@moluoxixi/create-app 2.0.414 → 2.0.416

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.
Files changed (22) hide show
  1. package/package.json +2 -8
  2. package/templates/react/micro-frontends/qiankun/base/node_modules/.bin/browserslist +17 -0
  3. package/templates/react/micro-frontends/qiankun/base/node_modules/.bin/browserslist.CMD +12 -0
  4. package/templates/react/micro-frontends/qiankun/base/node_modules/.bin/browserslist.ps1 +41 -0
  5. package/templates/react/micro-frontends/qiankun/base/node_modules/.bin/vite +4 -4
  6. package/templates/react/micro-frontends/qiankun/base/node_modules/.bin/vite.CMD +4 -4
  7. package/templates/react/micro-frontends/qiankun/base/node_modules/.bin/vite.ps1 +6 -6
  8. package/templates/react/micro-frontends/qiankun/base/package.json +1 -0
  9. package/templates/vue/micro-frontends/qiankun/base/node_modules/.bin/browserslist +17 -0
  10. package/templates/vue/micro-frontends/qiankun/base/node_modules/.bin/browserslist.CMD +12 -0
  11. package/templates/vue/micro-frontends/qiankun/base/node_modules/.bin/browserslist.ps1 +41 -0
  12. package/templates/vue/micro-frontends/qiankun/base/package.json +1 -0
  13. package/templates/vue/micro-frontends/qiankun/features/manualRoutes/package.json +2 -0
  14. package/templates/vue/micro-frontends/qiankun/features/manualRoutes/src/router/layout.vue +15 -0
  15. package/templates/vue/micro-frontends/qiankun/features/manualRoutes/src/router/routes.ts +26 -0
  16. package/templates/vue/micro-frontends/qiankun/features/manualRoutes/src/stores/index.ts +6 -0
  17. package/templates/vue/micro-frontends/qiankun/features/manualRoutes/src/stores/modules/system.ts +51 -0
  18. package/templates/vue/micro-frontends/qiankun/features/pageRoutes/package.json +2 -0
  19. package/templates/vue/micro-frontends/qiankun/features/pageRoutes/src/stores/index.ts +6 -0
  20. package/templates/vue/micro-frontends/qiankun/features/pageRoutes/src/stores/modules/system.ts +51 -0
  21. package/templates/vue/features/manualRoutes/src/layouts/index.ts +0 -26
  22. package/templates/vue/features/pageRoutes/src/layouts/index.ts +0 -26
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@moluoxixi/create-app",
3
- "version": "2.0.414",
3
+ "version": "2.0.416",
4
4
  "type": "module",
5
5
  "description": "Create Vue/React projects with atomic layered architecture",
6
6
  "main": "dist/index.js",
@@ -40,23 +40,17 @@
40
40
  "dependencies": {
41
41
  "chalk": "^5.3.0",
42
42
  "commander": "^12.1.0",
43
- "ejs": "^3.1.10",
44
43
  "fs-extra": "^11.3.0",
45
44
  "inquirer": "^12.0.0",
46
- "jiti": "^2.4.2",
47
- "lodash-es": "^4.17.21",
48
- "ora": "^8.1.1",
49
- "yaml": "^2.6.0"
45
+ "ora": "^8.1.1"
50
46
  },
