Skip to content

Commit 83147e4

Browse files
committed
Merge package:watcher into the tools monorepo
2 parents 5590447 + 0086fea commit 83147e4

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+4284
-0
lines changed

pkgs/watcher/.github/dependabot.yaml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Dependabot configuration file.
2+
version: 2
3+
4+
updates:
5+
- package-ecosystem: github-actions
6+
directory: /
7+
schedule:
8+
interval: monthly
9+
labels:
10+
- autosubmit
11+
groups:
12+
github-actions:
13+
patterns:
14+
- "*"
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# A workflow to close issues where the author hasn't responded to a request for
2+
# more information; see https://github.com/actions/stale.
3+
4+
name: No Response
5+
6+
# Run as a daily cron.
7+
on:
8+
schedule:
9+
# Every day at 8am
10+
- cron: '0 8 * * *'
11+
12+
# All permissions not specified are set to 'none'.
13+
permissions:
14+
issues: write
15+
pull-requests: write
16+
17+
jobs:
18+
no-response:
19+
runs-on: ubuntu-latest
20+
if: ${{ github.repository_owner == 'dart-lang' }}
21+
steps:
22+
- uses: actions/stale@28ca1036281a5e5922ead5184a1bbf96e5fc984e
23+
with:
24+
# Don't automatically mark inactive issues+PRs as stale.
25+
days-before-stale: -1
26+
# Close needs-info issues and PRs after 14 days of inactivity.
27+
days-before-close: 14
28+
stale-issue-label: "needs-info"
29+
close-issue-message: >
30+
Without additional information we're not able to resolve this issue.
31+
Feel free to add more info or respond to any questions above and we
32+
can reopen the case. Thanks for your contribution!
33+
stale-pr-label: "needs-info"
34+
close-pr-message: >
35+
Without additional information we're not able to resolve this PR.
36+
Feel free to add more info or respond to any questions above.
37+
Thanks for your contribution!
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# A CI configuration to auto-publish pub packages.
2+
3+
name: Publish
4+
5+
on:
6+
pull_request:
7+
branches: [ master ]
8+
push:
9+
tags: [ 'v[0-9]+.[0-9]+.[0-9]+' ]
10+
11+
jobs:
12+
publish:
13+
if: ${{ github.repository_owner == 'dart-lang' }}
14+
uses: dart-lang/ecosystem/.github/workflows/publish.yaml@main
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
name: Dart CI
2+
3+
on:
4+
# Run on PRs and pushes to the default branch.
5+
push:
6+
branches: [ master ]
7+
pull_request:
8+
branches: [ master ]
9+
schedule:
10+
- cron: "0 0 * * 0"
11+
12+
env:
13+
PUB_ENVIRONMENT: bot.github
14+
15+
jobs:
16+
# Check code formatting and static analysis on a single OS (linux)
17+
# against Dart dev.
18+
analyze:
19+
runs-on: ubuntu-latest
20+
strategy:
21+
fail-fast: false
22+
matrix:
23+
sdk: [dev]
24+
steps:
25+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
26+
- uses: dart-lang/setup-dart@e630b99d28a3b71860378cafdc2a067c71107f94
27+
with:
28+
sdk: ${{ matrix.sdk }}
29+
- id: install
30+
name: Install dependencies
31+
run: dart pub get
32+
- name: Check formatting
33+
run: dart format --output=none --set-exit-if-changed .
34+
if: always() && steps.install.outcome == 'success'
35+
- name: Analyze code
36+
run: dart analyze --fatal-infos
37+
if: always() && steps.install.outcome == 'success'
38+
39+
# Run tests on a matrix consisting of two dimensions:
40+
# 1. OS: ubuntu-latest, macos-latest, windows-latest
41+
# 2. release channel: dev
42+
test:
43+
needs: analyze
44+
runs-on: ${{ matrix.os }}
45+
strategy:
46+
fail-fast: false
47+
matrix:
48+
os: [ubuntu-latest, macos-latest, windows-latest]
49+
sdk: [3.1, dev]
50+
steps:
51+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
52+
- uses: dart-lang/setup-dart@e630b99d28a3b71860378cafdc2a067c71107f94
53+
with:
54+
sdk: ${{ matrix.sdk }}
55+
- id: install
56+
name: Install dependencies
57+
run: dart pub get
58+
- name: Run VM tests
59+
run: dart test --platform vm
60+
if: always() && steps.install.outcome == 'success'

pkgs/watcher/.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Don’t commit the following directories created by pub.
2+
.dart_tool
3+
.packages
4+
pubspec.lock

pkgs/watcher/.test_config

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"test_package": {
3+
"platforms": ["vm"]
4+
}
5+
}

pkgs/watcher/CHANGELOG.md

