gencow 0.1.104 → 0.1.105
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 +20 -6
- package/package.json +1 -1
package/bin/gencow.mjs
CHANGED
|
@@ -191,6 +191,20 @@ function isStandaloneProject() {
|
|
|
191
191
|
return existsSync(resolve(process.cwd(), "gencow.json"));
|
|
192
192
|
}
|
|
193
193
|
|
|
194
|
+
/**
|
|
195
|
+
* drizzle-kit CLI 명령어 빌드 — 로컬 바이너리 우선 사용.
|
|
196
|
+
* pnpm 모노레포에서 npx가 esbuild 네이티브 바이너리를 잘못 resolve하여
|
|
197
|
+
* "Host version X does not match binary version Y" 에러 방지.
|
|
198
|
+
* 로컬 ./node_modules/.bin/drizzle-kit이 있으면 직접 실행, 없으면 npx fallback.
|
|
199
|
+
*/
|
|
200
|
+
function _drizzleKitCmd(subcmd) {
|
|
201
|
+
const localBin = resolve(process.cwd(), "node_modules/.bin/drizzle-kit");
|
|
202
|
+
if (existsSync(localBin)) {
|
|
203
|
+
return `"${localBin}" ${subcmd}`;
|
|
204
|
+
}
|
|
205
|
+
return `npx drizzle-kit ${subcmd}`;
|
|
206
|
+
}
|
|
207
|
+
|
|
194
208
|
function findServerRoot() {
|
|
195
209
|
// 1st: monorepo structure (walk up from CWD to find packages/server)
|
|
196
210
|
let dir = process.cwd();
|
|
@@ -1251,7 +1265,7 @@ ${hasPrompt ? `
|
|
|
1251
1265
|
});
|
|
1252
1266
|
} else {
|
|
1253
1267
|
// Standalone: use npx drizzle-kit directly
|
|
1254
|
-
execSync("
|
|
1268
|
+
execSync(_drizzleKitCmd("generate"), {
|
|
1255
1269
|
cwd: process.cwd(),
|
|
1256
1270
|
env: genEnv,
|
|
1257
1271
|
stdio: "inherit", // 프롬프트 패스스루 (rename 등)
|
|
@@ -1435,7 +1449,7 @@ ${hasPrompt ? `
|
|
|
1435
1449
|
// 🆕 로컬 drizzle-kit generate 실행 (프롬프트 패스스루)
|
|
1436
1450
|
info("스키마 마이그레이션 생성 중...");
|
|
1437
1451
|
try {
|
|
1438
|
-
execSync("
|
|
1452
|
+
execSync(_drizzleKitCmd("generate"), {
|
|
1439
1453
|
cwd: process.cwd(),
|
|
1440
1454
|
stdio: "inherit",
|
|
1441
1455
|
});
|
|
@@ -1503,7 +1517,7 @@ ${hasPrompt ? `
|
|
|
1503
1517
|
runInServer("pnpm db:generate", buildEnv(config));
|
|
1504
1518
|
} else {
|
|
1505
1519
|
// Standalone: npx drizzle-kit generate (프롬프트 패스스루)
|
|
1506
|
-
execSync("
|
|
1520
|
+
execSync(_drizzleKitCmd("generate"), {
|
|
1507
1521
|
cwd: process.cwd(),
|
|
1508
1522
|
env: buildEnv(config),
|
|
1509
1523
|
stdio: "inherit",
|
|
@@ -1983,7 +1997,7 @@ ${BOLD}Examples:${RESET}
|
|
|
1983
1997
|
});
|
|
1984
1998
|
} else {
|
|
1985
1999
|
// Standalone: npx drizzle-kit generate (프롬프트 패스스루 — rename 감지 대화형 포함)
|
|
1986
|
-
execGen("
|
|
2000
|
+
execGen(_drizzleKitCmd("generate"), {
|
|
1987
2001
|
cwd: process.cwd(),
|
|
1988
2002
|
stdio: "inherit",
|
|
1989
2003
|
});
|
|
@@ -2493,7 +2507,7 @@ ${BOLD}Examples:${RESET}
|
|
|
2493
2507
|
if (existsSync(schemaPath)) {
|
|
2494
2508
|
info("스키마 마이그레이션 생성 중...");
|
|
2495
2509
|
try {
|
|
2496
|
-
execSync("
|
|
2510
|
+
execSync(_drizzleKitCmd("generate"), {
|
|
2497
2511
|
cwd: backendRoot,
|
|
2498
2512
|
stdio: "inherit", // ← 프롬프트 패스스루!
|
|
2499
2513
|
});
|
|
@@ -3957,7 +3971,7 @@ process.exit(0);
|
|
|
3957
3971
|
}
|
|
3958
3972
|
try {
|
|
3959
3973
|
const { execSync } = await import("child_process");
|
|
3960
|
-
execSync("
|
|
3974
|
+
execSync(_drizzleKitCmd("generate"), {
|
|
3961
3975
|
cwd: process.cwd(),
|
|
3962
3976
|
stdio: "inherit",
|
|
3963
3977
|
});
|