51
47
  "devDependencies": {
52
48
  "vite": "^6.2.4",
53
49
  "@commitlint/cli": "^19.8.0",
54
50
  "@commitlint/config-conventional": "^19.8.0",
55
51
  "@moluoxixi/eslint-config": "latest",
56
- "@types/ejs": "^3.1.5",
57
52
  "@types/fs-extra": "^11.0.4",
58
53
  "@types/inquirer": "^9.0.7",
59
- "@types/lodash-es": "^4.17.12",
60
54
  "@vue-macros/volar": "^3.0.0-beta.15",
61
55
  "@types/node": "^22.14.0",
62
56
  "commitizen": "^4.3.1",
@@ -0,0 +1,17 @@
1
+ #!/bin/sh
2
+ basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
3
+
4
+ case `uname` in
5
+ *CYGWIN*) basedir=`cygpath -w "$basedir"`;;
6
+ esac
7
+
8
+ if [ -z "$NODE_PATH" ]; then
9
+ export NODE_PATH="/mnt/e/project/template/vite-cli/node_modules/.pnpm/browserslist@4.28.1/node_modules/browserslist/node_modules:/mnt/e/project/template/vite-cli/node_modules/.pnpm/browserslist@4.28.1/node_modules:/mnt/e/project/template/vite-cli/node_modules/.pnpm/node_modules"
10
+ else
11
+ export NODE_PATH="/mnt/e/project/template/vite-cli/node_modules/.pnpm/browserslist@4.28.1/node_modules/browserslist/node_modules:/mnt/e/project/template/vite-cli/node_modules/.pnpm/browserslist@4.28.1/node_modules:/mnt/e/project/template/vite-cli/node_modules/.pnpm/node_modules:$NODE_PATH"
12
+ fi
13
+ if [ -x "$basedir/node" ]; then
14
+ exec "$basedir/node" "$basedir/../../../../../../../node_modules/.pnpm/browserslist@4.28.1/node_modules/browserslist/cli.js" "$@"
15
+ else
16
+ exec node "$basedir/../../../../../../../node_modules/.pnpm/browserslist@4.28.1/node_modules/browserslist/cli.js" "$@"
17
+ fi
@@ -0,0 +1,12 @@
1
+ @SETLOCAL
2
+ @IF NOT DEFINED NODE_PATH (
3
+ @SET "NODE_PATH=E:\project\template\vite-cli\node_modules\.pnpm\browserslist@4.28.1\node_modules\browserslist\node_modules;E:\project\template\vite-cli\node_modules\.pnpm\browserslist@4.28.1\node_modules;E:\project\template\vite-cli\node_modules\.pnpm\node_modules"
4
+ ) ELSE (
5
+ @SET "NODE_PATH=E:\project\template\vite-cli\node_modules\.pnpm\browserslist@4.28.1\node_modules\browserslist\node_modules;E:\project\template\vite-cli\node_modules\.pnpm\browserslist@4.28.1\node_modules;E:\project\template\vite-cli\node_modules\.pnpm\node_modules;%NODE_PATH%"
6
+ )
7
+ @IF EXIST "%~dp0\node.exe" (
8
+ "%~dp0\node.exe" "%~dp0\..\..\..\..\..\..\..\node_modules\.pnpm\browserslist@4.28.1\node_modules\browserslist\cli.js" %*
9
+ ) ELSE (
10
+ @SET PATHEXT=%PATHEXT:;.JS;=;%
11
+ node "%~dp0\..\..\..\..\..\..\..\node_modules\.pnpm\browserslist@4.28.1\node_modules\browserslist\cli.js" %*
12
+ )
@@ -0,0 +1,41 @@
1
+ #!/usr/bin/env pwsh
2
+ $basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
3
+
4
+ $exe=""
5
+ $pathsep=":"
6
+ $env_node_path=$env:NODE_PATH
7
+ $new_node_path="E:\project\template\vite-cli\node_modules\.pnpm\browserslist@4.28.1\node_modules\browserslist\node_modules;E:\project\template\vite-cli\node_modules\.pnpm\browserslist@4.28.1\node_modules;E:\project\template\vite-cli\node_modules\.pnpm\node_modules"
8
+ if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) {
9
+ # Fix case when both the Windows and Linux builds of Node
10
+ # are installed in the same directory
11
+ $exe=".exe"
12
+ $pathsep=";"
13
+ } else {
14
+ $new_node_path="/mnt/e/project/template/vite-cli/node_modules/.pnpm/browserslist@4.28.1/node_modules/browserslist/node_modules:/mnt/e/project/template/vite-cli/node_modules/.pnpm/browserslist@4.28.1/node_modules:/mnt/e/project/template/vite-cli/node_modules/.pnpm/node_modules"
15
+ }
16
+ if ([string]::IsNullOrEmpty($env_node_path)) {
17
+ $env:NODE_PATH=$new_node_path
18
+ } else {
19
+ $env:NODE_PATH="$new_node_path$pathsep$env_node_path"
20
+ }
21
+
22
+ $ret=0
23
+ if (Test-Path "$basedir/node$exe") {
24
+ # Support pipeline input
25
+ if ($MyInvocation.ExpectingInput) {
26
+ $input | & "$basedir/node$exe" "$basedir/../../../../../../../node_modules/.pnpm/browserslist@4.28.1/node_modules/browserslist/cli.js" $args
27
+ } else {
28
+ & "$basedir/node$exe" "$basedir/../../../../../../../node_modules/.pnpm/browserslist@4.28.1/node_modules/browserslist/cli.js" $args
29
+ }
30
+ $ret=$LASTEXITCODE
31
+ } else {
32
+ # Support pipeline input
33
+ if ($MyInvocation.ExpectingInput) {
34
+ $input | & "node$exe" "$basedir/../../../../../../../node_modules/.pnpm/browserslist@4.28.1/node_modules/browserslist/cli.js" $args
35
+ } else {
36
+ & "node$exe" "$basedir/../../../../../../../node_modules/.pnpm/browserslist@4.28.1/node_modules/browserslist/cli.js" $args
37
+ }
38
+ $ret=$LASTEXITCODE
39
+ }
40
+ $env:NODE_PATH=$env_node_path
41
+ exit $ret
@@ -6,12 +6,12 @@ case `uname` in
6
6
  esac
