@component-hook/create-app 1.1.0 → 1.1.2
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 +61 -37
- package/dist/index.js +39 -22
- package/package.json +2 -2
- package/template-vue/.browserslistrc +10 -0
- package/template-vue/.github/workflows/preview.yml +1 -1
- package/template-vue/.husky/commit-msg +0 -2
- package/template-vue/.husky/pre-commit +0 -2
- package/template-vue/README.md.art +34 -55
- package/template-vue/_gitignore +0 -3
- package/template-vue/index.html.art +2 -0
- package/template-vue/lint-staged.config.js +2 -0
- package/template-vue/package.json +32 -38
- package/template-vue/playwright.config.ts +12 -23
- package/template-vue/postcss.config.js +13 -10
- package/template-vue/src/__tests__/e2e/home.spec.ts +61 -0
- package/template-vue/src/__tests__/unit/{components/indexPage → pages/home/components}/HelloWorld.test.ts +2 -2
- package/template-vue/src/__tests__/unit/pages/home/index.test.ts +17 -0
- package/template-vue/src/components/common/index.ts +1 -0
- package/template-vue/src/components/common/svg-icon/index.ts +1 -0
- package/template-vue/src/main.ts +4 -7
- package/template-vue/src/{components/indexPage → pages/home/components}/HelloWorld.vue +3 -8
- package/template-vue/src/pages/{IndexPage.vue → home/index.vue} +15 -3
- package/template-vue/src/plugins/i18n.ts +2 -6
- package/template-vue/src/router/index.ts +2 -2
- package/template-vue/src/stores/constants.ts.art +1 -0
- package/template-vue/src/stores/index.ts +14 -2
- package/template-vue/src/stores/modules/config.ts +1 -1
- package/template-vue/src/styles/base.css +48 -0
- package/template-vue/src/styles/common/all.css +1 -0
- package/template-vue/src/styles/common/button.css +15 -0
- package/template-vue/src/styles/index.css +3 -0
- package/template-vue/src/styles/tailwind.css +1 -0
- package/template-vue/src/vite-env.d.ts +1 -0
- package/template-vue/tsconfig.app.json +2 -3
- package/template-vue/tsconfig.node.json +2 -2
- package/template-vue/tsconfig.vitest.json +5 -3
- package/template-vue/vite.config.ts +14 -7
- package/template-vue/vitest.config.ts +1 -4
- package/template-vue/{src/__tests__/setup/unit-test.ts → vitest.setup.ts} +7 -1
- package/template-vue/public/mockServiceWorker.js +0 -307
- package/template-vue/src/__tests__/e2e/IndexPage.spec.ts +0 -49
- package/template-vue/src/components.d.ts +0 -14
- package/template-vue/src/styles/common/all.postcss +0 -1
- package/template-vue/src/styles/common/button.postcss +0 -12
- package/template-vue/src/styles/index.postcss +0 -1
- package/template-vue/src/styles/tailwind.postcss +0 -39
- package/template-vue/tailwind.config.js +0 -20
- /package/template-vue/src/assets/{images/svgIcons → svg-icons}/vue.svg +0 -0
- /package/template-vue/src/components/common/{SvgIcon.vue → svg-icon/src/index.vue} +0 -0
package/README.md
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Scaffolding a basic `typescript` project.
|
|
4
4
|
|
|
5
5
|
> **Compatibility Note:**
|
|
6
|
-
> Requires [Node.js](https://nodejs.org/en/) version
|
|
6
|
+
> Requires [Node.js](https://nodejs.org/en/) version 20+. However, some templates require a higher Node.js version to work, please upgrade if your package manager warns about it.
|
|
7
7
|
|
|
8
8
|
<p>
|
|
9
9
|
<a href="https://npm-stat.com/charts.html?package=@component-hook/create-app">
|
|
@@ -44,39 +44,63 @@ Currently supported template presets include:
|
|
|
44
44
|
|
|
45
45
|
- `vue`
|
|
46
46
|
|
|
47
|
-
## Project
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
-
|
|
54
|
-
-
|
|
55
|
-
- [
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
-
|
|
60
|
-
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
-
|
|
65
|
-
-
|
|
66
|
-
- `
|
|
67
|
-
-
|
|
68
|
-
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
-
|
|
73
|
-
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
47
|
+
## Project Features Overview
|
|
48
|
+
|
|
49
|
+
This project leverages modern frontend practices and tooling, covering development experience, code quality, testing, and deployment.
|
|
50
|
+
|
|
51
|
+
### Development Experience
|
|
52
|
+
|
|
53
|
+
- **Written in TypeScript**: Provides type safety and better maintainability.
|
|
54
|
+
- **Styled with Tailwind CSS**: Utility-first CSS framework for fast and consistent UI styling.
|
|
55
|
+
- **SVG Support**: Integrated [`vite-plugin-svg-icons`](https://github.com/vbenjs/vite-plugin-svg-icons) to use SVGs as Vue components.
|
|
56
|
+
|
|
57
|
+
### API & Mocking
|
|
58
|
+
|
|
59
|
+
- Handles HTTP requests using `axios`.
|
|
60
|
+
- Uses `msw` (Mock Service Worker) for mocking APIs, enabling smooth local development and testing.
|
|
61
|
+
|
|
62
|
+
### Code Quality
|
|
63
|
+
|
|
64
|
+
- Enforces consistent code style with `ESLint` and `Prettier`.
|
|
65
|
+
- Enhanced with:
|
|
66
|
+
- `husky`: For Git hooks.
|
|
67
|
+
- `lint-staged`: Only runs linters on staged files.
|
|
68
|
+
- `commitlint`: Ensures commit messages follow conventional format.
|
|
69
|
+
|
|
70
|
+
### Testing
|
|
71
|
+
|
|
72
|
+
- Unit testing with `Vitest` + `Testing Library`.
|
|
73
|
+
- End-to-end (E2E) testing using `Playwright`.
|
|
74
|
+
|
|
75
|
+
### Optimization
|
|
76
|
+
|
|
77
|
+
- Minifies CSS with `cssnano`.
|
|
78
|
+
- Converts px to rem using `postcss-pxtorem` for responsive design.
|
|
79
|
+
- Uses `rollup-plugin-visualizer` to analyze bundle sizes.
|
|
80
|
+
|
|
81
|
+
### CI / CD
|
|
82
|
+
|
|
83
|
+
- Integrated `GitHub Actions` and `GitLab CI` for automated testing and deployment.
|
|
84
|
+
|
|
85
|
+
### Project Structure & Conventions
|
|
86
|
+
|
|
87
|
+
- The project root alias `@` points to the `src` directory (`<project_root>/src`).
|
|
88
|
+
- ESLint uses a custom plugin: [`@component-hook/eslint-plugin`](https://www.npmjs.com/package/@component-hook/eslint-plugin).
|
|
89
|
+
|
|
90
|
+
### Tip: Solving `npx: command not found`
|
|
91
|
+
|
|
92
|
+
If you encounter `npx: command not found`, run the following command to create a symbolic link:
|
|
93
|
+
|
|
94
|
+
```bash
|
|
95
|
+
ln -s $(which npx) /usr/local/bin/npx
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
### Predefined Global Variables
|
|
99
|
+
|
|
100
|
+
These variables are injected at build time and are fully typed:
|
|
101
|
+
|
|
102
|
+
| Variable Name | Description |
|
|
103
|
+
| ---------------------- | -------------------------------------------- |
|
|
104
|
+
| `VITE_APP_VERSION` | Read from `package.json` version |
|
|
105
|
+
| `VITE_APP_BUILD_EPOCH` | Timestamp generated at build time |
|
|
106
|
+
| `VITE_APP_MOCK` | Indicates whether the mock environment is on |
|
package/dist/index.js
CHANGED
|
@@ -1,28 +1,29 @@
|
|
|
1
1
|
// src/index.ts
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import colors2 from "picocolors";
|
|
7
|
-
import { copy, ensureDirSync } from "fs-extra/esm";
|
|
2
|
+
import { readdirSync as readdirSync2, statSync } from "fs";
|
|
3
|
+
import { readdir, readFile, writeFile } from "fs/promises";
|
|
4
|
+
import path2 from "path";
|
|
5
|
+
import { fileURLToPath } from "url";
|
|
8
6
|
import artTemplate from "art-template";
|
|
7
|
+
import { copy, ensureDirSync } from "fs-extra/esm";
|
|
8
|
+
import minimist from "minimist";
|
|
9
9
|
import ora from "ora";
|
|
10
|
+
import colors2 from "picocolors";
|
|
11
|
+
|
|
12
|
+
// src/constants.ts
|
|
13
|
+
var DEFAULT_PROJECT_NAME = "basic-project";
|
|
14
|
+
var TEMPLATES = ["vue"];
|
|
15
|
+
var GITHUB_ACTIONS = "GitHub Actions";
|
|
16
|
+
var GITLAB_CI = "GitLab CI";
|
|
10
17
|
|
|
11
18
|
// src/prompts.ts
|
|
12
|
-
import { existsSync as existsSync2 } from "
|
|
13
|
-
import prompts from "prompts";
|
|
19
|
+
import { existsSync as existsSync2 } from "fs";
|
|
14
20
|
import colors from "picocolors";
|
|
21
|
+
import prompts from "prompts";
|
|
15
22
|
|
|
16
23
|
// src/utils.ts
|
|
17
|
-
import
|
|
18
|
-
import
|
|
24
|
+
import { existsSync, readdirSync } from "fs";
|
|
25
|
+
import path from "path";
|
|
19
26
|
import { remove } from "fs-extra/esm";
|
|
20
|
-
|
|
21
|
-
// src/config.ts
|
|
22
|
-
var DEFAULT_PROJECT_NAME = "basic-project";
|
|
23
|
-
var TEMPLATES = ["vue"];
|
|
24
|
-
|
|
25
|
-
// src/utils.ts
|
|
26
27
|
function formatTargetDir(targetDir) {
|
|
27
28
|
if (!targetDir) return targetDir;
|
|
28
29
|
targetDir = targetDir.trim();
|
|
@@ -46,6 +47,9 @@ function isValidPackageName(projectName) {
|
|
|
46
47
|
function toValidPackageName(projectName) {
|
|
47
48
|
return projectName.trim().toLowerCase().replaceAll(/\s+/g, "-").replace(/^[._]/, "").replaceAll(/[^a-z\d\-~]+/g, "-");
|
|
48
49
|
}
|
|
50
|
+
function toUpperCasePackageName(projectName) {
|
|
51
|
+
return projectName.split("-").map((str) => `${str[0].toUpperCase()}${str.slice(1)}`).join(" ");
|
|
52
|
+
}
|
|
49
53
|
function getPkgManagerInfo() {
|
|
50
54
|
const userAgent = process.env.npm_config_user_agent;
|
|
51
55
|
if (!userAgent) return;
|
|
@@ -108,7 +112,7 @@ function operationPrompts({ targetDir, template }) {
|
|
|
108
112
|
type: (_, { projectName: nameAnswer }) => {
|
|
109
113
|
return isValidPackageName(getProjectName(nameAnswer)) ? null : "text";
|
|
110
114
|
},
|
|
111
|
-
name: "
|
|
115
|
+
name: "packageName",
|
|
112
116
|
message: styleTitle("Package name:"),
|
|
113
117
|
initial: (_, { projectName: nameAnswer }) => toValidPackageName(getProjectName(nameAnswer)),
|
|
114
118
|
validate: (name) => {
|
|
@@ -154,7 +158,7 @@ Available templates:
|
|
|
154
158
|
${colors2.green("vue")}
|
|
155
159
|
`;
|
|
156
160
|
async function copyTemplateFolder(root, templateDir, packageName) {
|
|
157
|
-
const isGitlab = argv.
|
|
161
|
+
const isGitlab = argv.l || argv.gitlab;
|
|
158
162
|
const [files, pkgJson] = await Promise.all([
|
|
159
163
|
readdir(templateDir),
|
|
160
164
|
readFile(path2.join(templateDir, "package.json"), "utf-8")
|
|
@@ -172,11 +176,24 @@ async function copyTemplateFolder(root, templateDir, packageName) {
|
|
|
172
176
|
}
|
|
173
177
|
const templatePath = path2.join(templateDir, file);
|
|
174
178
|
if (file.endsWith(".art")) {
|
|
175
|
-
const
|
|
176
|
-
const
|
|
177
|
-
|
|
179
|
+
const isScript = file.endsWith(".js.art") || file.endsWith(".ts.art");
|
|
180
|
+
const name = isScript ? packageName : toUpperCasePackageName(packageName);
|
|
181
|
+
const replacedPath = targetPath.replace(".art", "");
|
|
182
|
+
const renderedResult = artTemplate(templatePath, {
|
|
183
|
+
projectName: name,
|
|
184
|
+
gitRepository: isGitlab ? GITLAB_CI : GITHUB_ACTIONS
|
|
185
|
+
});
|
|
186
|
+
ensureDirSync(path2.dirname(replacedPath));
|
|
187
|
+
return writeFile(replacedPath, renderedResult);
|
|
188
|
+
}
|
|
189
|
+
if (statSync(templatePath).isDirectory()) {
|
|
190
|
+
const subFiles = readdirSync2(templatePath);
|
|
191
|
+
const rewriteOrCopySubFilePromises = subFiles.map((subFile) => rewriteOrCopyFile(path2.join(file, subFile)));
|
|
192
|
+
return Promise.all(rewriteOrCopySubFilePromises).then(() => {
|
|
193
|
+
});
|
|
194
|
+
} else {
|
|
195
|
+
return copy(templatePath, targetPath);
|
|
178
196
|
}
|
|
179
|
-
return copy(templatePath, targetPath);
|
|
180
197
|
};
|
|
181
198
|
pkg.name = packageName;
|
|
182
199
|
return Promise.all([
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@component-hook/create-app",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.2",
|
|
4
4
|
"description": "Scaffolding a basic typescript project",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
"dist"
|
|
15
15
|
],
|
|
16
16
|
"engines": {
|
|
17
|
-
"node": "
|
|
17
|
+
"node": ">=20.19.3"
|
|
18
18
|
},
|
|
19
19
|
"repository": {
|
|
20
20
|
"type": "git",
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
# Click this link to view browser coverage https://browsersl.ist/#q=%3E+1.5%25%0Aios+%3E%3D+12%0Achrome+%3E%3D+49%0Anot+ie+%3C%3D+11%0Alast+2+versions%0Anot+dead
|
|
2
|
+
|
|
3
|
+
# Browsers that support
|
|
4
|
+
|
|
5
|
+
> 1.5%
|
|
6
|
+
ios >= 12
|
|
7
|
+
chrome >= 49
|
|
8
|
+
not ie <= 11
|
|
9
|
+
last 2 versions
|
|
10
|
+
not dead
|
|
@@ -1,49 +1,26 @@
|
|
|
1
1
|
# {{projectName}}
|
|
2
2
|
|
|
3
|
+
This project is built with [vue3](https://vuejs.org/) + [vite](https://vite.dev/), using [pnpm](https://pnpm.io/) for package management and [pinia](https://pinia.vuejs.org/) for state management.
|
|
4
|
+
|
|
3
5
|
## Features
|
|
4
6
|
|
|
5
|
-
-
|
|
6
|
-
-
|
|
7
|
-
-
|
|
8
|
-
- [
|
|
9
|
-
|
|
10
|
-
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
-
|
|
15
|
-
-
|
|
16
|
-
- [
|
|
17
|
-
-
|
|
18
|
-
- [Vite-plugin-svg-icons](https://github.com/vbenjs/vite-plugin-svg-icons) generate svg sprite map
|
|
19
|
-
- [Unplugin-vue-components](https://www.npmjs.com/package/unplugin-vue-components) auto importing for common components
|
|
20
|
-
- Eslint
|
|
21
|
-
- [@component-hook/eslint-plugin](https://www.npmjs.com/package/@component-hook/eslint-plugin?activeTab=readme)
|
|
22
|
-
- Prettier
|
|
23
|
-
- [Husky](https://www.npmjs.com/package/husky) to improves commits
|
|
24
|
-
- if encounter npx: command not found, can execute `ln -s $(which npx) /usr/local/bin/npx` in zsh
|
|
25
|
-
- [commitlint](https://commitlint.js.org/#/) checks if your commit messages meet the conventional commit format
|
|
26
|
-
- [lint-staged](https://github.com/okonet/lint-staged) filter files checked by pre commit lint
|
|
27
|
-
- Alias `@` to `<project_root>/src`
|
|
28
|
-
- Mock use [msw](https://mswjs.io/)
|
|
29
|
-
- `npx msw init ./public`
|
|
30
|
-
- Unit test use [Vitest](https://vitest.dev/) + [Testing Library](https://testing-library.com/)
|
|
31
|
-
- [jsdom](https://www.npmjs.com/package/jsdom)
|
|
32
|
-
- [@vitest/coverage-v8](https://vitest.dev/guide/coverage.html)
|
|
33
|
-
- [@testing-library/jest-dom](https://testing-library.com/docs/ecosystem-jest-dom/)
|
|
34
|
-
- [@testing-library/vue](https://testing-library.com/docs/vue-testing-library/intro/)
|
|
35
|
-
- [@testing-library/user-event](https://testing-library.com/docs/ecosystem-user-event/)
|
|
36
|
-
- E2E test use [playwright](https://playwright.dev/)
|
|
37
|
-
- [Rollup-plugin-visualizer](https://github.com/btd/rollup-plugin-visualizer) visualize and analyze your Rollup bundle to see which modules are taking up space
|
|
7
|
+
- **Development Experience**: Written in [typeScript](https://www.typescriptlang.org/), styled with [tailwindcss](https://tailwindcss.com/), and structured with [vue-router](https://router.vuejs.org/), and [vue-i18n](https://vue-i18n.intlify.dev/). Supports SVGs ([vite-plugin-svg-icons](https://github.com/vbenjs/vite-plugin-svg-icons)).
|
|
8
|
+
- **API & Mocking**: Handles requests with [axios](https://axios-http.com/docs/intro) and mocks APIs using [msw](https://mswjs.io/).
|
|
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
|
+
- **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/) , converts units with [postcss-pxtorem](https://www.npmjs.com/package/postcss-pxtorem), and analyzes assets with [rollup-plugin-visualizer](https://github.com/btd/rollup-plugin-visualizer).
|
|
12
|
+
- **CI/CD**: Integrates `{{gitRepository}}` for automated testing and deployment.
|
|
13
|
+
|
|
14
|
+
## Code Features / Opinions
|
|
15
|
+
|
|
16
|
+
- Project root aliased as `@` to `<project_root>/src`
|
|
17
|
+
- Store persistedstate use [pinia-plugin-persistedstate](https://www.npmjs.com/package/pinia-plugin-persistedstate)
|
|
18
|
+
- ESlint plugin use [@component-hook/eslint-plugin](https://www.npmjs.com/package/@component-hook/eslint-plugin?activeTab=readme)
|
|
19
|
+
- if encounter npx: command not found, can execute `ln -s $(which npx) /usr/local/bin/npx` in zsh
|
|
38
20
|
- Predefined and fully typed global variables:
|
|
39
21
|
- `VITE_APP_VERSION` is read from `package.json` version at build time
|
|
40
22
|
- `VITE_APP_BUILD_EPOCH` is populated as `new Date().getTime()` at build time
|
|
41
|
-
-
|
|
42
|
-
- ci - on workflow call and dispatch
|
|
43
|
-
- deploy - on push main branch
|
|
44
|
-
- preview - on pull request
|
|
45
|
-
- Gitlab CI
|
|
46
|
-
- run tests - on branches, merge request and manual
|
|
23
|
+
- `VITE_APP_MOCK` is use mock environment
|
|
47
24
|
|
|
48
25
|
## Project Files
|
|
49
26
|
|
|
@@ -51,33 +28,34 @@
|
|
|
51
28
|
src/
|
|
52
29
|
├── __tests__/
|
|
53
30
|
│ ├── __mocks__/
|
|
54
|
-
│ ├── setup/
|
|
55
|
-
│ │ └── unitTest.ts
|
|
56
31
|
│ ├── e2e/*
|
|
57
32
|
│ └── unit/*
|
|
58
|
-
├── apis/*
|
|
59
33
|
├── assets/*
|
|
60
|
-
│ └──
|
|
61
|
-
│ └── svgIcons
|
|
34
|
+
│ └── svg-icons
|
|
62
35
|
│ └── vue.svg
|
|
63
36
|
├── components/
|
|
64
|
-
│
|
|
65
|
-
│
|
|
66
|
-
│
|
|
67
|
-
│ └──
|
|
68
|
-
|
|
37
|
+
│ └── common
|
|
38
|
+
│ ├── svg-icon/
|
|
39
|
+
│ │ ├── src
|
|
40
|
+
│ │ │ └── index.vue
|
|
41
|
+
│ │ └── index.ts
|
|
42
|
+
│ └── index.ts
|
|
43
|
+
├── constants/*
|
|
69
44
|
├── hooks/*
|
|
70
45
|
├── locales/
|
|
71
46
|
│ ├── en-US.json
|
|
72
47
|
│ └── zh-CN.json
|
|
73
48
|
├── mocks/
|
|
74
49
|
│ ├── handlers/*
|
|
75
|
-
│ │ ├──
|
|
50
|
+
│ │ ├── modules/*
|
|
76
51
|
│ │ └── index.ts
|
|
77
52
|
│ │── browser.ts
|
|
78
53
|
│ └── server.ts
|
|
79
54
|
├── pages/
|
|
80
|
-
│ └──
|
|
55
|
+
│ └── home/
|
|
56
|
+
│ ├── components
|
|
57
|
+
│ │ └── HelloWorld.vue
|
|
58
|
+
│ └── index.vue
|
|
81
59
|
├── plugins/
|
|
82
60
|
│ └── i18n.ts
|
|
83
61
|
├── router/
|
|
@@ -88,10 +66,11 @@ src/
|
|
|
88
66
|
│ └── index.ts
|
|
89
67
|
├── styles/
|
|
90
68
|
│ ├── common/
|
|
91
|
-
| │ ├── all.
|
|
92
|
-
| │ └── button.
|
|
93
|
-
│ ├──
|
|
94
|
-
│
|
|
69
|
+
| │ ├── all.css
|
|
70
|
+
| │ └── button.css
|
|
71
|
+
│ ├── base.css
|
|
72
|
+
│ ├── index.css
|
|
73
|
+
│ └── tailwind.css
|
|
95
74
|
├── types/*
|
|
96
75
|
├── utils/*
|
|
97
76
|
├── App.vue
|
package/template-vue/_gitignore
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vue-starter",
|
|
3
3
|
"version": "0.0.0",
|
|
4
|
-
"
|
|
4
|
+
"private": true,
|
|
5
5
|
"type": "module",
|
|
6
|
-
"packageManager": "pnpm@10.
|
|
6
|
+
"packageManager": "pnpm@10.12.4",
|
|
7
7
|
"scripts": {
|
|
8
8
|
"dev": "vite",
|
|
9
9
|
"dev:mock": "MOCK=true vite",
|
|
@@ -18,56 +18,50 @@
|
|
|
18
18
|
"preview": "vite preview"
|
|
19
19
|
},
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"axios": "^1.
|
|
22
|
-
"pinia": "^3.0.
|
|
23
|
-
"pinia-plugin-persistedstate": "^4.
|
|
24
|
-
"vue": "^3.5.
|
|
25
|
-
"vue-i18n": "^11.1.
|
|
26
|
-
"vue-router": "^4.5.
|
|
21
|
+
"axios": "^1.10.0",
|
|
22
|
+
"pinia": "^3.0.3",
|
|
23
|
+
"pinia-plugin-persistedstate": "^4.3.0",
|
|
24
|
+
"vue": "^3.5.17",
|
|
25
|
+
"vue-i18n": "^11.1.7",
|
|
26
|
+
"vue-router": "^4.5.1"
|
|
27
27
|
},
|
|
28
28
|
"devDependencies": {
|
|
29
|
-
"@component-hook/eslint-plugin": "1.
|
|
30
|
-
"@intlify/unplugin-vue-i18n": "^6.0.
|
|
31
|
-
"@playwright/test": "^1.
|
|
29
|
+
"@component-hook/eslint-plugin": "1.1.1",
|
|
30
|
+
"@intlify/unplugin-vue-i18n": "^6.0.8",
|
|
31
|
+
"@playwright/test": "^1.53.1",
|
|
32
|
+
"@tailwindcss/vite": "^4.1.11",
|
|
32
33
|
"@testing-library/jest-dom": "^6.6.3",
|
|
33
34
|
"@testing-library/user-event": "^14.6.1",
|
|
34
35
|
"@testing-library/vue": "^8.1.0",
|
|
35
|
-
"@tsconfig/node22": "22.0.
|
|
36
|
-
"@types/node": "^22.
|
|
37
|
-
"@vitejs/plugin-vue": "^5.2.
|
|
38
|
-
"@vitest/coverage-v8": "^2.
|
|
36
|
+
"@tsconfig/node22": "^22.0.2",
|
|
37
|
+
"@types/node": "^22.15.33",
|
|
38
|
+
"@vitejs/plugin-vue": "^5.2.4",
|
|
39
|
+
"@vitest/coverage-v8": "^3.2.4",
|
|
39
40
|
"@vue/tsconfig": "^0.7.0",
|
|
40
41
|
"autoprefixer": "^10.4.21",
|
|
41
|
-
"cssnano": "^7.0.
|
|
42
|
-
"eslint": "^9.
|
|
43
|
-
"jsdom": "^26.
|
|
44
|
-
"msw": "^2.
|
|
45
|
-
"postcss": "^8.5.
|
|
46
|
-
"postcss-
|
|
47
|
-
"postcss-nesting": "^13.0.1",
|
|
42
|
+
"cssnano": "^7.0.7",
|
|
43
|
+
"eslint": "^9.29.0",
|
|
44
|
+
"jsdom": "^26.1.0",
|
|
45
|
+
"msw": "^2.10.2",
|
|
46
|
+
"postcss": "^8.5.6",
|
|
47
|
+
"postcss-preset-env": "^10.2.4",
|
|
48
48
|
"postcss-pxtorem": "^6.1.0",
|
|
49
|
-
"prettier": "^3.
|
|
50
|
-
"rollup-plugin-visualizer": "^
|
|
51
|
-
"tailwindcss": "^
|
|
52
|
-
"typescript": "^5.8.
|
|
53
|
-
"
|
|
54
|
-
"vite": "^5.4.14",
|
|
49
|
+
"prettier": "^3.6.2",
|
|
50
|
+
"rollup-plugin-visualizer": "^6.0.3",
|
|
51
|
+
"tailwindcss": "^4.1.11",
|
|
52
|
+
"typescript": "^5.8.3",
|
|
53
|
+
"vite": "^6.3.5",
|
|
55
54
|
"vite-plugin-svg-icons": "^2.0.1",
|
|
56
|
-
"vitest": "^2.
|
|
57
|
-
"vue-tsc": "^2.2.
|
|
55
|
+
"vitest": "^3.2.4",
|
|
56
|
+
"vue-tsc": "^2.2.10"
|
|
58
57
|
},
|
|
59
|
-
"browserslist": [
|
|
60
|
-
"> 1%",
|
|
61
|
-
"last 2 versions",
|
|
62
|
-
"not dead"
|
|
63
|
-
],
|
|
64
58
|
"msw": {
|
|
65
59
|
"workerDirectory": "public"
|
|
66
60
|
},
|
|
67
61
|
"optionalDependencies": {
|
|
68
|
-
"@commitlint/cli": "^19.8.
|
|
69
|
-
"@commitlint/config-conventional": "^19.8.
|
|
62
|
+
"@commitlint/cli": "^19.8.1",
|
|
63
|
+
"@commitlint/config-conventional": "^19.8.1",
|
|
70
64
|
"husky": "^9.1.7",
|
|
71
|
-
"lint-staged": "^
|
|
65
|
+
"lint-staged": "^16.1.2"
|
|
72
66
|
}
|
|
73
67
|
}
|
|
@@ -24,37 +24,26 @@ export default defineConfig({
|
|
|
24
24
|
projects: [
|
|
25
25
|
{
|
|
26
26
|
name: 'chromium',
|
|
27
|
-
use: {
|
|
27
|
+
use: {
|
|
28
|
+
browserName: 'chromium',
|
|
29
|
+
...devices['Macbook Pro'],
|
|
30
|
+
},
|
|
28
31
|
},
|
|
29
32
|
|
|
30
33
|
{
|
|
31
34
|
name: 'firefox',
|
|
32
|
-
use: {
|
|
35
|
+
use: {
|
|
36
|
+
browserName: 'firefox',
|
|
37
|
+
...devices['Macbook 11'],
|
|
38
|
+
},
|
|
33
39
|
},
|
|
34
40
|
|
|
35
41
|
{
|
|
36
42
|
name: 'webkit',
|
|
37
|
-
use: {
|
|
43
|
+
use: {
|
|
44
|
+
browserName: 'webkit',
|
|
45
|
+
...devices['iPhone SE'],
|
|
46
|
+
},
|
|
38
47
|
},
|
|
39
|
-
|
|
40
|
-
/* Test against mobile viewports. */
|
|
41
|
-
// {
|
|
42
|
-
// name: 'Mobile Chrome',
|
|
43
|
-
// use: { ...devices['Pixel 5'] },
|
|
44
|
-
// },
|
|
45
|
-
// {
|
|
46
|
-
// name: 'Mobile Safari',
|
|
47
|
-
// use: { ...devices['iPhone 12'] },
|
|
48
|
-
// },
|
|
49
|
-
|
|
50
|
-
/* Test against branded browsers. */
|
|
51
|
-
// {
|
|
52
|
-
// name: 'Microsoft Edge',
|
|
53
|
-
// use: { ...devices['Desktop Edge'], channel: 'msedge' },
|
|
54
|
-
// },
|
|
55
|
-
// {
|
|
56
|
-
// name: 'Google Chrome',
|
|
57
|
-
// use: { ...devices['Desktop Chrome'], channel: 'chrome' },
|
|
58
|
-
// },
|
|
59
48
|
],
|
|
60
49
|
});
|
|
@@ -1,14 +1,17 @@
|
|
|
1
|
+
import autoprefixer from 'autoprefixer';
|
|
2
|
+
import cssnano from 'cssnano';
|
|
3
|
+
import postcssPresetEnv from 'postcss-preset-env';
|
|
4
|
+
import postcssPxtorem from 'postcss-pxtorem';
|
|
5
|
+
|
|
1
6
|
export default {
|
|
2
|
-
plugins:
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
'postcss-nesting': {},
|
|
6
|
-
tailwindcss: {},
|
|
7
|
-
autoprefixer: {},
|
|
8
|
-
'postcss-pxtorem': {
|
|
7
|
+
plugins: [
|
|
8
|
+
autoprefixer(),
|
|
9
|
+
postcssPxtorem({
|
|
9
10
|
rootValue: 16,
|
|
10
11
|
propList: ['*'],
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
12
|
+
selectorBlackList: ['norem'],
|
|
13
|
+
}),
|
|
14
|
+
postcssPresetEnv({ stage: 3 }),
|
|
15
|
+
...(process.env.NODE_ENV === 'production' ? [cssnano({ preset: 'default' })] : []),
|
|
16
|
+
],
|
|
14
17
|
};
|