@supacloud/compiler 0.57.0 → 0.57.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/cli.js +3 -1
- package/dist/command-boundary.d.ts +2 -0
- package/dist/index.js +3 -1
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -19186,6 +19186,8 @@ async function scanCommandBoundaries(source, file, checker, commands, boundRoute
|
|
|
19186
19186
|
return false;
|
|
19187
19187
|
if (!ts4.isCallExpression(node.parent) || node.parent.expression !== node)
|
|
19188
19188
|
return false;
|
|
19189
|
+
if (command.rpc !== undefined && propertyName(method.name) === "execute")
|
|
19190
|
+
return true;
|
|
19189
19191
|
for (let owner = node.parent.parent;owner; owner = owner.parent) {
|
|
19190
19192
|
if (ts4.isMethodDeclaration(owner)) {
|
|
19191
19193
|
if (owner.parent === method.parent && (ts4.isPropertyAccessExpression(node) || ts4.isElementAccessExpression(node)) && node.expression.kind === ts4.SyntaxKind.ThisKeyword)
|
|
@@ -19951,7 +19953,7 @@ async function analyzeProject(rootDir, include, cache, changedPaths, effectOptio
|
|
|
19951
19953
|
}
|
|
19952
19954
|
const governedClasses = modules.flatMap((module) => module.commands.flatMap((command) => {
|
|
19953
19955
|
const declaration = ctx.classesByName.get(command.className)?.decl;
|
|
19954
|
-
return declaration ? [{ declaration, name: command.name }] : [];
|
|
19956
|
+
return declaration ? [{ declaration, name: command.name, ...command.rpc === undefined ? {} : { rpc: command.rpc } }] : [];
|
|
19955
19957
|
}));
|
|
19956
19958
|
const boundRoutes = new Map;
|
|
19957
19959
|
for (const module of modules)
|
|
@@ -3,6 +3,8 @@ import type { Diagnostic } from "./types";
|
|
|
3
3
|
interface GovernedClass {
|
|
4
4
|
declaration: ts.ClassDeclaration;
|
|
5
5
|
name: string;
|
|
6
|
+
/** Declared durable persistence boundary (the database RPC that owns receipt, audit and transaction). */
|
|
7
|
+
rpc?: string;
|
|
6
8
|
}
|
|
7
9
|
/** A conservative source check for typed command references, not a JavaScript sandbox. */
|
|
8
10
|
export declare function scanCommandBoundaries(source: ts.SourceFile, file: string, checker: ts.TypeChecker, commands: readonly GovernedClass[], boundRoutes: ReadonlyMap<ts.MethodDeclaration, string>): Promise<Diagnostic[]>;
|
package/dist/index.js
CHANGED
|
@@ -19145,6 +19145,8 @@ async function scanCommandBoundaries(source, file, checker, commands, boundRoute
|
|
|
19145
19145
|
return false;
|
|
19146
19146
|
if (!ts4.isCallExpression(node.parent) || node.parent.expression !== node)
|
|
19147
19147
|
return false;
|
|
19148
|
+
if (command.rpc !== undefined && propertyName(method.name) === "execute")
|
|
19149
|
+
return true;
|
|
19148
19150
|
for (let owner = node.parent.parent;owner; owner = owner.parent) {
|
|
19149
19151
|
if (ts4.isMethodDeclaration(owner)) {
|
|
19150
19152
|
if (owner.parent === method.parent && (ts4.isPropertyAccessExpression(node) || ts4.isElementAccessExpression(node)) && node.expression.kind === ts4.SyntaxKind.ThisKeyword)
|
|
@@ -19910,7 +19912,7 @@ async function analyzeProject(rootDir, include, cache, changedPaths, effectOptio
|
|
|
19910
19912
|
}
|
|
19911
19913
|
const governedClasses = modules.flatMap((module) => module.commands.flatMap((command) => {
|
|
19912
19914
|
const declaration = ctx.classesByName.get(command.className)?.decl;
|
|
19913
|
-
return declaration ? [{ declaration, name: command.name }] : [];
|
|
19915
|
+
return declaration ? [{ declaration, name: command.name, ...command.rpc === undefined ? {} : { rpc: command.rpc } }] : [];
|
|
19914
19916
|
}));
|
|
19915
19917
|
const boundRoutes = new Map;
|
|
19916
19918
|
for (const module of modules)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@supacloud/compiler",
|
|
3
|
-
"version": "0.57.
|
|
3
|
+
"version": "0.57.1",
|
|
4
4
|
"description": "Static compiler for @supacloud/app metadata: builds the application graph from AST, validates it, and generates reflection-free factory code",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|