create-packer 1.42.6 → 1.43.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 +2 -2
- package/template/docusaurus/package.json +52 -52
- package/template/lib/workspace/package.json +81 -81
- package/template/lib/workspace/packages/react/package.json +45 -45
- package/template/lib/workspace/packages/ts/package.json +30 -30
- package/template/nest/package.json +82 -82
- package/template/web-app/next/package.json +1 -1
- package/template/web-app/react-rsbuild/index.html +0 -1
- package/template/web-app/react-rsbuild/package.json +1 -1
- package/template/web-app/react-rsbuild/rsbuild.config.ts +3 -2
- package/template/web-app/react-vite/package.json +2 -3
- package/template/web-app/react-vite/vite.config.ts +0 -2
- package/template/web-app/svelte/package.json +2 -3
- package/template/web-app/vue/eslint.config.js +2 -1
- package/template/web-app/vue/main.ts +0 -1
- package/template/web-app/vue/package.json +9 -8
- package/template/web-app/vue/pages/home/view.vue +6 -2
- package/template/web-app/vue/postcss.config.cjs +0 -2
- package/template/web-app/vue/router/index.ts +1 -1
- package/template/web-app/vue/shared/hooks/useList.ts +22 -41
- package/template/web-app/vue/style.css +1 -3
- package/template/web-app/vue/vite.config.ts +4 -3
- package/template/web-app/vue-rsbuild/eslint.config.js +2 -1
- package/template/web-app/vue-rsbuild/index.html +0 -1
- package/template/web-app/vue-rsbuild/package.json +4 -3
- package/template/web-app/vue-rsbuild/pages/home/view.vue +6 -2
- package/template/web-app/vue-rsbuild/postcss.config.cjs +1 -2
- package/template/web-app/vue-rsbuild/rsbuild.config.ts +3 -2
- package/template/web-app/vue-rsbuild/shared/hooks/useList.ts +22 -41
- package/template/web-extension/package.json +1 -1
- package/template/web-app/vue-rsbuild/pages/home/view.mock.ts +0 -19
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-packer",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.43.0",
|
|
4
4
|
"main": "index.js",
|
|
5
5
|
"repository": "https://github.com/kevily/create-packer",
|
|
6
6
|
"author": "1k <bug_zero@163.com>",
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
"globals": "15.12.0",
|
|
37
37
|
"prettier": "3.2.5",
|
|
38
38
|
"rimraf": "3.0.2",
|
|
39
|
-
"typescript": "5.
|
|
39
|
+
"typescript": "5.8.2",
|
|
40
40
|
"typescript-eslint": "8.15.0"
|
|
41
41
|
},
|
|
42
42
|
"config": {
|
|
@@ -1,52 +1,52 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "docusaurus-test",
|
|
3
|
-
"version": "0.0.0",
|
|
4
|
-
"private": true,
|
|
5
|
-
"scripts": {
|
|
6
|
-
"up:docusaurus": "pnpm up @tsconfig/docusaurus @docusaurus/* -L",
|
|
7
|
-
"docusaurus": "docusaurus",
|
|
8
|
-
"start": "docusaurus start",
|
|
9
|
-
"build": "docusaurus build",
|
|
10
|
-
"swizzle": "docusaurus swizzle",
|
|
11
|
-
"deploy": "docusaurus deploy",
|
|
12
|
-
"clear": "docusaurus clear",
|
|
13
|
-
"serve": "docusaurus serve",
|
|
14
|
-
"write-translations": "docusaurus write-translations",
|
|
15
|
-
"write-heading-ids": "docusaurus write-heading-ids",
|
|
16
|
-
"format": "prettier --write \"./src/**/*.{ts,js,tsx,jsx,json,css,scss,less}\"",
|
|
17
|
-
"typecheck": "tsc"
|
|
18
|
-
},
|
|
19
|
-
"dependencies": {
|
|
20
|
-
"@docusaurus/core": "2.4.1",
|
|
21
|
-
"@docusaurus/preset-classic": "2.4.1",
|
|
22
|
-
"@mdx-js/react": "1.6.22",
|
|
23
|
-
"clsx": "1.2.1",
|
|
24
|
-
"prism-react-renderer": "1.3.5",
|
|
25
|
-
"react": "18.2.0",
|
|
26
|
-
"react-dom": "18.2.0"
|
|
27
|
-
},
|
|
28
|
-
"devDependencies": {
|
|
29
|
-
"@docusaurus/module-type-aliases": "2.4.1",
|
|
30
|
-
"@docusaurus/theme-live-codeblock": "2.4.1",
|
|
31
|
-
"@docusaurus/types": "2.4.1",
|
|
32
|
-
"@easyops-cn/docusaurus-search-local": "^0.36.0",
|
|
33
|
-
"@tsconfig/docusaurus": "1.0.5",
|
|
34
|
-
"prettier": "3.2.5",
|
|
35
|
-
"typescript": "5.
|
|
36
|
-
},
|
|
37
|
-
"browserslist": {
|
|
38
|
-
"production": [
|
|
39
|
-
">0.5%",
|
|
40
|
-
"not dead",
|
|
41
|
-
"not op_mini all"
|
|
42
|
-
],
|
|
43
|
-
"development": [
|
|
44
|
-
"last 1 chrome version",
|
|
45
|
-
"last 1 firefox version",
|
|
46
|
-
"last 1 safari version"
|
|
47
|
-
]
|
|
48
|
-
},
|
|
49
|
-
"engines": {
|
|
50
|
-
"node": ">=16.14"
|
|
51
|
-
}
|
|
52
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "docusaurus-test",
|
|
3
|
+
"version": "0.0.0",
|
|
4
|
+
"private": true,
|
|
5
|
+
"scripts": {
|
|
6
|
+
"up:docusaurus": "pnpm up @tsconfig/docusaurus @docusaurus/* -L",
|
|
7
|
+
"docusaurus": "docusaurus",
|
|
8
|
+
"start": "docusaurus start",
|
|
9
|
+
"build": "docusaurus build",
|
|
10
|
+
"swizzle": "docusaurus swizzle",
|
|
11
|
+
"deploy": "docusaurus deploy",
|
|
12
|
+
"clear": "docusaurus clear",
|
|
13
|
+
"serve": "docusaurus serve",
|
|
14
|
+
"write-translations": "docusaurus write-translations",
|
|
15
|
+
"write-heading-ids": "docusaurus write-heading-ids",
|
|
16
|
+
"format": "prettier --write \"./src/**/*.{ts,js,tsx,jsx,json,css,scss,less}\"",
|
|
17
|
+
"typecheck": "tsc"
|
|
18
|
+
},
|
|
19
|
+
"dependencies": {
|
|
20
|
+
"@docusaurus/core": "2.4.1",
|
|
21
|
+
"@docusaurus/preset-classic": "2.4.1",
|
|
22
|
+
"@mdx-js/react": "1.6.22",
|
|
23
|
+
"clsx": "1.2.1",
|
|
24
|
+
"prism-react-renderer": "1.3.5",
|
|
25
|
+
"react": "18.2.0",
|
|
26
|
+
"react-dom": "18.2.0"
|
|
27
|
+
},
|
|
28
|
+
"devDependencies": {
|
|
29
|
+
"@docusaurus/module-type-aliases": "2.4.1",
|
|
30
|
+
"@docusaurus/theme-live-codeblock": "2.4.1",
|
|
31
|
+
"@docusaurus/types": "2.4.1",
|
|
32
|
+
"@easyops-cn/docusaurus-search-local": "^0.36.0",
|
|
33
|
+
"@tsconfig/docusaurus": "1.0.5",
|
|
34
|
+
"prettier": "3.2.5",
|
|
35
|
+
"typescript": "5.8.2"
|
|
36
|
+
},
|
|
37
|
+
"browserslist": {
|
|
38
|
+
"production": [
|
|
39
|
+
">0.5%",
|
|
40
|
+
"not dead",
|
|
41
|
+
"not op_mini all"
|
|
42
|
+
],
|
|
43
|
+
"development": [
|
|
44
|
+
"last 1 chrome version",
|
|
45
|
+
"last 1 firefox version",
|
|
46
|
+
"last 1 safari version"
|
|
47
|
+
]
|
|
48
|
+
},
|
|
49
|
+
"engines": {
|
|
50
|
+
"node": ">=16.14"
|
|
51
|
+
}
|
|
52
|
+
}
|
|
@@ -1,81 +1,81 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "my-lib",
|
|
3
|
-
"version": "1.0.0",
|
|
4
|
-
"description": "",
|
|
5
|
-
"private": true,
|
|
6
|
-
"main": "index.js",
|
|
7
|
-
"scripts": {
|
|
8
|
-
"eslint": "eslint",
|
|
9
|
-
"eslint:fix": "eslint --fix",
|
|
10
|
-
"stylelint": "stylelint packages/**/*.{css,scss,less,ts,tsx}",
|
|
11
|
-
"stylelint:fix": "stylelint packages/**/*.{css,scss,less,ts,tsx} --fix",
|
|
12
|
-
"lint": "pnpm -r run lint && pnpm eslint && pnpm stylelint",
|
|
13
|
-
"lint:fix": "pnpm -r run lint && pnpm eslint:fix && pnpm stylelint:fix",
|
|
14
|
-
"build": "ts-node --project ./tsconfig.node.json ./scripts/build.ts",
|
|
15
|
-
"changeVersion": "pnpm changeset && pnpm changeset version && pnpm run clear:changelog",
|
|
16
|
-
"clear:changelog": "pnpm -r exec rimraf CHANGELOG.md",
|
|
17
|
-
"commit": "git add . && cz",
|
|
18
|
-
"push": "pnpm run commit && git push",
|
|
19
|
-
"login": "npm login --registry https://registry.npmjs.org",
|
|
20
|
-
"clean:dist": "pnpm -r exec rimraf dist",
|
|
21
|
-
"format": "prettier --write \"**/*.{ts,js,tsx,jsx,json,css,scss,less}\"",
|
|
22
|
-
"pub": "pnpm run build && pnpm run changeVersion && pnpm run push && pnpm -r publish --registry https://registry.npmjs.org",
|
|
23
|
-
"storybook": "storybook dev -p 6006",
|
|
24
|
-
"build-storybook": "storybook build",
|
|
25
|
-
"up:storybook": "pnpm up storybook eslint-plugin-storybook @storybook/* -L"
|
|
26
|
-
},
|
|
27
|
-
"keywords": [],
|
|
28
|
-
"author": "kevily",
|
|
29
|
-
"license": "ISC",
|
|
30
|
-
"config": {
|
|
31
|
-
"commitizen": {
|
|
32
|
-
"path": "@commitlint/cz-commitlint"
|
|
33
|
-
}
|
|
34
|
-
},
|
|
35
|
-
"dependencies": {
|
|
36
|
-
"1k-tasks": "4.2.1",
|
|
37
|
-
"@commitlint/config-conventional": "17.6.6",
|
|
38
|
-
"@commitlint/cz-commitlint": "17.5.0",
|
|
39
|
-
"@eslint/js": "9.15.0",
|
|
40
|
-
"commitizen": "4.3.0",
|
|
41
|
-
"rimraf": "5.0.1"
|
|
42
|
-
},
|
|
43
|
-
"devDependencies": {
|
|
44
|
-
"@changesets/cli": "2.26.2",
|
|
45
|
-
"@eslint/js": "9.15.0",
|
|
46
|
-
"@storybook/addon-essentials": "8.5.0",
|
|
47
|
-
"@storybook/addon-interactions": "8.5.0",
|
|
48
|
-
"@storybook/addon-links": "8.5.0",
|
|
49
|
-
"@storybook/blocks": "8.5.0",
|
|
50
|
-
"@storybook/react": "8.5.0",
|
|
51
|
-
"@storybook/react-vite": "8.5.0",
|
|
52
|
-
"@storybook/testing-library": "0.2.2",
|
|
53
|
-
"@svgr/rollup": "8.1.0",
|
|
54
|
-
"@types/node": "20.3.2",
|
|
55
|
-
"@types/react": "18.3.3",
|
|
56
|
-
"@types/react-dom": "18.3.0",
|
|
57
|
-
"autoprefixer": "10.4.14",
|
|
58
|
-
"eslint": "9.17.0",
|
|
59
|
-
"eslint-import-resolver-typescript": "3.7.0",
|
|
60
|
-
"eslint-plugin-import": "2.31.0",
|
|
61
|
-
"eslint-plugin-react": "7.37.2",
|
|
62
|
-
"eslint-plugin-react-hooks": "5.1.0",
|
|
63
|
-
"eslint-plugin-storybook": "0.11.2",
|
|
64
|
-
"globals": "15.12.0",
|
|
65
|
-
"inquirer": "^8.1.2",
|
|
66
|
-
"postcss": "8.4.31",
|
|
67
|
-
"postcss-import": "15.1.0",
|
|
68
|
-
"postcss-nesting": "12.0.0",
|
|
69
|
-
"postcss-scss": "4.0.6",
|
|
70
|
-
"postcss-styled-syntax": "0.6.4",
|
|
71
|
-
"prettier": "3.2.5",
|
|
72
|
-
"prop-types": "15.8.1",
|
|
73
|
-
"react": "18.2.0",
|
|
74
|
-
"react-dom": "18.2.0",
|
|
75
|
-
"storybook": "8.5.0",
|
|
76
|
-
"stylelint": "16.10.0",
|
|
77
|
-
"stylelint-config-standard-scss": "13.0.0",
|
|
78
|
-
"ts-node": "10.9.1",
|
|
79
|
-
"typescript": "5.
|
|
80
|
-
}
|
|
81
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "my-lib",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "",
|
|
5
|
+
"private": true,
|
|
6
|
+
"main": "index.js",
|
|
7
|
+
"scripts": {
|
|
8
|
+
"eslint": "eslint",
|
|
9
|
+
"eslint:fix": "eslint --fix",
|
|
10
|
+
"stylelint": "stylelint packages/**/*.{css,scss,less,ts,tsx}",
|
|
11
|
+
"stylelint:fix": "stylelint packages/**/*.{css,scss,less,ts,tsx} --fix",
|
|
12
|
+
"lint": "pnpm -r run lint && pnpm eslint && pnpm stylelint",
|
|
13
|
+
"lint:fix": "pnpm -r run lint && pnpm eslint:fix && pnpm stylelint:fix",
|
|
14
|
+
"build": "ts-node --project ./tsconfig.node.json ./scripts/build.ts",
|
|
15
|
+
"changeVersion": "pnpm changeset && pnpm changeset version && pnpm run clear:changelog",
|
|
16
|
+
"clear:changelog": "pnpm -r exec rimraf CHANGELOG.md",
|
|
17
|
+
"commit": "git add . && cz",
|
|
18
|
+
"push": "pnpm run commit && git push",
|
|
19
|
+
"login": "npm login --registry https://registry.npmjs.org",
|
|
20
|
+
"clean:dist": "pnpm -r exec rimraf dist",
|
|
21
|
+
"format": "prettier --write \"**/*.{ts,js,tsx,jsx,json,css,scss,less}\"",
|
|
22
|
+
"pub": "pnpm run build && pnpm run changeVersion && pnpm run push && pnpm -r publish --registry https://registry.npmjs.org",
|
|
23
|
+
"storybook": "storybook dev -p 6006",
|
|
24
|
+
"build-storybook": "storybook build",
|
|
25
|
+
"up:storybook": "pnpm up storybook eslint-plugin-storybook @storybook/* -L"
|
|
26
|
+
},
|
|
27
|
+
"keywords": [],
|
|
28
|
+
"author": "kevily",
|
|
29
|
+
"license": "ISC",
|
|
30
|
+
"config": {
|
|
31
|
+
"commitizen": {
|
|
32
|
+
"path": "@commitlint/cz-commitlint"
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
"dependencies": {
|
|
36
|
+
"1k-tasks": "4.2.1",
|
|
37
|
+
"@commitlint/config-conventional": "17.6.6",
|
|
38
|
+
"@commitlint/cz-commitlint": "17.5.0",
|
|
39
|
+
"@eslint/js": "9.15.0",
|
|
40
|
+
"commitizen": "4.3.0",
|
|
41
|
+
"rimraf": "5.0.1"
|
|
42
|
+
},
|
|
43
|
+
"devDependencies": {
|
|
44
|
+
"@changesets/cli": "2.26.2",
|
|
45
|
+
"@eslint/js": "9.15.0",
|
|
46
|
+
"@storybook/addon-essentials": "8.5.0",
|
|
47
|
+
"@storybook/addon-interactions": "8.5.0",
|
|
48
|
+
"@storybook/addon-links": "8.5.0",
|
|
49
|
+
"@storybook/blocks": "8.5.0",
|
|
50
|
+
"@storybook/react": "8.5.0",
|
|
51
|
+
"@storybook/react-vite": "8.5.0",
|
|
52
|
+
"@storybook/testing-library": "0.2.2",
|
|
53
|
+
"@svgr/rollup": "8.1.0",
|
|
54
|
+
"@types/node": "20.3.2",
|
|
55
|
+
"@types/react": "18.3.3",
|
|
56
|
+
"@types/react-dom": "18.3.0",
|
|
57
|
+
"autoprefixer": "10.4.14",
|
|
58
|
+
"eslint": "9.17.0",
|
|
59
|
+
"eslint-import-resolver-typescript": "3.7.0",
|
|
60
|
+
"eslint-plugin-import": "2.31.0",
|
|
61
|
+
"eslint-plugin-react": "7.37.2",
|
|
62
|
+
"eslint-plugin-react-hooks": "5.1.0",
|
|
63
|
+
"eslint-plugin-storybook": "0.11.2",
|
|
64
|
+
"globals": "15.12.0",
|
|
65
|
+
"inquirer": "^8.1.2",
|
|
66
|
+
"postcss": "8.4.31",
|
|
67
|
+
"postcss-import": "15.1.0",
|
|
68
|
+
"postcss-nesting": "12.0.0",
|
|
69
|
+
"postcss-scss": "4.0.6",
|
|
70
|
+
"postcss-styled-syntax": "0.6.4",
|
|
71
|
+
"prettier": "3.2.5",
|
|
72
|
+
"prop-types": "15.8.1",
|
|
73
|
+
"react": "18.2.0",
|
|
74
|
+
"react-dom": "18.2.0",
|
|
75
|
+
"storybook": "8.5.0",
|
|
76
|
+
"stylelint": "16.10.0",
|
|
77
|
+
"stylelint-config-standard-scss": "13.0.0",
|
|
78
|
+
"ts-node": "10.9.1",
|
|
79
|
+
"typescript": "5.8.2"
|
|
80
|
+
}
|
|
81
|
+
}
|
|
@@ -1,45 +1,45 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "react-lib",
|
|
3
|
-
"version": "1.0.0",
|
|
4
|
-
"description": "",
|
|
5
|
-
"main": "dist/index.js",
|
|
6
|
-
"types": "dist/index.d.ts",
|
|
7
|
-
"sideEffects": [
|
|
8
|
-
"*.css",
|
|
9
|
-
"*.scss"
|
|
10
|
-
],
|
|
11
|
-
"scripts": {
|
|
12
|
-
"lint": "tsc --noEmit -p tsconfig.lint.json",
|
|
13
|
-
"test": "echo \"Error: no test specified\" && exit 1",
|
|
14
|
-
"storybook": "storybook dev -p 6006",
|
|
15
|
-
"build-storybook": "storybook build",
|
|
16
|
-
"up:storybook": "pnpm up storybook eslint-plugin-storybook @storybook/* -L"
|
|
17
|
-
},
|
|
18
|
-
"files": [
|
|
19
|
-
"dist"
|
|
20
|
-
],
|
|
21
|
-
"keywords": [],
|
|
22
|
-
"author": "",
|
|
23
|
-
"license": "ISC",
|
|
24
|
-
"peerDependencies": {
|
|
25
|
-
"react": "18.2.0",
|
|
26
|
-
"react-dom": "18.2.0"
|
|
27
|
-
},
|
|
28
|
-
"devDependencies": {
|
|
29
|
-
"@types/react": "18.3.3",
|
|
30
|
-
"@types/react-dom": "18.3.0",
|
|
31
|
-
"eslint": "9.17.0",
|
|
32
|
-
"eslint-import-resolver-typescript": "3.7.0",
|
|
33
|
-
"eslint-plugin-import": "2.31.0",
|
|
34
|
-
"eslint-plugin-react": "7.37.2",
|
|
35
|
-
"eslint-plugin-react-hooks": "5.1.0",
|
|
36
|
-
"
|
|
37
|
-
"
|
|
38
|
-
"prettier": "3.2.5",
|
|
39
|
-
"react": "18.2.0",
|
|
40
|
-
"react-dom": "18.2.0",
|
|
41
|
-
"stylelint": "16.10.0",
|
|
42
|
-
"stylelint-config-standard": "36.0.1",
|
|
43
|
-
"typescript": "5.
|
|
44
|
-
}
|
|
45
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "react-lib",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"types": "dist/index.d.ts",
|
|
7
|
+
"sideEffects": [
|
|
8
|
+
"*.css",
|
|
9
|
+
"*.scss"
|
|
10
|
+
],
|
|
11
|
+
"scripts": {
|
|
12
|
+
"lint": "tsc --noEmit -p tsconfig.lint.json",
|
|
13
|
+
"test": "echo \"Error: no test specified\" && exit 1",
|
|
14
|
+
"storybook": "storybook dev -p 6006",
|
|
15
|
+
"build-storybook": "storybook build",
|
|
16
|
+
"up:storybook": "pnpm up storybook eslint-plugin-storybook @storybook/* -L"
|
|
17
|
+
},
|
|
18
|
+
"files": [
|
|
19
|
+
"dist"
|
|
20
|
+
],
|
|
21
|
+
"keywords": [],
|
|
22
|
+
"author": "",
|
|
23
|
+
"license": "ISC",
|
|
24
|
+
"peerDependencies": {
|
|
25
|
+
"react": "18.2.0",
|
|
26
|
+
"react-dom": "18.2.0"
|
|
27
|
+
},
|
|
28
|
+
"devDependencies": {
|
|
29
|
+
"@types/react": "18.3.3",
|
|
30
|
+
"@types/react-dom": "18.3.0",
|
|
31
|
+
"eslint": "9.17.0",
|
|
32
|
+
"eslint-import-resolver-typescript": "3.7.0",
|
|
33
|
+
"eslint-plugin-import": "2.31.0",
|
|
34
|
+
"eslint-plugin-react": "7.37.2",
|
|
35
|
+
"eslint-plugin-react-hooks": "5.1.0",
|
|
36
|
+
"eslint-plugin-storybook": "0.11.1",
|
|
37
|
+
"globals": "15.12.0",
|
|
38
|
+
"prettier": "3.2.5",
|
|
39
|
+
"react": "18.2.0",
|
|
40
|
+
"react-dom": "18.2.0",
|
|
41
|
+
"stylelint": "16.10.0",
|
|
42
|
+
"stylelint-config-standard": "36.0.1",
|
|
43
|
+
"typescript": "5.8.2"
|
|
44
|
+
}
|
|
45
|
+
}
|
|
@@ -1,30 +1,30 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "ts-lib",
|
|
3
|
-
"version": "1.0.0",
|
|
4
|
-
"description": "",
|
|
5
|
-
"main": "dist/index.js",
|
|
6
|
-
"types": "dist/index.d.ts",
|
|
7
|
-
"sideEffects": false,
|
|
8
|
-
"scripts": {
|
|
9
|
-
"lint": "tsc --noEmit -p tsconfig.lint.json",
|
|
10
|
-
"build": "tsc",
|
|
11
|
-
"test": "vitest",
|
|
12
|
-
"coverage": "vitest run --coverage"
|
|
13
|
-
},
|
|
14
|
-
"files": [
|
|
15
|
-
"dist"
|
|
16
|
-
],
|
|
17
|
-
"license": "ISC",
|
|
18
|
-
"devDependencies": {
|
|
19
|
-
"@vitest/coverage-v8": "2.0.5",
|
|
20
|
-
"eslint": "9.17.0",
|
|
21
|
-
"eslint-import-resolver-typescript": "3.7.0",
|
|
22
|
-
"eslint-plugin-import": "2.31.0",
|
|
23
|
-
"prettier": "3.2.5",
|
|
24
|
-
"stylelint": "16.10.0",
|
|
25
|
-
"stylelint-config-standard-scss": "13.0.0",
|
|
26
|
-
"typescript": "5.
|
|
27
|
-
"typescript-eslint": "8.15.0",
|
|
28
|
-
"vitest": "2.0.5"
|
|
29
|
-
}
|
|
30
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "ts-lib",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"types": "dist/index.d.ts",
|
|
7
|
+
"sideEffects": false,
|
|
8
|
+
"scripts": {
|
|
9
|
+
"lint": "tsc --noEmit -p tsconfig.lint.json",
|
|
10
|
+
"build": "tsc",
|
|
11
|
+
"test": "vitest",
|
|
12
|
+
"coverage": "vitest run --coverage"
|
|
13
|
+
},
|
|
14
|
+
"files": [
|
|
15
|
+
"dist"
|
|
16
|
+
],
|
|
17
|
+
"license": "ISC",
|
|
18
|
+
"devDependencies": {
|
|
19
|
+
"@vitest/coverage-v8": "2.0.5",
|
|
20
|
+
"eslint": "9.17.0",
|
|
21
|
+
"eslint-import-resolver-typescript": "3.7.0",
|
|
22
|
+
"eslint-plugin-import": "2.31.0",
|
|
23
|
+
"prettier": "3.2.5",
|
|
24
|
+
"stylelint": "16.10.0",
|
|
25
|
+
"stylelint-config-standard-scss": "13.0.0",
|
|
26
|
+
"typescript": "5.8.2",
|
|
27
|
+
"typescript-eslint": "8.15.0",
|
|
28
|
+
"vitest": "2.0.5"
|
|
29
|
+
}
|
|
30
|
+
}
|
|
@@ -1,82 +1,82 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "nest-temp",
|
|
3
|
-
"version": "0.0.1",
|
|
4
|
-
"description": "",
|
|
5
|
-
"author": "",
|
|
6
|
-
"private": true,
|
|
7
|
-
"license": "UNLICENSED",
|
|
8
|
-
"scripts": {
|
|
9
|
-
"prepare": "husky install",
|
|
10
|
-
"prebuild": "rimraf dist",
|
|
11
|
-
"build": "nest build",
|
|
12
|
-
"format": "prettier --write \"src/**/*.ts\" \"test/**/*.ts\"",
|
|
13
|
-
"start": "nest start",
|
|
14
|
-
"start:dev": "nest start --watch",
|
|
15
|
-
"start:debug": "nest start --debug --watch",
|
|
16
|
-
"start:prod": "node dist/main",
|
|
17
|
-
"lint": "eslint \"{src,apps,libs,test}/**/*.ts\"",
|
|
18
|
-
"lint:fix": "eslint \"{src,apps,libs,test}/**/*.ts\" --fix",
|
|
19
|
-
"test": "jest",
|
|
20
|
-
"test:watch": "jest --watch",
|
|
21
|
-
"test:cov": "jest --coverage",
|
|
22
|
-
"test:debug": "node --inspect-brk -r tsconfig-paths/register -r ts-node/register node_modules/.bin/jest --runInBand",
|
|
23
|
-
"test:e2e": "jest --config test/jest-e2e.json",
|
|
24
|
-
"cz": "cz",
|
|
25
|
-
"push": "npm run commit && git push",
|
|
26
|
-
"commit": "git add . && npm run cz"
|
|
27
|
-
},
|
|
28
|
-
"dependencies": {
|
|
29
|
-
"@nestjs/common": "9.3.8",
|
|
30
|
-
"@nestjs/core": "9.3.8",
|
|
31
|
-
"@nestjs/platform-express": "9.3.8",
|
|
32
|
-
"reflect-metadata": "0.1.13",
|
|
33
|
-
"rimraf": "4.1.2",
|
|
34
|
-
"rxjs": "7.8.0"
|
|
35
|
-
},
|
|
36
|
-
"devDependencies": {
|
|
37
|
-
"@nestjs/cli": "9.2.0",
|
|
38
|
-
"@nestjs/schematics": "9.0.4",
|
|
39
|
-
"@nestjs/testing": "9.3.8",
|
|
40
|
-
"@types/express": "4.17.17",
|
|
41
|
-
"@types/jest": "29.4.0",
|
|
42
|
-
"@types/node": "18.13.0",
|
|
43
|
-
"@types/supertest": "2.0.12",
|
|
44
|
-
"commitizen": "4.3.0",
|
|
45
|
-
"cz-adapter-eslint": "0.3.0",
|
|
46
|
-
"eslint": "9.17.0",
|
|
47
|
-
"eslint-config-prettier": "9.1.0",
|
|
48
|
-
"eslint-plugin-prettier": "5.2.1",
|
|
49
|
-
"husky": "9.1.6",
|
|
50
|
-
"jest": "29.4.2",
|
|
51
|
-
"prettier": "3.2.5",
|
|
52
|
-
"source-map-support": "0.5.21",
|
|
53
|
-
"supertest": "6.3.3",
|
|
54
|
-
"ts-jest": "29.0.5",
|
|
55
|
-
"ts-loader": "9.4.2",
|
|
56
|
-
"ts-node": "10.9.1",
|
|
57
|
-
"tsconfig-paths": "4.1.2",
|
|
58
|
-
"typescript": "5.
|
|
59
|
-
},
|
|
60
|
-
"jest": {
|
|
61
|
-
"moduleFileExtensions": [
|
|
62
|
-
"js",
|
|
63
|
-
"json",
|
|
64
|
-
"ts"
|
|
65
|
-
],
|
|
66
|
-
"rootDir": "src",
|
|
67
|
-
"testRegex": ".*\\.spec\\.ts$",
|
|
68
|
-
"transform": {
|
|
69
|
-
"^.+\\.(t|j)s$": "ts-jest"
|
|
70
|
-
},
|
|
71
|
-
"collectCoverageFrom": [
|
|
72
|
-
"**/*.(t|j)s"
|
|
73
|
-
],
|
|
74
|
-
"coverageDirectory": "../coverage",
|
|
75
|
-
"testEnvironment": "node"
|
|
76
|
-
},
|
|
77
|
-
"config": {
|
|
78
|
-
"commitizen": {
|
|
79
|
-
"path": "./node_modules/cz-adapter-eslint"
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "nest-temp",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"description": "",
|
|
5
|
+
"author": "",
|
|
6
|
+
"private": true,
|
|
7
|
+
"license": "UNLICENSED",
|
|
8
|
+
"scripts": {
|
|
9
|
+
"prepare": "husky install",
|
|
10
|
+
"prebuild": "rimraf dist",
|
|
11
|
+
"build": "nest build",
|
|
12
|
+
"format": "prettier --write \"src/**/*.ts\" \"test/**/*.ts\"",
|
|
13
|
+
"start": "nest start",
|
|
14
|
+
"start:dev": "nest start --watch",
|
|
15
|
+
"start:debug": "nest start --debug --watch",
|
|
16
|
+
"start:prod": "node dist/main",
|
|
17
|
+
"lint": "eslint \"{src,apps,libs,test}/**/*.ts\"",
|
|
18
|
+
"lint:fix": "eslint \"{src,apps,libs,test}/**/*.ts\" --fix",
|
|
19
|
+
"test": "jest",
|
|
20
|
+
"test:watch": "jest --watch",
|
|
21
|
+
"test:cov": "jest --coverage",
|
|
22
|
+
"test:debug": "node --inspect-brk -r tsconfig-paths/register -r ts-node/register node_modules/.bin/jest --runInBand",
|
|
23
|
+
"test:e2e": "jest --config test/jest-e2e.json",
|
|
24
|
+
"cz": "cz",
|
|
25
|
+
"push": "npm run commit && git push",
|
|
26
|
+
"commit": "git add . && npm run cz"
|
|
27
|
+
},
|
|
28
|
+
"dependencies": {
|
|
29
|
+
"@nestjs/common": "9.3.8",
|
|
30
|
+
"@nestjs/core": "9.3.8",
|
|
31
|
+
"@nestjs/platform-express": "9.3.8",
|
|
32
|
+
"reflect-metadata": "0.1.13",
|
|
33
|
+
"rimraf": "4.1.2",
|
|
34
|
+
"rxjs": "7.8.0"
|
|
35
|
+
},
|
|
36
|
+
"devDependencies": {
|
|
37
|
+
"@nestjs/cli": "9.2.0",
|
|
38
|
+
"@nestjs/schematics": "9.0.4",
|
|
39
|
+
"@nestjs/testing": "9.3.8",
|
|
40
|
+
"@types/express": "4.17.17",
|
|
41
|
+
"@types/jest": "29.4.0",
|
|
42
|
+
"@types/node": "18.13.0",
|
|
43
|
+
"@types/supertest": "2.0.12",
|
|
44
|
+
"commitizen": "4.3.0",
|
|
45
|
+
"cz-adapter-eslint": "0.3.0",
|
|
46
|
+
"eslint": "9.17.0",
|
|
47
|
+
"eslint-config-prettier": "9.1.0",
|
|
48
|
+
"eslint-plugin-prettier": "5.2.1",
|
|
49
|
+
"husky": "9.1.6",
|
|
50
|
+
"jest": "29.4.2",
|
|
51
|
+
"prettier": "3.2.5",
|
|
52
|
+
"source-map-support": "0.5.21",
|
|
53
|
+
"supertest": "6.3.3",
|
|
54
|
+
"ts-jest": "29.0.5",
|
|
55
|
+
"ts-loader": "9.4.2",
|
|
56
|
+
"ts-node": "10.9.1",
|
|
57
|
+
"tsconfig-paths": "4.1.2",
|
|
58
|
+
"typescript": "5.8.2"
|
|
59
|
+
},
|
|
60
|
+
"jest": {
|
|
61
|
+
"moduleFileExtensions": [
|
|
62
|
+
"js",
|
|
63
|
+
"json",
|
|
64
|
+
"ts"
|
|
65
|
+
],
|
|
66
|
+
"rootDir": "src",
|
|
67
|
+
"testRegex": ".*\\.spec\\.ts$",
|
|
68
|
+
"transform": {
|
|
69
|
+
"^.+\\.(t|j)s$": "ts-jest"
|
|
70
|
+
},
|
|
71
|
+
"collectCoverageFrom": [
|
|
72
|
+
"**/*.(t|j)s"
|
|
73
|
+
],
|
|
74
|
+
"coverageDirectory": "../coverage",
|
|
75
|
+
"testEnvironment": "node"
|
|
76
|
+
},
|
|
77
|
+
"config": {
|
|
78
|
+
"commitizen": {
|
|
79
|
+
"path": "./node_modules/cz-adapter-eslint"
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
}
|
|
@@ -13,7 +13,8 @@ export default defineConfig(({ envMode, command }) => {
|
|
|
13
13
|
return {
|
|
14
14
|
html: {
|
|
15
15
|
template: './index.html',
|
|
16
|
-
title: 'Rspack + React + TS'
|
|
16
|
+
title: 'Rspack + React + TS',
|
|
17
|
+
favicon: './shared/assets/react.ico'
|
|
17
18
|
},
|
|
18
19
|
source: {
|
|
19
20
|
entry: {
|
|
@@ -32,7 +33,7 @@ export default defineConfig(({ envMode, command }) => {
|
|
|
32
33
|
cleanDistPath: true
|
|
33
34
|
},
|
|
34
35
|
dev: {
|
|
35
|
-
progressBar:
|
|
36
|
+
progressBar: command === 'build'
|
|
36
37
|
},
|
|
37
38
|
tools: {
|
|
38
39
|
rspack: {
|
|
@@ -63,12 +63,11 @@
|
|
|
63
63
|
"rollup-plugin-visualizer": "5.12.0",
|
|
64
64
|
"stylelint": "16.10.0",
|
|
65
65
|
"stylelint-config-standard": "36.0.1",
|
|
66
|
-
"typescript": "5.
|
|
66
|
+
"typescript": "5.8.2",
|
|
67
67
|
"typescript-eslint": "8.15.0",
|
|
68
68
|
"vite": "6.0.7",
|
|
69
|
-
"vite-plugin-checker": "0.
|
|
69
|
+
"vite-plugin-checker": "0.9.0",
|
|
70
70
|
"vite-plugin-mock-dev-server": "1.8.3",
|
|
71
|
-
"vite-plugin-stylelint": "6.0.0",
|
|
72
71
|
"vite-plugin-svgr": "4.3.0"
|
|
73
72
|
},
|
|
74
73
|
"config": {
|
|
@@ -3,7 +3,6 @@ import react from '@vitejs/plugin-react'
|
|
|
3
3
|
import svgr from 'vite-plugin-svgr'
|
|
4
4
|
import mockDevServer from 'vite-plugin-mock-dev-server'
|
|
5
5
|
import checker from 'vite-plugin-checker'
|
|
6
|
-
import stylelint from 'vite-plugin-stylelint'
|
|
7
6
|
import { visualizer } from 'rollup-plugin-visualizer'
|
|
8
7
|
import { includes } from 'lodash-es'
|
|
9
8
|
import { createChunks } from './scripts'
|
|
@@ -14,7 +13,6 @@ export default defineConfig(({ mode }) => {
|
|
|
14
13
|
const proxyBaseUrl = env.VITE_BASE_URL + env.VITE_API_HOST
|
|
15
14
|
const plugins: any[] = [
|
|
16
15
|
svgr(),
|
|
17
|
-
stylelint({ cache: false, include: ['**/*.{css,scss,less,ts,tsx}'] }),
|
|
18
16
|
checker({
|
|
19
17
|
enableBuild: false,
|
|
20
18
|
typescript: true,
|
|
@@ -45,11 +45,10 @@
|
|
|
45
45
|
"rollup-plugin-visualizer": "5.12.0",
|
|
46
46
|
"svelte-check": "4.1.1",
|
|
47
47
|
"tslib": "2.6.2",
|
|
48
|
-
"typescript": "5.
|
|
48
|
+
"typescript": "5.8.2",
|
|
49
49
|
"typescript-eslint": "8.15.0",
|
|
50
50
|
"vite": "6.0.7",
|
|
51
|
-
"vite-plugin-checker": "0.
|
|
52
|
-
"vite-plugin-stylelint": "6.0.0"
|
|
51
|
+
"vite-plugin-checker": "0.9.0"
|
|
53
52
|
},
|
|
54
53
|
"dependencies": {
|
|
55
54
|
"lodash-es": "4.17.21",
|
|
@@ -10,17 +10,19 @@
|
|
|
10
10
|
"build:analyse": "tsc --noEmit && vite build --mode analyse",
|
|
11
11
|
"preview": "vite preview",
|
|
12
12
|
"format": "prettier --write \"**/*.{vue,ts,js,tsx,jsx,json,css,scss,less}\"",
|
|
13
|
-
"lint": "vue-tsc --noEmit && eslint --no-error-on-unmatched-pattern && stylelint **/*.{css,scss,less}",
|
|
14
|
-
"lint:fix": "eslint --fix && stylelint **/*.{css,scss,less} --fix",
|
|
13
|
+
"lint": "vue-tsc --noEmit && eslint --no-error-on-unmatched-pattern && stylelint **/*.{css,scss,less,vue}",
|
|
14
|
+
"lint:fix": "eslint --fix && stylelint **/*.{css,scss,less,vue} --fix",
|
|
15
15
|
"cz": "cz",
|
|
16
16
|
"push": "npm run commit && git push",
|
|
17
17
|
"commit": "git add . && npm run cz",
|
|
18
|
-
"up:vite": "pnpm up vite @vitejs/* vite-plugin-* -L"
|
|
18
|
+
"up:vite": "pnpm up vite @vitejs/* vite-plugin-* -L",
|
|
19
|
+
"up:vue": "pnpm up vue vue-router vue-tsc -L"
|
|
19
20
|
},
|
|
20
21
|
"dependencies": {
|
|
21
22
|
"axios": "1.7.9",
|
|
22
23
|
"lodash-es": "4.17.21",
|
|
23
24
|
"pinia": "2.3.1",
|
|
25
|
+
"tailwindcss": "4.0.9",
|
|
24
26
|
"type-fest": "4.33.0",
|
|
25
27
|
"vue": "3.5.13",
|
|
26
28
|
"vue-router": "4.5.0"
|
|
@@ -31,6 +33,7 @@
|
|
|
31
33
|
"@commitlint/cz-commitlint": "17.5.0",
|
|
32
34
|
"@eslint/js": "9.15.0",
|
|
33
35
|
"@faker-js/faker": "8.4.1",
|
|
36
|
+
"@tailwindcss/vite": "4.0.9",
|
|
34
37
|
"@types/lodash-es": "4.17.12",
|
|
35
38
|
"@types/mockjs": "1.0.10",
|
|
36
39
|
"@vitejs/plugin-vue": "5.2.1",
|
|
@@ -52,15 +55,13 @@
|
|
|
52
55
|
"rollup-plugin-visualizer": "5.12.0",
|
|
53
56
|
"stylelint": "16.10.0",
|
|
54
57
|
"stylelint-config-standard-scss": "13.1.0",
|
|
55
|
-
"
|
|
56
|
-
"typescript": "5.7.2",
|
|
58
|
+
"typescript": "5.8.2",
|
|
57
59
|
"typescript-eslint": "8.15.0",
|
|
58
60
|
"vite": "6.0.7",
|
|
59
|
-
"vite-plugin-checker": "0.
|
|
61
|
+
"vite-plugin-checker": "0.9.0",
|
|
60
62
|
"vite-plugin-mock-dev-server": "1.8.3",
|
|
61
|
-
"vite-plugin-stylelint": "6.0.0",
|
|
62
63
|
"vite-svg-loader": "5.1.0",
|
|
63
|
-
"vue-tsc": "2.2.
|
|
64
|
+
"vue-tsc": "2.2.8"
|
|
64
65
|
},
|
|
65
66
|
"config": {
|
|
66
67
|
"commitizen": {
|
|
@@ -21,6 +21,6 @@ const routes: RouteRecordRaw[] = [
|
|
|
21
21
|
export { default as routerNames } from './names'
|
|
22
22
|
|
|
23
23
|
export const router = createRouter({
|
|
24
|
-
history: createWebHistory(import.meta.env.
|
|
24
|
+
history: createWebHistory(import.meta.env.VITE_BASE_URL),
|
|
25
25
|
routes
|
|
26
26
|
})
|
|
@@ -1,31 +1,14 @@
|
|
|
1
1
|
import { ref, reactive, computed, unref } from 'vue'
|
|
2
|
-
import { cloneDeep,
|
|
2
|
+
import { cloneDeep, assign, pick, isNil, size, max } from 'lodash-es'
|
|
3
3
|
|
|
4
|
-
export interface
|
|
5
|
-
loading: boolean
|
|
6
|
-
total: number
|
|
7
|
-
params: P
|
|
8
|
-
list: ListItem[]
|
|
9
|
-
sum: Record<string, any>
|
|
10
|
-
selected: ListItem[]
|
|
11
|
-
selectedKeys: (string | number)[]
|
|
12
|
-
pagination: {
|
|
13
|
-
current: number
|
|
14
|
-
pageSize: number
|
|
15
|
-
total: number
|
|
16
|
-
}
|
|
17
|
-
selectedLen: number
|
|
18
|
-
}
|
|
19
|
-
export interface createListStorePropsType<ListItem, P> {
|
|
4
|
+
export interface configType<ListItem, P> {
|
|
20
5
|
/**
|
|
21
6
|
* @description 默认请求参数
|
|
22
7
|
*/
|
|
23
8
|
defaultParams: P
|
|
24
9
|
/** 列表请求 */
|
|
25
|
-
fetch: (
|
|
26
|
-
|
|
27
|
-
) => Promise<{
|
|
28
|
-
list: any[]
|
|
10
|
+
fetch: (state: { params: P }) => Promise<{
|
|
11
|
+
list: ListItem[]
|
|
29
12
|
page?: number
|
|
30
13
|
pageSize?: number
|
|
31
14
|
total?: number
|
|
@@ -39,22 +22,22 @@ export interface createListStorePropsType<ListItem, P> {
|
|
|
39
22
|
}
|
|
40
23
|
|
|
41
24
|
export default function createListStore<
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
>(config:
|
|
45
|
-
const loading = ref
|
|
46
|
-
const total = ref
|
|
47
|
-
const params = reactive
|
|
48
|
-
const list = ref<
|
|
49
|
-
const sum = reactive<
|
|
50
|
-
const selected = ref<
|
|
51
|
-
const selectedKeys = ref<
|
|
52
|
-
const pagination = computed
|
|
25
|
+
P extends { page?: number; pageSize?: number; [key: string]: any },
|
|
26
|
+
ListItem extends Record<string, any> = Record<string, any>
|
|
27
|
+
>(config: configType<ListItem, P>) {
|
|
28
|
+
const loading = ref(true)
|
|
29
|
+
const total = ref(0)
|
|
30
|
+
const params = reactive(cloneDeep(config.defaultParams))
|
|
31
|
+
const list = ref<ListItem[]>([])
|
|
32
|
+
const sum = reactive<Record<string, any>>({})
|
|
33
|
+
const selected = ref<ListItem[]>([])
|
|
34
|
+
const selectedKeys = ref<(string | number)[]>([])
|
|
35
|
+
const pagination = computed(() => ({
|
|
53
36
|
current: params.page || 0,
|
|
54
37
|
pageSize: params.pageSize || 0,
|
|
55
38
|
total: total.value
|
|
56
39
|
}))
|
|
57
|
-
const selectedLen = computed
|
|
40
|
+
const selectedLen = computed(() => {
|
|
58
41
|
return max([size(selected.value), size(selectedKeys.value)]) || 0
|
|
59
42
|
})
|
|
60
43
|
function resetParams() {
|
|
@@ -71,14 +54,12 @@ export default function createListStore<
|
|
|
71
54
|
)
|
|
72
55
|
}
|
|
73
56
|
assign(params, arg?.params)
|
|
74
|
-
const result = await config.fetch({
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
}
|
|
80
|
-
list.value =
|
|
81
|
-
!isNil(result.page) && arg?.isConcat ? concat(list.value, result.list) : result.list
|
|
57
|
+
const result = await config.fetch({ params: unref(params) })
|
|
58
|
+
if (!isNil(result.page) && arg?.isConcat) {
|
|
59
|
+
list.value = [...list.value, ...result.list] as ListItem[]
|
|
60
|
+
} else {
|
|
61
|
+
list.value = result.list
|
|
62
|
+
}
|
|
82
63
|
sum.value = result.sum || {}
|
|
83
64
|
total.value = result.total || total.value
|
|
84
65
|
params.page = result.page || params.page
|
|
@@ -3,8 +3,9 @@ import vue from '@vitejs/plugin-vue'
|
|
|
3
3
|
import vueJsx from '@vitejs/plugin-vue-jsx'
|
|
4
4
|
import svgLoader from 'vite-svg-loader'
|
|
5
5
|
import mockDevServer from 'vite-plugin-mock-dev-server'
|
|
6
|
-
import stylelint from 'vite-plugin-stylelint'
|
|
7
6
|
import checker from 'vite-plugin-checker'
|
|
7
|
+
// @ts-ignore
|
|
8
|
+
import tailwindcss from '@tailwindcss/vite'
|
|
8
9
|
import { visualizer } from 'rollup-plugin-visualizer'
|
|
9
10
|
import { includes } from 'lodash-es'
|
|
10
11
|
import { createChunks } from './scripts'
|
|
@@ -14,16 +15,16 @@ export default defineConfig(({ mode }) => {
|
|
|
14
15
|
const env = loadEnv(mode, process.cwd(), '')
|
|
15
16
|
const proxyBaseUrl = env.VITE_BASE_URL + env.VITE_API_HOST
|
|
16
17
|
const plugins: any[] = [
|
|
18
|
+
tailwindcss(),
|
|
17
19
|
vueJsx({
|
|
18
20
|
enableObjectSlots: false
|
|
19
21
|
}),
|
|
20
|
-
|
|
22
|
+
vue(),
|
|
21
23
|
checker({
|
|
22
24
|
enableBuild: false,
|
|
23
25
|
typescript: true,
|
|
24
26
|
eslint: { useFlatConfig: true, lintCommand: 'eslint', dev: { logLevel: ['error'] } }
|
|
25
27
|
}),
|
|
26
|
-
vue(),
|
|
27
28
|
svgLoader(),
|
|
28
29
|
mockDevServer({
|
|
29
30
|
include: ['**/*.mock.{ts,js}']
|
|
@@ -23,6 +23,7 @@
|
|
|
23
23
|
"axios": "1.7.9",
|
|
24
24
|
"lodash-es": "4.17.21",
|
|
25
25
|
"pinia": "2.3.1",
|
|
26
|
+
"tailwindcss": "3.4.3",
|
|
26
27
|
"type-fest": "4.33.0",
|
|
27
28
|
"vue": "3.5.13",
|
|
28
29
|
"vue-router": "4.5.0"
|
|
@@ -38,6 +39,7 @@
|
|
|
38
39
|
"@rsbuild/plugin-type-check": "1.2.1",
|
|
39
40
|
"@rsbuild/plugin-vue": "1.0.6",
|
|
40
41
|
"@rsdoctor/rspack-plugin": "0.4.13",
|
|
42
|
+
"@tailwindcss/postcss": "^4.0.9",
|
|
41
43
|
"@types/lodash-es": "4.17.12",
|
|
42
44
|
"@types/mockjs": "1.0.10",
|
|
43
45
|
"autoprefixer": "10.4.14",
|
|
@@ -58,10 +60,9 @@
|
|
|
58
60
|
"stylelint": "16.10.0",
|
|
59
61
|
"stylelint-config-standard-scss": "13.1.0",
|
|
60
62
|
"stylelint-webpack-plugin": "5.0.0",
|
|
61
|
-
"
|
|
62
|
-
"typescript": "5.7.2",
|
|
63
|
+
"typescript": "5.8.2",
|
|
63
64
|
"typescript-eslint": "8.15.0",
|
|
64
|
-
"vue-tsc": "2.2.
|
|
65
|
+
"vue-tsc": "2.2.8"
|
|
65
66
|
},
|
|
66
67
|
"config": {
|
|
67
68
|
"commitizen": {
|
|
@@ -11,7 +11,8 @@ export default defineConfig(({ envMode, command }) => {
|
|
|
11
11
|
return {
|
|
12
12
|
html: {
|
|
13
13
|
template: './index.html',
|
|
14
|
-
title: 'Vite + Vue + TS'
|
|
14
|
+
title: 'Vite + Vue + TS',
|
|
15
|
+
favicon: './shared/assets/vue.svg'
|
|
15
16
|
},
|
|
16
17
|
source: {
|
|
17
18
|
entry: {
|
|
@@ -30,7 +31,7 @@ export default defineConfig(({ envMode, command }) => {
|
|
|
30
31
|
cleanDistPath: true
|
|
31
32
|
},
|
|
32
33
|
dev: {
|
|
33
|
-
progressBar:
|
|
34
|
+
progressBar: command === 'build'
|
|
34
35
|
},
|
|
35
36
|
tools: {
|
|
36
37
|
rspack: {
|
|
@@ -1,31 +1,14 @@
|
|
|
1
1
|
import { ref, reactive, computed, unref } from 'vue'
|
|
2
|
-
import { cloneDeep,
|
|
2
|
+
import { cloneDeep, assign, pick, isNil, size, max } from 'lodash-es'
|
|
3
3
|
|
|
4
|
-
export interface
|
|
5
|
-
loading: boolean
|
|
6
|
-
total: number
|
|
7
|
-
params: P
|
|
8
|
-
list: ListItem[]
|
|
9
|
-
sum: Record<string, any>
|
|
10
|
-
selected: ListItem[]
|
|
11
|
-
selectedKeys: (string | number)[]
|
|
12
|
-
pagination: {
|
|
13
|
-
current: number
|
|
14
|
-
pageSize: number
|
|
15
|
-
total: number
|
|
16
|
-
}
|
|
17
|
-
selectedLen: number
|
|
18
|
-
}
|
|
19
|
-
export interface createListStorePropsType<ListItem, P> {
|
|
4
|
+
export interface configType<ListItem, P> {
|
|
20
5
|
/**
|
|
21
6
|
* @description 默认请求参数
|
|
22
7
|
*/
|
|
23
8
|
defaultParams: P
|
|
24
9
|
/** 列表请求 */
|
|
25
|
-
fetch: (
|
|
26
|
-
|
|
27
|
-
) => Promise<{
|
|
28
|
-
list: any[]
|
|
10
|
+
fetch: (state: { params: P }) => Promise<{
|
|
11
|
+
list: ListItem[]
|
|
29
12
|
page?: number
|
|
30
13
|
pageSize?: number
|
|
31
14
|
total?: number
|
|
@@ -39,22 +22,22 @@ export interface createListStorePropsType<ListItem, P> {
|
|
|
39
22
|
}
|
|
40
23
|
|
|
41
24
|
export default function createListStore<
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
>(config:
|
|
45
|
-
const loading = ref
|
|
46
|
-
const total = ref
|
|
47
|
-
const params = reactive
|
|
48
|
-
const list = ref<
|
|
49
|
-
const sum = reactive<
|
|
50
|
-
const selected = ref<
|
|
51
|
-
const selectedKeys = ref<
|
|
52
|
-
const pagination = computed
|
|
25
|
+
P extends { page?: number; pageSize?: number; [key: string]: any },
|
|
26
|
+
ListItem extends Record<string, any> = Record<string, any>
|
|
27
|
+
>(config: configType<ListItem, P>) {
|
|
28
|
+
const loading = ref(true)
|
|
29
|
+
const total = ref(0)
|
|
30
|
+
const params = reactive(cloneDeep(config.defaultParams))
|
|
31
|
+
const list = ref<ListItem[]>([])
|
|
32
|
+
const sum = reactive<Record<string, any>>({})
|
|
33
|
+
const selected = ref<ListItem[]>([])
|
|
34
|
+
const selectedKeys = ref<(string | number)[]>([])
|
|
35
|
+
const pagination = computed(() => ({
|
|
53
36
|
current: params.page || 0,
|
|
54
37
|
pageSize: params.pageSize || 0,
|
|
55
38
|
total: total.value
|
|
56
39
|
}))
|
|
57
|
-
const selectedLen = computed
|
|
40
|
+
const selectedLen = computed(() => {
|
|
58
41
|
return max([size(selected.value), size(selectedKeys.value)]) || 0
|
|
59
42
|
})
|
|
60
43
|
function resetParams() {
|
|
@@ -71,14 +54,12 @@ export default function createListStore<
|
|
|
71
54
|
)
|
|
72
55
|
}
|
|
73
56
|
assign(params, arg?.params)
|
|
74
|
-
const result = await config.fetch({
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
}
|
|
80
|
-
list.value =
|
|
81
|
-
!isNil(result.page) && arg?.isConcat ? concat(list.value, result.list) : result.list
|
|
57
|
+
const result = await config.fetch({ params: unref(params) })
|
|
58
|
+
if (!isNil(result.page) && arg?.isConcat) {
|
|
59
|
+
list.value = [...list.value, ...result.list] as ListItem[]
|
|
60
|
+
} else {
|
|
61
|
+
list.value = result.list
|
|
62
|
+
}
|
|
82
63
|
sum.value = result.sum || {}
|
|
83
64
|
total.value = result.total || total.value
|
|
84
65
|
params.page = result.page || params.page
|
|
@@ -1,19 +0,0 @@
|
|
|
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
|
-
])
|