@formspec/build 0.1.0-alpha.31 → 0.1.0-alpha.33

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.
@@ -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"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@formspec/build",
3
- "version": "0.1.0-alpha.31",
3
+ "version": "0.1.0-alpha.33",
4
4
  "description": "Build tools to compile FormSpec forms to JSON Schema and UI Schema",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",
@@ -35,15 +35,15 @@
35
35
  "@microsoft/tsdoc": "^0.16.0",
36
36
  "@microsoft/tsdoc-config": "^0.18.1",
37
37
  "zod": "^3.25.0",
38
- "@formspec/analysis": "0.1.0-alpha.30",
39
- "@formspec/core": "0.1.0-alpha.29"
38
+ "@formspec/analysis": "0.1.0-alpha.33",
39
+ "@formspec/core": "0.1.0-alpha.33"
40
40
  },
41
41
  "peerDependencies": {
42
42
  "typescript": "^5.0.0"
43
43
  },
44
44
  "devDependencies": {
45
45
  "vitest": "^3.0.0",
46
- "@formspec/dsl": "0.1.0-alpha.29"
46
+ "@formspec/dsl": "0.1.0-alpha.33"
47
47
  },
48
48
  "publishConfig": {
49
49
  "access": "public"