@component-hook/create-app 1.1.2 → 1.1.4
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/README.md +6 -4
- package/dist/index.js +27 -23
- package/package.json +3 -3
- package/template-react/.vscode/extensions.json +9 -0
- package/template-react/.vscode/settings.json +24 -0
- package/template-react/README.md.art +86 -0
- package/template-react/eslint.config.js +18 -0
- package/template-react/index.html.art +13 -0
- package/template-react/lint-staged.config.js +6 -0
- package/template-react/package.json +68 -0
- package/template-react/pnpm-lock.yaml +9897 -0
- package/template-react/public/vite.svg +1 -0
- package/template-react/src/App.tsx +6 -0
- package/template-react/src/__tests__/e2e/home.spec.ts +40 -0
- package/template-react/src/__tests__/unit/pages/home/components/HelloWorld.test.tsx +45 -0
- package/template-react/src/__tests__/unit/pages/home/index.test.tsx +19 -0
- package/template-react/src/__tests__/unit/render/index.tsx +15 -0
- package/template-react/src/assets/svg-icons/react.svg +1 -0
- package/template-react/src/components/common/index.ts +1 -0
- package/template-react/src/components/common/svg-icon/index.ts +1 -0
- package/template-react/src/components/common/svg-icon/src/index.tsx +23 -0
- package/template-react/src/main.tsx +26 -0
- package/template-react/src/mocks/browser.ts +4 -0
- package/template-react/src/mocks/handlers/index.ts +1 -0
- package/template-react/src/mocks/server.ts +4 -0
- package/template-react/src/pages/home/components/hello-world/index.tsx +47 -0
- package/template-react/src/pages/home/index.module.css +8 -0
- package/template-react/src/pages/home/index.tsx +37 -0
- package/template-react/src/plugins/i18n/index.ts +15 -0
- package/template-react/src/plugins/i18n/locales/en-US.json +3 -0
- package/template-react/src/plugins/i18n/locales/zh-TW.json +3 -0
- package/template-react/src/router/index.tsx +22 -0
- package/template-react/src/stores/constants.ts +1 -0
- package/template-react/src/stores/index.ts +1 -0
- package/template-react/src/stores/middleware.ts +17 -0
- package/template-react/src/stores/modules/config.ts +25 -0
- package/template-react/src/styles/base.css +68 -0
- package/template-react/src/styles/common/all.css +1 -0
- package/template-react/src/styles/common/button.css +26 -0
- package/template-react/src/styles/index.css +3 -0
- package/template-react/src/styles/tailwind.css +14 -0
- package/template-react/src/vite-env.d.ts +9 -0
- package/template-react/tsconfig.app.json +32 -0
- package/template-react/tsconfig.vitest.json +10 -0
- package/template-react/vite.config.ts +50 -0
- package/template-react/vitest.config.ts +18 -0
- package/template-react/vitest.setup.ts +13 -0
- package/{template-vue → template-shared}/.github/actions/setup-environment/action.yml +1 -1
- package/{template-vue → template-shared}/.github/workflows/ci.yml +1 -1
- package/{template-vue → template-shared}/.github/workflows/deploy.yml +1 -1
- package/{template-vue → template-shared}/.github/workflows/preview.yml +1 -1
- package/template-vue/README.md.art +1 -1
- package/template-vue/package.json +20 -20
- package/template-vue/src/styles/base.css +14 -3
- /package/{template-vue → template-shared}/.browserslistrc +0 -0
- /package/{template-vue → template-shared}/.github/renovate.json +0 -0
- /package/{template-vue → template-shared}/.gitlab/setup.yml +0 -0
- /package/{template-vue → template-shared}/.husky/commit-msg +0 -0
- /package/{template-vue → template-shared}/.husky/pre-commit +0 -0
- /package/{template-vue → template-shared}/LICENSE +0 -0
- /package/{template-vue → template-shared}/_gitignore +0 -0
- /package/{template-vue → template-shared}/_gitlab-ci.yml +0 -0
- /package/{template-vue → template-shared}/commitlint.config.js +0 -0
- /package/{template-vue → template-shared}/playwright.config.ts +0 -0
- /package/{template-vue → template-shared}/postcss.config.js +0 -0
- /package/{template-vue → template-shared}/prettier.config.js +0 -0
- /package/{template-vue → template-shared}/tsconfig.json +0 -0
- /package/{template-vue → template-shared}/tsconfig.node.json +0 -0
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { cleanup } from '@testing-library/react';
|
|
2
|
+
import { mswServer } from '@/mocks/server';
|
|
3
|
+
import '@testing-library/jest-dom';
|
|
4
|
+
import '@/plugins/i18n';
|
|
5
|
+
|
|
6
|
+
beforeAll(() => mswServer.listen());
|
|
7
|
+
|
|
8
|
+
afterEach(() => {
|
|
9
|
+
cleanup();
|
|
10
|
+
mswServer.resetHandlers();
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
afterAll(() => mswServer.close());
|
|
@@ -8,7 +8,7 @@ This project is built with [vue3](https://vuejs.org/) + [vite](https://vite.dev/
|
|
|
8
8
|
- **API & Mocking**: Handles requests with [axios](https://axios-http.com/docs/intro) and mocks APIs using [msw](https://mswjs.io/).
|
|
9
9
|
- **Code Quality**: Enforces standards with [eslint](https://eslint.org/) and [prettier](https://prettier.io/), with [husky](https://www.npmjs.com/package/husky), [commitlint](https://commitlint.js.org/#/), and [lint-staged](https://github.com/okonet/lint-staged) for commit validation.
|
|
10
10
|
- **Testing**: Uses [vitest](https://vitest.dev/) + [testing-library](https://testing-library.com/) for unit testing and [playwright](https://playwright.dev/) for E2E testing.
|
|
11
|
-
- **Optimization**: Compresses CSS with [cssnano](https://cssnano.github.io/cssnano/)
|
|
11
|
+
- **Optimization**: Compresses CSS with [cssnano](https://cssnano.github.io/cssnano/), converts units with [postcss-pxtorem](https://www.npmjs.com/package/postcss-pxtorem), convert modern CSS into something most browsers can understand with [postcss-preset-env](https://www.npmjs.com/package/postcss-preset-env), and analyzes assets with [rollup-plugin-visualizer](https://github.com/btd/rollup-plugin-visualizer).
|
|
12
12
|
- **CI/CD**: Integrates `{{gitRepository}}` for automated testing and deployment.
|
|
13
13
|
|
|
14
14
|
## Code Features / Opinions
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"version": "0.0.0",
|
|
4
4
|
"private": true,
|
|
5
5
|
"type": "module",
|
|
6
|
-
"packageManager": "pnpm@10.
|
|
6
|
+
"packageManager": "pnpm@10.15.0",
|
|
7
7
|
"scripts": {
|
|
8
8
|
"dev": "vite",
|
|
9
9
|
"dev:mock": "MOCK=true vite",
|
|
@@ -18,42 +18,42 @@
|
|
|
18
18
|
"preview": "vite preview"
|
|
19
19
|
},
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"axios": "^1.
|
|
21
|
+
"axios": "^1.11.0",
|
|
22
22
|
"pinia": "^3.0.3",
|
|
23
|
-
"pinia-plugin-persistedstate": "^4.
|
|
24
|
-
"vue": "^3.5.
|
|
25
|
-
"vue-i18n": "^11.1.
|
|
23
|
+
"pinia-plugin-persistedstate": "^4.5.0",
|
|
24
|
+
"vue": "^3.5.19",
|
|
25
|
+
"vue-i18n": "^11.1.11",
|
|
26
26
|
"vue-router": "^4.5.1"
|
|
27
27
|
},
|
|
28
28
|
"devDependencies": {
|
|
29
|
-
"@component-hook/eslint-plugin": "1.1.
|
|
29
|
+
"@component-hook/eslint-plugin": "1.1.3",
|
|
30
30
|
"@intlify/unplugin-vue-i18n": "^6.0.8",
|
|
31
|
-
"@playwright/test": "^1.
|
|
32
|
-
"@tailwindcss/vite": "^4.1.
|
|
33
|
-
"@testing-library/jest-dom": "^6.
|
|
31
|
+
"@playwright/test": "^1.55.0",
|
|
32
|
+
"@tailwindcss/vite": "^4.1.12",
|
|
33
|
+
"@testing-library/jest-dom": "^6.8.0",
|
|
34
34
|
"@testing-library/user-event": "^14.6.1",
|
|
35
35
|
"@testing-library/vue": "^8.1.0",
|
|
36
36
|
"@tsconfig/node22": "^22.0.2",
|
|
37
|
-
"@types/node": "^22.
|
|
38
|
-
"@vitejs/plugin-vue": "^
|
|
37
|
+
"@types/node": "^22.17.2",
|
|
38
|
+
"@vitejs/plugin-vue": "^6.0.1",
|
|
39
39
|
"@vitest/coverage-v8": "^3.2.4",
|
|
40
|
-
"@vue/tsconfig": "^0.
|
|
40
|
+
"@vue/tsconfig": "^0.8.1",
|
|
41
41
|
"autoprefixer": "^10.4.21",
|
|
42
|
-
"cssnano": "^7.0
|
|
43
|
-
"eslint": "^9.
|
|
42
|
+
"cssnano": "^7.1.0",
|
|
43
|
+
"eslint": "^9.33.0",
|
|
44
44
|
"jsdom": "^26.1.0",
|
|
45
|
-
"msw": "^2.10.
|
|
45
|
+
"msw": "^2.10.5",
|
|
46
46
|
"postcss": "^8.5.6",
|
|
47
47
|
"postcss-preset-env": "^10.2.4",
|
|
48
48
|
"postcss-pxtorem": "^6.1.0",
|
|
49
49
|
"prettier": "^3.6.2",
|
|
50
50
|
"rollup-plugin-visualizer": "^6.0.3",
|
|
51
|
-
"tailwindcss": "^4.1.
|
|
52
|
-
"typescript": "^5.
|
|
53
|
-
"vite": "^
|
|
51
|
+
"tailwindcss": "^4.1.12",
|
|
52
|
+
"typescript": "^5.9.2",
|
|
53
|
+
"vite": "^7.1.3",
|
|
54
54
|
"vite-plugin-svg-icons": "^2.0.1",
|
|
55
55
|
"vitest": "^3.2.4",
|
|
56
|
-
"vue-tsc": "^
|
|
56
|
+
"vue-tsc": "^3.0.6"
|
|
57
57
|
},
|
|
58
58
|
"msw": {
|
|
59
59
|
"workerDirectory": "public"
|
|
@@ -62,6 +62,6 @@
|
|
|
62
62
|
"@commitlint/cli": "^19.8.1",
|
|
63
63
|
"@commitlint/config-conventional": "^19.8.1",
|
|
64
64
|
"husky": "^9.1.7",
|
|
65
|
-
"lint-staged": "^16.1.
|
|
65
|
+
"lint-staged": "^16.1.5"
|
|
66
66
|
}
|
|
67
67
|
}
|
|
@@ -7,11 +7,16 @@
|
|
|
7
7
|
color: rgba(255, 255, 255, 0.87);
|
|
8
8
|
background-color: #242424;
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
overscroll-behavior: none none;
|
|
11
|
+
touch-action: manipulation;
|
|
12
|
+
user-select: none;
|
|
11
13
|
text-rendering: optimizeLegibility;
|
|
12
|
-
-webkit-font-smoothing: antialiased;
|
|
13
14
|
-moz-osx-font-smoothing: grayscale;
|
|
14
|
-
-
|
|
15
|
+
-moz-touch-callout: none;
|
|
16
|
+
-ms-touch-callout: none;
|
|
17
|
+
-webkit-font-smoothing: antialiased;
|
|
18
|
+
-webkit-touch-callout: none;
|
|
19
|
+
-webkit-overflow-scrolling: touch;
|
|
15
20
|
}
|
|
16
21
|
|
|
17
22
|
@media (prefers-color-scheme: light) {
|
|
@@ -29,6 +34,12 @@ body {
|
|
|
29
34
|
min-height: 100vh;
|
|
30
35
|
}
|
|
31
36
|
|
|
37
|
+
img {
|
|
38
|
+
-webkit-touch-callout: none;
|
|
39
|
+
-webkit-user-drag: none;
|
|
40
|
+
user-select: none;
|
|
41
|
+
}
|
|
42
|
+
|
|
32
43
|
#app {
|
|
33
44
|
max-width: 80rem;
|
|
34
45
|
margin: auto;
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|