@moluoxixi/create-app 2.0.407 → 2.0.410
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/dist/test.js +168 -87
- package/dist/types/features.d.ts +7 -9
- package/dist/types/features.js +6 -25
- package/dist/types/index.d.ts +20 -13
- package/dist/utils/featureMapping.d.ts +5 -26
- package/dist/utils/featureMapping.js +24 -68
- package/dist/utils/generateFrameworkProject.d.ts +2 -0
- package/dist/utils/generateFrameworkProject.js +136 -21
- package/dist/utils/prompts.js +37 -7
- package/dist/utils/renderFeatures.d.ts +38 -1
- package/dist/utils/renderFeatures.js +121 -37
- package/dist/utils/routeModeMapping.d.ts +14 -0
- package/dist/utils/routeModeMapping.js +15 -0
- package/package.json +2 -3
- package/templates/common/base/package.json +1 -1
- package/templates/common/base/vite.config.ts.ejs +1 -1
- package/templates/react/base/package.json +1 -3
- package/templates/react/base/src/main.tsx.ejs +16 -43
- package/templates/react/features/pageRoutes/package.json +1 -0
- package/templates/react/micro-frontends/qiankun/base/package.json +6 -0
- package/templates/react/micro-frontends/qiankun/base/src/main.tsx.ejs +83 -0
- package/templates/react/micro-frontends/qiankun/base/vite.config.ts.ejs +93 -0
- package/templates/vue/base/package.json +1 -5
- package/templates/vue/base/src/main.ts.ejs +18 -41
- package/templates/vue/features/element-plus/src/layouts/element.vue +1 -4
- package/templates/vue/features/manualRoutes/package.json +0 -1
- package/templates/vue/features/manualRoutes/src/router/index.ts +11 -12
- package/templates/vue/features/manualRoutes/src/router/routes.ts +14 -23
- package/templates/vue/features/pageRoutes/package.json +0 -1
- package/templates/vue/features/pageRoutes/src/router/index.ts +11 -12
- package/templates/vue/features/pinia/node_modules/.bin/tsc +17 -0
- package/templates/vue/features/pinia/node_modules/.bin/tsc.CMD +12 -0
- package/templates/vue/features/pinia/node_modules/.bin/tsc.ps1 +41 -0
- package/templates/vue/features/pinia/node_modules/.bin/tsserver +17 -0
- package/templates/vue/features/pinia/node_modules/.bin/tsserver.CMD +12 -0
- package/templates/vue/features/pinia/node_modules/.bin/tsserver.ps1 +41 -0
- package/templates/vue/features/pinia/package.json +6 -0
- package/templates/vue/micro-frontends/qiankun/base/package.json +6 -0
- package/templates/vue/micro-frontends/qiankun/base/src/main.ts.ejs +87 -0
- package/templates/vue/micro-frontends/qiankun/base/vite.config.ts.ejs +93 -0
- package/templates/vue/micro-frontends/qiankun/features/element-plus/src/layouts/element.vue +120 -0
- package/templates/vue/micro-frontends/qiankun/features/manualRoutes/node_modules/.bin/jiti +17 -0
- package/templates/vue/micro-frontends/qiankun/features/manualRoutes/node_modules/.bin/jiti.CMD +12 -0
- package/templates/vue/micro-frontends/qiankun/features/manualRoutes/node_modules/.bin/jiti.ps1 +41 -0
- package/templates/vue/micro-frontends/qiankun/features/manualRoutes/node_modules/.bin/sass +17 -0
- package/templates/vue/micro-frontends/qiankun/features/manualRoutes/node_modules/.bin/sass.CMD +12 -0
- package/templates/vue/micro-frontends/qiankun/features/manualRoutes/node_modules/.bin/sass.ps1 +41 -0
- package/templates/vue/micro-frontends/qiankun/features/manualRoutes/node_modules/.bin/terser +17 -0
- package/templates/vue/micro-frontends/qiankun/features/manualRoutes/node_modules/.bin/terser.CMD +12 -0
- package/templates/vue/micro-frontends/qiankun/features/manualRoutes/node_modules/.bin/terser.ps1 +41 -0
- package/templates/vue/micro-frontends/qiankun/features/manualRoutes/node_modules/.bin/tsc +17 -0
- package/templates/vue/micro-frontends/qiankun/features/manualRoutes/node_modules/.bin/tsc.CMD +12 -0
- package/templates/vue/micro-frontends/qiankun/features/manualRoutes/node_modules/.bin/tsc.ps1 +41 -0
- package/templates/vue/micro-frontends/qiankun/features/manualRoutes/node_modules/.bin/tsserver +17 -0
- package/templates/vue/micro-frontends/qiankun/features/manualRoutes/node_modules/.bin/tsserver.CMD +12 -0
- package/templates/vue/micro-frontends/qiankun/features/manualRoutes/node_modules/.bin/tsserver.ps1 +41 -0
- package/templates/vue/micro-frontends/qiankun/features/manualRoutes/node_modules/.bin/tsx +17 -0
- package/templates/vue/micro-frontends/qiankun/features/manualRoutes/node_modules/.bin/tsx.CMD +12 -0
- package/templates/vue/micro-frontends/qiankun/features/manualRoutes/node_modules/.bin/tsx.ps1 +41 -0
- package/templates/vue/micro-frontends/qiankun/features/manualRoutes/node_modules/.bin/vite +17 -0
- package/templates/vue/micro-frontends/qiankun/features/manualRoutes/node_modules/.bin/vite.CMD +12 -0
- package/templates/vue/micro-frontends/qiankun/features/manualRoutes/node_modules/.bin/vite.ps1 +41 -0
- package/templates/vue/micro-frontends/qiankun/features/manualRoutes/node_modules/.bin/yaml +17 -0
- package/templates/vue/micro-frontends/qiankun/features/manualRoutes/node_modules/.bin/yaml.CMD +12 -0
- package/templates/vue/micro-frontends/qiankun/features/manualRoutes/node_modules/.bin/yaml.ps1 +41 -0
- package/templates/vue/micro-frontends/qiankun/features/manualRoutes/package.json +5 -0
- package/templates/vue/micro-frontends/qiankun/features/manualRoutes/src/router/index.ts +56 -0
- package/templates/vue/micro-frontends/qiankun/features/pageRoutes/node_modules/.bin/jiti +17 -0
- package/templates/vue/micro-frontends/qiankun/features/pageRoutes/node_modules/.bin/jiti.CMD +12 -0
- package/templates/vue/micro-frontends/qiankun/features/pageRoutes/node_modules/.bin/jiti.ps1 +41 -0
- package/templates/vue/micro-frontends/qiankun/features/pageRoutes/node_modules/.bin/sass +17 -0
- package/templates/vue/micro-frontends/qiankun/features/pageRoutes/node_modules/.bin/sass.CMD +12 -0
- package/templates/vue/micro-frontends/qiankun/features/pageRoutes/node_modules/.bin/sass.ps1 +41 -0
- package/templates/vue/micro-frontends/qiankun/features/pageRoutes/node_modules/.bin/terser +17 -0
- package/templates/vue/micro-frontends/qiankun/features/pageRoutes/node_modules/.bin/terser.CMD +12 -0
- package/templates/vue/micro-frontends/qiankun/features/pageRoutes/node_modules/.bin/terser.ps1 +41 -0
- package/templates/vue/micro-frontends/qiankun/features/pageRoutes/node_modules/.bin/tsc +17 -0
- package/templates/vue/micro-frontends/qiankun/features/pageRoutes/node_modules/.bin/tsc.CMD +12 -0
- package/templates/vue/micro-frontends/qiankun/features/pageRoutes/node_modules/.bin/tsc.ps1 +41 -0
- package/templates/vue/micro-frontends/qiankun/features/pageRoutes/node_modules/.bin/tsserver +17 -0
- package/templates/vue/micro-frontends/qiankun/features/pageRoutes/node_modules/.bin/tsserver.CMD +12 -0
- package/templates/vue/micro-frontends/qiankun/features/pageRoutes/node_modules/.bin/tsserver.ps1 +41 -0
- package/templates/vue/micro-frontends/qiankun/features/pageRoutes/node_modules/.bin/tsx +17 -0
- package/templates/vue/micro-frontends/qiankun/features/pageRoutes/node_modules/.bin/tsx.CMD +12 -0
- package/templates/vue/micro-frontends/qiankun/features/pageRoutes/node_modules/.bin/tsx.ps1 +41 -0
- package/templates/vue/micro-frontends/qiankun/features/pageRoutes/node_modules/.bin/vite +17 -0
- package/templates/vue/micro-frontends/qiankun/features/pageRoutes/node_modules/.bin/vite.CMD +12 -0
- package/templates/vue/micro-frontends/qiankun/features/pageRoutes/node_modules/.bin/vite.ps1 +41 -0
- package/templates/vue/micro-frontends/qiankun/features/pageRoutes/node_modules/.bin/yaml +17 -0
- package/templates/vue/micro-frontends/qiankun/features/pageRoutes/node_modules/.bin/yaml.CMD +12 -0
- package/templates/vue/micro-frontends/qiankun/features/pageRoutes/node_modules/.bin/yaml.ps1 +41 -0
- package/templates/vue/micro-frontends/qiankun/features/pageRoutes/package.json +5 -0
- package/templates/vue/micro-frontends/qiankun/features/pageRoutes/src/router/index.ts +57 -0
- package/templates/react/base/src/qiankun/index.ts +0 -83
- package/templates/react/base/src/stores/user.ts +0 -55
- package/templates/vue/base/src/router/layout.vue +0 -15
- package/templates/vue/features/manualRoutes/src/stores/index.ts +0 -6
- package/templates/vue/features/manualRoutes/src/stores/modules/system.ts +0 -51
- package/templates/vue/features/manualRoutes/src/stores/modules/user.ts +0 -41
- package/templates/vue/features/pageRoutes/src/stores/index.ts +0 -6
- package/templates/vue/features/pageRoutes/src/stores/modules/system.ts +0 -51
- package/templates/vue/features/pageRoutes/src/stores/modules/user.ts +0 -41
- /package/templates/react/features/{router → manualRoutes}/package.json +0 -0
- /package/templates/react/{base → features/zustand}/src/stores/index.ts +0 -0
- /package/templates/vue/{base → features/pinia}/src/stores/index.ts +0 -0
- /package/templates/vue/{base → features/pinia}/src/stores/modules/system.ts +0 -0
- /package/templates/vue/{base → features/pinia}/src/stores/modules/user.ts +0 -0
package/templates/vue/micro-frontends/qiankun/features/pageRoutes/node_modules/.bin/terser.ps1
ADDED
|
@@ -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\terser@5.44.1\node_modules\terser\bin\node_modules;E:\project\template\vite-cli\node_modules\.pnpm\terser@5.44.1\node_modules\terser\node_modules;E:\project\template\vite-cli\node_modules\.pnpm\terser@5.44.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/terser@5.44.1/node_modules/terser/bin/node_modules:/mnt/e/project/template/vite-cli/node_modules/.pnpm/terser@5.44.1/node_modules/terser/node_modules:/mnt/e/project/template/vite-cli/node_modules/.pnpm/terser@5.44.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/terser@5.44.1/node_modules/terser/bin/terser" $args
|
|
27
|
+
} else {
|
|
28
|
+
& "$basedir/node$exe" "$basedir/../../../../../../../../node_modules/.pnpm/terser@5.44.1/node_modules/terser/bin/terser" $args
|
|
29
|
+
}
|
|
30
|
+
$ret=$LASTEXITCODE
|
|
31
|
+
} else {
|
|
32
|
+
# Support pipeline input
|
|
33
|
+
if ($MyInvocation.ExpectingInput) {
|
|
34
|
+
$input | & "node$exe" "$basedir/../../../../../../../../node_modules/.pnpm/terser@5.44.1/node_modules/terser/bin/terser" $args
|
|
35
|
+
} else {
|
|
36
|
+
& "node$exe" "$basedir/../../../../../../../../node_modules/.pnpm/terser@5.44.1/node_modules/terser/bin/terser" $args
|
|
37
|
+
}
|
|
38
|
+
$ret=$LASTEXITCODE
|
|
39
|
+
}
|
|
40
|
+
$env:NODE_PATH=$env_node_path
|
|
41
|
+
exit $ret
|
|
@@ -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/typescript@5.8.3/node_modules/typescript/bin/node_modules:/mnt/e/project/template/vite-cli/node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/node_modules:/mnt/e/project/template/vite-cli/node_modules/.pnpm/typescript@5.8.3/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/typescript@5.8.3/node_modules/typescript/bin/node_modules:/mnt/e/project/template/vite-cli/node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/node_modules:/mnt/e/project/template/vite-cli/node_modules/.pnpm/typescript@5.8.3/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/typescript@5.8.3/node_modules/typescript/bin/tsc" "$@"
|
|
15
|
+
else
|
|
16
|
+
exec node "$basedir/../../../../../../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/bin/tsc" "$@"
|
|
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\typescript@5.8.3\node_modules\typescript\bin\node_modules;E:\project\template\vite-cli\node_modules\.pnpm\typescript@5.8.3\node_modules\typescript\node_modules;E:\project\template\vite-cli\node_modules\.pnpm\typescript@5.8.3\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\typescript@5.8.3\node_modules\typescript\bin\node_modules;E:\project\template\vite-cli\node_modules\.pnpm\typescript@5.8.3\node_modules\typescript\node_modules;E:\project\template\vite-cli\node_modules\.pnpm\typescript@5.8.3\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\typescript@5.8.3\node_modules\typescript\bin\tsc" %*
|
|
9
|
+
) ELSE (
|
|
10
|
+
@SET PATHEXT=%PATHEXT:;.JS;=;%
|
|
11
|
+
node "%~dp0\..\..\..\..\..\..\..\..\node_modules\.pnpm\typescript@5.8.3\node_modules\typescript\bin\tsc" %*
|
|
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\typescript@5.8.3\node_modules\typescript\bin\node_modules;E:\project\template\vite-cli\node_modules\.pnpm\typescript@5.8.3\node_modules\typescript\node_modules;E:\project\template\vite-cli\node_modules\.pnpm\typescript@5.8.3\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/typescript@5.8.3/node_modules/typescript/bin/node_modules:/mnt/e/project/template/vite-cli/node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/node_modules:/mnt/e/project/template/vite-cli/node_modules/.pnpm/typescript@5.8.3/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/typescript@5.8.3/node_modules/typescript/bin/tsc" $args
|
|
27
|
+
} else {
|
|
28
|
+
& "$basedir/node$exe" "$basedir/../../../../../../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/bin/tsc" $args
|
|
29
|
+
}
|
|
30
|
+
$ret=$LASTEXITCODE
|
|
31
|
+
} else {
|
|
32
|
+
# Support pipeline input
|
|
33
|
+
if ($MyInvocation.ExpectingInput) {
|
|
34
|
+
$input | & "node$exe" "$basedir/../../../../../../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/bin/tsc" $args
|
|
35
|
+
} else {
|
|
36
|
+
& "node$exe" "$basedir/../../../../../../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/bin/tsc" $args
|
|
37
|
+
}
|
|
38
|
+
$ret=$LASTEXITCODE
|
|
39
|
+
}
|
|
40
|
+
$env:NODE_PATH=$env_node_path
|
|
41
|
+
exit $ret
|
|
@@ -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/typescript@5.8.3/node_modules/typescript/bin/node_modules:/mnt/e/project/template/vite-cli/node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/node_modules:/mnt/e/project/template/vite-cli/node_modules/.pnpm/typescript@5.8.3/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/typescript@5.8.3/node_modules/typescript/bin/node_modules:/mnt/e/project/template/vite-cli/node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/node_modules:/mnt/e/project/template/vite-cli/node_modules/.pnpm/typescript@5.8.3/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/typescript@5.8.3/node_modules/typescript/bin/tsserver" "$@"
|
|
15
|
+
else
|
|
16
|
+
exec node "$basedir/../../../../../../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/bin/tsserver" "$@"
|
|
17
|
+
fi
|
package/templates/vue/micro-frontends/qiankun/features/pageRoutes/node_modules/.bin/tsserver.CMD
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
@SETLOCAL
|
|
2
|
+
@IF NOT DEFINED NODE_PATH (
|
|
3
|
+
@SET "NODE_PATH=E:\project\template\vite-cli\node_modules\.pnpm\typescript@5.8.3\node_modules\typescript\bin\node_modules;E:\project\template\vite-cli\node_modules\.pnpm\typescript@5.8.3\node_modules\typescript\node_modules;E:\project\template\vite-cli\node_modules\.pnpm\typescript@5.8.3\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\typescript@5.8.3\node_modules\typescript\bin\node_modules;E:\project\template\vite-cli\node_modules\.pnpm\typescript@5.8.3\node_modules\typescript\node_modules;E:\project\template\vite-cli\node_modules\.pnpm\typescript@5.8.3\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\typescript@5.8.3\node_modules\typescript\bin\tsserver" %*
|
|
9
|
+
) ELSE (
|
|
10
|
+
@SET PATHEXT=%PATHEXT:;.JS;=;%
|
|
11
|
+
node "%~dp0\..\..\..\..\..\..\..\..\node_modules\.pnpm\typescript@5.8.3\node_modules\typescript\bin\tsserver" %*
|
|
12
|
+
)
|
package/templates/vue/micro-frontends/qiankun/features/pageRoutes/node_modules/.bin/tsserver.ps1
ADDED
|
@@ -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\typescript@5.8.3\node_modules\typescript\bin\node_modules;E:\project\template\vite-cli\node_modules\.pnpm\typescript@5.8.3\node_modules\typescript\node_modules;E:\project\template\vite-cli\node_modules\.pnpm\typescript@5.8.3\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/typescript@5.8.3/node_modules/typescript/bin/node_modules:/mnt/e/project/template/vite-cli/node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/node_modules:/mnt/e/project/template/vite-cli/node_modules/.pnpm/typescript@5.8.3/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/typescript@5.8.3/node_modules/typescript/bin/tsserver" $args
|
|
27
|
+
} else {
|
|
28
|
+
& "$basedir/node$exe" "$basedir/../../../../../../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/bin/tsserver" $args
|
|
29
|
+
}
|
|
30
|
+
$ret=$LASTEXITCODE
|
|
31
|
+
} else {
|
|
32
|
+
# Support pipeline input
|
|
33
|
+
if ($MyInvocation.ExpectingInput) {
|
|
34
|
+
$input | & "node$exe" "$basedir/../../../../../../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/bin/tsserver" $args
|
|
35
|
+
} else {
|
|
36
|
+
& "node$exe" "$basedir/../../../../../../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/bin/tsserver" $args
|
|
37
|
+
}
|
|
38
|
+
$ret=$LASTEXITCODE
|
|
39
|
+
}
|
|
40
|
+
$env:NODE_PATH=$env_node_path
|
|
41
|
+
exit $ret
|
|
@@ -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/tsx@4.21.0/node_modules/tsx/dist/node_modules:/mnt/e/project/template/vite-cli/node_modules/.pnpm/tsx@4.21.0/node_modules/tsx/node_modules:/mnt/e/project/template/vite-cli/node_modules/.pnpm/tsx@4.21.0/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/tsx@4.21.0/node_modules/tsx/dist/node_modules:/mnt/e/project/template/vite-cli/node_modules/.pnpm/tsx@4.21.0/node_modules/tsx/node_modules:/mnt/e/project/template/vite-cli/node_modules/.pnpm/tsx@4.21.0/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/tsx@4.21.0/node_modules/tsx/dist/cli.mjs" "$@"
|
|
15
|
+
else
|
|
16
|
+
exec node "$basedir/../../../../../../../../node_modules/.pnpm/tsx@4.21.0/node_modules/tsx/dist/cli.mjs" "$@"
|
|
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\tsx@4.21.0\node_modules\tsx\dist\node_modules;E:\project\template\vite-cli\node_modules\.pnpm\tsx@4.21.0\node_modules\tsx\node_modules;E:\project\template\vite-cli\node_modules\.pnpm\tsx@4.21.0\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\tsx@4.21.0\node_modules\tsx\dist\node_modules;E:\project\template\vite-cli\node_modules\.pnpm\tsx@4.21.0\node_modules\tsx\node_modules;E:\project\template\vite-cli\node_modules\.pnpm\tsx@4.21.0\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\tsx@4.21.0\node_modules\tsx\dist\cli.mjs" %*
|
|
9
|
+
) ELSE (
|
|
10
|
+
@SET PATHEXT=%PATHEXT:;.JS;=;%
|
|
11
|
+
node "%~dp0\..\..\..\..\..\..\..\..\node_modules\.pnpm\tsx@4.21.0\node_modules\tsx\dist\cli.mjs" %*
|
|
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\tsx@4.21.0\node_modules\tsx\dist\node_modules;E:\project\template\vite-cli\node_modules\.pnpm\tsx@4.21.0\node_modules\tsx\node_modules;E:\project\template\vite-cli\node_modules\.pnpm\tsx@4.21.0\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/tsx@4.21.0/node_modules/tsx/dist/node_modules:/mnt/e/project/template/vite-cli/node_modules/.pnpm/tsx@4.21.0/node_modules/tsx/node_modules:/mnt/e/project/template/vite-cli/node_modules/.pnpm/tsx@4.21.0/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/tsx@4.21.0/node_modules/tsx/dist/cli.mjs" $args
|
|
27
|
+
} else {
|
|
28
|
+
& "$basedir/node$exe" "$basedir/../../../../../../../../node_modules/.pnpm/tsx@4.21.0/node_modules/tsx/dist/cli.mjs" $args
|
|
29
|
+
}
|
|
30
|
+
$ret=$LASTEXITCODE
|
|
31
|
+
} else {
|
|
32
|
+
# Support pipeline input
|
|
33
|
+
if ($MyInvocation.ExpectingInput) {
|
|
34
|
+
$input | & "node$exe" "$basedir/../../../../../../../../node_modules/.pnpm/tsx@4.21.0/node_modules/tsx/dist/cli.mjs" $args
|
|
35
|
+
} else {
|
|
36
|
+
& "node$exe" "$basedir/../../../../../../../../node_modules/.pnpm/tsx@4.21.0/node_modules/tsx/dist/cli.mjs" $args
|
|
37
|
+
}
|
|
38
|
+
$ret=$LASTEXITCODE
|
|
39
|
+
}
|
|
40
|
+
$env:NODE_PATH=$env_node_path
|
|
41
|
+
exit $ret
|
|
@@ -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/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"
|
|
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"
|
|
12
|
+
fi
|
|
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" "$@"
|
|
15
|
+
else
|
|
16
|
+
exec node "$basedir/../../../../../../../../node_modules/.pnpm/vite@7.3.0_@types+node@22.1_7c06d9c6f7b7316383c1af6ed786169b/node_modules/vite/bin/vite.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\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"
|
|
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%"
|
|
6
|
+
)
|
|
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" %*
|
|
9
|
+
) ELSE (
|
|
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" %*
|
|
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\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"
|
|
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/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"
|
|
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/vite@7.3.0_@types+node@22.1_7c06d9c6f7b7316383c1af6ed786169b/node_modules/vite/bin/vite.js" $args
|
|
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
|
|
29
|
+
}
|
|
30
|
+
$ret=$LASTEXITCODE
|
|
31
|
+
} else {
|
|
32
|
+
# Support pipeline input
|
|
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
|
|
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
|
|
37
|
+
}
|
|
38
|
+
$ret=$LASTEXITCODE
|
|
39
|
+
}
|
|
40
|
+
$env:NODE_PATH=$env_node_path
|
|
41
|
+
exit $ret
|
|
@@ -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/yaml@2.8.2/node_modules/yaml/node_modules:/mnt/e/project/template/vite-cli/node_modules/.pnpm/yaml@2.8.2/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/yaml@2.8.2/node_modules/yaml/node_modules:/mnt/e/project/template/vite-cli/node_modules/.pnpm/yaml@2.8.2/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/yaml@2.8.2/node_modules/yaml/bin.mjs" "$@"
|
|
15
|
+
else
|
|
16
|
+
exec node "$basedir/../../../../../../../../node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/bin.mjs" "$@"
|
|
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\yaml@2.8.2\node_modules\yaml\node_modules;E:\project\template\vite-cli\node_modules\.pnpm\yaml@2.8.2\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\yaml@2.8.2\node_modules\yaml\node_modules;E:\project\template\vite-cli\node_modules\.pnpm\yaml@2.8.2\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\yaml@2.8.2\node_modules\yaml\bin.mjs" %*
|
|
9
|
+
) ELSE (
|
|
10
|
+
@SET PATHEXT=%PATHEXT:;.JS;=;%
|
|
11
|
+
node "%~dp0\..\..\..\..\..\..\..\..\node_modules\.pnpm\yaml@2.8.2\node_modules\yaml\bin.mjs" %*
|
|
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\yaml@2.8.2\node_modules\yaml\node_modules;E:\project\template\vite-cli\node_modules\.pnpm\yaml@2.8.2\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/yaml@2.8.2/node_modules/yaml/node_modules:/mnt/e/project/template/vite-cli/node_modules/.pnpm/yaml@2.8.2/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/yaml@2.8.2/node_modules/yaml/bin.mjs" $args
|
|
27
|
+
} else {
|
|
28
|
+
& "$basedir/node$exe" "$basedir/../../../../../../../../node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/bin.mjs" $args
|
|
29
|
+
}
|
|
30
|
+
$ret=$LASTEXITCODE
|
|
31
|
+
} else {
|
|
32
|
+
# Support pipeline input
|
|
33
|
+
if ($MyInvocation.ExpectingInput) {
|
|
34
|
+
$input | & "node$exe" "$basedir/../../../../../../../../node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/bin.mjs" $args
|
|
35
|
+
} else {
|
|
36
|
+
& "node$exe" "$basedir/../../../../../../../../node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/bin.mjs" $args
|
|
37
|
+
}
|
|
38
|
+
$ret=$LASTEXITCODE
|
|
39
|
+
}
|
|
40
|
+
$env:NODE_PATH=$env_node_path
|
|
41
|
+
exit $ret
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { cloneDeep } from 'lodash-es'
|
|
2
|
+
import { assign, isEmpty } from 'radash'
|
|
3
|
+
import routes from '~pages'
|
|
4
|
+
import { qiankunWindow } from 'vite-plugin-qiankun/dist/helper'
|
|
5
|
+
import { createRouter, createWebHistory } from 'vue-router'
|
|
6
|
+
|
|
7
|
+
// 自动生成的路由
|
|
8
|
+
const routesChildrens = routes
|
|
9
|
+
const Routes = [
|
|
10
|
+
{
|
|
11
|
+
path: '/',
|
|
12
|
+
name: 'layout',
|
|
13
|
+
component: () => import('@/router/layout.vue' as string),
|
|
14
|
+
redirect: routes[0]?.path,
|
|
15
|
+
children: routesChildrens,
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
path: '/:pathMatch(.*)*',
|
|
19
|
+
redirect: '/',
|
|
20
|
+
},
|
|
21
|
+
]
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* 创建路由实例(Qiankun 微前端模式)
|
|
25
|
+
* @param props Qiankun 传递的属性
|
|
26
|
+
* @returns 路由实例
|
|
27
|
+
*/
|
|
28
|
+
function getRouter(props: any = {}) {
|
|
29
|
+
let base: string
|
|
30
|
+
const routesClone = cloneDeep(Routes)
|
|
31
|
+
|
|
32
|
+
if (qiankunWindow.__POWERED_BY_QIANKUN__) {
|
|
33
|
+
// 微前端模式:使用主应用传递的 activeRule
|
|
34
|
+
const { activeRule } = props.data || {}
|
|
35
|
+
base = activeRule || import.meta.env.VITE_APP_CODE
|
|
36
|
+
}
|
|
37
|
+
else {
|
|
38
|
+
// 独立运行模式
|
|
39
|
+
base = import.meta.env.VITE_APP_CODE
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
const router = createRouter({
|
|
43
|
+
history: createWebHistory(base),
|
|
44
|
+
routes: routesClone,
|
|
45
|
+
})
|
|
46
|
+
|
|
47
|
+
router.beforeEach((_, from, next) => {
|
|
48
|
+
if (isEmpty(history.state.current)) {
|
|
49
|
+
assign(history.state, { current: from.fullPath })
|
|
50
|
+
}
|
|
51
|
+
next()
|
|
52
|
+
})
|
|
53
|
+
|
|
54
|
+
return router
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
export default getRouter
|
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Qiankun 微前端配置
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
import type { ReactNode } from 'react'
|
|
6
|
-
import type { Router } from '@remix-run/router'
|
|
7
|
-
import {
|
|
8
|
-
qiankunWindow,
|
|
9
|
-
renderWithQiankun,
|
|
10
|
-
} from 'vite-plugin-qiankun/dist/helper'
|
|
11
|
-
|
|
12
|
-
let root: ReturnType<typeof import('react-dom/client').createRoot> | null = null
|
|
13
|
-
let router: Router | null = null
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
* Qiankun 微前端 Props 接口
|
|
17
|
-
*/
|
|
18
|
-
interface QiankunProps {
|
|
19
|
-
/** 容器元素(可选) */
|
|
20
|
-
container?: Element
|
|
21
|
-
/** 其他自定义属性 */
|
|
22
|
-
[key: string]: unknown
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
/**
|
|
26
|
-
* Qiankun 渲染选项接口
|
|
27
|
-
*/
|
|
28
|
-
interface RenderOptions {
|
|
29
|
-
/** 创建 React 根节点的函数 */
|
|
30
|
-
createRoot: (container: Element | DocumentFragment) => ReturnType<typeof import('react-dom/client').createRoot>
|
|
31
|
-
/** 创建 React Router 实例的函数 */
|
|
32
|
-
createRouter: (basename?: string) => Router
|
|
33
|
-
/** 创建应用组件的函数 */
|
|
34
|
-
createApp: (router: Router) => ReactNode
|
|
35
|
-
/** 容器选择器或元素 */
|
|
36
|
-
container?: string | Element
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
/**
|
|
40
|
-
* 设置 Qiankun 微前端
|
|
41
|
-
* @param options 渲染选项
|
|
42
|
-
*/
|
|
43
|
-
export function setupQiankun(options: RenderOptions): void {
|
|
44
|
-
const { createRoot, createRouter, createApp, container = '#root' } = options
|
|
45
|
-
|
|
46
|
-
renderWithQiankun({
|
|
47
|
-
mount(props: QiankunProps) {
|
|
48
|
-
const containerElement = props.container
|
|
49
|
-
? props.container.querySelector('#root') || props.container
|
|
50
|
-
: typeof container === 'string'
|
|
51
|
-
? document.querySelector(container)!
|
|
52
|
-
: container
|
|
53
|
-
|
|
54
|
-
root = createRoot(containerElement)
|
|
55
|
-
const basename = qiankunWindow.__POWERED_BY_QIANKUN__
|
|
56
|
-
? (qiankunWindow as { __INJECTED_PUBLIC_PATH_BY_QIANKUN__?: string }).__INJECTED_PUBLIC_PATH_BY_QIANKUN__?.split('/')[1]
|
|
57
|
-
: undefined
|
|
58
|
-
router = createRouter(basename)
|
|
59
|
-
root.render(createApp(router))
|
|
60
|
-
},
|
|
61
|
-
bootstrap() {
|
|
62
|
-
console.log('[Qiankun] bootstrap')
|
|
63
|
-
},
|
|
64
|
-
unmount() {
|
|
65
|
-
if (root) {
|
|
66
|
-
root.unmount()
|
|
67
|
-
root = null
|
|
68
|
-
router = null
|
|
69
|
-
}
|
|
70
|
-
},
|
|
71
|
-
update() {
|
|
72
|
-
console.log('[Qiankun] update')
|
|
73
|
-
},
|
|
74
|
-
})
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
/**
|
|
78
|
-
* 判断是否运行在 Qiankun 微前端环境中
|
|
79
|
-
* @returns 是否在 Qiankun 环境中
|
|
80
|
-
*/
|
|
81
|
-
export function isQiankun(): boolean {
|
|
82
|
-
return qiankunWindow.__POWERED_BY_QIANKUN__ || false
|
|
83
|
-
}
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* 用户状态管理
|
|
3
|
-
* 基于 Zustand
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
|
-
import { create } from 'zustand'
|
|
7
|
-
import { persist } from 'zustand/middleware'
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* 用户信息接口
|
|
11
|
-
*/
|
|
12
|
-
interface UserInfo {
|
|
13
|
-
/** 用户 ID */
|
|
14
|
-
id: string
|
|
15
|
-
/** 用户名 */
|
|
16
|
-
username: string
|
|
17
|
-
/** 邮箱 */
|
|
18
|
-
email: string
|
|
19
|
-
/** 头像 URL(可选) */
|
|
20
|
-
avatar?: string
|
|
21
|
-
/** 角色列表 */
|
|
22
|
-
roles: string[]
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
/**
|
|
26
|
-
* 用户状态接口
|
|
27
|
-
*/
|
|
28
|
-
interface UserState {
|
|
29
|
-
/** 用户信息 */
|
|
30
|
-
userInfo: UserInfo | null
|
|
31
|
-
/** 认证 token */
|
|
32
|
-
token: string
|
|
33
|
-
/** 设置用户信息 */
|
|
34
|
-
setUserInfo: (info: UserInfo | null) => void
|
|
35
|
-
/** 设置 token */
|
|
36
|
-
setToken: (token: string) => void
|
|
37
|
-
/** 清除用户信息 */
|
|
38
|
-
clearUser: () => void
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
export const useUserStore = create<UserState>()(
|
|
42
|
-
persist(
|
|
43
|
-
set => ({
|
|
44
|
-
userInfo: null,
|
|
45
|
-
token: '',
|
|
46
|
-
setUserInfo: info => set({ userInfo: info }),
|
|
47
|
-
setToken: token => set({ token }),
|
|
48
|
-
clearUser: () => set({ userInfo: null, token: '' }),
|
|
49
|
-
}),
|
|
50
|
-
{
|
|
51
|
-
name: 'user-storage',
|
|
52
|
-
partialize: state => ({ token: state.token }),
|
|
53
|
-
},
|
|
54
|
-
),
|
|
55
|
-
)
|
|
@@ -1,15 +0,0 @@
|
|
|
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>
|