create-bubbles 0.0.8 → 0.0.12
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 +1 -1
- package/template-react-rsbuild/biome.json +102 -101
- package/template-react-rsbuild/commitlint.config.js +1 -1
- package/template-react-rsbuild/lefthook.yml +1 -1
- package/template-react-rsbuild/package.json +16 -16
- package/template-react-rsbuild/rsbuild.config.ts +11 -5
- package/template-react-rsbuild/src/App.tsx +9 -9
- package/template-react-rsbuild/src/components/Loading/PageLoading.tsx +11 -11
- package/template-react-rsbuild/src/env.d.ts +1 -1
- package/template-react-rsbuild/src/index.tsx +20 -20
- package/template-react-rsbuild/src/pages/home/index.tsx +26 -26
- package/template-react-rsbuild/src/router/index.tsx +27 -27
- package/template-react-rsbuild/src/store/index.ts +0 -0
- package/template-react-rsbuild/src/store/modules/user.ts +11 -0
- package/template-react-rsbuild/src/types/auto-import.d.ts +47 -47
- package/template-react-rsbuild/src/utils/request/axios.ts +82 -93
- package/template-react-rsbuild/src/utils/request/index.ts +43 -26
- package/template-react-rsbuild/tsconfig.json +29 -29
- package/template-react-rsbuild/uno.config.ts +8 -8
- package/template-vue-rsbuild/.prettierrc +1 -0
- package/template-vue-rsbuild/.vscode/settings.json +7 -0
- package/template-vue-rsbuild/biome.json +102 -112
- package/template-vue-rsbuild/lefthook.yml +11 -0
- package/template-vue-rsbuild/package.json +32 -30
- package/template-vue-rsbuild/pnpm-lock.yaml +3324 -0
- package/template-vue-rsbuild/rsbuild.config.ts +35 -28
- package/template-vue-rsbuild/src/App.vue +1 -27
- package/template-vue-rsbuild/src/index.ts +15 -7
- package/template-vue-rsbuild/src/router/guard/index.tsx +6 -0
- package/template-vue-rsbuild/src/router/guard/permissionGuard.ts +8 -0
- package/template-vue-rsbuild/src/router/index.tsx +14 -0
- package/template-vue-rsbuild/src/router/modules/index.tsx +10 -0
- package/template-vue-rsbuild/src/store/index.ts +7 -0
- package/template-vue-rsbuild/src/store/modules/user.ts +17 -0
- package/template-vue-rsbuild/src/types/auto-import.d.ts +91 -91
- package/template-vue-rsbuild/src/types/env.d.ts +17 -0
- package/template-vue-rsbuild/src/utils/request/axios.ts +83 -0
- package/template-vue-rsbuild/src/utils/request/index.ts +77 -0
- package/template-vue-rsbuild/src/views/home/index.vue +11 -0
- package/template-vue-rsbuild-eslint/.env +3 -0
- package/template-vue-rsbuild-eslint/.env.development +0 -0
- package/template-vue-rsbuild-eslint/.env.production +0 -0
- package/template-vue-rsbuild-eslint/.prettierignore +4 -0
- package/template-vue-rsbuild-eslint/.prettierrc +17 -0
- package/{template-vue-rsbuild → template-vue-rsbuild-eslint}/.vscode/extensions.json +3 -3
- package/template-vue-rsbuild-eslint/README.md +29 -0
- package/template-vue-rsbuild-eslint/biome.json +110 -0
- package/template-vue-rsbuild-eslint/index.html +7 -0
- package/template-vue-rsbuild-eslint/package.json +31 -0
- package/{template-react-rsbuild → template-vue-rsbuild-eslint}/postcss.config.mjs +2 -2
- package/template-vue-rsbuild-eslint/public/.gitkeep +0 -0
- package/template-vue-rsbuild-eslint/rsbuild.config.ts +28 -0
- package/template-vue-rsbuild-eslint/src/App.vue +29 -0
- package/template-vue-rsbuild-eslint/src/env.d.ts +17 -0
- package/template-vue-rsbuild-eslint/src/index.ts +15 -0
- package/template-vue-rsbuild-eslint/src/router/guard/index.tsx +6 -0
- package/template-vue-rsbuild-eslint/src/router/guard/permissionGuard.ts +8 -0
- package/template-vue-rsbuild-eslint/src/router/index.tsx +14 -0
- package/template-vue-rsbuild-eslint/src/router/modules/index.tsx +10 -0
- package/template-vue-rsbuild-eslint/src/store/index.ts +7 -0
- package/template-vue-rsbuild-eslint/src/store/modules/user.ts +16 -0
- package/template-vue-rsbuild-eslint/src/styles/index.css +16 -0
- package/template-vue-rsbuild-eslint/src/types/auto-import.d.ts +91 -0
- package/template-vue-rsbuild-eslint/src/utils/request/axios.ts +83 -0
- package/template-vue-rsbuild-eslint/src/utils/request/index.ts +77 -0
- package/template-vue-rsbuild-eslint/src/views/home/index.vue +13 -0
- package/template-vue-rsbuild-eslint/tsconfig.json +29 -0
- package/template-vue-rsbuild-eslint/uno.config.ts +9 -0
- package/template-react-rsbuild/pnpm-lock.yaml +0 -3615
- package/template-vue-rsbuild/postcss.config.mjs +0 -5
- package/template-vue-rsbuild/src/env.d.ts +0 -9
- /package/{template-vue-rsbuild → template-vue-rsbuild-eslint}/src/index.css +0 -0
package/package.json
CHANGED
|
@@ -1,101 +1,102 @@
|
|
|
1
|
-
{
|
|
2
|
-
"files": {
|
|
3
|
-
"ignoreUnknown": true,
|
|
4
|
-
"ignore": ["dist/*", "node_modules", "package.json", "auto-import.d.ts", "*.js"]
|
|
5
|
-
},
|
|
6
|
-
"formatter": {
|
|
7
|
-
"enabled": true,
|
|
8
|
-
"indentStyle": "space",
|
|
9
|
-
"lineWidth": 100,
|
|
10
|
-
"indentWidth": 2
|
|
11
|
-
},
|
|
12
|
-
"javascript": {
|
|
13
|
-
"formatter": {
|
|
14
|
-
"quoteStyle": "single"
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
"
|
|
25
|
-
"
|
|
26
|
-
"
|
|
27
|
-
"
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
"
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
"
|
|
39
|
-
"
|
|
40
|
-
"
|
|
41
|
-
"
|
|
42
|
-
"
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
"
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
"
|
|
51
|
-
"
|
|
52
|
-
"
|
|
53
|
-
"
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
"
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
"
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
"
|
|
80
|
-
"
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
"
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
"
|
|
95
|
-
"
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
1
|
+
{
|
|
2
|
+
"files": {
|
|
3
|
+
"ignoreUnknown": true,
|
|
4
|
+
"ignore": ["dist/*", "node_modules", "package.json", "auto-import.d.ts", "*.js"]
|
|
5
|
+
},
|
|
6
|
+
"formatter": {
|
|
7
|
+
"enabled": true,
|
|
8
|
+
"indentStyle": "space",
|
|
9
|
+
"lineWidth": 100,
|
|
10
|
+
"indentWidth": 2
|
|
11
|
+
},
|
|
12
|
+
"javascript": {
|
|
13
|
+
"formatter": {
|
|
14
|
+
"quoteStyle": "single",
|
|
15
|
+
"semicolons": "asNeeded"
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
"organizeImports": {
|
|
19
|
+
"enabled": false
|
|
20
|
+
},
|
|
21
|
+
"linter": {
|
|
22
|
+
"rules": {
|
|
23
|
+
"style": {
|
|
24
|
+
"useImportType": "off",
|
|
25
|
+
"useNumberNamespace": "off",
|
|
26
|
+
"useNodejsImportProtocol": "off",
|
|
27
|
+
"noNonNullAssertion": "off",
|
|
28
|
+
"noUnusedTemplateLiteral": "off"
|
|
29
|
+
},
|
|
30
|
+
"complexity": {
|
|
31
|
+
"noUselessTypeConstraint": "off",
|
|
32
|
+
"noForEach": "off"
|
|
33
|
+
},
|
|
34
|
+
"correctness": {
|
|
35
|
+
"useExhaustiveDependencies": "off"
|
|
36
|
+
},
|
|
37
|
+
"suspicious": {
|
|
38
|
+
"noGlobalIsNan": "off",
|
|
39
|
+
"noGlobalIsFinite": "off",
|
|
40
|
+
"noExplicitAny": "off",
|
|
41
|
+
"noArrayIndexKey": "off",
|
|
42
|
+
"noConfusingVoidType": "off",
|
|
43
|
+
"noThenProperty": "off"
|
|
44
|
+
},
|
|
45
|
+
"performance": {
|
|
46
|
+
"noDelete": "off",
|
|
47
|
+
"noAccumulatingSpread": "off"
|
|
48
|
+
},
|
|
49
|
+
"a11y": {
|
|
50
|
+
"noAriaHiddenOnFocusable": "off",
|
|
51
|
+
"noLabelWithoutControl": "off",
|
|
52
|
+
"useFocusableInteractive": "off",
|
|
53
|
+
"useKeyWithClickEvents": "off",
|
|
54
|
+
"useSemanticElements": "off"
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
},
|
|
58
|
+
"css": {
|
|
59
|
+
"formatter": {
|
|
60
|
+
"quoteStyle": "single"
|
|
61
|
+
}
|
|
62
|
+
},
|
|
63
|
+
"overrides": [
|
|
64
|
+
{
|
|
65
|
+
"include": ["**/*.test.ts", "**/*.test.tsx", "tests/**/*", "scripts/**/*"],
|
|
66
|
+
"linter": {
|
|
67
|
+
"rules": {
|
|
68
|
+
"style": {
|
|
69
|
+
"noParameterAssign": "off"
|
|
70
|
+
},
|
|
71
|
+
"suspicious": {
|
|
72
|
+
"noThenProperty": "off",
|
|
73
|
+
"noImplicitAnyLet": "off"
|
|
74
|
+
},
|
|
75
|
+
"complexity": {
|
|
76
|
+
"noUselessFragments": "off"
|
|
77
|
+
},
|
|
78
|
+
"a11y": {
|
|
79
|
+
"useValidAnchor": "off",
|
|
80
|
+
"useAnchorContent": "off",
|
|
81
|
+
"useKeyWithClickEvents": "off"
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
"include": ["components/*/demo/*"],
|
|
88
|
+
"linter": {
|
|
89
|
+
"rules": {
|
|
90
|
+
"correctness": {
|
|
91
|
+
"noVoidTypeReturn": "off"
|
|
92
|
+
},
|
|
93
|
+
"a11y": {
|
|
94
|
+
"useValidAnchor": "off",
|
|
95
|
+
"useAnchorContent": "off",
|
|
96
|
+
"useKeyWithClickEvents": "off"
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
]
|
|
102
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
module.exports = { extends: ['@commitlint/config-conventional'] };
|
|
1
|
+
module.exports = { extends: ['@commitlint/config-conventional'] };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
pre-commit:
|
|
2
2
|
commands:
|
|
3
3
|
check:
|
|
4
|
-
glob: "*.{js,ts,cjs,mjs,d.cts,d.mts,jsx,tsx,json,jsonc
|
|
4
|
+
glob: "*.{js,ts,cjs,mjs,d.cts,d.mts,jsx,tsx,json,jsonc}"
|
|
5
5
|
run: npx @biomejs/biome check --write --no-errors-on-unmatched --files-ignore-unknown=true --colors=off {staged_files}
|
|
6
6
|
stage_fixed: true
|
|
7
7
|
|
|
@@ -13,27 +13,27 @@
|
|
|
13
13
|
},
|
|
14
14
|
"dependencies": {
|
|
15
15
|
"ahooks": "^3.8.4",
|
|
16
|
-
"antd": "^5.
|
|
17
|
-
"axios": "^1.
|
|
16
|
+
"antd": "^5.24.5",
|
|
17
|
+
"axios": "^1.8.4",
|
|
18
18
|
"dayjs": "^1.11.13",
|
|
19
|
-
"react": "^19.
|
|
20
|
-
"react-dom": "^19.
|
|
21
|
-
"react-router": "^7.
|
|
19
|
+
"react": "^19.1.0",
|
|
20
|
+
"react-dom": "^19.1.0",
|
|
21
|
+
"react-router": "^7.4.1",
|
|
22
22
|
"zustand": "^5.0.3"
|
|
23
23
|
},
|
|
24
24
|
"devDependencies": {
|
|
25
|
-
"@biomejs/biome": "^1.9.
|
|
26
|
-
"@commitlint/config-conventional": "^19.
|
|
27
|
-
"@ianvs/prettier-plugin-sort-imports": "^4.4.
|
|
28
|
-
"@rsbuild/core": "^1.1
|
|
29
|
-
"@rsbuild/plugin-react": "^1.
|
|
30
|
-
"@types/react": "^19.0.
|
|
31
|
-
"@types/react-dom": "^19.0.
|
|
25
|
+
"@biomejs/biome": "^1.9.4",
|
|
26
|
+
"@commitlint/config-conventional": "^19.8.0",
|
|
27
|
+
"@ianvs/prettier-plugin-sort-imports": "^4.4.1",
|
|
28
|
+
"@rsbuild/core": "^1.3.1",
|
|
29
|
+
"@rsbuild/plugin-react": "^1.1.1",
|
|
30
|
+
"@types/react": "^19.0.12",
|
|
31
|
+
"@types/react-dom": "^19.0.4",
|
|
32
32
|
"@unocss/postcss": "^0.65.4",
|
|
33
|
-
"lefthook": "^1.
|
|
34
|
-
"prettier": "^3.
|
|
35
|
-
"typescript": "^5.
|
|
33
|
+
"lefthook": "^1.11.6",
|
|
34
|
+
"prettier": "^3.5.3",
|
|
35
|
+
"typescript": "^5.8.2",
|
|
36
36
|
"unocss": "^0.65.4",
|
|
37
|
-
"unplugin-auto-import": "^19.
|
|
37
|
+
"unplugin-auto-import": "^19.1.2"
|
|
38
38
|
}
|
|
39
39
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { defineConfig } from '@rsbuild/core'
|
|
2
|
-
import { pluginReact } from '@rsbuild/plugin-react'
|
|
3
|
-
import AutoImport from 'unplugin-auto-import/rspack'
|
|
1
|
+
import { defineConfig } from '@rsbuild/core'
|
|
2
|
+
import { pluginReact } from '@rsbuild/plugin-react'
|
|
3
|
+
import AutoImport from 'unplugin-auto-import/rspack'
|
|
4
|
+
import UnoCSS from '@unocss/postcss'
|
|
4
5
|
|
|
5
6
|
export default defineConfig({
|
|
6
7
|
html: {
|
|
@@ -12,7 +13,7 @@ export default defineConfig({
|
|
|
12
13
|
},
|
|
13
14
|
},
|
|
14
15
|
server: {
|
|
15
|
-
port: process.env.PUBLIC_PORT,
|
|
16
|
+
port: Number(process.env.PUBLIC_PORT),
|
|
16
17
|
},
|
|
17
18
|
plugins: [pluginReact()],
|
|
18
19
|
tools: {
|
|
@@ -24,5 +25,10 @@ export default defineConfig({
|
|
|
24
25
|
}),
|
|
25
26
|
],
|
|
26
27
|
},
|
|
28
|
+
postcss: {
|
|
29
|
+
postcssOptions: {
|
|
30
|
+
plugins: [UnoCSS()],
|
|
31
|
+
},
|
|
32
|
+
},
|
|
27
33
|
},
|
|
28
|
-
})
|
|
34
|
+
})
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { RouterProvider } from 'react-router';
|
|
2
|
-
|
|
3
|
-
import router from './router';
|
|
4
|
-
|
|
5
|
-
const App = () => {
|
|
6
|
-
return <RouterProvider router={router} />;
|
|
7
|
-
};
|
|
8
|
-
|
|
9
|
-
export default App;
|
|
1
|
+
import { RouterProvider } from 'react-router';
|
|
2
|
+
|
|
3
|
+
import router from './router';
|
|
4
|
+
|
|
5
|
+
const App = () => {
|
|
6
|
+
return <RouterProvider router={router} />;
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
export default App;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { Spin } from 'antd';
|
|
2
|
-
|
|
3
|
-
const Loading = () => {
|
|
4
|
-
return (
|
|
5
|
-
<div className="flex justify-center items-center w-full h-100%">
|
|
6
|
-
<Spin size="large" />
|
|
7
|
-
</div>
|
|
8
|
-
);
|
|
9
|
-
};
|
|
10
|
-
|
|
11
|
-
export default Loading;
|
|
1
|
+
import { Spin } from 'antd';
|
|
2
|
+
|
|
3
|
+
const Loading = () => {
|
|
4
|
+
return (
|
|
5
|
+
<div className="flex justify-center items-center w-full h-100%">
|
|
6
|
+
<Spin size="large" />
|
|
7
|
+
</div>
|
|
8
|
+
);
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
export default Loading;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
/// <reference types="@rsbuild/core/types" />
|
|
1
|
+
/// <reference types="@rsbuild/core/types" />
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import React, { Suspense } from 'react';
|
|
2
|
-
import ReactDOM from 'react-dom/client';
|
|
3
|
-
|
|
4
|
-
import App from './App';
|
|
5
|
-
|
|
6
|
-
import '@/styles/index.css';
|
|
7
|
-
|
|
8
|
-
import Loading from './components/Loading/PageLoading';
|
|
9
|
-
|
|
10
|
-
const rootEl = document.getElementById('root');
|
|
11
|
-
if (rootEl) {
|
|
12
|
-
const root = ReactDOM.createRoot(rootEl);
|
|
13
|
-
root.render(
|
|
14
|
-
<React.StrictMode>
|
|
15
|
-
<Suspense fallback={<Loading />}>
|
|
16
|
-
<App />
|
|
17
|
-
</Suspense>
|
|
18
|
-
</React.StrictMode>,
|
|
19
|
-
);
|
|
20
|
-
}
|
|
1
|
+
import React, { Suspense } from 'react';
|
|
2
|
+
import ReactDOM from 'react-dom/client';
|
|
3
|
+
|
|
4
|
+
import App from './App';
|
|
5
|
+
|
|
6
|
+
import '@/styles/index.css';
|
|
7
|
+
|
|
8
|
+
import Loading from './components/Loading/PageLoading';
|
|
9
|
+
|
|
10
|
+
const rootEl = document.getElementById('root');
|
|
11
|
+
if (rootEl) {
|
|
12
|
+
const root = ReactDOM.createRoot(rootEl);
|
|
13
|
+
root.render(
|
|
14
|
+
<React.StrictMode>
|
|
15
|
+
<Suspense fallback={<Loading />}>
|
|
16
|
+
<App />
|
|
17
|
+
</Suspense>
|
|
18
|
+
</React.StrictMode>,
|
|
19
|
+
);
|
|
20
|
+
}
|
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
import { use } from 'react';
|
|
2
|
-
|
|
3
|
-
const fetchData = () => {
|
|
4
|
-
return new Promise((resolve) => {
|
|
5
|
-
setTimeout(() => {
|
|
6
|
-
resolve({
|
|
7
|
-
data: [
|
|
8
|
-
{
|
|
9
|
-
id: 1,
|
|
10
|
-
title: 'Album 1',
|
|
11
|
-
},
|
|
12
|
-
{
|
|
13
|
-
id: 2,
|
|
14
|
-
title: 'Album 2',
|
|
15
|
-
},
|
|
16
|
-
],
|
|
17
|
-
});
|
|
18
|
-
}, 1000);
|
|
19
|
-
});
|
|
20
|
-
};
|
|
21
|
-
|
|
22
|
-
const Home = () => {
|
|
23
|
-
return <h1>111</h1>;
|
|
24
|
-
};
|
|
25
|
-
|
|
26
|
-
export default Home;
|
|
1
|
+
import { use } from 'react';
|
|
2
|
+
|
|
3
|
+
const fetchData = () => {
|
|
4
|
+
return new Promise((resolve) => {
|
|
5
|
+
setTimeout(() => {
|
|
6
|
+
resolve({
|
|
7
|
+
data: [
|
|
8
|
+
{
|
|
9
|
+
id: 1,
|
|
10
|
+
title: 'Album 1',
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
id: 2,
|
|
14
|
+
title: 'Album 2',
|
|
15
|
+
},
|
|
16
|
+
],
|
|
17
|
+
});
|
|
18
|
+
}, 1000);
|
|
19
|
+
});
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
const Home = () => {
|
|
23
|
+
return <h1>111</h1>;
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
export default Home;
|
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
import { Suspense } from 'react';
|
|
2
|
-
import { createBrowserRouter, type RouteObject } from 'react-router';
|
|
3
|
-
|
|
4
|
-
import Loading from '@/components/Loading/PageLoading';
|
|
5
|
-
|
|
6
|
-
export const lazyLoad = (path: string) => {
|
|
7
|
-
const Module = lazy(() => import(`@/pages/${path}.tsx`));
|
|
8
|
-
return (
|
|
9
|
-
<Suspense fallback={<Loading />}>
|
|
10
|
-
<Module />
|
|
11
|
-
</Suspense>
|
|
12
|
-
);
|
|
13
|
-
};
|
|
14
|
-
|
|
15
|
-
const routes: RouteObject[] = [
|
|
16
|
-
{
|
|
17
|
-
path: '/',
|
|
18
|
-
id: 'home',
|
|
19
|
-
element: lazyLoad('home/index'),
|
|
20
|
-
},
|
|
21
|
-
];
|
|
22
|
-
|
|
23
|
-
export const router = createBrowserRouter(routes, {
|
|
24
|
-
basename: import.meta.env.PUBLIC_PATH,
|
|
25
|
-
});
|
|
26
|
-
|
|
27
|
-
export default router;
|
|
1
|
+
import { Suspense } from 'react';
|
|
2
|
+
import { createBrowserRouter, type RouteObject } from 'react-router';
|
|
3
|
+
|
|
4
|
+
import Loading from '@/components/Loading/PageLoading';
|
|
5
|
+
|
|
6
|
+
export const lazyLoad = (path: string) => {
|
|
7
|
+
const Module = lazy(() => import(`@/pages/${path}.tsx`));
|
|
8
|
+
return (
|
|
9
|
+
<Suspense fallback={<Loading />}>
|
|
10
|
+
<Module />
|
|
11
|
+
</Suspense>
|
|
12
|
+
);
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
const routes: RouteObject[] = [
|
|
16
|
+
{
|
|
17
|
+
path: '/',
|
|
18
|
+
id: 'home',
|
|
19
|
+
element: lazyLoad('home/index'),
|
|
20
|
+
},
|
|
21
|
+
];
|
|
22
|
+
|
|
23
|
+
export const router = createBrowserRouter(routes, {
|
|
24
|
+
basename: import.meta.env.PUBLIC_PATH,
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
export default router;
|
|
File without changes
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { create } from 'zustand'
|
|
2
|
+
|
|
3
|
+
interface searchFormState {
|
|
4
|
+
token?: string
|
|
5
|
+
setToken: (token?: string) => void
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export const useUserStore = create<searchFormState>((set) => ({
|
|
9
|
+
token: undefined,
|
|
10
|
+
setToken: (token) => set(() => ({ token })),
|
|
11
|
+
}))
|
|
@@ -1,47 +1,47 @@
|
|
|
1
|
-
/* eslint-disable */
|
|
2
|
-
/* prettier-ignore */
|
|
3
|
-
// @ts-nocheck
|
|
4
|
-
// noinspection JSUnusedGlobalSymbols
|
|
5
|
-
// Generated by unplugin-auto-import
|
|
6
|
-
// biome-ignore lint: disable
|
|
7
|
-
export {};
|
|
8
|
-
declare global {
|
|
9
|
-
const Link: typeof import('react-router-dom')['Link'];
|
|
10
|
-
const NavLink: typeof import('react-router-dom')['NavLink'];
|
|
11
|
-
const Navigate: typeof import('react-router-dom')['Navigate'];
|
|
12
|
-
const Outlet: typeof import('react-router-dom')['Outlet'];
|
|
13
|
-
const Route: typeof import('react-router-dom')['Route'];
|
|
14
|
-
const Routes: typeof import('react-router-dom')['Routes'];
|
|
15
|
-
const createRef: typeof import('react')['createRef'];
|
|
16
|
-
const forwardRef: typeof import('react')['forwardRef'];
|
|
17
|
-
const lazy: typeof import('react')['lazy'];
|
|
18
|
-
const memo: typeof import('react')['memo'];
|
|
19
|
-
const startTransition: typeof import('react')['startTransition'];
|
|
20
|
-
const useCallback: typeof import('react')['useCallback'];
|
|
21
|
-
const useContext: typeof import('react')['useContext'];
|
|
22
|
-
const useDebugValue: typeof import('react')['useDebugValue'];
|
|
23
|
-
const useDeferredValue: typeof import('react')['useDeferredValue'];
|
|
24
|
-
const useEffect: typeof import('react')['useEffect'];
|
|
25
|
-
const useHref: typeof import('react-router-dom')['useHref'];
|
|
26
|
-
const useId: typeof import('react')['useId'];
|
|
27
|
-
const useImperativeHandle: typeof import('react')['useImperativeHandle'];
|
|
28
|
-
const useInRouterContext: typeof import('react-router-dom')['useInRouterContext'];
|
|
29
|
-
const useInsertionEffect: typeof import('react')['useInsertionEffect'];
|
|
30
|
-
const useLayoutEffect: typeof import('react')['useLayoutEffect'];
|
|
31
|
-
const useLinkClickHandler: typeof import('react-router-dom')['useLinkClickHandler'];
|
|
32
|
-
const useLocation: typeof import('react-router-dom')['useLocation'];
|
|
33
|
-
const useMemo: typeof import('react')['useMemo'];
|
|
34
|
-
const useNavigate: typeof import('react-router-dom')['useNavigate'];
|
|
35
|
-
const useNavigationType: typeof import('react-router-dom')['useNavigationType'];
|
|
36
|
-
const useOutlet: typeof import('react-router-dom')['useOutlet'];
|
|
37
|
-
const useOutletContext: typeof import('react-router-dom')['useOutletContext'];
|
|
38
|
-
const useParams: typeof import('react-router-dom')['useParams'];
|
|
39
|
-
const useReducer: typeof import('react')['useReducer'];
|
|
40
|
-
const useRef: typeof import('react')['useRef'];
|
|
41
|
-
const useResolvedPath: typeof import('react-router-dom')['useResolvedPath'];
|
|
42
|
-
const useRoutes: typeof import('react-router-dom')['useRoutes'];
|
|
43
|
-
const useSearchParams: typeof import('react-router-dom')['useSearchParams'];
|
|
44
|
-
const useState: typeof import('react')['useState'];
|
|
45
|
-
const useSyncExternalStore: typeof import('react')['useSyncExternalStore'];
|
|
46
|
-
const useTransition: typeof import('react')['useTransition'];
|
|
47
|
-
}
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
/* prettier-ignore */
|
|
3
|
+
// @ts-nocheck
|
|
4
|
+
// noinspection JSUnusedGlobalSymbols
|
|
5
|
+
// Generated by unplugin-auto-import
|
|
6
|
+
// biome-ignore lint: disable
|
|
7
|
+
export {};
|
|
8
|
+
declare global {
|
|
9
|
+
const Link: typeof import('react-router-dom')['Link'];
|
|
10
|
+
const NavLink: typeof import('react-router-dom')['NavLink'];
|
|
11
|
+
const Navigate: typeof import('react-router-dom')['Navigate'];
|
|
12
|
+
const Outlet: typeof import('react-router-dom')['Outlet'];
|
|
13
|
+
const Route: typeof import('react-router-dom')['Route'];
|
|
14
|
+
const Routes: typeof import('react-router-dom')['Routes'];
|
|
15
|
+
const createRef: typeof import('react')['createRef'];
|
|
16
|
+
const forwardRef: typeof import('react')['forwardRef'];
|
|
17
|
+
const lazy: typeof import('react')['lazy'];
|
|
18
|
+
const memo: typeof import('react')['memo'];
|
|
19
|
+
const startTransition: typeof import('react')['startTransition'];
|
|
20
|
+
const useCallback: typeof import('react')['useCallback'];
|
|
21
|
+
const useContext: typeof import('react')['useContext'];
|
|
22
|
+
const useDebugValue: typeof import('react')['useDebugValue'];
|
|
23
|
+
const useDeferredValue: typeof import('react')['useDeferredValue'];
|
|
24
|
+
const useEffect: typeof import('react')['useEffect'];
|
|
25
|
+
const useHref: typeof import('react-router-dom')['useHref'];
|
|
26
|
+
const useId: typeof import('react')['useId'];
|
|
27
|
+
const useImperativeHandle: typeof import('react')['useImperativeHandle'];
|
|
28
|
+
const useInRouterContext: typeof import('react-router-dom')['useInRouterContext'];
|
|
29
|
+
const useInsertionEffect: typeof import('react')['useInsertionEffect'];
|
|
30
|
+
const useLayoutEffect: typeof import('react')['useLayoutEffect'];
|
|
31
|
+
const useLinkClickHandler: typeof import('react-router-dom')['useLinkClickHandler'];
|
|
32
|
+
const useLocation: typeof import('react-router-dom')['useLocation'];
|
|
33
|
+
const useMemo: typeof import('react')['useMemo'];
|
|
34
|
+
const useNavigate: typeof import('react-router-dom')['useNavigate'];
|
|
35
|
+
const useNavigationType: typeof import('react-router-dom')['useNavigationType'];
|
|
36
|
+
const useOutlet: typeof import('react-router-dom')['useOutlet'];
|
|
37
|
+
const useOutletContext: typeof import('react-router-dom')['useOutletContext'];
|
|
38
|
+
const useParams: typeof import('react-router-dom')['useParams'];
|
|
39
|
+
const useReducer: typeof import('react')['useReducer'];
|
|
40
|
+
const useRef: typeof import('react')['useRef'];
|
|
41
|
+
const useResolvedPath: typeof import('react-router-dom')['useResolvedPath'];
|
|
42
|
+
const useRoutes: typeof import('react-router-dom')['useRoutes'];
|
|
43
|
+
const useSearchParams: typeof import('react-router-dom')['useSearchParams'];
|
|
44
|
+
const useState: typeof import('react')['useState'];
|
|
45
|
+
const useSyncExternalStore: typeof import('react')['useSyncExternalStore'];
|
|
46
|
+
const useTransition: typeof import('react')['useTransition'];
|
|
47
|
+
}
|