Skip to content

Commit 9ef8db9

Browse files
committed
ci: fix publish script
1 parent e621316 commit 9ef8db9

File tree

9 files changed

+68
-51
lines changed

9 files changed

+68
-51
lines changed

.github/workflows/CI.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -320,8 +320,8 @@ jobs:
320320
path: artifacts
321321
- name: create npm dirs
322322
run: |
323-
pnpm napi create-npm-dirs
324-
pnpm napi artifacts --build-output-dir packages/core
323+
pnpm napi create-npm-dirs --package-json-path packages/core/package.json
324+
pnpm napi artifacts --package-json-path packages/core/package.json --build-output-dir packages/core
325325
- name: List packages
326326
run: ls -R ./npm
327327
shell: bash
@@ -332,11 +332,11 @@ jobs:
332332
if git log -1 --pretty=%B | grep "^v\?[0-9]\+\.[0-9]\+\.[0-9]\+$";
333333
then
334334
pnpm napi pre-publish -t npm --package-json-path packages/core/package.json
335-
pnpm publish --filter=@oxc/node-core --access public
335+
pnpm publish --filter=@oxc/node-core --access public --no-git-checks
336336
elif git log -1 --pretty=%B | grep "^v\?[0-9]\+\.[0-9]\+\.[0-9]\+";
337337
then
338338
pnpm napi pre-publish -t npm --package-json-path packages/core/package.json
339-
pnpm --filter=@oxc/node-core publish --tag next --access public
339+
pnpm --filter=@oxc/node-core publish --tag next --access public --no-git-checks
340340
else
341341
echo "Not a release, skipping publish"
342342
fi

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -238,3 +238,4 @@ target/
238238
*.node
239239
*.wasm
240240
pgo-data
241+
/npm

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@
44

55
Fast and friendly Node.js devtools based on [OXC](https://github.com/oxc-project/oxc)
66

7-
## `@oxc/node-core`
7+
## `@oxc-node/core`
88

99
Transformer and register for Node.js projects.
1010

1111
### Usage
1212

1313
```bash
14-
node --import @oxc/node-core ./path/to/entry.ts
14+
node --import @oxc-node/core ./path/to/entry.ts
1515
```

package.json

+1-20
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
"typescript": "^5.5.3"
2222
},
2323
"scripts": {
24-
"build": "napi build --platform --release -o packages/core",
24+
"build": "napi build --platform --release -o packages/core --package-json-path packages/core/package.json",
2525
"format": "taplo fmt && prettier --write . && cargo fmt",
2626
"lint": "oxlint",
2727
"test": "pnpm --filter=integrate-module* run test",
@@ -41,24 +41,5 @@
4141
"trailingComma": "all",
4242
"singleQuote": true,
4343
"arrowParens": "always"
44-
},
45-
"napi": {
46-
"binaryName": "oxc-node",
47-
"packageName": "@oxc/node-core",
48-
"targets": [
49-
"x86_64-apple-darwin",
50-
"aarch64-apple-darwin",
51-
"x86_64-pc-windows-msvc",
52-
"x86_64-unknown-linux-gnu",
53-
"aarch64-linux-android",
54-
"aarch64-unknown-linux-gnu",
55-
"aarch64-unknown-linux-musl",
56-
"aarch64-pc-windows-msvc",
57-
"armv7-unknown-linux-gnueabihf",
58-
"x86_64-unknown-linux-musl",
59-
"i686-pc-windows-msvc",
60-
"armv7-linux-androideabi",
61-
"wasm32-wasip1-threads"
62-
]
6344
}
6445
}

packages/core/README.md

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# `@oxc-node/core`
2+
3+
Transformer and register for Node.js projects.
4+
5+
## Usage
6+
7+
```bash
8+
node --import @oxc-node/core ./path/to/entry.ts
9+
```

packages/core/browser.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
export * from '@oxc/node-core-wasm32-wasi'
1+
export * from '@oxc-node/core-wasm32-wasi'

packages/core/index.js

