@gonvex/cli 0.5.2-staging.16 → 0.5.2-staging.18
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/index.js +38 -2
- package/dist/index.js.map +1 -1
- package/dist/local-bindings.js +7 -1
- package/dist/local-bindings.js.map +1 -1
- package/dist/local-dependencies.d.ts +58 -0
- package/dist/local-dependencies.js +850 -0
- package/dist/local-dependencies.js.map +1 -0
- package/dist/manifest-types.d.ts +11 -1
- package/dist/module-artifact.js +14 -2
- package/dist/module-artifact.js.map +1 -1
- package/package.json +6 -6
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
export type LocalTableAccess = {
|
|
2
|
+
table: string;
|
|
3
|
+
operation: string;
|
|
4
|
+
/** False only for inserts with an intent-generated key: they never read locally. */
|
|
5
|
+
reads: boolean;
|
|
6
|
+
/** Project-relative `file:line`. */
|
|
7
|
+
site: string;
|
|
8
|
+
};
|
|
9
|
+
export type UnresolvedLocalAccess = {
|
|
10
|
+
operation: string;
|
|
11
|
+
site: string;
|
|
12
|
+
expression: string;
|
|
13
|
+
};
|
|
14
|
+
export type LocalReducerAnalysis = {
|
|
15
|
+
path: string;
|
|
16
|
+
accesses: LocalTableAccess[];
|
|
17
|
+
unresolved: UnresolvedLocalAccess[];
|
|
18
|
+
rawQueries: string[];
|
|
19
|
+
};
|
|
20
|
+
export type LocalReducerSource = {
|
|
21
|
+
/** Public function path. */
|
|
22
|
+
path: string;
|
|
23
|
+
/** Project-relative module file. */
|
|
24
|
+
file: string;
|
|
25
|
+
/** Exported binding that holds the Reducer definition. */
|
|
26
|
+
exportName: string;
|
|
27
|
+
};
|
|
28
|
+
export type LocalDependencyViolation = {
|
|
29
|
+
reducer: string;
|
|
30
|
+
table: string;
|
|
31
|
+
operation: string;
|
|
32
|
+
site: string;
|
|
33
|
+
reason: string;
|
|
34
|
+
};
|
|
35
|
+
/**
|
|
36
|
+
* Whether an access reads the table locally. The analysis checks inserts for
|
|
37
|
+
* an explicit `_id`; a table keyed by another column is treated as read by any
|
|
38
|
+
* insert, since the row may carry that key.
|
|
39
|
+
*/
|
|
40
|
+
export declare function readsLocally(access: LocalTableAccess, tableKeys: ReadonlyMap<string, string>): boolean;
|
|
41
|
+
/** Tables a Reducer needs in the Local Replica to run locally, sorted. */
|
|
42
|
+
export declare function localDependencyTables(analysis: LocalReducerAnalysis, tableKeys: ReadonlyMap<string, string>): string[];
|
|
43
|
+
/** Accesses a local run cannot complete. `tableKeys` maps every local-schema table to its key. */
|
|
44
|
+
export declare function localDependencyViolations(analyses: readonly LocalReducerAnalysis[], localTables: ReadonlySet<string>, tableKeys: ReadonlyMap<string, string>): LocalDependencyViolation[];
|
|
45
|
+
/** A readable report grouped by table, for CLI errors and warnings. */
|
|
46
|
+
export declare function formatLocalDependencyViolations(violations: readonly LocalDependencyViolation[]): string;
|
|
47
|
+
/**
|
|
48
|
+
* Analyze the table dependencies of locally executing Reducers. Loads the
|
|
49
|
+
* TypeScript compiler bundled with the CLI on first use.
|
|
50
|
+
*/
|
|
51
|
+
export declare function analyzeLocalReducerDependencies(input: {
|
|
52
|
+
root: string;
|
|
53
|
+
backendDir: string;
|
|
54
|
+
files: readonly string[];
|
|
55
|
+
reducers: readonly LocalReducerSource[];
|
|
56
|
+
/** Project-relative tsconfig whose compiler options (paths, resolution) apply to the backend. */
|
|
57
|
+
tsconfig?: string;
|
|
58
|
+
}): Promise<LocalReducerAnalysis[]>;
|