Skip to content

Commit 010a343

Browse files
authored
Merge pull request #403 from dart-lang/merge-path-package
Merge `package:path`
2 parents 1a3e04e + ad17462 commit 010a343

35 files changed

+6290
-0
lines changed

.github/ISSUE_TEMPLATE/path.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
name: "package:path"
3+
about: "Create a bug or file a feature request against package:path."
4+
labels: "package:path"
5+
---

.github/labeler.yml

+4
Original file line numberDiff line numberDiff line change
@@ -31,3 +31,7 @@
3131
"package:os_detect":
3232
- changed-files:
3333
- any-glob-to-any-file: 'pkgs/os_detect/**'
34+
35+
"package:path":
36+
- changed-files:
37+
- any-glob-to-any-file: 'pkgs/path/**'

.github/workflows/path.yaml

+64
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
name: package:path
2+
3+
on:
4+
# Run CI on pushes to the main branch, and on PRs against main.
5+
push:
6+
branches: [ main ]
7+
paths:
8+
- '.github/workflows/path.yaml'
9+
- 'pkgs/path/**'
10+
pull_request:
11+
branches: [ main ]
12+
paths:
13+
- '.github/workflows/path.yaml'
14+
- 'pkgs/path/**'
15+
schedule:
16+
- cron: "0 0 * * 0"
17+
env:
18+
PUB_ENVIRONMENT: bot.github
19+
20+
defaults:
21+
run:
22+
working-directory: pkgs/path/
23+
24+
jobs:
25+
# Check code formatting and static analysis on a single OS (linux)
26+
# against Dart dev and stable.
27+
analyze:
28+
runs-on: ubuntu-latest
29+
strategy:
30+
fail-fast: false
31+
matrix:
32+
sdk: [dev]
33+
steps:
34+
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332
35+
- uses: dart-lang/setup-dart@0a8a0fc875eb934c15d08629302413c671d3f672
36+
with:
37+
sdk: ${{ matrix.sdk }}
38+
- id: install
39+
name: Install dependencies
40+
run: dart pub get
41+
- name: Check formatting
42+
run: dart format --output=none --set-exit-if-changed .
43+
if: always() && steps.install.outcome == 'success'
44+
- name: Analyze code
45+
run: dart analyze --fatal-infos
46+
if: always() && steps.install.outcome == 'success'
47+
48+
test:
49+
needs: analyze
50+
runs-on: ${{ matrix.os }}
51+
strategy:
52+
matrix:
53+
os: [ubuntu-latest]
54+
sdk: [3.4, dev]
55+
steps:
56+
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332
57+
- uses: dart-lang/setup-dart@0a8a0fc875eb934c15d08629302413c671d3f672
58+
with:
59+
sdk: ${{ matrix.sdk }}
60+
- run: dart pub get
61+
- run: dart test --platform vm,chrome
62+
- name: Run Chrome tests - wasm
63+
run: dart test --platform chrome --compiler dart2wasm
64+
if: always() && steps.install.outcome == 'success'

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ This repository is home to various Dart packages under the [dart.dev](https://pu
1616
| [fixnum](pkgs/fixnum/) | Library for 32- and 64-bit signed fixed-width integers. | [![pub package](https://img.shields.io/pub/v/fixnum.svg)](https://pub.dev/packages/fixnum) |
1717
| [logging](pkgs/logging/) | Provides APIs for debugging and error logging. | [![pub package](https://img.shields.io/pub/v/logging.svg)](https://pub.dev/packages/logging) |
1818
| [os_detect](pkgs/os_detect/) | Platform independent OS detection. | [![pub package](https://img.shields.io/pub/v/os_detect.svg)](https://pub.dev/packages/os_detect) |
19+
| [path](pkgs/path/) | A string-based path manipulation library for all of the path operations you know and love. | [![pub package](https://img.shields.io/pub/v/path.svg)](https://pub.dev/packages/path) |
1920

2021
## Publishing automation
2122

pkgs/path/.gitignore

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Don’t commit the following directories created by pub.
2+
.buildlog
3+
.pub/
4+
.dart_tool/
5+
.idea/
6+
build/
7+
.packages
8+
9+
# Or the files created by dart2js.
10+
*.dart.js
11+
*.js_
12+
*.js.deps
13+
*.js.map
14+
15+
# Include when developing application packages.
16+
pubspec.lock

pkgs/path/CHANGELOG.md

+186
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,186 @@
1+
## 1.9.1
2+
3+
- Require Dart 3.4
4+
- Move to `dart-lang/core` monorepo.
5+
6+
## 1.9.0
7+
8+
* Allow percent-encoded colons (`%3a`) in drive letters in `fromUri`.
9+
* Fixed an issue with the `split` method doc comment.
10+
* Require Dart 3.0
11+
12+
## 1.8.3
13+
14+
* Support up to 16 arguments in join function and up to 15 arguments in absolute function.
15+
16+
## 1.8.2
17+
18+
* Enable the `avoid_dynamic_calls` lint.
19+
* Populate the pubspec `repository` field.
20+
21+
## 1.8.1
22+
23+
* Don't crash when an empty string is passed to `toUri()`.
24+
25+
## 1.8.0
26+
27+
* Stable release for null safety.
28+
29+
## 1.8.0-nullsafety.3
30+
31+
* Update SDK constraints to `>=2.12.0-0 <3.0.0` based on beta release
32+
guidelines.
33+
34+
## 1.8.0-nullsafety.2
35+
36+
* Allow prerelease versions of the 2.12 sdk.
37+
38+
## 1.8.0-nullsafety.1
39+
40+
* Allow 2.10 stable and 2.11.0 dev SDK versions.
41+
42+
## 1.8.0-nullsafety
43+
44+
* Migrate to null safety.
45+
46+
## 1.7.0
47+
48+
* Add support for multiple extension in `context.extension()`.
49+
50+
## 1.6.4
51+
52+
* Fixed a number of lints that affect the package health score.
53+
54+
* Added an example.
55+
56+
## 1.6.3
57+
58+
* Don't throw a FileSystemException from `current` if the working directory has
59+
been deleted, but we have a cached one we can use.
60+
61+
## 1.6.2
62+
63+
* Set max SDK version to `<3.0.0`, and adjust other dependencies.
64+
65+
## 1.6.1
66+
67+
* Drop the `retype` implementation for compatibility with the latest SDK.
68+
69+
## 1.6.0
70+
71+
* Add a `PathMap` class that uses path equality for its keys.
72+
73+
* Add a `PathSet` class that uses path equality for its contents.
74+
75+
## 1.5.1
76+
77+
* Fix a number of bugs that occurred when the current working directory was `/`
78+
on Linux or Mac OS.
79+
80+
## 1.5.0
81+
82+
* Add a `setExtension()` top-level function and `Context` method.
83+
84+
## 1.4.2
85+
86+
* Treat `package:` URLs as absolute.
87+
88+
* Normalize `c:\foo\.` to `c:\foo`.
89+
90+
## 1.4.1
91+
92+
* Root-relative URLs like `/foo` are now resolved relative to the drive letter
93+
for `file` URLs that begin with a Windows-style drive letter. This matches the
94+
[WHATWG URL specification][].
95+
96+
[WHATWG URL specification]: https://url.spec.whatwg.org/#file-slash-state
97+
98+
* When a root-relative URLs like `/foo` is converted to a Windows path using
99+
`fromUrl()`, it is now resolved relative to the drive letter. This matches
100+
IE's behavior.
101+
102+
## 1.4.0
103+
104+
* Add `equals()`, `hash()` and `canonicalize()` top-level functions and
105+
`Context` methods. These make it easier to treat paths as map keys.
106+
107+
* Properly compare Windows paths case-insensitively.
108+
109+
* Further improve the performance of `isWithin()`.
110+
111+
## 1.3.9
112+
113+
* Further improve the performance of `isWithin()` when paths contain `/.`
114+
sequences that aren't `/../`.
115+
116+
## 1.3.8
117+
118+
* Improve the performance of `isWithin()` when the paths don't contain
119+
asymmetrical `.` or `..` components.
120+
121+
* Improve the performance of `relative()` when `from` is `null` and the path is
122+
already relative.
123+
124+
* Improve the performance of `current` when the current directory hasn't
125+
changed.
126+
127+
## 1.3.7
128+
129+
* Improve the performance of `absolute()` and `normalize()`.
130+
131+
## 1.3.6
132+
133+
* Ensure that `path.toUri` preserves trailing slashes for relative paths.
134+
135+
## 1.3.5
136+
137+
* Added type annotations to top-level and static fields.
138+
139+
## 1.3.4
140+
141+
* Fix dev_compiler warnings.
142+
143+
## 1.3.3
144+
145+
* Performance improvement in `Context.relative` - don't call `current` if `from`
146+
is not relative.
147+
148+
## 1.3.2
149+
150+
* Fix some analyzer hints.
151+
152+
## 1.3.1
153+
154+
* Add a number of performance improvements.
155+
156+
## 1.3.0
157+
158+
* Expose a top-level `context` field that provides access to a `Context` object
159+
for the current system.
160+
161+
## 1.2.3
162+
163+
* Don't cache path Context based on cwd, as cwd involves a system-call to
164+
compute.
165+
166+
## 1.2.2
167+
168+
* Remove the documentation link from the pubspec so this is linked to
169+
pub.dev by default.
170+
171+
# 1.2.1
172+
173+
* Many members on `Style` that provided access to patterns and functions used
174+
internally for parsing paths have been deprecated.
175+
176+
* Manually parse paths (rather than using RegExps to do so) for better
177+
performance.
178+
179+
# 1.2.0
180+
181+
* Added `path.prettyUri`, which produces a human-readable representation of a
182+
URI.
183+
184+
# 1.1.0
185+
186+
* `path.fromUri` now accepts strings as well as `Uri` objects.

pkgs/path/LICENSE

+27
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.

0 commit comments

Comments
 (0)