7
7
 
8
8
  if [ -z "$NODE_PATH" ]; then
9
- export NODE_PATH="/mnt/e/project/template/vite-cli/node_modules/.pnpm/vite@7.3.0_@types+node@22.1_7c06d9c6f7b7316383c1af6ed786169b/node_modules/vite/bin/node_modules:/mnt/e/project/template/vite-cli/node_modules/.pnpm/vite@7.3.0_@types+node@22.1_7c06d9c6f7b7316383c1af6ed786169b/node_modules/vite/node_modules:/mnt/e/project/template/vite-cli/node_modules/.pnpm/vite@7.3.0_@types+node@22.1_7c06d9c6f7b7316383c1af6ed786169b/node_modules:/mnt/e/project/template/vite-cli/node_modules/.pnpm/node_modules"
9
+ export NODE_PATH="/mnt/e/project/template/vite-cli/node_modules/.pnpm/vite@7.1.11_@types+node@22._a442b9e867f9e314d66f8a1e734ad862/node_modules/vite/bin/node_modules:/mnt/e/project/template/vite-cli/node_modules/.pnpm/vite@7.1.11_@types+node@22._a442b9e867f9e314d66f8a1e734ad862/node_modules/vite/node_modules:/mnt/e/project/template/vite-cli/node_modules/.pnpm/vite@7.1.11_@types+node@22._a442b9e867f9e314d66f8a1e734ad862/node_modules:/mnt/e/project/template/vite-cli/node_modules/.pnpm/node_modules"
10
10
  else
11
- export NODE_PATH="/mnt/e/project/template/vite-cli/node_modules/.pnpm/vite@7.3.0_@types+node@22.1_7c06d9c6f7b7316383c1af6ed786169b/node_modules/vite/bin/node_modules:/mnt/e/project/template/vite-cli/node_modules/.pnpm/vite@7.3.0_@types+node@22.1_7c06d9c6f7b7316383c1af6ed786169b/node_modules/vite/node_modules:/mnt/e/project/template/vite-cli/node_modules/.pnpm/vite@7.3.0_@types+node@22.1_7c06d9c6f7b7316383c1af6ed786169b/node_modules:/mnt/e/project/template/vite-cli/node_modules/.pnpm/node_modules:$NODE_PATH"
11
+ export NODE_PATH="/mnt/e/project/template/vite-cli/node_modules/.pnpm/vite@7.1.11_@types+node@22._a442b9e867f9e314d66f8a1e734ad862/node_modules/vite/bin/node_modules:/mnt/e/project/template/vite-cli/node_modules/.pnpm/vite@7.1.11_@types+node@22._a442b9e867f9e314d66f8a1e734ad862/node_modules/vite/node_modules:/mnt/e/project/template/vite-cli/node_modules/.pnpm/vite@7.1.11_@types+node@22._a442b9e867f9e314d66f8a1e734ad862/node_modules:/mnt/e/project/template/vite-cli/node_modules/.pnpm/node_modules:$NODE_PATH"
12
12
  fi
13
13
  if [ -x "$basedir/node" ]; then
14
- exec "$basedir/node" "$basedir/../../../../../../../node_modules/.pnpm/vite@7.3.0_@types+node@22.1_7c06d9c6f7b7316383c1af6ed786169b/node_modules/vite/bin/vite.js" "$@"
14
+ exec "$basedir/node" "$basedir/../vite/bin/vite.js" "$@"
15
15
  else
16
- exec node "$basedir/../../../../../../../node_modules/.pnpm/vite@7.3.0_@types+node@22.1_7c06d9c6f7b7316383c1af6ed786169b/node_modules/vite/bin/vite.js" "$@"
16
+ exec node "$basedir/../vite/bin/vite.js" "$@"
17
17
  fi
@@ -1,12 +1,12 @@
1
1
  @SETLOCAL