Lines changed: 129 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,129 @@
1+
## 1.1.1-wip
2+
3+
- Ensure `PollingFileWatcher.ready` completes for files that do not exist.
4+
- Require Dart SDK `^3.1.0`
5+
6+
## 1.1.0
7+
8+
- Require Dart SDK >= 3.0.0
9+
- Remove usage of redundant ConstructableFileSystemEvent classes.
10+
11+
## 1.0.3-dev
12+
13+
- Require Dart SDK >= 2.19
14+
15+
## 1.0.2
16+
17+
- Require Dart SDK >= 2.14
18+
- Ensure `DirectoryWatcher.ready` completes even when errors occur that close the watcher.
19+
- Add markdown badges to the readme.
20+
21+
## 1.0.1
22+
23+
* Drop package:pedantic and use package:lints instead.
24+
25+
## 1.0.0
26+
27+
* Require Dart SDK >= 2.12
28+
* Add the ability to create custom Watcher types for specific file paths.
29+
30+
## 0.9.7+15
31+
32+
* Fix a bug on Mac where modifying a directory with a path exactly matching a
33+
prefix of a modified file would suppress change events for that file.
34+
35+
## 0.9.7+14
36+
37+
* Prepare for breaking change in SDK where modified times for not found files
38+
becomes meaningless instead of null.
39+
40+
## 0.9.7+13
41+
42+
* Catch & forward `FileSystemException` from unexpectedly closed file watchers
43+
on windows; the watcher will also be automatically restarted when this occurs.
44+
45+
## 0.9.7+12
46+
47+
* Catch `FileSystemException` during `existsSync()` on Windows.
48+
* Internal cleanup.
49+
50+
## 0.9.7+11
51+
52+
* Fix an analysis hint.
53+
54+
## 0.9.7+10
55+
56+
* Set max SDK version to `<3.0.0`, and adjust other dependencies.
57+
58+
## 0.9.7+9
59+
60+
* Internal changes only.
61+
62+
## 0.9.7+8
63+
64+
* Fix Dart 2.0 type issues on Mac and Windows.
65+
66+
## 0.9.7+7
67+
68+
* Updates to support Dart 2.0 core library changes (wave 2.2).
69+
See [issue 31847][sdk#31847] for details.
70+
71+
[sdk#31847]: https://github.com/dart-lang/sdk/issues/31847
72+
73+
74+
## 0.9.7+6
75+
76+
* Internal changes only, namely removing dep on scheduled test.
77+
78+
## 0.9.7+5
79+
80+
* Fix an analysis warning.
81+
82+
## 0.9.7+4
83+
84+
* Declare support for `async` 2.0.0.
85+
86+
## 0.9.7+3
87+
88+
* Fix a crashing bug on Linux.
89+
90+
## 0.9.7+2
91+
92+
* Narrow the constraint on `async` to reflect the APIs this package is actually
93+
using.
94+
95+
## 0.9.7+1
96+
97+
* Fix all strong-mode warnings.
98+
99+
## 0.9.7
100+
101+
* Fix a bug in `FileWatcher` where events could be added after watchers were
102+
closed.
103+
104+
## 0.9.6
105+
106+
* Add a `Watcher` interface that encompasses watching both files and
107+
directories.
108+
109+
* Add `FileWatcher` and `PollingFileWatcher` classes for watching changes to
110+
individual files.
111+
112+
* Deprecate `DirectoryWatcher.directory`. Use `DirectoryWatcher.path` instead.
113+
114+
## 0.9.5
115+
116+
* Fix bugs where events could be added after watchers were closed.
117+
118+
## 0.9.4
119+
120+
* Treat add events for known files as modifications instead of discarding them
121+
on Mac OS.
122+
123+
## 0.9.3
124+
125+
* Improved support for Windows via `WindowsDirectoryWatcher`.
126+
127+
* Simplified `PollingDirectoryWatcher`.
128+
129+
* Fixed bugs in `MacOSDirectoryWatcher`

pkgs/watcher/LICENSE

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
Copyright 2014, 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/watcher/README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
[![Dart CI](https://github.com/dart-lang/watcher/actions/workflows/test-package.yml/badge.svg)](https://github.com/dart-lang/watcher/actions/workflows/test-package.yml)
2+
[![pub package](https://img.shields.io/pub/v/watcher.svg)](https://pub.dev/packages/watcher)
3+
[![package publisher](https://img.shields.io/pub/publisher/watcher.svg)](https://pub.dev/packages/watcher/publisher)
4+
5+
A file system watcher.
6+
7+
## What's this?
8+
9+
`package:watcher` monitors changes to contents of directories and sends
10+
notifications when files have been added, removed, or modified.

pkgs/watcher/analysis_options.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
include: package:dart_flutter_team_lints/analysis_options.yaml

0 commit comments

Comments
 (0)