create-packer 1.35.14 → 1.35.16
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 +2 -1
- package/template/cli/biome.json +37 -0
- package/template/cli/package.json +1 -0
- package/template/lib/workspace/.eslintrc +1 -7
- package/template/lib/workspace/biome.json +37 -0
- package/template/lib/workspace/package.json +1 -2
- package/template/lib/workspace/packages/react/.eslintrc +1 -7
- package/template/lib/workspace/packages/react/package.json +0 -2
- package/template/lib/workspace/packages/ts/.eslintrc +1 -7
- package/template/lib/workspace/packages/ts/package.json +0 -1
- package/template/web-app/react-rspack/.eslintrc +1 -10
- package/template/web-app/react-rspack/.vscode/extensions.json +2 -2
- package/template/web-app/react-rspack/biome.json +37 -0
- package/template/web-app/react-rspack/package.json +2 -3
- package/template/web-app/react-vite/.eslintrc +1 -10
- package/template/web-app/react-vite/.vscode/extensions.json +8 -8
- package/template/web-app/react-vite/.vscode/settings.json +4 -18
- package/template/web-app/react-vite/biome.json +37 -0
- package/template/web-app/react-vite/domain/app/app.model.ts +7 -7
- package/template/web-app/react-vite/domain/app/app.styled.ts +3 -3
- package/template/web-app/react-vite/domain/app/components/app-context.tsx +17 -17
- package/template/web-app/react-vite/domain/app/components/app.tsx +24 -24
- package/template/web-app/react-vite/domain/app/components/index.ts +1 -1
- package/template/web-app/react-vite/domain/app/index.ts +2 -2
- package/template/web-app/react-vite/domain/router/home/ids.ts +3 -3
- package/template/web-app/react-vite/domain/router/home/index.ts +2 -2
- package/template/web-app/react-vite/domain/router/home/routes.tsx +13 -13
- package/template/web-app/react-vite/domain/router/ids.ts +6 -6
- package/template/web-app/react-vite/domain/router/index.ts +3 -3
- package/template/web-app/react-vite/domain/router/router.tsx +28 -28
- package/template/web-app/react-vite/domain/router/router.types.ts +3 -3
- package/template/web-app/react-vite/main.tsx +4 -4
- package/template/web-app/react-vite/mockUtils.ts +6 -6
- package/template/web-app/react-vite/package.json +79 -80
- package/template/web-app/react-vite/pages/home/home.mock.ts +19 -19
- package/template/web-app/react-vite/pages/home/home.styled.ts +7 -7
- package/template/web-app/react-vite/pages/home/home.tsx +10 -10
- package/template/web-app/react-vite/pages/home/index.ts +1 -1
- package/template/web-app/react-vite/pages/index.tsx +18 -18
- package/template/web-app/react-vite/pages/not-found.tsx +3 -3
- package/template/web-app/react-vite/scripts/createChunks.ts +26 -26
- package/template/web-app/react-vite/scripts/index.ts +1 -1
- package/template/web-app/react-vite/shared/hooks/defineRouter/defineRouter.types.ts +33 -33
- package/template/web-app/react-vite/shared/hooks/defineRouter/index.ts +2 -2
- package/template/web-app/react-vite/shared/hooks/index.ts +6 -6
- package/template/web-app/react-vite/shared/hooks/useInterval.ts +26 -26
- package/template/web-app/react-vite/shared/hooks/useLoadingAction.ts +27 -27
- package/template/web-app/react-vite/shared/hooks/useLowPriorityState.ts +26 -26
- package/template/web-app/react-vite/shared/hooks/useSyncState.ts +15 -15
- package/template/web-app/react-vite/shared/hooks/useVisible.ts +27 -27
- package/template/web-app/react-vite/shared/service/api.ts +1 -1
- package/template/web-app/react-vite/shared/service/home.ts +10 -10
- package/template/web-app/react-vite/shared/service/index.ts +3 -3
- package/template/web-app/react-vite/shared/service/request.ts +5 -5
- package/template/web-app/react-vite/shared/theme/index.ts +1 -1
- package/template/web-app/react-vite/shared/theme/theme.styled.ts +56 -56
- package/template/web-app/react-vite/shared/tools/componentInstance.tsx +80 -80
- package/template/web-app/react-vite/shared/tools/index.ts +1 -1
- package/template/web-app/react-vite/shared/types/index.ts +1 -1
- package/template/web-app/react-vite/shared/types/utils.ts +2 -2
- package/template/web-app/react-vite/tsconfig.json +32 -44
- package/template/web-app/react-vite/tsconfig.node.json +10 -10
- package/template/web-app/react-vite/vite-env.d.ts +18 -18
- package/template/web-app/react-vite/vite.config.ts +76 -76
- package/template/web-app/react-webpack/.eslintrc +1 -10
- package/template/web-app/react-webpack/.vscode/extensions.json +2 -2
- package/template/web-app/react-webpack/biome.json +37 -0
- package/template/web-app/react-webpack/package.json +2 -3
- package/template/web-app/vue/.eslintrc +0 -7
- package/template/web-app/vue/.vscode/extensions.json +9 -9
- package/template/web-app/vue/biome.json +37 -0
- package/template/web-app/vue/domain/app/app.ts +4 -4
- package/template/web-app/vue/domain/app/components/index.ts +1 -1
- package/template/web-app/vue/domain/app/createComponentInstance.ts +44 -44
- package/template/web-app/vue/domain/app/index.ts +3 -3
- package/template/web-app/vue/main.ts +7 -7
- package/template/web-app/vue/mockUtils.ts +6 -6
- package/template/web-app/vue/package.json +2 -3
- package/template/web-app/vue/pages/home/home.mock.ts +19 -19
- package/template/web-app/vue/pages/home/index.ts +1 -1
- package/template/web-app/vue/pages/index.ts +1 -1
- package/template/web-app/vue/router/home/index.ts +2 -2
- package/template/web-app/vue/router/home/names.ts +3 -3
- package/template/web-app/vue/router/home/routes.ts +8 -8
- package/template/web-app/vue/router/index.ts +26 -26
- package/template/web-app/vue/router/names.ts +5 -5
- package/template/web-app/vue/scripts/createChunks.ts +26 -26
- package/template/web-app/vue/scripts/index.ts +1 -1
- package/template/web-app/vue/shared/hooks/index.ts +2 -2
- package/template/web-app/vue/shared/hooks/useList.ts +104 -104
- package/template/web-app/vue/shared/hooks/useVisible.ts +27 -27
- package/template/web-app/vue/shared/service/api.ts +1 -1
- package/template/web-app/vue/shared/service/home.ts +10 -10
- package/template/web-app/vue/shared/service/index.ts +3 -3
- package/template/web-app/vue/shared/service/request.ts +5 -5
- package/template/web-app/vue/style.css +3 -3
- package/template/web-app/vue/tsconfig.json +24 -24
- package/template/web-app/vue/tsconfig.node.json +10 -10
- package/template/web-app/vue/vite-env.d.ts +18 -18
- package/template/web-app/vue/vite.config.ts +65 -65
- package/template/web-extension/.eslintrc +0 -9
- package/template/web-extension/.vscode/extensions.json +2 -2
- package/template/web-extension/biome.json +37 -0
- package/template/web-extension/package.json +2 -3
- package/template/cli/.prettierignore +0 -6
- package/template/cli/.prettierrc.js +0 -20
- package/template/lib/workspace/.prettierignore +0 -4
- package/template/lib/workspace/.prettierrc +0 -18
- package/template/lib/workspace/packages/react/.prettierignore +0 -4
- package/template/lib/workspace/packages/react/.prettierrc +0 -18
- package/template/lib/workspace/packages/ts/.prettierrc +0 -12
- package/template/web-app/react-rspack/.prettierignore +0 -6
- package/template/web-app/react-rspack/.prettierrc +0 -12
- package/template/web-app/react-vite/.prettierignore +0 -6
- package/template/web-app/react-vite/.prettierrc +0 -12
- package/template/web-app/vue/.prettierignore +0 -6
- package/template/web-app/vue/.prettierrc +0 -12
- package/template/web-extension/.prettierignore +0 -6
- package/template/web-extension/.prettierrc +0 -12
|
@@ -1,76 +1,76 @@
|
|
|
1
|
-
import { defineConfig, loadEnv } from 'vite'
|
|
2
|
-
import react from '@vitejs/plugin-react'
|
|
3
|
-
import svgr from 'vite-plugin-svgr'
|
|
4
|
-
import mockDevServer from 'vite-plugin-mock-dev-server'
|
|
5
|
-
import stylelint from 'vite-plugin-stylelint'
|
|
6
|
-
import eslint from '@rollup/plugin-eslint'
|
|
7
|
-
import { visualizer } from 'rollup-plugin-visualizer'
|
|
8
|
-
import { includes } from 'lodash-es'
|
|
9
|
-
import { createChunks } from './scripts'
|
|
10
|
-
|
|
11
|
-
// https://vitejs.dev/config/
|
|
12
|
-
export default defineConfig(({ mode }) => {
|
|
13
|
-
const env = loadEnv(mode, process.cwd(), '')
|
|
14
|
-
const proxyBaseUrl = env.VITE_BASE_URL + env.VITE_API_HOST
|
|
15
|
-
const plugins: any[] = [
|
|
16
|
-
svgr(),
|
|
17
|
-
stylelint({ cache: false, include: ['**/*.{css,scss,sass,less,styl,ts,tsx}'] }),
|
|
18
|
-
eslint({ include: ['**/*.{ts,tsx,js,jsx}'] }),
|
|
19
|
-
react({
|
|
20
|
-
babel: {
|
|
21
|
-
plugins: [
|
|
22
|
-
[
|
|
23
|
-
'babel-plugin-styled-components',
|
|
24
|
-
{
|
|
25
|
-
ssr: false,
|
|
26
|
-
displayName: false,
|
|
27
|
-
fileName: false,
|
|
28
|
-
transpileTemplateLiterals: false
|
|
29
|
-
}
|
|
30
|
-
]
|
|
31
|
-
]
|
|
32
|
-
}
|
|
33
|
-
}),
|
|
34
|
-
mockDevServer({
|
|
35
|
-
include: ['**/*.mock.{ts,js}']
|
|
36
|
-
})
|
|
37
|
-
]
|
|
38
|
-
|
|
39
|
-
if (mode === 'analyse') {
|
|
40
|
-
plugins.push(visualizer({ open: true, sourcemap: true, brotliSize: true, gzipSize: true }))
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
return {
|
|
44
|
-
base: env.VITE_BASE_URL,
|
|
45
|
-
plugins,
|
|
46
|
-
resolve: {
|
|
47
|
-
alias: {
|
|
48
|
-
'@': __dirname
|
|
49
|
-
}
|
|
50
|
-
},
|
|
51
|
-
esbuild: {
|
|
52
|
-
drop: includes(['production', 'analyse'], mode) ? ['console', 'debugger'] : []
|
|
53
|
-
},
|
|
54
|
-
build: {
|
|
55
|
-
sourcemap: mode === 'analyse',
|
|
56
|
-
reportCompressedSize: mode === 'analyse',
|
|
57
|
-
rollupOptions: {
|
|
58
|
-
output: {
|
|
59
|
-
manualChunks: createChunks({
|
|
60
|
-
react: ['react', 'react-dom']
|
|
61
|
-
})
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
},
|
|
65
|
-
server: {
|
|
66
|
-
host: '0.0.0.0',
|
|
67
|
-
proxy: {
|
|
68
|
-
[proxyBaseUrl]: {
|
|
69
|
-
target: 'http://127.0.0.1',
|
|
70
|
-
changeOrigin: true,
|
|
71
|
-
rewrite: path => path.replace(proxyBaseUrl, '')
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
})
|
|
1
|
+
import { defineConfig, loadEnv } from 'vite'
|
|
2
|
+
import react from '@vitejs/plugin-react'
|
|
3
|
+
import svgr from 'vite-plugin-svgr'
|
|
4
|
+
import mockDevServer from 'vite-plugin-mock-dev-server'
|
|
5
|
+
import stylelint from 'vite-plugin-stylelint'
|
|
6
|
+
import eslint from '@rollup/plugin-eslint'
|
|
7
|
+
import { visualizer } from 'rollup-plugin-visualizer'
|
|
8
|
+
import { includes } from 'lodash-es'
|
|
9
|
+
import { createChunks } from './scripts'
|
|
10
|
+
|
|
11
|
+
// https://vitejs.dev/config/
|
|
12
|
+
export default defineConfig(({ mode }) => {
|
|
13
|
+
const env = loadEnv(mode, process.cwd(), '')
|
|
14
|
+
const proxyBaseUrl = env.VITE_BASE_URL + env.VITE_API_HOST
|
|
15
|
+
const plugins: any[] = [
|
|
16
|
+
svgr(),
|
|
17
|
+
stylelint({ cache: false, include: ['**/*.{css,scss,sass,less,styl,ts,tsx}'] }),
|
|
18
|
+
eslint({ include: ['**/*.{ts,tsx,js,jsx}'] }),
|
|
19
|
+
react({
|
|
20
|
+
babel: {
|
|
21
|
+
plugins: [
|
|
22
|
+
[
|
|
23
|
+
'babel-plugin-styled-components',
|
|
24
|
+
{
|
|
25
|
+
ssr: false,
|
|
26
|
+
displayName: false,
|
|
27
|
+
fileName: false,
|
|
28
|
+
transpileTemplateLiterals: false
|
|
29
|
+
}
|
|
30
|
+
]
|
|
31
|
+
]
|
|
32
|
+
}
|
|
33
|
+
}),
|
|
34
|
+
mockDevServer({
|
|
35
|
+
include: ['**/*.mock.{ts,js}']
|
|
36
|
+
})
|
|
37
|
+
]
|
|
38
|
+
|
|
39
|
+
if (mode === 'analyse') {
|
|
40
|
+
plugins.push(visualizer({ open: true, sourcemap: true, brotliSize: true, gzipSize: true }))
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
return {
|
|
44
|
+
base: env.VITE_BASE_URL,
|
|
45
|
+
plugins,
|
|
46
|
+
resolve: {
|
|
47
|
+
alias: {
|
|
48
|
+
'@': __dirname
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
esbuild: {
|
|
52
|
+
drop: includes(['production', 'analyse'], mode) ? ['console', 'debugger'] : []
|
|
53
|
+
},
|
|
54
|
+
build: {
|
|
55
|
+
sourcemap: mode === 'analyse',
|
|
56
|
+
reportCompressedSize: mode === 'analyse',
|
|
57
|
+
rollupOptions: {
|
|
58
|
+
output: {
|
|
59
|
+
manualChunks: createChunks({
|
|
60
|
+
react: ['react', 'react-dom']
|
|
61
|
+
})
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
},
|
|
65
|
+
server: {
|
|
66
|
+
host: '0.0.0.0',
|
|
67
|
+
proxy: {
|
|
68
|
+
[proxyBaseUrl]: {
|
|
69
|
+
target: 'http://127.0.0.1',
|
|
70
|
+
changeOrigin: true,
|
|
71
|
+
rewrite: path => path.replace(proxyBaseUrl, '')
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
})
|
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"root": true,
|
|
3
3
|
"parser": "@typescript-eslint/parser",
|
|
4
|
-
"plugins": [
|
|
5
|
-
"prettier"
|
|
6
|
-
],
|
|
7
4
|
"extends": [
|
|
8
5
|
"eslint:recommended",
|
|
9
6
|
"plugin:@typescript-eslint/recommended",
|
|
@@ -108,12 +105,6 @@
|
|
|
108
105
|
"react-hooks/exhaustive-deps": "off",
|
|
109
106
|
"react/display-name": "off",
|
|
110
107
|
"react/react-in-jsx-scope": "off",
|
|
111
|
-
"prettier/prettier": [
|
|
112
|
-
"error",
|
|
113
|
-
{
|
|
114
|
-
"endOfLine": "auto"
|
|
115
|
-
}
|
|
116
|
-
],
|
|
117
108
|
"no-constant-condition": "off"
|
|
118
109
|
}
|
|
119
|
-
}
|
|
110
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
{
|
|
2
|
+
"linter": {
|
|
3
|
+
"enabled": false
|
|
4
|
+
},
|
|
5
|
+
"formatter": {
|
|
6
|
+
"enabled": true,
|
|
7
|
+
"formatWithErrors": false,
|
|
8
|
+
"include": [
|
|
9
|
+
"**/*.ts",
|
|
10
|
+
"**/*.js",
|
|
11
|
+
"**/*.tsx",
|
|
12
|
+
"**/*.jsx",
|
|
13
|
+
"**/*.json",
|
|
14
|
+
"**/*.css",
|
|
15
|
+
"**/*.scss",
|
|
16
|
+
"**/*.less"
|
|
17
|
+
],
|
|
18
|
+
"ignore": ["**/*.md", "**/*.svg", "**/*.ejs", "**/*.html", ".history", "dist"],
|
|
19
|
+
"attributePosition": "auto",
|
|
20
|
+
"indentStyle": "space",
|
|
21
|
+
"indentWidth": 4,
|
|
22
|
+
"lineEnding": "lf",
|
|
23
|
+
"lineWidth": 100
|
|
24
|
+
},
|
|
25
|
+
"javascript": {
|
|
26
|
+
"formatter": {
|
|
27
|
+
"arrowParentheses": "asNeeded",
|
|
28
|
+
"bracketSameLine": false,
|
|
29
|
+
"bracketSpacing": true,
|
|
30
|
+
"quoteStyle": "single",
|
|
31
|
+
"jsxQuoteStyle": "single",
|
|
32
|
+
"quoteProperties": "asNeeded",
|
|
33
|
+
"semicolons": "asNeeded",
|
|
34
|
+
"trailingCommas": "none"
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"build": "webpack --env mode=prod",
|
|
12
12
|
"build:analyzer": "webpack --env mode=analyzer",
|
|
13
13
|
"up:webpack": "pnpm up webpackbar webpackbar-* -L",
|
|
14
|
-
"format": "
|
|
14
|
+
"format": "biome format --write",
|
|
15
15
|
"lint": "tsc --noEmit && eslint **/*.{tsx,ts,jsx,js} --no-error-on-unmatched-pattern && stylelint **/*.{css,scss,less,ts,tsx}",
|
|
16
16
|
"lint:fix": "eslint **/*.{tsx,ts,jsx,js} --fix && stylelint **/*.{css,scss,less,ts,tsx} --fix",
|
|
17
17
|
"cz": "cz",
|
|
@@ -34,6 +34,7 @@
|
|
|
34
34
|
"zustand": "4.4.1"
|
|
35
35
|
},
|
|
36
36
|
"devDependencies": {
|
|
37
|
+
"@biomejs/biome": "1.9.2",
|
|
37
38
|
"@commitlint/cli": "18.6.1",
|
|
38
39
|
"@commitlint/config-conventional": "18.6.2",
|
|
39
40
|
"@commitlint/cz-commitlint": "18.6.1",
|
|
@@ -53,7 +54,6 @@
|
|
|
53
54
|
"eslint": "8.56.0",
|
|
54
55
|
"eslint-import-resolver-typescript": "3.6.1",
|
|
55
56
|
"eslint-plugin-import": "2.29.1",
|
|
56
|
-
"eslint-plugin-prettier": "5.1.3",
|
|
57
57
|
"eslint-plugin-react": "7.33.2",
|
|
58
58
|
"eslint-plugin-react-hooks": "4.6.0",
|
|
59
59
|
"eslint-webpack-plugin": "4.0.1",
|
|
@@ -65,7 +65,6 @@
|
|
|
65
65
|
"postcss-loader": "8.1.0",
|
|
66
66
|
"postcss-nesting": "12.0.3",
|
|
67
67
|
"postcss-styled-syntax": "0.6.4",
|
|
68
|
-
"prettier": "3.2.5",
|
|
69
68
|
"react-css-modules": "4.7.11",
|
|
70
69
|
"react-test-renderer": "18.2.0",
|
|
71
70
|
"rimraf": "5.0.5",
|
|
@@ -12,7 +12,6 @@
|
|
|
12
12
|
"defineExpose": "readonly",
|
|
13
13
|
"withDefaults": "readonly"
|
|
14
14
|
},
|
|
15
|
-
"plugins": ["prettier"],
|
|
16
15
|
"extends": [
|
|
17
16
|
"eslint:recommended",
|
|
18
17
|
"plugin:@typescript-eslint/recommended",
|
|
@@ -75,12 +74,6 @@
|
|
|
75
74
|
"@typescript-eslint/explicit-module-boundary-types": "off",
|
|
76
75
|
"@typescript-eslint/ban-ts-comment": "off",
|
|
77
76
|
"@typescript-eslint/no-empty-interface": "off",
|
|
78
|
-
"prettier/prettier": [
|
|
79
|
-
"error",
|
|
80
|
-
{
|
|
81
|
-
"endOfLine": "auto"
|
|
82
|
-
}
|
|
83
|
-
],
|
|
84
77
|
"vue/multi-word-component-names": 0,
|
|
85
78
|
"vue/html-indent": ["error", 4],
|
|
86
79
|
"vue/require-default-prop": "off",
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
{
|
|
2
|
-
"recommendations": [
|
|
3
|
-
"vue.volar",
|
|
4
|
-
"vue.vscode-typescript-vue-plugin",
|
|
5
|
-
"dbaeumer.vscode-eslint",
|
|
6
|
-
"stylelint.vscode-stylelint",
|
|
7
|
-
"
|
|
8
|
-
]
|
|
9
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"recommendations": [
|
|
3
|
+
"vue.volar",
|
|
4
|
+
"vue.vscode-typescript-vue-plugin",
|
|
5
|
+
"dbaeumer.vscode-eslint",
|
|
6
|
+
"stylelint.vscode-stylelint",
|
|
7
|
+
"biomejs.biome",
|
|
8
|
+
]
|
|
9
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
{
|
|
2
|
+
"linter": {
|
|
3
|
+
"enabled": false
|
|
4
|
+
},
|
|
5
|
+
"formatter": {
|
|
6
|
+
"enabled": true,
|
|
7
|
+
"formatWithErrors": false,
|
|
8
|
+
"include": [
|
|
9
|
+
"**/*.ts",
|
|
10
|
+
"**/*.js",
|
|
11
|
+
"**/*.tsx",
|
|
12
|
+
"**/*.jsx",
|
|
13
|
+
"**/*.json",
|
|
14
|
+
"**/*.css",
|
|
15
|
+
"**/*.scss",
|
|
16
|
+
"**/*.less"
|
|
17
|
+
],
|
|
18
|
+
"ignore": ["**/*.md", "**/*.svg", "**/*.ejs", "**/*.html", ".history", "dist"],
|
|
19
|
+
"attributePosition": "auto",
|
|
20
|
+
"indentStyle": "space",
|
|
21
|
+
"indentWidth": 4,
|
|
22
|
+
"lineEnding": "lf",
|
|
23
|
+
"lineWidth": 100
|
|
24
|
+
},
|
|
25
|
+
"javascript": {
|
|
26
|
+
"formatter": {
|
|
27
|
+
"arrowParentheses": "asNeeded",
|
|
28
|
+
"bracketSameLine": false,
|
|
29
|
+
"bracketSpacing": true,
|
|
30
|
+
"quoteStyle": "single",
|
|
31
|
+
"jsxQuoteStyle": "single",
|
|
32
|
+
"quoteProperties": "asNeeded",
|
|
33
|
+
"semicolons": "asNeeded",
|
|
34
|
+
"trailingCommas": "none"
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { createApp } from 'vue'
|
|
2
|
-
import { App } from './components'
|
|
3
|
-
|
|
4
|
-
export default createApp(App)
|
|
1
|
+
import { createApp } from 'vue'
|
|
2
|
+
import { App } from './components'
|
|
3
|
+
|
|
4
|
+
export default createApp(App)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { default as App } from './app.vue'
|
|
1
|
+
export { default as App } from './app.vue'
|
|
@@ -1,44 +1,44 @@
|
|
|
1
|
-
import { createVNode, render, VNodeChild } from 'vue'
|
|
2
|
-
import { assign, keys } from 'lodash-es'
|
|
3
|
-
import app from './app'
|
|
4
|
-
|
|
5
|
-
const store = new Map()
|
|
6
|
-
|
|
7
|
-
function reset(oldObj: Record<string, any>, newObj: Record<string, any>) {
|
|
8
|
-
keys(oldObj).forEach(k => {
|
|
9
|
-
oldObj[k] = void 0
|
|
10
|
-
})
|
|
11
|
-
assign(oldObj, newObj)
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
export function createComponentInstance<
|
|
15
|
-
P extends Record<string, any>,
|
|
16
|
-
E extends Record<string, any>,
|
|
17
|
-
Slots extends Record<string, () => VNodeChild> = Record<string, () => VNodeChild>
|
|
18
|
-
>(name: string, component: any, props?: P, slots?: Slots) {
|
|
19
|
-
let vNode = store.get(name)
|
|
20
|
-
function updateProps(props: Partial<P>) {
|
|
21
|
-
reset(vNode.component.props, props)
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
function updateSlots(slots: Partial<Record<string, () => VNodeChild>>) {
|
|
25
|
-
reset(vNode.component.slots, slots)
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
if (!vNode) {
|
|
29
|
-
const container = document.createElement('div')
|
|
30
|
-
vNode = createVNode(component, props, slots)
|
|
31
|
-
vNode.appContext = app._context || {}
|
|
32
|
-
store.set(name, vNode)
|
|
33
|
-
render(vNode, container)
|
|
34
|
-
} else {
|
|
35
|
-
updateProps(props || {})
|
|
36
|
-
updateSlots(slots || {})
|
|
37
|
-
}
|
|
38
|
-
return {
|
|
39
|
-
instance: vNode,
|
|
40
|
-
updateProps,
|
|
41
|
-
updateSlots,
|
|
42
|
-
...(vNode.component?.exposed as E)
|
|
43
|
-
}
|
|
44
|
-
}
|
|
1
|
+
import { createVNode, render, VNodeChild } from 'vue'
|
|
2
|
+
import { assign, keys } from 'lodash-es'
|
|
3
|
+
import app from './app'
|
|
4
|
+
|
|
5
|
+
const store = new Map()
|
|
6
|
+
|
|
7
|
+
function reset(oldObj: Record<string, any>, newObj: Record<string, any>) {
|
|
8
|
+
keys(oldObj).forEach(k => {
|
|
9
|
+
oldObj[k] = void 0
|
|
10
|
+
})
|
|
11
|
+
assign(oldObj, newObj)
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export function createComponentInstance<
|
|
15
|
+
P extends Record<string, any>,
|
|
16
|
+
E extends Record<string, any>,
|
|
17
|
+
Slots extends Record<string, () => VNodeChild> = Record<string, () => VNodeChild>
|
|
18
|
+
>(name: string, component: any, props?: P, slots?: Slots) {
|
|
19
|
+
let vNode = store.get(name)
|
|
20
|
+
function updateProps(props: Partial<P>) {
|
|
21
|
+
reset(vNode.component.props, props)
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
function updateSlots(slots: Partial<Record<string, () => VNodeChild>>) {
|
|
25
|
+
reset(vNode.component.slots, slots)
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
if (!vNode) {
|
|
29
|
+
const container = document.createElement('div')
|
|
30
|
+
vNode = createVNode(component, props, slots)
|
|
31
|
+
vNode.appContext = app._context || {}
|
|
32
|
+
store.set(name, vNode)
|
|
33
|
+
render(vNode, container)
|
|
34
|
+
} else {
|
|
35
|
+
updateProps(props || {})
|
|
36
|
+
updateSlots(slots || {})
|
|
37
|
+
}
|
|
38
|
+
return {
|
|
39
|
+
instance: vNode,
|
|
40
|
+
updateProps,
|
|
41
|
+
updateSlots,
|
|
42
|
+
...(vNode.component?.exposed as E)
|
|
43
|
+
}
|
|
44
|
+
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { default as app } from './app'
|
|
2
|
-
export * from './components'
|
|
3
|
-
export * from './createComponentInstance'
|
|
1
|
+
export { default as app } from './app'
|
|
2
|
+
export * from './components'
|
|
3
|
+
export * from './createComponentInstance'
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { createPinia } from 'pinia'
|
|
2
|
-
import { VueQueryPlugin } from '@tanstack/vue-query'
|
|
3
|
-
import { router } from '@/router'
|
|
4
|
-
import { app } from '@/domain/app'
|
|
5
|
-
import './style.css'
|
|
6
|
-
|
|
7
|
-
app.use(VueQueryPlugin).use(createPinia()).use(router).mount('#app')
|
|
1
|
+
import { createPinia } from 'pinia'
|
|
2
|
+
import { VueQueryPlugin } from '@tanstack/vue-query'
|
|
3
|
+
import { router } from '@/router'
|
|
4
|
+
import { app } from '@/domain/app'
|
|
5
|
+
import './style.css'
|
|
6
|
+
|
|
7
|
+
app.use(VueQueryPlugin).use(createPinia()).use(router).mount('#app')
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import path from 'node:path'
|
|
2
|
-
import { createDefineMock } from 'vite-plugin-mock-dev-server'
|
|
3
|
-
|
|
4
|
-
export const defineMock = createDefineMock(mock => {
|
|
5
|
-
mock.url = path.join(import.meta.env.VITE_BASE_URL + import.meta.env.VITE_API_HOST, mock.url)
|
|
6
|
-
})
|
|
1
|
+
import path from 'node:path'
|
|
2
|
+
import { createDefineMock } from 'vite-plugin-mock-dev-server'
|
|
3
|
+
|
|
4
|
+
export const defineMock = createDefineMock(mock => {
|
|
5
|
+
mock.url = path.join(import.meta.env.VITE_BASE_URL + import.meta.env.VITE_API_HOST, mock.url)
|
|
6
|
+
})
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"build": "vue-tsc --noEmit && vite build",
|
|
10
10
|
"build:analyse": "tsc --noEmit && vite build --mode analyse",
|
|
11
11
|
"preview": "vite preview",
|
|
12
|
-
"format": "
|
|
12
|
+
"format": "biome format --write",
|
|
13
13
|
"lint": "vue-tsc --noEmit && eslint **/*.{ts,tsx,js,jsx,vue} --no-error-on-unmatched-pattern && stylelint **/*.{css,scss,less}",
|
|
14
14
|
"lint:fix": "eslint **/*.{ts,tsx,js,jsx,vue} --fix && stylelint **/*.{css,scss,less} --fix",
|
|
15
15
|
"cz": "cz",
|
|
@@ -27,6 +27,7 @@
|
|
|
27
27
|
"vue-router": "4.3.0"
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
|
30
|
+
"@biomejs/biome": "1.9.2",
|
|
30
31
|
"@commitlint/cli": "17.6.1",
|
|
31
32
|
"@commitlint/config-conventional": "17.6.1",
|
|
32
33
|
"@commitlint/cz-commitlint": "17.5.0",
|
|
@@ -44,14 +45,12 @@
|
|
|
44
45
|
"eslint": "8.56.0",
|
|
45
46
|
"eslint-import-resolver-typescript": "3.6.1",
|
|
46
47
|
"eslint-plugin-import": "2.29.1",
|
|
47
|
-
"eslint-plugin-prettier": "5.1.3",
|
|
48
48
|
"eslint-plugin-vue": "9.21.1",
|
|
49
49
|
"husky": "8.0.3",
|
|
50
50
|
"inquirer": "8.1.2",
|
|
51
51
|
"postcss": "8.4.38",
|
|
52
52
|
"postcss-import": "16.1.0",
|
|
53
53
|
"postcss-nesting": "12.1.1",
|
|
54
|
-
"prettier": "3.2.5",
|
|
55
54
|
"rollup-plugin-visualizer": "5.12.0",
|
|
56
55
|
"stylelint": "16.3.1",
|
|
57
56
|
"stylelint-config-standard-scss": "13.1.0",
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import { faker } from '@faker-js/faker'
|
|
2
|
-
import { defineMock } from '@/mockUtils'
|
|
3
|
-
import { API } from '@/shared/service'
|
|
4
|
-
|
|
5
|
-
export default defineMock([
|
|
6
|
-
{
|
|
7
|
-
url: API.HOME_DATA,
|
|
8
|
-
body: faker.helpers.multiple(
|
|
9
|
-
() => ({
|
|
10
|
-
id: faker.string.uuid(),
|
|
11
|
-
name: faker.person.fullName(),
|
|
12
|
-
age: faker.number.int({ max: 110 })
|
|
13
|
-
}),
|
|
14
|
-
{
|
|
15
|
-
count: 10
|
|
16
|
-
}
|
|
17
|
-
)
|
|
18
|
-
}
|
|
19
|
-
])
|
|
1
|
+
import { faker } from '@faker-js/faker'
|
|
2
|
+
import { defineMock } from '@/mockUtils'
|
|
3
|
+
import { API } from '@/shared/service'
|
|
4
|
+
|
|
5
|
+
export default defineMock([
|
|
6
|
+
{
|
|
7
|
+
url: API.HOME_DATA,
|
|
8
|
+
body: faker.helpers.multiple(
|
|
9
|
+
() => ({
|
|
10
|
+
id: faker.string.uuid(),
|
|
11
|
+
name: faker.person.fullName(),
|
|
12
|
+
age: faker.number.int({ max: 110 })
|
|
13
|
+
}),
|
|
14
|
+
{
|
|
15
|
+
count: 10
|
|
16
|
+
}
|
|
17
|
+
)
|
|
18
|
+
}
|
|
19
|
+
])
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { default } from './home.vue'
|
|
1
|
+
export { default } from './home.vue'
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { default } from './index.vue'
|
|
1
|
+
export { default } from './index.vue'
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { default as names } from './names'
|
|
2
|
-
export { default as routes } from './routes'
|
|
1
|
+
export { default as names } from './names'
|
|
2
|
+
export { default as routes } from './routes'
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export default {
|
|
2
|
-
home: 'home'
|
|
3
|
-
}
|
|
1
|
+
export default {
|
|
2
|
+
home: 'home'
|
|
3
|
+
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { RouteRecordRaw } from 'vue-router'
|
|
2
|
-
import names from './names'
|
|
3
|
-
|
|
4
|
-
const routes: RouteRecordRaw[] = [
|
|
5
|
-
{ path: '/home', name: names.home, component: () => import('@/pages/home') }
|
|
6
|
-
]
|
|
7
|
-
|
|
8
|
-
export default routes
|
|
1
|
+
import { RouteRecordRaw } from 'vue-router'
|
|
2
|
+
import names from './names'
|
|
3
|
+
|
|
4
|
+
const routes: RouteRecordRaw[] = [
|
|
5
|
+
{ path: '/home', name: names.home, component: () => import('@/pages/home') }
|
|
6
|
+
]
|
|
7
|
+
|
|
8
|
+
export default routes
|
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
import { createRouter, createWebHashHistory, RouteRecordRaw } from 'vue-router'
|
|
2
|
-
import names from './names'
|
|
3
|
-
import * as homeRouter from './home'
|
|
4
|
-
|
|
5
|
-
const routes: RouteRecordRaw[] = [
|
|
6
|
-
{
|
|
7
|
-
path: '/',
|
|
8
|
-
component: () => import('@/pages'),
|
|
9
|
-
redirect: { name: names.home },
|
|
10
|
-
children: [
|
|
11
|
-
...homeRouter.routes,
|
|
12
|
-
{
|
|
13
|
-
path: '/404',
|
|
14
|
-
name: names.notFound,
|
|
15
|
-
component: () => import('@/pages/not-found.vue')
|
|
16
|
-
}
|
|
17
|
-
]
|
|
18
|
-
}
|
|
19
|
-
]
|
|
20
|
-
|
|
21
|
-
export { default as routerNames } from './names'
|
|
22
|
-
|
|
23
|
-
export const router = createRouter({
|
|
24
|
-
history: createWebHashHistory(),
|
|
25
|
-
routes
|
|
26
|
-
})
|
|
1
|
+
import { createRouter, createWebHashHistory, RouteRecordRaw } from 'vue-router'
|
|
2
|
+
import names from './names'
|
|
3
|
+
import * as homeRouter from './home'
|
|
4
|
+
|
|
5
|
+
const routes: RouteRecordRaw[] = [
|
|
6
|
+
{
|
|
7
|
+
path: '/',
|
|
8
|
+
component: () => import('@/pages'),
|
|
9
|
+
redirect: { name: names.home },
|
|
10
|
+
children: [
|
|
11
|
+
...homeRouter.routes,
|
|
12
|
+
{
|
|
13
|
+
path: '/404',
|
|
14
|
+
name: names.notFound,
|
|
15
|
+
component: () => import('@/pages/not-found.vue')
|
|
16
|
+
}
|
|
17
|
+
]
|
|
18
|
+
}
|
|
19
|
+
]
|
|
20
|
+
|
|
21
|
+
export { default as routerNames } from './names'
|
|
22
|
+
|
|
23
|
+
export const router = createRouter({
|
|
24
|
+
history: createWebHashHistory(),
|
|
25
|
+
routes
|
|
26
|
+
})
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import * as homeRouter from './home'
|
|
2
|
-
export default {
|
|
3
|
-
...homeRouter.names,
|
|
4
|
-
notFound: '404'
|
|
5
|
-
}
|
|
1
|
+
import * as homeRouter from './home'
|
|
2
|
+
export default {
|
|
3
|
+
...homeRouter.names,
|
|
4
|
+
notFound: '404'
|
|
5
|
+
}
|