@component-hook/create-app 1.3.1 → 1.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,21 +1,11 @@
1
1
  {
2
2
  "name": "@component-hook/create-app",
3
- "version": "1.3.1",
4
- "description": "Scaffolding a basic typescript project",
5
3
  "type": "module",
6
- "license": "MIT",
4
+ "version": "1.4.0",
5
+ "description": "Scaffolding a basic typescript project",
7
6
  "author": "Tzuyi",
8
- "bin": {
9
- "create-component-hook": "bin/index.js"
10
- },
11
- "files": [
12
- "bin",
13
- "template-*",
14
- "dist"
15
- ],
16
- "engines": {
17
- "node": ">=20.19.5"
18
- },
7
+ "license": "MIT",
8
+ "homepage": "https://github.com/tzuyi0817/component-hook/tree/master/packages/create-app#readme",
19
9
  "repository": {
20
10
  "type": "git",
21
11
  "url": "https://github.com/tzuyi0817/component-hook.git",
@@ -24,10 +14,20 @@
24
14
  "bugs": {
25
15
  "url": "https://github.com/tzuyi0817/component-hook/issues"
26
16
  },
27
- "homepage": "https://github.com/tzuyi0817/component-hook/tree/master/packages/create-app#readme",
17
+ "bin": {
18
+ "create-component-hook": "bin/index.js"
19
+ },
20
+ "files": [
21
+ "bin",
22
+ "dist",
23
+ "template-*"
24
+ ],
25
+ "engines": {
26
+ "node": ">=20.19.6"
27
+ },
28
28
  "dependencies": {
29
29
  "art-template": "^4.13.4",
30
- "fs-extra": "^11.3.2",
30
+ "fs-extra": "^11.3.3",
31
31
  "minimist": "^1.2.8",
32
32
  "ora": "^9.0.0",
33
33
  "picocolors": "^1.1.1",
@@ -42,9 +42,6 @@ src/
42
42
  │ └── index.ts
43
43
  ├── constants/*
44
44
  ├── hooks/*
45
- ├── locales/
46
- │ ├── en-US.json
47
- │ └── zh-CN.json
48
45
  ├── mocks/
49
46
  │ ├── handlers/*
50
47
  │ │ ├── modules/*
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "name": "react-starter",
3
- "private": true,
4
- "version": "0.0.0",
5
3
  "type": "module",
6
- "packageManager": "pnpm@10.20.0",
4
+ "version": "0.0.0",
5
+ "private": true,
6
+ "packageManager": "pnpm@10.27.0",
7
7
  "scripts": {
8
8
  "dev": "vite",
9
9
  "dev:mock": "MOCK=true vite",
@@ -19,47 +19,48 @@
19
19
  },
20
20
  "dependencies": {
21
21
  "axios": "^1.13.2",
22
- "i18next": "^25.6.0",
23
- "react": "^19.2.0",
24
- "react-dom": "^19.2.0",
25
- "react-i18next": "^16.4.1",
26
- "react-router-dom": "^7.9.5",
27
- "zustand": "^5.0.8"
22
+ "i18next": "^25.7.4",
23
+ "react": "^19.2.3",
24
+ "react-dom": "^19.2.3",
25
+ "react-i18next": "^16.5.1",
26
+ "react-router-dom": "^7.12.0",
27
+ "zustand": "^5.0.9"
28
+ },
29
+ "optionalDependencies": {
30
+ "@commitlint/cli": "^20.3.1",
31
+ "@commitlint/config-conventional": "^20.3.1",
32
+ "husky": "^9.1.7",
33
+ "lint-staged": "^16.2.7"
28
34
  },
29
35
  "devDependencies": {
30
- "@component-hook/eslint-plugin": "^1.1.5",
31
- "@playwright/test": "^1.56.1",
32
- "@tailwindcss/vite": "^4.1.16",
36
+ "@component-hook/eslint-plugin": "^1.3.2",
37
+ "@playwright/test": "^1.57.0",
38
+ "@tailwindcss/vite": "^4.1.18",
33
39
  "@testing-library/jest-dom": "^6.9.1",
34
- "@testing-library/react": "^16.3.0",
40
+ "@testing-library/react": "^16.3.1",
35
41
  "@testing-library/user-event": "^14.6.1",
36
- "@tsconfig/node22": "^22.0.2",
37
- "@types/node": "^22.19.0",
38
- "@types/react": "^19.2.2",
39
- "@types/react-dom": "^19.2.2",
40
- "@vitejs/plugin-react-swc": "^4.2.1",
41
- "@vitest/coverage-v8": "^3.2.4",
42
- "autoprefixer": "^10.4.21",
42
+ "@tsconfig/node24": "^24.0.3",
43
+ "@types/node": "^22.19.3",
44
+ "@types/react": "^19.2.7",
45
+ "@types/react-dom": "^19.2.3",
46
+ "@vitejs/plugin-react-swc": "^4.2.2",
47
+ "@vitest/coverage-v8": "^4.0.16",
48
+ "autoprefixer": "^10.4.23",
43
49
  "cssnano": "^7.1.2",
44
- "eslint": "^9.39.1",
45
- "jsdom": "^27.1.0",
46
- "msw": "^2.12.0",
50
+ "eslint": "^9.39.2",
51
+ "fast-glob": "^3.3.3",
52
+ "jsdom": "^27.4.0",
53
+ "msw": "^2.12.7",
47
54
  "postcss": "^8.5.6",
48
- "postcss-preset-env": "^10.4.0",
55
+ "postcss-preset-env": "^10.6.0",
49
56
  "postcss-pxtorem": "^6.1.0",
50
- "prettier": "^3.6.2",
51
- "prettier-plugin-tailwindcss": "^0.7.1",
52
- "tailwindcss": "^4.1.16",
57
+ "prettier": "^3.7.4",
58
+ "prettier-plugin-tailwindcss": "^0.7.2",
59
+ "tailwindcss": "^4.1.18",
53
60
  "typescript": "^5.9.3",
54
- "vite": "^7.2.1",
61
+ "vite": "^7.3.1",
55
62
  "vite-plugin-svg-icons": "^2.0.1",
56
- "vitest": "^3.2.4"
57
- },
58
- "optionalDependencies": {
59
- "@commitlint/cli": "^20.1.0",
60
- "@commitlint/config-conventional": "^20.0.0",
61
- "husky": "^9.1.7",
62
- "lint-staged": "^16.2.6"
63
+ "vitest": "^4.0.16"
63
64
  },
64
65
  "msw": {
65
66
  "workerDirectory": [
@@ -3,28 +3,28 @@
3
3
  "composite": true,
4
4
  "tsBuildInfoFile": "./node_modules/.tmp/tsconfig.app.tsbuildinfo",
5
5
  "target": "ES2020",
6
- "useDefineForClassFields": true,
6
+ "jsx": "react-jsx",
7
7
  "lib": ["ES2020", "DOM", "DOM.Iterable"],
8
+ "moduleDetection": "force",
9
+ "useDefineForClassFields": true,
8
10
  "module": "ESNext",
9
- "skipLibCheck": true,
10
- "paths": {
11
- "@/*": ["./src/*"]
12
- },
13
11
 
14
12
  /* Bundler mode */
15
13
  "moduleResolution": "bundler",
14
+ "paths": {
15
+ "@/*": ["./src/*"]
16
+ },
16
17
  "allowImportingTsExtensions": true,
17
- "verbatimModuleSyntax": true,
18
- "moduleDetection": "force",
19
- "noEmit": true,
20
- "jsx": "react-jsx",
21
18
 
22
19
  /* Linting */
23
20
  "strict": true,
21
+ "noFallthroughCasesInSwitch": true,
24
22
  "noUnusedLocals": true,
25
23
  "noUnusedParameters": true,
24
+ "noEmit": true,
25
+ "verbatimModuleSyntax": true,
26
26
  "erasableSyntaxOnly": true,
27
- "noFallthroughCasesInSwitch": true,
27
+ "skipLibCheck": true,
28
28
  "noUncheckedSideEffectImports": true
29
29
  },
30
30
  "include": ["src/**/*.ts", "src/**/*.d.ts", "src/**/*.tsx"],
@@ -5,6 +5,6 @@
5
5
  "tsBuildInfoFile": "./node_modules/.tmp/tsconfig.vitest.tsbuildinfo",
6
6
  "types": ["vitest/globals"]
7
7
  },
8
- "exclude": [],
9
- "include": ["src/**/*.ts", "src/**/*.d.ts", "src/**/*.tsx", "vitest.setup.ts"]
8
+ "include": ["src/**/*.ts", "src/**/*.d.ts", "src/**/*.tsx", "vitest.setup.ts"],
9
+ "exclude": []
10
10
  }