2
2
  @IF NOT DEFINED NODE_PATH (
3
- @SET "NODE_PATH=E:\project\template\vite-cli\node_modules\.pnpm\vite@7.3.0_@types+node@22.1_7c06d9c6f7b7316383c1af6ed786169b\node_modules\vite\bin\node_modules;E:\project\template\vite-cli\node_modules\.pnpm\vite@7.3.0_@types+node@22.1_7c06d9c6f7b7316383c1af6ed786169b\node_modules\vite\node_modules;E:\project\template\vite-cli\node_modules\.pnpm\vite@7.3.0_@types+node@22.1_7c06d9c6f7b7316383c1af6ed786169b\node_modules;E:\project\template\vite-cli\node_modules\.pnpm\node_modules"
3
+ @SET "NODE_PATH=E:\project\template\vite-cli\node_modules\.pnpm\vite@7.1.11_@types+node@22._a442b9e867f9e314d66f8a1e734ad862\node_modules\vite\bin\node_modules;E:\project\template\vite-cli\node_modules\.pnpm\vite@7.1.11_@types+node@22._a442b9e867f9e314d66f8a1e734ad862\node_modules\vite\node_modules;E:\project\template\vite-cli\node_modules\.pnpm\vite@7.1.11_@types+node@22._a442b9e867f9e314d66f8a1e734ad862\node_modules;E:\project\template\vite-cli\node_modules\.pnpm\node_modules"
4
4
  ) ELSE (
5
- @SET "NODE_PATH=E:\project\template\vite-cli\node_modules\.pnpm\vite@7.3.0_@types+node@22.1_7c06d9c6f7b7316383c1af6ed786169b\node_modules\vite\bin\node_modules;E:\project\template\vite-cli\node_modules\.pnpm\vite@7.3.0_@types+node@22.1_7c06d9c6f7b7316383c1af6ed786169b\node_modules\vite\node_modules;E:\project\template\vite-cli\node_modules\.pnpm\vite@7.3.0_@types+node@22.1_7c06d9c6f7b7316383c1af6ed786169b\node_modules;E:\project\template\vite-cli\node_modules\.pnpm\node_modules;%NODE_PATH%"
5
+ @SET "NODE_PATH=E:\project\template\vite-cli\node_modules\.pnpm\vite@7.1.11_@types+node@22._a442b9e867f9e314d66f8a1e734ad862\node_modules\vite\bin\node_modules;E:\project\template\vite-cli\node_modules\.pnpm\vite@7.1.11_@types+node@22._a442b9e867f9e314d66f8a1e734ad862\node_modules\vite\node_modules;E:\project\template\vite-cli\node_modules\.pnpm\vite@7.1.11_@types+node@22._a442b9e867f9e314d66f8a1e734ad862\node_modules;E:\project\template\vite-cli\node_modules\.pnpm\node_modules;%NODE_PATH%"
6
6
  )
7
7
  @IF EXIST "%~dp0\node.exe" (
8
- "%~dp0\node.exe" "%~dp0\..\..\..\..\..\..\..\node_modules\.pnpm\vite@7.3.0_@types+node@22.1_7c06d9c6f7b7316383c1af6ed786169b\node_modules\vite\bin\vite.js" %*
8
+ "%~dp0\node.exe" "%~dp0\..\vite\bin\vite.js" %*
9
9
  ) ELSE (
10
10
  @SET PATHEXT=%PATHEXT:;.JS;=;%
11
- node "%~dp0\..\..\..\..\..\..\..\node_modules\.pnpm\vite@7.3.0_@types+node@22.1_7c06d9c6f7b7316383c1af6ed786169b\node_modules\vite\bin\vite.js" %*
11
+ node "%~dp0\..\vite\bin\vite.js" %*
12
12
  )
@@ -4,14 +4,14 @@ $basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
4
4
  $exe=""
5
5
  $pathsep=":"
6
6
  $env_node_path=$env:NODE_PATH
