create-packer 1.37.2 → 1.38.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/package.json +3 -2
- package/template/cli/.prettierignore +6 -0
- package/template/cli/.prettierrc +18 -0
- package/template/cli/bin/createTemp.d.ts +1 -0
- package/template/cli/bin/createTemp.js +54 -0
- package/template/cli/bin/index.d.ts +2 -0
- package/template/cli/bin/index.js +4 -0
- package/template/cli/bin/utils/index.d.ts +10 -0
- package/template/cli/bin/utils/index.js +44 -0
- package/template/cli/package.json +53 -47
- package/template/docusaurus/.prettierignore +2 -0
- package/template/docusaurus/src/components/HomepageFeatures/index.tsx +70 -70
- package/template/docusaurus/src/components/HomepageFeatures/styles.module.css +11 -11
- package/template/docusaurus/src/css/custom.css +30 -30
- package/template/docusaurus/src/pages/index.module.css +23 -23
- package/template/docusaurus/src/pages/index.tsx +40 -40
- package/template/lib/workspace/.prettierignore +6 -0
- package/template/lib/workspace/.prettierrc +18 -0
- package/template/lib/workspace/package.json +73 -72
- package/template/lib/workspace/packages/react/package.json +41 -40
- package/template/lib/workspace/packages/ts/package.json +29 -28
- package/template/nest/package.json +84 -84
- package/template/nest/src/app.controller.spec.ts +22 -22
- package/template/nest/src/app.controller.ts +12 -12
- package/template/nest/src/app.module.ts +10 -10
- package/template/nest/src/app.service.ts +8 -8
- package/template/nest/src/main.ts +10 -10
- package/template/nest/src/utils/transform.interceptor.ts +26 -26
- package/template/nest/test/app.e2e-spec.ts +24 -24
- package/template/web-app/next/app/globals.css +22 -22
- package/template/web-app/next/app/layout.tsx +18 -18
- package/template/web-app/next/app/page.tsx +113 -113
- package/template/web-app/next/package.json +47 -47
- package/template/web-app/react-rsbuild/.prettierignore +6 -0
- package/template/web-app/react-rsbuild/.prettierrc +18 -0
- package/template/web-app/react-rsbuild/.vscode/extensions.json +8 -8
- package/template/web-app/react-rsbuild/.vscode/settings.json +4 -18
- package/template/web-app/react-rsbuild/domain/app/app.model.ts +7 -7
- package/template/web-app/react-rsbuild/domain/app/app.styled.ts +3 -3
- package/template/web-app/react-rsbuild/domain/app/components/app-context.tsx +17 -17
- package/template/web-app/react-rsbuild/domain/app/components/app.tsx +24 -24
- package/template/web-app/react-rsbuild/domain/app/components/index.ts +1 -1
- package/template/web-app/react-rsbuild/domain/app/index.ts +2 -2
- package/template/web-app/react-rsbuild/domain/router/home/ids.ts +3 -3
- package/template/web-app/react-rsbuild/domain/router/home/index.ts +2 -2
- package/template/web-app/react-rsbuild/domain/router/home/routes.tsx +13 -13
- package/template/web-app/react-rsbuild/domain/router/ids.ts +6 -6
- package/template/web-app/react-rsbuild/domain/router/index.ts +3 -3
- package/template/web-app/react-rsbuild/domain/router/router.tsx +28 -28
- package/template/web-app/react-rsbuild/domain/router/router.types.ts +3 -3
- package/template/web-app/react-rsbuild/env.d.ts +28 -28
- package/template/web-app/react-rsbuild/main.tsx +4 -4
- package/template/web-app/react-rsbuild/package.json +10 -11
- package/template/web-app/react-rsbuild/pages/home/home.styled.ts +7 -7
- package/template/web-app/react-rsbuild/pages/home/home.tsx +10 -10
- package/template/web-app/react-rsbuild/pages/home/index.ts +1 -1
- package/template/web-app/react-rsbuild/pages/index.tsx +18 -18
- package/template/web-app/react-rsbuild/pages/not-found.tsx +3 -3
- package/template/web-app/react-rsbuild/rsbuild.config.ts +78 -85
- package/template/web-app/react-rsbuild/scripts/createChunks.ts +26 -26
- package/template/web-app/react-rsbuild/scripts/index.ts +1 -1
- package/template/web-app/react-rsbuild/shared/hooks/defineRouter/defineRouter.types.ts +33 -33
- package/template/web-app/react-rsbuild/shared/hooks/defineRouter/index.ts +2 -2
- package/template/web-app/react-rsbuild/shared/hooks/index.ts +6 -6
- package/template/web-app/react-rsbuild/shared/hooks/useInterval.ts +26 -26
- package/template/web-app/react-rsbuild/shared/hooks/useLoadingAction.ts +27 -27
- package/template/web-app/react-rsbuild/shared/hooks/useLowPriorityState.ts +26 -26
- package/template/web-app/react-rsbuild/shared/hooks/useSyncState.ts +15 -15
- package/template/web-app/react-rsbuild/shared/hooks/useVisible.ts +27 -27
- package/template/web-app/react-rsbuild/shared/service/api.ts +1 -1
- package/template/web-app/react-rsbuild/shared/service/home.ts +8 -8
- package/template/web-app/react-rsbuild/shared/service/index.ts +3 -3
- package/template/web-app/react-rsbuild/shared/service/request.ts +5 -5
- package/template/web-app/react-rsbuild/shared/theme/index.ts +1 -1
- package/template/web-app/react-rsbuild/shared/theme/theme.styled.ts +56 -56
- package/template/web-app/react-rsbuild/shared/tools/componentInstance.tsx +80 -80
- package/template/web-app/react-rsbuild/shared/tools/index.ts +1 -1
- package/template/web-app/react-rsbuild/shared/types/index.ts +1 -1
- package/template/web-app/react-rsbuild/shared/types/utils.ts +2 -2
- package/template/web-app/react-rsbuild/tsconfig.json +32 -44
- package/template/web-app/react-rsbuild/tsconfig.node.json +10 -14
- package/template/web-app/react-vite/.prettierignore +6 -0
- package/template/web-app/react-vite/.prettierrc +18 -0
- package/template/web-app/react-vite/.vscode/extensions.json +1 -1
- package/template/web-app/react-vite/package.json +4 -4
- package/template/web-app/react-webpack/.prettierignore +6 -0
- package/template/web-app/react-webpack/.prettierrc +18 -0
- package/template/web-app/react-webpack/.vscode/extensions.json +8 -8
- package/template/web-app/react-webpack/.vscode/settings.json +4 -18
- package/template/web-app/react-webpack/commitlint.config.js +1 -1
- package/template/web-app/react-webpack/domain/app/app.model.ts +7 -7
- package/template/web-app/react-webpack/domain/app/app.styled.ts +3 -3
- package/template/web-app/react-webpack/domain/app/components/app-context.tsx +17 -17
- package/template/web-app/react-webpack/domain/app/components/app.tsx +24 -24
- package/template/web-app/react-webpack/domain/app/components/index.ts +1 -1
- package/template/web-app/react-webpack/domain/app/index.ts +2 -2
- package/template/web-app/react-webpack/domain/router/home/ids.ts +3 -3
- package/template/web-app/react-webpack/domain/router/home/index.ts +2 -2
- package/template/web-app/react-webpack/domain/router/home/routes.tsx +13 -13
- package/template/web-app/react-webpack/domain/router/ids.ts +6 -6
- package/template/web-app/react-webpack/domain/router/index.ts +3 -3
- package/template/web-app/react-webpack/domain/router/router.tsx +28 -28
- package/template/web-app/react-webpack/domain/router/router.types.ts +3 -3
- package/template/web-app/react-webpack/global.d.ts +26 -26
- package/template/web-app/react-webpack/index.css +3 -3
- package/template/web-app/react-webpack/main.tsx +4 -4
- package/template/web-app/react-webpack/package.json +87 -87
- package/template/web-app/react-webpack/pages/home/home.styled.ts +7 -7
- package/template/web-app/react-webpack/pages/home/home.tsx +10 -10
- package/template/web-app/react-webpack/pages/home/index.ts +1 -1
- package/template/web-app/react-webpack/pages/index.tsx +18 -18
- package/template/web-app/react-webpack/pages/not-found.tsx +3 -3
- package/template/web-app/react-webpack/postcss.config.js +7 -7
- package/template/web-app/react-webpack/shared/hooks/defineRouter/defineRouter.types.ts +33 -33
- package/template/web-app/react-webpack/shared/hooks/defineRouter/index.ts +2 -2
- package/template/web-app/react-webpack/shared/hooks/index.ts +6 -6
- package/template/web-app/react-webpack/shared/hooks/useInterval.ts +26 -26
- package/template/web-app/react-webpack/shared/hooks/useLoadingAction.ts +27 -27
- package/template/web-app/react-webpack/shared/hooks/useLowPriorityState.ts +26 -26
- package/template/web-app/react-webpack/shared/hooks/useSyncState.ts +15 -15
- package/template/web-app/react-webpack/shared/hooks/useVisible.ts +27 -27
- package/template/web-app/react-webpack/shared/service/home.ts +8 -8
- package/template/web-app/react-webpack/shared/service/index.ts +2 -2
- package/template/web-app/react-webpack/shared/service/request.ts +5 -5
- package/template/web-app/react-webpack/shared/theme/index.ts +1 -1
- package/template/web-app/react-webpack/shared/theme/theme.styled.ts +56 -56
- package/template/web-app/react-webpack/shared/tools/componentInstance.tsx +78 -78
- package/template/web-app/react-webpack/shared/tools/index.ts +1 -1
- package/template/web-app/react-webpack/shared/types/index.ts +1 -1
- package/template/web-app/react-webpack/shared/types/utils.ts +2 -2
- package/template/web-app/react-webpack/tsconfig.json +27 -38
- package/template/web-app/react-webpack/tsconfig.node.json +9 -9
- package/template/web-app/solid/package.json +51 -51
- package/template/web-app/solid/src/app.container.tsx +12 -12
- package/template/web-app/solid/src/index.css +15 -15
- package/template/web-app/solid/src/index.tsx +15 -15
- package/template/web-app/solid/src/layout/index.ts +1 -1
- package/template/web-app/solid/src/layout/layout.container.tsx +5 -5
- package/template/web-app/solid/src/pages/home/home.container.tsx +5 -5
- package/template/web-app/solid/src/pages/home/index.ts +1 -1
- package/template/web-app/solid/src/pages/notFound/index.ts +1 -1
- package/template/web-app/solid/src/pages/notFound/notFound.container.tsx +3 -3
- package/template/web-app/solid/src/router/home/index.ts +2 -2
- package/template/web-app/solid/src/router/home/paths.ts +3 -3
- package/template/web-app/solid/src/router/home/routes.tsx +12 -12
- package/template/web-app/solid/src/router/index.ts +2 -2
- package/template/web-app/solid/src/router/paths.ts +5 -5
- package/template/web-app/solid/src/router/routes.ts +16 -16
- package/template/web-app/svelte/.prettierignore +2 -0
- package/template/web-app/svelte/.prettierrc +14 -14
- package/template/web-app/svelte/.svelte-kit/ambient.d.ts +177 -153
- package/template/web-app/svelte/.svelte-kit/generated/client/app.js +23 -19
- package/template/web-app/svelte/.svelte-kit/generated/client/matchers.js +1 -1
- package/template/web-app/svelte/.svelte-kit/generated/client/nodes/0.js +1 -1
- package/template/web-app/svelte/.svelte-kit/generated/client/nodes/1.js +1 -1
- package/template/web-app/svelte/.svelte-kit/generated/client/nodes/2.js +1 -1
- package/template/web-app/svelte/.svelte-kit/generated/root.svelte +62 -56
- package/template/web-app/svelte/.svelte-kit/generated/server/internal.js +61 -30
- package/template/web-app/svelte/.svelte-kit/non-ambient.d.ts +23 -0
- package/template/web-app/svelte/.svelte-kit/tsconfig.json +32 -39
- package/template/web-app/svelte/.svelte-kit/types/route_meta_data.json +3 -3
- package/template/web-app/svelte/.svelte-kit/types/src/routes/$types.d.ts +35 -20
- package/template/web-app/svelte/.vscode/extensions.json +8 -8
- package/template/web-app/svelte/commitlint.config.cjs +1 -1
- package/template/web-app/svelte/package.json +55 -55
- package/template/web-app/svelte/scripts/createChunks.ts +26 -26
- package/template/web-app/svelte/scripts/index.ts +1 -1
- package/template/web-app/svelte/src/app.d.ts +12 -12
- package/template/web-app/svelte/src/routes/+page.svelte +2 -2
- package/template/web-app/svelte/svelte.config.js +17 -17
- package/template/web-app/svelte/tsconfig.json +21 -21
- package/template/web-app/svelte/vite-env.d.ts +11 -11
- package/template/web-app/svelte/vite.config.ts +55 -55
- package/template/web-app/vue/.prettierignore +6 -0
- package/template/web-app/vue/.prettierrc +18 -0
- package/template/web-app/vue/.vscode/extensions.json +1 -1
- package/template/web-app/vue/domain/app/components/app.vue +18 -18
- package/template/web-app/vue/package.json +4 -4
- package/template/web-app/vue/pages/home/home.vue +16 -16
- package/template/web-app/vue/pages/index.vue +3 -3
- package/template/web-app/vue/pages/not-found.vue +3 -3
- package/template/web-extension/.prettierignore +6 -0
- package/template/web-extension/.prettierrc +18 -0
- package/template/web-extension/.vscode/extensions.json +8 -8
- package/template/web-extension/.vscode/settings.json +4 -18
- package/template/web-extension/.wxt/eslintrc-auto-import.json +19 -19
- package/template/web-extension/.wxt/tsconfig.json +24 -27
- package/template/web-extension/.wxt/types/globals.d.ts +10 -10
- package/template/web-extension/.wxt/types/i18n.d.ts +80 -74
- package/template/web-extension/.wxt/types/imports.d.ts +17 -17
- package/template/web-extension/.wxt/types/paths.d.ts +12 -12
- package/template/web-extension/entrypoints/background/index.ts +1 -1
- package/template/web-extension/entrypoints/content/constants/base.ts +1 -1
- package/template/web-extension/entrypoints/content/constants/index.ts +1 -1
- package/template/web-extension/entrypoints/content/domain/app/index.ts +1 -1
- package/template/web-extension/entrypoints/content/domain/app/tools/index.ts +1 -1
- package/template/web-extension/entrypoints/content/domain/app/tools/insertApp.tsx +59 -55
- package/template/web-extension/entrypoints/content/index.tsx +12 -12
- package/template/web-extension/entrypoints/content/modules/common/common.tsx +10 -10
- package/template/web-extension/entrypoints/content/modules/common/index.ts +2 -2
- package/template/web-extension/entrypoints/content/modules/common/insert.tsx +9 -9
- package/template/web-extension/entrypoints/content/modules/index.ts +1 -1
- package/template/web-extension/entrypoints/popup/index.html +0 -1
- package/template/web-extension/entrypoints/popup/main.tsx +14 -14
- package/template/web-extension/entrypoints/popup/popup.container.tsx +3 -3
- package/template/web-extension/package.json +86 -86
- package/template/web-extension/shared/background/index.ts +1 -1
- package/template/web-extension/shared/background/message.ts +11 -11
- package/template/web-extension/shared/components/app-context.tsx +14 -14
- package/template/web-extension/shared/components/index.ts +1 -1
- package/template/web-extension/shared/content/index.ts +1 -1
- package/template/web-extension/shared/content/message.ts +15 -15
- package/template/web-extension/shared/hooks/index.ts +2 -2
- package/template/web-extension/shared/hooks/useSyncState.ts +15 -15
- package/template/web-extension/shared/hooks/useVisible.ts +27 -27
- package/template/web-extension/shared/popup/index.ts +1 -1
- package/template/web-extension/shared/popup/message.ts +12 -12
- package/template/web-extension/shared/service/index.ts +1 -1
- package/template/web-extension/shared/service/request.ts +5 -5
- package/template/web-extension/shared/styles/global.styled.ts +8 -8
- package/template/web-extension/shared/styles/index.ts +2 -2
- package/template/web-extension/shared/styles/theme.styled.ts +56 -56
- package/template/web-extension/shared/tools/index.ts +1 -1
- package/template/web-extension/shared/tools/message.ts +80 -80
- package/template/web-extension/shared/types/index.ts +1 -1
- package/template/web-extension/shared/types/utils.ts +3 -3
- package/template/web-extension/tsconfig.json +32 -32
- package/template/web-extension/tsconfig.node.json +10 -10
- package/template/web-extension/vite-env.d.ts +19 -19
- package/template/web-extension/wxt.config.ts +50 -46
- package/template/cli/biome.json +0 -40
- package/template/lib/workspace/biome.json +0 -40
- package/template/web-app/react-rsbuild/biome.json +0 -40
- package/template/web-app/react-vite/biome.json +0 -40
- package/template/web-app/react-webpack/biome.json +0 -40
- package/template/web-app/vue/biome.json +0 -40
- package/template/web-extension/biome.json +0 -40
|
@@ -1,87 +1,87 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "react-app-webpack",
|
|
3
|
-
"version": "1.0.0",
|
|
4
|
-
"main": "./dist/index",
|
|
5
|
-
"module": "./dist/index.esm.js",
|
|
6
|
-
"private": true,
|
|
7
|
-
"author": "1K",
|
|
8
|
-
"scripts": {
|
|
9
|
-
"prepare": "husky install",
|
|
10
|
-
"dev": "webpack serve --env mode=dev",
|
|
11
|
-
"build": "webpack --env mode=prod",
|
|
12
|
-
"build:analyzer": "webpack --env mode=analyzer",
|
|
13
|
-
"up:webpack": "pnpm up webpackbar webpackbar-* -L",
|
|
14
|
-
"format": "
|
|
15
|
-
"lint": "tsc --noEmit && eslint **/*.{tsx,ts,jsx,js} --no-error-on-unmatched-pattern && stylelint **/*.{css,scss,less,ts,tsx}",
|
|
16
|
-
"lint:fix": "eslint **/*.{tsx,ts,jsx,js} --fix && stylelint **/*.{css,scss,less,ts,tsx} --fix",
|
|
17
|
-
"cz": "cz",
|
|
18
|
-
"push": "npm run commit && git push",
|
|
19
|
-
"commit": "git add . && npm run cz"
|
|
20
|
-
},
|
|
21
|
-
"dependencies": {
|
|
22
|
-
"1k-types": "1.2.0",
|
|
23
|
-
"@tanstack/react-query": "5.51.15",
|
|
24
|
-
"axios": "1.6.7",
|
|
25
|
-
"define-zustand": "3.1.1",
|
|
26
|
-
"immer": "10.0.3",
|
|
27
|
-
"lodash-es": "4.17.21",
|
|
28
|
-
"qs": "6.11.2",
|
|
29
|
-
"react": "18.3.1",
|
|
30
|
-
"react-dom": "18.3.1",
|
|
31
|
-
"react-router-dom": "6.14.0",
|
|
32
|
-
"react-use": "17.5.0",
|
|
33
|
-
"styled-components": "6.1.11",
|
|
34
|
-
"zustand": "4.4.1"
|
|
35
|
-
},
|
|
36
|
-
"devDependencies": {
|
|
37
|
-
"@
|
|
38
|
-
"@commitlint/
|
|
39
|
-
"@commitlint/
|
|
40
|
-
"@
|
|
41
|
-
"@
|
|
42
|
-
"@types/
|
|
43
|
-
"@types/
|
|
44
|
-
"@types/react": "18.3.
|
|
45
|
-
"@
|
|
46
|
-
"@typescript-eslint/
|
|
47
|
-
"
|
|
48
|
-
"
|
|
49
|
-
"
|
|
50
|
-
"
|
|
51
|
-
"
|
|
52
|
-
"
|
|
53
|
-
"
|
|
54
|
-
"eslint": "
|
|
55
|
-
"eslint-import
|
|
56
|
-
"eslint-plugin-
|
|
57
|
-
"eslint-plugin-react": "
|
|
58
|
-
"eslint-plugin
|
|
59
|
-
"
|
|
60
|
-
"
|
|
61
|
-
"
|
|
62
|
-
"
|
|
63
|
-
"
|
|
64
|
-
"postcss-
|
|
65
|
-
"postcss-
|
|
66
|
-
"postcss-
|
|
67
|
-
"
|
|
68
|
-
"react-css-modules": "4.7.11",
|
|
69
|
-
"react-test-renderer": "18.2.0",
|
|
70
|
-
"rimraf": "5.0.5",
|
|
71
|
-
"style-loader": "3.3.4",
|
|
72
|
-
"stylelint": "16.
|
|
73
|
-
"stylelint-config-standard": "36.0.1",
|
|
74
|
-
"stylelint-webpack-plugin": "5.0.0",
|
|
75
|
-
"typescript": "5.5.2",
|
|
76
|
-
"webpack": "5.91.0",
|
|
77
|
-
"webpack-bundle-analyzer": "4.10.1",
|
|
78
|
-
"webpack-cli": "5.1.4",
|
|
79
|
-
"webpack-dev-server": "5.0.4",
|
|
80
|
-
"webpackbar": "6.0.1"
|
|
81
|
-
},
|
|
82
|
-
"config": {
|
|
83
|
-
"commitizen": {
|
|
84
|
-
"path": "@commitlint/cz-commitlint"
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "react-app-webpack",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"main": "./dist/index",
|
|
5
|
+
"module": "./dist/index.esm.js",
|
|
6
|
+
"private": true,
|
|
7
|
+
"author": "1K",
|
|
8
|
+
"scripts": {
|
|
9
|
+
"prepare": "husky install",
|
|
10
|
+
"dev": "webpack serve --env mode=dev",
|
|
11
|
+
"build": "webpack --env mode=prod",
|
|
12
|
+
"build:analyzer": "webpack --env mode=analyzer",
|
|
13
|
+
"up:webpack": "pnpm up webpackbar webpackbar-* -L",
|
|
14
|
+
"format": "prettier --write \"**/*.{ts,js,tsx,jsx,json,css,scss,less}\"",
|
|
15
|
+
"lint": "tsc --noEmit && eslint **/*.{tsx,ts,jsx,js} --no-error-on-unmatched-pattern && stylelint **/*.{css,scss,less,ts,tsx}",
|
|
16
|
+
"lint:fix": "eslint **/*.{tsx,ts,jsx,js} --fix && stylelint **/*.{css,scss,less,ts,tsx} --fix",
|
|
17
|
+
"cz": "cz",
|
|
18
|
+
"push": "npm run commit && git push",
|
|
19
|
+
"commit": "git add . && npm run cz"
|
|
20
|
+
},
|
|
21
|
+
"dependencies": {
|
|
22
|
+
"1k-types": "1.2.0",
|
|
23
|
+
"@tanstack/react-query": "5.51.15",
|
|
24
|
+
"axios": "1.6.7",
|
|
25
|
+
"define-zustand": "3.1.1",
|
|
26
|
+
"immer": "10.0.3",
|
|
27
|
+
"lodash-es": "4.17.21",
|
|
28
|
+
"qs": "6.11.2",
|
|
29
|
+
"react": "18.3.1",
|
|
30
|
+
"react-dom": "18.3.1",
|
|
31
|
+
"react-router-dom": "6.14.0",
|
|
32
|
+
"react-use": "17.5.0",
|
|
33
|
+
"styled-components": "6.1.11",
|
|
34
|
+
"zustand": "4.4.1"
|
|
35
|
+
},
|
|
36
|
+
"devDependencies": {
|
|
37
|
+
"@commitlint/cli": "18.6.1",
|
|
38
|
+
"@commitlint/config-conventional": "18.6.2",
|
|
39
|
+
"@commitlint/cz-commitlint": "18.6.1",
|
|
40
|
+
"@svgr/webpack": "8.1.0",
|
|
41
|
+
"@types/lodash-es": "4.17.12",
|
|
42
|
+
"@types/qs": "6.9.11",
|
|
43
|
+
"@types/react": "18.3.3",
|
|
44
|
+
"@types/react-dom": "18.3.0",
|
|
45
|
+
"@typescript-eslint/eslint-plugin": "7.0.2",
|
|
46
|
+
"@typescript-eslint/parser": "7.0.2",
|
|
47
|
+
"autoprefixer": "10.4.17",
|
|
48
|
+
"commitizen": "4.3.0",
|
|
49
|
+
"css-loader": "6.10.0",
|
|
50
|
+
"cssnano": "6.0.3",
|
|
51
|
+
"dotenv": "16.4.5",
|
|
52
|
+
"esbuild-loader": "4.2.2",
|
|
53
|
+
"eslint": "8.56.0",
|
|
54
|
+
"eslint-import-resolver-typescript": "3.6.1",
|
|
55
|
+
"eslint-plugin-import": "2.29.1",
|
|
56
|
+
"eslint-plugin-react": "7.33.2",
|
|
57
|
+
"eslint-plugin-react-hooks": "4.6.0",
|
|
58
|
+
"eslint-webpack-plugin": "4.0.1",
|
|
59
|
+
"fork-ts-checker-webpack-plugin": "9.0.2",
|
|
60
|
+
"html-webpack-plugin": "5.6.0",
|
|
61
|
+
"husky": "9.1.6",
|
|
62
|
+
"mini-css-extract-plugin": "2.8.0",
|
|
63
|
+
"postcss-import": "16.0.1",
|
|
64
|
+
"postcss-loader": "8.1.0",
|
|
65
|
+
"postcss-nesting": "12.0.3",
|
|
66
|
+
"postcss-styled-syntax": "0.6.4",
|
|
67
|
+
"prettier": "3.2.5",
|
|
68
|
+
"react-css-modules": "4.7.11",
|
|
69
|
+
"react-test-renderer": "18.2.0",
|
|
70
|
+
"rimraf": "5.0.5",
|
|
71
|
+
"style-loader": "3.3.4",
|
|
72
|
+
"stylelint": "16.10.0",
|
|
73
|
+
"stylelint-config-standard": "36.0.1",
|
|
74
|
+
"stylelint-webpack-plugin": "5.0.0",
|
|
75
|
+
"typescript": "5.5.2",
|
|
76
|
+
"webpack": "5.91.0",
|
|
77
|
+
"webpack-bundle-analyzer": "4.10.1",
|
|
78
|
+
"webpack-cli": "5.1.4",
|
|
79
|
+
"webpack-dev-server": "5.0.4",
|
|
80
|
+
"webpackbar": "6.0.1"
|
|
81
|
+
},
|
|
82
|
+
"config": {
|
|
83
|
+
"commitizen": {
|
|
84
|
+
"path": "@commitlint/cz-commitlint"
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import styled, { css } from 'styled-components'
|
|
2
|
-
|
|
3
|
-
export const StyledRoot = styled.div(({ theme }) => {
|
|
4
|
-
return css`
|
|
5
|
-
${theme.tools.flex('center', 'center')};
|
|
6
|
-
`
|
|
7
|
-
})
|
|
1
|
+
import styled, { css } from 'styled-components'
|
|
2
|
+
|
|
3
|
+
export const StyledRoot = styled.div(({ theme }) => {
|
|
4
|
+
return css`
|
|
5
|
+
${theme.tools.flex('center', 'center')};
|
|
6
|
+
`
|
|
7
|
+
})
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { useHomeQuery } from '@/shared/service'
|
|
2
|
-
import { StyledRoot } from './home.styled'
|
|
3
|
-
|
|
4
|
-
export default function Home() {
|
|
5
|
-
const homeQuery = useHomeQuery()
|
|
6
|
-
|
|
7
|
-
console.log('data', homeQuery.data?.data)
|
|
8
|
-
|
|
9
|
-
return <StyledRoot>sdsddds</StyledRoot>
|
|
10
|
-
}
|
|
1
|
+
import { useHomeQuery } from '@/shared/service'
|
|
2
|
+
import { StyledRoot } from './home.styled'
|
|
3
|
+
|
|
4
|
+
export default function Home() {
|
|
5
|
+
const homeQuery = useHomeQuery()
|
|
6
|
+
|
|
7
|
+
console.log('data', homeQuery.data?.data)
|
|
8
|
+
|
|
9
|
+
return <StyledRoot>sdsddds</StyledRoot>
|
|
10
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { default } from './home'
|
|
1
|
+
export { default } from './home'
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { useEffect } from 'react'
|
|
2
|
-
import { Outlet, useLocation } from 'react-router-dom'
|
|
3
|
-
import { useRouter, routerIds } from '@/domain/router'
|
|
4
|
-
|
|
5
|
-
const Layout = () => {
|
|
6
|
-
const location = useLocation()
|
|
7
|
-
const navigate = useRouter(state => state.navigate)
|
|
8
|
-
|
|
9
|
-
useEffect(() => {
|
|
10
|
-
if (location.pathname === '/') {
|
|
11
|
-
navigate({ id: routerIds.home })
|
|
12
|
-
}
|
|
13
|
-
}, [location])
|
|
14
|
-
|
|
15
|
-
return <Outlet />
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
export default Layout
|
|
1
|
+
import { useEffect } from 'react'
|
|
2
|
+
import { Outlet, useLocation } from 'react-router-dom'
|
|
3
|
+
import { useRouter, routerIds } from '@/domain/router'
|
|
4
|
+
|
|
5
|
+
const Layout = () => {
|
|
6
|
+
const location = useLocation()
|
|
7
|
+
const navigate = useRouter(state => state.navigate)
|
|
8
|
+
|
|
9
|
+
useEffect(() => {
|
|
10
|
+
if (location.pathname === '/') {
|
|
11
|
+
navigate({ id: routerIds.home })
|
|
12
|
+
}
|
|
13
|
+
}, [location])
|
|
14
|
+
|
|
15
|
+
return <Outlet />
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export default Layout
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export default function AppNotFound() {
|
|
2
|
-
return <div>404</div>
|
|
3
|
-
}
|
|
1
|
+
export default function AppNotFound() {
|
|
2
|
+
return <div>404</div>
|
|
3
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
module.exports = {
|
|
2
|
-
plugins: {
|
|
3
|
-
'postcss-import': {},
|
|
4
|
-
autoprefixer: {},
|
|
5
|
-
...(process.env.NODE_ENV === 'production' ? { cssnano: {} } : {})
|
|
6
|
-
}
|
|
7
|
-
}
|
|
1
|
+
module.exports = {
|
|
2
|
+
plugins: {
|
|
3
|
+
'postcss-import': {},
|
|
4
|
+
autoprefixer: {},
|
|
5
|
+
...(process.env.NODE_ENV === 'production' ? { cssnano: {} } : {})
|
|
6
|
+
}
|
|
7
|
+
}
|
|
@@ -1,33 +1,33 @@
|
|
|
1
|
-
import { FunctionComponent, ReactNode } from 'react'
|
|
2
|
-
import { RouteObject } from 'react-router-dom'
|
|
3
|
-
|
|
4
|
-
export type routeType = Omit<RouteObject, 'children' | 'id'> & {
|
|
5
|
-
id: string
|
|
6
|
-
meta?: {
|
|
7
|
-
title?: string
|
|
8
|
-
/** 只在当前路由才显示的小提示 */
|
|
9
|
-
tip?: string
|
|
10
|
-
}
|
|
11
|
-
/** 静态配置,便于回退 */
|
|
12
|
-
unauthorizedOrigin?: boolean
|
|
13
|
-
/** 动态使用,用于程序校验 */
|
|
14
|
-
unauthorized?: boolean
|
|
15
|
-
query?: () => Record<string, any>
|
|
16
|
-
menu?: {
|
|
17
|
-
hidden?: boolean
|
|
18
|
-
icon?: FunctionComponent
|
|
19
|
-
label?: ReactNode
|
|
20
|
-
}
|
|
21
|
-
children?: routeType[]
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
export type editableRouteType = Omit<routeType, 'element' | 'errorElement' | 'children'>
|
|
25
|
-
|
|
26
|
-
export interface routerFactoryArgType {
|
|
27
|
-
basename: string
|
|
28
|
-
routes: routeType[]
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
export type routeByIdType = Omit<routeType, 'children'> & {
|
|
32
|
-
pos: string
|
|
33
|
-
}
|
|
1
|
+
import { FunctionComponent, ReactNode } from 'react'
|
|
2
|
+
import { RouteObject } from 'react-router-dom'
|
|
3
|
+
|
|
4
|
+
export type routeType = Omit<RouteObject, 'children' | 'id'> & {
|
|
5
|
+
id: string
|
|
6
|
+
meta?: {
|
|
7
|
+
title?: string
|
|
8
|
+
/** 只在当前路由才显示的小提示 */
|
|
9
|
+
tip?: string
|
|
10
|
+
}
|
|
11
|
+
/** 静态配置,便于回退 */
|
|
12
|
+
unauthorizedOrigin?: boolean
|
|
13
|
+
/** 动态使用,用于程序校验 */
|
|
14
|
+
unauthorized?: boolean
|
|
15
|
+
query?: () => Record<string, any>
|
|
16
|
+
menu?: {
|
|
17
|
+
hidden?: boolean
|
|
18
|
+
icon?: FunctionComponent
|
|
19
|
+
label?: ReactNode
|
|
20
|
+
}
|
|
21
|
+
children?: routeType[]
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export type editableRouteType = Omit<routeType, 'element' | 'errorElement' | 'children'>
|
|
25
|
+
|
|
26
|
+
export interface routerFactoryArgType {
|
|
27
|
+
basename: string
|
|
28
|
+
routes: routeType[]
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export type routeByIdType = Omit<routeType, 'children'> & {
|
|
32
|
+
pos: string
|
|
33
|
+
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { default as defineRouter } from './deineRouter'
|
|
2
|
-
export * from './defineRouter.types'
|
|
1
|
+
export { default as defineRouter } from './deineRouter'
|
|
2
|
+
export * from './defineRouter.types'
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export { default as useLoadingAction } from './useLoadingAction'
|
|
2
|
-
export { default as useInterval } from './useInterval'
|
|
3
|
-
export { default as useVisible } from './useVisible'
|
|
4
|
-
export { default as useLowPriorityState } from './useLowPriorityState'
|
|
5
|
-
export * from './useSyncState'
|
|
6
|
-
export * from './defineRouter'
|
|
1
|
+
export { default as useLoadingAction } from './useLoadingAction'
|
|
2
|
+
export { default as useInterval } from './useInterval'
|
|
3
|
+
export { default as useVisible } from './useVisible'
|
|
4
|
+
export { default as useLowPriorityState } from './useLowPriorityState'
|
|
5
|
+
export * from './useSyncState'
|
|
6
|
+
export * from './defineRouter'
|
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
import { useState } from 'react'
|
|
2
|
-
import { useInterval as useRUInterval } from 'react-use'
|
|
3
|
-
|
|
4
|
-
interface actionsType {
|
|
5
|
-
start: () => void
|
|
6
|
-
stop: () => void
|
|
7
|
-
}
|
|
8
|
-
export default function useInterval(
|
|
9
|
-
cb: (actions: actionsType) => Promise<void> | void,
|
|
10
|
-
delay: number
|
|
11
|
-
): actionsType {
|
|
12
|
-
const [startInterval, setStartInterval] = useState(false)
|
|
13
|
-
const start: actionsType['start'] = () => {
|
|
14
|
-
setStartInterval(true)
|
|
15
|
-
}
|
|
16
|
-
const stop: actionsType['stop'] = () => {
|
|
17
|
-
setStartInterval(false)
|
|
18
|
-
}
|
|
19
|
-
useRUInterval(
|
|
20
|
-
async () => {
|
|
21
|
-
cb({ start, stop })
|
|
22
|
-
},
|
|
23
|
-
startInterval ? delay : null
|
|
24
|
-
)
|
|
25
|
-
return { start, stop }
|
|
26
|
-
}
|
|
1
|
+
import { useState } from 'react'
|
|
2
|
+
import { useInterval as useRUInterval } from 'react-use'
|
|
3
|
+
|
|
4
|
+
interface actionsType {
|
|
5
|
+
start: () => void
|
|
6
|
+
stop: () => void
|
|
7
|
+
}
|
|
8
|
+
export default function useInterval(
|
|
9
|
+
cb: (actions: actionsType) => Promise<void> | void,
|
|
10
|
+
delay: number
|
|
11
|
+
): actionsType {
|
|
12
|
+
const [startInterval, setStartInterval] = useState(false)
|
|
13
|
+
const start: actionsType['start'] = () => {
|
|
14
|
+
setStartInterval(true)
|
|
15
|
+
}
|
|
16
|
+
const stop: actionsType['stop'] = () => {
|
|
17
|
+
setStartInterval(false)
|
|
18
|
+
}
|
|
19
|
+
useRUInterval(
|
|
20
|
+
async () => {
|
|
21
|
+
cb({ start, stop })
|
|
22
|
+
},
|
|
23
|
+
startInterval ? delay : null
|
|
24
|
+
)
|
|
25
|
+
return { start, stop }
|
|
26
|
+
}
|
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
import { useCallback, useState, DependencyList, useRef } from 'react'
|
|
2
|
-
|
|
3
|
-
export default function useLoadingAction<C extends (...arg: any) => Promise<any> | any>(
|
|
4
|
-
callback: C,
|
|
5
|
-
deps: DependencyList,
|
|
6
|
-
debounce = true
|
|
7
|
-
) {
|
|
8
|
-
const [loading, setLoading] = useState(false)
|
|
9
|
-
const loadingSync = useRef(loading)
|
|
10
|
-
function $setLoading(loading: boolean) {
|
|
11
|
-
setLoading(loading)
|
|
12
|
-
loadingSync.current = loading
|
|
13
|
-
}
|
|
14
|
-
const action = useCallback(async (...arg: any) => {
|
|
15
|
-
if (debounce && loadingSync.current) {
|
|
16
|
-
return
|
|
17
|
-
}
|
|
18
|
-
try {
|
|
19
|
-
$setLoading(true)
|
|
20
|
-
return await callback(...arg)
|
|
21
|
-
} finally {
|
|
22
|
-
$setLoading(false)
|
|
23
|
-
}
|
|
24
|
-
}, deps) as C
|
|
25
|
-
|
|
26
|
-
return [loading, action] as const
|
|
27
|
-
}
|
|
1
|
+
import { useCallback, useState, DependencyList, useRef } from 'react'
|
|
2
|
+
|
|
3
|
+
export default function useLoadingAction<C extends (...arg: any) => Promise<any> | any>(
|
|
4
|
+
callback: C,
|
|
5
|
+
deps: DependencyList,
|
|
6
|
+
debounce = true
|
|
7
|
+
) {
|
|
8
|
+
const [loading, setLoading] = useState(false)
|
|
9
|
+
const loadingSync = useRef(loading)
|
|
10
|
+
function $setLoading(loading: boolean) {
|
|
11
|
+
setLoading(loading)
|
|
12
|
+
loadingSync.current = loading
|
|
13
|
+
}
|
|
14
|
+
const action = useCallback(async (...arg: any) => {
|
|
15
|
+
if (debounce && loadingSync.current) {
|
|
16
|
+
return
|
|
17
|
+
}
|
|
18
|
+
try {
|
|
19
|
+
$setLoading(true)
|
|
20
|
+
return await callback(...arg)
|
|
21
|
+
} finally {
|
|
22
|
+
$setLoading(false)
|
|
23
|
+
}
|
|
24
|
+
}, deps) as C
|
|
25
|
+
|
|
26
|
+
return [loading, action] as const
|
|
27
|
+
}
|
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
import { useEffect, useState, useTransition, DependencyList } from 'react'
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
*
|
|
5
|
-
* @param callback
|
|
6
|
-
* @param watches If set, it is autorun callback
|
|
7
|
-
* @returns
|
|
8
|
-
*/
|
|
9
|
-
export default function useLowPriorityState<V>(callback: () => V, watches?: DependencyList) {
|
|
10
|
-
const [value, setValue] = useState<V>(callback)
|
|
11
|
-
const [loading, startTransition] = useTransition()
|
|
12
|
-
|
|
13
|
-
function startLoad() {
|
|
14
|
-
startTransition(() => {
|
|
15
|
-
setValue(callback())
|
|
16
|
-
})
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
useEffect(() => {
|
|
20
|
-
if (watches) {
|
|
21
|
-
startLoad()
|
|
22
|
-
}
|
|
23
|
-
}, watches)
|
|
24
|
-
|
|
25
|
-
return [value, { loading, startLoad }] as const
|
|
26
|
-
}
|
|
1
|
+
import { useEffect, useState, useTransition, DependencyList } from 'react'
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
*
|
|
5
|
+
* @param callback
|
|
6
|
+
* @param watches If set, it is autorun callback
|
|
7
|
+
* @returns
|
|
8
|
+
*/
|
|
9
|
+
export default function useLowPriorityState<V>(callback: () => V, watches?: DependencyList) {
|
|
10
|
+
const [value, setValue] = useState<V>(callback)
|
|
11
|
+
const [loading, startTransition] = useTransition()
|
|
12
|
+
|
|
13
|
+
function startLoad() {
|
|
14
|
+
startTransition(() => {
|
|
15
|
+
setValue(callback())
|
|
16
|
+
})
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
useEffect(() => {
|
|
20
|
+
if (watches) {
|
|
21
|
+
startLoad()
|
|
22
|
+
}
|
|
23
|
+
}, watches)
|
|
24
|
+
|
|
25
|
+
return [value, { loading, startLoad }] as const
|
|
26
|
+
}
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { useRef, useState, Dispatch, SetStateAction } from 'react'
|
|
2
|
-
import { isFunction } from 'lodash-es'
|
|
3
|
-
|
|
4
|
-
export function useSyncState<S>(initialState: S | (() => S)) {
|
|
5
|
-
const [state, setState] = useState(initialState)
|
|
6
|
-
const syncState = useRef<S>(state)
|
|
7
|
-
|
|
8
|
-
const $setState: Dispatch<SetStateAction<S>> = newState => {
|
|
9
|
-
const $newState = isFunction(newState) ? newState(state) : newState
|
|
10
|
-
setState($newState)
|
|
11
|
-
syncState.current = $newState
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
return [syncState, state, $setState] as const
|
|
15
|
-
}
|
|
1
|
+
import { useRef, useState, Dispatch, SetStateAction } from 'react'
|
|
2
|
+
import { isFunction } from 'lodash-es'
|
|
3
|
+
|
|
4
|
+
export function useSyncState<S>(initialState: S | (() => S)) {
|
|
5
|
+
const [state, setState] = useState(initialState)
|
|
6
|
+
const syncState = useRef<S>(state)
|
|
7
|
+
|
|
8
|
+
const $setState: Dispatch<SetStateAction<S>> = newState => {
|
|
9
|
+
const $newState = isFunction(newState) ? newState(state) : newState
|
|
10
|
+
setState($newState)
|
|
11
|
+
syncState.current = $newState
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
return [syncState, state, $setState] as const
|
|
15
|
+
}
|
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
import { useState } from 'react'
|
|
2
|
-
import { isFunction } from 'lodash-es'
|
|
3
|
-
|
|
4
|
-
export interface useVisibleConfigType {
|
|
5
|
-
defaultVisible?: boolean
|
|
6
|
-
onBeforeShow?: () => Promise<boolean | void>
|
|
7
|
-
onBeforeHide?: () => Promise<boolean | void>
|
|
8
|
-
}
|
|
9
|
-
export default function useVisible(config?: useVisibleConfigType) {
|
|
10
|
-
const [visible, setVisible] = useState(config?.defaultVisible ?? false)
|
|
11
|
-
const onShow = async () => {
|
|
12
|
-
let isShow: boolean | void = true
|
|
13
|
-
if (isFunction(config?.onBeforeShow)) {
|
|
14
|
-
isShow = await config?.onBeforeShow?.()
|
|
15
|
-
}
|
|
16
|
-
setVisible(isShow !== false)
|
|
17
|
-
}
|
|
18
|
-
const onClose = async () => {
|
|
19
|
-
let isHide: boolean | void = true
|
|
20
|
-
if (isFunction(config?.onBeforeHide)) {
|
|
21
|
-
isHide = await config?.onBeforeHide?.()
|
|
22
|
-
}
|
|
23
|
-
setVisible(isHide === false)
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
return { visible, onShow, onClose }
|
|
27
|
-
}
|
|
1
|
+
import { useState } from 'react'
|
|
2
|
+
import { isFunction } from 'lodash-es'
|
|
3
|
+
|
|
4
|
+
export interface useVisibleConfigType {
|
|
5
|
+
defaultVisible?: boolean
|
|
6
|
+
onBeforeShow?: () => Promise<boolean | void>
|
|
7
|
+
onBeforeHide?: () => Promise<boolean | void>
|
|
8
|
+
}
|
|
9
|
+
export default function useVisible(config?: useVisibleConfigType) {
|
|
10
|
+
const [visible, setVisible] = useState(config?.defaultVisible ?? false)
|
|
11
|
+
const onShow = async () => {
|
|
12
|
+
let isShow: boolean | void = true
|
|
13
|
+
if (isFunction(config?.onBeforeShow)) {
|
|
14
|
+
isShow = await config?.onBeforeShow?.()
|
|
15
|
+
}
|
|
16
|
+
setVisible(isShow !== false)
|
|
17
|
+
}
|
|
18
|
+
const onClose = async () => {
|
|
19
|
+
let isHide: boolean | void = true
|
|
20
|
+
if (isFunction(config?.onBeforeHide)) {
|
|
21
|
+
isHide = await config?.onBeforeHide?.()
|
|
22
|
+
}
|
|
23
|
+
setVisible(isHide === false)
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
return { visible, onShow, onClose }
|
|
27
|
+
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { useQuery } from '@tanstack/react-query'
|
|
2
|
-
|
|
3
|
-
export function useHomeQuery() {
|
|
4
|
-
return useQuery({
|
|
5
|
-
queryKey: ['home_data'],
|
|
6
|
-
queryFn: () => Promise.resolve({ data: { data: [] } })
|
|
7
|
-
})
|
|
8
|
-
}
|
|
1
|
+
import { useQuery } from '@tanstack/react-query'
|
|
2
|
+
|
|
3
|
+
export function useHomeQuery() {
|
|
4
|
+
return useQuery({
|
|
5
|
+
queryKey: ['home_data'],
|
|
6
|
+
queryFn: () => Promise.resolve({ data: { data: [] } })
|
|
7
|
+
})
|
|
8
|
+
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from './request'
|
|
2
|
-
export * from './home'
|
|
1
|
+
export * from './request'
|
|
2
|
+
export * from './home'
|