Skip to content

Commit 0ebd99a

Browse files
committed
feat: use "workspace:" protocol, for auto replace on "bun publish"
1 parent bc16e16 commit 0ebd99a

File tree

5 files changed

+13
-4
lines changed

5 files changed

+13
-4
lines changed

.github/workflows/test.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ jobs:
4545
- name: Install and test with Node
4646
run: |
4747
node -v && npm -v
48+
node setup-npm.js
4849
npm install
4950
npm install --no-save jest jest-extended esbuild
5051
npm test -- --coverage

CONTRIBUTING.md

+1
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ nue
5858
nue build --production
5959

6060
# if using node
61+
node setup-npm.js # prepare local dev env
6162
npm install
6263
cd packages/nuekit
6364
npm link

packages/nuekit/package.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@
2626
"import-meta-resolve": "^4.1.0",
2727
"js-yaml": "^4.1.0",
2828
"lightningcss": "^1.27.0",
29-
"nue-glow": "*",
30-
"nuejs-core": "*",
31-
"nuemark": "*"
29+
"nue-glow": "workspace:*",
30+
"nuejs-core": "workspace:*",
31+
"nuemark": "workspace:*"
3232
},
3333
"jest": {
3434
"setupFilesAfterEnv": [

packages/nuemark/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
},
1717
"dependencies": {
1818
"js-yaml": "^4.1.0",
19-
"nue-glow": "*"
19+
"nue-glow": "workspace:*"
2020
},
2121
"jest": {
2222
"setupFilesAfterEnv": [

setup-npm.js

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import { readdirSync, existsSync, readFileSync, writeFileSync } from 'node:fs'
2+
import { join } from 'node:path'
3+
4+
for (const pkg of readdirSync('packages').map(d => join('packages', d, 'package.json'))) {
5+
if (!existsSync(pkg)) continue
6+
writeFileSync(pkg, readFileSync(pkg, 'utf8').replaceAll('workspace:*', '*'))
7+
}

0 commit comments

Comments
 (0)