Skip to content

Commit ded28a4

Browse files
authored
Skeleton for package:io_file (#196)
1 parent ab6d9cc commit ded28a4

File tree

11 files changed

+188
-0
lines changed

11 files changed

+188
-0
lines changed

.github/workflows/io_file.yml

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
name: package:io_file
2+
3+
permissions: read-all
4+
5+
on:
6+
# Run CI on pushes to the main branch, and on PRs against main.
7+
push:
8+
branches: [ main ]
9+
paths:
10+
- '.github/workflows/io_file.yml'
11+
- 'pkgs/io_file/**'
12+
pull_request:
13+
branches: [ main ]
14+
paths:
15+
- '.github/workflows/io_file.yml'
16+
- 'pkgs/io_file/**'
17+
schedule:
18+
- cron: '0 0 * * 0' # weekly
19+
20+
defaults:
21+
run:
22+
working-directory: pkgs/io_file
23+
24+
jobs:
25+
analyze_and_format:
26+
runs-on: ubuntu-latest
27+
steps:
28+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
29+
- uses: dart-lang/setup-dart@e51d8e571e22473a2ddebf0ef8a2123f0ab2c02c
30+
with:
31+
sdk: stable
32+
- run: dart pub get
33+
- run: dart analyze --fatal-infos
34+
- run: dart format --output=none --set-exit-if-changed .
35+
36+
desktop-vm-test:
37+
strategy:
38+
fail-fast: false
39+
matrix:
40+
sdk: [stable, dev]
41+
os: [ubuntu-latest, windows-latest, macos-latest]
42+
runs-on: ${{ matrix.os }}
43+
steps:
44+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
45+
- uses: dart-lang/setup-dart@e51d8e571e22473a2ddebf0ef8a2123f0ab2c02c
46+
with:
47+
sdk: ${{ matrix.sdk }}
48+
49+
- run: dart test --test-randomize-ordering-seed=random --platform vm
50+
51+
web-test:
52+
runs-on: ubuntu-latest
53+
steps:
54+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
55+
- uses: dart-lang/setup-dart@e51d8e571e22473a2ddebf0ef8a2123f0ab2c02c
56+
with:
57+
sdk: stable
58+
59+
- run: dart test --test-randomize-ordering-seed=random --platform chrome

pkgs/io_file/.gitignore

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# https://dart.dev/guides/libraries/private-files
2+
# Created by `dart pub`
3+
.dart_tool/
4+
5+
# Avoid committing pubspec.lock for library packages; see
6+
# https://dart.dev/guides/libraries/private-files#pubspeclock.
7+
pubspec.lock

pkgs/io_file/CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
## 0.1.0-wip
2+
3+
- Initial version.

pkgs/io_file/LICENSE

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
Copyright 2025, the Dart project authors.
2+
3+
Redistribution and use in source and binary forms, with or without
4+
modification, are permitted provided that the following conditions are
5+
met:
6+
7+
* Redistributions of source code must retain the above copyright
8+
notice, this list of conditions and the following disclaimer.
9+
* Redistributions in binary form must reproduce the above
10+
copyright notice, this list of conditions and the following
11+
disclaimer in the documentation and/or other materials provided
12+
with the distribution.
13+
* Neither the name of Google LLC nor the names of its
14+
contributors may be used to endorse or promote products derived
15+
from this software without specific prior written permission.
16+
17+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
18+
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
19+
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
20+
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
21+
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
22+
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
23+
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
24+
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
25+
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26+
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
27+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

pkgs/io_file/README.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
This package is an **experimental** reimplementation of the `dart:io` file
2+
system API using FFI.
3+
4+
See
5+
[package:io_file - a pure dart file system API](https://docs.google.com/document/d/17dPegdklLKQz4fjrRDHaN0ld7FlmK0prncZQUTx68nk/edit?usp=sharing)
6+
7+
## Status: Experimental
8+
9+
**NOTE**: This package is currently experimental and published under the
10+
[labs.dart.dev](https://dart.dev/dart-team-packages) pub publisher in order to
11+
solicit feedback.
12+
13+
For packages in the labs.dart.dev publisher we generally plan to either graduate
14+
the package into a supported publisher (dart.dev, tools.dart.dev) after a period
15+
of feedback and iteration, or discontinue the package. These packages have a
16+
much higher expected rate of API and breaking changes.
17+
18+
Your feedback is valuable and will help us evolve this package. For general
19+
feedback, suggestions, and comments, please file an issue in the
20+
[bug tracker](https://github.com/dart-lang/labs/issues).
21+

pkgs/io_file/analysis_options.yaml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
include: package:dart_flutter_team_lints/analysis_options.yaml
2+
3+
analyzer:
4+
language:
5+
strict-casts: true
6+
strict-raw-types: true
7+
strict-inference: true
8+
9+
linter:
10+
rules:
11+
- avoid_bool_literals_in_conditional_expressions
12+
- avoid_classes_with_only_static_members
13+
- avoid_private_typedef_functions
14+
- avoid_returning_this
15+
- avoid_unused_constructor_parameters
16+
- cascade_invocations
17+
- join_return_with_assignment
18+
- missing_whitespace_between_adjacent_strings
19+
- no_adjacent_strings_in_list
20+
- no_runtimeType_toString
21+
- prefer_const_declarations
22+
- prefer_expression_function_bodies
23+
- use_string_buffers
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import 'package:io_file/io_file.dart';
2+
3+
void main() {
4+
var awesome = Awesome();
5+
print('awesome: ${awesome.isAwesome}');
6+
}

pkgs/io_file/lib/io_file.dart

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
/// Support for doing something awesome.
2+
///
3+
/// More dartdocs go here.
4+
library;
5+
6+
export 'src/io_file_base.dart';
7+
8+
// TODO: Export any libraries intended for clients of this package.
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
// TODO: Put public facing types in this file.
2+
3+
/// Checks if you are awesome. Spoiler: you are.
4+
class Awesome {
5+
bool get isAwesome => true;
6+
}

pkgs/io_file/pubspec.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
name: io_file
2+
description: A starting point for Dart libraries or applications.
3+
version: 0.1.0-wip
4+
repository: https://github.com/dart-lang/labs/tree/main/pkgs/io_file
5+
publish_to: none
6+
7+
environment:
8+
sdk: ^3.7.0
9+
10+
dev_dependencies:
11+
dart_flutter_team_lints: ^3.4.0
12+
test: ^1.24.0

0 commit comments

Comments
 (0)