7
- $new_node_path="E:\project\template\vite-cli\node_modules\.pnpm\vite@7.3.0_@types+node@22.1_7c06d9c6f7b7316383c1af6ed786169b\node_modules\vite\bin\node_modules;E:\project\template\vite-cli\node_modules\.pnpm\vite@7.3.0_@types+node@22.1_7c06d9c6f7b7316383c1af6ed786169b\node_modules\vite\node_modules;E:\project\template\vite-cli\node_modules\.pnpm\vite@7.3.0_@types+node@22.1_7c06d9c6f7b7316383c1af6ed786169b\node_modules;E:\project\template\vite-cli\node_modules\.pnpm\node_modules"
7
+ $new_node_path="E:\project\template\vite-cli\node_modules\.pnpm\vite@7.1.11_@types+node@22._a442b9e867f9e314d66f8a1e734ad862\node_modules\vite\bin\node_modules;E:\project\template\vite-cli\node_modules\.pnpm\vite@7.1.11_@types+node@22._a442b9e867f9e314d66f8a1e734ad862\node_modules\vite\node_modules;E:\project\template\vite-cli\node_modules\.pnpm\vite@7.1.11_@types+node@22._a442b9e867f9e314d66f8a1e734ad862\node_modules;E:\project\template\vite-cli\node_modules\.pnpm\node_modules"
8
8
  if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) {
9
9
  # Fix case when both the Windows and Linux builds of Node
10
10
  # are installed in the same directory
11
11
  $exe=".exe"
12
12
  $pathsep=";"
13
13
  } else {
14
- $new_node_path="/mnt/e/project/template/vite-cli/node_modules/.pnpm/vite@7.3.0_@types+node@22.1_7c06d9c6f7b7316383c1af6ed786169b/node_modules/vite/bin/node_modules:/mnt/e/project/template/vite-cli/node_modules/.pnpm/vite@7.3.0_@types+node@22.1_7c06d9c6f7b7316383c1af6ed786169b/node_modules/vite/node_modules:/mnt/e/project/template/vite-cli/node_modules/.pnpm/vite@7.3.0_@types+node@22.1_7c06d9c6f7b7316383c1af6ed786169b/node_modules:/mnt/e/project/template/vite-cli/node_modules/.pnpm/node_modules"
14
+ $new_node_path="/mnt/e/project/template/vite-cli/node_modules/.pnpm/vite@7.1.11_@types+node@22._a442b9e867f9e314d66f8a1e734ad862/node_modules/vite/bin/node_modules:/mnt/e/project/template/vite-cli/node_modules/.pnpm/vite@7.1.11_@types+node@22._a442b9e867f9e314d66f8a1e734ad862/node_modules/vite/node_modules:/mnt/e/project/template/vite-cli/node_modules/.pnpm/vite@7.1.11_@types+node@22._a442b9e867f9e314d66f8a1e734ad862/node_modules:/mnt/e/project/template/vite-cli/node_modules/.pnpm/node_modules"
15
15
  }
16
16
  if ([string]::IsNullOrEmpty($env_node_path)) {
17
17
  $env:NODE_PATH=$new_node_path
@@ -23,17 +23,17 @@ $ret=0
23
23
  if (Test-Path "$basedir/node$exe") {
24
24
  # Support pipeline input
25
25
  if ($MyInvocation.ExpectingInput) {
26
- $input | & "$basedir/node$exe" "$basedir/../../../../../../../node_modules/.pnpm/vite@7.3.0_@types+node@22.1_7c06d9c6f7b7316383c1af6ed786169b/node_modules/vite/bin/vite.js" $args
26
+ $input | & "$basedir/node$exe" "$basedir/../vite/bin/vite.js" $args
27
27
  } else {
28
- & "$basedir/node$exe" "$basedir/../../../../../../../node_modules/.pnpm/vite@7.3.0_@types+node@22.1_7c06d9c6f7b7316383c1af6ed786169b/node_modules/vite/bin/vite.js" $args
28
+ & "$basedir/node$exe" "$basedir/../vite/bin/vite.js" $args
29
29
  }
30
30
  $ret=$LASTEXITCODE
31
31
  } else {
32
32
  # Support pipeline input
33
33
  if ($MyInvocation.ExpectingInput) {
34
- $input | & "node$exe" "$basedir/../../../../../../../node_modules/.pnpm/vite@7.3.0_@types+node@22.1_7c06d9c6f7b7316383c1af6ed786169b/node_modules/vite/bin/vite.js" $args
34
+ $input | & "node$exe" "$basedir/../vite/bin/vite.js" $args
35
35
  } else {
36
- & "node$exe" "$basedir/../../../../../../../node_modules/.pnpm/vite@7.3.0_@types+node@22.1_7c06d9c6f7b7316383c1af6ed786169b/node_modules/vite/bin/vite.js" $args
36
+ & "node$exe" "$basedir/../vite/bin/vite.js" $args
37
37
  }
38
38
  $ret=$LASTEXITCODE
39
39
  }
@@ -3,6 +3,7 @@
3
3
  "vite-plugin-qiankun": "^1.0.15"
4
4
  },
5
5
  "devDependencies": {
6
+ "vite": "7.1.11",
6
7
  "@moluoxixi/css-module-global-root-plugin": "latest",
7
8
  "@moluoxixi/vite-config": "latest"
8
9
  }
