Skip to content

Commit

Permalink
feat: use "workspace:" protocol, for auto replace on "bun publish"
Browse files Browse the repository at this point in the history
  • Loading branch information
nobkd committed Nov 2, 2024
1 parent bc16e16 commit 0ebd99a
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 4 deletions.
1 change: 1 addition & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ jobs:
- name: Install and test with Node
run: |
node -v && npm -v
node setup-npm.js
npm install
npm install --no-save jest jest-extended esbuild
npm test -- --coverage
Expand Down
1 change: 1 addition & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ nue
nue build --production

# if using node
node setup-npm.js # prepare local dev env
npm install
cd packages/nuekit
npm link
Expand Down
6 changes: 3 additions & 3 deletions packages/nuekit/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@
"import-meta-resolve": "^4.1.0",
"js-yaml": "^4.1.0",
"lightningcss": "^1.27.0",
"nue-glow": "*",
"nuejs-core": "*",
"nuemark": "*"
"nue-glow": "workspace:*",
"nuejs-core": "workspace:*",
"nuemark": "workspace:*"
},
"jest": {
"setupFilesAfterEnv": [
Expand Down
2 changes: 1 addition & 1 deletion packages/nuemark/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
},
"dependencies": {
"js-yaml": "^4.1.0",
"nue-glow": "*"
"nue-glow": "workspace:*"
},
"jest": {
"setupFilesAfterEnv": [
Expand Down
7 changes: 7 additions & 0 deletions setup-npm.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { readdirSync, existsSync, readFileSync, writeFileSync } from 'node:fs'
import { join } from 'node:path'

for (const pkg of readdirSync('packages').map(d => join('packages', d, 'package.json'))) {
if (!existsSync(pkg)) continue
writeFileSync(pkg, readFileSync(pkg, 'utf8').replaceAll('workspace:*', '*'))
}

0 comments on commit 0ebd99a

Please sign in to comment.