Skip to content

Commit 6c30d5e

Browse files
Bump napi toolchain to 3.3 (#18947)
This PR bumps all napi related dependencies to their latest version. Napi 3 has by now officially been released but since we've been using the preview already, there aren't many changes. One thing that ChatGPT found is that `--no-const-enum` is the default behavior now (see default value [in this table](https://napi.rs/docs/cli/build#options)) ## Test plan - `pnpm install && pnpm build` - `cd crates/node/npm/wasm32-wasi` - `pnpm install --ignore-workspace` (This is necessary for some reason or the bundled dependencies won't work, I have no clue why it's not necessary on CI) - `pnpm pack` - Install dependency in a new npm package with a simple config like this: ```js import { Scanner } from "@tailwindcss/oxide-wasm32-wasi"; let scanner = new Scanner({ sources: [ { base: "/Users/philipp/dev/tailwindcss/packages/@tailwindcss-postcss/src/fixtures/example-project", pattern: "**/*", negated: false, }, ], }); console.log(scanner.scan()); ``` - <img width="904" height="494" alt="CleanShot 2025-09-19 at 14 53 52@2x" src="https://github.com/user-attachments/assets/93e32c19-6db4-4d00-9fdb-a6fde22fc69c" /> I also tested the CI build to make sure the `bundledDependencies` are properly added.
1 parent 8d56381 commit 6c30d5e

File tree

7 files changed

+691
-553
lines changed

7 files changed

+691
-553
lines changed

Cargo.lock

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

crates/node/Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@ crate-type = ["cdylib"]
88

99
[dependencies]
1010
# Default enable napi4 feature, see https://nodejs.org/api/n-api.html#node-api-version-matrix
11-
napi = { version = "2.16.17", default-features = false, features = ["napi4"] }
12-
napi-derive = "2.16.13"
11+
napi = { version = "3.3.0", default-features = false, features = ["napi4"] }
12+
napi-derive = "3.2.5"
1313
tailwindcss-oxide = { path = "../oxide" }
1414
rayon = "1.10.0"
1515

1616
[build-dependencies]
17-
napi-build = "2.1.6"
17+
napi-build = "2.2.3"

crates/node/npm/wasm32-wasi/package.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,12 @@
2727
},
2828
"browser": "tailwindcss-oxide.wasi-browser.js",
2929
"dependencies": {
30-
"@napi-rs/wasm-runtime": "^0.2.12",
31-
"@emnapi/core": "^1.4.5",
32-
"@emnapi/runtime": "^1.4.5",
33-
"@tybys/wasm-util": "^0.10.0",
34-
"@emnapi/wasi-threads": "^1.0.4",
35-
"tslib": "^2.8.0"
30+
"@napi-rs/wasm-runtime": "^1.0.5",
31+
"@emnapi/core": "^1.5.0",
32+
"@emnapi/runtime": "^1.5.0",
33+
"@tybys/wasm-util": "^0.10.1",
34+
"@emnapi/wasi-threads": "^1.1.0",
35+
"tslib": "^2.4.0"
3636
},
3737
"bundledDependencies": [
3838
"@napi-rs/wasm-runtime",

crates/node/npm/wasm32-wasi/pnpm-lock.yaml

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

crates/node/package.json

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,9 @@
3737
"detect-libc": "^2.0.4"
3838
},
3939
"devDependencies": {
40-
"@napi-rs/cli": "^3.0.0-alpha.78",
41-
"@napi-rs/wasm-runtime": "^0.2.12",
42-
"emnapi": "1.4.5"
40+
"@napi-rs/cli": "^3.2.0",
41+
"@napi-rs/wasm-runtime": "^1.0.5",
42+
"emnapi": "1.5.0"
4343
},
4444
"engines": {
4545
"node": ">= 10"
@@ -54,14 +54,13 @@
5454
"access": "public"
5555
},
5656
"scripts": {
57-
"artifacts": "napi artifacts",
5857
"build": "pnpm run build:platform && pnpm run build:wasm",
59-
"build:platform": "napi build --platform --release --no-const-enum",
58+
"build:platform": "napi build --platform --release",
6059
"postbuild:platform": "node ./scripts/move-artifacts.mjs",
61-
"build:wasm": "napi build --release --target wasm32-wasip1-threads --no-const-enum",
60+
"build:wasm": "napi build --release --target wasm32-wasip1-threads",
6261
"postbuild:wasm": "node ./scripts/move-artifacts.mjs",
6362
"dev": "cargo watch --quiet --shell 'npm run build'",
64-
"build:debug": "napi build --platform --no-const-enum",
63+
"build:debug": "napi build --platform",
6564
"version": "napi version",
6665
"postinstall": "node ./scripts/install.js"
6766
},

crates/node/scripts/move-artifacts.mjs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,3 +35,4 @@ for (let file of await fs.readdir(tailwindcssOxideRoot)) {
3535
)
3636
console.log(`Moved ${file} to npm/wasm32-wasi`)
3737
}
38+

0 commit comments

Comments
 (0)