@@ -13,8 +13,8 @@ runs:
13
13
  - name: install Node.js
14
14
  uses: actions/setup-node@v6
15
15
  with:
16
- node-version: 24.11.1
17
- cache: 'pnpm'
16
+ node-version: 24.12.0
17
+ cache: pnpm
18
18
 
19
19
  - name: install dependencies
20
20
  shell: bash
@@ -10,7 +10,7 @@ jobs:
10
10
  steps:
11
11
  - uses: actions/checkout@v6
12
12
  - name: setup environment
13
- uses: './.github/actions/setup-environment'
13
+ uses: ./.github/actions/setup-environment
14
14
 
15
15
  - name: install Playwright browsers
16
16
  run: npx playwright install --with-deps
@@ -5,12 +5,12 @@ on:
5
5
  branches: [main]
6
6
  paths:
7
7
  - 'src/**'
8
- - 'pnpm-lock.yaml'
9
- - 'package.json'
8
+ - pnpm-lock.yaml
9
+ - package.json
10
10
 
11
11
  jobs:
12
12
  CI:
13
- uses: './.github/workflows/ci.yml'
13
+ uses: ./.github/workflows/ci.yml
14
14
 
15
15
  deploy:
16
16
  runs-on: ubuntu-latest
@@ -6,7 +6,7 @@ on:
6
6
 
