-
Notifications
You must be signed in to change notification settings - Fork 5
Skeleton for package:io_file
#196
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
Changes from all commits
2d89661
099cbf8
e607ebf
db8bfd6
6da7153
24f5a18
8a25541
eb9079d
eb8a8d3
4a0e92e
ca85e05
d5508c2
feef57a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
name: package:io_file | ||
|
||
permissions: read-all | ||
|
||
on: | ||
# Run CI on pushes to the main branch, and on PRs against main. | ||
push: | ||
branches: [ main ] | ||
paths: | ||
- '.github/workflows/io_file.yml' | ||
- 'pkgs/io_file/**' | ||
pull_request: | ||
branches: [ main ] | ||
paths: | ||
- '.github/workflows/io_file.yml' | ||
- 'pkgs/io_file/**' | ||
schedule: | ||
- cron: '0 0 * * 0' # weekly | ||
|
||
defaults: | ||
run: | ||
working-directory: pkgs/io_file | ||
|
||
jobs: | ||
analyze_and_format: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 | ||
- uses: dart-lang/setup-dart@e51d8e571e22473a2ddebf0ef8a2123f0ab2c02c | ||
with: | ||
sdk: stable | ||
- run: dart pub get | ||
- run: dart analyze --fatal-infos | ||
- run: dart format --output=none --set-exit-if-changed . | ||
|
||
desktop-vm-test: | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
sdk: [stable, dev] | ||
os: [ubuntu-latest, windows-latest, macos-latest] | ||
runs-on: ${{ matrix.os }} | ||
steps: | ||
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 | ||
- uses: dart-lang/setup-dart@e51d8e571e22473a2ddebf0ef8a2123f0ab2c02c | ||
with: | ||
sdk: ${{ matrix.sdk }} | ||
|
||
- run: dart test --test-randomize-ordering-seed=random --platform vm | ||
|
||
web-test: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 | ||
- uses: dart-lang/setup-dart@e51d8e571e22473a2ddebf0ef8a2123f0ab2c02c | ||
with: | ||
sdk: stable | ||
|
||
- run: dart test --test-randomize-ordering-seed=random --platform chrome |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# https://dart.dev/guides/libraries/private-files | ||
# Created by `dart pub` | ||
.dart_tool/ | ||
|
||
# Avoid committing pubspec.lock for library packages; see | ||
# https://dart.dev/guides/libraries/private-files#pubspeclock. | ||
pubspec.lock |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
## 0.1.0-wip | ||
|
||
- Initial version. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
Copyright 2025, the Dart project authors. | ||
|
||
Redistribution and use in source and binary forms, with or without | ||
modification, are permitted provided that the following conditions are | ||
met: | ||
|
||
* Redistributions of source code must retain the above copyright | ||
notice, this list of conditions and the following disclaimer. | ||
* Redistributions in binary form must reproduce the above | ||
copyright notice, this list of conditions and the following | ||
disclaimer in the documentation and/or other materials provided | ||
with the distribution. | ||
* Neither the name of Google LLC nor the names of its | ||
contributors may be used to endorse or promote products derived | ||
from this software without specific prior written permission. | ||
|
||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | ||
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | ||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | ||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | ||
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | ||
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | ||
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | ||
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | ||
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | ||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
This package is an **experimental** reimplementation of the `dart:io` file | ||
system API using FFI. | ||
|
||
See | ||
[package:io_file - a pure dart file system API](https://docs.google.com/document/d/17dPegdklLKQz4fjrRDHaN0ld7FlmK0prncZQUTx68nk/edit?usp=sharing) | ||
|
||
## Status: Experimental | ||
|
||
**NOTE**: This package is currently experimental and published under the | ||
[labs.dart.dev](https://dart.dev/dart-team-packages) pub publisher in order to | ||
solicit feedback. | ||
|
||
For packages in the labs.dart.dev publisher we generally plan to either graduate | ||
the package into a supported publisher (dart.dev, tools.dart.dev) after a period | ||
of feedback and iteration, or discontinue the package. These packages have a | ||
much higher expected rate of API and breaking changes. | ||
|
||
Your feedback is valuable and will help us evolve this package. For general | ||
feedback, suggestions, and comments, please file an issue in the | ||
[bug tracker](https://github.com/dart-lang/labs/issues). | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
include: package:dart_flutter_team_lints/analysis_options.yaml | ||
|
||
analyzer: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do you need / want this customization? You could also start w/ just dart_flutter_team_lints. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I copied these from dart-lang/http. They seem reasonable to me. |
||
language: | ||
strict-casts: true | ||
strict-raw-types: true | ||
strict-inference: true | ||
|
||
linter: | ||
rules: | ||
- avoid_bool_literals_in_conditional_expressions | ||
- avoid_classes_with_only_static_members | ||
- avoid_private_typedef_functions | ||
- avoid_returning_this | ||
- avoid_unused_constructor_parameters | ||
- cascade_invocations | ||
- join_return_with_assignment | ||
- missing_whitespace_between_adjacent_strings | ||
- no_adjacent_strings_in_list | ||
- no_runtimeType_toString | ||
- prefer_const_declarations | ||
- prefer_expression_function_bodies | ||
- use_string_buffers |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import 'package:io_file/io_file.dart'; | ||
|
||
void main() { | ||
var awesome = Awesome(); | ||
print('awesome: ${awesome.isAwesome}'); | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
/// Support for doing something awesome. | ||
/// | ||
/// More dartdocs go here. | ||
library; | ||
|
||
export 'src/io_file_base.dart'; | ||
|
||
// TODO: Export any libraries intended for clients of this package. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
// TODO: Put public facing types in this file. | ||
|
||
/// Checks if you are awesome. Spoiler: you are. | ||
class Awesome { | ||
bool get isAwesome => true; | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
name: io_file | ||
description: A starting point for Dart libraries or applications. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You might want to update this description now (and the corresponding one on the root repo readme). |
||
version: 0.1.0-wip | ||
repository: https://github.com/dart-lang/labs/tree/main/pkgs/io_file | ||
publish_to: none | ||
|
||
brianquinlan marked this conversation as resolved.
Show resolved
Hide resolved
|
||
environment: | ||
sdk: ^3.7.0 | ||
|
||
dev_dependencies: | ||
dart_flutter_team_lints: ^3.4.0 | ||
test: ^1.24.0 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import 'package:io_file/io_file.dart'; | ||
import 'package:test/test.dart'; | ||
|
||
void main() { | ||
group('A group of tests', () { | ||
final awesome = Awesome(); | ||
|
||
setUp(() { | ||
// Additional setup goes here. | ||
}); | ||
|
||
test('First Test', () { | ||
expect(awesome.isAwesome, isTrue); | ||
}); | ||
}); | ||
} |
Uh oh!
There was an error while loading. Please reload this page.