gencow 0.1.299 → 0.2.0
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 +0 -6
- package/core/package.json +1 -1
- package/docs/packaging.md +14 -4
- package/lib/cli-artifact-guard.mjs +53 -3
- package/lib/cli-dev-runtime.mjs +1 -0
- package/lib/cli-project-runtime.mjs +26 -14
- package/lib/codegen-command.mjs +16 -0
- package/lib/coding-guardrails.mjs +2 -0
- package/lib/dashboard-artifact.mjs +65 -0
- package/lib/dashboard-assets.mjs +20 -0
- package/lib/db-command.mjs +121 -80
- package/lib/db-migration-command-steps.mjs +19 -16
- package/lib/db-push-command.mjs +1 -1
- package/lib/deploy-codegen-preflight.mjs +1 -0
- package/lib/dev-cloud-command.mjs +1 -1
- package/lib/dev-local-command.mjs +19 -56
- package/lib/document-local-converter.mjs +11 -0
- package/lib/local-dashboard-plan.mjs +60 -0
- package/lib/local-database-commands.mjs +127 -0
- package/lib/local-development-migrations.mjs +157 -0
- package/lib/local-drizzle-database.config.mjs +10 -0
- package/lib/local-runtime-features.mjs +12 -0
- package/lib/rag-selection.mjs +7 -0
- package/lib/runtime-local-worker.mjs +116 -0
- package/lib/runtime-mode.mjs +3 -0
- package/lib/standalone-codegen-adapter.mjs +91 -0
- package/lib/ts-codegen-import-extension.mjs +228 -19
- package/package.json +16 -9
- package/runtime/config.mjs +218 -2
- package/runtime/engine/chunk-2HA4CUMS.mjs +90 -0
- package/runtime/engine/chunk-2JLO3KMM.mjs +305 -0
- package/runtime/engine/chunk-2SR2M7SR.mjs +1045 -0
- package/runtime/engine/chunk-3D7MHEUC.mjs +253 -0
- package/runtime/engine/chunk-3R7COBWG.mjs +309 -0
- package/runtime/engine/chunk-3ZKA54UW.mjs +1560 -0
- package/runtime/engine/chunk-45I4YR2J.mjs +9 -0
- package/runtime/engine/chunk-4MLRXO7F.mjs +74 -0
- package/runtime/engine/chunk-5575APCJ.mjs +215 -0
- package/runtime/engine/chunk-5GUJZQF3.mjs +114 -0
- package/runtime/engine/chunk-5MXY3T75.mjs +428 -0
- package/runtime/engine/chunk-5TACQ2US.mjs +44 -0
- package/runtime/engine/chunk-66G4YEDT.mjs +3104 -0
- package/runtime/engine/chunk-67YO53WW.mjs +1426 -0
- package/runtime/engine/chunk-6GQRM7XY.mjs +87 -0
- package/runtime/engine/chunk-6JO72SPP.mjs +68 -0
- package/runtime/engine/chunk-6W653LXI.mjs +13 -0
- package/runtime/engine/chunk-7ITSMI3S.mjs +69 -0
- package/runtime/engine/chunk-7KUJ2H2S.mjs +128 -0
- package/runtime/engine/chunk-A5BMQ5IC.mjs +45 -0
- package/runtime/engine/chunk-ADF3UR6L.mjs +428 -0
- package/runtime/engine/chunk-AEBW7XZJ.mjs +4510 -0
- package/runtime/engine/chunk-AGPQ5XIV.mjs +156 -0
- package/runtime/engine/chunk-CPU4OZSX.mjs +753 -0
- package/runtime/engine/chunk-CSWPPWBL.mjs +50 -0
- package/runtime/engine/chunk-DPWXSMWO.mjs +53 -0
- package/runtime/engine/chunk-EAIELFKU.mjs +151 -0
- package/runtime/engine/chunk-EDU5CBKT.mjs +10 -0
- package/runtime/engine/chunk-EQCTAET7.mjs +173 -0
- package/runtime/engine/chunk-EQCXDF2Z.mjs +70 -0
- package/runtime/engine/chunk-F3G4UGV4.mjs +330 -0
- package/runtime/engine/chunk-F62NUNOO.mjs +26 -0
- package/runtime/engine/chunk-FKPNIFRP.mjs +2492 -0
- package/runtime/engine/chunk-FM23RGVI.mjs +81 -0
- package/runtime/engine/chunk-FW5AK4YP.mjs +1041 -0
- package/runtime/engine/chunk-GDWYAGWV.mjs +23 -0
- package/runtime/engine/chunk-GO5PZUYW.mjs +53 -0
- package/runtime/engine/chunk-GOLP7OSG.mjs +340 -0
- package/runtime/engine/chunk-GSLM44EF.mjs +242 -0
- package/runtime/engine/chunk-GYAJ7OX2.mjs +125 -0
- package/runtime/engine/chunk-I3GWR43K.mjs +14 -0
- package/runtime/engine/chunk-IFMOTJNU.mjs +106 -0
- package/runtime/engine/chunk-IKQKBE2G.mjs +128 -0
- package/runtime/engine/chunk-ITH2NEKM.mjs +282 -0
- package/runtime/engine/chunk-J6SDRCG4.mjs +96 -0
- package/runtime/engine/chunk-JODRNM3S.mjs +29596 -0
- package/runtime/engine/chunk-JUDKX53X.mjs +137 -0
- package/runtime/engine/chunk-K2YZVPJ4.mjs +827 -0
- package/runtime/engine/chunk-KEZJUXEE.mjs +151 -0
- package/runtime/engine/chunk-KVLTJFCH.mjs +234 -0
- package/runtime/engine/chunk-KX2PRQPS.mjs +126 -0
- package/runtime/engine/chunk-LEW5ZMLR.mjs +76 -0
- package/runtime/engine/chunk-LINVSJEM.mjs +175 -0
- package/runtime/engine/chunk-M7K2ICSM.mjs +11 -0
- package/runtime/engine/chunk-MZXDXSDC.mjs +292 -0
- package/runtime/engine/chunk-N2TA2IK2.mjs +678 -0
- package/runtime/engine/chunk-N4LTCKJP.mjs +695 -0
- package/runtime/engine/chunk-N6GCLOUX.mjs +13 -0
- package/runtime/engine/chunk-NAG2OXS5.mjs +37 -0
- package/runtime/engine/chunk-NNZ2QJUG.mjs +381 -0
- package/runtime/engine/chunk-NZPPLDNW.mjs +15 -0
- package/runtime/engine/chunk-ODWM57W6.mjs +138 -0
- package/runtime/engine/chunk-P5IIXAIE.mjs +23 -0
- package/runtime/engine/chunk-PBOXB2BV.mjs +6 -0
- package/runtime/engine/chunk-PMOJLN2P.mjs +8 -0
- package/runtime/engine/chunk-PZFMKFHO.mjs +180 -0
- package/runtime/engine/chunk-QL2TQX2N.mjs +114 -0
- package/runtime/engine/chunk-RITT2RSJ.mjs +258 -0
- package/runtime/engine/chunk-RODBVJ5M.mjs +135 -0
- package/runtime/engine/chunk-RW65MPVY.mjs +261 -0
- package/runtime/engine/chunk-S67UYPB6.mjs +25 -0
- package/runtime/engine/chunk-SVJCOUI3.mjs +47 -0
- package/runtime/engine/chunk-TCN3ZASV.mjs +957 -0
- package/runtime/engine/chunk-U2NRG6KC.mjs +32 -0
- package/runtime/engine/chunk-UM3F7HUV.mjs +432 -0
- package/runtime/engine/chunk-VWU7JJ3P.mjs +146 -0
- package/runtime/engine/chunk-WDTKPPMU.mjs +310 -0
- package/runtime/engine/chunk-WJOO4XTB.mjs +31 -0
- package/runtime/engine/chunk-XNFVL2OY.mjs +63 -0
- package/runtime/engine/chunk-XPWJXP2J.mjs +58 -0
- package/runtime/engine/chunk-Y3HSBJ3I.mjs +1132 -0
- package/runtime/engine/chunk-YMH4RYSX.mjs +317 -0
- package/runtime/engine/chunk-YNOMPSGS.mjs +8 -0
- package/runtime/engine/chunk-YRBAYTEZ.mjs +251 -0
- package/runtime/engine/chunk-YRHM272W.mjs +528 -0
- package/runtime/engine/chunk-ZQUZAGIQ.mjs +149 -0
- package/runtime/engine/chunk-ZXMM7QFP.mjs +176 -0
- package/runtime/engine/chunk-ZZJSIPV2.mjs +262 -0
- package/runtime/engine/composition.mjs +325 -0
- package/runtime/engine/document-local.mjs +504 -0
- package/runtime/engine/graph.json +4134 -0
- package/runtime/engine/index.mjs +265 -0
- package/runtime/engine/local-postgres-support.mjs +69 -0
- package/runtime/engine/local.mjs +3275 -0
- package/runtime/engine/pglite-directory-lock.mjs +8 -0
- package/runtime/engine/rag.mjs +11 -0
- package/runtime/engine/search.mjs +18 -0
- package/runtime/framework-migrations/foundation-bootstrap/rag.sql +115 -0
- package/runtime/framework-migrations/foundation-bootstrap/workflow.sql +194 -0
- package/runtime/framework-migrations/journal-bootstrap/migration.sql +26 -0
- package/runtime/framework-migrations/manifest.json +56 -0
- package/runtime/framework-migrations/rag/20261006111509_mushy_warhawk/migration.sql +121 -0
- package/runtime/framework-migrations/rag/20261013234621_rag_v2_lifecycle_markers/migration.sql +6 -0
- package/runtime/framework-migrations/workflow/20261006111508_perpetual_star_brand/migration.sql +31 -0
- package/runtime/runtime-metadata.json +27 -0
- package/runtime/tooling.mjs +10399 -8951
- package/scripts/bundle-runtime-config.mjs +23 -0
- package/scripts/bundle-runtime.mjs +100 -0
- package/scripts/bundle-runtime.test.mjs +33 -0
- package/scripts/bundle-shared.mjs +3 -0
- package/scripts/copy-dashboard.mjs +16 -0
- package/scripts/pre-publish-check.mjs +23 -11
- package/templateFeature/sso/sso-auth-callback.tsx +37 -5
- package/templateFeature/tools/manifest.json +2 -1
- package/templateFeature/tools/tools.ts +3 -3
- package/runtime/server.mjs +0 -14389
- package/scripts/bundle-server.mjs +0 -223
- package/server/config.js +0 -1
- package/server/index.js +0 -1
- package/server/package.json +0 -6
|
@@ -1,223 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
/**
|
|
3
|
-
* bundle-server.mjs — Gencow 서버 런타임 번들 + 선택 대시보드 정적 파일 복사
|
|
4
|
-
*
|
|
5
|
-
* 이 스크립트의 출력:
|
|
6
|
-
* runtime/server.mjs — 서버 런타임
|
|
7
|
-
* runtime/config.mjs — 서버 런타임을 읽지 않는 설정 전용 시작 경로
|
|
8
|
-
* server/index.js — 기존 CLI 호출을 위한 런타임 호환 shim
|
|
9
|
-
* server/config.js — 기존 CLI 호출을 위한 설정 호환 shim
|
|
10
|
-
* dashboard/ — 있으면 복사하는 선택 자산
|
|
11
|
-
*
|
|
12
|
-
* 별도 빌드 단계:
|
|
13
|
-
* runtime/tooling.mjs — CLI 도구 번들
|
|
14
|
-
* core/index.js — 별도 Core codegen 번들
|
|
15
|
-
*
|
|
16
|
-
* 앱 코드에서 import하거나 앱 소유 schema에 의존하는 모듈은 external 처리합니다.
|
|
17
|
-
* 런타임 구현 의존성은 서버 런타임 번들에 포함합니다.
|
|
18
|
-
*/
|
|
19
|
-
|
|
20
|
-
import { build } from "esbuild";
|
|
21
|
-
import { resolve, dirname } from "path";
|
|
22
|
-
import { fileURLToPath } from "url";
|
|
23
|
-
import { mkdirSync, writeFileSync, existsSync, rmSync, statSync } from "fs";
|
|
24
|
-
import { copyOptionalDashboardAssets } from "../lib/dashboard-assets.mjs";
|
|
25
|
-
|
|
26
|
-
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
27
|
-
const cliRoot = resolve(__dirname, "..");
|
|
28
|
-
const serverRoot = resolve(cliRoot, "..", "server");
|
|
29
|
-
const sharedRoot = resolve(cliRoot, "..", "shared");
|
|
30
|
-
const routeGatewayWsSource = resolve(cliRoot, "..", "route-gateway", "src", "ws-gateway.ts");
|
|
31
|
-
const platformSource = (file) => resolve(cliRoot, "..", "platform", "src", file);
|
|
32
|
-
|
|
33
|
-
function packageClosedServerBridge(path) {
|
|
34
|
-
if (path.endsWith("/server-platform-lifecycle-surface.js")) {
|
|
35
|
-
return `
|
|
36
|
-
export { registerPlatformApiRoutes as registerPackedPlatformApiRoutes }
|
|
37
|
-
from ${JSON.stringify(platformSource("platform-api-surface.ts"))};
|
|
38
|
-
`;
|
|
39
|
-
}
|
|
40
|
-
if (path.endsWith("/ws-gateway.js")) {
|
|
41
|
-
return `export * from ${JSON.stringify(routeGatewayWsSource)};`;
|
|
42
|
-
}
|
|
43
|
-
if (path.endsWith("/server-node-proxy-ws-tunnel.js")) {
|
|
44
|
-
return `export * from ${JSON.stringify(platformSource("node-proxy-ws-tunnel.ts"))};`;
|
|
45
|
-
}
|
|
46
|
-
if (path.endsWith("/runtime-metrics.js")) {
|
|
47
|
-
return `export * from ${JSON.stringify(platformSource("runtime-metrics.ts"))};`;
|
|
48
|
-
}
|
|
49
|
-
if (path.endsWith("/server-node-routing-metrics.js")) {
|
|
50
|
-
return `
|
|
51
|
-
import * as routeMetrics from ${JSON.stringify(platformSource("node-routing-metrics.ts"))};
|
|
52
|
-
import * as storageMetrics from ${JSON.stringify(platformSource("storage-direct-metrics.ts"))};
|
|
53
|
-
export const recordNodeRouteMetric = routeMetrics.recordNodeRouteMetric;
|
|
54
|
-
export function getNodeRouteMetricsSnapshot(limit = 50) {
|
|
55
|
-
return { ...routeMetrics.getNodeRouteMetricsSnapshot(limit), storageDirect: storageMetrics.getStorageDirectMetricsSnapshot() };
|
|
56
|
-
}
|
|
57
|
-
export function resetNodeRouteMetricsForTests() {
|
|
58
|
-
routeMetrics.resetNodeRouteMetricsForTests();
|
|
59
|
-
storageMetrics.resetStorageDirectMetricsForTests();
|
|
60
|
-
}
|
|
61
|
-
`;
|
|
62
|
-
}
|
|
63
|
-
return null;
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
const runtimeDir = resolve(cliRoot, "runtime");
|
|
67
|
-
const serverCompatDir = resolve(cliRoot, "server");
|
|
68
|
-
mkdirSync(runtimeDir, { recursive: true });
|
|
69
|
-
mkdirSync(serverCompatDir, { recursive: true });
|
|
70
|
-
|
|
71
|
-
const serverDistEntry = resolve(serverRoot, "dist/index.js");
|
|
72
|
-
const configDistEntry = resolve(sharedRoot, "dist/src/config/index.js");
|
|
73
|
-
|
|
74
|
-
if (!existsSync(serverDistEntry)) {
|
|
75
|
-
throw new Error(
|
|
76
|
-
`Expected built server entry not found: ${serverDistEntry}. Build @gencow/server before running bundle-server.mjs.`,
|
|
77
|
-
);
|
|
78
|
-
}
|
|
79
|
-
if (!existsSync(configDistEntry)) {
|
|
80
|
-
throw new Error(
|
|
81
|
-
`Expected built config entry not found: ${configDistEntry}. Build @gencow/shared before running bundle-server.mjs.`,
|
|
82
|
-
);
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
console.log("📦 Bundling Gencow server runtime...");
|
|
86
|
-
console.log(` Server: ${serverDistEntry}`);
|
|
87
|
-
console.log(` Output: ${runtimeDir}/server.mjs`);
|
|
88
|
-
rmSync(resolve(runtimeDir, "server.mjs.map"), { force: true });
|
|
89
|
-
|
|
90
|
-
await build({
|
|
91
|
-
entryPoints: [serverDistEntry],
|
|
92
|
-
bundle: true,
|
|
93
|
-
format: "esm",
|
|
94
|
-
platform: "node",
|
|
95
|
-
target: "node20",
|
|
96
|
-
outfile: resolve(runtimeDir, "server.mjs"),
|
|
97
|
-
plugins: [
|
|
98
|
-
{
|
|
99
|
-
name: "gencow-server-runtime-package-closure",
|
|
100
|
-
setup(buildContext) {
|
|
101
|
-
buildContext.onLoad(
|
|
102
|
-
{
|
|
103
|
-
filter:
|
|
104
|
-
/[\\/]packages[\\/]server[\\/]dist[\\/](?:ws-gateway|server-node-routing-metrics|server-node-proxy-ws-tunnel|runtime-metrics|server-platform-lifecycle-surface)\.js$/,
|
|
105
|
-
},
|
|
106
|
-
(args) => {
|
|
107
|
-
const contents = packageClosedServerBridge(args.path.replaceAll("\\", "/"));
|
|
108
|
-
if (!contents) return null;
|
|
109
|
-
return { contents, loader: "js" };
|
|
110
|
-
},
|
|
111
|
-
);
|
|
112
|
-
},
|
|
113
|
-
},
|
|
114
|
-
],
|
|
115
|
-
|
|
116
|
-
// 앱 코드가 import하거나 앱 소유 schema에 의존하는 모듈은 external 처리합니다.
|
|
117
|
-
// 런타임 구현 의존성은 server runtime artifact에 포함합니다.
|
|
118
|
-
external: [
|
|
119
|
-
"esbuild",
|
|
120
|
-
"@esbuild/*",
|
|
121
|
-
"@electric-sql/pglite",
|
|
122
|
-
"postgres",
|
|
123
|
-
"better-auth",
|
|
124
|
-
"better-auth/*",
|
|
125
|
-
"drizzle-kit",
|
|
126
|
-
"drizzle-orm",
|
|
127
|
-
"drizzle-orm/*",
|
|
128
|
-
"bun",
|
|
129
|
-
"bun:*",
|
|
130
|
-
// Node.js built-in modules
|
|
131
|
-
"node:*",
|
|
132
|
-
"fs",
|
|
133
|
-
"path",
|
|
134
|
-
"url",
|
|
135
|
-
"http",
|
|
136
|
-
"https",
|
|
137
|
-
"net",
|
|
138
|
-
"tls",
|
|
139
|
-
"crypto",
|
|
140
|
-
"stream",
|
|
141
|
-
"os",
|
|
142
|
-
"util",
|
|
143
|
-
"events",
|
|
144
|
-
"buffer",
|
|
145
|
-
"child_process",
|
|
146
|
-
"worker_threads",
|
|
147
|
-
"cluster",
|
|
148
|
-
"zlib",
|
|
149
|
-
"querystring",
|
|
150
|
-
"string_decoder",
|
|
151
|
-
"assert",
|
|
152
|
-
"async_hooks",
|
|
153
|
-
"perf_hooks",
|
|
154
|
-
"dns",
|
|
155
|
-
"readline",
|
|
156
|
-
"tty",
|
|
157
|
-
"v8",
|
|
158
|
-
],
|
|
159
|
-
|
|
160
|
-
sourcemap: false,
|
|
161
|
-
minify: false,
|
|
162
|
-
minifyWhitespace: true,
|
|
163
|
-
legalComments: "inline",
|
|
164
|
-
treeShaking: true,
|
|
165
|
-
|
|
166
|
-
define: {
|
|
167
|
-
"process.env.GENCOW_BUNDLED": '"true"',
|
|
168
|
-
},
|
|
169
|
-
});
|
|
170
|
-
|
|
171
|
-
// Keep the legacy runtime entrypoint available for existing CLI imports.
|
|
172
|
-
writeFileSync(resolve(serverCompatDir, "index.js"), 'export * from "../runtime/server.mjs";\n');
|
|
173
|
-
|
|
174
|
-
console.log("📦 Bundling Gencow config runtime...");
|
|
175
|
-
console.log(` Config: ${configDistEntry}`);
|
|
176
|
-
console.log(` Output: ${runtimeDir}/config.mjs`);
|
|
177
|
-
|
|
178
|
-
// Keep config-only startup on its separate artifact; do not evaluate the full
|
|
179
|
-
// server runtime merely to load project configuration.
|
|
180
|
-
await build({
|
|
181
|
-
entryPoints: [configDistEntry],
|
|
182
|
-
bundle: true,
|
|
183
|
-
format: "esm",
|
|
184
|
-
platform: "node",
|
|
185
|
-
target: "node20",
|
|
186
|
-
outfile: resolve(runtimeDir, "config.mjs"),
|
|
187
|
-
external: ["node:*", "fs", "path", "url"],
|
|
188
|
-
sourcemap: false,
|
|
189
|
-
minify: false,
|
|
190
|
-
treeShaking: true,
|
|
191
|
-
});
|
|
192
|
-
|
|
193
|
-
// Preserve the small server/config.js compatibility entry for older CLI imports.
|
|
194
|
-
writeFileSync(
|
|
195
|
-
resolve(serverCompatDir, "config.js"),
|
|
196
|
-
'export { gencowConfigSchema, getDefaultConfig } from "../runtime/config.mjs";\n',
|
|
197
|
-
);
|
|
198
|
-
|
|
199
|
-
writeFileSync(
|
|
200
|
-
resolve(serverCompatDir, "package.json"),
|
|
201
|
-
JSON.stringify(
|
|
202
|
-
{
|
|
203
|
-
name: "@gencow/server-bundle",
|
|
204
|
-
version: "0.1.0",
|
|
205
|
-
type: "module",
|
|
206
|
-
main: "index.js",
|
|
207
|
-
},
|
|
208
|
-
null,
|
|
209
|
-
2,
|
|
210
|
-
) + "\n",
|
|
211
|
-
);
|
|
212
|
-
|
|
213
|
-
const serverKb = (statSync(resolve(runtimeDir, "server.mjs")).size / 1024) | 0;
|
|
214
|
-
const configKb = (statSync(resolve(runtimeDir, "config.mjs")).size / 1024) | 0;
|
|
215
|
-
console.log("✅ Server runtime bundled successfully!");
|
|
216
|
-
console.log(` Size: ${serverKb}KB`);
|
|
217
|
-
console.log(`✅ Config runtime bundled successfully!`);
|
|
218
|
-
console.log(` Size: ${configKb}KB`);
|
|
219
|
-
|
|
220
|
-
// ── Dashboard 정적 파일 복사 ──────────────────────────
|
|
221
|
-
const dashboardSrc = resolve(cliRoot, "../../apps/system/dashboard/dist");
|
|
222
|
-
const dashboardDest = resolve(cliRoot, "dashboard");
|
|
223
|
-
copyOptionalDashboardAssets(dashboardSrc, dashboardDest);
|
package/server/config.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { gencowConfigSchema, getDefaultConfig } from "../runtime/config.mjs";
|
package/server/index.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "../runtime/server.mjs";
|