Skip to content

Commit 3efa30d

Browse files
committed
chore: migrate some scripts to tasks
1 parent 4e452ae commit 3efa30d

File tree

3 files changed

+43
-25
lines changed

3 files changed

+43
-25
lines changed

package.json

Lines changed: 12 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -11,43 +11,34 @@
1111
"type": "module",
1212
"scripts": {
1313
"build": "nuxt build",
14-
"build:lunaria": "node ./lunaria/lunaria.ts",
15-
"build:test": "NODE_ENV=test pnpm build",
14+
"build:test": "NODE_ENV=test vp run build",
1615
"dev": "nuxt dev",
17-
"dev:docs": "pnpm run --filter npmx-docs dev --port=3001",
18-
"i18n:check": "node scripts/compare-translations.ts",
16+
"dev:docs": "vp run --filter npmx-docs dev --port=3001",
1917
"i18n:check:fix": "node scripts/compare-translations.ts --fix",
20-
"i18n:report": "node scripts/find-invalid-translations.ts",
2118
"i18n:report:fix": "node scripts/remove-unused-translations.ts",
22-
"i18n:schema": "node scripts/generate-i18n-schema.ts",
23-
"knip": "knip",
2419
"knip:fix": "knip --fix",
25-
"lint": "vp lint && vp fmt --check",
2620
"lint:fix": "vp lint --fix && vp fmt",
27-
"lint:css": "node scripts/unocss-checker.ts",
2821
"generate": "nuxt generate",
29-
"npmx-connector": "pnpm --filter npmx-connector dev",
30-
"mock-connector": "pnpm --filter npmx-connector dev:mock",
22+
"npmx-connector": "vp run --filter npmx-connector dev",
23+
"mock-connector": "vp run --filter npmx-connector dev:mock",
3124
"generate-pwa-icons": "pwa-assets-generator",
3225
"preview": "nuxt preview",
33-
"postinstall": "(pnpm rebuild @resvg/resvg-js || true) && pnpm generate:lexicons && pnpm generate:sprite && nuxt prepare && vp config",
34-
"generate:sprite": "node scripts/generate-file-tree-sprite.ts",
26+
"postinstall": "(vp pm rebuild @resvg/resvg-js || true) && vp run generate:lexicons && vp run generate:sprite && nuxt prepare && vp config",
3527
"generate:fixtures": "node scripts/generate-fixtures.ts",
36-
"generate:lexicons": "lex build --lexicons lexicons --out shared/types/lexicons --clear",
3728
"generate:jwk": "node scripts/gen-jwk.ts",
3829
"test": "vp test",
39-
"test:a11y": "pnpm build:test && LIGHTHOUSE_COLOR_MODE=dark pnpm test:a11y:prebuilt && LIGHTHOUSE_COLOR_MODE=light pnpm test:a11y:prebuilt",
30+
"test:a11y": "vp run build:test && LIGHTHOUSE_COLOR_MODE=dark vp run test:a11y:prebuilt && LIGHTHOUSE_COLOR_MODE=light vp run test:a11y:prebuilt",
4031
"test:a11y:prebuilt": "./scripts/lighthouse.sh",
41-
"test:perf": "pnpm build:test && pnpm test:perf:prebuilt",
32+
"test:perf": "vp run build:test && vp run test:perf:prebuilt",
4233
"test:perf:prebuilt": "LH_PERF=1 ./scripts/lighthouse.sh",
43-
"test:browser": "pnpm build:test && pnpm test:browser:prebuilt",
34+
"test:browser": "vp run build:test && vp run test:browser:prebuilt",
4435
"test:browser:prebuilt": "playwright test",
45-
"test:browser:ui": "pnpm build:test && pnpm test:browser:prebuilt --ui",
46-
"test:browser:update": "pnpm build:test && pnpm test:browser:prebuilt --update-snapshots",
36+
"test:browser:ui": "vp run build:test && vp run test:browser:prebuilt --ui",
37+
"test:browser:update": "vp run build:test && vp run test:browser:prebuilt --update-snapshots",
4738
"test:nuxt": "vp test --project nuxt",
48-
"test:types": "pnpm generate:lexicons && nuxt prepare && vue-tsc -b --noEmit && pnpm --filter npmx-connector test:types",
39+
"test:types": "vp run generate:lexicons && nuxt prepare && vue-tsc -b --noEmit && vp run --filter npmx-connector test:types",
4940
"test:unit": "vp test --project unit",
50-
"start:playwright:webserver": "NODE_ENV=test pnpm preview --port 5678",
41+
"start:playwright:webserver": "NODE_ENV=test vp run preview --port 5678",
5142
"storybook": "STORYBOOK=true storybook dev -p 6006",
5243
"build-storybook": "STORYBOOK=true storybook build",
5344
"chromatic": "chromatic"
@@ -152,7 +143,6 @@
152143
"typescript": "5.9.3",
153144
"unplugin-vue-markdown": "30.0.0",
154145
"vitest": "npm:@voidzero-dev/vite-plus-test@0.1.12",
155-
"vitest-environment-nuxt": "1.0.1",
156146
"vue-i18n-extract": "2.0.7",
157147
"vue-tsc": "3.2.5"
158148
},

pnpm-lock.yaml

Lines changed: 0 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vite.config.ts

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,37 @@ import { playwright } from 'vite-plus/test/browser-playwright'
66
const rootDir = fileURLToPath(new URL('.', import.meta.url))
77

88
export default defineConfig({
9+
run: {
10+
tasks: {
11+
'lint': {
12+
command: 'vp lint && vp fmt --check',
13+
},
14+
'knip': {
15+
command: 'knip',
16+
},
17+
'generate:lexicons': {
18+
command: 'lex build --lexicons lexicons --out shared/types/lexicons --clear',
19+
},
20+
'generate:sprite': {
21+
command: 'node scripts/generate-file-tree-sprite.ts',
22+
},
23+
'i18n:check': {
24+
command: 'node scripts/compare-translations.ts',
25+
},
26+
'i18n:report': {
27+
command: 'node scripts/find-invalid-translations.ts',
28+
},
29+
'i18n:schema': {
30+
command: 'node scripts/generate-i18n-schema.ts',
31+
},
32+
'lint:css': {
33+
command: 'node scripts/unocss-checker.ts',
34+
},
35+
'build:lunaria': {
36+
command: 'node ./lunaria/lunaria.ts',
37+
},
38+
},
39+
},
940
lint: {
1041
plugins: ['unicorn', 'typescript', 'oxc', 'vue', 'vitest'],
1142
jsPlugins: ['@e18e/eslint-plugin', 'eslint-plugin-regexp'],

0 commit comments

Comments
 (0)