-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
transfer package:file, package:file_testing #598
Conversation
Add README, fix c9.sh. Checkpoint. Initial new pass. Override.
Fix badge.
feat: sync file system; more tests; stricter code analysis
feat: allow sharing backing store across in-memory file systems
Fix strong mode issues, enforce dartfmt.
* v.next interface for package:file/file.dart This changes the interface to chiefly expose the FileSystem abstraction and deal in native dart:io types where at all possible: - Expose all dart:io file-system static methods as instance methods on `FileSystem`, to allow injectable implementations (e.g. in-memory, local, mock, etc.) - Create FileSystemEntity, File, Directory, Link as abstract classes that implement their native counterparts and add any extra methods we choose in this library (initially, only `get fileSystem => Filesystem`) By going this route, it implies that each FileSystem implementation will need to provide types that implement both the sync and async APIs (since they implement the interfaces in native dart:io). However, I still plan to provide SynchronousFileSystem & AsynchronousFileSystem, which will simply throw UnsupportedError for the APIs they don't support. This change will allow existing libraries/apps to seamlessly start using FileSystem as a drop-in replacement for existing direct dart:io usage.
This implements most of the in-memory file system. The only part that's not complete is memory_file.dart. The rest of the impl, plus tests, will follow for both the in-memory implementation and the local backend in an upcoming change.
This completes the implementation of the in-memory FileSystem backend. Next change will add tests.
- Add stub tests for Directory. Please review for coverage; impl will come later - Rename tests to follow common pattern - Fix some cases where we weren't matching the behavior of dart:io libraries
Move memory tests to common tests. This change prepares us to be able to run all file system tests against multiple implementations of the interface. The goal is to be able to test the local file system impl against all tests, and run the exact same tests against the in-memory impl, thus ensuring (a) the in-memory impl has test coverage, and (b) that it behaves identical in its API to the local dart:io variant. This change does not touch any code - just restructures things.
This change uses conditional imports to support browser-based Dart usage of this package. For non-VM users, this will export the subset of the dart:io interface that is required by this package, whereas VM users will simply get dart:io itself.
Apply dartfmt straight from the SDK.
…ile#21) These classes will also be the basis of a ChrootFileSystem, which is forthcoming.
- Add ChrootFileSystem. - Wire up local_test.dart to use it
While the original intent of ChrootFileSystem was inspired by the idea that we could use it to test LocalFileSystem (chroot'ed to a tmp folder), it turns out that ChrootFileSystem adds too much abstraction and gets in the way of actually testing LocalFileSystem. ChrootFileSystem is still valuable in its own right, but this change updates local_test.dart to test LocalFileSystem without the need for ChrootFileSystem, by factoring common_tests.dart to accept a root folder argument and do all its work in that folder.
* Make `FileSystem.isLink` actually work `FileSystem.isLink` called `FileSystem.type` with the default argument of `followLinks: true`. This is obviously wrong since it would mean that `isLink` would never return true (except maybe for broken symbolic links). Make `FileSystem.isLink` use `followLinks: false`. This is what `dart:io`'s `FileSystemEntity.isLink` is documented to do. Partially addresses https://github.com/google/file.dart/issues/8. * Reorganize isFile/isDirectory/isLink tests Reorganize the isFile/isDirectory/isLink tests so that the test names are more appropriate.
…g/file#213) * Fix MemoryFileSystem to treat an empty path as non-existent `_MemoryFileSystem.findNode` returns `reference?.directory` if given the root path or an empty path. However, an empty path should be treated as non-existent, not as a directory. Instead explicitly return `null` as a special case when given an empty path. Partially addresses https://github.com/google/file.dart/issues/198. * Make _MemoryFileSystem._current nullable
Route stream errors to the stream completer rather than the file completer. Fixes dart-lang/file#219
…int>> again (dart-lang/file#217) * Make MemoryFile.openRead and _ChrootFile.openRead return Stream<List<int>> again This is equivalent to dart-archive/file.dart#168, but I foolishly neglected to make corresponding changes for all file system types. Fixes https://github.com/google/file.dart/issues/193. * Apply suggestions from natebosch Co-authored-by: Nate Bosch <[email protected]> --------- Co-authored-by: Nate Bosch <[email protected]>
Bumps [actions/checkout](https://github.com/actions/checkout) from 3.5.2 to 3.6.0. - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](actions/checkout@8e5e7e5...f43a0e5) --- updated-dependencies: - dependency-name: actions/checkout dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [dart-lang/setup-dart](https://github.com/dart-lang/setup-dart) from 1.5.0 to 1.6.0. - [Release notes](https://github.com/dart-lang/setup-dart/releases) - [Changelog](https://github.com/dart-lang/setup-dart/blob/main/CHANGELOG.md) - [Commits](dart-lang/setup-dart@d6a63da...b64355a) --- updated-dependencies: - dependency-name: dart-lang/setup-dart dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [actions/checkout](https://github.com/actions/checkout) from 3.6.0 to 4.1.1. - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](actions/checkout@f43a0e5...b4ffde6) --- updated-dependencies: - dependency-name: actions/checkout dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [dart-lang/setup-dart](https://github.com/dart-lang/setup-dart) from 1.6.0 to 1.6.2. - [Release notes](https://github.com/dart-lang/setup-dart/releases) - [Changelog](https://github.com/dart-lang/setup-dart/blob/main/CHANGELOG.md) - [Commits](dart-lang/setup-dart@b64355a...fedb126) --- updated-dependencies: - dependency-name: dart-lang/setup-dart dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [actions/checkout](https://github.com/actions/checkout) from 4.1.1 to 4.1.2. - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](actions/checkout@b4ffde6...9bb5618) --- updated-dependencies: - dependency-name: actions/checkout dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [actions/checkout](https://github.com/actions/checkout) from 4.1.2 to 4.1.4. - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](actions/checkout@9bb5618...0ad4b8f) --- updated-dependencies: - dependency-name: actions/checkout dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [dart-lang/setup-dart](https://github.com/dart-lang/setup-dart) from 1.6.2 to 1.6.4. - [Release notes](https://github.com/dart-lang/setup-dart/releases) - [Changelog](https://github.com/dart-lang/setup-dart/blob/main/CHANGELOG.md) - [Commits](dart-lang/setup-dart@fedb126...f0ead98) --- updated-dependencies: - dependency-name: dart-lang/setup-dart dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [actions/checkout](https://github.com/actions/checkout) from 4.1.4 to 4.1.6. - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](actions/checkout@0ad4b8f...a5ac7e5) --- updated-dependencies: - dependency-name: actions/checkout dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [dart-lang/setup-dart](https://github.com/dart-lang/setup-dart) from 1.6.4 to 1.6.5. - [Release notes](https://github.com/dart-lang/setup-dart/releases) - [Changelog](https://github.com/dart-lang/setup-dart/blob/main/CHANGELOG.md) - [Commits](dart-lang/setup-dart@f0ead98...0a8a0fc) --- updated-dependencies: - dependency-name: dart-lang/setup-dart dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [actions/checkout](https://github.com/actions/checkout) from 4.1.6 to 4.1.7. - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](actions/checkout@a5ac7e5...692973e) --- updated-dependencies: - dependency-name: actions/checkout dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [actions/checkout](https://github.com/actions/checkout) from 4.1.7 to 4.2.0. - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](actions/checkout@692973e...d632683) --- updated-dependencies: - dependency-name: actions/checkout dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
PR HealthChangelog Entry ✔️
Changes to files need to be accounted for in their respective changelogs. API leaks ✔️The following packages contain symbols visible in the public API, but not exported by the library. Export these symbols or remove them from your publicly visible API.
License Headers ✔️
All source files should start with a license header. Package publish validation ✔️
Documentation at https://github.com/dart-lang/ecosystem/wiki/Publishing-automation. |
git tag --list 'file*' | xargs git push origin
dart run pkgs/repo_manage/bin/report.dart transfer-issues --source-repo dart-lang/file --target-repo dart-lang/tools --add-label package:file --apply-changes
Contribution guidelines:
dart format
.Note that many Dart repos have a weekly cadence for reviewing PRs - please allow for some latency before initial review feedback.