Skip to content

Commit c605b0d

Browse files
committed
ci: update pkg scripts tasks
1 parent 7d04620 commit c605b0d

File tree

6 files changed

+13
-10
lines changed

6 files changed

+13
-10
lines changed

.github/workflows/dev-publish.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,13 +83,13 @@ jobs:
8383

8484
- name: pushing lite snapshot to ${{ env.GOOGLE_NPM_REGISTRY }}
8585
run: |
86-
mv package-lite.json package.json
86+
mv -f package-lite.json package.json
8787
cat <<< $(jq '.version="${{ env.ZX_LITE_DEV_VERSION }}"' package.json) > package.json
8888
npm publish --provenance --access=public --no-git-tag-version --tag dev --registry https://${{ env.GOOGLE_NPM_REGISTRY }}
8989
9090
- name: pushing to ${{ env.GOOGLE_NPM_REGISTRY }}
9191
run: |
92-
mv package-main.json package.json
92+
mv -f package-main.json package.json
9393
cat <<< $(jq '.version="${{ env.ZX_DEV_VERSION }}"' package.json) > package.json
9494
npm publish --provenance --access=public --no-git-tag-version --tag dev --registry https://${{ env.GOOGLE_NPM_REGISTRY }}
9595

.github/workflows/publish.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ jobs:
8080

8181
- name: pushing to ${{ env.GOOGLE_NPM_REGISTRY }}
8282
run: |
83-
mv package-main.json package.json
83+
mv -f package-main.json package.json
8484
npm publish --provenance --access=public --registry https://${{ env.GOOGLE_NPM_REGISTRY }}
8585
8686
- name: pushing to ${{ env.GH_NPM_REGISTRY }}
@@ -90,7 +90,7 @@ jobs:
9090
9191
- name: pushing lite snapshot to ${{ env.GOOGLE_NPM_REGISTRY }}
9292
run: |
93-
mv package-lite.json package.json
93+
mv -f package-lite.json package.json
9494
npm publish --provenance --access=public --no-git-tag-version --tag lite --registry https://${{ env.GOOGLE_NPM_REGISTRY }}
9595
9696
jsr-publish:

package.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,16 +70,17 @@
7070
"fmt": "prettier --write .",
7171
"fmt:check": "prettier --check .",
7272
"prebuild": "rm -rf build",
73-
"build": "npm run build:versions && npm run build:js && npm run build:dts && npm run build:tests",
73+
"build": "npm run build:versions && npm run build:js && npm run build:dts && npm run build:tests && npm run build:manifest",
7474
"build:js": "node scripts/build-js.mjs --format=cjs --hybrid --entry='src/{cli,core,deps,globals,index,internals,util,vendor*}.ts' && npm run build:vendor",
7575
"build:vendor": "node scripts/build-js.mjs --format=cjs --entry=src/vendor-*.ts --bundle=all --external='./internals.ts'",
7676
"build:versions": "node scripts/build-versions.mjs",
7777
"build:tests": "node scripts/build-tests.mjs",
7878
"build:dts": "tsc --project tsconfig.json && node scripts/build-dts.mjs",
7979
"build:dcr": "docker build -f ./dcr/Dockerfile . -t zx",
8080
"build:jsr": "node scripts/build-jsr.mjs",
81-
"build:lite": "node scripts/build-lite.mjs",
82-
"build:pkgjson": "node scripts/build-pkgjson.mjs",
81+
"build:lite": "node scripts/build-pkgjson-lite.mjs",
82+
"build:pkgjson": "node scripts/build-pkgjson-main.mjs",
83+
"build:manifest": "npm run build:pkgjson && npm run build:lite && npm run build:jsr",
8384
"postbuild": "node scripts/build-clean.mjs",
8485
"docs:dev": "vitepress dev docs",
8586
"docs:build": "vitepress build docs",

scripts/build-jsr.mjs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,3 +81,5 @@ fs.writeFileSync(
8181
2
8282
)
8383
)
84+
85+
console.log('jsr.json prepared for JSR')
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,4 +88,4 @@ const pkgJson = {
8888

8989
fs.writeFileSync('package-lite.json', JSON.stringify(pkgJson, null, 2))
9090

91-
console.log('package-lite.json prepared for zx-lite publishing')
91+
console.log('package-lite.json prepared for npm')
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,6 @@ const whitelist = new Set([
4747
const pkgJson = Object.fromEntries(
4848
Object.entries(_pkgJson).filter(([k]) => whitelist.has(k))
4949
)
50-
fs.writeFileSync(pkgJsonFile, JSON.stringify(pkgJson, null, 2))
50+
fs.writeFileSync('package-main.json', JSON.stringify(pkgJson, null, 2))
5151

52-
console.log('package.json optimized for npm publishing')
52+
console.log('package-main.json prepared for npm')

0 commit comments

Comments
 (0)