7
7
  jobs:
8
8
  CI:
9
- uses: './.github/workflows/ci.yml'
9
+ uses: ./.github/workflows/ci.yml
10
10
 
11
11
  preview:
12
12
  runs-on: ubuntu-latest
@@ -3,7 +3,7 @@ stages:
3
3
  # - deploy
4
4
 
5
5
  include:
6
- - local: '.gitlab/setup.yml'
6
+ - local: .gitlab/setup.yml
7
7
 
8
8
  run_test:
9
9
  stage: test
@@ -16,7 +16,7 @@ run_test:
16
16
  - if: $CI_COMMIT_BRANCH
17
17
  changes:
18
18
  - 'src/**'
19
- - 'pnpm-lock.yaml'
20
- - 'package.json'
19
+ - pnpm-lock.yaml
20
+ - package.json
21
21
  - if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
22
22
  - when: manual
@@ -4,10 +4,16 @@ import packageJson from '../../package.json' with { type: 'json' };
4
4
 
5
5
  const platform = os.platform();
6
6
  const git = platform === 'win32' ? String.raw`C:\Program Files\Git\bin\git.exe` : '/usr/bin/git';
7
- const hash = execFileSync(git, ['rev-parse', 'HEAD']).toString().trim().slice(0, 7);
7
+ let hash = 'unknown';
8
+
9
+ try {
10
+ hash = execFileSync(git, ['rev-parse', 'HEAD']).toString().trim().slice(0, 7);
11
+ } catch {
12
+ hash = 'no-git-detected';
13
+ }
8
14
 
9
15
  process.env.VITE_APP_VERSION = packageJson.version;
10
- process.env.VITE_APP_LAST_COMMIT_HASH = `${hash}`;
16
+ process.env.VITE_APP_LAST_COMMIT_HASH = hash;
11
17
  process.env.VITE_APP_BUILD_EPOCH = Date.now().toString();
12
18
 
