create-packer 1.50.5 → 1.50.7
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/electron-react/package.json +1 -1
- package/template/electron-react/renderer/domain/models/app.ts +1 -1
- package/template/electron-react/renderer/shared/hooks/defineRouter/deineRouter.tsx +24 -26
- package/template/web-app/react-rsbuild/package.json +2 -2
- package/template/web-app/react-rsbuild/src/hooks/defineRouter/deineRouter.tsx +24 -26
- package/template/web-app/react-rsbuild/src/models/app.ts +1 -1
- package/template/web-app/react-vite/package.json +1 -1
- package/template/web-app/react-vite/src/hooks/defineRouter/deineRouter.tsx +24 -26
- package/template/web-app/react-vite/src/models/app.ts +1 -1
- package/template/web-app/vue-rsbuild/package.json +1 -0
- package/template/web-extension/package.json +1 -1
package/package.json
CHANGED
|
@@ -11,32 +11,30 @@ export default function defineRouter(router: ReturnType<typeof createBrowserRout
|
|
|
11
11
|
state: () => ({
|
|
12
12
|
routes: cloneDeep(router.routes) as routeType[]
|
|
13
13
|
}),
|
|
14
|
-
getters: {
|
|
15
|
-
routesById:
|
|
16
|
-
return (
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
}
|
|
39
|
-
},
|
|
14
|
+
getters: state => ({
|
|
15
|
+
routesById: (function flat(routes: routeType[], parentRoute?: routeByIdType) {
|
|
16
|
+
return reduce(
|
|
17
|
+
routes,
|
|
18
|
+
(result, { children, ...route }, i) => {
|
|
19
|
+
const $route: routeByIdType = {
|
|
20
|
+
...route,
|
|
21
|
+
pos: parentRoute?.pos ? `${parentRoute?.pos}-${i}` : `${i}`
|
|
22
|
+
}
|
|
23
|
+
if (parentRoute) {
|
|
24
|
+
$route.path = `${
|
|
25
|
+
parentRoute.path === '/' ? '' : parentRoute.path
|
|
26
|
+
}/${$route.path}`
|
|
27
|
+
}
|
|
28
|
+
result[$route.id] = $route
|
|
29
|
+
if (isArray(children)) {
|
|
30
|
+
assign(result, flat(children, $route))
|
|
31
|
+
}
|
|
32
|
+
return result
|
|
33
|
+
},
|
|
34
|
+
{} as Record<string, routeByIdType>
|
|
35
|
+
)
|
|
36
|
+
})(state.routes)
|
|
37
|
+
}),
|
|
40
38
|
actions: (setState, getState) => {
|
|
41
39
|
function posToLodashPath(pos: string) {
|
|
42
40
|
if (pos) {
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"preview": "rsbuild preview",
|
|
12
12
|
"up-rsbuild": "pnpm up @rsbuild/* -L",
|
|
13
13
|
"up-tailwind": "pnpm up tailwindcss @tailwindcss/* -L",
|
|
14
|
-
"up-
|
|
14
|
+
"up-react": "pnpm up react react-dom -L",
|
|
15
15
|
"format": "prettier --write \"**/*.{ts,js,tsx,jsx,json,css,scss,less}\"",
|
|
16
16
|
"lint": "tsc --noEmit && eslint --no-error-on-unmatched-pattern && stylelint **/*.{css,scss,less,ts,tsx}",
|
|
17
17
|
"lint-fix": "eslint --fix && stylelint **/*.{css,scss,less,ts,tsx} --fix",
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
"dependencies": {
|
|
23
23
|
"@tanstack/react-query": "5.51.15",
|
|
24
24
|
"axios": "1.16.0",
|
|
25
|
-
"define-zustand": "
|
|
25
|
+
"define-zustand": "4.0.2",
|
|
26
26
|
"es-toolkit": "1.46.1",
|
|
27
27
|
"immer": "10.0.1",
|
|
28
28
|
"qs": "6.11.2",
|
|
@@ -11,32 +11,30 @@ export default function defineRouter(router: ReturnType<typeof createBrowserRout
|
|
|
11
11
|
state: () => ({
|
|
12
12
|
routes: cloneDeep(router.routes) as routeType[]
|
|
13
13
|
}),
|
|
14
|
-
getters: {
|
|
15
|
-
routesById:
|
|
16
|
-
return (
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
}
|
|
39
|
-
},
|
|
14
|
+
getters: state => ({
|
|
15
|
+
routesById: (function flat(routes: routeType[], parentRoute?: routeByIdType) {
|
|
16
|
+
return reduce(
|
|
17
|
+
routes,
|
|
18
|
+
(result, { children, ...route }, i) => {
|
|
19
|
+
const $route: routeByIdType = {
|
|
20
|
+
...route,
|
|
21
|
+
pos: parentRoute?.pos ? `${parentRoute?.pos}-${i}` : `${i}`
|
|
22
|
+
}
|
|
23
|
+
if (parentRoute) {
|
|
24
|
+
$route.path = `${
|
|
25
|
+
parentRoute.path === '/' ? '' : parentRoute.path
|
|
26
|
+
}/${$route.path}`
|
|
27
|
+
}
|
|
28
|
+
result[$route.id] = $route
|
|
29
|
+
if (isArray(children)) {
|
|
30
|
+
assign(result, flat(children, $route))
|
|
31
|
+
}
|
|
32
|
+
return result
|
|
33
|
+
},
|
|
34
|
+
{} as Record<string, routeByIdType>
|
|
35
|
+
)
|
|
36
|
+
})(state.routes)
|
|
37
|
+
}),
|
|
40
38
|
actions: (setState, getState) => {
|
|
41
39
|
function posToLodashPath(pos: string) {
|
|
42
40
|
if (pos) {
|
|
@@ -11,32 +11,30 @@ export default function defineRouter(router: ReturnType<typeof createBrowserRout
|
|
|
11
11
|
state: () => ({
|
|
12
12
|
routes: cloneDeep(router.routes) as routeType[]
|
|
13
13
|
}),
|
|
14
|
-
getters: {
|
|
15
|
-
routesById:
|
|
16
|
-
return (
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
}
|
|
39
|
-
},
|
|
14
|
+
getters: state => ({
|
|
15
|
+
routesById: (function flat(routes: routeType[], parentRoute?: routeByIdType) {
|
|
16
|
+
return reduce(
|
|
17
|
+
routes,
|
|
18
|
+
(result, { children, ...route }, i) => {
|
|
19
|
+
const $route: routeByIdType = {
|
|
20
|
+
...route,
|
|
21
|
+
pos: parentRoute?.pos ? `${parentRoute?.pos}-${i}` : `${i}`
|
|
22
|
+
}
|
|
23
|
+
if (parentRoute) {
|
|
24
|
+
$route.path = `${
|
|
25
|
+
parentRoute.path === '/' ? '' : parentRoute.path
|
|
26
|
+
}/${$route.path}`
|
|
27
|
+
}
|
|
28
|
+
result[$route.id] = $route
|
|
29
|
+
if (isArray(children)) {
|
|
30
|
+
assign(result, flat(children, $route))
|
|
31
|
+
}
|
|
32
|
+
return result
|
|
33
|
+
},
|
|
34
|
+
{} as Record<string, routeByIdType>
|
|
35
|
+
)
|
|
36
|
+
})(state.routes)
|
|
37
|
+
}),
|
|
40
38
|
actions: (setState, getState) => {
|
|
41
39
|
function posToLodashPath(pos: string) {
|
|
42
40
|
if (pos) {
|
|
@@ -18,6 +18,7 @@
|
|
|
18
18
|
"push": "npm run commit && git push",
|
|
19
19
|
"commit": "git add . && npm run cz",
|
|
20
20
|
"up-vite": "pnpm up vite @vitejs/* vite-plugin-* -L",
|
|
21
|
+
"up-vue": "pnpm up vue vue-router vue-tsc -L",
|
|
21
22
|
"up-tailwind": "pnpm up tailwindcss @tailwindcss/* -L"
|
|
22
23
|
},
|
|
23
24
|
"dependencies": {
|