Skip to content

Commit bbffe8f

Browse files
committed
workflow(GitHub Actions): fix the error—cnpm: command not found
1 parent 0ebda26 commit bbffe8f

File tree

4 files changed

+30
-10
lines changed

4 files changed

+30
-10
lines changed

.github/workflows/release.yml

+3-6
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,9 @@ jobs:
3232
env:
3333
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
3434

35-
- run: cnpm sync
36-
if: success()
37-
38-
- run: curl -L https://npmmirror.com/sync/json-editor-vue
39-
if: success()
40-
4135
- run: npx changelogithub
4236
env:
4337
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
38+
39+
- run: pnpm sync-to-cnpm
40+
if: success()

package.json

+3-2
Original file line numberDiff line numberDiff line change
@@ -66,10 +66,10 @@
6666
"test:coverage": "vitest run --coverage",
6767
"test:ui": "vitest --ui",
6868
"doc": "vitepress dev --open /README",
69-
"build": "vite build && pnpm typegen",
7069
"typegen": "npx tsup --entry.json-editor-vue src/index.ts --format esm,cjs --cjsInterop --clean --dts-only",
71-
"check-exports": "pnpm build && npx attw $(npm pack)",
70+
"build": "vite build && pnpm typegen",
7271
"release": "esno ./scripts/release.mts",
72+
"sync-to-cnpm": "npx cnpm sync && curl -L https://npmmirror.com/sync/json-editor-vue",
7373
"license-scan": "license-checker --summary --out ./dependency-licenses.txt",
7474
"lint": "eslint \"**/*.{js,mjs,cjs,jsx,ts,mts,cts,tsx,vue,json,md,html,css,scss,sass}\" --ignore-pattern stats.html",
7575
"lint:fix": "eslint \"**/*.{js,mjs,cjs,jsx,ts,mts,cts,tsx,vue,json,md,html,css,scss,sass}\" --ignore-pattern stats.html --fix",
@@ -105,6 +105,7 @@
105105
"@vue/test-utils": "latest",
106106
"axios": "^1.7.7",
107107
"case-police": "^0.7.0",
108+
"cnpm": "^9.4.0",
108109
"cross-spawn": "^7.0.3",
109110
"del": "^8.0.0",
110111
"destr": "^2.0.3",

pnpm-lock.yaml

+22
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

scripts/release.mts

+2-2
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ async function release() {
3636
return
3737
}
3838

39-
console.log(cyan('\nChecking exports...'))
40-
if (spawn.sync('pnpm', ['check-exports'], { stdio: 'inherit' }).status === 1) {
39+
console.log(cyan('\nAnalyzing types...'))
40+
if (spawn.sync('npx', ['attw', '$(npm pack)'], { stdio: 'inherit' }).status === 1) {
4141
return
4242
}
4343
// await deleteAsync(['./*.tgz'])

0 commit comments

Comments
 (0)