13
19
  if (process.env.MOCK) {
@@ -1,5 +1,4 @@
1
1
  {
2
- "files": [],
3
2
  "references": [
4
3
  {
5
4
  "path": "./tsconfig.node.json"
@@ -10,5 +9,6 @@
10
9
  {
11
10
  "path": "./tsconfig.vitest.json"
12
11
  }
13
- ]
12
+ ],
13
+ "files": []
14
14
  }
@@ -1,12 +1,12 @@
1
1
  {
2
- "extends": "@tsconfig/node22/tsconfig.json",
2
+ "extends": "@tsconfig/node24/tsconfig.json",
3
3
  "compilerOptions": {
4
4
  "composite": true,
5
- "noEmit": true,
6
5
  "tsBuildInfoFile": "./node_modules/.tmp/tsconfig.node.tsbuildinfo",
7
6
  "module": "ESNext",
8
7
  "moduleResolution": "bundler",
9
- "types": ["node"]
8
+ "types": ["node"],
9
+ "noEmit": true
10
10
  },
11
11
  "include": ["vite.config.ts", "package.json", "vitest.config.ts", "playwright.config.ts", "scripts/**/*.ts"]
12
12
  }
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "name": "vue-starter",
3
+ "type": "module",
3
4
  "version": "0.0.0",
4
5
  "private": true,
5
- "type": "module",
6
- "packageManager": "pnpm@10.20.0",
6
+ "packageManager": "pnpm@10.27.0",
7
7
  "scripts": {
8
8
  "dev": "vite",
9
9
  "dev:mock": "MOCK=true vite",
@@ -21,48 +21,49 @@
21
21
  "axios": "^1.13.2",
22
22
  "pinia": "^3.0.4",
23
23
  "pinia-plugin-persistedstate": "^4.7.1",
24
- "vue": "^3.5.23",
24
+ "vue": "^3.5.26",
25
25
  "vue-i18n": "^11.1.12",
26
- "vue-router": "^4.6.3"
26
+ "vue-router": "^4.6.4"
27
+ },
28
+ "optionalDependencies": {
29
+ "@commitlint/cli": "^20.3.1",
30
+ "@commitlint/config-conventional": "^20.3.1",
31
+ "husky": "^9.1.7",
32
+ "lint-staged": "^16.2.7"
27
33
  },
28
34
  "devDependencies": {
29
- "@component-hook/eslint-plugin": "^1.1.5",
30
- "@intlify/unplugin-vue-i18n": "^11.0.1",
31
- "@playwright/test": "^1.56.1",
32
- "@tailwindcss/vite": "^4.1.16",
35
+ "@component-hook/eslint-plugin": "^1.3.2",
36
+ "@intlify/unplugin-vue-i18n": "^11.0.3",
37
+ "@playwright/test": "^1.57.0",
38
+ "@tailwindcss/vite": "^4.1.18",
33
39
  "@testing-library/jest-dom": "^6.9.1",
34
40
  "@testing-library/user-event": "^14.6.1",
35
41
  "@testing-library/vue": "^8.1.0",
36
- "@tsconfig/node22": "^22.0.2",
37
- "@types/node": "^22.19.0",
38
- "@vitejs/plugin-vue": "^6.0.1",
39
- "@vitest/coverage-v8": "^3.2.4",
42
+ "@tsconfig/node24": "^24.0.3",
43
+ "@types/node": "^22.19.3",
44
+ "@vitejs/plugin-vue": "^6.0.3",
45
+ "@vitest/coverage-v8": "^4.0.16",
40
46
  "@vue/tsconfig": "^0.8.1",
41
- "autoprefixer": "^10.4.21",
47
+ "autoprefixer": "^10.4.23",
42
48
  "cssnano": "^7.1.2",
43
- "eslint": "^9.39.1",
44
- "jsdom": "^27.1.0",
45
- "msw": "^2.12.0",
49
+ "eslint": "^9.39.2",
50
+ "fast-glob": "^3.3.3",
51
+ "jsdom": "^27.4.0",
52
+ "msw": "^2.12.7",
46
53
  "postcss": "^8.5.6",
47
- "postcss-preset-env": "^10.4.0",
54
+ "postcss-preset-env": "^10.6.0",
48
55
  "postcss-pxtorem": "^6.1.0",
49
- "prettier": "^3.6.2",
50
- "prettier-plugin-tailwindcss": "^0.7.1",
56
+ "prettier": "^3.7.4",
57
+ "prettier-plugin-tailwindcss": "^0.7.2",
51
58
  "rollup-plugin-visualizer": "^6.0.5",
52
- "tailwindcss": "^4.1.16",
59
+ "tailwindcss": "^4.1.18",
53
60
  "typescript": "^5.9.3",
54
- "vite": "^7.2.1",
61
+ "vite": "^7.3.1",
55
62
  "vite-plugin-svg-icons": "^2.0.1",
56
- "vitest": "^3.2.4",
57
- "vue-tsc": "^3.1.3"
63
+ "vitest": "^4.0.16",
64
+ "vue-tsc": "^3.2.2"
58
65
  },
59
66
  "msw": {
60
67
  "workerDirectory": "public"
61
- },
62
- "optionalDependencies": {
63
- "@commitlint/cli": "^20.1.0",
64
- "@commitlint/config-conventional": "^20.0.0",
65
- "husky": "^9.1.7",
66
- "lint-staged": "^16.2.6"
67
68
  }
68
69
  }
@@ -1,6 +1,5 @@
1
1
  import { createApp } from 'vue';
2
2
  import i18NPlugin from '@/plugins/i18n';
3
-
4
3
  import router from '@/router';
5
4
  import App from './App.vue';
6
5
  import { createPinia } from './stores';
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "extends": "@vue/tsconfig/tsconfig.dom.json",
3
- "include": ["src/**/*.ts", "src/**/*.d.ts", "src/**/*.tsx", "src/**/*.vue"],
4
- "exclude": ["src/**/__tests__/*"],
5
3
  "compilerOptions": {
6
4
  "composite": true,
7
5
  "tsBuildInfoFile": "./node_modules/.tmp/tsconfig.app.tsbuildinfo",
8
6
  "paths": {
9
7
  "@/*": ["./src/*"]
10
8
  }
11
- }
9
+ },
10
+ "include": ["src/**/*.ts", "src/**/*.d.ts", "src/**/*.tsx", "src/**/*.vue"],
11
+ "exclude": ["src/**/__tests__/*"]
12
12
  }
@@ -5,6 +5,6 @@
5
5
  "tsBuildInfoFile": "./node_modules/.tmp/tsconfig.vitest.tsbuildinfo",
6
6
  "types": ["vitest/globals"]
7
7
  },
8
- "exclude": [],
9
- "include": ["src/**/*.ts", "src/**/*.d.ts", "src/**/*.tsx", "src/**/*.vue", "vitest.setup.ts"]
8
+ "include": ["src/**/*.ts", "src/**/*.d.ts", "src/**/*.tsx", "src/**/*.vue", "vitest.setup.ts"],
9
+ "exclude": []
10
10
  }