@kmlckj/licos-ai-cli 1.0.16 → 1.0.19
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__/expo/.licosproj/scripts/prod_build.sh +7 -5
- package/lib/__templates__/expo/client/app.config.ts +87 -76
- package/lib/__templates__/nextjs/next.config.ts +35 -35
- package/lib/__templates__/nextjs/src/server.ts +129 -129
- package/lib/__templates__/nuxt-vue/nuxt.config.ts +180 -152
- package/lib/__templates__/taro/config/index.ts +352 -352
- package/lib/__templates__/vite/server/server.ts +1 -1
- package/lib/__templates__/vite/server/vite.ts +11 -3
- package/lib/__templates__/vite/vite.config.ts +64 -64
- package/package.json +1 -1
|
@@ -1,152 +1,180 @@
|
|
|
1
|
-
// https://nuxt.com/docs/api/configuration/nuxt-config
|
|
2
|
-
import { fileURLToPath } from 'url';
|
|
3
|
-
import { dirname, resolve } from 'path';
|
|
4
|
-
|
|
5
|
-
const __filename = fileURLToPath(import.meta.url);
|
|
6
|
-
const __dirname = dirname(__filename);
|
|
7
|
-
|
|
8
|
-
function normalizeBaseURL(value?: string): string {
|
|
9
|
-
const trimmed = value?.trim();
|
|
10
|
-
if (!trimmed || trimmed === '/') return '/';
|
|
11
|
-
return `/${trimmed.replace(/^\/+|\/+$/g, '')}/`;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
function
|
|
15
|
-
const
|
|
16
|
-
return
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
const
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
1
|
+
// https://nuxt.com/docs/api/configuration/nuxt-config
|
|
2
|
+
import { fileURLToPath } from 'url';
|
|
3
|
+
import { dirname, resolve } from 'path';
|
|
4
|
+
|
|
5
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
6
|
+
const __dirname = dirname(__filename);
|
|
7
|
+
|
|
8
|
+
function normalizeBaseURL(value?: string): string {
|
|
9
|
+
const trimmed = value?.trim();
|
|
10
|
+
if (!trimmed || trimmed === '/') return '/';
|
|
11
|
+
return `/${trimmed.replace(/^\/+|\/+$/g, '')}/`;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
function parsePort(value?: string): number | undefined {
|
|
15
|
+
const port = Number.parseInt(value || '', 10);
|
|
16
|
+
return Number.isInteger(port) && port > 0 ? port : undefined;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
function createPreviewHmrConfig() {
|
|
20
|
+
if (!process.env.LICOS_PREVIEW_BASE_PATH) {
|
|
21
|
+
return undefined;
|
|
22
|
+
}
|
|
23
|
+
const hmr: Record<string, unknown> = {
|
|
24
|
+
overlay: true,
|
|
25
|
+
path: process.env.LICOS_PREVIEW_HMR_PATH || '/hot/vite-hmr',
|
|
26
|
+
timeout: 30000,
|
|
27
|
+
};
|
|
28
|
+
if (process.env.LICOS_PREVIEW_HMR_HOST) {
|
|
29
|
+
hmr.host = process.env.LICOS_PREVIEW_HMR_HOST;
|
|
30
|
+
}
|
|
31
|
+
if (process.env.LICOS_PREVIEW_HMR_PROTOCOL) {
|
|
32
|
+
hmr.protocol = process.env.LICOS_PREVIEW_HMR_PROTOCOL;
|
|
33
|
+
}
|
|
34
|
+
const clientPort = parsePort(process.env.LICOS_PREVIEW_HMR_CLIENT_PORT);
|
|
35
|
+
if (clientPort) {
|
|
36
|
+
hmr.clientPort = clientPort;
|
|
37
|
+
}
|
|
38
|
+
return hmr;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
function isProdProjectEnv(value?: string): boolean {
|
|
42
|
+
const normalized = value?.trim().toLowerCase();
|
|
43
|
+
return normalized === 'prod' || normalized === 'production' || normalized === 'release';
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
const isProd = isProdProjectEnv(process.env.LICOS_PROJECT_ENV);
|
|
47
|
+
const deployBaseURL = process.env.NUXT_PUBLIC_BASE_URL || process.env.BASE_PATH;
|
|
48
|
+
const shouldUseBaseURL = Boolean(deployBaseURL) || isProd;
|
|
49
|
+
|
|
50
|
+
const publicBaseURL = shouldUseBaseURL ? normalizeBaseURL(deployBaseURL) : '/';
|
|
51
|
+
const publicAssetCdnURL = publicBaseURL === '/' ? '' : publicBaseURL.replace(/\/$/, '');
|
|
52
|
+
const previewHmrConfig = createPreviewHmrConfig();
|
|
53
|
+
|
|
54
|
+
export default defineNuxtConfig({
|
|
55
|
+
compatibilityDate: '2025-07-15',
|
|
56
|
+
// Disable devtools in CI/test environments (prevents hanging in headless mode)
|
|
57
|
+
devtools: {
|
|
58
|
+
enabled: process.env.CI !== 'true' && !isProd,
|
|
59
|
+
},
|
|
60
|
+
telemetry: false,
|
|
61
|
+
|
|
62
|
+
// App head configuration
|
|
63
|
+
app: {
|
|
64
|
+
// The cluster ingress rewrites /p/{projectId}/... to backend /...
|
|
65
|
+
// Keep Nuxt's server asset route at /_nuxt and prefix browser URLs via cdnURL.
|
|
66
|
+
baseURL: '/',
|
|
67
|
+
buildAssetsDir: '/_nuxt/',
|
|
68
|
+
cdnURL: publicAssetCdnURL,
|
|
69
|
+
head: {
|
|
70
|
+
title: '新应用 | LICOS AI',
|
|
71
|
+
titleTemplate: '%s | LICOS AI',
|
|
72
|
+
meta: [
|
|
73
|
+
{ charset: 'utf-8' },
|
|
74
|
+
{ name: 'viewport', content: 'width=device-width, initial-scale=1' },
|
|
75
|
+
{
|
|
76
|
+
name: 'description',
|
|
77
|
+
content:
|
|
78
|
+
'LICOS AI是一款一站式云端 Vibe Coding 开发平台。通过对话轻松构建智能体、工作流和网站,实现从创意到上线的无缝衔接。',
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
name: 'keywords',
|
|
82
|
+
content:
|
|
83
|
+
'LICOS AI,LICOS AI,Vibe Coding,AI 编程,智能体搭建,工作流搭建,网站搭建,网站部署,全栈开发,AI 工程师',
|
|
84
|
+
},
|
|
85
|
+
{ name: 'author', content: 'LICOS Team' },
|
|
86
|
+
{ name: 'generator', content: 'LICOS AI' },
|
|
87
|
+
// Open Graph
|
|
88
|
+
{ property: 'og:title', content: 'LICOS AI | 你的 AI 工程师已就位' },
|
|
89
|
+
{
|
|
90
|
+
property: 'og:description',
|
|
91
|
+
content:
|
|
92
|
+
'我正在使用LICOS AI Vibe Coding,让创意瞬间上线。告别拖拽,拥抱心流。',
|
|
93
|
+
},
|
|
94
|
+
{ property: 'og:url', content: 'https://licos.ai' },
|
|
95
|
+
{ property: 'og:site_name', content: 'LICOS AI' },
|
|
96
|
+
{ property: 'og:locale', content: 'zh_CN' },
|
|
97
|
+
{ property: 'og:type', content: 'website' },
|
|
98
|
+
// Robots
|
|
99
|
+
{ name: 'robots', content: 'index, follow' },
|
|
100
|
+
],
|
|
101
|
+
link: [{ rel: 'canonical', href: 'https://licos.ai' }],
|
|
102
|
+
htmlAttrs: {
|
|
103
|
+
lang: 'zh-CN',
|
|
104
|
+
},
|
|
105
|
+
},
|
|
106
|
+
},
|
|
107
|
+
|
|
108
|
+
// Nuxt modules
|
|
109
|
+
modules: ['@nuxt/image', '@nuxtjs/tailwindcss'],
|
|
110
|
+
|
|
111
|
+
// Global CSS
|
|
112
|
+
css: [resolve(__dirname, 'assets/css/main.css')],
|
|
113
|
+
|
|
114
|
+
runtimeConfig: {
|
|
115
|
+
public: {
|
|
116
|
+
baseURL: publicBaseURL,
|
|
117
|
+
},
|
|
118
|
+
},
|
|
119
|
+
|
|
120
|
+
// Development server configuration
|
|
121
|
+
devServer: {
|
|
122
|
+
port: parseInt(process.env.PORT || '<%= port %>', 10),
|
|
123
|
+
host: process.env.HOST || '0.0.0.0',
|
|
124
|
+
},
|
|
125
|
+
|
|
126
|
+
// TypeScript configuration
|
|
127
|
+
typescript: {
|
|
128
|
+
strict: false,
|
|
129
|
+
typeCheck: false,
|
|
130
|
+
},
|
|
131
|
+
|
|
132
|
+
// Vite configuration (similar to Next.js allowedDevOrigins)
|
|
133
|
+
vite: {
|
|
134
|
+
server: {
|
|
135
|
+
host: '0.0.0.0',
|
|
136
|
+
cors: {
|
|
137
|
+
origin: ['*.dev.licos.local'],
|
|
138
|
+
credentials: true,
|
|
139
|
+
},
|
|
140
|
+
hmr: previewHmrConfig || {
|
|
141
|
+
overlay: true,
|
|
142
|
+
path: '/hot/vite-hmr',
|
|
143
|
+
port: parseInt(process.env.HMR_PORT || '<%= hmrPort %>', 10),
|
|
144
|
+
clientPort: 443,
|
|
145
|
+
timeout: 30000,
|
|
146
|
+
},
|
|
147
|
+
// Fix EMFILE: too many open files error
|
|
148
|
+
// Exclude large directories from file watching to avoid exceeding system limits
|
|
149
|
+
watch: {
|
|
150
|
+
ignored: [
|
|
151
|
+
'**/node_modules/**',
|
|
152
|
+
'**/.nuxt/**',
|
|
153
|
+
'**/.output/**',
|
|
154
|
+
'**/dist/**',
|
|
155
|
+
'**/.git/**',
|
|
156
|
+
'**/coverage/**',
|
|
157
|
+
'**/.cache/**',
|
|
158
|
+
],
|
|
159
|
+
},
|
|
160
|
+
},
|
|
161
|
+
},
|
|
162
|
+
|
|
163
|
+
// Security headers (Content Security Policy)
|
|
164
|
+
nitro: {
|
|
165
|
+
publicAssets: [
|
|
166
|
+
{
|
|
167
|
+
baseURL: '/assets',
|
|
168
|
+
dir: resolve(__dirname, 'assets'),
|
|
169
|
+
},
|
|
170
|
+
],
|
|
171
|
+
routeRules: {
|
|
172
|
+
'/**': {
|
|
173
|
+
headers: {
|
|
174
|
+
'Content-Security-Policy':
|
|
175
|
+
"img-src 'self' data:;",
|
|
176
|
+
},
|
|
177
|
+
},
|
|
178
|
+
},
|
|
179
|
+
},
|
|
180
|
+
});
|