@tsplc/compiler 0.3.0 → 0.4.1
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/codesys.js +48 -26
- package/dist/codesys.js.map +5 -5
- package/dist/elaborate-capture.js +22 -3
- package/dist/elaborate-capture.js.map +4 -4
- package/dist/index.js +489 -355
- package/dist/index.js.map +9 -8
- package/dist/retain.js +8 -0
- package/dist/retain.js.map +10 -0
- package/package.json +14 -9
- package/src/codesys/global-lists.ts +18 -16
- package/src/codesys/global-names.ts +3 -3
- package/src/codesys/storage.ts +44 -9
- package/src/frontend/elaborate/capture-protocol.ts +5 -0
- package/src/frontend/elaborate/capture.ts +22 -1
- package/src/frontend/elaborate/expressions.ts +4 -2
- package/src/frontend/elaborate/index.ts +29 -4
- package/src/frontend/elaborate/retention.ts +206 -0
- package/src/frontend/elaborate/storage.ts +1 -1
- package/stdlib/retain.ts +2 -0
- package/types/retain.d.ts +6 -0
|
@@ -54,7 +54,8 @@ var capturedGraphSchema = z.strictObject({
|
|
|
54
54
|
file: z.string(),
|
|
55
55
|
name: z.string(),
|
|
56
56
|
value: capturedValueSchema
|
|
57
|
-
}))
|
|
57
|
+
})),
|
|
58
|
+
retained: z.array(z.number().int().nonnegative())
|
|
58
59
|
}).superRefine((graph, context) => {
|
|
59
60
|
const references = [
|
|
60
61
|
...graph.bindings.map((binding) => binding.value),
|
|
@@ -68,6 +69,9 @@ var capturedGraphSchema = z.strictObject({
|
|
|
68
69
|
return [];
|
|
69
70
|
})
|
|
70
71
|
];
|
|
72
|
+
for (const id of graph.retained) {
|
|
73
|
+
references.push({ kind: "node", id });
|
|
74
|
+
}
|
|
71
75
|
for (const value of references) {
|
|
72
76
|
if (value.kind === "node" && value.id >= graph.nodes.length) {
|
|
73
77
|
context.addIssue({
|
|
@@ -112,6 +116,10 @@ plugin({
|
|
|
112
116
|
export const onTelemetry = () => () => {};`,
|
|
113
117
|
loader: "js"
|
|
114
118
|
}));
|
|
119
|
+
build.module("@tsplc/compiler/retain", () => ({
|
|
120
|
+
contents: "export const retain = (value) => globalThis.__tsplcRetain(value);",
|
|
121
|
+
loader: "js"
|
|
122
|
+
}));
|
|
115
123
|
build.module("@tsplc/compiler/async", () => ({
|
|
116
124
|
contents: `export const createServiceClient = () => globalThis.__tsplcService([]);
|
|
117
125
|
const unsupported = (name) => () => { throw new Error(name + " cannot run during PLC setup."); };
|
|
@@ -121,6 +129,13 @@ plugin({
|
|
|
121
129
|
}
|
|
122
130
|
});
|
|
123
131
|
globalThis.__tsplcService = service;
|
|
132
|
+
var retainedObjects = new Set;
|
|
133
|
+
globalThis.__tsplcRetain = (value) => {
|
|
134
|
+
if (typeof value === "object" && value !== null) {
|
|
135
|
+
retainedObjects.add(value);
|
|
136
|
+
}
|
|
137
|
+
return value;
|
|
138
|
+
};
|
|
124
139
|
var modules = new Map;
|
|
125
140
|
for (const file of [
|
|
126
141
|
request.entry,
|
|
@@ -205,7 +220,7 @@ var capture = (value, where) => {
|
|
|
205
220
|
nodes[id] = registered ? { kind: "instance", ...registered, fields } : { kind: "object", fields };
|
|
206
221
|
return { kind: "node", id };
|
|
207
222
|
};
|
|
208
|
-
var graph = { nodes, bindings: [] };
|
|
223
|
+
var graph = { nodes, bindings: [], retained: [] };
|
|
209
224
|
for (const [file, registry] of modules) {
|
|
210
225
|
for (const [name, read] of Object.entries(registry.values)) {
|
|
211
226
|
let value;
|
|
@@ -220,7 +235,11 @@ for (const [file, registry] of modules) {
|
|
|
220
235
|
graph.bindings.push({ file, name, value: capture(value, name) });
|
|
221
236
|
}
|
|
222
237
|
}
|
|
238
|
+
graph.retained = [...retainedObjects].flatMap((value) => {
|
|
239
|
+
const id = ids.get(value);
|
|
240
|
+
return id === undefined ? [] : [id];
|
|
241
|
+
});
|
|
223
242
|
writeFileSync(process.argv[3], JSON.stringify(graph));
|
|
224
243
|
|
|
225
|
-
//# debugId=
|
|
244
|
+
//# debugId=F9AACF3DF259896064756E2164756E21
|
|
226
245
|
//# sourceMappingURL=elaborate-capture.js.map
|
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../src/frontend/elaborate/capture.ts", "../src/frontend/elaborate/capture-protocol.ts"],
|
|
4
4
|
"sourcesContent": [
|
|
5
|
-
"// biome-ignore-all lint/style/noNonNullAssertion: Retain existing non-null assertions during the tooling migration; changing their contracts requires a separate review.\n/**\n * Runs a program's setup code in Bun and writes the object graph it builds: every module binding,\n * and every object, array, class instance and function reachable from them. The compiler runs\n * this in a subprocess (graph.ts), so setup code never shares the compiler's process.\n *\n * Usage: bun capture.ts <request.json> <graph.json>\n */\n\nimport { readFileSync, realpathSync, writeFileSync } from \"node:fs\";\nimport { plugin } from \"bun\";\nimport {\n\ttype CapturedGraph,\n\ttype CapturedNode,\n\ttype CapturedValue,\n\ttype CaptureRequest,\n\tcaptureRequestSchema,\n} from \"./capture-protocol.ts\";\n\nconst request: CaptureRequest = captureRequestSchema.parse(\n\tJSON.parse(readFileSync(process.argv[2]!, \"utf8\")),\n);\n// Bun loads modules by their real path; the compiler may name them through a symlink.\nconst real = new Map(request.files.map((file) => [realpathSync(file), file]));\nconst runtime = new Set(real.keys());\nconst exportName = \"__tsplcCapture\";\n\n/** Top-level bindings a module declares, so captured state can be traced back to its source. */\nconst bindings = (source: string, names: CaptureRequest[\"bindings\"][string]) =>\n\t`${source}\\n;export const ${exportName} = { values: { ${names.values\n\t\t.map((name) => `${JSON.stringify(name)}: () => ${name}`)\n\t\t.join(\", \")} }, classes: { ${names.classes\n\t\t.map((name) => `${JSON.stringify(name)}: ${name}`)\n\t\t.join(\", \")} }, functions: { ${names.functions\n\t\t.map((name) => `${JSON.stringify(name)}: ${name}`)\n\t\t.join(\", \")} } };\\n`;\n\nconst servicePath = Symbol(\"tsplc service path\");\n/** A service client: any property is a deeper procedure path, and its identity names that path. */\nconst service = (path: readonly string[]): unknown =>\n\tnew Proxy(function serviceProcedure() {}, {\n\t\tget: (_, key) =>\n\t\t\tkey === servicePath ? path.join(\".\") : service([...path, String(key)]),\n\t\tapply: () => {\n\t\t\tthrow new Error(`Setup code called the PLC service ${path.join(\".\")}.`);\n\t\t},\n\t});\n\nplugin({\n\tname: \"tsplc-capture\",\n\tsetup(build) {\n\t\tbuild.onLoad(\n\t\t\t{\n\t\t\t\tfilter: new RegExp(\n\t\t\t\t\t`^(${[...runtime].map((file) => file.replace(/[.*+?^${}()|[\\]\\\\]/g, \"\\\\$&\")).join(\"|\")})$`,\n\t\t\t\t),\n\t\t\t},\n\t\t\t({ path }) => ({\n\t\t\t\tcontents: bindings(\n\t\t\t\t\treadFileSync(path, \"utf8\"),\n\t\t\t\t\trequest.bindings[real.get(path)!]!,\n\t\t\t\t),\n\t\t\t\tloader: \"ts\",\n\t\t\t}),\n\t\t);\n\t\t// Setup runs before the first scan, so the clock reads 0 there.\n\t\tbuild.module(\"@tsplc/compiler/clock\", () => ({\n\t\t\tcontents: \"export const now = () => 0;\",\n\t\t\tloader: \"js\",\n\t\t}));\n\t\t// Records describe scans, so setup has none to make.\n\t\tbuild.module(\"@tsplc/compiler/telemetry\", () => ({\n\t\t\tcontents: `const unsupported = (name) => () => { throw new Error(\"telemetry.\" + name + \" cannot run during PLC setup.\"); };\n export const telemetry = Object.fromEntries([\"capture\", \"info\", \"warn\", \"error\", \"captureException\", \"text\"].map((name) => [name, unsupported(name)]));\n export const onTelemetry = () => () => {};`,\n\t\t\tloader: \"js\",\n\t\t}));\n\t\tbuild.module(\"@tsplc/compiler/async\", () => ({\n\t\t\tcontents: `export const createServiceClient = () => globalThis.__tsplcService([]);\n const unsupported = (name) => () => { throw new Error(name + \" cannot run during PLC setup.\"); };\n export const sleep = unsupported(\"sleep\"), fetch = unsupported(\"fetch\"), cancelAsync = unsupported(\"cancelAsync\");`,\n\t\t\tloader: \"js\",\n\t\t}));\n\t},\n});\n(globalThis as { __tsplcService?: unknown }).__tsplcService = service;\n\n/** The bindings each runtime module exports for capture, as `bindings` above adds them. */\ninterface Registry {\n\tvalues: Record<string, () => unknown>;\n\tclasses: Record<string, unknown>;\n\tfunctions: Record<string, unknown>;\n}\n\nconst modules = new Map<string, Registry>();\nfor (const file of [\n\trequest.entry,\n\t...request.files.filter((file) => file !== request.entry),\n]) {\n\tconst loaded = (await import(realpathSync(file))) as Record<string, unknown>;\n\tmodules.set(file, loaded[exportName] as Registry);\n}\n\nconst classes = new Map<unknown, { file: string; name: string }>();\nconst functions = new Map<unknown, { file: string; name: string }>();\nfor (const [file, registry] of modules) {\n\tfor (const [name, value] of Object.entries(registry.classes)) {\n\t\tclasses.set(value, { file, name });\n\t}\n\tfor (const [name, value] of Object.entries(registry.functions)) {\n\t\tfunctions.set(value, { file, name });\n\t}\n}\n\nconst nodes: CapturedNode[] = [];\nconst ids = new Map<object, number>();\nconst capture = (value: unknown, where: string): CapturedValue => {\n\tif (value === undefined) {\n\t\treturn { kind: \"undefined\" };\n\t}\n\tif (value === null) {\n\t\tthrow new Error(`${where}: null has no PLC value; use undefined.`);\n\t}\n\tif (typeof value === \"number\") {\n\t\tif (!Number.isFinite(value)) {\n\t\t\tthrow new Error(`${where}: ${value} has no PLC value.`);\n\t\t}\n\t\treturn { kind: \"number\", value };\n\t}\n\tif (typeof value === \"boolean\") {\n\t\treturn { kind: \"boolean\", value };\n\t}\n\tif (typeof value === \"string\") {\n\t\treturn { kind: \"string\", value };\n\t}\n\tif (typeof value === \"bigint\") {\n\t\treturn { kind: \"bigint\", value: String(value) };\n\t}\n\tif (typeof value !== \"object\" && typeof value !== \"function\") {\n\t\tthrow new Error(`${where}: a ${typeof value} has no PLC value.`);\n\t}\n\tconst known = ids.get(value);\n\tif (known !== undefined) {\n\t\treturn { kind: \"node\", id: known };\n\t}\n\tconst id = nodes.length;\n\tids.set(value, id);\n\tnodes.push({ kind: \"object\", fields: {} });\n\tif (typeof value === \"function\") {\n\t\tconst path = (value as { [servicePath]?: string })[servicePath];\n\t\tconst named = functions.get(value) ?? classes.get(value);\n\t\tif (path !== undefined) {\n\t\t\tnodes[id] = { kind: \"service\", path };\n\t\t} else if (named) {\n\t\t\tnodes[id] = { kind: \"function\", ...named };\n\t\t} else {\n\t\t\tthrow new Error(\n\t\t\t\t`${where}: setup stored a function that is not a module-level function, so the PLC can't call it.`,\n\t\t\t);\n\t\t}\n\t\treturn { kind: \"node\", id };\n\t}\n\tif (Array.isArray(value)) {\n\t\tnodes[id] = {\n\t\t\tkind: \"array\",\n\t\t\titems: value.map((item, index) => capture(item, `${where}[${index}]`)),\n\t\t};\n\t\treturn { kind: \"node\", id };\n\t}\n\tconst prototype = Object.getPrototypeOf(value);\n\tconst owner =\n\t\tprototype === Object.prototype || prototype === null\n\t\t\t? undefined\n\t\t\t: prototype.constructor;\n\tconst registered = owner && classes.get(owner);\n\tif (owner && !registered) {\n\t\tthrow new Error(\n\t\t\t`${where}: a ${owner.name} has no PLC layout; use a class from the program.`,\n\t\t);\n\t}\n\tconst fields: Record<string, CapturedValue> = {};\n\tfor (const [key, field] of Object.entries(value)) {\n\t\tfields[key] = capture(field, `${where}.${key}`);\n\t}\n\tnodes[id] = registered\n\t\t? { kind: \"instance\", ...registered, fields }\n\t\t: { kind: \"object\", fields };\n\treturn { kind: \"node\", id };\n};\n\nconst graph: CapturedGraph = { nodes, bindings: [] };\nfor (const [file, registry] of modules) {\n\tfor (const [name, read] of Object.entries(registry.values)) {\n\t\tlet value: unknown;\n\t\ttry {\n\t\t\tvalue = read();\n\t\t} catch {\n\t\t\tcontinue; // A binding the module never initialized.\n\t\t}\n\t\tif (\n\t\t\ttypeof value === \"function\" &&\n\t\t\t(functions.has(value) || classes.has(value))\n\t\t) {\n\t\t\tcontinue;\n\t\t}\n\t\tgraph.bindings.push({ file, name, value: capture(value, name) });\n\t}\n}\nwriteFileSync(process.argv[3]!, JSON.stringify(graph));\n",
|
|
6
|
-
"import { z } from \"zod\";\n\n/**\n * The files the compiler and its setup subprocess (capture.ts) exchange: the request names the\n * program's runtime files and the bindings each declares; the graph is what setup built.\n */\nexport const captureRequestSchema = z.strictObject({\n\tentry: z.string().nonempty(),\n\tfiles: z.array(z.string().nonempty()),\n\tbindings: z.record(\n\t\tz.string(),\n\t\tz.strictObject({\n\t\t\tvalues: z.array(z.string()),\n\t\t\tclasses: z.array(z.string()),\n\t\t\tfunctions: z.array(z.string()),\n\t\t}),\n\t),\n});\nexport type CaptureRequest = z.infer<typeof captureRequestSchema>;\n\nconst capturedValueSchema = z.discriminatedUnion(\"kind\", [\n\tz.strictObject({ kind: z.literal(\"undefined\") }),\n\t// JSON has no NaN or infinity; capture rejects them rather than write null.\n\tz.strictObject({ kind: z.literal(\"number\"), value: z.number() }),\n\tz.strictObject({ kind: z.literal(\"boolean\"), value: z.boolean() }),\n\tz.strictObject({ kind: z.literal(\"string\"), value: z.string() }),\n\tz.strictObject({\n\t\tkind: z.literal(\"bigint\"),\n\t\tvalue: z.string().regex(/^-?\\d+$/),\n\t}),\n\tz.strictObject({\n\t\tkind: z.literal(\"node\"),\n\t\tid: z.number().int().nonnegative(),\n\t}),\n]);\nexport type CapturedValue = z.infer<typeof capturedValueSchema>;\n\n/** A captured value that is not an object setup built. */\nexport type CapturedPrimitive = Exclude<CapturedValue, { kind: \"node\" }>;\n\nconst fieldsSchema = z.record(z.string(), capturedValueSchema);\n\nconst capturedNodeSchema = z.discriminatedUnion(\"kind\", [\n\tz.strictObject({ kind: z.literal(\"object\"), fields: fieldsSchema }),\n\tz.strictObject({\n\t\tkind: z.literal(\"instance\"),\n\t\tfile: z.string(),\n\t\tname: z.string(),\n\t\tfields: fieldsSchema,\n\t}),\n\tz.strictObject({\n\t\tkind: z.literal(\"array\"),\n\t\titems: z.array(capturedValueSchema),\n\t}),\n\tz.strictObject({\n\t\tkind: z.literal(\"function\"),\n\t\tfile: z.string(),\n\t\tname: z.string(),\n\t}),\n\tz.strictObject({ kind: z.literal(\"service\"), path: z.string() }),\n]);\nexport type CapturedNode = z.infer<typeof capturedNodeSchema>;\n\nexport const capturedGraphSchema = z\n\t.strictObject({\n\t\tnodes: z.array(capturedNodeSchema),\n\t\t/** Every module-level value binding, in module evaluation order. */\n\t\tbindings: z.array(\n\t\t\tz.strictObject({\n\t\t\t\tfile: z.string(),\n\t\t\t\tname: z.string(),\n\t\t\t\tvalue: capturedValueSchema,\n\t\t\t}),\n\t\t),\n\t})\n\t.superRefine((graph, context) => {\n\t\tconst references = [\n\t\t\t...graph.bindings.map((binding) => binding.value),\n\t\t\t...graph.nodes.flatMap((node) => {\n\t\t\t\tif (node.kind === \"array\") {\n\t\t\t\t\treturn node.items;\n\t\t\t\t}\n\t\t\t\tif (node.kind === \"object\" || node.kind === \"instance\") {\n\t\t\t\t\treturn Object.values(node.fields);\n\t\t\t\t}\n\t\t\t\treturn [];\n\t\t\t}),\n\t\t];\n\t\tfor (const value of references) {\n\t\t\tif (value.kind === \"node\" && value.id >= graph.nodes.length) {\n\t\t\t\tcontext.addIssue({\n\t\t\t\t\tcode: \"custom\",\n\t\t\t\t\tmessage: `Captured value refers to missing node ${value.id}.`,\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t});\nexport type CapturedGraph = z.infer<typeof capturedGraphSchema>;\n"
|
|
5
|
+
"// biome-ignore-all lint/style/noNonNullAssertion: Retain existing non-null assertions during the tooling migration; changing their contracts requires a separate review.\n/**\n * Runs a program's setup code in Bun and writes the object graph it builds: every module binding,\n * and every object, array, class instance and function reachable from them. The compiler runs\n * this in a subprocess (graph.ts), so setup code never shares the compiler's process.\n *\n * Usage: bun capture.ts <request.json> <graph.json>\n */\n\nimport { readFileSync, realpathSync, writeFileSync } from \"node:fs\";\nimport { plugin } from \"bun\";\nimport {\n\ttype CapturedGraph,\n\ttype CapturedNode,\n\ttype CapturedValue,\n\ttype CaptureRequest,\n\tcaptureRequestSchema,\n} from \"./capture-protocol.ts\";\n\nconst request: CaptureRequest = captureRequestSchema.parse(\n\tJSON.parse(readFileSync(process.argv[2]!, \"utf8\")),\n);\n// Bun loads modules by their real path; the compiler may name them through a symlink.\nconst real = new Map(request.files.map((file) => [realpathSync(file), file]));\nconst runtime = new Set(real.keys());\nconst exportName = \"__tsplcCapture\";\n\n/** Top-level bindings a module declares, so captured state can be traced back to its source. */\nconst bindings = (source: string, names: CaptureRequest[\"bindings\"][string]) =>\n\t`${source}\\n;export const ${exportName} = { values: { ${names.values\n\t\t.map((name) => `${JSON.stringify(name)}: () => ${name}`)\n\t\t.join(\", \")} }, classes: { ${names.classes\n\t\t.map((name) => `${JSON.stringify(name)}: ${name}`)\n\t\t.join(\", \")} }, functions: { ${names.functions\n\t\t.map((name) => `${JSON.stringify(name)}: ${name}`)\n\t\t.join(\", \")} } };\\n`;\n\nconst servicePath = Symbol(\"tsplc service path\");\n/** A service client: any property is a deeper procedure path, and its identity names that path. */\nconst service = (path: readonly string[]): unknown =>\n\tnew Proxy(function serviceProcedure() {}, {\n\t\tget: (_, key) =>\n\t\t\tkey === servicePath ? path.join(\".\") : service([...path, String(key)]),\n\t\tapply: () => {\n\t\t\tthrow new Error(`Setup code called the PLC service ${path.join(\".\")}.`);\n\t\t},\n\t});\n\nplugin({\n\tname: \"tsplc-capture\",\n\tsetup(build) {\n\t\tbuild.onLoad(\n\t\t\t{\n\t\t\t\tfilter: new RegExp(\n\t\t\t\t\t`^(${[...runtime].map((file) => file.replace(/[.*+?^${}()|[\\]\\\\]/g, \"\\\\$&\")).join(\"|\")})$`,\n\t\t\t\t),\n\t\t\t},\n\t\t\t({ path }) => ({\n\t\t\t\tcontents: bindings(\n\t\t\t\t\treadFileSync(path, \"utf8\"),\n\t\t\t\t\trequest.bindings[real.get(path)!]!,\n\t\t\t\t),\n\t\t\t\tloader: \"ts\",\n\t\t\t}),\n\t\t);\n\t\t// Setup runs before the first scan, so the clock reads 0 there.\n\t\tbuild.module(\"@tsplc/compiler/clock\", () => ({\n\t\t\tcontents: \"export const now = () => 0;\",\n\t\t\tloader: \"js\",\n\t\t}));\n\t\t// Records describe scans, so setup has none to make.\n\t\tbuild.module(\"@tsplc/compiler/telemetry\", () => ({\n\t\t\tcontents: `const unsupported = (name) => () => { throw new Error(\"telemetry.\" + name + \" cannot run during PLC setup.\"); };\n export const telemetry = Object.fromEntries([\"capture\", \"info\", \"warn\", \"error\", \"captureException\", \"text\"].map((name) => [name, unsupported(name)]));\n export const onTelemetry = () => () => {};`,\n\t\t\tloader: \"js\",\n\t\t}));\n\t\t// Retention belongs to storage, so setup notes each object it retains for the compiler.\n\t\tbuild.module(\"@tsplc/compiler/retain\", () => ({\n\t\t\tcontents:\n\t\t\t\t\"export const retain = (value) => globalThis.__tsplcRetain(value);\",\n\t\t\tloader: \"js\",\n\t\t}));\n\t\tbuild.module(\"@tsplc/compiler/async\", () => ({\n\t\t\tcontents: `export const createServiceClient = () => globalThis.__tsplcService([]);\n const unsupported = (name) => () => { throw new Error(name + \" cannot run during PLC setup.\"); };\n export const sleep = unsupported(\"sleep\"), fetch = unsupported(\"fetch\"), cancelAsync = unsupported(\"cancelAsync\");`,\n\t\t\tloader: \"js\",\n\t\t}));\n\t},\n});\n(globalThis as { __tsplcService?: unknown }).__tsplcService = service;\n/** Objects setup passed to `retain`. A retained primitive has no identity; the compiler finds those in the source. */\nconst retainedObjects = new Set<object>();\n(globalThis as { __tsplcRetain?: unknown }).__tsplcRetain = (\n\tvalue: unknown,\n) => {\n\tif (typeof value === \"object\" && value !== null) {\n\t\tretainedObjects.add(value);\n\t}\n\treturn value;\n};\n\n/** The bindings each runtime module exports for capture, as `bindings` above adds them. */\ninterface Registry {\n\tvalues: Record<string, () => unknown>;\n\tclasses: Record<string, unknown>;\n\tfunctions: Record<string, unknown>;\n}\n\nconst modules = new Map<string, Registry>();\nfor (const file of [\n\trequest.entry,\n\t...request.files.filter((file) => file !== request.entry),\n]) {\n\tconst loaded = (await import(realpathSync(file))) as Record<string, unknown>;\n\tmodules.set(file, loaded[exportName] as Registry);\n}\n\nconst classes = new Map<unknown, { file: string; name: string }>();\nconst functions = new Map<unknown, { file: string; name: string }>();\nfor (const [file, registry] of modules) {\n\tfor (const [name, value] of Object.entries(registry.classes)) {\n\t\tclasses.set(value, { file, name });\n\t}\n\tfor (const [name, value] of Object.entries(registry.functions)) {\n\t\tfunctions.set(value, { file, name });\n\t}\n}\n\nconst nodes: CapturedNode[] = [];\nconst ids = new Map<object, number>();\nconst capture = (value: unknown, where: string): CapturedValue => {\n\tif (value === undefined) {\n\t\treturn { kind: \"undefined\" };\n\t}\n\tif (value === null) {\n\t\tthrow new Error(`${where}: null has no PLC value; use undefined.`);\n\t}\n\tif (typeof value === \"number\") {\n\t\tif (!Number.isFinite(value)) {\n\t\t\tthrow new Error(`${where}: ${value} has no PLC value.`);\n\t\t}\n\t\treturn { kind: \"number\", value };\n\t}\n\tif (typeof value === \"boolean\") {\n\t\treturn { kind: \"boolean\", value };\n\t}\n\tif (typeof value === \"string\") {\n\t\treturn { kind: \"string\", value };\n\t}\n\tif (typeof value === \"bigint\") {\n\t\treturn { kind: \"bigint\", value: String(value) };\n\t}\n\tif (typeof value !== \"object\" && typeof value !== \"function\") {\n\t\tthrow new Error(`${where}: a ${typeof value} has no PLC value.`);\n\t}\n\tconst known = ids.get(value);\n\tif (known !== undefined) {\n\t\treturn { kind: \"node\", id: known };\n\t}\n\tconst id = nodes.length;\n\tids.set(value, id);\n\tnodes.push({ kind: \"object\", fields: {} });\n\tif (typeof value === \"function\") {\n\t\tconst path = (value as { [servicePath]?: string })[servicePath];\n\t\tconst named = functions.get(value) ?? classes.get(value);\n\t\tif (path !== undefined) {\n\t\t\tnodes[id] = { kind: \"service\", path };\n\t\t} else if (named) {\n\t\t\tnodes[id] = { kind: \"function\", ...named };\n\t\t} else {\n\t\t\tthrow new Error(\n\t\t\t\t`${where}: setup stored a function that is not a module-level function, so the PLC can't call it.`,\n\t\t\t);\n\t\t}\n\t\treturn { kind: \"node\", id };\n\t}\n\tif (Array.isArray(value)) {\n\t\tnodes[id] = {\n\t\t\tkind: \"array\",\n\t\t\titems: value.map((item, index) => capture(item, `${where}[${index}]`)),\n\t\t};\n\t\treturn { kind: \"node\", id };\n\t}\n\tconst prototype = Object.getPrototypeOf(value);\n\tconst owner =\n\t\tprototype === Object.prototype || prototype === null\n\t\t\t? undefined\n\t\t\t: prototype.constructor;\n\tconst registered = owner && classes.get(owner);\n\tif (owner && !registered) {\n\t\tthrow new Error(\n\t\t\t`${where}: a ${owner.name} has no PLC layout; use a class from the program.`,\n\t\t);\n\t}\n\tconst fields: Record<string, CapturedValue> = {};\n\tfor (const [key, field] of Object.entries(value)) {\n\t\tfields[key] = capture(field, `${where}.${key}`);\n\t}\n\tnodes[id] = registered\n\t\t? { kind: \"instance\", ...registered, fields }\n\t\t: { kind: \"object\", fields };\n\treturn { kind: \"node\", id };\n};\n\nconst graph: CapturedGraph = { nodes, bindings: [], retained: [] };\nfor (const [file, registry] of modules) {\n\tfor (const [name, read] of Object.entries(registry.values)) {\n\t\tlet value: unknown;\n\t\ttry {\n\t\t\tvalue = read();\n\t\t} catch {\n\t\t\tcontinue; // A binding the module never initialized.\n\t\t}\n\t\tif (\n\t\t\ttypeof value === \"function\" &&\n\t\t\t(functions.has(value) || classes.has(value))\n\t\t) {\n\t\t\tcontinue;\n\t\t}\n\t\tgraph.bindings.push({ file, name, value: capture(value, name) });\n\t}\n}\n// A retained object no binding reaches is stored nowhere, so it has no id.\ngraph.retained = [...retainedObjects].flatMap((value) => {\n\tconst id = ids.get(value);\n\treturn id === undefined ? [] : [id];\n});\nwriteFileSync(process.argv[3]!, JSON.stringify(graph));\n",
|
|
6
|
+
"import { z } from \"zod\";\n\n/**\n * The files the compiler and its setup subprocess (capture.ts) exchange: the request names the\n * program's runtime files and the bindings each declares; the graph is what setup built.\n */\nexport const captureRequestSchema = z.strictObject({\n\tentry: z.string().nonempty(),\n\tfiles: z.array(z.string().nonempty()),\n\tbindings: z.record(\n\t\tz.string(),\n\t\tz.strictObject({\n\t\t\tvalues: z.array(z.string()),\n\t\t\tclasses: z.array(z.string()),\n\t\t\tfunctions: z.array(z.string()),\n\t\t}),\n\t),\n});\nexport type CaptureRequest = z.infer<typeof captureRequestSchema>;\n\nconst capturedValueSchema = z.discriminatedUnion(\"kind\", [\n\tz.strictObject({ kind: z.literal(\"undefined\") }),\n\t// JSON has no NaN or infinity; capture rejects them rather than write null.\n\tz.strictObject({ kind: z.literal(\"number\"), value: z.number() }),\n\tz.strictObject({ kind: z.literal(\"boolean\"), value: z.boolean() }),\n\tz.strictObject({ kind: z.literal(\"string\"), value: z.string() }),\n\tz.strictObject({\n\t\tkind: z.literal(\"bigint\"),\n\t\tvalue: z.string().regex(/^-?\\d+$/),\n\t}),\n\tz.strictObject({\n\t\tkind: z.literal(\"node\"),\n\t\tid: z.number().int().nonnegative(),\n\t}),\n]);\nexport type CapturedValue = z.infer<typeof capturedValueSchema>;\n\n/** A captured value that is not an object setup built. */\nexport type CapturedPrimitive = Exclude<CapturedValue, { kind: \"node\" }>;\n\nconst fieldsSchema = z.record(z.string(), capturedValueSchema);\n\nconst capturedNodeSchema = z.discriminatedUnion(\"kind\", [\n\tz.strictObject({ kind: z.literal(\"object\"), fields: fieldsSchema }),\n\tz.strictObject({\n\t\tkind: z.literal(\"instance\"),\n\t\tfile: z.string(),\n\t\tname: z.string(),\n\t\tfields: fieldsSchema,\n\t}),\n\tz.strictObject({\n\t\tkind: z.literal(\"array\"),\n\t\titems: z.array(capturedValueSchema),\n\t}),\n\tz.strictObject({\n\t\tkind: z.literal(\"function\"),\n\t\tfile: z.string(),\n\t\tname: z.string(),\n\t}),\n\tz.strictObject({ kind: z.literal(\"service\"), path: z.string() }),\n]);\nexport type CapturedNode = z.infer<typeof capturedNodeSchema>;\n\nexport const capturedGraphSchema = z\n\t.strictObject({\n\t\tnodes: z.array(capturedNodeSchema),\n\t\t/** Every module-level value binding, in module evaluation order. */\n\t\tbindings: z.array(\n\t\t\tz.strictObject({\n\t\t\t\tfile: z.string(),\n\t\t\t\tname: z.string(),\n\t\t\t\tvalue: capturedValueSchema,\n\t\t\t}),\n\t\t),\n\t\t/** The objects setup passed to `retain`. */\n\t\tretained: z.array(z.number().int().nonnegative()),\n\t})\n\t.superRefine((graph, context) => {\n\t\tconst references = [\n\t\t\t...graph.bindings.map((binding) => binding.value),\n\t\t\t...graph.nodes.flatMap((node) => {\n\t\t\t\tif (node.kind === \"array\") {\n\t\t\t\t\treturn node.items;\n\t\t\t\t}\n\t\t\t\tif (node.kind === \"object\" || node.kind === \"instance\") {\n\t\t\t\t\treturn Object.values(node.fields);\n\t\t\t\t}\n\t\t\t\treturn [];\n\t\t\t}),\n\t\t];\n\t\tfor (const id of graph.retained) {\n\t\t\treferences.push({ kind: \"node\", id });\n\t\t}\n\t\tfor (const value of references) {\n\t\t\tif (value.kind === \"node\" && value.id >= graph.nodes.length) {\n\t\t\t\tcontext.addIssue({\n\t\t\t\t\tcode: \"custom\",\n\t\t\t\t\tmessage: `Captured value refers to missing node ${value.id}.`,\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t});\nexport type CapturedGraph = z.infer<typeof capturedGraphSchema>;\n"
|
|
7
7
|
],
|
|
8
|
-
"mappings": ";;AASA;AACA;;;ACVA;AAMO,IAAM,uBAAuB,EAAE,aAAa;AAAA,EAClD,OAAO,EAAE,OAAO,EAAE,SAAS;AAAA,EAC3B,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,SAAS,CAAC;AAAA,EACpC,UAAU,EAAE,OACX,EAAE,OAAO,GACT,EAAE,aAAa;AAAA,IACd,QAAQ,EAAE,MAAM,EAAE,OAAO,CAAC;AAAA,IAC1B,SAAS,EAAE,MAAM,EAAE,OAAO,CAAC;AAAA,IAC3B,WAAW,EAAE,MAAM,EAAE,OAAO,CAAC;AAAA,EAC9B,CAAC,CACF;AACD,CAAC;AAGD,IAAM,sBAAsB,EAAE,mBAAmB,QAAQ;AAAA,EACxD,EAAE,aAAa,EAAE,MAAM,EAAE,QAAQ,WAAW,EAAE,CAAC;AAAA,EAE/C,EAAE,aAAa,EAAE,MAAM,EAAE,QAAQ,QAAQ,GAAG,OA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