@supacloud/compiler 0.4.1 → 0.6.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/README.md +62 -4
- package/dist/analyze.d.ts +3 -3
- package/dist/cli.js +3862 -308
- package/dist/generate.d.ts +17 -0
- package/dist/incremental.d.ts +30 -0
- package/dist/index.d.ts +15 -2
- package/dist/index.js +3743 -299
- package/dist/inspect.d.ts +21 -0
- package/dist/program.d.ts +30 -0
- package/dist/traits.d.ts +32 -0
- package/dist/type-safety.d.ts +9 -0
- package/dist/types.d.ts +201 -0
- package/dist/util.d.ts +4 -0
- package/dist/validate.d.ts +4 -0
- package/dist/watch.d.ts +3 -0
- package/package.json +3 -3
package/dist/generate.d.ts
CHANGED
|
@@ -2,10 +2,18 @@ import type { ApplicationGraph } from "./types";
|
|
|
2
2
|
export interface GenerateOptions {
|
|
3
3
|
rootDir: string;
|
|
4
4
|
outDir: string;
|
|
5
|
+
generateClient?: boolean;
|
|
6
|
+
generatePermissions?: boolean;
|
|
7
|
+
/** Prune unused root providers from compiled output (Angular Ivy AOT tree-shaking). */
|
|
8
|
+
treeShakeUnusedProviders?: boolean;
|
|
9
|
+
/** Incremental emitter state. Unchanged artifacts are not rewritten. */
|
|
10
|
+
artifactHashes?: Map<string, string>;
|
|
5
11
|
}
|
|
6
12
|
export interface RenderedArtifacts {
|
|
7
13
|
applicationCode: string;
|
|
8
14
|
manifestJson: string;
|
|
15
|
+
clientCode?: string;
|
|
16
|
+
permissionsCode?: string;
|
|
9
17
|
}
|
|
10
18
|
/** Render application.ts and app.manifest.json content without file I/O. */
|
|
11
19
|
export declare function renderApplication(graph: ApplicationGraph, options: GenerateOptions): RenderedArtifacts;
|
|
@@ -14,3 +22,12 @@ export declare function renderApplication(graph: ApplicationGraph, options: Gene
|
|
|
14
22
|
* Generated code imports only application classes and schemas, with no runtime reflection or container lookup.
|
|
15
23
|
*/
|
|
16
24
|
export declare function generateApplication(graph: ApplicationGraph, options: GenerateOptions): Promise<string[]>;
|
|
25
|
+
/**
|
|
26
|
+
* Generates typed API client in client.ts from discovered Controllers and Routes.
|
|
27
|
+
* Modeled after Angular HttpClient and typed contract clients.
|
|
28
|
+
*/
|
|
29
|
+
export declare function renderClient(graph: ApplicationGraph, _options?: GenerateOptions): string;
|
|
30
|
+
/**
|
|
31
|
+
* Generates static permissions and route permission bindings in permissions.ts.
|
|
32
|
+
*/
|
|
33
|
+
export declare function renderPermissions(graph: ApplicationGraph): string;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { CompileOptions, CompileResult, CompileStats, DependencyGraphCache, ModuleNode } from "./types";
|
|
2
|
+
export interface IncrementalCompileResult extends CompileResult {
|
|
3
|
+
stats: CompileStats;
|
|
4
|
+
}
|
|
5
|
+
export interface IncrementalCompiler {
|
|
6
|
+
compile(options: CompileOptions, changedPaths?: string[]): Promise<IncrementalCompileResult>;
|
|
7
|
+
reset(): void;
|
|
8
|
+
getCache?(): DependencyGraphCache;
|
|
9
|
+
}
|
|
10
|
+
export declare function createDependencyGraphCache(): DependencyGraphCache;
|
|
11
|
+
/** Keeps a process-local source snapshot and reuses the last result on cache hits. */
|
|
12
|
+
export declare function createIncrementalCompiler(): IncrementalCompiler;
|
|
13
|
+
/**
|
|
14
|
+
* Angular Ivy-inspired module dependency graph.
|
|
15
|
+
* Tracks forward module imports, reverse dependent relationships, and file ownership
|
|
16
|
+
* to compute precise affected module subgraphs during incremental compilation.
|
|
17
|
+
*/
|
|
18
|
+
export declare class ModuleDependencyGraph {
|
|
19
|
+
private readonly imports;
|
|
20
|
+
private readonly dependents;
|
|
21
|
+
private readonly fileOwners;
|
|
22
|
+
private readonly moduleMap;
|
|
23
|
+
constructor(modules?: ModuleNode[]);
|
|
24
|
+
rebuild(modules: ModuleNode[]): void;
|
|
25
|
+
private indexFile;
|
|
26
|
+
getModulesOwningFile(filePath: string): string[];
|
|
27
|
+
getAffectedModules(changedFiles: string[]): string[];
|
|
28
|
+
getDirectImports(moduleName: string): string[];
|
|
29
|
+
getDirectDependents(moduleName: string): string[];
|
|
30
|
+
}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,8 +1,21 @@
|
|
|
1
1
|
export { analyzeProject } from "./analyze";
|
|
2
2
|
export { checkProject, compileProject } from "./compile";
|
|
3
|
+
export { watchProject } from "./watch";
|
|
4
|
+
export { doctorProject, explainGraph, formatGraph, exportGraphDot, exportGraphMermaid } from "./inspect";
|
|
5
|
+
export { createIncrementalCompiler } from "./incremental";
|
|
6
|
+
export { createDependencyGraphCache } from "./incremental";
|
|
7
|
+
export { ModuleDependencyGraph } from "./incremental";
|
|
8
|
+
export { createIncrementalProgramSession } from "./program";
|
|
9
|
+
export type { IncrementalProgramSession, ProgramUpdate } from "./program";
|
|
10
|
+
export { compileTraits } from "./traits";
|
|
11
|
+
export { TraitCompiler } from "./traits";
|
|
12
|
+
export type { TraitCompilation, TraitHandler, TraitKind, TraitRecord } from "./traits";
|
|
3
13
|
export { generateApplication, renderApplication } from "./generate";
|
|
4
14
|
export type { GenerateOptions, RenderedArtifacts } from "./generate";
|
|
5
|
-
export {
|
|
15
|
+
export type { DoctorResult } from "./inspect";
|
|
16
|
+
export { validateGraph, COMPILER_DIAGNOSTIC_CODES } from "./validate";
|
|
17
|
+
export { scanGeneratedArtifacts, scanProductionSource } from "./type-safety";
|
|
18
|
+
export type { TypeSafetyScanOptions } from "./type-safety";
|
|
6
19
|
export { camelName } from "./util";
|
|
7
20
|
export { ANGULAR_ENTERPRISE_RULES, CLEAN_ARCHITECTURE_RULES, MODULAR_MONOLITH_RULES, MODULE_BOUNDARY_PROFILES, getModuleBoundaryPreset, getModuleBoundaryProfile, resolveModuleBoundaries, } from "./profiles";
|
|
8
|
-
export type { ApplicationGraph, CheckProjectResult, CommandExecutionCapabilities, CommandNode, CompileOptions, CompileResult, ControllerNode, Diagnostic, ModuleBoundaryPresetName, ModuleBoundaryProfile, ModuleBoundaryRule, ModuleNode, ProviderKind, ProviderNode, QueryNode, RouteNode, Scope, TokenKind, ValidateOptions, } from "./types";
|
|
21
|
+
export type { ApplicationGraph, AspectRefNode, CachedModuleEntry, CheckProjectResult, CommandExecutionCapabilities, CommandNode, CompileOptions, CompileResult, CompileStats, ControllerNode, DependencyGraphCache, DependencyGraphIndex, Diagnostic, ModuleBoundaryPresetName, ModuleBoundaryProfile, ModuleBoundaryRule, ModuleNode, JobNode, ProviderKind, ProviderNode, QueryNode, RouteNode, Scope, TokenKind, TypeSafetyOptions, ValidateOptions, WatchEvent, WatchHandle, WatchOptions, } from "./types";
|