Skip to content

Commit 4e40538

Browse files
committedOct 11, 2024·
workflow(GitHub Actions): fix the error—cnpm: command not found
1 parent 0ebda26 commit 4e40538

File tree

5 files changed

+33
-15
lines changed

5 files changed

+33
-15
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()

‎.gitignore

-1
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,3 @@ stats.html
1313
*.local
1414
*.log
1515
*.zip
16-
*.tgz

‎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

+5-6
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
1-
// pnpm i esno prompts semver cross-spawn kolorist del open -D -w
2-
31
import fs from 'node:fs'
42
import spawn from 'cross-spawn'
5-
// import { deleteAsync } from 'del'
3+
import { deleteAsync } from 'del'
64
import { cyan } from 'kolorist'
75
// import open from 'open'
86
import prompts from 'prompts'
@@ -36,11 +34,12 @@ async function release() {
3634
return
3735
}
3836

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

4544
const jsrConfig = JSON.parse(fs.readFileSync('./jsr.json', 'utf-8'))
4645
const npmConfig = JSON.parse(fs.readFileSync('./package.json', 'utf-8'))

0 commit comments

Comments
 (0)
Please sign in to comment.