@gaganref/confect-core 10.3.1-fork.81 → 10.3.1-fork.82
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.
|
@@ -4,11 +4,21 @@ export interface Data<Value = unknown> {
|
|
|
4
4
|
readonly format: number;
|
|
5
5
|
readonly functions: Readonly<Record<string, Value>>;
|
|
6
6
|
}
|
|
7
|
+
/**
|
|
8
|
+
* The backend codegen generates: the app, or a component under the name its
|
|
9
|
+
* `defineComponent` gives it.
|
|
10
|
+
*/
|
|
11
|
+
export type Target = {
|
|
12
|
+
readonly kind: "app";
|
|
13
|
+
} | {
|
|
14
|
+
readonly kind: "component";
|
|
15
|
+
readonly name: string;
|
|
16
|
+
};
|
|
7
17
|
/**
|
|
8
18
|
* What codegen hands a section's `render`: the exports of each `confect/` file
|
|
9
19
|
* it matched, every registered function with the spec file declaring it, each
|
|
10
|
-
* mounted component with the specifier of its definition,
|
|
11
|
-
*
|
|
20
|
+
* mounted component with the specifier of its definition, every file `match`
|
|
21
|
+
* was offered, the backend it generates and the absolute path of `confect/`.
|
|
12
22
|
*/
|
|
13
23
|
export interface GenerateInput {
|
|
14
24
|
readonly modules: ReadonlyArray<{
|
|
@@ -24,6 +34,8 @@ export interface GenerateInput {
|
|
|
24
34
|
readonly definition: string;
|
|
25
35
|
}>;
|
|
26
36
|
readonly files: ReadonlyArray<string>;
|
|
37
|
+
readonly target: Target;
|
|
38
|
+
readonly confectDirectory: string;
|
|
27
39
|
}
|
|
28
40
|
export interface Generate {
|
|
29
41
|
readonly file: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ManifestSection.d.ts","sourceRoot":"","sources":["../src/ManifestSection.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,YAAY,MAAM,mBAAmB,CAAC;AACvD,OAAO,KAAK,KAAK,cAAc,MAAM,qBAAqB,CAAC;AAE3D,MAAM,WAAW,IAAI,CAAC,KAAK,GAAG,OAAO;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.js","names":[],"sources":["../src/ManifestSection.ts"],"sourcesContent":["import type * as FunctionSpec from \"./FunctionSpec.js\";\nimport type * as MiddlewareSpec from \"./MiddlewareSpec.js\";\n\nexport interface Data<Value = unknown> {\n readonly format: number;\n readonly functions: Readonly<Record<string, Value>>;\n}\n\n/**\n * What codegen hands a section's `render`: the exports of each `confect/` file\n * it matched, every registered function with the spec file declaring it, each\n * mounted component with the specifier of its definition,
|
|
1
|
+
{"version":3,"file":"ManifestSection.js","names":[],"sources":["../src/ManifestSection.ts"],"sourcesContent":["import type * as FunctionSpec from \"./FunctionSpec.js\";\nimport type * as MiddlewareSpec from \"./MiddlewareSpec.js\";\n\nexport interface Data<Value = unknown> {\n readonly format: number;\n readonly functions: Readonly<Record<string, Value>>;\n}\n\n/**\n * The backend codegen generates: the app, or a component under the name its\n * `defineComponent` gives it.\n */\nexport type Target =\n | { readonly kind: \"app\" }\n | { readonly kind: \"component\"; readonly name: string };\n\n/**\n * What codegen hands a section's `render`: the exports of each `confect/` file\n * it matched, every registered function with the spec file declaring it, each\n * mounted component with the specifier of its definition, every file `match`\n * was offered, the backend it generates and the absolute path of `confect/`.\n */\nexport interface GenerateInput {\n readonly modules: ReadonlyArray<{\n readonly relativePath: string;\n readonly exports: Readonly<Record<string, unknown>>;\n }>;\n readonly functions: ReadonlyArray<{\n readonly path: string;\n readonly source: string;\n }>;\n readonly mounts: ReadonlyArray<{\n readonly name: string;\n readonly definition: string;\n }>;\n readonly files: ReadonlyArray<string>;\n readonly target: Target;\n readonly confectDirectory: string;\n}\n\nexport interface Generate {\n readonly file: string;\n match(relativePath: string): boolean;\n render(input: GenerateInput): {\n readonly contents: string;\n readonly errors: ReadonlyArray<string>;\n };\n}\n\n/**\n * What codegen hands a section's `summarize`: the `confect/` files its\n * `generate` matched, each function's description by path, and the spec file\n * declaring each function by path, relative to `confect/`.\n */\nexport interface SummarizeInput<Value = unknown> {\n readonly modules: GenerateInput[\"modules\"];\n readonly functions: Readonly<Record<string, Value>>;\n readonly sources: Readonly<Record<string, string>>;\n}\n\nexport interface ManifestSection<\n Value = unknown,\n Data_ extends { readonly format: number } = Data<Value>,\n> {\n readonly owner: string;\n readonly format: number;\n describe(input: {\n readonly path: string;\n readonly spec: FunctionSpec.AnyWithProps;\n readonly middleware: ReadonlyArray<MiddlewareSpec.AnyMiddlewareSpec>;\n }): Value;\n summarize?(input: SummarizeInput<Value>): Data_;\n check?(\n next: Data_,\n previous: unknown,\n ): {\n readonly errors: ReadonlyArray<string>;\n readonly notes: ReadonlyArray<string>;\n };\n readonly generate?: Generate;\n}\n\nexport type Any = ManifestSection<unknown, { readonly format: number }>;\n\nexport interface Entry {\n readonly key: string;\n readonly section: Any;\n}\n"],"mappings":""}
|
package/package.json
CHANGED
package/src/ManifestSection.ts
CHANGED
|
@@ -6,11 +6,19 @@ export interface Data<Value = unknown> {
|
|
|
6
6
|
readonly functions: Readonly<Record<string, Value>>;
|
|
7
7
|
}
|
|
8
8
|
|
|
9
|
+
/**
|
|
10
|
+
* The backend codegen generates: the app, or a component under the name its
|
|
11
|
+
* `defineComponent` gives it.
|
|
12
|
+
*/
|
|
13
|
+
export type Target =
|
|
14
|
+
| { readonly kind: "app" }
|
|
15
|
+
| { readonly kind: "component"; readonly name: string };
|
|
16
|
+
|
|
9
17
|
/**
|
|
10
18
|
* What codegen hands a section's `render`: the exports of each `confect/` file
|
|
11
19
|
* it matched, every registered function with the spec file declaring it, each
|
|
12
|
-
* mounted component with the specifier of its definition,
|
|
13
|
-
*
|
|
20
|
+
* mounted component with the specifier of its definition, every file `match`
|
|
21
|
+
* was offered, the backend it generates and the absolute path of `confect/`.
|
|
14
22
|
*/
|
|
15
23
|
export interface GenerateInput {
|
|
16
24
|
readonly modules: ReadonlyArray<{
|
|
@@ -26,6 +34,8 @@ export interface GenerateInput {
|
|
|
26
34
|
readonly definition: string;
|
|
27
35
|
}>;
|
|
28
36
|
readonly files: ReadonlyArray<string>;
|
|
37
|
+
readonly target: Target;
|
|
38
|
+
readonly confectDirectory: string;
|
|
29
39
|
}
|
|
30
40
|
|
|
31
41
|
export interface Generate {
|