gencow 0.1.142 → 0.1.143

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/bin/gencow.mjs CHANGED
@@ -314,7 +314,6 @@ ${BOLD}Commands (login required):${RESET}
314
314
  ${GREEN}templates clone <slug>${RESET} Clone a template into a local directory
315
315
  ${GREEN}deploy${RESET} Deploy backend to cloud ${DIM}(dev by default)${RESET}
316
316
  ${DIM}--static [dir] Deploy backend, then static files${RESET}
317
- ${DIM}--no-backend With --static, skip backend deployment${RESET}
318
317
  ${DIM}--prod Deploy to production (Pro+ only)${RESET}
319
318
  ${DIM}--rollback Rollback to previous deployment${RESET}
320
319
  ${DIM}--force, -f Skip optional dependency scan${RESET}
@@ -368,6 +367,9 @@ ${BOLD}Examples:${RESET}
368
367
  ${DIM}# Deploy backend + built frontend:${RESET}
369
368
  gencow deploy --static dist/
370
369
 
370
+ ${DIM}# Deploy built frontend files only:${RESET}
371
+ gencow static dist/
372
+
371
373
  ${DIM}# Deploy to production (Pro+ only):${RESET}
372
374
  gencow deploy --prod
373
375
 
@@ -6,7 +6,6 @@ export function renderDeployHelp() {
6
6
  log(` ${BOLD}Usage:${RESET} gencow deploy [options]\n`);
7
7
  log(` ${BOLD}Options:${RESET}`);
8
8
  log(` ${DIM}--static [dir]${RESET} Deploy backend first, then static files`);
9
- log(` ${DIM}--no-backend${RESET} With --static, skip backend deployment`);
10
9
  log(` ${DIM}--prod${RESET} Deploy to production (Pro+ only)`);
11
10
  log(` ${DIM}--rollback${RESET} Rollback to previous deployment`);
12
11
  log(` ${DIM}--force, -f${RESET} Skip optional dependency scan`);
@@ -14,7 +13,6 @@ export function renderDeployHelp() {
14
13
  log(` ${BOLD}Examples:${RESET}`);
15
14
  log(` gencow deploy`);
16
15
  log(` gencow deploy --static dist/`);
17
- log(` gencow deploy --static --no-backend dist/`);
18
16
  log(` gencow deploy --prod`);
19
17
  log(` gencow deploy --rollback\n`);
20
18
  }
@@ -15,7 +15,6 @@ export function parseDeployArgs(deployArgs) {
15
15
  envTarget: "dev",
16
16
  forceDeploy: false,
17
17
  isRollback: false,
18
- noBackend: false,
19
18
  staticDeploy: false,
20
19
  staticDirArg: null,
21
20
  unknownArg: null,
@@ -38,7 +37,8 @@ export function parseDeployArgs(deployArgs) {
38
37
  parsed.staticDeploy = true;
39
38
  parsed.staticDirArg = arg.slice("--static=".length) || null;
40
39
  } else if (arg === "--no-backend") {
41
- parsed.noBackend = true;
40
+ parsed.unknownArg = arg;
41
+ break;
42
42
  } else if (!arg.startsWith("-")) {
43
43
  if (parsed.staticDeploy && !parsed.staticDirArg) {
44
44
  parsed.staticDirArg = arg;
@@ -93,8 +93,8 @@ function showUnknownDeployArgument(arg, { errorImpl = error, infoImpl = info, lo
93
93
  infoImpl(" gencow deploy --force Skip optional dependency scan");
94
94
  logImpl("");
95
95
  infoImpl("Static files:");
96
- infoImpl(" gencow deploy --static [dir] Deploy backend, then static files");
97
- infoImpl(" gencow deploy --static --no-backend [dir] Deploy static files only");
96
+ infoImpl(" gencow deploy --static [dir] Deploy backend, then static files");
97
+ infoImpl(" gencow static [dir] Deploy static files only");
98
98
  }
99
99
 
100
100
  async function confirmFirstProductionDeploy({ appId, createInterfaceImpl, infoImpl = info, logImpl = log }) {
@@ -408,7 +408,6 @@ export function createDeployCommand({
408
408
  forceDeploy: parsed.forceDeploy,
409
409
  gencowJsonPath,
410
410
  hasDetectedBackend,
411
- noBackend: parsed.noBackend,
412
411
  staticDirArg: parsed.staticDirArg,
413
412
  createDeployPackageRuntimeForCwd,
414
413
  cwdImpl,
@@ -127,7 +127,6 @@ export async function runStaticDeployFlow({
127
127
  forceDeploy,
128
128
  gencowJsonPath,
129
129
  hasDetectedBackend,
130
- noBackend,
131
130
  staticDirArg,
132
131
  createDeployPackageRuntimeForCwd,
133
132
  cwdImpl = () => process.cwd(),
@@ -164,7 +163,7 @@ export async function runStaticDeployFlow({
164
163
  return;
165
164
  }
166
165
 
167
- const shouldDeployBackend = hasDetectedBackend && !noBackend;
166
+ const shouldDeployBackend = hasDetectedBackend;
168
167
  if (shouldDeployBackend) {
169
168
  logImpl(`\n${BOLD}${CYAN}Gencow Deploy (Fullstack)${RESET}\n`);
170
169
  infoImpl(`Backend: ${backendRoot}`);
@@ -200,7 +199,6 @@ export async function runStaticDeployFlow({
200
199
  envTarget,
201
200
  forceDeploy,
202
201
  hasBackend: shouldDeployBackend,
203
- noBackend,
204
202
  },
205
203
  });
206
204
  }
@@ -339,7 +339,7 @@ export function buildAiPrompt(apiObj, namespaces) {
339
339
  md += `- 프로덕션: \`npx gencow deploy --prod\` (Pro+ only, prod 환경)\n`;
340
340
  md += `- 풀스택 정적: VITE_API_URL=https://{앱ID}.{도메인} npm run build 후 \`npx gencow deploy --static dist/\`\n`;
341
341
  md += ` → 백엔드가 감지되면 자동으로 백엔드 먼저 배포 후 프론트엔드 배포\n`;
342
- md += `- 프론트엔드만 배포: \`npx gencow deploy --static --no-backend dist/\`\n`;
342
+ md += `- 프론트엔드만 배포: \`npx gencow static dist/\` (frontend/에서 실행해도 parent gencow.json 자동 감지)\n`;
343
343
  md += `- 환경변수는 \`npx gencow env set KEY=VALUE\`로 클라우드에 설정해. 즉시 반영 (재시작 불필요).\n`;
344
344
  md += `- process.env.KEY는 반드시 handler 내부에서 접근해 (모듈 상단 캐싱 시 hot-reload 안 됨).\n`;
345
345
  md += `- .env 파일은 로컬 개발 전용이야. 클라우드에는 gencow env push로 올려.\n`;
@@ -528,7 +528,7 @@ export function buildDeploySection() {
528
528
  md += `gencow deploy --static dist/\n`;
529
529
  md += `\`\`\`\n\n`;
530
530
  md += `> 💡 동일 프로젝트에 \`gencow/\` 폴더가 있으면 백엔드를 자동 감지하여 백엔드 → 프론트엔드 순서로 배포합니다.\n`;
531
- md += `> 프론트엔드만 배포하려면: \`gencow deploy --static --no-backend dist/\`\n\n`;
531
+ md += `> 프론트엔드만 배포하려면: \`gencow static dist/\` (parent backend root의 앱 메타데이터 자동 감지)\n\n`;
532
532
  md += `### 정적 사이트 전용 (API 없는 경우)\n`;
533
533
  md += `\`\`\`bash\n`;
534
534
  md += `gencow static dist/ # 순수 HTML/CSS/JS만 배포\n`;
@@ -3,13 +3,13 @@ import { resolve } from "path";
3
3
 
4
4
  import { readProjectDisplayName } from "./cli-project-runtime.mjs";
5
5
  import { BOLD, CYAN, DIM, RESET, error, info, log } from "./output.mjs";
6
+ import { detectStaticDeployBackend } from "./static-deploy-command.mjs";
6
7
 
7
8
  export function parseStaticArgs(staticArgs) {
8
9
  const parsed = {
9
10
  appId: null,
10
11
  forceDeploy: false,
11
12
  isProd: false,
12
- noBackend: false,
13
13
  staticDir: null,
14
14
  };
15
15
 
@@ -17,7 +17,6 @@ export function parseStaticArgs(staticArgs) {
17
17
  const arg = staticArgs[index];
18
18
  if (arg === "--force" || arg === "-f") parsed.forceDeploy = true;
19
19
  else if (arg === "--prod") parsed.isProd = true;
20
- else if (arg === "--no-backend") parsed.noBackend = true;
21
20
  else if (arg === "--app" || arg === "-a") parsed.appId = staticArgs[++index];
22
21
  else if (!arg.startsWith("-")) parsed.staticDir = arg;
23
22
  }
@@ -33,9 +32,12 @@ export function readStaticProjectContext(options = {}) {
33
32
  readFileSyncImpl = readFileSync,
34
33
  resolvePathImpl = resolve,
35
34
  readProjectDisplayNameImpl = readProjectDisplayName,
35
+ detectStaticDeployBackendImpl = detectStaticDeployBackend,
36
36
  } = options;
37
37
 
38
- const gencowJsonPath = resolvePathImpl(cwd, "gencow.json");
38
+ const staticBackend = detectStaticDeployBackendImpl({ cwd, existsSyncImpl, resolvePathImpl });
39
+ const projectRoot = staticBackend.detectedBackend && staticBackend.backendRoot ? staticBackend.backendRoot : cwd;
40
+ const gencowJsonPath = resolvePathImpl(projectRoot, "gencow.json");
39
41
  let appId = explicitAppId;
40
42
  let prodAppId = null;
41
43
 
@@ -47,9 +49,10 @@ export function readStaticProjectContext(options = {}) {
47
49
 
48
50
  return {
49
51
  appId,
50
- displayName: readProjectDisplayNameImpl({ cwd, existsSyncImpl, readFileSyncImpl, resolvePathImpl }),
52
+ displayName: readProjectDisplayNameImpl({ cwd: projectRoot, existsSyncImpl, readFileSyncImpl, resolvePathImpl }),
51
53
  gencowJsonPath,
52
54
  prodAppId,
55
+ projectRoot,
53
56
  };
54
57
  }
55
58
 
@@ -76,13 +79,12 @@ export function createStaticCommand(options = {}) {
76
79
  logImpl(` ${CYANValue}dir${RESETValue} Static directory (auto-detects dist/, out/, build/)\n`);
77
80
  logImpl(` ${BOLDValue}Options:${RESETValue}`);
78
81
  logImpl(` ${DIMValue}--prod${RESETValue} Deploy to production app`);
79
- logImpl(` ${DIMValue}--no-backend${RESETValue} Compatibility flag; static does not deploy backend`);
80
82
  logImpl(` ${DIMValue}--force, -f${RESETValue} Skip optional dependency scan`);
81
83
  logImpl(` ${DIMValue}--app, -a${RESETValue} Target specific app\n`);
82
84
  logImpl(` ${BOLDValue}Examples:${RESETValue}`);
83
85
  logImpl(" gencow static dist/");
84
- logImpl(" gencow static --prod dist/");
85
- logImpl(" gencow static --no-backend dist/\n");
86
+ logImpl(" gencow static --prod dist/\n");
87
+ logImpl(` ${DIMValue}When run from frontend/, app metadata is read from the parent backend root.${RESETValue}\n`);
86
88
  return;
87
89
  }
88
90
 
@@ -109,7 +111,6 @@ export function createStaticCommand(options = {}) {
109
111
  gencowJsonPath,
110
112
  opts: {
111
113
  forceDeploy: parsed.forceDeploy,
112
- noBackend: parsed.noBackend,
113
114
  envTarget,
114
115
  },
115
116
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gencow",
3
- "version": "0.1.142",
3
+ "version": "0.1.143",
4
4
  "description": "Gencow — AI Backend Engine",
5
5
  "type": "module",
6
6
  "bin": {