@liujitcn/kratos-taro-app-cli 0.0.80 → 0.0.82
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
CHANGED
package/src/index.mjs
CHANGED
|
@@ -94,17 +94,17 @@ function writeEnvironmentFiles(target) {
|
|
|
94
94
|
write(
|
|
95
95
|
target,
|
|
96
96
|
'.env.development',
|
|
97
|
-
'VITE_APP_BASE_API=/api\nVITE_APP_API_URL=http://
|
|
97
|
+
'VITE_APP_BASE_API=/api\nVITE_APP_API_URL=http://127.0.0.1:7001\nVITE_APP_STATIC_API=\nVITE_APP_STATIC_URL=http://127.0.0.1:7001\n',
|
|
98
98
|
)
|
|
99
99
|
write(
|
|
100
100
|
target,
|
|
101
101
|
'.env.development-h5',
|
|
102
|
-
`VITE_APP_PORT=5002\nVITE_APP_HTTPS=false\n# VITE_APP_HTTPS_KEY=../../certs/dev-key.pem\n# VITE_APP_HTTPS_CERT=../../certs/dev-cert.pem\n# ${cliMessage('https_environment_hint')}\nVITE_APP_BASE_PATH=/\nVITE_APP_BASE_API=/api\nVITE_APP_API_URL=http://
|
|
102
|
+
`VITE_APP_PORT=5002\nVITE_APP_HTTPS=false\n# VITE_APP_HTTPS_KEY=../../certs/dev-key.pem\n# VITE_APP_HTTPS_CERT=../../certs/dev-cert.pem\n# ${cliMessage('https_environment_hint')}\nVITE_APP_BASE_PATH=/\nVITE_APP_BASE_API=/api\nVITE_APP_API_URL=http://127.0.0.1:7001\nVITE_APP_STATIC_API=\nVITE_APP_STATIC_URL=http://127.0.0.1:7001\n`,
|
|
103
103
|
)
|
|
104
104
|
write(
|
|
105
105
|
target,
|
|
106
106
|
'.env.production',
|
|
107
|
-
'VITE_APP_BASE_API=/api\nVITE_APP_API_URL=http://
|
|
107
|
+
'VITE_APP_BASE_API=/api\nVITE_APP_API_URL=http://127.0.0.1:7001\nVITE_APP_STATIC_API=\nVITE_APP_STATIC_URL=http://127.0.0.1:7001\n',
|
|
108
108
|
)
|
|
109
109
|
write(
|
|
110
110
|
target,
|
|
@@ -235,6 +235,7 @@ function writeHost(target, projectName, modules, packages, options) {
|
|
|
235
235
|
'apps/taro-app/src/app.config.base.json',
|
|
236
236
|
json({
|
|
237
237
|
pages: ['pages/bootstrap/index'],
|
|
238
|
+
animation: false,
|
|
238
239
|
darkmode: true,
|
|
239
240
|
themeLocation: 'theme.json',
|
|
240
241
|
window: {
|
|
@@ -469,7 +470,7 @@ export default defineConfig<'webpack5'>(async (merge) => {
|
|
|
469
470
|
'dist/' + outputMode + '/' + (platform === 'weapp' ? 'mp-weixin' : platform || 'h5')
|
|
470
471
|
const publicPath = env.VITE_APP_BASE_PATH ?? '/'
|
|
471
472
|
const apiBasePath = env.VITE_APP_BASE_API ?? '/api'
|
|
472
|
-
const apiTargetUrl = env.VITE_APP_API_URL ?? 'http://
|
|
473
|
+
const apiTargetUrl = env.VITE_APP_API_URL ?? 'http://127.0.0.1:7001'
|
|
473
474
|
const apiProxyOptions = apiTargetUrl.startsWith('https://') ? { secure: false } : {}
|
|
474
475
|
const staticApi = env.VITE_APP_STATIC_API ?? ''
|
|
475
476
|
const staticUrl = env.VITE_APP_STATIC_URL ?? apiTargetUrl
|
|
@@ -534,8 +535,8 @@ export default defineConfig<'webpack5'>(async (merge) => {
|
|
|
534
535
|
host: '0.0.0.0',
|
|
535
536
|
https: httpsOptions,
|
|
536
537
|
proxy: {
|
|
537
|
-
[apiBasePath || '/api']: { target: apiTargetUrl || 'http://
|
|
538
|
-
'/events': { target: apiTargetUrl || 'http://
|
|
538
|
+
[apiBasePath || '/api']: { target: apiTargetUrl || 'http://127.0.0.1:7001', changeOrigin: true, ...apiProxyOptions },
|
|
539
|
+
'/events': { target: apiTargetUrl || 'http://127.0.0.1:7001', changeOrigin: true, ...apiProxyOptions },
|
|
539
540
|
},
|
|
540
541
|
},
|
|
541
542
|
output: {
|
package/src/messages.mjs
CHANGED
|
@@ -14,7 +14,7 @@ const messages = {
|
|
|
14
14
|
example_create: ' kratos-taro-app create customer-app',
|
|
15
15
|
example_modules: ' kratos-taro-app create business-app --module business,report',
|
|
16
16
|
example_package: ' kratos-taro-app create customer-app --with @acme/customer-module',
|
|
17
|
-
https_environment_hint: '后端使用 HTTPS 时,在 .env.development-h5.local 中设置 VITE_APP_API_URL=https://
|
|
17
|
+
https_environment_hint: '后端使用 HTTPS 时,在 .env.development-h5.local 中设置 VITE_APP_API_URL=https://127.0.0.1:7001。',
|
|
18
18
|
},
|
|
19
19
|
'en-US': {
|
|
20
20
|
package_version_missing: 'CLI package.json is missing a valid version',
|
|
@@ -31,7 +31,7 @@ const messages = {
|
|
|
31
31
|
example_create: ' kratos-taro-app create customer-app',
|
|
32
32
|
example_modules: ' kratos-taro-app create business-app --module business,report',
|
|
33
33
|
example_package: ' kratos-taro-app create customer-app --with @acme/customer-module',
|
|
34
|
-
https_environment_hint: 'When the backend uses HTTPS, set VITE_APP_API_URL=https://
|
|
34
|
+
https_environment_hint: 'When the backend uses HTTPS, set VITE_APP_API_URL=https://127.0.0.1:7001 in .env.development-h5.local.',
|
|
35
35
|
},
|
|
36
36
|
}
|
|
37
37
|
|
|
@@ -6,4 +6,4 @@ Development output is under `apps/taro-app/dist/dev/<platform>` and production o
|
|
|
6
6
|
|
|
7
7
|
The fixed startup page is in `src/pages/bootstrap`. The core runner temporarily generates wrappers, page configuration, and static assets for other module pages during builds, then restores the host directory.
|
|
8
8
|
|
|
9
|
-
To access H5 over a LAN IP, use the shared certificate under the repository's `certs` directory and set `VITE_APP_HTTPS=true` in `.env.development-h5.local`. If the backend uses HTTPS, also set `VITE_APP_API_URL=https://
|
|
9
|
+
To access H5 over a LAN IP, use the shared certificate under the repository's `certs` directory and set `VITE_APP_HTTPS=true` in `.env.development-h5.local`. If the backend uses HTTPS, also set `VITE_APP_API_URL=https://127.0.0.1:7001`.
|
|
@@ -32,4 +32,4 @@ The module assembly entry is `apps/taro-app/src/module-manifest.ts`. Declaration
|
|
|
32
32
|
|
|
33
33
|
Environment files are at the workspace root and use the same names as uni-app: `VITE_APP_PORT`, `VITE_APP_BASE_PATH`, `VITE_APP_BASE_API`, `VITE_APP_API_URL`, `VITE_APP_STATIC_API`, and `VITE_APP_STATIC_URL`. H5 overlays the matching `*-h5` file on the base mode file.
|
|
34
34
|
|
|
35
|
-
To access H5 over a LAN IP, run `bash scripts/generate-dev-cert.sh 192.168.1.100` from the repository root, then set `VITE_APP_HTTPS=true` in `.env.development-h5.local`. If the backend uses HTTPS, also set `VITE_APP_API_URL=https://
|
|
35
|
+
To access H5 over a LAN IP, run `bash scripts/generate-dev-cert.sh 192.168.1.100` from the repository root, then set `VITE_APP_HTTPS=true` in `.env.development-h5.local`. If the backend uses HTTPS, also set `VITE_APP_API_URL=https://127.0.0.1:7001`.
|
|
@@ -6,4 +6,4 @@
|
|
|
6
6
|
|
|
7
7
|
固定启动页位于 `src/pages/bootstrap`。其他模块页面由 core runner 在构建期间临时生成包装器、页面配置与静态资源,构建结束后会自动恢复宿主目录。
|
|
8
8
|
|
|
9
|
-
通过局域网 IP 访问 H5 时,可复用仓库根 certs 下的共享证书,并在 .env.development-h5.local 中设置 VITE_APP_HTTPS=true;后端使用 HTTPS 时同步设置 VITE_APP_API_URL=https://
|
|
9
|
+
通过局域网 IP 访问 H5 时,可复用仓库根 certs 下的共享证书,并在 .env.development-h5.local 中设置 VITE_APP_HTTPS=true;后端使用 HTTPS 时同步设置 VITE_APP_API_URL=https://127.0.0.1:7001。
|
|
@@ -32,4 +32,4 @@ pnpm tsc
|
|
|
32
32
|
|
|
33
33
|
环境文件位于 workspace 根目录,变量名与 uni-app 保持一致:`VITE_APP_PORT`、`VITE_APP_BASE_PATH`、`VITE_APP_BASE_API`、`VITE_APP_API_URL`、`VITE_APP_STATIC_API`、`VITE_APP_STATIC_URL`。H5 会在基础模式文件上叠加对应的 `*-h5` 文件。
|
|
34
34
|
|
|
35
|
-
H5 通过局域网 IP 访问时,先在仓库根目录运行 `bash scripts/generate-dev-cert.sh 192.168.1.100` 生成证书,再在 `.env.development-h5.local` 中设置 `VITE_APP_HTTPS=true`;后端使用 HTTPS 时同时设置 `VITE_APP_API_URL=https://
|
|
35
|
+
H5 通过局域网 IP 访问时,先在仓库根目录运行 `bash scripts/generate-dev-cert.sh 192.168.1.100` 生成证书,再在 `.env.development-h5.local` 中设置 `VITE_APP_HTTPS=true`;后端使用 HTTPS 时同时设置 `VITE_APP_API_URL=https://127.0.0.1:7001`。
|