@@ -0,0 +1,17 @@
1
+ #!/bin/sh
2
+ basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
3
+
4
+ case `uname` in
5
+ *CYGWIN*) basedir=`cygpath -w "$basedir"`;;
6
+ esac
7
+
8
+ if [ -z "$NODE_PATH" ]; then
9
+ export NODE_PATH="/mnt/e/project/template/vite-cli/node_modules/.pnpm/browserslist@4.28.1/node_modules/browserslist/node_modules:/mnt/e/project/template/vite-cli/node_modules/.pnpm/browserslist@4.28.1/node_modules:/mnt/e/project/template/vite-cli/node_modules/.pnpm/node_modules"
10
+ else
11
+ export NODE_PATH="/mnt/e/project/template/vite-cli/node_modules/.pnpm/browserslist@4.28.1/node_modules/browserslist/node_modules:/mnt/e/project/template/vite-cli/node_modules/.pnpm/browserslist@4.28.1/node_modules:/mnt/e/project/template/vite-cli/node_modules/.pnpm/node_modules:$NODE_PATH"
12
+ fi
13
+ if [ -x "$basedir/node" ]; then
14
+ exec "$basedir/node" "$basedir/../../../../../../../node_modules/.pnpm/browserslist@4.28.1/node_modules/browserslist/cli.js" "$@"
15
+ else
16
+ exec node "$basedir/../../../../../../../node_modules/.pnpm/browserslist@4.28.1/node_modules/browserslist/cli.js" "$@"
17
+ fi
@@ -0,0 +1,12 @@
1
+ @SETLOCAL
2
+ @IF NOT DEFINED NODE_PATH (
3
+ @SET "NODE_PATH=E:\project\template\vite-cli\node_modules\.pnpm\browserslist@4.28.1\node_modules\browserslist\node_modules;E:\project\template\vite-cli\node_modules\.pnpm\browserslist@4.28.1\node_modules;E:\project\template\vite-cli\node_modules\.pnpm\node_modules"
4
+ ) ELSE (
5
+ @SET "NODE_PATH=E:\project\template\vite-cli\node_modules\.pnpm\browserslist@4.28.1\node_modules\browserslist\node_modules;E:\project\template\vite-cli\node_modules\.pnpm\browserslist@4.28.1\node_modules;E:\project\template\vite-cli\node_modules\.pnpm\node_modules;%NODE_PATH%"
6
+ )
7
+ @IF EXIST "%~dp0\node.exe" (
8
+ "%~dp0\node.exe" "%~dp0\..\..\..\..\..\..\..\node_modules\.pnpm\browserslist@4.28.1\node_modules\browserslist\cli.js" %*
9
+ ) ELSE (
10
+ @SET PATHEXT=%PATHEXT:;.JS;=;%
11
+ node "%~dp0\..\..\..\..\..\..\..\node_modules\.pnpm\browserslist@4.28.1\node_modules\browserslist\cli.js" %*
12
+ )
@@ -0,0 +1,41 @@
1
+ #!/usr/bin/env pwsh
2
+ $basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
3
+
4
+ $exe=""
5
+ $pathsep=":"
6
+ $env_node_path=$env:NODE_PATH
7
+ $new_node_path="E:\project\template\vite-cli\node_modules\.pnpm\browserslist@4.28.1\node_modules\browserslist\node_modules;E:\project\template\vite-cli\node_modules\.pnpm\browserslist@4.28.1\node_modules;E:\project\template\vite-cli\node_modules\.pnpm\node_modules"
8
+ if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) {
9
+ # Fix case when both the Windows and Linux builds of Node
10
+ # are installed in the same directory
11
+ $exe=".exe"
12
+ $pathsep=";"
13
+ } else {
14
+ $new_node_path="/mnt/e/project/template/vite-cli/node_modules/.pnpm/browserslist@4.28.1/node_modules/browserslist/node_modules:/mnt/e/project/template/vite-cli/node_modules/.pnpm/browserslist@4.28.1/node_modules:/mnt/e/project/template/vite-cli/node_modules/.pnpm/node_modules"
15
+ }
16
+ if ([string]::IsNullOrEmpty($env_node_path)) {
17
+ $env:NODE_PATH=$new_node_path
18
+ } else {
19
+ $env:NODE_PATH="$new_node_path$pathsep$env_node_path"
20
+ }
21
+
22
+ $ret=0
23
+ if (Test-Path "$basedir/node$exe") {
24
+ # Support pipeline input
25
+ if ($MyInvocation.ExpectingInput) {
26
+ $input | & "$basedir/node$exe" "$basedir/../../../../../../../node_modules/.pnpm/browserslist@4.28.1/node_modules/browserslist/cli.js" $args
27
+ } else {
28
+ & "$basedir/node$exe" "$basedir/../../../../../../../node_modules/.pnpm/browserslist@4.28.1/node_modules/browserslist/cli.js" $args
29
+ }
30
+ $ret=$LASTEXITCODE
31
+ } else {
32
+ # Support pipeline input
33
+ if ($MyInvocation.ExpectingInput) {
34
+ $input | & "node$exe" "$basedir/../../../../../../../node_modules/.pnpm/browserslist@4.28.1/node_modules/browserslist/cli.js" $args
35
+ } else {
36
+ & "node$exe" "$basedir/../../../../../../../node_modules/.pnpm/browserslist@4.28.1/node_modules/browserslist/cli.js" $args
37
+ }
38
+ $ret=$LASTEXITCODE
39
+ }
40
+ $env:NODE_PATH=$env_node_path
41
+ exit $ret
@@ -3,6 +3,7 @@
3
3
  "vite-plugin-qiankun": "^1.0.15"
