theokit 0.56.0 → 0.57.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/dist/{actions-virtual-module-KJBCM7PP.js → actions-virtual-module-GMRXCAVN.js} +2 -2
- package/dist/{actions-virtual-module-3V7VG2YL.js → actions-virtual-module-XAWZOWSY.js} +3 -3
- package/dist/{agent-NLG77PFN.js → agent-LS7I3ZQB.js} +2 -2
- package/dist/{app-typed-client-ZO3VKJ3O.js → app-typed-client-NMKJ4DR7.js} +3 -3
- package/dist/{app-typed-client-XSXAORG6.js → app-typed-client-W74QO5LH.js} +2 -2
- package/dist/{build-4GQLIFTD.js → build-FHE72YXR.js} +4 -4
- package/dist/chunk-CLBJTDI6.js +189 -0
- package/dist/chunk-CLBJTDI6.js.map +1 -0
- package/dist/{chunk-XYVZJCZU.js → chunk-CMCEGW3B.js} +3 -3
- package/dist/{chunk-XYVZJCZU.js.map → chunk-CMCEGW3B.js.map} +1 -1
- package/dist/{chunk-MWWFXYW3.js → chunk-CTRVTBGY.js} +3 -3
- package/dist/chunk-CTRVTBGY.js.map +1 -0
- package/dist/{chunk-22ZZSUKD.js → chunk-G5JYB2LO.js} +2 -2
- package/dist/{chunk-5TPBOAAH.js → chunk-KEDRCI2L.js} +8 -8
- package/dist/{chunk-TUO2FE3S.js → chunk-NC2OPE22.js} +2 -2
- package/dist/{chunk-6PFF5HMY.js → chunk-OKDCBENR.js} +3 -3
- package/dist/{chunk-ZTIB4QSV.js → chunk-Q6HS3NFG.js} +6 -6
- package/dist/cli/index.js +6 -6
- package/dist/client/index.js +8 -5
- package/dist/client/index.js.map +1 -1
- package/dist/{dev-ZNTHPBBN.js → dev-WDKROZBS.js} +5 -5
- package/dist/index.js +2 -2
- package/dist/{internal-api-D76JZGSC.js → internal-api-732K3H75.js} +3 -3
- package/dist/{internal-api-JNX3MTIM.js → internal-api-EVJSGGO3.js} +2 -2
- package/dist/{mcp-IMY3NUCL.js → mcp-PBUCHHAS.js} +2 -2
- package/dist/{preview-K4NIQLAK.js → preview-VFIFKVP4.js} +3 -3
- package/dist/{server-boundary-NW6LNNGK.js → server-boundary-B6U4DRRH.js} +3 -3
- package/dist/{server-boundary-654WC5SA.js → server-boundary-QRVK3OIJ.js} +2 -2
- package/dist/{start-ONZXIWEG.js → start-UAMJ5TSC.js} +5 -5
- package/dist/vite-plugin/index.js +2 -2
- package/dist/{vite-plugin-UET2BUFW.js → vite-plugin-ABJIDKE6.js} +5 -5
- package/package.json +4 -4
- package/dist/chunk-MWWFXYW3.js.map +0 -1
- package/dist/chunk-VSLY4KB3.js +0 -46
- package/dist/chunk-VSLY4KB3.js.map +0 -1
- /package/dist/{actions-virtual-module-KJBCM7PP.js.map → actions-virtual-module-GMRXCAVN.js.map} +0 -0
- /package/dist/{actions-virtual-module-3V7VG2YL.js.map → actions-virtual-module-XAWZOWSY.js.map} +0 -0
- /package/dist/{agent-NLG77PFN.js.map → agent-LS7I3ZQB.js.map} +0 -0
- /package/dist/{app-typed-client-ZO3VKJ3O.js.map → app-typed-client-NMKJ4DR7.js.map} +0 -0
- /package/dist/{app-typed-client-XSXAORG6.js.map → app-typed-client-W74QO5LH.js.map} +0 -0
- /package/dist/{build-4GQLIFTD.js.map → build-FHE72YXR.js.map} +0 -0
- /package/dist/{chunk-22ZZSUKD.js.map → chunk-G5JYB2LO.js.map} +0 -0
- /package/dist/{chunk-5TPBOAAH.js.map → chunk-KEDRCI2L.js.map} +0 -0
- /package/dist/{chunk-TUO2FE3S.js.map → chunk-NC2OPE22.js.map} +0 -0
- /package/dist/{chunk-6PFF5HMY.js.map → chunk-OKDCBENR.js.map} +0 -0
- /package/dist/{chunk-ZTIB4QSV.js.map → chunk-Q6HS3NFG.js.map} +0 -0
- /package/dist/{dev-ZNTHPBBN.js.map → dev-WDKROZBS.js.map} +0 -0
- /package/dist/{internal-api-D76JZGSC.js.map → internal-api-732K3H75.js.map} +0 -0
- /package/dist/{internal-api-JNX3MTIM.js.map → internal-api-EVJSGGO3.js.map} +0 -0
- /package/dist/{mcp-IMY3NUCL.js.map → mcp-PBUCHHAS.js.map} +0 -0
- /package/dist/{preview-K4NIQLAK.js.map → preview-VFIFKVP4.js.map} +0 -0
- /package/dist/{server-boundary-NW6LNNGK.js.map → server-boundary-B6U4DRRH.js.map} +0 -0
- /package/dist/{server-boundary-654WC5SA.js.map → server-boundary-QRVK3OIJ.js.map} +0 -0
- /package/dist/{start-ONZXIWEG.js.map → start-UAMJ5TSC.js.map} +0 -0
- /package/dist/{vite-plugin-UET2BUFW.js.map → vite-plugin-ABJIDKE6.js.map} +0 -0
package/dist/chunk-VSLY4KB3.js
DELETED
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import "tsx/esm";
|
|
3
|
-
import {
|
|
4
|
-
findControllerFiles
|
|
5
|
-
} from "./chunk-MWWFXYW3.js";
|
|
6
|
-
|
|
7
|
-
// src/cli/commands/build/emit-controllers.ts
|
|
8
|
-
import { mkdirSync, readFileSync, writeFileSync } from "fs";
|
|
9
|
-
import { basename, dirname, join, relative, resolve } from "path";
|
|
10
|
-
import { transformControllerSource } from "@theokit/http";
|
|
11
|
-
var CONTROLLER_MANIFEST_FILE = "controllers.json";
|
|
12
|
-
var CONTROLLER_OUT_DIR = "controllers";
|
|
13
|
-
async function emitControllerArtifacts(opts) {
|
|
14
|
-
const controllersDir = resolve(opts.serverDir, CONTROLLER_OUT_DIR);
|
|
15
|
-
const files = findControllerFiles(controllersDir);
|
|
16
|
-
if (files.length === 0) return null;
|
|
17
|
-
const outDir = resolve(opts.distDir, CONTROLLER_OUT_DIR);
|
|
18
|
-
mkdirSync(outDir, { recursive: true });
|
|
19
|
-
const modules = [];
|
|
20
|
-
for (const file of files) {
|
|
21
|
-
const code = await transformControllerSource(readFileSync(file, "utf-8"), file);
|
|
22
|
-
const rel = relative(controllersDir, file).replace(/\.controller\.ts$/, ".controller.mjs");
|
|
23
|
-
const outPath = join(outDir, rel);
|
|
24
|
-
mkdirSync(dirname(outPath), { recursive: true });
|
|
25
|
-
writeFileSync(outPath, code);
|
|
26
|
-
modules.push(`${CONTROLLER_OUT_DIR}/${rel.split("\\").join("/")}`);
|
|
27
|
-
}
|
|
28
|
-
const manifest = { version: 1, modules };
|
|
29
|
-
writeFileSync(
|
|
30
|
-
resolve(opts.distDir, CONTROLLER_MANIFEST_FILE),
|
|
31
|
-
JSON.stringify(manifest, null, 2) + "\n"
|
|
32
|
-
);
|
|
33
|
-
return manifest;
|
|
34
|
-
}
|
|
35
|
-
function describeControllerArtifacts(manifest) {
|
|
36
|
-
if (manifest === null) return "controllers: none";
|
|
37
|
-
const names = manifest.modules.map((m) => basename(m, ".mjs")).join(", ");
|
|
38
|
-
return `controllers: ${manifest.modules.length} compiled (${names})`;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
export {
|
|
42
|
-
CONTROLLER_MANIFEST_FILE,
|
|
43
|
-
emitControllerArtifacts,
|
|
44
|
-
describeControllerArtifacts
|
|
45
|
-
};
|
|
46
|
-
//# sourceMappingURL=chunk-VSLY4KB3.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/cli/commands/build/emit-controllers.ts"],"sourcesContent":["import { mkdirSync, readFileSync, writeFileSync } from 'node:fs'\nimport { basename, dirname, join, relative, resolve } from 'node:path'\n\nimport { transformControllerSource } from '@theokit/http'\n\nimport { findControllerFiles } from '../../../server/http/controller-dispatch.js'\n\n/**\n * theokit#123 — compile `server/controllers/**` into `dist` so production can serve them.\n *\n * ## Why production needed anything at all\n *\n * #122 made decorator controllers first-class in `theokit dev`, where a Vite `enforce:'pre'` swc\n * transform compiles them on the fly — parameter decorators (`@Body`/`@Param`/`@Query`) emit\n * metadata esbuild cannot produce. `theokit start` has no Vite and no transform, so an uncompiled\n * `.controller.ts` simply cannot load, and controller routes 404'd in production while working in\n * dev. That split is the whole issue.\n *\n * ## Why compile at BUILD time rather than load with swc at runtime\n *\n * `loadControllerWithSwc` would work in production and was the smaller diff. It is refused on\n * purpose: `@swc/core` is a peer dependency and a native binary, so that path makes every deployed\n * app carry a compiler it only needs once, and turns a missing optional peer into a runtime 404\n * instead of a build failure. Compilation belongs where the rest of the build already is — and it\n * is what the issue's root-cause note asks for.\n *\n * ## Why NOT in `generateManifest`\n *\n * ADR-5 keeps controllers out of the manifest, and that is preserved here: the manifest is the\n * deploy-adapter contract, and adding a parallel route source to it would ripple through every\n * adapter. This emits a SEPARATE artifact (`dist/controllers.json` + `dist/controllers/*.mjs`) that\n * only the Node start path reads. An adapter that knows nothing about controllers keeps working\n * exactly as before.\n */\n\n/** The build artifact `theokit start` reads to find compiled controllers. */\ninterface ControllerBuildManifest {\n version: 1\n /** Emitted module paths, relative to `distDir`, in scan order. */\n modules: string[]\n}\n\nexport const CONTROLLER_MANIFEST_FILE = 'controllers.json'\nconst CONTROLLER_OUT_DIR = 'controllers'\n\n/**\n * Compile every controller under `<serverDir>/controllers` into `<distDir>/controllers`.\n *\n * No controllers ⇒ **no artifact at all** (not an empty one). `theokit start` treats a missing\n * manifest as \"this app has no controllers\" and skips the whole branch, so a routes-only app pays\n * nothing and its `dist` is byte-identical to before — the ADR-5 posture, kept.\n */\nexport async function emitControllerArtifacts(opts: {\n serverDir: string\n distDir: string\n}): Promise<ControllerBuildManifest | null> {\n const controllersDir = resolve(opts.serverDir, CONTROLLER_OUT_DIR)\n const files = findControllerFiles(controllersDir)\n if (files.length === 0) return null\n\n const outDir = resolve(opts.distDir, CONTROLLER_OUT_DIR)\n mkdirSync(outDir, { recursive: true })\n\n const modules: string[] = []\n for (const file of files) {\n // Errors are NOT caught. A controller that fails to compile must fail the BUILD — swallowing it\n // here would ship an app whose routes 404 at runtime with nothing pointing back at the cause,\n // which is the exact failure mode this issue reports (error-handling.md § 2).\n const code = await transformControllerSource(readFileSync(file, 'utf-8'), file)\n\n // Mirror the source tree under `dist/controllers` so two files with the same basename in\n // different folders cannot overwrite each other.\n const rel = relative(controllersDir, file).replace(/\\.controller\\.ts$/, '.controller.mjs')\n const outPath = join(outDir, rel)\n mkdirSync(dirname(outPath), { recursive: true })\n writeFileSync(outPath, code)\n modules.push(`${CONTROLLER_OUT_DIR}/${rel.split('\\\\').join('/')}`)\n }\n\n const manifest: ControllerBuildManifest = { version: 1, modules }\n writeFileSync(\n resolve(opts.distDir, CONTROLLER_MANIFEST_FILE),\n JSON.stringify(manifest, null, 2) + '\\n',\n )\n return manifest\n}\n\n/** Human-facing summary for the build log (mirrors the cron/job emitters). */\nexport function describeControllerArtifacts(manifest: ControllerBuildManifest | null): string {\n if (manifest === null) return 'controllers: none'\n const names = manifest.modules.map((m) => basename(m, '.mjs')).join(', ')\n return `controllers: ${manifest.modules.length} compiled (${names})`\n}\n"],"mappings":";;;;;;;AAAA,SAAS,WAAW,cAAc,qBAAqB;AACvD,SAAS,UAAU,SAAS,MAAM,UAAU,eAAe;AAE3D,SAAS,iCAAiC;AAuCnC,IAAM,2BAA2B;AACxC,IAAM,qBAAqB;AAS3B,eAAsB,wBAAwB,MAGF;AAC1C,QAAM,iBAAiB,QAAQ,KAAK,WAAW,kBAAkB;AACjE,QAAM,QAAQ,oBAAoB,cAAc;AAChD,MAAI,MAAM,WAAW,EAAG,QAAO;AAE/B,QAAM,SAAS,QAAQ,KAAK,SAAS,kBAAkB;AACvD,YAAU,QAAQ,EAAE,WAAW,KAAK,CAAC;AAErC,QAAM,UAAoB,CAAC;AAC3B,aAAW,QAAQ,OAAO;AAIxB,UAAM,OAAO,MAAM,0BAA0B,aAAa,MAAM,OAAO,GAAG,IAAI;AAI9E,UAAM,MAAM,SAAS,gBAAgB,IAAI,EAAE,QAAQ,qBAAqB,iBAAiB;AACzF,UAAM,UAAU,KAAK,QAAQ,GAAG;AAChC,cAAU,QAAQ,OAAO,GAAG,EAAE,WAAW,KAAK,CAAC;AAC/C,kBAAc,SAAS,IAAI;AAC3B,YAAQ,KAAK,GAAG,kBAAkB,IAAI,IAAI,MAAM,IAAI,EAAE,KAAK,GAAG,CAAC,EAAE;AAAA,EACnE;AAEA,QAAM,WAAoC,EAAE,SAAS,GAAG,QAAQ;AAChE;AAAA,IACE,QAAQ,KAAK,SAAS,wBAAwB;AAAA,IAC9C,KAAK,UAAU,UAAU,MAAM,CAAC,IAAI;AAAA,EACtC;AACA,SAAO;AACT;AAGO,SAAS,4BAA4B,UAAkD;AAC5F,MAAI,aAAa,KAAM,QAAO;AAC9B,QAAM,QAAQ,SAAS,QAAQ,IAAI,CAAC,MAAM,SAAS,GAAG,MAAM,CAAC,EAAE,KAAK,IAAI;AACxE,SAAO,gBAAgB,SAAS,QAAQ,MAAM,cAAc,KAAK;AACnE;","names":[]}
|
/package/dist/{actions-virtual-module-KJBCM7PP.js.map → actions-virtual-module-GMRXCAVN.js.map}
RENAMED
|
File without changes
|
/package/dist/{actions-virtual-module-3V7VG2YL.js.map → actions-virtual-module-XAWZOWSY.js.map}
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|