@kmlckj/licos-ai-cli 0.0.35 → 0.0.36
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/lib/__templates__/nuxt-vue/nuxt.config.ts +4 -2
- package/lib/__templates__/nuxt-vue/scripts/build.sh +3 -2
- package/lib/__templates__/nuxt-vue/scripts/start.sh +3 -2
- package/lib/__templates__/vite/server/server.ts +1 -1
- package/lib/__templates__/vite/tsconfig.json +1 -1
- package/lib/cli.js +1 -1
- package/package.json +1 -1
|
@@ -21,6 +21,7 @@ const deployBaseURL = process.env.NUXT_PUBLIC_BASE_URL || process.env.BASE_PATH;
|
|
|
21
21
|
const shouldUseBaseURL = Boolean(deployBaseURL) || isProd;
|
|
22
22
|
|
|
23
23
|
const publicBaseURL = shouldUseBaseURL ? normalizeBaseURL(deployBaseURL) : '/';
|
|
24
|
+
const publicAssetCdnURL = publicBaseURL === '/' ? '' : publicBaseURL.replace(/\/$/, '');
|
|
24
25
|
|
|
25
26
|
export default defineNuxtConfig({
|
|
26
27
|
compatibilityDate: '2025-07-15',
|
|
@@ -33,9 +34,10 @@ export default defineNuxtConfig({
|
|
|
33
34
|
// App head configuration
|
|
34
35
|
app: {
|
|
35
36
|
// The cluster ingress rewrites /p/{projectId}/... to backend /...
|
|
36
|
-
// Keep Nuxt's server
|
|
37
|
+
// Keep Nuxt's server asset route at /_nuxt and prefix browser URLs via cdnURL.
|
|
37
38
|
baseURL: '/',
|
|
38
|
-
buildAssetsDir:
|
|
39
|
+
buildAssetsDir: '/_nuxt/',
|
|
40
|
+
cdnURL: publicAssetCdnURL,
|
|
39
41
|
head: {
|
|
40
42
|
title: '新应用 | LICOS AI',
|
|
41
43
|
titleTemplate: '%s | LICOS AI',
|
|
@@ -15,10 +15,11 @@ if [ "${BASE_URL}" != "/" ]; then
|
|
|
15
15
|
fi
|
|
16
16
|
export NUXT_PUBLIC_BASE_URL="${BASE_URL}"
|
|
17
17
|
if [ "${BASE_URL}" = "/" ]; then
|
|
18
|
-
export
|
|
18
|
+
export NUXT_APP_CDN_URL=""
|
|
19
19
|
else
|
|
20
|
-
export
|
|
20
|
+
export NUXT_APP_CDN_URL="${BASE_URL%/}"
|
|
21
21
|
fi
|
|
22
|
+
export NUXT_APP_BUILD_ASSETS_DIR="/_nuxt/"
|
|
22
23
|
pnpm nuxt build
|
|
23
24
|
|
|
24
25
|
echo "Build completed successfully!"
|
|
@@ -20,10 +20,11 @@ start_service() {
|
|
|
20
20
|
fi
|
|
21
21
|
export NUXT_PUBLIC_BASE_URL="${BASE_URL}"
|
|
22
22
|
if [ "${BASE_URL}" = "/" ]; then
|
|
23
|
-
export
|
|
23
|
+
export NUXT_APP_CDN_URL=""
|
|
24
24
|
else
|
|
25
|
-
export
|
|
25
|
+
export NUXT_APP_CDN_URL="${BASE_URL%/}"
|
|
26
26
|
fi
|
|
27
|
+
export NUXT_APP_BUILD_ASSETS_DIR="/_nuxt/"
|
|
27
28
|
HOST=0.0.0.0 PORT=${DEPLOY_RUN_PORT} node .output/server/index.mjs
|
|
28
29
|
}
|
|
29
30
|
|
|
@@ -42,7 +42,7 @@ async function startServer(): Promise<Server> {
|
|
|
42
42
|
await setupVite(app);
|
|
43
43
|
|
|
44
44
|
// 全局错误处理
|
|
45
|
-
app.use((err: Error,
|
|
45
|
+
app.use((err: Error, _req: express.Request, res: express.Response, _next: express.NextFunction) => {
|
|
46
46
|
console.error('Server error:', err);
|
|
47
47
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
48
48
|
const status = 'status' in err ? (err as any).status || 500 : 500;
|
package/lib/cli.js
CHANGED
|
@@ -2109,7 +2109,7 @@ const EventBuilder = {
|
|
|
2109
2109
|
};
|
|
2110
2110
|
|
|
2111
2111
|
var name = "@kmlckj/licos-ai-cli";
|
|
2112
|
-
var version = "0.0.
|
|
2112
|
+
var version = "0.0.36";
|
|
2113
2113
|
var description = "LICOS AI coding workspace CLI - project template engine and dev tools";
|
|
2114
2114
|
var license = "MIT";
|
|
2115
2115
|
var author = "kmlckj";
|