Skip to content

Commit d9ca5e3

Browse files
authored
chore(script): optimize scripts (#2396)
* chore(script): optimize scripts * fix: update prettierignore
1 parent 0281121 commit d9ca5e3

File tree

5 files changed

+28
-56
lines changed

5 files changed

+28
-56
lines changed

.github/workflows/ci.yml

+6-6
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ jobs:
2929
run: pnpm install
3030

3131
- name: Run prettier
32-
run: npm run lint
32+
run: pnpm lint
3333

3434
test:
3535
runs-on: ubuntu-latest
@@ -48,7 +48,7 @@ jobs:
4848
run: pnpm install
4949

5050
- name: Run test cases
51-
run: npm run test:c
51+
run: pnpm test:c
5252

5353
- name: Upload coverage reports to Codecov
5454
uses: codecov/codecov-action@v3
@@ -72,13 +72,13 @@ jobs:
7272
run: pnpm install
7373

7474
- name: Build NutUI
75-
run: npm run build
75+
run: pnpm build
7676

7777
- name: Build NutUI-Taro
78-
run: npm run build:taro:vue
78+
run: pnpm build:taro:vue
7979

8080
- name: Build NutUI Demo
81-
run: npm run build:site
81+
run: pnpm build:site
8282

8383
- name: Build NutUI-Taro Demo
84-
run: npm run build:taro:h5
84+
run: pnpm build:taro:h5

.prettierignore

+5
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,11 @@ src/packages/vscode-extension/*.vsix
3232
/tsc
3333
/site_docs
3434

35+
# packagse
36+
37+
## nutui-taro-demo
38+
packages/nutui-taro-demo/src/app.config.ts
39+
3540
# local env files
3641
.env.local
3742
.env.*.local

package.json

+16-24
Original file line numberDiff line numberDiff line change
@@ -36,41 +36,33 @@
3636
"CHANGELOG.md"
3737
],
3838
"scripts": {
39-
"checked": "npm run generate:file && tsc",
40-
"checked:taro:vue": "npm run generate:file:taro:vue",
41-
"dev": "npm run checked && npm run dts && vite --open --force",
42-
"taro": "npm run createTaroConfig && npm run checked:taro:vue && npm run dts",
43-
"dev:taro:weapp": "npm run taro && cd packages/nutui-taro-demo/ && npm run dev:weapp",
44-
"dev:taro:alipay": "npm run taro && cd packages/nutui-taro-demo/ && npm run dev:alipay",
45-
"dev:taro:jd": "npm run taro && cd packages/nutui-taro-demo/ && npm run dev:jd",
46-
"dev:taro:h5": "npm run taro && cd packages/nutui-taro-demo/ && npm run dev:h5",
47-
"build:taro:h5": "npm run taro && cd packages/nutui-taro-demo/ && npm run build:h5",
48-
"build:taro:weapp": "npm run taro && cd packages/nutui-taro-demo/ && npm run build:weapp",
49-
"build:site": "npm run checked && vite build",
50-
"build:site-jdt": "npm run checked && vite build --config vite.config.jdt.ts ",
51-
"build:site:oss": "npm run checked && vite build --base=/nutui/4x/",
52-
"build": "npm run checked && vite build --config vite.config.build.ts && vite build --config vite.config.build.disperse.ts && npm run generate:themes && vite build --config vite.config.build.css.ts && vite build --config vite.config.build.locale.ts && vite build --config vite.config.build.resolver.ts && npm run dts && npm run attrs && node jd/generate-unplugin-deps.cjs nutui && node jd/copy-dist.cjs nutui",
53-
"build:taro:vue": "npm run checked:taro:vue && vite build --config vite.config.build.taro.vue.ts && vite build --config vite.config.build.taro.vue.disperse.ts && npm run generate:themes:taro && vite build --config vite.config.build.css.ts && vite build --config vite.config.build.locale.ts && vite build --config vite.config.build.resolver.ts && npm run dts:taro && npm run attrs:taro && node jd/generate-unplugin-deps.cjs nutui-taro && node jd/copy-dist.cjs nutui-taro",
54-
"serve": "vite preview",
39+
"preinstall": "npx only-allow pnpm",
40+
"prepare": "husky install && node jd/generate-nutui.cjs && node jd/generate-nutui-taro-vue.cjs && node ./jd/generate-taro-route.cjs",
41+
"dev": "vite --open --force",
42+
"dev:taro:weapp": "pnpm --dir ./packages/nutui-taro-demo dev:weapp",
43+
"dev:taro:alipay": "pnpm --dir ./packages/nutui-taro-demo dev:alipay",
44+
"dev:taro:jd": "pnpm --dir ./packages/nutui-taro-demo dev:jd",
45+
"dev:taro:h5": "pnpm --dir ./packages/nutui-taro-demo dev:h5",
46+
"build:taro:h5": "pnpm --dir ./packages/nutui-taro-demo build:h5",
47+
"build:taro:weapp": "pnpm --dir ./packages/nutui-taro-demo build:weapp",
48+
"build:site": "vite build",
49+
"build": "vite build --config vite.config.build.ts && vite build --config vite.config.build.disperse.ts && pnpm generate:themes && vite build --config vite.config.build.css.ts && vite build --config vite.config.build.locale.ts && vite build --config vite.config.build.resolver.ts && pnpm dts && pnpm attrs && node jd/generate-unplugin-deps.cjs nutui && node jd/copy-dist.cjs nutui",
50+
"build:taro:vue": "vite build --config vite.config.build.taro.vue.ts && vite build --config vite.config.build.taro.vue.disperse.ts && pnpm generate:themes:taro && vite build --config vite.config.build.css.ts && vite build --config vite.config.build.locale.ts && vite build --config vite.config.build.resolver.ts && pnpm dts:taro && pnpm attrs:taro && node jd/generate-unplugin-deps.cjs nutui-taro && node jd/copy-dist.cjs nutui-taro",
5551
"add": "node jd/createComponentMode.js",
56-
"generate:file": "node jd/generate-nutui.cjs",
57-
"generate:file:taro:vue": "node jd/generate-nutui-taro-vue.cjs",
5852
"generate:types": "rimraf ./dist/types && node jd/generate-types.cjs",
5953
"generate:types:taro": "rimraf ./dist/types && node jd/generate-types-taro.cjs",
6054
"generate:themes": "node jd/generate-themes.cjs",
6155
"generate:themes:taro": "node jd/generate-themes.cjs taro",
62-
"prepare": "husky install",
6356
"test": "vitest",
64-
"test:ui": "vitest --ui",
65-
"test:c": "vitest run --coverage",
57+
"test:ui": "vitest --ui --coverage",
58+
"test:c": "vitest --coverage",
6659
"lint": "prettier --check .",
6760
"lint:fix": "prettier --write .",
6861
"copydocs": "node ./jd/copymd.cjs",
69-
"createTaroConfig": "node ./jd/generate-taro-route.cjs",
7062
"attrs:taro": "node ./jd/createAttributes.cjs taro",
7163
"attrs": "node ./jd/createAttributes.cjs",
72-
"dts": "rimraf ./tsc/type && vue-tsc --declaration --emitDeclarationOnly -p ./tsconfig.declaration.json && npm run generate:types",
73-
"dts:taro": "rimraf ./tsc/type && vue-tsc --declaration --emitDeclarationOnly -p ./tsconfig.declaration.taro.json && npm run generate:types:taro",
64+
"dts": "rimraf ./tsc/type && vue-tsc --declaration --emitDeclarationOnly -p ./tsconfig.declaration.json && pnpm generate:types",
65+
"dts:taro": "rimraf ./tsc/type && vue-tsc --declaration --emitDeclarationOnly -p ./tsconfig.declaration.taro.json && pnpm generate:types:taro",
7466
"copy:h5": "node ./jd/copyh5.cjs",
7567
"copy:taro": "node ./jd/copytaro.cjs"
7668
},

pnpm-lock.yaml

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

pnpm-workspace.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
packages:
2-
- 'packages/**'
2+
- 'packages/*'

0 commit comments

Comments
 (0)