4
4
  },
5
5
  "devDependencies": {
6
+ "vite": "7.1.11",
6
7
  "@moluoxixi/css-module-global-root-plugin": "latest",
7
8
  "@moluoxixi/vite-config": "latest"
8
9
  }
@@ -4,6 +4,8 @@
4
4
  "radash": "^12.1.0",
5
5
  "vite-plugin-qiankun": "^1.0.15",
6
6
  "vue": "^3.5.13",
7
+ "pinia": "^2.2.7",
8
+ "pinia-plugin-persistedstate": "^3.2.1",
7
9
  "vue-router": "^4.4.5"
8
10
  },
9
11
  "devDependencies": {
@@ -0,0 +1,15 @@
1
+ <template>
2
+ <component :is="layout" />
3
+ </template>
4
+
5
+ <script lang="ts" setup>
6
+ import { computed } from 'vue'
7
+ import layouts from '@/layouts'
8
+ import { useSystemStore } from '@/stores/modules/system'
9
+
10
+ const systemInfo = useSystemStore()
11
+ const layoutType = computed(() => systemInfo.layout)
12
+ const layout = computed(() => layouts[layoutType.value])
13
+ </script>
14
+
15
+ <style lang="scss" scoped></style>
@@ -0,0 +1,26 @@
1
+ /**
2
+ * 路由配置
3
+ * 手动配置路由表
4
+ */
5
+
6
+ /**
7
+ * 路由配置数组
8
+ */
9
+ export const routes = [
10
+ {
11
+ path: '/home',
12
+ name: 'Home',
13
+ component: () => import('@/pages/home/index.vue'),
14
+ meta: {
15
+ title: '首页',
16
+ },
17
+ },
18
+ {
19
+ path: '/about',
20
+ name: 'About',
21
+ component: () => import('@/pages/about/index.vue'),
22
+ meta: {
23
+ title: '关于',
24
+ },
25
+ },
26
+ ]
@@ -0,0 +1,6 @@
1
+ import { createPinia } from 'pinia'
2
+ import piniaPluginPersistedstate from 'pinia-plugin-persistedstate'
3
+
4
+ const store = createPinia()
5
+ store.use(piniaPluginPersistedstate)
6
+ export { store }
@@ -0,0 +1,51 @@
1
+ import { defineStore } from 'pinia'
2
+ import { store } from '../index.ts'
3
+
4
+ /**
5
+ * 系统对象
6
+ * @returns {object} 系统存储对象
7
+ */
8
+ const systemStore = defineStore('system', {
9
+ state: () => ({
10
+ /**
11
+ * 主题颜色
12
+ * @type {string}
13
+ */
14
+ themeColor: '#3a77ff',
15
+ /**
16
+ * 布局
17
+ * @type {string}
18
+ */
19
+ layout: 'element',
20
+ /**
21
+ * 系统编码
22
+ * @type {string}
23
+ */
24
+ systemCode: import.meta.env.VITE_APP_CODE || '',
25
+ }),
26
+ actions: {
27
+ setSystemCode(systemCode: string) {
28
+ // 将当前的主题颜色设置为传入的颜色
29
+ this.systemCode = systemCode
30
+ },
31
+ /**
32
+ * 设置布局
33
+ * @param {string} layout - 新的布局
34
+ */
35
+ setLayout(layout: string) {
36
+ this.layout = layout
37
+ },
38
+ /**
39
+ * 设置主题颜色
40
+ * @param {string} color - 新的主题颜色
41
+ */
42
+ setTheme(color: string) {
43
+ // 将当前的主题颜色设置为传入的颜色
44
+ this.themeColor = color
45
+ },
46
+ },
47
+ })
48
+
49
+ export function useSystemStore() {
50
+ return systemStore(store)
51
+ }
@@ -3,6 +3,8 @@
3
3
  "lodash-es": "^4.17.21",
4
4
  "radash": "^12.1.0",
5
5
  "vite-plugin-qiankun": "^1.0.15",
6
+ "pinia": "^2.2.7",
7
+ "pinia-plugin-persistedstate": "^3.2.1",
6
8
  "vue": "^3.5.13",
7
9
  "vue-router": "^4.4.5"
8
10
  },
