@geekmidas/cli 10.0.0-alpha.11 → 10.0.0-alpha.13
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/README.md +13 -40
- package/dist/{HostingerProvider-BcyFRbqV.mjs → HostingerProvider-BY26bWwB.mjs} +20 -21
- package/dist/HostingerProvider-BY26bWwB.mjs.map +1 -0
- package/dist/{HostingerProvider-BOvsgATO.cjs → HostingerProvider-BZFGYYVA.cjs} +21 -22
- package/dist/HostingerProvider-BZFGYYVA.cjs.map +1 -0
- package/dist/{LocalStateProvider-yjXZXZDM.cjs → LocalStateProvider-7HR6SS2t.cjs} +11 -6
- package/dist/LocalStateProvider-7HR6SS2t.cjs.map +1 -0
- package/dist/{LocalStateProvider-Bq-0C0sg.mjs → LocalStateProvider-D7QyJoLM.mjs} +10 -4
- package/dist/LocalStateProvider-D7QyJoLM.mjs.map +1 -0
- package/dist/{Route53Provider-C0xmer8U.mjs → Route53Provider-Cvj40A8I.mjs} +12 -12
- package/dist/Route53Provider-Cvj40A8I.mjs.map +1 -0
- package/dist/{Route53Provider-CH9XH7bz.cjs → Route53Provider-DVILBsvV.cjs} +20 -21
- package/dist/Route53Provider-DVILBsvV.cjs.map +1 -0
- package/dist/{SSMStateProvider-DOZifZfE.mjs → SSMStateProvider-B0Hu1MKZ.mjs} +13 -4
- package/dist/SSMStateProvider-B0Hu1MKZ.mjs.map +1 -0
- package/dist/{SSMStateProvider-CXtNgPfy.cjs → SSMStateProvider-VrQ-yeqd.cjs} +17 -9
- package/dist/SSMStateProvider-VrQ-yeqd.cjs.map +1 -0
- package/dist/{backup-provisioner-cE2PuCTb.cjs → backup-provisioner-BmhIO_Yr.cjs} +21 -19
- package/dist/backup-provisioner-BmhIO_Yr.cjs.map +1 -0
- package/dist/{backup-provisioner-DXXg6FIL.mjs → backup-provisioner-DIVCbfee.mjs} +10 -7
- package/dist/backup-provisioner-DIVCbfee.mjs.map +1 -0
- package/dist/{bundler-CaTGtiaO.cjs → bundler-BeNDZdHQ.cjs} +10 -28
- package/dist/bundler-BeNDZdHQ.cjs.map +1 -0
- package/dist/{bundler-S3ek7ea-.mjs → bundler-BodTL4kf.mjs} +9 -26
- package/dist/bundler-BodTL4kf.mjs.map +1 -0
- package/dist/{config-HhDpJmLO.cjs → config-Q1rvKHvw.cjs} +74 -69
- package/dist/config-Q1rvKHvw.cjs.map +1 -0
- package/dist/{config-B0L2tvvC.mjs → config-pqGD3hF9.mjs} +26 -14
- package/dist/config-pqGD3hF9.mjs.map +1 -0
- package/dist/config.cjs +4 -5
- package/dist/config.d.cts +14 -17
- package/dist/config.d.cts.map +1 -1
- package/dist/config.d.mts +14 -17
- package/dist/config.d.mts.map +1 -1
- package/dist/config.mjs +3 -5
- package/dist/{credentials-CZrys9C5.mjs → credentials-BekkKtY_.mjs} +1331 -1100
- package/dist/credentials-BekkKtY_.mjs.map +1 -0
- package/dist/{credentials-B2Pyh3bJ.cjs → credentials-Q6F0uqJq.cjs} +1468 -1232
- package/dist/credentials-Q6F0uqJq.cjs.map +1 -0
- package/dist/deploy/sniffer-envkit-patch.cjs +18 -10
- package/dist/deploy/sniffer-envkit-patch.cjs.map +1 -1
- package/dist/deploy/sniffer-envkit-patch.d.cts +0 -2
- package/dist/deploy/sniffer-envkit-patch.d.cts.map +1 -1
- package/dist/deploy/sniffer-envkit-patch.d.mts +0 -2
- package/dist/deploy/sniffer-envkit-patch.d.mts.map +1 -1
- package/dist/deploy/sniffer-envkit-patch.mjs +10 -2
- package/dist/deploy/sniffer-envkit-patch.mjs.map +1 -1
- package/dist/deploy/sniffer-hooks.cjs +13 -7
- package/dist/deploy/sniffer-hooks.cjs.map +1 -1
- package/dist/deploy/sniffer-hooks.d.cts +1 -2
- package/dist/deploy/sniffer-hooks.d.cts.map +1 -1
- package/dist/deploy/sniffer-hooks.d.mts +1 -2
- package/dist/deploy/sniffer-hooks.d.mts.map +1 -1
- package/dist/deploy/sniffer-hooks.mjs +9 -2
- package/dist/deploy/sniffer-hooks.mjs.map +1 -1
- package/dist/deploy/sniffer-loader.cjs +16 -7
- package/dist/deploy/sniffer-loader.cjs.map +1 -1
- package/dist/deploy/sniffer-loader.d.cts +1 -1
- package/dist/deploy/sniffer-loader.d.mts +1 -1
- package/dist/deploy/sniffer-loader.mjs +13 -2
- package/dist/deploy/sniffer-loader.mjs.map +1 -1
- package/dist/deploy/sniffer-routes-worker.cjs +11 -11
- package/dist/deploy/sniffer-routes-worker.cjs.map +1 -1
- package/dist/deploy/sniffer-routes-worker.d.cts +1 -1
- package/dist/deploy/sniffer-routes-worker.d.mts +1 -1
- package/dist/deploy/sniffer-routes-worker.mjs +2 -2
- package/dist/deploy/sniffer-routes-worker.mjs.map +1 -1
- package/dist/deploy/sniffer-worker.cjs +15 -6
- package/dist/deploy/sniffer-worker.cjs.map +1 -1
- package/dist/deploy/sniffer-worker.d.cts +1 -3
- package/dist/deploy/sniffer-worker.d.cts.map +1 -1
- package/dist/deploy/sniffer-worker.d.mts +1 -3
- package/dist/deploy/sniffer-worker.d.mts.map +1 -1
- package/dist/deploy/sniffer-worker.mjs +15 -4
- package/dist/deploy/sniffer-worker.mjs.map +1 -1
- package/dist/{discover-DTmFeloL.cjs → discover-BERGFg8v.cjs} +81 -64
- package/dist/discover-BERGFg8v.cjs.map +1 -0
- package/dist/{discover-CAlFgYec.mjs → discover-CK-n3w6b.mjs} +35 -20
- package/dist/discover-CK-n3w6b.mjs.map +1 -0
- package/dist/{emit-CUD1BWls.cjs → emit-BdoPFjZf.cjs} +53 -36
- package/dist/emit-BdoPFjZf.cjs.map +1 -0
- package/dist/{emit-CIlvnDvV.mjs → emit-Bzq7JsMP.mjs} +24 -6
- package/dist/emit-Bzq7JsMP.mjs.map +1 -0
- package/dist/{fullstack-secrets-METaRLS1.mjs → fullstack-secrets-BET8gqwK.mjs} +9 -15
- package/dist/fullstack-secrets-BET8gqwK.mjs.map +1 -0
- package/dist/{fullstack-secrets-D6MyHhQP.cjs → fullstack-secrets-DXsWO-5m.cjs} +19 -38
- package/dist/fullstack-secrets-DXsWO-5m.cjs.map +1 -0
- package/dist/{generator-VE2JrFlY.mjs → generator-LfZU7NlU.mjs} +8 -14
- package/dist/generator-LfZU7NlU.mjs.map +1 -0
- package/dist/{generator-CNzBw7g5.cjs → generator-Wdfp0jCS.cjs} +38 -45
- package/dist/generator-Wdfp0jCS.cjs.map +1 -0
- package/dist/{github-BrvaPkFf.cjs → github-BfflNPVe.cjs} +36 -30
- package/dist/{github-BrvaPkFf.cjs.map → github-BfflNPVe.cjs.map} +1 -1
- package/dist/{github-CrpsXSfV.mjs → github-CRwnxKmD.mjs} +27 -20
- package/dist/github-CRwnxKmD.mjs.map +1 -0
- package/dist/{index-CR5urhWX.d.cts → index-Cd-qeOam.d.mts} +3 -12
- package/dist/index-Cd-qeOam.d.mts.map +1 -0
- package/dist/{index-Ayxg_DQY.d.mts → index-D-iAVHx-.d.cts} +3 -12
- package/dist/index-D-iAVHx-.d.cts.map +1 -0
- package/dist/index.cjs +3320 -2961
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.mts +1 -1
- package/dist/index.mjs +3200 -2858
- package/dist/index.mjs.map +1 -1
- package/dist/{keystore-TxeYM7an.mjs → keystore-B4PRlbgE.mjs} +5 -7
- package/dist/keystore-B4PRlbgE.mjs.map +1 -0
- package/dist/{keystore-C9rint2E.cjs → keystore-DgGRj2Yy.cjs} +23 -26
- package/dist/keystore-DgGRj2Yy.cjs.map +1 -0
- package/dist/{openapi-DaKlTKxz.cjs → openapi-Dcbme-Us.cjs} +134 -171
- package/dist/openapi-Dcbme-Us.cjs.map +1 -0
- package/dist/openapi-react-query.cjs +156 -2
- package/dist/openapi-react-query.cjs.map +1 -0
- package/dist/openapi-react-query.d.cts +1 -3
- package/dist/openapi-react-query.d.cts.map +1 -1
- package/dist/openapi-react-query.d.mts +1 -3
- package/dist/openapi-react-query.d.mts.map +1 -1
- package/dist/openapi-react-query.mjs +156 -2
- package/dist/openapi-react-query.mjs.map +1 -0
- package/dist/{openapi-y1d7Kalt.mjs → openapi-vy4JzhUv.mjs} +76 -106
- package/dist/openapi-vy4JzhUv.mjs.map +1 -0
- package/dist/openapi.cjs +3 -6
- package/dist/openapi.d.cts +8 -11
- package/dist/openapi.d.cts.map +1 -1
- package/dist/openapi.d.mts +8 -11
- package/dist/openapi.d.mts.map +1 -1
- package/dist/openapi.mjs +2 -6
- package/dist/reconcile/public.cjs +4 -4
- package/dist/reconcile/public.d.cts +8 -26
- package/dist/reconcile/public.d.cts.map +1 -1
- package/dist/reconcile/public.d.mts +8 -26
- package/dist/reconcile/public.d.mts.map +1 -1
- package/dist/reconcile/public.mjs +3 -4
- package/dist/{reconcile-CYMhFSYy.cjs → reconcile-Dd2iyILf.cjs} +4 -7
- package/dist/reconcile-Dd2iyILf.cjs.map +1 -0
- package/dist/{reconcile-C13ERt1U.mjs → reconcile-DhQ00DpU.mjs} +4 -7
- package/dist/reconcile-DhQ00DpU.mjs.map +1 -0
- package/dist/rolldown-runtime-BhDjJH2R.mjs +15 -0
- package/dist/{chunk-CUT6urMc.cjs → rolldown-runtime-C0BPl7ul.cjs} +23 -10
- package/dist/{storage-CSNplaJn.cjs → storage-C-30BD1e.cjs} +59 -69
- package/dist/storage-C-30BD1e.cjs.map +1 -0
- package/dist/{storage-B020InPW.mjs → storage-P_b3w7uj.mjs} +22 -13
- package/dist/storage-P_b3w7uj.mjs.map +1 -0
- package/dist/{sync-CzHXiR9c.mjs → sync-B3xxXtJT.mjs} +18 -6
- package/dist/sync-B3xxXtJT.mjs.map +1 -0
- package/dist/{sync-0ILCb-1S.cjs → sync-D7uTIIEi.cjs} +43 -25
- package/dist/sync-D7uTIIEi.cjs.map +1 -0
- package/dist/types-BGo5TaNE.d.mts +6164 -0
- package/dist/types-BGo5TaNE.d.mts.map +1 -0
- package/dist/types-C5ZNpUad.d.cts +6165 -0
- package/dist/types-C5ZNpUad.d.cts.map +1 -0
- package/dist/workspace/index.cjs +3 -3
- package/dist/workspace/index.d.cts +3 -3
- package/dist/workspace/index.d.mts +3 -3
- package/dist/workspace/index.mjs +2 -3
- package/dist/{workspace-DaEX7FEg.mjs → workspace-CgwmXEtc.mjs} +725 -871
- package/dist/workspace-CgwmXEtc.mjs.map +1 -0
- package/dist/{workspace-C-a3G_U0.cjs → workspace-mFpI_ky_.cjs} +894 -1041
- package/dist/workspace-mFpI_ky_.cjs.map +1 -0
- package/package.json +14 -14
- package/dist/CachedStateProvider-BEBl2wQT.cjs +0 -60
- package/dist/CachedStateProvider-BEBl2wQT.cjs.map +0 -1
- package/dist/CachedStateProvider-C-8wtlto.mjs +0 -3
- package/dist/CachedStateProvider-Co4n5Wvs.mjs +0 -54
- package/dist/CachedStateProvider-Co4n5Wvs.mjs.map +0 -1
- package/dist/CachedStateProvider-DqhGpzsm.cjs +0 -3
- package/dist/HostingerProvider-BOvsgATO.cjs.map +0 -1
- package/dist/HostingerProvider-BcyFRbqV.mjs.map +0 -1
- package/dist/LocalStateProvider-Bq-0C0sg.mjs.map +0 -1
- package/dist/LocalStateProvider-yjXZXZDM.cjs.map +0 -1
- package/dist/Route53Provider-C0xmer8U.mjs.map +0 -1
- package/dist/Route53Provider-CH9XH7bz.cjs.map +0 -1
- package/dist/SSMStateProvider-CXtNgPfy.cjs.map +0 -1
- package/dist/SSMStateProvider-DOZifZfE.mjs.map +0 -1
- package/dist/backup-provisioner-DXXg6FIL.mjs.map +0 -1
- package/dist/backup-provisioner-cE2PuCTb.cjs.map +0 -1
- package/dist/bundler-CaTGtiaO.cjs.map +0 -1
- package/dist/bundler-S3ek7ea-.mjs.map +0 -1
- package/dist/chunk-Duj1WY3L.mjs +0 -7
- package/dist/config-B0L2tvvC.mjs.map +0 -1
- package/dist/config-HhDpJmLO.cjs.map +0 -1
- package/dist/credentials-B2Pyh3bJ.cjs.map +0 -1
- package/dist/credentials-B5zRHdAl.mjs +0 -141
- package/dist/credentials-B5zRHdAl.mjs.map +0 -1
- package/dist/credentials-BapzjyV5.cjs +0 -195
- package/dist/credentials-BapzjyV5.cjs.map +0 -1
- package/dist/credentials-CZrys9C5.mjs.map +0 -1
- package/dist/discover-CAlFgYec.mjs.map +0 -1
- package/dist/discover-DTmFeloL.cjs.map +0 -1
- package/dist/dokploy-api-5cK2InBm.cjs +0 -3
- package/dist/dokploy-api-D2Ny4Jrc.mjs +0 -3
- package/dist/dokploy-api-pdaBryoY.mjs +0 -706
- package/dist/dokploy-api-pdaBryoY.mjs.map +0 -1
- package/dist/dokploy-api-zqKe9lHH.cjs +0 -718
- package/dist/dokploy-api-zqKe9lHH.cjs.map +0 -1
- package/dist/emit-CIlvnDvV.mjs.map +0 -1
- package/dist/emit-CUD1BWls.cjs.map +0 -1
- package/dist/encryption-D2pL3tHH.cjs +0 -54
- package/dist/encryption-D2pL3tHH.cjs.map +0 -1
- package/dist/encryption-YDsXXi6w.mjs +0 -3
- package/dist/encryption-_4zwjOAR.mjs +0 -42
- package/dist/encryption-_4zwjOAR.mjs.map +0 -1
- package/dist/encryption-sQ2Oxx0d.cjs +0 -4
- package/dist/fullstack-secrets-D6MyHhQP.cjs.map +0 -1
- package/dist/fullstack-secrets-METaRLS1.mjs.map +0 -1
- package/dist/generator-CNzBw7g5.cjs.map +0 -1
- package/dist/generator-VE2JrFlY.mjs.map +0 -1
- package/dist/github-CrpsXSfV.mjs.map +0 -1
- package/dist/index-Ayxg_DQY.d.mts.map +0 -1
- package/dist/index-CR5urhWX.d.cts.map +0 -1
- package/dist/keystore-C9rint2E.cjs.map +0 -1
- package/dist/keystore-TxeYM7an.mjs.map +0 -1
- package/dist/openapi-DaKlTKxz.cjs.map +0 -1
- package/dist/openapi-react-query-BKH334Ug.cjs +0 -173
- package/dist/openapi-react-query-BKH334Ug.cjs.map +0 -1
- package/dist/openapi-react-query-DoR5CmzQ.mjs +0 -167
- package/dist/openapi-react-query-DoR5CmzQ.mjs.map +0 -1
- package/dist/openapi-y1d7Kalt.mjs.map +0 -1
- package/dist/reconcile-C13ERt1U.mjs.map +0 -1
- package/dist/reconcile-CYMhFSYy.cjs.map +0 -1
- package/dist/setup-BWgMs4gg.mjs +0 -12
- package/dist/setup-DOv92pIu.cjs +0 -473
- package/dist/setup-DOv92pIu.cjs.map +0 -1
- package/dist/setup-DQo_h_yK.mjs +0 -443
- package/dist/setup-DQo_h_yK.mjs.map +0 -1
- package/dist/setup-lCx_DcUo.cjs +0 -12
- package/dist/storage-B020InPW.mjs.map +0 -1
- package/dist/storage-CSNplaJn.cjs.map +0 -1
- package/dist/storage-DGBzMLZa.mjs +0 -4
- package/dist/storage-DlVol_oj.cjs +0 -8
- package/dist/sync-0ILCb-1S.cjs.map +0 -1
- package/dist/sync-CzHXiR9c.mjs.map +0 -1
- package/dist/sync-DYENfOt4.cjs +0 -4
- package/dist/sync-HAau6h_R.mjs +0 -3
- package/dist/types-CL7jPFM2.d.mts +0 -2220
- package/dist/types-CL7jPFM2.d.mts.map +0 -1
- package/dist/types-Y3fKQSAK.d.cts +0 -2220
- package/dist/types-Y3fKQSAK.d.cts.map +0 -1
- package/dist/workspace-C-a3G_U0.cjs.map +0 -1
- package/dist/workspace-DQxxs7Jk.cjs +0 -10
- package/dist/workspace-DaEX7FEg.mjs.map +0 -1
- package/dist/workspace-DbI580qS.mjs +0 -9
|
@@ -1,13 +1,12 @@
|
|
|
1
|
-
import { ConstructGenerator
|
|
2
|
-
import { loadWorkspaceConfig } from "./config-
|
|
3
|
-
import { dirname, join, relative, resolve } from "node:path";
|
|
4
|
-
import { kebabCase } from "@geekmidas/manifest";
|
|
1
|
+
import { r as ConstructGenerator } from "./discover-CK-n3w6b.mjs";
|
|
2
|
+
import { o as loadWorkspaceConfig } from "./config-pqGD3hF9.mjs";
|
|
5
3
|
import { mkdir, writeFile } from "node:fs/promises";
|
|
4
|
+
import { dirname, join, relative, resolve } from "node:path";
|
|
6
5
|
import { spawn } from "node:child_process";
|
|
6
|
+
import { kebabCase } from "@geekmidas/manifest";
|
|
7
7
|
import { Endpoint } from "@geekmidas/constructs/endpoints";
|
|
8
8
|
import { fileURLToPath } from "node:url";
|
|
9
9
|
import { StandardSchemaJsonSchema, getRegisteredZodJsonSchemas, getSchemaMetadata } from "@geekmidas/schema/conversion";
|
|
10
|
-
|
|
11
10
|
//#region src/build/endpoint-analyzer.ts
|
|
12
11
|
/**
|
|
13
12
|
* Analyze an endpoint to extract its features
|
|
@@ -84,7 +83,6 @@ function summarizeAnalysis(analyses) {
|
|
|
84
83
|
byFeature
|
|
85
84
|
};
|
|
86
85
|
}
|
|
87
|
-
|
|
88
86
|
//#endregion
|
|
89
87
|
//#region src/build/handler-templates.ts
|
|
90
88
|
/**
|
|
@@ -106,8 +104,7 @@ function generateMinimalHandler(analysis) {
|
|
|
106
104
|
const { exportName, features } = analysis;
|
|
107
105
|
const method = analysis.method.toLowerCase();
|
|
108
106
|
const validators = generateValidators(exportName, features);
|
|
109
|
-
|
|
110
|
-
if (!hasValidators && !features.hasOutputValidation) return `
|
|
107
|
+
if (!(validators.length > 0) && !features.hasOutputValidation) return `
|
|
111
108
|
// Minimal handler: ${analysis.route} (${analysis.method})
|
|
112
109
|
app.${method}('${analysis.route}', async (c) => {
|
|
113
110
|
const result = await ${exportName}.handler(
|
|
@@ -305,8 +302,7 @@ ${factories.join("\n")}
|
|
|
305
302
|
*/
|
|
306
303
|
function generateMinimalEndpointFile(analysis, endpointImport) {
|
|
307
304
|
const { exportName, features } = analysis;
|
|
308
|
-
const
|
|
309
|
-
const validatorImport = needsValidators ? generateValidatorImportsForEndpoint(analysis) : "";
|
|
305
|
+
const validatorImport = features.hasBodyValidation || features.hasQueryValidation || features.hasParamValidation ? generateValidatorImportsForEndpoint(analysis) : "";
|
|
310
306
|
const handler = generateMinimalHandler(analysis);
|
|
311
307
|
return `/**
|
|
312
308
|
* Minimal endpoint: ${analysis.route} (${analysis.method})
|
|
@@ -331,8 +327,7 @@ ${handler}
|
|
|
331
327
|
*/
|
|
332
328
|
function generateStandardEndpointFile(analysis, endpointImport) {
|
|
333
329
|
const { exportName, features } = analysis;
|
|
334
|
-
const
|
|
335
|
-
const validatorImport = needsValidators ? generateValidatorImportsForEndpoint(analysis) : "";
|
|
330
|
+
const validatorImport = features.hasBodyValidation || features.hasQueryValidation || features.hasParamValidation ? generateValidatorImportsForEndpoint(analysis) : "";
|
|
336
331
|
const eventsImport = features.hasEvents ? `import { publishConstructEvents } from '@geekmidas/constructs/endpoints';` : "";
|
|
337
332
|
const handler = generateStandardHandler(analysis);
|
|
338
333
|
return `/**
|
|
@@ -424,7 +419,7 @@ export function setupFullEndpoints(
|
|
|
424
419
|
}
|
|
425
420
|
const imports = tierEndpoints.map((a) => `import { setup${capitalize(a.exportName)} } from './${a.exportName}.js';`).join("\n");
|
|
426
421
|
if (tier === "minimal") {
|
|
427
|
-
const calls
|
|
422
|
+
const calls = tierEndpoints.map((a) => ` setup${capitalize(a.exportName)}(app, logger);`).join("\n");
|
|
428
423
|
return `/**
|
|
429
424
|
* Minimal-tier endpoint index (${tierEndpoints.length} endpoints)
|
|
430
425
|
* Near-raw-Hono performance
|
|
@@ -437,12 +432,12 @@ export function setupMinimalEndpoints(
|
|
|
437
432
|
app: Hono,
|
|
438
433
|
logger: Logger,
|
|
439
434
|
): void {
|
|
440
|
-
${calls
|
|
435
|
+
${calls}
|
|
441
436
|
}
|
|
442
437
|
`;
|
|
443
438
|
}
|
|
444
439
|
if (tier === "standard") {
|
|
445
|
-
const calls
|
|
440
|
+
const calls = tierEndpoints.map((a) => ` setup${capitalize(a.exportName)}(app, serviceDiscovery, logger);`).join("\n");
|
|
446
441
|
return `/**
|
|
447
442
|
* Standard-tier endpoint index (${tierEndpoints.length} endpoints)
|
|
448
443
|
* Auth and/or services enabled
|
|
@@ -457,7 +452,7 @@ export function setupStandardEndpoints(
|
|
|
457
452
|
serviceDiscovery: ServiceDiscovery<any, any>,
|
|
458
453
|
logger: Logger,
|
|
459
454
|
): void {
|
|
460
|
-
${calls
|
|
455
|
+
${calls}
|
|
461
456
|
}
|
|
462
457
|
`;
|
|
463
458
|
}
|
|
@@ -527,9 +522,7 @@ function generateEndpointFilesNested(analyses, endpointImports) {
|
|
|
527
522
|
case "standard":
|
|
528
523
|
files[fileName] = generateStandardEndpointFile(analysis, endpointImport);
|
|
529
524
|
break;
|
|
530
|
-
case "full":
|
|
531
|
-
files[fileName] = generateFullEndpointFile(analysis, endpointImport);
|
|
532
|
-
break;
|
|
525
|
+
case "full": files[fileName] = generateFullEndpointFile(analysis, endpointImport);
|
|
533
526
|
}
|
|
534
527
|
}
|
|
535
528
|
return files;
|
|
@@ -586,7 +579,6 @@ export async function setupEndpoints(
|
|
|
586
579
|
}
|
|
587
580
|
`;
|
|
588
581
|
}
|
|
589
|
-
|
|
590
582
|
//#endregion
|
|
591
583
|
//#region src/generators/EndpointGenerator.ts
|
|
592
584
|
/**
|
|
@@ -732,8 +724,7 @@ var EndpointGenerator = class extends ConstructGenerator {
|
|
|
732
724
|
async generateHandlerFile(outputDir, sourceFile, exportName, provider, _endpoint, context) {
|
|
733
725
|
const handlerFileName = `${exportName}.ts`;
|
|
734
726
|
const handlerPath = join(outputDir, handlerFileName);
|
|
735
|
-
const
|
|
736
|
-
const importPath = relativePath.replace(/\.ts$/, ".js");
|
|
727
|
+
const importPath = relative(dirname(handlerPath), sourceFile).replace(/\.ts$/, ".js");
|
|
737
728
|
let content;
|
|
738
729
|
switch (provider) {
|
|
739
730
|
case "aws-apigatewayv1":
|
|
@@ -751,12 +742,10 @@ var EndpointGenerator = class extends ConstructGenerator {
|
|
|
751
742
|
return handlerPath;
|
|
752
743
|
}
|
|
753
744
|
async generateEndpointsFile(outputDir, endpoints, context) {
|
|
754
|
-
const
|
|
755
|
-
const endpointsPath = join(outputDir, endpointsFileName);
|
|
745
|
+
const endpointsPath = join(outputDir, "endpoints.ts");
|
|
756
746
|
const importsByFile = /* @__PURE__ */ new Map();
|
|
757
747
|
for (const { path, key } of endpoints) {
|
|
758
|
-
const
|
|
759
|
-
const importPath = relativePath.replace(/\.ts$/, ".js");
|
|
748
|
+
const importPath = relative(dirname(endpointsPath), path.relative).replace(/\.ts$/, ".js");
|
|
760
749
|
if (!importsByFile.has(importPath)) importsByFile.set(importPath, []);
|
|
761
750
|
importsByFile.get(importPath)?.push(key);
|
|
762
751
|
}
|
|
@@ -822,11 +811,9 @@ export async function setupEndpoints(
|
|
|
822
811
|
const analyses = endpoints.map(({ key, construct }) => analyzeEndpoint(construct, key));
|
|
823
812
|
const endpointImports = endpoints.map(({ key, path }) => {
|
|
824
813
|
const tierDir = join(endpointsDir, "standard");
|
|
825
|
-
const relativePath = relative(tierDir, path.relative);
|
|
826
|
-
const importPath = relativePath.replace(/\.ts$/, ".js");
|
|
827
814
|
return {
|
|
828
815
|
exportName: key,
|
|
829
|
-
importPath
|
|
816
|
+
importPath: relative(tierDir, path.relative).replace(/\.ts$/, ".js")
|
|
830
817
|
};
|
|
831
818
|
});
|
|
832
819
|
const summary = summarizeAnalysis(analyses);
|
|
@@ -848,8 +835,7 @@ export async function setupEndpoints(
|
|
|
848
835
|
}
|
|
849
836
|
async generateAppFile(outputDir, context) {
|
|
850
837
|
if (context.production?.enabled) return this.generateProductionAppFile(outputDir, context);
|
|
851
|
-
const
|
|
852
|
-
const appPath = join(outputDir, appFileName);
|
|
838
|
+
const appPath = join(outputDir, "app.ts");
|
|
853
839
|
const runtime = runtimeFor(context, dirname(appPath));
|
|
854
840
|
const telescopeEnabled = context.telescope?.enabled;
|
|
855
841
|
const telescopeWebSocketEnabled = context.telescope?.websocket;
|
|
@@ -859,32 +845,35 @@ export async function setupEndpoints(
|
|
|
859
845
|
const studioFromDatabase = !usesExternalStudio && !!context.studio?.database;
|
|
860
846
|
const telescopeFromSurface = !!context.surface?.module && !usesExternalTelescope;
|
|
861
847
|
let telescopeImports = "";
|
|
862
|
-
if (telescopeEnabled)
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
848
|
+
if (telescopeEnabled) {
|
|
849
|
+
if (telescopeFromSurface) telescopeImports = "import { createMiddleware, createUI } from '@geekmidas/telescope/hono';";
|
|
850
|
+
else if (usesExternalTelescope) {
|
|
851
|
+
const relativeTelescopePath = relative(dirname(appPath), context.telescope?.telescopePath);
|
|
852
|
+
telescopeImports = `import ${context.telescope?.telescopeImportPattern} from '${relativeTelescopePath}';
|
|
866
853
|
import { createMiddleware, createUI } from '@geekmidas/telescope/hono';`;
|
|
867
|
-
|
|
854
|
+
} else telescopeImports = `import { Telescope, InMemoryStorage } from '@geekmidas/telescope';
|
|
868
855
|
import { createMiddleware, createUI } from '@geekmidas/telescope/hono';`;
|
|
856
|
+
}
|
|
869
857
|
let studioImports = "";
|
|
870
|
-
if (studioEnabled)
|
|
871
|
-
|
|
872
|
-
|
|
858
|
+
if (studioEnabled) {
|
|
859
|
+
if (usesExternalStudio) {
|
|
860
|
+
const relativeStudioPath = relative(dirname(appPath), context.studio?.studioPath);
|
|
861
|
+
studioImports = `import ${context.studio?.studioImportPattern} from '${relativeStudioPath}';
|
|
873
862
|
import { createStudioApp } from '@geekmidas/studio/server/hono';`;
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
863
|
+
} else if (studioFromDatabase) {
|
|
864
|
+
const dbSpecifier = importSpecifier(dirname(appPath), context.studio.database.specifier);
|
|
865
|
+
studioImports = `import { snifferContext } from '@geekmidas/constructs';
|
|
877
866
|
import { Direction, InMemoryMonitoringStorage, Studio } from '@geekmidas/studio';
|
|
878
867
|
import { ${context.studio.database.exportName} as __studioDb } from '${dbSpecifier}';
|
|
879
868
|
import { createStudioApp } from '@geekmidas/studio/server/hono';`;
|
|
880
|
-
|
|
869
|
+
} else studioImports = "";
|
|
870
|
+
}
|
|
881
871
|
const cors = corsFor(context.surface);
|
|
882
872
|
let hooksImports = "";
|
|
883
873
|
let beforeSetupCall = "";
|
|
884
874
|
let afterSetupCall = "";
|
|
885
875
|
if (context.hooks?.serverHooksPath) {
|
|
886
|
-
|
|
887
|
-
hooksImports = `import * as serverHooks from '${relativeHooksPath}';`;
|
|
876
|
+
hooksImports = `import * as serverHooks from '${relative(dirname(appPath), context.hooks.serverHooksPath)}';`;
|
|
888
877
|
beforeSetupCall = `
|
|
889
878
|
// Call beforeSetup hook if defined
|
|
890
879
|
if (typeof serverHooks.beforeSetup === 'function') {
|
|
@@ -930,7 +919,8 @@ import { createStudioApp } from '@geekmidas/studio/server/hono';`;
|
|
|
930
919
|
}
|
|
931
920
|
` : "";
|
|
932
921
|
let telescopeSetup = "";
|
|
933
|
-
if (telescopeEnabled)
|
|
922
|
+
if (telescopeEnabled) {
|
|
923
|
+
if (telescopeFromSurface || usesExternalTelescope) telescopeSetup = `
|
|
934
924
|
${telescopeWebSocketSetupCode}
|
|
935
925
|
// Add telescope middleware (before endpoints to capture all requests)
|
|
936
926
|
honoApp.use('*', createMiddleware(telescope));
|
|
@@ -939,7 +929,7 @@ ${telescopeWebSocketSetupCode}
|
|
|
939
929
|
const telescopeUI = createUI(telescope);
|
|
940
930
|
honoApp.route('${context.telescope?.path}', telescopeUI);
|
|
941
931
|
`;
|
|
942
|
-
|
|
932
|
+
else telescopeSetup = `
|
|
943
933
|
// Setup Telescope for debugging/monitoring
|
|
944
934
|
const telescopeStorage = new InMemoryStorage({ maxEntries: ${context.telescope?.maxEntries} });
|
|
945
935
|
const telescope = new Telescope({
|
|
@@ -957,6 +947,7 @@ ${telescopeWebSocketSetupCode}
|
|
|
957
947
|
const telescopeUI = createUI(telescope);
|
|
958
948
|
honoApp.route('${context.telescope?.path}', telescopeUI);
|
|
959
949
|
`;
|
|
950
|
+
}
|
|
960
951
|
let studioSetup = "";
|
|
961
952
|
if (studioEnabled && studioFromDatabase) studioSetup = `
|
|
962
953
|
// Studio, built from the declared database. The client comes from the
|
|
@@ -1152,8 +1143,7 @@ export const handler = ${exportName};
|
|
|
1152
1143
|
* No dev tools (Telescope, Studio, WebSocket), includes health checks and graceful shutdown
|
|
1153
1144
|
*/
|
|
1154
1145
|
async generateProductionAppFile(outputDir, context) {
|
|
1155
|
-
const
|
|
1156
|
-
const appPath = join(outputDir, appFileName);
|
|
1146
|
+
const appPath = join(outputDir, "app.ts");
|
|
1157
1147
|
const runtime = runtimeFor(context, dirname(appPath));
|
|
1158
1148
|
const production = context.production;
|
|
1159
1149
|
const healthCheckPath = production.healthCheck;
|
|
@@ -1165,8 +1155,7 @@ export const handler = ${exportName};
|
|
|
1165
1155
|
let beforeSetupCall = "";
|
|
1166
1156
|
let afterSetupCall = "";
|
|
1167
1157
|
if (context.hooks?.serverHooksPath) {
|
|
1168
|
-
|
|
1169
|
-
hooksImports = `import * as serverHooks from '${relativeHooksPath}';`;
|
|
1158
|
+
hooksImports = `import * as serverHooks from '${relative(dirname(appPath), context.hooks.serverHooksPath)}';`;
|
|
1170
1159
|
beforeSetupCall = `
|
|
1171
1160
|
// Call beforeSetup hook if defined
|
|
1172
1161
|
if (typeof serverHooks.beforeSetup === 'function') {
|
|
@@ -1215,7 +1204,6 @@ import { setupCrons } from './crons.js';` : "";
|
|
|
1215
1204
|
process.on('SIGTERM', shutdown);
|
|
1216
1205
|
process.on('SIGINT', shutdown);
|
|
1217
1206
|
` : "";
|
|
1218
|
-
const endpointsImportPath = production.optimizedHandlers ? "./endpoints/index.js" : "./endpoints.js";
|
|
1219
1207
|
const content = `/**
|
|
1220
1208
|
* Generated production server application
|
|
1221
1209
|
*
|
|
@@ -1227,7 +1215,7 @@ import { setupCrons } from './crons.js';` : "";
|
|
|
1227
1215
|
*/
|
|
1228
1216
|
import { Hono } from 'hono';
|
|
1229
1217
|
import type { Hono as HonoType } from 'hono';
|
|
1230
|
-
import { setupEndpoints } from '${
|
|
1218
|
+
import { setupEndpoints } from '${production.optimizedHandlers ? "./endpoints/index.js" : "./endpoints.js"}';
|
|
1231
1219
|
${subscriberImport}
|
|
1232
1220
|
${runtime.imports}
|
|
1233
1221
|
${runtime.bindings}
|
|
@@ -1294,7 +1282,7 @@ export default createApp;
|
|
|
1294
1282
|
*/
|
|
1295
1283
|
async generateProductionServerEntry(outputDir) {
|
|
1296
1284
|
const serverPath = join(outputDir, "server.ts");
|
|
1297
|
-
|
|
1285
|
+
await writeFile(serverPath, `#!/usr/bin/env node
|
|
1298
1286
|
/**
|
|
1299
1287
|
* Production server entry point
|
|
1300
1288
|
* Generated by 'gkm build --provider server --production'
|
|
@@ -1310,11 +1298,9 @@ await start({
|
|
|
1310
1298
|
port,
|
|
1311
1299
|
serve: (app, port) => { serve({ fetch: app.fetch, port }); },
|
|
1312
1300
|
});
|
|
1313
|
-
|
|
1314
|
-
await writeFile(serverPath, content);
|
|
1301
|
+
`);
|
|
1315
1302
|
}
|
|
1316
1303
|
};
|
|
1317
|
-
|
|
1318
1304
|
//#endregion
|
|
1319
1305
|
//#region src/generators/OpenApiTsGenerator.ts
|
|
1320
1306
|
/**
|
|
@@ -1469,7 +1455,7 @@ var OpenApiTsGenerator = class {
|
|
|
1469
1455
|
for (const [rawName, rawSchema] of Object.entries(registrySchemas)) {
|
|
1470
1456
|
const defName = this.pascalCase(rawName);
|
|
1471
1457
|
if (collectedDefs.has(defName) || generatedNames.has(defName)) continue;
|
|
1472
|
-
const { id: _id, $defs: _defs
|
|
1458
|
+
const { id: _id, $defs: _defs, ...rest } = rawSchema;
|
|
1473
1459
|
collectedDefs.set(defName, rest);
|
|
1474
1460
|
}
|
|
1475
1461
|
for (const [defName, defSchema] of collectedDefs) if (!generatedNames.has(defName)) {
|
|
@@ -1505,17 +1491,17 @@ var OpenApiTsGenerator = class {
|
|
|
1505
1491
|
async schemaToInterfaceWithDefs(schema, name, collectedDefs) {
|
|
1506
1492
|
try {
|
|
1507
1493
|
const vendor = schema["~standard"]?.vendor;
|
|
1508
|
-
if (!vendor || !(vendor in StandardSchemaJsonSchema)) return
|
|
1494
|
+
if (!vendor || !(vendor in StandardSchemaJsonSchema)) return unknownType(name);
|
|
1509
1495
|
const toJsonSchema = StandardSchemaJsonSchema[vendor];
|
|
1510
1496
|
const jsonSchema = await toJsonSchema(schema);
|
|
1511
|
-
if (!jsonSchema) return
|
|
1497
|
+
if (!jsonSchema) return unknownType(name);
|
|
1512
1498
|
if (jsonSchema.$defs && typeof jsonSchema.$defs === "object") {
|
|
1513
1499
|
for (const [defName, defSchema] of Object.entries(jsonSchema.$defs)) if (!collectedDefs.has(defName)) {
|
|
1514
|
-
const { id
|
|
1500
|
+
const { id, ...schemaWithoutId } = defSchema;
|
|
1515
1501
|
collectedDefs.set(defName, schemaWithoutId);
|
|
1516
1502
|
}
|
|
1517
1503
|
}
|
|
1518
|
-
const { $defs
|
|
1504
|
+
const { $defs, ...schemaWithoutDefs } = jsonSchema;
|
|
1519
1505
|
const ref = schemaWithoutDefs.$ref;
|
|
1520
1506
|
if (ref && Object.keys(schemaWithoutDefs).every((k) => k === "$ref" || k === "$schema")) {
|
|
1521
1507
|
const target = ref.split("/").pop();
|
|
@@ -1523,14 +1509,11 @@ var OpenApiTsGenerator = class {
|
|
|
1523
1509
|
}
|
|
1524
1510
|
return this.jsonSchemaToInterface(schemaWithoutDefs, name);
|
|
1525
1511
|
} catch {
|
|
1526
|
-
return
|
|
1512
|
+
return unknownType(name);
|
|
1527
1513
|
}
|
|
1528
1514
|
}
|
|
1529
1515
|
jsonSchemaToInterface(schema, name) {
|
|
1530
|
-
if (schema.type !== "object" || !schema.properties) {
|
|
1531
|
-
const typeStr = this.jsonSchemaTypeToTs(schema);
|
|
1532
|
-
return `export type ${name} = ${typeStr};`;
|
|
1533
|
-
}
|
|
1516
|
+
if (schema.type !== "object" || !schema.properties) return `export type ${name} = ${this.jsonSchemaTypeToTs(schema)};`;
|
|
1534
1517
|
const props = [];
|
|
1535
1518
|
const required = new Set(schema.required || []);
|
|
1536
1519
|
for (const [propName, propSchema] of Object.entries(schema.properties)) {
|
|
@@ -1543,13 +1526,15 @@ var OpenApiTsGenerator = class {
|
|
|
1543
1526
|
}
|
|
1544
1527
|
jsonSchemaTypeToTs(schema) {
|
|
1545
1528
|
if (!schema) return "unknown";
|
|
1546
|
-
if (schema.$ref)
|
|
1547
|
-
|
|
1548
|
-
return refName;
|
|
1549
|
-
}
|
|
1529
|
+
if (schema.$ref) return schema.$ref.split("/").pop() || "unknown";
|
|
1530
|
+
if (schema.const !== void 0) return typeof schema.const === "string" ? `'${schema.const}'` : String(schema.const);
|
|
1550
1531
|
if (schema.anyOf) return schema.anyOf.map((s) => this.jsonSchemaTypeToTs(s)).join(" | ");
|
|
1551
1532
|
if (schema.oneOf) return schema.oneOf.map((s) => this.jsonSchemaTypeToTs(s)).join(" | ");
|
|
1552
1533
|
if (schema.allOf) return schema.allOf.map((s) => this.jsonSchemaTypeToTs(s)).join(" & ");
|
|
1534
|
+
if (Array.isArray(schema.type)) return schema.type.map((type) => this.jsonSchemaTypeToTs({
|
|
1535
|
+
...schema,
|
|
1536
|
+
type
|
|
1537
|
+
})).join(" | ");
|
|
1553
1538
|
switch (schema.type) {
|
|
1554
1539
|
case "string":
|
|
1555
1540
|
if (schema.enum) return schema.enum.map((e) => `'${e}'`).join(" | ");
|
|
@@ -1573,10 +1558,7 @@ var OpenApiTsGenerator = class {
|
|
|
1573
1558
|
}
|
|
1574
1559
|
return `{ ${props.join("; ")} }`;
|
|
1575
1560
|
}
|
|
1576
|
-
if (schema.additionalProperties) {
|
|
1577
|
-
const valueType = this.jsonSchemaTypeToTs(schema.additionalProperties);
|
|
1578
|
-
return `Record<string, ${valueType}>`;
|
|
1579
|
-
}
|
|
1561
|
+
if (schema.additionalProperties) return `Record<string, ${this.jsonSchemaTypeToTs(schema.additionalProperties)}>`;
|
|
1580
1562
|
return "Record<string, unknown>";
|
|
1581
1563
|
default: return "unknown";
|
|
1582
1564
|
}
|
|
@@ -1597,10 +1579,7 @@ var OpenApiTsGenerator = class {
|
|
|
1597
1579
|
}
|
|
1598
1580
|
const firstWithParams = infos.find((i) => i.input?.params);
|
|
1599
1581
|
let paramsEntry = "";
|
|
1600
|
-
if (firstWithParams?.input?.params) {
|
|
1601
|
-
const paramsName = await this.getSchemaName(firstWithParams.input.params, `${this.getSchemaBaseName(firstWithParams)}Params`);
|
|
1602
|
-
paramsEntry = `\n parameters: {\n path: ${paramsName};\n };`;
|
|
1603
|
-
}
|
|
1582
|
+
if (firstWithParams?.input?.params) paramsEntry = `\n parameters: {\n path: ${await this.getSchemaName(firstWithParams.input.params, `${this.getSchemaBaseName(firstWithParams)}Params`)};\n };`;
|
|
1604
1583
|
pathEntries.push(` '${route}': {${paramsEntry}\n${methodEntries.join("\n")}\n };`);
|
|
1605
1584
|
}
|
|
1606
1585
|
return `export interface paths {\n${pathEntries.join("\n")}\n}`;
|
|
@@ -1639,8 +1618,7 @@ var OpenApiTsGenerator = class {
|
|
|
1639
1618
|
return acc;
|
|
1640
1619
|
}, {});
|
|
1641
1620
|
const schemeNames = securitySchemes.map((s) => `'${s.name}'`).join(" | ");
|
|
1642
|
-
const
|
|
1643
|
-
const createApiSection = hasSecuritySchemes ? `
|
|
1621
|
+
const createApiSection = schemeNames.length > 0 ? `
|
|
1644
1622
|
// ============================================================
|
|
1645
1623
|
// API Client Factory
|
|
1646
1624
|
// ============================================================
|
|
@@ -1817,20 +1795,14 @@ ${createApiSection}
|
|
|
1817
1795
|
`;
|
|
1818
1796
|
}
|
|
1819
1797
|
};
|
|
1820
|
-
|
|
1821
|
-
//#endregion
|
|
1822
|
-
//#region src/workspace/client-generator.ts
|
|
1823
1798
|
/**
|
|
1824
|
-
*
|
|
1825
|
-
*
|
|
1826
|
-
*
|
|
1799
|
+
* The declaration for a schema that cannot be converted — a vendor with no
|
|
1800
|
+
* converter, or one that fails. The paths interface names it either way, so
|
|
1801
|
+
* leaving it undeclared made the generated client fail to compile.
|
|
1827
1802
|
*/
|
|
1828
|
-
function
|
|
1829
|
-
|
|
1830
|
-
if (isPartitionedRoutes(routes)) return Array.isArray(routes.paths) ? routes.paths : [routes.paths];
|
|
1831
|
-
return Array.isArray(routes) ? routes : [routes];
|
|
1803
|
+
function unknownType(name) {
|
|
1804
|
+
return `export type ${name} = unknown;`;
|
|
1832
1805
|
}
|
|
1833
|
-
|
|
1834
1806
|
//#endregion
|
|
1835
1807
|
//#region src/openapi.ts
|
|
1836
1808
|
/**
|
|
@@ -1873,8 +1845,7 @@ function resolveOpenApiConfig(config) {
|
|
|
1873
1845
|
* directories under it — not a `routes` field anybody wrote.
|
|
1874
1846
|
*/
|
|
1875
1847
|
async function generateOpenApiFrom(routes, options = {}) {
|
|
1876
|
-
|
|
1877
|
-
return generateOpenApi(loaded.map(({ construct }) => construct), options);
|
|
1848
|
+
return generateOpenApi((await new EndpointGenerator().load(routes, void 0, options.bustCache)).map(({ construct }) => construct), options);
|
|
1878
1849
|
}
|
|
1879
1850
|
/**
|
|
1880
1851
|
* Generate an OpenAPI spec for each surface these endpoints name.
|
|
@@ -1910,8 +1881,8 @@ async function generateOpenApi(endpoints, options = {}) {
|
|
|
1910
1881
|
const tsGenerator = new OpenApiTsGenerator();
|
|
1911
1882
|
const written = [];
|
|
1912
1883
|
for (const [surfaceId, surfaceEndpoints] of bySurface) {
|
|
1913
|
-
const relative
|
|
1914
|
-
const outputPath = join(process.cwd(), relative
|
|
1884
|
+
const relative = openApiPathFor(surfaceId);
|
|
1885
|
+
const outputPath = join(process.cwd(), relative);
|
|
1915
1886
|
await mkdir(dirname(outputPath), { recursive: true });
|
|
1916
1887
|
const tsContent = await tsGenerator.generate(surfaceEndpoints, {
|
|
1917
1888
|
title: openApiConfig.title ?? surfaceId,
|
|
@@ -1919,8 +1890,8 @@ async function generateOpenApi(endpoints, options = {}) {
|
|
|
1919
1890
|
description: openApiConfig.description
|
|
1920
1891
|
});
|
|
1921
1892
|
await writeFile(outputPath, tsContent);
|
|
1922
|
-
written.push(relative
|
|
1923
|
-
logger.log(`📄 OpenAPI client generated: ${relative
|
|
1893
|
+
written.push(relative);
|
|
1894
|
+
logger.log(`📄 OpenAPI client generated: ${relative} (${surfaceEndpoints.length} endpoints)`);
|
|
1924
1895
|
}
|
|
1925
1896
|
return {
|
|
1926
1897
|
outputPath: join(process.cwd(), written[0]),
|
|
@@ -1975,8 +1946,7 @@ async function openapiCommand(options = {}) {
|
|
|
1975
1946
|
async function generateOpenApiForApp(workspaceRoot, _appName, app, silent = true) {
|
|
1976
1947
|
if (app.type !== "backend") return null;
|
|
1977
1948
|
const appPath = join(workspaceRoot, app.path);
|
|
1978
|
-
|
|
1979
|
-
return generateOpenApiFrom(globs, {
|
|
1949
|
+
return generateOpenApiFrom([join(appPath, "**/*.ts")], {
|
|
1980
1950
|
openapi: app.openapi ?? { enabled: true },
|
|
1981
1951
|
silent
|
|
1982
1952
|
});
|
|
@@ -1997,7 +1967,7 @@ function resolveGkmBinPath() {
|
|
|
1997
1967
|
*/
|
|
1998
1968
|
async function runOpenApiInSubprocess(appCwd, appName) {
|
|
1999
1969
|
const binPath = resolveGkmBinPath();
|
|
2000
|
-
await new Promise((resolve
|
|
1970
|
+
await new Promise((resolve, reject) => {
|
|
2001
1971
|
const child = spawn(process.execPath, [
|
|
2002
1972
|
binPath,
|
|
2003
1973
|
"openapi",
|
|
@@ -2010,12 +1980,12 @@ async function runOpenApiInSubprocess(appCwd, appName) {
|
|
|
2010
1980
|
});
|
|
2011
1981
|
child.on("error", reject);
|
|
2012
1982
|
child.on("close", (code) => {
|
|
2013
|
-
if (code === 0) resolve
|
|
2014
|
-
else reject(new Error(`OpenAPI generation for app "${appName}" exited with code ${code}`));
|
|
1983
|
+
if (code === 0) resolve();
|
|
1984
|
+
else reject(/* @__PURE__ */ new Error(`OpenAPI generation for app "${appName}" exited with code ${code}`));
|
|
2015
1985
|
});
|
|
2016
1986
|
});
|
|
2017
1987
|
}
|
|
2018
|
-
|
|
2019
1988
|
//#endregion
|
|
2020
|
-
export {
|
|
2021
|
-
|
|
1989
|
+
export { openapiCommand as a, runtimeFor as c, openApiPathFor as i, generateOpenApi as n, resolveOpenApiConfig as o, generateOpenApiFrom as r, EndpointGenerator as s, OPENAPI_OUTPUT_PATH as t };
|
|
1990
|
+
|
|
1991
|
+
//# sourceMappingURL=openapi-vy4JzhUv.mjs.map
|