+21-21
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ function requireNative() {
6565
loadErrors.push(e)
6666
}
6767
try {
68-
return require('@oxc/node-core-android-arm64')
68+
return require('@oxc-node/core-android-arm64')
6969
} catch (e) {
7070
loadErrors.push(e)
7171
}
@@ -77,7 +77,7 @@ function requireNative() {
7777
loadErrors.push(e)
7878
}
7979
try {
80-
return require('@oxc/node-core-android-arm-eabi')
80+
return require('@oxc-node/core-android-arm-eabi')
8181
} catch (e) {
8282
loadErrors.push(e)
8383
}
@@ -93,7 +93,7 @@ function requireNative() {
9393
loadErrors.push(e)
9494
}
9595
try {
96-
return require('@oxc/node-core-win32-x64-msvc')
96+
return require('@oxc-node/core-win32-x64-msvc')
9797
} catch (e) {
9898
loadErrors.push(e)
9999
}
@@ -105,7 +105,7 @@ function requireNative() {
105105
loadErrors.push(e)
106106
}
107107
try {
108-
return require('@oxc/node-core-win32-ia32-msvc')
108+
return require('@oxc-node/core-win32-ia32-msvc')
109109
} catch (e) {
110110
loadErrors.push(e)
111111
}
@@ -117,7 +117,7 @@ function requireNative() {
117117
loadErrors.push(e)
118118
}
119119
try {
120-
return require('@oxc/node-core-win32-arm64-msvc')
120+
return require('@oxc-node/core-win32-arm64-msvc')
121121
} catch (e) {
122122
loadErrors.push(e)
123123
}
@@ -132,7 +132,7 @@ function requireNative() {
132132
loadErrors.push(e)
133133
}
134134
try {
135-
return require('@oxc/node-core-darwin-universal')
135+
return require('@oxc-node/core-darwin-universal')
136136
} catch (e) {
137137
loadErrors.push(e)
138138
}
@@ -144,7 +144,7 @@ function requireNative() {
144144
loadErrors.push(e)
145145
}
146146
try {
147-
return require('@oxc/node-core-darwin-x64')
147+
return require('@oxc-node/core-darwin-x64')
148148
} catch (e) {
149149
loadErrors.push(e)
150150
}
@@ -156,7 +156,7 @@ function requireNative() {
156156
loadErrors.push(e)
157157
}
158158
try {
159-
return require('@oxc/node-core-darwin-arm64')
159+
return require('@oxc-node/core-darwin-arm64')
160160
} catch (e) {
161161
loadErrors.push(e)
162162
}
@@ -172,7 +172,7 @@ function requireNative() {
172172
loadErrors.push(e)
173173
}
174174
try {
175-
return require('@oxc/node-core-freebsd-x64')
175+
return require('@oxc-node/core-freebsd-x64')
176176
} catch (e) {
177177
loadErrors.push(e)
178178
}
@@ -184,7 +184,7 @@ function requireNative() {
184184
loadErrors.push(e)
185185
}
186186
try {
187-
return require('@oxc/node-core-freebsd-arm64')
187+
return require('@oxc-node/core-freebsd-arm64')
188188
} catch (e) {
189189
loadErrors.push(e)
190190
}
@@ -201,7 +201,7 @@ function requireNative() {
201201
loadErrors.push(e)
202202
}
203203
try {
204-
return require('@oxc/node-core-linux-x64-musl')
204+
return require('@oxc-node/core-linux-x64-musl')
205205
} catch (e) {
206206
loadErrors.push(e)
207207
}
@@ -213,7 +213,7 @@ function requireNative() {
213213
loadErrors.push(e)
214214
}
215215
try {
216-
return require('@oxc/node-core-linux-x64-gnu')
216+
return require('@oxc-node/core-linux-x64-gnu')
217217
} catch (e) {
218218
loadErrors.push(e)
219219
}
@@ -227,7 +227,7 @@ function requireNative() {
227227
loadErrors.push(e)
228228
}
229229
try {
230-
return require('@oxc/node-core-linux-arm64-musl')
230+
return require('@oxc-node/core-linux-arm64-musl')
231231
} catch (e) {
232232
loadErrors.push(e)
233233
}
@@ -239,7 +239,7 @@ function requireNative() {
239239
loadErrors.push(e)
240240
}
241241
try {
242-
return require('@oxc/node-core-linux-arm64-gnu')
242+
return require('@oxc-node/core-linux-arm64-gnu')
243243
} catch (e) {
244244
loadErrors.push(e)
245245
}
@@ -253,7 +253,7 @@ function requireNative() {
253253
loadErrors.push(e)
254254
}
255255
try {
256-
return require('@oxc/node-core-linux-arm-musleabihf')
256+
return require('@oxc-node/core-linux-arm-musleabihf')
257257
} catch (e) {
258258
loadErrors.push(e)
259259
}
@@ -265,7 +265,7 @@ function requireNative() {
265265
loadErrors.push(e)
266266
}
267267
try {
268-
return require('@oxc/node-core-linux-arm-gnueabihf')
268+
return require('@oxc-node/core-linux-arm-gnueabihf')
269269
} catch (e) {
270270
loadErrors.push(e)
271271
}
@@ -279,7 +279,7 @@ function requireNative() {
279279
loadErrors.push(e)
280280
}
281281
try {
282-
return require('@oxc/node-core-linux-riscv64-musl')
282+
return require('@oxc-node/core-linux-riscv64-musl')
283283
} catch (e) {
284284
loadErrors.push(e)
285285
}
@@ -291,7 +291,7 @@ function requireNative() {
291291
loadErrors.push(e)
292292
}
293293
try {
294-
return require('@oxc/node-core-linux-riscv64-gnu')
294+
return require('@oxc-node/core-linux-riscv64-gnu')
295295
} catch (e) {
296296
loadErrors.push(e)
297297
}
@@ -304,7 +304,7 @@ function requireNative() {
304304
loadErrors.push(e)
305305
}
306306
try {
307-
return require('@oxc/node-core-linux-ppc64-gnu')
307+
return require('@oxc-node/core-linux-ppc64-gnu')
308308
} catch (e) {
309309
loadErrors.push(e)
310310
}
@@ -316,7 +316,7 @@ function requireNative() {
316316
loadErrors.push(e)
317317
}
318318
try {
319-
return require('@oxc/node-core-linux-s390x-gnu')
319+
return require('@oxc-node/core-linux-s390x-gnu')
320320
} catch (e) {
321321
loadErrors.push(e)
322322
}
@@ -341,7 +341,7 @@ if (!nativeBinding || process.env.NAPI_RS_FORCE_WASI) {
341341
}
342342
if (!nativeBinding) {
343343
try {
344-
nativeBinding = require('@oxc/node-core-wasm32-wasi')
344+
nativeBinding = require('@oxc-node/core-wasm32-wasi')
345345
} catch (err) {
346346
if (process.env.NAPI_RS_FORCE_WASI) {
347347
console.error(err)

packages/core/oxc-node.wasi.cjs

+2-2
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,9 @@ if (__nodeFs.existsSync(__wasmDebugFilePath)) {
3939
__wasmFilePath = __wasmDebugFilePath
4040
} else if (!__nodeFs.existsSync(__wasmFilePath)) {
4141
try {
42-
__wasmFilePath = __nodePath.resolve('@oxc/node-core-wasm32-wasi')
42+
__wasmFilePath = __nodePath.resolve('@oxc-node/core-wasm32-wasi')
4343
} catch {
44-
throw new Error('Cannot find oxc-node.wasm32-wasi.wasm file, and @oxc/node-core-wasm32-wasi package is not installed.')
44+
throw new Error('Cannot find oxc-node.wasm32-wasi.wasm file, and @oxc-node/core-wasm32-wasi package is not installed.')
4545
}
4646
}
4747

packages/core/package.json

+27-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"name": "@oxc/node-core",
2+
"name": "@oxc-node/core",
33
"version": "0.0.0",
44
"main": "./index.js",
55
"browser": "./browser.js",
@@ -30,6 +30,32 @@
3030
"import": "./register.mjs"
3131
}
3232
},
33+
"publishConfig": {
34+
"registry": "https://registry.npmjs.org/",
35+
"access": "public"
36+
},
37+
"napi": {
38+
"binaryName": "oxc-node",
39+
"targets": [
40+
"x86_64-apple-darwin",
41+
"aarch64-apple-darwin",
42+
"x86_64-pc-windows-msvc",
43+
"x86_64-unknown-linux-gnu",
44+
"aarch64-linux-android",
45+
"aarch64-unknown-linux-gnu",
46+
"aarch64-unknown-linux-musl",
47+
"aarch64-pc-windows-msvc",
48+
"armv7-unknown-linux-gnueabihf",
49+
"x86_64-unknown-linux-musl",
50+
"i686-pc-windows-msvc",
51+
"armv7-linux-androideabi",
52+
"wasm32-wasip1-threads"
53+
]
54+
},
55+
"repository": {
56+
"type": "git",
57+
"url": "git+https://github.com/oxc-project/oxc-node.git"
58+
},
3359
"funding": [
3460
{
3561
"type": "github",

0 commit comments

Comments
 (0)