@@ -0,0 +1,6 @@
1
+ import { createPinia } from 'pinia'
2
+ import piniaPluginPersistedstate from 'pinia-plugin-persistedstate'
3
+
4
+ const store = createPinia()
5
+ store.use(piniaPluginPersistedstate)
6
+ export { store }
@@ -0,0 +1,51 @@
1
+ import { defineStore } from 'pinia'
2
+ import { store } from '../index.ts'
3
+
4
+ /**
5
+ * 系统对象
6
+ * @returns {object} 系统存储对象
7
+ */
8
+ const systemStore = defineStore('system', {
9
+ state: () => ({
10
+ /**
11
+ * 主题颜色
12
+ * @type {string}
13
+ */
14
+ themeColor: '#3a77ff',
15
+ /**
16
+ * 布局
17
+ * @type {string}
18
+ */
19
+ layout: 'element',
20
+ /**
21
+ * 系统编码
22
+ * @type {string}
23
+ */
24
+ systemCode: import.meta.env.VITE_APP_CODE || '',
25
+ }),
26
+ actions: {
27
+ setSystemCode(systemCode: string) {
28
+ // 将当前的主题颜色设置为传入的颜色
29
+ this.systemCode = systemCode
30
+ },
31
+ /**
32
+ * 设置布局
33
+ * @param {string} layout - 新的布局
34
+ */
35
+ setLayout(layout: string) {
36
+ this.layout = layout
37
+ },
38
+ /**
39
+ * 设置主题颜色
40
+ * @param {string} color - 新的主题颜色
41
+ */
42
+ setTheme(color: string) {
43
+ // 将当前的主题颜色设置为传入的颜色
44
+ this.themeColor = color
45
+ },
46
+ },
47
+ })
48
+
49
+ export function useSystemStore() {
50
+ return systemStore(store)
51
+ }
@@ -1,26 +0,0 @@
1
- /**
2
- * 布局组件导出
3
- * 注意:具体的布局组件在对应的 UI 库 feature 中
4
- */
5
- import type { App, Component } from 'vue'
6
-
7
- const layoutFiles = import.meta.glob('./*.vue', { eager: true, import: 'default' })
8
- const layouts = Object.keys(layoutFiles).reduce((modules, modulePath) => {
9
- const nameArr: string[] = modulePath.split('/')
10
- const name: string | undefined
11
- = nameArr.at(-1) === 'index.vue' ? nameArr.at(-2) : nameArr.at(-1)?.slice(0, -4)
12
- const layout: Component = layoutFiles[modulePath] as Component
13
- if (!layout)
14
- return modules
15
- if (name) {
16
- modules[name!] = layout as Component
17
- }
18
- return modules
19
- }, {} as any)
20
- layouts.install = function (app: App) {
21
- const layoutNames = Object.keys(layouts)
22
- layoutNames.forEach((name) => {
23
- app.component(name, layouts[name!])
24
- })
25
- }
26
- export default layouts
@@ -1,26 +0,0 @@
1
- /**
2
- * 布局组件导出
3
- * 注意:具体的布局组件在对应的 UI 库 feature 中
4
- */
5
- import type { App, Component } from 'vue'
6
-
7
- const layoutFiles = import.meta.glob('./*.vue', { eager: true, import: 'default' })
8
- const layouts = Object.keys(layoutFiles).reduce((modules, modulePath) => {
9
- const nameArr: string[] = modulePath.split('/')
10
- const name: string | undefined
11
- = nameArr.at(-1) === 'index.vue' ? nameArr.at(-2) : nameArr.at(-1)?.slice(0, -4)
12
- const layout: Component = layoutFiles[modulePath] as Component
13
- if (!layout)
14
- return modules
15
- if (name) {
16
- modules[name!] = layout as Component
17
- }
18
- return modules
19
- }, {} as any)
20
- layouts.install = function (app: App) {
21
- const layoutNames = Object.keys(layouts)
22
- layoutNames.forEach((name) => {
23
- app.component(name, layouts[name!])
24
- })
25
- }
26
- export default layouts