Skip to content

Commit ae343c1

Browse files
BoshenSoonIter
authored andcommitted
chore: rebase
1 parent fffde99 commit ae343c1

26 files changed

Lines changed: 216 additions & 126 deletions

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ jobs:
9494
steps:
9595
- uses: taiki-e/checkout-action@v1
9696

97-
- uses: crate-ci/typos@v1.23.6
97+
- uses: crate-ci/typos@v1.26.0
9898
with:
9999
files: .
100100

.github/workflows/release-plz.yml

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@ on:
55
push:
66
branches:
77
- main
8-
paths:
9-
- Cargo.toml
108

119
permissions:
1210
pull-requests: write
@@ -27,9 +25,31 @@ jobs:
2725
cache-key: warm
2826

2927
- name: Run release-plz
28+
id: release-plz
3029
uses: MarcoIeni/release-plz-action@v0.5
31-
with:
32-
command: release
3330
env:
3431
GITHUB_TOKEN: ${{ secrets.RELEASE_PLZ_TOKEN }}
3532
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
33+
34+
- name: Bump package.json
35+
if: ${{ steps.release-plz.outputs.prs_created }}
36+
env:
37+
GH_TOKEN: ${{ github.token }}
38+
RELEASES: ${{ steps.release-plz.outputs.releases }}
39+
PR: ${{ steps.release-plz.outputs.pr }}
40+
run: |
41+
set -e
42+
43+
pr_number=${{ fromJSON(steps.release-plz.outputs.pr).number }}
44+
if [[ -n "$pr_number" ]]; then
45+
version=$(echo "$RELEASES" | jq -r '.[0].version')
46+
echo "version: $version"
47+
48+
jq --arg version "${version}" '.version = ($version)' npm/package.json > tmp
49+
mv tmp npm/package.json
50+
51+
gh pr checkout $pr_number
52+
git add .
53+
git commit -m "Update package.json"
54+
git push
55+
fi

.typos.toml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# https://github.com/crate-ci/typos
2+
# cargo install typos-cli
3+
# typos
4+
5+
[files]
6+
extend-exclude = [
7+
"CHANGELOG.md",
8+
]

CHANGELOG.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,20 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
66

77
## [Unreleased]
88

9+
## [1.12.0](https://github.com/oxc-project/oxc_resolver/compare/oxc_resolver-v1.11.0...oxc_resolver-v1.12.0) - 2024-09-25
10+
11+
### Added
12+
13+
- [**breaking**] mark `ResolveError` #[non_exhaustive] ([#252](https://github.com/oxc-project/oxc_resolver/pull/252))
14+
- show tried extension aliases in `ResolveError::ExtensionAlias` ([#251](https://github.com/oxc-project/oxc_resolver/pull/251))
15+
- give a specific error for matched alias not found ([#238](https://github.com/oxc-project/oxc_resolver/pull/238))
16+
17+
## [1.11.0](https://github.com/oxc-project/oxc_resolver/compare/oxc_resolver-v1.10.2...oxc_resolver-v1.11.0) - 2024-08-26
18+
19+
### Added
20+
- use simdutf8 to validate UTF-8 when reading files ([#237](https://github.com/oxc-project/oxc_resolver/pull/237))
21+
- Yarn PnP (behind a feature flag) ([#217](https://github.com/oxc-project/oxc_resolver/pull/217))
22+
923
## [1.10.2](https://github.com/oxc-project/oxc_resolver/compare/oxc_resolver-v1.10.1...oxc_resolver-v1.10.2) - 2024-07-16
1024

1125
### Chore

Cargo.lock

Lines changed: 10 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,8 @@ doc_markdown = "allow"
6868
# `const` functions do not make sense for our project because this is not a `const` library.
6969
# This rule also confuses new comers and forces them to add `const` blindlessly without any reason.
7070
missing_const_for_fn = "allow"
71+
# cargo
72+
multiple_crate_versions = "allow"
7173

7274
[[example]]
7375
name = "resolver"
@@ -86,15 +88,16 @@ thiserror = "1.0.61"
8688
json-strip-comments = "1.0.2"
8789
indexmap = { version = "2.2.6", features = ["serde"] }
8890
cfg-if = "1.0"
91+
simdutf8 = { version = "0.1.4", features = ["aarch64_neon"] }
8992

9093
pnp = { version = "0.9.0", optional = true }
9194

9295
document-features = { version = "0.2.8", optional = true }
9396

9497
[dev-dependencies]
95-
vfs = "0.12.0" # for testing with in memory file system
98+
vfs = "0.12.0" # for testing with in memory file system
9699
rayon = { version = "1.10.0" }
97-
criterion2 = { version = "0.11.0", default-features = false }
100+
criterion2 = { version = "1.0.0", default-features = false }
98101
normalize-path = { version = "0.2.1" }
99102

100103
[features]

LICENSE

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
MIT License
2+
23
Copyright (c) 2024-present Bytedance Inc and its affiliates.
34
Copyright (c) 2023-2024 Boshen
45

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ This means when the caller is a CJS require (`require("module")`), resolve optio
5656
To support both CJS and ESM with the same cache:
5757

5858
```javascript
59-
const esmResolver = ResolverFactory({
59+
const esmResolver = new ResolverFactory({
6060
conditionNames: ["node", "import"]
6161
});
6262

@@ -93,7 +93,7 @@ Quoting esbuild's documentation:
9393
* `module` - This field came from a [proposal](https://github.com/dherman/defense-of-dot-js/blob/f31319be735b21739756b87d551f6711bd7aa283/proposal.md) for how to integrate ECMAScript modules into node. Because of this, it's reasonable to expect that the file path in this field is an ECMAScript-style module. This proposal wasn't adopted by node (node uses "type": "module" instead) but it was adopted by major bundlers because ECMAScript-style modules lead to better tree shaking, or dead code removal.
9494
* `browser` - This field came from a [proposal](https://gist.github.com/defunctzombie/4339901/49493836fb873ddaa4b8a7aa0ef2352119f69211) that allows bundlers to replace node-specific files or modules with their browser-friendly versions. It lets you specify an alternate browser-specific entry point. Note that it is possible for a package to use both the browser and module field together (see the note below).
9595

96-
### Errors
96+
## Errors & Trouble Shooting
9797

9898
* `Error: Package subpath '.' is not defined by "exports" in` - occurs when resolving without `conditionNames`.
9999

examples/resolver.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,10 @@ fn main() {
1919
alias: vec![("asdf".into(), vec![AliasValue::from("./test.js")])],
2020
extensions: vec![".js".into(), ".ts".into()],
2121
extension_alias: vec![(".js".into(), vec![".ts".into(), ".js".into()])],
22+
// ESM
23+
condition_names: vec!["node".into(), "import".into()],
24+
// CJS
25+
// condition_names: vec!["node".into(), "require".into()],
2226
..ResolveOptions::default()
2327
};
2428

justfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,9 @@ benchmark:
6969
fuzz:
7070
cd fuzz && cargo +nightly fuzz run --sanitizer none resolver -- -only_ascii=1 -max_total_time=900
7171

72+
# Manual Release
7273
release:
7374
cargo binstall -y release-plz
7475
release-plz update
7576
just check
77+
# NOTE: make sure to update version in npm/package.json

0 commit comments

Comments
 (0)