ai-yuca 1.1.9 → 1.2.1

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ai-yuca",
3
- "version": "1.1.9",
3
+ "version": "1.2.1",
4
4
  "description": "一个用AI生成的开发辅助工具",
5
5
  "main": "dist/src/index.js",
6
6
  "types": "dist/src/index.d.ts",
@@ -196,7 +196,6 @@ async function updateEnvironmentConfig(env, projectName, versionInfo, config, ke
196
196
  const { data: envConfig } = await getConfigFiles(env, config, keyFile);
197
197
  // 查找或创建项目配置
198
198
  let projectConfig = envConfig.projects.find((p) => p.name === projectName);
199
- envConfig.lastVersion = versionInfo.cdnKey;
200
199
  const newProjectConfig = {
201
200
  baseUrl: versionInfo.baseUrl,
202
201
  s3Static: config.upload.s3Static,
@@ -217,6 +216,8 @@ async function updateEnvironmentConfig(env, projectName, versionInfo, config, ke
217
216
  return p;
218
217
  });
219
218
  }
219
+ envConfig.lastVersion = versionInfo.cdnKey;
220
+ envConfig.cdnVersion = versionInfo.cdnKey;
220
221
  // 上传更新后的环境配置
221
222
  const configPath = `${config.aws.prefix}/static/config/${env}.config.json`;
222
223
  const tempFile = path.join(process.cwd(), `temp-${env}-config.json`);
@@ -395,7 +396,7 @@ async function deployFiles(options) {
395
396
  const versionInfo = {
396
397
  cdnKey,
397
398
  version: cdnKey,
398
- baseUrl: Array.isArray(config.deploy.baseUrl) ? config.deploy.baseUrl[0] : config.deploy.baseUrl,
399
+ baseUrl: config.deploy.baseUrl,
399
400
  branch: getBranchName(),
400
401
  timestamp: Date.now(),
401
402
  links: obj.links
@@ -17,7 +17,7 @@ export interface DeployCommandOptions {
17
17
  }
18
18
  export interface DeployConfig {
19
19
  deploy: {
20
- baseUrl: string | string[];
20
+ baseUrl: string[];
21
21
  testHost?: string;
22
22
  };
23
23
  aws: {
@@ -37,7 +37,7 @@ export interface ProjectInfo {
37
37
  export interface DeployVersionInfo {
38
38
  cdnKey: string;
39
39
  version: string;
40
- baseUrl: string;
40
+ baseUrl: string[];
41
41
  branch?: string;
42
42
  timestamp: number;
43
43
  links: string[];
@@ -65,6 +65,7 @@ export interface GetConfigFilesFunction {
65
65
  data: {
66
66
  projects: Array<any>;
67
67
  lastVersion?: string;
68
+ cdnVersion?: string;
68
69
  };
69
70
  }>;
70
71
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ai-yuca",
3
- "version": "1.1.9",
3
+ "version": "1.2.1",
4
4
  "description": "一个用AI生成的开发辅助工具",
5
5
  "main": "dist/src/index.js",
6
6
  "types": "dist/src/index.d.ts",
package/src/deploy.ts CHANGED
@@ -202,7 +202,7 @@ async function updateEnvironmentConfig(
202
202
 
203
203
  // 查找或创建项目配置
204
204
  let projectConfig = envConfig.projects.find((p: any) => p.name === projectName);
205
- envConfig.lastVersion = versionInfo.cdnKey;
205
+
206
206
  const newProjectConfig = {
207
207
  baseUrl: versionInfo.baseUrl,
208
208
  s3Static:config.upload.s3Static,
@@ -223,6 +223,8 @@ async function updateEnvironmentConfig(
223
223
  });
224
224
  }
225
225
 
226
+ envConfig.lastVersion = versionInfo.cdnKey;
227
+ envConfig.cdnVersion = versionInfo.cdnKey;
226
228
  // 上传更新后的环境配置
227
229
  const configPath = `${config.aws.prefix}/static/config/${env}.config.json`;
228
230
  const tempFile = path.join(process.cwd(), `temp-${env}-config.json`);
@@ -428,7 +430,7 @@ export async function deployFiles(options: DeployCommandOptions): Promise<Deploy
428
430
  const versionInfo: DeployVersionInfo = {
429
431
  cdnKey,
430
432
  version: cdnKey,
431
- baseUrl: Array.isArray(config.deploy.baseUrl) ? config.deploy.baseUrl[0] : config.deploy.baseUrl,
433
+ baseUrl: config.deploy.baseUrl,
432
434
  branch: getBranchName(),
433
435
  timestamp: Date.now(),
434
436
  links: obj.links
@@ -20,7 +20,7 @@ export interface DeployCommandOptions {
20
20
 
21
21
  export interface DeployConfig {
22
22
  deploy: {
23
- baseUrl: string | string[]; // 部署基础URL,支持字符串或数组
23
+ baseUrl: string[]; // 部署基础URL,支持字符串或数组
24
24
  testHost?: string; // 测试环境主机
25
25
  };
26
26
  aws: {
@@ -42,7 +42,7 @@ export interface ProjectInfo {
42
42
  export interface DeployVersionInfo {
43
43
  cdnKey: string;
44
44
  version: string;
45
- baseUrl: string;
45
+ baseUrl: string[];
46
46
  branch?: string;
47
47
  timestamp: number;
48
48
  links: string[];
@@ -70,5 +70,5 @@ export interface DeployResult {
70
70
  }
71
71
 
72
72
  export interface GetConfigFilesFunction {
73
- (env: string, config: Record<string, any>, keyFile?: string): Promise<{ data: { projects: Array<any>, lastVersion?: string } }>;
73
+ (env: string, config: Record<string, any>, keyFile?: string): Promise<{ data: { projects: Array<any>, lastVersion?: string, cdnVersion?: string } }>;
74
74
  }