@formspec/build 0.1.0-alpha.30 → 0.1.0-alpha.32
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 +82 -5
- package/dist/analyzer/class-analyzer.d.ts +6 -0
- package/dist/analyzer/class-analyzer.d.ts.map +1 -1
- package/dist/browser.cjs +166 -24
- package/dist/browser.cjs.map +1 -1
- package/dist/browser.js +166 -24
- package/dist/browser.js.map +1 -1
- package/dist/build-alpha.d.ts +180 -0
- package/dist/build-beta.d.ts +180 -0
- package/dist/build-internal.d.ts +180 -0
- package/dist/build.d.ts +180 -0
- package/dist/cli.cjs +584 -33
- package/dist/cli.cjs.map +1 -1
- package/dist/cli.js +582 -33
- package/dist/cli.js.map +1 -1
- package/dist/generators/discovered-schema.d.ts +112 -0
- package/dist/generators/discovered-schema.d.ts.map +1 -0
- package/dist/index.cjs +573 -33
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +565 -33
- package/dist/index.js.map +1 -1
- package/dist/internals.cjs +197 -33
- package/dist/internals.cjs.map +1 -1
- package/dist/internals.js +197 -33
- package/dist/internals.js.map +1 -1
- package/dist/static-build.d.ts +61 -0
- package/dist/static-build.d.ts.map +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import * as ts from "typescript";
|
|
2
|
+
/**
|
|
3
|
+
* Supported compiler context for static build-time analysis workflows.
|
|
4
|
+
*
|
|
5
|
+
* This context gives consumers access to the TypeScript program, checker, and
|
|
6
|
+
* source file used to discover declarations before invoking FormSpec schema
|
|
7
|
+
* generation helpers.
|
|
8
|
+
*
|
|
9
|
+
* @public
|
|
10
|
+
*/
|
|
11
|
+
export interface StaticBuildContext {
|
|
12
|
+
/** Host-owned or FormSpec-created TypeScript program. */
|
|
13
|
+
readonly program: ts.Program;
|
|
14
|
+
/** TypeScript checker for symbol and type analysis. */
|
|
15
|
+
readonly checker: ts.TypeChecker;
|
|
16
|
+
/** Source file used as the entry module for export resolution. */
|
|
17
|
+
readonly sourceFile: ts.SourceFile;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Creates a supported static build context for a source file.
|
|
21
|
+
*
|
|
22
|
+
* @param filePath - Entry TypeScript source file used for export resolution
|
|
23
|
+
* @returns Reusable build context containing the program, checker, and source file
|
|
24
|
+
*
|
|
25
|
+
* @public
|
|
26
|
+
*/
|
|
27
|
+
export declare function createStaticBuildContext(filePath: string): StaticBuildContext;
|
|
28
|
+
/**
|
|
29
|
+
* Creates a supported static build context from an existing host-owned program.
|
|
30
|
+
*
|
|
31
|
+
* @param program - Existing TypeScript program supplied by the caller
|
|
32
|
+
* @param filePath - Entry TypeScript source file used for export resolution
|
|
33
|
+
* @returns Reusable build context containing the program, checker, and source file
|
|
34
|
+
*
|
|
35
|
+
* @public
|
|
36
|
+
*/
|
|
37
|
+
export declare function createStaticBuildContextFromProgram(program: ts.Program, filePath: string): StaticBuildContext;
|
|
38
|
+
/**
|
|
39
|
+
* Resolves an export from the context source file, following aliases and re-exports.
|
|
40
|
+
*
|
|
41
|
+
* @param context - Static build context created for the entry source file
|
|
42
|
+
* @param exportName - Export name to resolve. Defaults to `"default"`.
|
|
43
|
+
* @returns Resolved symbol for the export, or `null` when it cannot be found
|
|
44
|
+
*
|
|
45
|
+
* @public
|
|
46
|
+
*/
|
|
47
|
+
export declare function resolveModuleExport(context: StaticBuildContext, exportName?: string): ts.Symbol | null;
|
|
48
|
+
/**
|
|
49
|
+
* Resolves the declaration behind an export from the context source file,
|
|
50
|
+
* following aliases and re-exports. This helper is intentionally limited to
|
|
51
|
+
* declaration kinds accepted by declaration-driven schema generation.
|
|
52
|
+
*
|
|
53
|
+
* @param context - Static build context created for the entry source file
|
|
54
|
+
* @param exportName - Export name to resolve. Defaults to `"default"`.
|
|
55
|
+
* @returns Resolved class, interface, or type-alias declaration for the export,
|
|
56
|
+
* or `null` when the export does not resolve to one of those schema-source kinds
|
|
57
|
+
*
|
|
58
|
+
* @public
|
|
59
|
+
*/
|
|
60
|
+
export declare function resolveModuleExportDeclaration(context: StaticBuildContext, exportName?: string): ts.ClassDeclaration | ts.InterfaceDeclaration | ts.TypeAliasDeclaration | null;
|
|
61
|
+
//# sourceMappingURL=static-build.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"static-build.d.ts","sourceRoot":"","sources":["../src/static-build.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,YAAY,CAAC;AAOjC;;;;;;;;GAQG;AACH,MAAM,WAAW,kBAAkB;IACjC,yDAAyD;IACzD,QAAQ,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC;IAC7B,uDAAuD;IACvD,QAAQ,CAAC,OAAO,EAAE,EAAE,CAAC,WAAW,CAAC;IACjC,kEAAkE;IAClE,QAAQ,CAAC,UAAU,EAAE,EAAE,CAAC,UAAU,CAAC;CACpC;AAMD;;;;;;;GAOG;AACH,wBAAgB,wBAAwB,CAAC,QAAQ,EAAE,MAAM,GAAG,kBAAkB,CAE7E;AAED;;;;;;;;GAQG;AACH,wBAAgB,mCAAmC,CACjD,OAAO,EAAE,EAAE,CAAC,OAAO,EACnB,QAAQ,EAAE,MAAM,GACf,kBAAkB,CAEpB;AAiBD;;;;;;;;GAQG;AACH,wBAAgB,mBAAmB,CACjC,OAAO,EAAE,kBAAkB,EAC3B,UAAU,SAAY,GACrB,EAAE,CAAC,MAAM,GAAG,IAAI,CAiBlB;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,8BAA8B,CAC5C,OAAO,EAAE,kBAAkB,EAC3B,UAAU,SAAY,GACrB,EAAE,CAAC,gBAAgB,GAAG,EAAE,CAAC,oBAAoB,GAAG,EAAE,CAAC,oBAAoB,GAAG,IAAI,CAIhF"}
|