@powerlines/plugin-alloy 0.26.236 → 0.26.238
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/core/components/index.cjs +1 -9
- package/dist/core/components/index.d.cts +1 -5
- package/dist/core/components/index.d.mts +1 -5
- package/dist/core/components/index.mjs +1 -5
- package/dist/core/components/infrastructure-file.cjs +6 -3
- package/dist/core/components/infrastructure-file.d.cts +1 -1
- package/dist/core/components/infrastructure-file.d.cts.map +1 -1
- package/dist/core/components/infrastructure-file.d.mts +1 -1
- package/dist/core/components/infrastructure-file.mjs +5 -2
- package/dist/core/contexts/index.cjs +1 -11
- package/dist/core/contexts/index.d.cts +1 -3
- package/dist/core/contexts/index.d.mts +1 -3
- package/dist/core/contexts/index.mjs +1 -3
- package/dist/core/index.cjs +2 -23
- package/dist/core/index.d.cts +2 -10
- package/dist/core/index.d.mts +2 -10
- package/dist/core/index.mjs +2 -10
- package/dist/helpers/capnp.cjs +2 -2
- package/dist/helpers/capnp.mjs +2 -2
- package/dist/index.cjs +10 -2
- package/dist/index.d.cts +10 -4
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.mts +10 -4
- package/dist/index.mjs +10 -2
- package/dist/render.cjs +67 -48
- package/dist/render.d.cts +33 -2
- package/dist/render.d.cts.map +1 -1
- package/dist/render.d.mts +33 -2
- package/dist/render.mjs +68 -49
- package/dist/types/index.d.cts +2 -3
- package/dist/types/index.d.mts +2 -3
- package/dist/types/plugin.d.cts +7 -4
- package/dist/types/plugin.d.cts.map +1 -1
- package/dist/types/plugin.d.mts +7 -4
- package/dist/typescript/components/builtin-file.cjs +6 -6
- package/dist/typescript/components/builtin-file.d.cts +2 -2
- package/dist/typescript/components/builtin-file.d.cts.map +1 -1
- package/dist/typescript/components/builtin-file.d.mts +2 -2
- package/dist/typescript/components/builtin-file.mjs +2 -2
- package/dist/typescript/components/entry-file.cjs +2 -2
- package/dist/typescript/components/entry-file.d.cts +1 -1
- package/dist/typescript/components/entry-file.d.cts.map +1 -1
- package/dist/typescript/components/entry-file.d.mts +1 -1
- package/dist/typescript/components/entry-file.mjs +1 -1
- package/dist/typescript/components/index.cjs +1 -56
- package/dist/typescript/components/index.d.cts +1 -12
- package/dist/typescript/components/index.d.mts +1 -12
- package/dist/typescript/components/index.mjs +1 -12
- package/dist/typescript/index.cjs +1 -64
- package/dist/typescript/index.d.cts +1 -17
- package/dist/typescript/index.d.mts +1 -17
- package/dist/typescript/index.mjs +1 -17
- package/package.json +18 -639
- package/dist/core/components/output.cjs +0 -40
- package/dist/core/components/output.d.cts +0 -22
- package/dist/core/components/output.d.cts.map +0 -1
- package/dist/core/components/output.d.mts +0 -22
- package/dist/core/components/output.d.mts.map +0 -1
- package/dist/core/components/output.mjs +0 -40
- package/dist/core/components/output.mjs.map +0 -1
- package/dist/core/components/single-line-comment.cjs +0 -22
- package/dist/core/components/single-line-comment.d.cts +0 -19
- package/dist/core/components/single-line-comment.d.cts.map +0 -1
- package/dist/core/components/single-line-comment.d.mts +0 -19
- package/dist/core/components/single-line-comment.d.mts.map +0 -1
- package/dist/core/components/single-line-comment.mjs +0 -22
- package/dist/core/components/single-line-comment.mjs.map +0 -1
- package/dist/core/components/source-file.cjs +0 -64
- package/dist/core/components/source-file.d.cts +0 -30
- package/dist/core/components/source-file.d.cts.map +0 -1
- package/dist/core/components/source-file.d.mts +0 -30
- package/dist/core/components/source-file.d.mts.map +0 -1
- package/dist/core/components/source-file.mjs +0 -62
- package/dist/core/components/source-file.mjs.map +0 -1
- package/dist/core/components/spacing.cjs +0 -19
- package/dist/core/components/spacing.d.cts +0 -19
- package/dist/core/components/spacing.d.cts.map +0 -1
- package/dist/core/components/spacing.d.mts +0 -19
- package/dist/core/components/spacing.d.mts.map +0 -1
- package/dist/core/components/spacing.mjs +0 -19
- package/dist/core/components/spacing.mjs.map +0 -1
- package/dist/core/contexts/meta.cjs +0 -40
- package/dist/core/contexts/meta.d.cts +0 -46
- package/dist/core/contexts/meta.d.cts.map +0 -1
- package/dist/core/contexts/meta.d.mts +0 -46
- package/dist/core/contexts/meta.d.mts.map +0 -1
- package/dist/core/contexts/meta.mjs +0 -37
- package/dist/core/contexts/meta.mjs.map +0 -1
- package/dist/core/contexts/schema.cjs +0 -38
- package/dist/core/contexts/schema.d.cts +0 -26
- package/dist/core/contexts/schema.d.cts.map +0 -1
- package/dist/core/contexts/schema.d.mts +0 -26
- package/dist/core/contexts/schema.d.mts.map +0 -1
- package/dist/core/contexts/schema.mjs +0 -35
- package/dist/core/contexts/schema.mjs.map +0 -1
- package/dist/core/helpers/code.cjs +0 -33
- package/dist/core/helpers/code.d.cts +0 -28
- package/dist/core/helpers/code.d.cts.map +0 -1
- package/dist/core/helpers/code.d.mts +0 -28
- package/dist/core/helpers/code.d.mts.map +0 -1
- package/dist/core/helpers/code.mjs +0 -33
- package/dist/core/helpers/code.mjs.map +0 -1
- package/dist/core/helpers/index.cjs +0 -4
- package/dist/core/helpers/index.d.cts +0 -2
- package/dist/core/helpers/index.d.mts +0 -2
- package/dist/core/helpers/index.mjs +0 -3
- package/dist/hcl/components/block-declaration.cjs +0 -33
- package/dist/hcl/components/block-declaration.d.cts +0 -19
- package/dist/hcl/components/block-declaration.d.cts.map +0 -1
- package/dist/hcl/components/block-declaration.d.mts +0 -19
- package/dist/hcl/components/block-declaration.d.mts.map +0 -1
- package/dist/hcl/components/block-declaration.mjs +0 -33
- package/dist/hcl/components/block-declaration.mjs.map +0 -1
- package/dist/hcl/components/hcl-file.cjs +0 -82
- package/dist/hcl/components/hcl-file.d.cts +0 -25
- package/dist/hcl/components/hcl-file.d.cts.map +0 -1
- package/dist/hcl/components/hcl-file.d.mts +0 -25
- package/dist/hcl/components/hcl-file.d.mts.map +0 -1
- package/dist/hcl/components/hcl-file.mjs +0 -81
- package/dist/hcl/components/hcl-file.mjs.map +0 -1
- package/dist/hcl/components/index.cjs +0 -11
- package/dist/hcl/components/index.d.cts +0 -5
- package/dist/hcl/components/index.d.mts +0 -5
- package/dist/hcl/components/index.mjs +0 -6
- package/dist/hcl/components/packer-file.cjs +0 -28
- package/dist/hcl/components/packer-file.d.cts +0 -16
- package/dist/hcl/components/packer-file.d.cts.map +0 -1
- package/dist/hcl/components/packer-file.d.mts +0 -16
- package/dist/hcl/components/packer-file.d.mts.map +0 -1
- package/dist/hcl/components/packer-file.mjs +0 -28
- package/dist/hcl/components/packer-file.mjs.map +0 -1
- package/dist/hcl/components/terraform-file.cjs +0 -29
- package/dist/hcl/components/terraform-file.d.cts +0 -17
- package/dist/hcl/components/terraform-file.d.cts.map +0 -1
- package/dist/hcl/components/terraform-file.d.mts +0 -17
- package/dist/hcl/components/terraform-file.d.mts.map +0 -1
- package/dist/hcl/components/terraform-file.mjs +0 -29
- package/dist/hcl/components/terraform-file.mjs.map +0 -1
- package/dist/hcl/index.cjs +0 -12
- package/dist/hcl/index.d.cts +0 -6
- package/dist/hcl/index.d.mts +0 -6
- package/dist/hcl/index.mjs +0 -7
- package/dist/markdown/components/alert.cjs +0 -74
- package/dist/markdown/components/alert.d.cts +0 -52
- package/dist/markdown/components/alert.d.cts.map +0 -1
- package/dist/markdown/components/alert.d.mts +0 -52
- package/dist/markdown/components/alert.d.mts.map +0 -1
- package/dist/markdown/components/alert.mjs +0 -69
- package/dist/markdown/components/alert.mjs.map +0 -1
- package/dist/markdown/components/front-matter.cjs +0 -30
- package/dist/markdown/components/front-matter.d.cts +0 -13
- package/dist/markdown/components/front-matter.d.cts.map +0 -1
- package/dist/markdown/components/front-matter.d.mts +0 -13
- package/dist/markdown/components/front-matter.d.mts.map +0 -1
- package/dist/markdown/components/front-matter.mjs +0 -30
- package/dist/markdown/components/front-matter.mjs.map +0 -1
- package/dist/markdown/components/heading.cjs +0 -23
- package/dist/markdown/components/heading.d.cts +0 -17
- package/dist/markdown/components/heading.d.cts.map +0 -1
- package/dist/markdown/components/heading.d.mts +0 -17
- package/dist/markdown/components/heading.d.mts.map +0 -1
- package/dist/markdown/components/heading.mjs +0 -23
- package/dist/markdown/components/heading.mjs.map +0 -1
- package/dist/markdown/components/index.cjs +0 -20
- package/dist/markdown/components/index.d.cts +0 -6
- package/dist/markdown/components/index.d.mts +0 -6
- package/dist/markdown/components/index.mjs +0 -7
- package/dist/markdown/components/markdown-file.cjs +0 -146
- package/dist/markdown/components/markdown-file.d.cts +0 -25
- package/dist/markdown/components/markdown-file.d.cts.map +0 -1
- package/dist/markdown/components/markdown-file.d.mts +0 -25
- package/dist/markdown/components/markdown-file.d.mts.map +0 -1
- package/dist/markdown/components/markdown-file.mjs +0 -145
- package/dist/markdown/components/markdown-file.mjs.map +0 -1
- package/dist/markdown/components/markdown-table.cjs +0 -106
- package/dist/markdown/components/markdown-table.d.cts +0 -37
- package/dist/markdown/components/markdown-table.d.cts.map +0 -1
- package/dist/markdown/components/markdown-table.d.mts +0 -37
- package/dist/markdown/components/markdown-table.d.mts.map +0 -1
- package/dist/markdown/components/markdown-table.mjs +0 -104
- package/dist/markdown/components/markdown-table.mjs.map +0 -1
- package/dist/markdown/contexts/index.cjs +0 -7
- package/dist/markdown/contexts/index.d.cts +0 -2
- package/dist/markdown/contexts/index.d.mts +0 -2
- package/dist/markdown/contexts/index.mjs +0 -3
- package/dist/markdown/contexts/markdown-table.cjs +0 -37
- package/dist/markdown/contexts/markdown-table.d.cts +0 -35
- package/dist/markdown/contexts/markdown-table.d.cts.map +0 -1
- package/dist/markdown/contexts/markdown-table.d.mts +0 -35
- package/dist/markdown/contexts/markdown-table.d.mts.map +0 -1
- package/dist/markdown/contexts/markdown-table.mjs +0 -34
- package/dist/markdown/contexts/markdown-table.mjs.map +0 -1
- package/dist/markdown/index.cjs +0 -27
- package/dist/markdown/index.d.cts +0 -9
- package/dist/markdown/index.d.mts +0 -9
- package/dist/markdown/index.mjs +0 -10
- package/dist/types/components.cjs +0 -9
- package/dist/types/components.d.cts +0 -137
- package/dist/types/components.d.cts.map +0 -1
- package/dist/types/components.d.mts +0 -137
- package/dist/types/components.d.mts.map +0 -1
- package/dist/types/components.mjs +0 -10
- package/dist/types/components.mjs.map +0 -1
- package/dist/typescript/components/class-declaration.cjs +0 -305
- package/dist/typescript/components/class-declaration.d.cts +0 -139
- package/dist/typescript/components/class-declaration.d.cts.map +0 -1
- package/dist/typescript/components/class-declaration.d.mts +0 -139
- package/dist/typescript/components/class-declaration.d.mts.map +0 -1
- package/dist/typescript/components/class-declaration.mjs +0 -300
- package/dist/typescript/components/class-declaration.mjs.map +0 -1
- package/dist/typescript/components/dynamic-import-statement.cjs +0 -25
- package/dist/typescript/components/dynamic-import-statement.d.cts +0 -30
- package/dist/typescript/components/dynamic-import-statement.d.cts.map +0 -1
- package/dist/typescript/components/dynamic-import-statement.d.mts +0 -30
- package/dist/typescript/components/dynamic-import-statement.d.mts.map +0 -1
- package/dist/typescript/components/dynamic-import-statement.mjs +0 -25
- package/dist/typescript/components/dynamic-import-statement.mjs.map +0 -1
- package/dist/typescript/components/interface-declaration.cjs +0 -257
- package/dist/typescript/components/interface-declaration.d.cts +0 -78
- package/dist/typescript/components/interface-declaration.d.cts.map +0 -1
- package/dist/typescript/components/interface-declaration.d.mts +0 -78
- package/dist/typescript/components/interface-declaration.d.mts.map +0 -1
- package/dist/typescript/components/interface-declaration.mjs +0 -254
- package/dist/typescript/components/interface-declaration.mjs.map +0 -1
- package/dist/typescript/components/object-declaration.cjs +0 -131
- package/dist/typescript/components/object-declaration.d.cts +0 -24
- package/dist/typescript/components/object-declaration.d.cts.map +0 -1
- package/dist/typescript/components/object-declaration.d.mts +0 -24
- package/dist/typescript/components/object-declaration.d.mts.map +0 -1
- package/dist/typescript/components/object-declaration.mjs +0 -130
- package/dist/typescript/components/object-declaration.mjs.map +0 -1
- package/dist/typescript/components/property-name.cjs +0 -31
- package/dist/typescript/components/property-name.d.cts +0 -21
- package/dist/typescript/components/property-name.d.cts.map +0 -1
- package/dist/typescript/components/property-name.d.mts +0 -21
- package/dist/typescript/components/property-name.d.mts.map +0 -1
- package/dist/typescript/components/property-name.mjs +0 -31
- package/dist/typescript/components/property-name.mjs.map +0 -1
- package/dist/typescript/components/record-expression.cjs +0 -12
- package/dist/typescript/components/record-expression.d.cts +0 -9
- package/dist/typescript/components/record-expression.d.cts.map +0 -1
- package/dist/typescript/components/record-expression.d.mts +0 -9
- package/dist/typescript/components/record-expression.d.mts.map +0 -1
- package/dist/typescript/components/record-expression.mjs +0 -12
- package/dist/typescript/components/record-expression.mjs.map +0 -1
- package/dist/typescript/components/tsdoc-schema.cjs +0 -166
- package/dist/typescript/components/tsdoc-schema.d.cts +0 -21
- package/dist/typescript/components/tsdoc-schema.d.cts.map +0 -1
- package/dist/typescript/components/tsdoc-schema.d.mts +0 -21
- package/dist/typescript/components/tsdoc-schema.d.mts.map +0 -1
- package/dist/typescript/components/tsdoc-schema.mjs +0 -165
- package/dist/typescript/components/tsdoc-schema.mjs.map +0 -1
- package/dist/typescript/components/tsdoc.cjs +0 -486
- package/dist/typescript/components/tsdoc.d.cts +0 -163
- package/dist/typescript/components/tsdoc.d.cts.map +0 -1
- package/dist/typescript/components/tsdoc.d.mts +0 -163
- package/dist/typescript/components/tsdoc.d.mts.map +0 -1
- package/dist/typescript/components/tsdoc.mjs +0 -465
- package/dist/typescript/components/tsdoc.mjs.map +0 -1
- package/dist/typescript/components/type-declaration.cjs +0 -38
- package/dist/typescript/components/type-declaration.d.cts +0 -15
- package/dist/typescript/components/type-declaration.d.cts.map +0 -1
- package/dist/typescript/components/type-declaration.d.mts +0 -15
- package/dist/typescript/components/type-declaration.d.mts.map +0 -1
- package/dist/typescript/components/type-declaration.mjs +0 -38
- package/dist/typescript/components/type-declaration.mjs.map +0 -1
- package/dist/typescript/components/type-parameters.cjs +0 -82
- package/dist/typescript/components/type-parameters.d.cts +0 -22
- package/dist/typescript/components/type-parameters.d.cts.map +0 -1
- package/dist/typescript/components/type-parameters.d.mts +0 -22
- package/dist/typescript/components/type-parameters.d.mts.map +0 -1
- package/dist/typescript/components/type-parameters.mjs +0 -82
- package/dist/typescript/components/type-parameters.mjs.map +0 -1
- package/dist/typescript/components/typescript-file.cjs +0 -231
- package/dist/typescript/components/typescript-file.d.cts +0 -46
- package/dist/typescript/components/typescript-file.d.cts.map +0 -1
- package/dist/typescript/components/typescript-file.d.mts +0 -46
- package/dist/typescript/components/typescript-file.d.mts.map +0 -1
- package/dist/typescript/components/typescript-file.mjs +0 -229
- package/dist/typescript/components/typescript-file.mjs.map +0 -1
- package/dist/typescript/contexts/index.cjs +0 -4
- package/dist/typescript/contexts/index.d.cts +0 -2
- package/dist/typescript/contexts/index.d.mts +0 -2
- package/dist/typescript/contexts/index.mjs +0 -3
- package/dist/typescript/contexts/lexical-scope.cjs +0 -25
- package/dist/typescript/contexts/lexical-scope.d.cts +0 -12
- package/dist/typescript/contexts/lexical-scope.d.cts.map +0 -1
- package/dist/typescript/contexts/lexical-scope.d.mts +0 -12
- package/dist/typescript/contexts/lexical-scope.d.mts.map +0 -1
- package/dist/typescript/contexts/lexical-scope.mjs +0 -25
- package/dist/typescript/contexts/lexical-scope.mjs.map +0 -1
- package/dist/typescript/contexts/member-scope.cjs +0 -23
- package/dist/typescript/contexts/member-scope.d.cts +0 -18
- package/dist/typescript/contexts/member-scope.d.cts.map +0 -1
- package/dist/typescript/contexts/member-scope.d.mts +0 -18
- package/dist/typescript/contexts/member-scope.d.mts.map +0 -1
- package/dist/typescript/contexts/member-scope.mjs +0 -23
- package/dist/typescript/contexts/member-scope.mjs.map +0 -1
- package/dist/typescript/helpers/get-call-signature-props.cjs +0 -25
- package/dist/typescript/helpers/get-call-signature-props.d.cts +0 -13
- package/dist/typescript/helpers/get-call-signature-props.d.cts.map +0 -1
- package/dist/typescript/helpers/get-call-signature-props.d.mts +0 -13
- package/dist/typescript/helpers/get-call-signature-props.d.mts.map +0 -1
- package/dist/typescript/helpers/get-call-signature-props.mjs +0 -25
- package/dist/typescript/helpers/get-call-signature-props.mjs.map +0 -1
- package/dist/typescript/helpers/index.cjs +0 -6
- package/dist/typescript/helpers/index.d.cts +0 -3
- package/dist/typescript/helpers/index.d.mts +0 -3
- package/dist/typescript/helpers/index.mjs +0 -4
- package/dist/typescript/helpers/utilities.cjs +0 -15
- package/dist/typescript/helpers/utilities.d.cts +0 -11
- package/dist/typescript/helpers/utilities.d.cts.map +0 -1
- package/dist/typescript/helpers/utilities.d.mts +0 -11
- package/dist/typescript/helpers/utilities.d.mts.map +0 -1
- package/dist/typescript/helpers/utilities.mjs +0 -14
- package/dist/typescript/helpers/utilities.mjs.map +0 -1
- package/dist/yaml/components/index.cjs +0 -5
- package/dist/yaml/components/index.d.cts +0 -2
- package/dist/yaml/components/index.d.mts +0 -2
- package/dist/yaml/components/index.mjs +0 -3
- package/dist/yaml/components/yaml-file.cjs +0 -148
- package/dist/yaml/components/yaml-file.d.cts +0 -31
- package/dist/yaml/components/yaml-file.d.cts.map +0 -1
- package/dist/yaml/components/yaml-file.d.mts +0 -31
- package/dist/yaml/components/yaml-file.d.mts.map +0 -1
- package/dist/yaml/components/yaml-file.mjs +0 -147
- package/dist/yaml/components/yaml-file.mjs.map +0 -1
- package/dist/yaml/index.cjs +0 -6
- package/dist/yaml/index.d.cts +0 -3
- package/dist/yaml/index.d.mts +0 -3
- package/dist/yaml/index.mjs +0 -4
package/dist/render.d.cts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"render.d.cts","names":[],"sources":["../src/render.tsx"],"mappings":"
|
|
1
|
+
{"version":3,"file":"render.d.cts","names":[],"sources":["../src/render.tsx"],"mappings":";;;;UA4BiB,iBAAiB;;;;EAIhC;;;;EAKA;;;;EAKA,UAAU;;;;EAKV;;;;EAKA,iBAAiB;GAEhB;;;;;;;;;;;;;;;;;;;;;;;iBAgCmB,OAAO,iBAAiB,eAC5C,SAAS,UACT,UAAU,WAAQ;;;;;;;;;;;;;;;;iBAsGJ,aAAa,iBAAiB,eAC5C,SAAS,UACT,UAAU,UACV,UAAU"}
|
package/dist/render.d.mts
CHANGED
|
@@ -1,9 +1,38 @@
|
|
|
1
1
|
import { Children, PrintTreeOptions } from "@alloy-js/core";
|
|
2
|
-
import { PluginContext } from "powerlines";
|
|
2
|
+
import { PluginContext, StoragePreset } from "powerlines";
|
|
3
|
+
import { MetaConfig } from "@power-plant/core";
|
|
3
4
|
//#region src/render.d.ts
|
|
5
|
+
interface MetaItem extends MetaConfig {
|
|
6
|
+
/**
|
|
7
|
+
* The kind of metadata item.
|
|
8
|
+
*/
|
|
9
|
+
kind?: "builtin" | "entry" | "infrastructure" | string;
|
|
10
|
+
/**
|
|
11
|
+
* Whether to skip formatting for this output.
|
|
12
|
+
*/
|
|
13
|
+
skipFormat?: boolean;
|
|
14
|
+
/**
|
|
15
|
+
* The storage preset or adapter name for the output files.
|
|
16
|
+
*/
|
|
17
|
+
storage?: StoragePreset | string;
|
|
18
|
+
/**
|
|
19
|
+
* Built-in / infrastructure module id.
|
|
20
|
+
*/
|
|
21
|
+
id?: string;
|
|
22
|
+
/**
|
|
23
|
+
* Entry type definition metadata.
|
|
24
|
+
*/
|
|
25
|
+
typeDefinition?: Record<string, unknown>;
|
|
26
|
+
[key: string]: any;
|
|
27
|
+
}
|
|
4
28
|
/**
|
|
5
29
|
* A function to render children components within the [Alloy](https://alloy-framework.github.io) context, and write any saved content to the file system.
|
|
6
30
|
*
|
|
31
|
+
* @remarks
|
|
32
|
+
* Uses Power Plant's {@link generate | `generate`} entry point to create an
|
|
33
|
+
* execution context and render Alloy-js templates, then emits the resulting
|
|
34
|
+
* documents through the Powerlines plugin context.
|
|
35
|
+
*
|
|
7
36
|
* @example
|
|
8
37
|
* ```tsx
|
|
9
38
|
* import { render } from "@powerlines/plugin-alloy/render";
|
|
@@ -11,6 +40,8 @@ import { PluginContext } from "powerlines";
|
|
|
11
40
|
* await render(context, <> ... </>);
|
|
12
41
|
* ```
|
|
13
42
|
*
|
|
43
|
+
* @see https://github.com/storm-software/power-plant/blob/main/packages/generators/alloy-js/src/generate.ts
|
|
44
|
+
*
|
|
14
45
|
* @param context - The Powerlines plugin context.
|
|
15
46
|
* @param children - The children components to render.
|
|
16
47
|
* @returns A promise that resolves when rendering is complete.
|
|
@@ -33,5 +64,5 @@ declare function render<TContext extends PluginContext>(context: TContext, child
|
|
|
33
64
|
*/
|
|
34
65
|
declare function renderString<TContext extends PluginContext>(context: TContext, children: Children, options?: PrintTreeOptions): string;
|
|
35
66
|
//#endregion
|
|
36
|
-
export { render, renderString };
|
|
67
|
+
export { MetaItem, render, renderString };
|
|
37
68
|
//# sourceMappingURL=render.d.mts.map
|
package/dist/render.mjs
CHANGED
|
@@ -1,16 +1,26 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import "./core/index.mjs";
|
|
1
|
+
import { PowerlinesContext } from "./core/contexts/context.mjs";
|
|
3
2
|
import { findFileExtension } from "@stryke/path/file-path-fns";
|
|
4
3
|
import { createComponent } from "@alloy-js/core/jsx-runtime";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
4
|
+
import { Output, printTree, renderTree } from "@alloy-js/core";
|
|
5
|
+
import { generate } from "@power-plant/alloy-js/generate";
|
|
7
6
|
import { replacePath } from "@stryke/path/replace";
|
|
8
7
|
import { list } from "@stryke/string-format/list";
|
|
9
8
|
|
|
10
9
|
//#region src/render.tsx
|
|
10
|
+
function getDocumentMeta(document) {
|
|
11
|
+
return document.meta ?? document.chunks?.[0]?.meta ?? {};
|
|
12
|
+
}
|
|
13
|
+
function getDocumentContents(document) {
|
|
14
|
+
return (document.chunks ?? []).map((chunk) => chunk.content ?? "").join("");
|
|
15
|
+
}
|
|
11
16
|
/**
|
|
12
17
|
* A function to render children components within the [Alloy](https://alloy-framework.github.io) context, and write any saved content to the file system.
|
|
13
18
|
*
|
|
19
|
+
* @remarks
|
|
20
|
+
* Uses Power Plant's {@link generate | `generate`} entry point to create an
|
|
21
|
+
* execution context and render Alloy-js templates, then emits the resulting
|
|
22
|
+
* documents through the Powerlines plugin context.
|
|
23
|
+
*
|
|
14
24
|
* @example
|
|
15
25
|
* ```tsx
|
|
16
26
|
* import { render } from "@powerlines/plugin-alloy/render";
|
|
@@ -18,56 +28,58 @@ import { list } from "@stryke/string-format/list";
|
|
|
18
28
|
* await render(context, <> ... </>);
|
|
19
29
|
* ```
|
|
20
30
|
*
|
|
31
|
+
* @see https://github.com/storm-software/power-plant/blob/main/packages/generators/alloy-js/src/generate.ts
|
|
32
|
+
*
|
|
21
33
|
* @param context - The Powerlines plugin context.
|
|
22
34
|
* @param children - The children components to render.
|
|
23
35
|
* @returns A promise that resolves when rendering is complete.
|
|
24
36
|
*/
|
|
25
37
|
async function render(context, children) {
|
|
26
|
-
const
|
|
27
|
-
|
|
28
|
-
context,
|
|
29
|
-
meta,
|
|
38
|
+
const documents = await generate(createComponent(PowerlinesContext.Provider, {
|
|
39
|
+
value: context,
|
|
30
40
|
children
|
|
31
|
-
})
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
41
|
+
}), {}, {
|
|
42
|
+
cwd: context.config.cwd,
|
|
43
|
+
logger: {
|
|
44
|
+
debug: (message) => context.debug(message),
|
|
45
|
+
info: (message) => context.info(message),
|
|
46
|
+
warn: (message) => context.warn(message),
|
|
47
|
+
error: (message) => context.error(message)
|
|
48
|
+
},
|
|
49
|
+
settings: { skipStorage: true }
|
|
36
50
|
});
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
context.debug(
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
else if (metadata.kind === "infrastructure") {
|
|
61
|
-
if (!metadata.id) throw new Error(`Infrastructure file "${file.path}" is missing its ID in the render metadata.`);
|
|
62
|
-
context.emitInfrastructureSync(file.contents, metadata.id, {
|
|
63
|
-
skipFormat: metadata.skipFormat,
|
|
64
|
-
storage: metadata.storage,
|
|
65
|
-
extension: findFileExtension(file.path)
|
|
66
|
-
});
|
|
67
|
-
} else context.emitSync(file.contents, file.path, metadata);
|
|
68
|
-
} else context.fs.copySync(file.sourcePath, file.path);
|
|
69
|
-
}
|
|
51
|
+
const entries = Object.values(documents);
|
|
52
|
+
if (!entries.length) {
|
|
53
|
+
context.debug("No output files were rendered by the Alloy-js components.");
|
|
54
|
+
return;
|
|
55
|
+
}
|
|
56
|
+
context.debug(`Emitting ${entries.length} output files from Alloy-js components: ${list(entries.map((document) => {
|
|
57
|
+
const metadata = getDocumentMeta(document);
|
|
58
|
+
return `${replacePath(document.path, context.config.cwd)}${metadata.kind === "builtin" || metadata.kind === "infrastructure" ? ` (${metadata.kind === "builtin" ? "Builtin" : "Infrastructure"})` : ""}`;
|
|
59
|
+
}))}.`);
|
|
60
|
+
for (const document of entries) {
|
|
61
|
+
const metadata = getDocumentMeta(document);
|
|
62
|
+
const contents = getDocumentContents(document);
|
|
63
|
+
if (metadata.kind === "builtin") {
|
|
64
|
+
if (!metadata.id) throw new Error(`Built-in file "${document.path}" is missing its ID in the render metadata.`);
|
|
65
|
+
context.emitBuiltinSync(contents, metadata.id, {
|
|
66
|
+
skipFormat: metadata.skipFormat,
|
|
67
|
+
storage: metadata.storage,
|
|
68
|
+
extension: findFileExtension(document.path)
|
|
69
|
+
});
|
|
70
|
+
} else if (metadata.kind === "entry") context.emitEntrySync(contents, document.path, {
|
|
71
|
+
skipFormat: metadata.skipFormat,
|
|
72
|
+
storage: metadata.storage,
|
|
73
|
+
...metadata.typeDefinition ?? {}
|
|
70
74
|
});
|
|
75
|
+
else if (metadata.kind === "infrastructure") {
|
|
76
|
+
if (!metadata.id) throw new Error(`Infrastructure file "${document.path}" is missing its ID in the render metadata.`);
|
|
77
|
+
context.emitInfrastructureSync(contents, metadata.id, {
|
|
78
|
+
skipFormat: metadata.skipFormat,
|
|
79
|
+
storage: metadata.storage,
|
|
80
|
+
extension: findFileExtension(document.path)
|
|
81
|
+
});
|
|
82
|
+
} else context.emitSync(contents, document.path, metadata);
|
|
71
83
|
}
|
|
72
84
|
}
|
|
73
85
|
/**
|
|
@@ -86,9 +98,16 @@ async function render(context, children) {
|
|
|
86
98
|
* @returns The rendered output as a string.
|
|
87
99
|
*/
|
|
88
100
|
function renderString(context, children, options) {
|
|
89
|
-
return printTree(renderTree(createComponent(
|
|
90
|
-
context,
|
|
91
|
-
children
|
|
101
|
+
return printTree(renderTree(createComponent(PowerlinesContext.Provider, {
|
|
102
|
+
value: context,
|
|
103
|
+
get children() {
|
|
104
|
+
return createComponent(Output, {
|
|
105
|
+
get basePath() {
|
|
106
|
+
return context.config.cwd;
|
|
107
|
+
},
|
|
108
|
+
children
|
|
109
|
+
});
|
|
110
|
+
}
|
|
92
111
|
})), options);
|
|
93
112
|
}
|
|
94
113
|
|
package/dist/types/index.d.cts
CHANGED
|
@@ -1,3 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
export { AlloyPluginContext, AlloyPluginOptions, AlloyPluginResolvedConfig, AlloyPluginUserConfig, BuiltinSourceFileContext, ComponentProps, ComponentPropsWithChildren, CopyFileOutputContext, CopyOutputFile, OutputDirectory, OutputFile, ReflectionOverrideInterface, RenderBuiltinContext, RenderContext, RenderEntryContext, RenderOutputContext, SourceFileHeaderProps, TypescriptFileImportItem, TypescriptFileImports, WriteOutputFile };
|
|
1
|
+
import { AlloyPluginContext, AlloyPluginOptions, AlloyPluginResolvedConfig, AlloyPluginUserConfig, PowerPlantAlloyOptions } from "./plugin.cjs";
|
|
2
|
+
export { AlloyPluginContext, AlloyPluginOptions, AlloyPluginResolvedConfig, AlloyPluginUserConfig, PowerPlantAlloyOptions };
|
package/dist/types/index.d.mts
CHANGED
|
@@ -1,3 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
export { AlloyPluginContext, AlloyPluginOptions, AlloyPluginResolvedConfig, AlloyPluginUserConfig, BuiltinSourceFileContext, ComponentProps, ComponentPropsWithChildren, CopyFileOutputContext, CopyOutputFile, OutputDirectory, OutputFile, ReflectionOverrideInterface, RenderBuiltinContext, RenderContext, RenderEntryContext, RenderOutputContext, SourceFileHeaderProps, TypescriptFileImportItem, TypescriptFileImports, WriteOutputFile };
|
|
1
|
+
import { AlloyPluginContext, AlloyPluginOptions, AlloyPluginResolvedConfig, AlloyPluginUserConfig, PowerPlantAlloyOptions } from "./plugin.mjs";
|
|
2
|
+
export { AlloyPluginContext, AlloyPluginOptions, AlloyPluginResolvedConfig, AlloyPluginUserConfig, PowerPlantAlloyOptions };
|
package/dist/types/plugin.d.cts
CHANGED
|
@@ -1,15 +1,18 @@
|
|
|
1
1
|
import { PrintTreeOptions } from "@alloy-js/core";
|
|
2
2
|
import { PluginContext } from "powerlines";
|
|
3
|
+
import { Options } from "@power-plant/alloy-js";
|
|
3
4
|
import { BabelPluginResolvedConfig, BabelPluginUserConfig } from "@powerlines/plugin-babel/types/plugin";
|
|
5
|
+
import { PowerPlantPluginContext, PowerPlantPluginResolvedConfig } from "@powerlines/plugin-power-plant/types/plugin";
|
|
4
6
|
//#region src/types/plugin.d.ts
|
|
5
|
-
type
|
|
7
|
+
type PowerPlantAlloyOptions = Options;
|
|
8
|
+
type AlloyPluginOptions = Partial<Options> & Partial<PrintTreeOptions>;
|
|
6
9
|
type AlloyPluginUserConfig = BabelPluginUserConfig & {
|
|
7
10
|
alloy?: AlloyPluginOptions;
|
|
8
11
|
};
|
|
9
|
-
type AlloyPluginResolvedConfig = BabelPluginResolvedConfig & {
|
|
12
|
+
type AlloyPluginResolvedConfig = BabelPluginResolvedConfig & Partial<PowerPlantPluginResolvedConfig<Record<string, unknown>, PowerPlantAlloyOptions>> & {
|
|
10
13
|
alloy: AlloyPluginOptions;
|
|
11
14
|
};
|
|
12
|
-
type AlloyPluginContext<TResolvedConfig extends AlloyPluginResolvedConfig = AlloyPluginResolvedConfig> = PluginContext<TResolvedConfig
|
|
15
|
+
type AlloyPluginContext<TResolvedConfig extends AlloyPluginResolvedConfig = AlloyPluginResolvedConfig> = PluginContext<TResolvedConfig> & Partial<PowerPlantPluginContext<Record<string, unknown>, PowerPlantAlloyOptions, TResolvedConfig & PowerPlantPluginResolvedConfig<Record<string, unknown>, PowerPlantAlloyOptions>>>;
|
|
13
16
|
//#endregion
|
|
14
|
-
export { AlloyPluginContext, AlloyPluginOptions, AlloyPluginResolvedConfig, AlloyPluginUserConfig };
|
|
17
|
+
export { AlloyPluginContext, AlloyPluginOptions, AlloyPluginResolvedConfig, AlloyPluginUserConfig, PowerPlantAlloyOptions };
|
|
15
18
|
//# sourceMappingURL=plugin.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.d.cts","names":[],"sources":["../../src/types/plugin.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"plugin.d.cts","names":[],"sources":["../../src/types/plugin.ts"],"mappings":";;;;;;KA8BY,yBAAyB;KAEzB,qBAAqB,QAAQ,WACvC,QAAQ;KAEE,wBAAwB;EAClC,QAAQ;;KAGE,4BAA4B,4BACtC,QACE,+BAA+B,yBAAyB;EAExD,OAAO;;KAGC,mBACV,wBAAwB,4BAA4B,6BAClD,cAAc,mBAChB,QACE,wBACE,yBACA,wBACA,kBACE,+BACE,yBACA"}
|
package/dist/types/plugin.d.mts
CHANGED
|
@@ -1,15 +1,18 @@
|
|
|
1
1
|
import { PrintTreeOptions } from "@alloy-js/core";
|
|
2
2
|
import { PluginContext } from "powerlines";
|
|
3
|
+
import { Options } from "@power-plant/alloy-js";
|
|
3
4
|
import { BabelPluginResolvedConfig, BabelPluginUserConfig } from "@powerlines/plugin-babel/types/plugin";
|
|
5
|
+
import { PowerPlantPluginContext, PowerPlantPluginResolvedConfig } from "@powerlines/plugin-power-plant/types/plugin";
|
|
4
6
|
//#region src/types/plugin.d.ts
|
|
5
|
-
type
|
|
7
|
+
type PowerPlantAlloyOptions = Options;
|
|
8
|
+
type AlloyPluginOptions = Partial<Options> & Partial<PrintTreeOptions>;
|
|
6
9
|
type AlloyPluginUserConfig = BabelPluginUserConfig & {
|
|
7
10
|
alloy?: AlloyPluginOptions;
|
|
8
11
|
};
|
|
9
|
-
type AlloyPluginResolvedConfig = BabelPluginResolvedConfig & {
|
|
12
|
+
type AlloyPluginResolvedConfig = BabelPluginResolvedConfig & Partial<PowerPlantPluginResolvedConfig<Record<string, unknown>, PowerPlantAlloyOptions>> & {
|
|
10
13
|
alloy: AlloyPluginOptions;
|
|
11
14
|
};
|
|
12
|
-
type AlloyPluginContext<TResolvedConfig extends AlloyPluginResolvedConfig = AlloyPluginResolvedConfig> = PluginContext<TResolvedConfig
|
|
15
|
+
type AlloyPluginContext<TResolvedConfig extends AlloyPluginResolvedConfig = AlloyPluginResolvedConfig> = PluginContext<TResolvedConfig> & Partial<PowerPlantPluginContext<Record<string, unknown>, PowerPlantAlloyOptions, TResolvedConfig & PowerPlantPluginResolvedConfig<Record<string, unknown>, PowerPlantAlloyOptions>>>;
|
|
13
16
|
//#endregion
|
|
14
|
-
export { AlloyPluginContext, AlloyPluginOptions, AlloyPluginResolvedConfig, AlloyPluginUserConfig };
|
|
17
|
+
export { AlloyPluginContext, AlloyPluginOptions, AlloyPluginResolvedConfig, AlloyPluginUserConfig, PowerPlantAlloyOptions };
|
|
15
18
|
//# sourceMappingURL=plugin.d.mts.map
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
2
|
const require_core_contexts_context = require('../../core/contexts/context.cjs');
|
|
3
|
-
const require_typescript_components_tsdoc = require('./tsdoc.cjs');
|
|
4
|
-
const require_typescript_components_typescript_file = require('./typescript-file.cjs');
|
|
5
3
|
let _stryke_path_file_path_fns = require("@stryke/path/file-path-fns");
|
|
6
4
|
let _alloy_js_core_jsx_runtime = require("@alloy-js/core/jsx-runtime");
|
|
7
5
|
let _alloy_js_core = require("@alloy-js/core");
|
|
8
6
|
let _stryke_path_replace = require("@stryke/path/replace");
|
|
7
|
+
let _power_plant_alloy_js_typescript_components_typescript_file = require("@power-plant/alloy-js/typescript/components/typescript-file");
|
|
8
|
+
let _power_plant_alloy_js_typescript_components_tsdoc = require("@power-plant/alloy-js/typescript/components/tsdoc");
|
|
9
9
|
let _stryke_type_checks_is_set = require("@stryke/type-checks/is-set");
|
|
10
10
|
|
|
11
11
|
//#region src/typescript/components/builtin-file.tsx
|
|
@@ -27,17 +27,17 @@ function BuiltinFile(props) {
|
|
|
27
27
|
]);
|
|
28
28
|
const context = require_core_contexts_context.usePowerlinesSafe();
|
|
29
29
|
const path = (0, _alloy_js_core.computed)(() => (0, _stryke_path_replace.replacePath)(`${!(0, _stryke_type_checks_is_set.isSet)(tsx) ? id : (0, _stryke_path_replace.replaceExtension)(id)}${(0, _stryke_path_file_path_fns.hasFileExtension)(id) && !(0, _stryke_type_checks_is_set.isSet)(tsx) ? "" : tsx ? ".tsx" : ".ts"}`, context?.builtinsPath));
|
|
30
|
-
return (0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
30
|
+
return (0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_typescript_components_typescript_file.TypescriptFile, (0, _alloy_js_core_jsx_runtime.mergeProps)({
|
|
31
31
|
get header() {
|
|
32
|
-
return (0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
32
|
+
return (0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_typescript_components_typescript_file.TypescriptFileHeader, {
|
|
33
33
|
get header() {
|
|
34
|
-
return (0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
34
|
+
return (0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_typescript_components_tsdoc.TSDocModule, {
|
|
35
35
|
name: id,
|
|
36
36
|
children: description
|
|
37
37
|
});
|
|
38
38
|
},
|
|
39
39
|
get children() {
|
|
40
|
-
return (0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
40
|
+
return (0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_typescript_components_typescript_file.TypescriptFileHeaderImports, {
|
|
41
41
|
imports,
|
|
42
42
|
builtinImports
|
|
43
43
|
});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { TypescriptFileProps } from "@power-plant/alloy-js/typescript/components/typescript-file";
|
|
2
|
+
import { TSDocModuleProps } from "@power-plant/alloy-js/typescript/components/tsdoc";
|
|
3
3
|
//#region src/typescript/components/builtin-file.d.ts
|
|
4
4
|
type BuiltinFileProps = Omit<TypescriptFileProps, "path"> & Omit<TSDocModuleProps, "name"> & {
|
|
5
5
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"builtin-file.d.cts","names":[],"sources":["../../../src/typescript/components/builtin-file.tsx"],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"builtin-file.d.cts","names":[],"sources":["../../../src/typescript/components/builtin-file.tsx"],"mappings":";;;KAkCY,mBAAmB,KAAK,+BAClC,KAAK;;;;;;;EAOH;;;;EAKA;;;;;;EAOA;;;;;;EAOA;;;;;;;;iBASY,YAAY,OAAO,4CAAgB"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { TypescriptFileProps } from "@power-plant/alloy-js/typescript/components/typescript-file";
|
|
2
|
+
import { TSDocModuleProps } from "@power-plant/alloy-js/typescript/components/tsdoc";
|
|
3
3
|
//#region src/typescript/components/builtin-file.d.ts
|
|
4
4
|
type BuiltinFileProps = Omit<TypescriptFileProps, "path"> & Omit<TSDocModuleProps, "name"> & {
|
|
5
5
|
/**
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { usePowerlinesSafe } from "../../core/contexts/context.mjs";
|
|
2
|
-
import { TSDocModule } from "./tsdoc.mjs";
|
|
3
|
-
import { TypescriptFile, TypescriptFileHeader, TypescriptFileHeaderImports } from "./typescript-file.mjs";
|
|
4
2
|
import { hasFileExtension } from "@stryke/path/file-path-fns";
|
|
5
3
|
import { createComponent, mergeProps } from "@alloy-js/core/jsx-runtime";
|
|
6
4
|
import { computed, splitProps } from "@alloy-js/core";
|
|
7
5
|
import { replaceExtension, replacePath } from "@stryke/path/replace";
|
|
6
|
+
import { TypescriptFile, TypescriptFileHeader, TypescriptFileHeaderImports } from "@power-plant/alloy-js/typescript/components/typescript-file";
|
|
7
|
+
import { TSDocModule } from "@power-plant/alloy-js/typescript/components/tsdoc";
|
|
8
8
|
import { isSet } from "@stryke/type-checks/is-set";
|
|
9
9
|
|
|
10
10
|
//#region src/typescript/components/builtin-file.tsx
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
2
|
const require_runtime = require('../../_virtual/_rolldown/runtime.cjs');
|
|
3
3
|
const require_core_contexts_context = require('../../core/contexts/context.cjs');
|
|
4
|
-
const require_typescript_components_typescript_file = require('./typescript-file.cjs');
|
|
5
4
|
let _stryke_path_file_path_fns = require("@stryke/path/file-path-fns");
|
|
6
5
|
let _alloy_js_core_jsx_runtime = require("@alloy-js/core/jsx-runtime");
|
|
7
6
|
let _alloy_js_core = require("@alloy-js/core");
|
|
@@ -9,6 +8,7 @@ let _stryke_path_replace = require("@stryke/path/replace");
|
|
|
9
8
|
let _stryke_path_append = require("@stryke/path/append");
|
|
10
9
|
let defu = require("defu");
|
|
11
10
|
defu = require_runtime.__toESM(defu, 1);
|
|
11
|
+
let _power_plant_alloy_js_typescript_components_typescript_file = require("@power-plant/alloy-js/typescript/components/typescript-file");
|
|
12
12
|
let _stryke_type_checks_is_set = require("@stryke/type-checks/is-set");
|
|
13
13
|
|
|
14
14
|
//#region src/typescript/components/entry-file.tsx
|
|
@@ -28,7 +28,7 @@ function EntryFile(props) {
|
|
|
28
28
|
]);
|
|
29
29
|
const context = require_core_contexts_context.usePowerlinesSafe();
|
|
30
30
|
const fullPath = (0, _alloy_js_core.computed)(() => context ? (0, _stryke_path_append.appendPath)(`${!(0, _stryke_type_checks_is_set.isSet)(tsx) ? path : (0, _stryke_path_replace.replaceExtension)(path)}${tsx ? ".tsx" : (0, _stryke_path_file_path_fns.hasFileExtension)(path) ? "" : ".ts"}`, (0, _stryke_path_replace.replacePath)(context.entryPath, context.config.cwd)) : path);
|
|
31
|
-
return (0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
31
|
+
return (0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_typescript_components_typescript_file.TypescriptFile, (0, _alloy_js_core_jsx_runtime.mergeProps)(rest, {
|
|
32
32
|
get path() {
|
|
33
33
|
return fullPath.value;
|
|
34
34
|
},
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { TypescriptFileProps } from "./typescript-file.cjs";
|
|
2
1
|
import { ResolvedEntryFileReference } from "powerlines";
|
|
2
|
+
import { TypescriptFileProps } from "@power-plant/alloy-js/typescript/components/typescript-file";
|
|
3
3
|
//#region src/typescript/components/entry-file.d.ts
|
|
4
4
|
type EntryFileProps = TypescriptFileProps & {
|
|
5
5
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"entry-file.d.cts","names":[],"sources":["../../../src/typescript/components/entry-file.tsx"],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"entry-file.d.cts","names":[],"sources":["../../../src/typescript/components/entry-file.tsx"],"mappings":";;;KA+BY,iBAAiB;;;;;;EAM3B;;;;EAKA,iBAAiB;;;;;;;;iBASH,UAAU,OAAO,0CAAc"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { TypescriptFileProps } from "
|
|
1
|
+
import { TypescriptFileProps } from "@power-plant/alloy-js/typescript/components/typescript-file";
|
|
2
2
|
import { ResolvedEntryFileReference } from "powerlines";
|
|
3
3
|
//#region src/typescript/components/entry-file.d.ts
|
|
4
4
|
type EntryFileProps = TypescriptFileProps & {
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { usePowerlinesSafe } from "../../core/contexts/context.mjs";
|
|
2
|
-
import { TypescriptFile } from "./typescript-file.mjs";
|
|
3
2
|
import { hasFileExtension } from "@stryke/path/file-path-fns";
|
|
4
3
|
import { createComponent, mergeProps } from "@alloy-js/core/jsx-runtime";
|
|
5
4
|
import { computed, splitProps } from "@alloy-js/core";
|
|
6
5
|
import { replaceExtension, replacePath } from "@stryke/path/replace";
|
|
7
6
|
import { appendPath } from "@stryke/path/append";
|
|
8
7
|
import defu from "defu";
|
|
8
|
+
import { TypescriptFile } from "@power-plant/alloy-js/typescript/components/typescript-file";
|
|
9
9
|
import { isSet } from "@stryke/type-checks/is-set";
|
|
10
10
|
|
|
11
11
|
//#region src/typescript/components/entry-file.tsx
|
|
@@ -1,61 +1,6 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
-
const require_typescript_components_tsdoc = require('./tsdoc.cjs');
|
|
3
|
-
const require_typescript_components_typescript_file = require('./typescript-file.cjs');
|
|
4
2
|
const require_typescript_components_builtin_file = require('./builtin-file.cjs');
|
|
5
|
-
const require_typescript_components_property_name = require('./property-name.cjs');
|
|
6
|
-
const require_typescript_components_type_parameters = require('./type-parameters.cjs');
|
|
7
|
-
const require_typescript_components_class_declaration = require('./class-declaration.cjs');
|
|
8
|
-
const require_typescript_components_dynamic_import_statement = require('./dynamic-import-statement.cjs');
|
|
9
3
|
const require_typescript_components_entry_file = require('./entry-file.cjs');
|
|
10
|
-
const require_typescript_components_tsdoc_schema = require('./tsdoc-schema.cjs');
|
|
11
|
-
const require_typescript_components_interface_declaration = require('./interface-declaration.cjs');
|
|
12
|
-
const require_typescript_components_object_declaration = require('./object-declaration.cjs');
|
|
13
|
-
const require_typescript_components_record_expression = require('./record-expression.cjs');
|
|
14
|
-
const require_typescript_components_type_declaration = require('./type-declaration.cjs');
|
|
15
4
|
|
|
16
5
|
exports.BuiltinFile = require_typescript_components_builtin_file.BuiltinFile;
|
|
17
|
-
exports.
|
|
18
|
-
exports.ClassField = require_typescript_components_class_declaration.ClassField;
|
|
19
|
-
exports.ClassMember = require_typescript_components_class_declaration.ClassMember;
|
|
20
|
-
exports.ClassMethod = require_typescript_components_class_declaration.ClassMethod;
|
|
21
|
-
exports.ClassPropertyGet = require_typescript_components_class_declaration.ClassPropertyGet;
|
|
22
|
-
exports.ClassPropertySet = require_typescript_components_class_declaration.ClassPropertySet;
|
|
23
|
-
exports.DynamicImportStatement = require_typescript_components_dynamic_import_statement.DynamicImportStatement;
|
|
24
|
-
exports.EntryFile = require_typescript_components_entry_file.EntryFile;
|
|
25
|
-
exports.InterfaceDeclaration = require_typescript_components_interface_declaration.InterfaceDeclaration;
|
|
26
|
-
exports.InterfaceDeclarationProperty = require_typescript_components_interface_declaration.InterfaceDeclarationProperty;
|
|
27
|
-
exports.InterfaceExpression = require_typescript_components_interface_declaration.InterfaceExpression;
|
|
28
|
-
exports.InterfaceMember = require_typescript_components_interface_declaration.InterfaceMember;
|
|
29
|
-
exports.ObjectDeclaration = require_typescript_components_object_declaration.ObjectDeclaration;
|
|
30
|
-
exports.ObjectDeclarationProperty = require_typescript_components_object_declaration.ObjectDeclarationProperty;
|
|
31
|
-
exports.PropertyName = require_typescript_components_property_name.PropertyName;
|
|
32
|
-
exports.RecordExpression = require_typescript_components_record_expression.RecordExpression;
|
|
33
|
-
exports.TSDoc = require_typescript_components_tsdoc.TSDoc;
|
|
34
|
-
exports.TSDocAlias = require_typescript_components_tsdoc.TSDocAlias;
|
|
35
|
-
exports.TSDocAttributesTags = require_typescript_components_tsdoc.TSDocAttributesTags;
|
|
36
|
-
exports.TSDocDefaultValue = require_typescript_components_tsdoc.TSDocDefaultValue;
|
|
37
|
-
exports.TSDocDomain = require_typescript_components_tsdoc.TSDocDomain;
|
|
38
|
-
exports.TSDocExample = require_typescript_components_tsdoc.TSDocExample;
|
|
39
|
-
exports.TSDocGroup = require_typescript_components_tsdoc.TSDocGroup;
|
|
40
|
-
exports.TSDocHidden = require_typescript_components_tsdoc.TSDocHidden;
|
|
41
|
-
exports.TSDocIgnore = require_typescript_components_tsdoc.TSDocIgnore;
|
|
42
|
-
exports.TSDocInternal = require_typescript_components_tsdoc.TSDocInternal;
|
|
43
|
-
exports.TSDocLink = require_typescript_components_tsdoc.TSDocLink;
|
|
44
|
-
exports.TSDocModule = require_typescript_components_tsdoc.TSDocModule;
|
|
45
|
-
exports.TSDocObjectSchema = require_typescript_components_tsdoc_schema.TSDocObjectSchema;
|
|
46
|
-
exports.TSDocParam = require_typescript_components_tsdoc.TSDocParam;
|
|
47
|
-
exports.TSDocParams = require_typescript_components_tsdoc.TSDocParams;
|
|
48
|
-
exports.TSDocPermission = require_typescript_components_tsdoc.TSDocPermission;
|
|
49
|
-
exports.TSDocReadonly = require_typescript_components_tsdoc.TSDocReadonly;
|
|
50
|
-
exports.TSDocRemarks = require_typescript_components_tsdoc.TSDocRemarks;
|
|
51
|
-
exports.TSDocReturns = require_typescript_components_tsdoc.TSDocReturns;
|
|
52
|
-
exports.TSDocRuntime = require_typescript_components_tsdoc.TSDocRuntime;
|
|
53
|
-
exports.TSDocSchemaProperty = require_typescript_components_tsdoc_schema.TSDocSchemaProperty;
|
|
54
|
-
exports.TSDocTag = require_typescript_components_tsdoc.TSDocTag;
|
|
55
|
-
exports.TSDocThrows = require_typescript_components_tsdoc.TSDocThrows;
|
|
56
|
-
exports.TSDocTitle = require_typescript_components_tsdoc.TSDocTitle;
|
|
57
|
-
exports.TypeDeclaration = require_typescript_components_type_declaration.TypeDeclaration;
|
|
58
|
-
exports.TypeParameters = require_typescript_components_type_parameters.TypeParameters;
|
|
59
|
-
exports.TypescriptFile = require_typescript_components_typescript_file.TypescriptFile;
|
|
60
|
-
exports.TypescriptFileHeader = require_typescript_components_typescript_file.TypescriptFileHeader;
|
|
61
|
-
exports.TypescriptFileHeaderImports = require_typescript_components_typescript_file.TypescriptFileHeaderImports;
|
|
6
|
+
exports.EntryFile = require_typescript_components_entry_file.EntryFile;
|
|
@@ -1,14 +1,3 @@
|
|
|
1
|
-
import { TSDoc, TSDocAlias, TSDocAttributesTags, TSDocAttributesTagsProps, TSDocDefaultValue, TSDocDefaultValueProps, TSDocDomain, TSDocExample, TSDocExampleProps, TSDocGroup, TSDocHidden, TSDocIgnore, TSDocInternal, TSDocLink, TSDocModule, TSDocModuleProps, TSDocParam, TSDocParamProps, TSDocParams, TSDocParamsProps, TSDocPermission, TSDocProps, TSDocReadonly, TSDocRemarks, TSDocReturns, TSDocRuntime, TSDocTag, TSDocTagProps, TSDocThrows, TSDocTitle } from "./tsdoc.cjs";
|
|
2
|
-
import { TypescriptFile, TypescriptFileHeader, TypescriptFileHeaderImports, TypescriptFileHeaderImportsProps, TypescriptFileHeaderProps, TypescriptFileProps } from "./typescript-file.cjs";
|
|
3
1
|
import { BuiltinFile, BuiltinFileProps } from "./builtin-file.cjs";
|
|
4
|
-
import { TypeParameters, TypeParametersProps } from "./type-parameters.cjs";
|
|
5
|
-
import { ClassDeclaration, ClassDeclarationProps, ClassField, ClassFieldProps, ClassMember, ClassMemberProps, ClassMethod, ClassMethodProps, ClassPropertyGet, ClassPropertyProps, ClassPropertySet } from "./class-declaration.cjs";
|
|
6
|
-
import { DynamicImportStatement, DynamicImportStatementProps } from "./dynamic-import-statement.cjs";
|
|
7
2
|
import { EntryFile, EntryFileProps } from "./entry-file.cjs";
|
|
8
|
-
|
|
9
|
-
import { ObjectDeclaration, ObjectDeclarationProperty, ObjectDeclarationPropertyProps, ObjectDeclarationProps } from "./object-declaration.cjs";
|
|
10
|
-
import { PropertyName, PropertyNameProps } from "./property-name.cjs";
|
|
11
|
-
import { RecordExpression, RecordExpressionProps } from "./record-expression.cjs";
|
|
12
|
-
import { TSDocObjectSchema, TSDocObjectSchemaProps, TSDocSchemaProperty, TSDocSchemaPropertyProps } from "./tsdoc-schema.cjs";
|
|
13
|
-
import { TypeDeclaration, TypeDeclarationProps } from "./type-declaration.cjs";
|
|
14
|
-
export { BuiltinFile, BuiltinFileProps, ClassDeclaration, ClassDeclarationProps, ClassField, ClassFieldProps, ClassMember, ClassMemberProps, ClassMethod, ClassMethodProps, ClassPropertyGet, ClassPropertyProps, ClassPropertySet, DynamicImportStatement, DynamicImportStatementProps, EntryFile, EntryFileProps, InterfaceDeclaration, InterfaceDeclarationProperty, InterfaceDeclarationPropertyProps, InterfaceDeclarationProps, InterfaceExpression, InterfaceExpressionProps, InterfaceIndexerMemberProps, InterfaceMember, InterfaceMemberProps, InterfaceMemberPropsBase, InterfaceSchemaMemberProps, InterfaceTypeMemberProps, ObjectDeclaration, ObjectDeclarationProperty, ObjectDeclarationPropertyProps, ObjectDeclarationProps, PropertyName, PropertyNameProps, RecordExpression, RecordExpressionProps, TSDoc, TSDocAlias, TSDocAttributesTags, TSDocAttributesTagsProps, TSDocDefaultValue, TSDocDefaultValueProps, TSDocDomain, TSDocExample, TSDocExampleProps, TSDocGroup, TSDocHidden, TSDocIgnore, TSDocInternal, TSDocLink, TSDocModule, TSDocModuleProps, TSDocObjectSchema, TSDocObjectSchemaProps, TSDocParam, TSDocParamProps, TSDocParams, TSDocParamsProps, TSDocPermission, TSDocProps, TSDocReadonly, TSDocRemarks, TSDocReturns, TSDocRuntime, TSDocSchemaProperty, TSDocSchemaPropertyProps, TSDocTag, TSDocTagProps, TSDocThrows, TSDocTitle, TypeDeclaration, TypeDeclarationProps, TypeParameters, TypeParametersProps, TypescriptFile, TypescriptFileHeader, TypescriptFileHeaderImports, TypescriptFileHeaderImportsProps, TypescriptFileHeaderProps, TypescriptFileProps };
|
|
3
|
+
export { BuiltinFile, BuiltinFileProps, EntryFile, EntryFileProps };
|
|
@@ -1,14 +1,3 @@
|
|
|
1
|
-
import { TSDoc, TSDocAlias, TSDocAttributesTags, TSDocAttributesTagsProps, TSDocDefaultValue, TSDocDefaultValueProps, TSDocDomain, TSDocExample, TSDocExampleProps, TSDocGroup, TSDocHidden, TSDocIgnore, TSDocInternal, TSDocLink, TSDocModule, TSDocModuleProps, TSDocParam, TSDocParamProps, TSDocParams, TSDocParamsProps, TSDocPermission, TSDocProps, TSDocReadonly, TSDocRemarks, TSDocReturns, TSDocRuntime, TSDocTag, TSDocTagProps, TSDocThrows, TSDocTitle } from "./tsdoc.mjs";
|
|
2
|
-
import { TypescriptFile, TypescriptFileHeader, TypescriptFileHeaderImports, TypescriptFileHeaderImportsProps, TypescriptFileHeaderProps, TypescriptFileProps } from "./typescript-file.mjs";
|
|
3
1
|
import { BuiltinFile, BuiltinFileProps } from "./builtin-file.mjs";
|
|
4
|
-
import { TypeParameters, TypeParametersProps } from "./type-parameters.mjs";
|
|
5
|
-
import { ClassDeclaration, ClassDeclarationProps, ClassField, ClassFieldProps, ClassMember, ClassMemberProps, ClassMethod, ClassMethodProps, ClassPropertyGet, ClassPropertyProps, ClassPropertySet } from "./class-declaration.mjs";
|
|
6
|
-
import { DynamicImportStatement, DynamicImportStatementProps } from "./dynamic-import-statement.mjs";
|
|
7
2
|
import { EntryFile, EntryFileProps } from "./entry-file.mjs";
|
|
8
|
-
|
|
9
|
-
import { ObjectDeclaration, ObjectDeclarationProperty, ObjectDeclarationPropertyProps, ObjectDeclarationProps } from "./object-declaration.mjs";
|
|
10
|
-
import { PropertyName, PropertyNameProps } from "./property-name.mjs";
|
|
11
|
-
import { RecordExpression, RecordExpressionProps } from "./record-expression.mjs";
|
|
12
|
-
import { TSDocObjectSchema, TSDocObjectSchemaProps, TSDocSchemaProperty, TSDocSchemaPropertyProps } from "./tsdoc-schema.mjs";
|
|
13
|
-
import { TypeDeclaration, TypeDeclarationProps } from "./type-declaration.mjs";
|
|
14
|
-
export { BuiltinFile, BuiltinFileProps, ClassDeclaration, ClassDeclarationProps, ClassField, ClassFieldProps, ClassMember, ClassMemberProps, ClassMethod, ClassMethodProps, ClassPropertyGet, ClassPropertyProps, ClassPropertySet, DynamicImportStatement, DynamicImportStatementProps, EntryFile, EntryFileProps, InterfaceDeclaration, InterfaceDeclarationProperty, InterfaceDeclarationPropertyProps, InterfaceDeclarationProps, InterfaceExpression, InterfaceExpressionProps, InterfaceIndexerMemberProps, InterfaceMember, InterfaceMemberProps, InterfaceMemberPropsBase, InterfaceSchemaMemberProps, InterfaceTypeMemberProps, ObjectDeclaration, ObjectDeclarationProperty, ObjectDeclarationPropertyProps, ObjectDeclarationProps, PropertyName, PropertyNameProps, RecordExpression, RecordExpressionProps, TSDoc, TSDocAlias, TSDocAttributesTags, TSDocAttributesTagsProps, TSDocDefaultValue, TSDocDefaultValueProps, TSDocDomain, TSDocExample, TSDocExampleProps, TSDocGroup, TSDocHidden, TSDocIgnore, TSDocInternal, TSDocLink, TSDocModule, TSDocModuleProps, TSDocObjectSchema, TSDocObjectSchemaProps, TSDocParam, TSDocParamProps, TSDocParams, TSDocParamsProps, TSDocPermission, TSDocProps, TSDocReadonly, TSDocRemarks, TSDocReturns, TSDocRuntime, TSDocSchemaProperty, TSDocSchemaPropertyProps, TSDocTag, TSDocTagProps, TSDocThrows, TSDocTitle, TypeDeclaration, TypeDeclarationProps, TypeParameters, TypeParametersProps, TypescriptFile, TypescriptFileHeader, TypescriptFileHeaderImports, TypescriptFileHeaderImportsProps, TypescriptFileHeaderProps, TypescriptFileProps };
|
|
3
|
+
export { BuiltinFile, BuiltinFileProps, EntryFile, EntryFileProps };
|
|
@@ -1,15 +1,4 @@
|
|
|
1
|
-
import { TSDoc, TSDocAlias, TSDocAttributesTags, TSDocDefaultValue, TSDocDomain, TSDocExample, TSDocGroup, TSDocHidden, TSDocIgnore, TSDocInternal, TSDocLink, TSDocModule, TSDocParam, TSDocParams, TSDocPermission, TSDocReadonly, TSDocRemarks, TSDocReturns, TSDocRuntime, TSDocTag, TSDocThrows, TSDocTitle } from "./tsdoc.mjs";
|
|
2
|
-
import { TypescriptFile, TypescriptFileHeader, TypescriptFileHeaderImports } from "./typescript-file.mjs";
|
|
3
1
|
import { BuiltinFile } from "./builtin-file.mjs";
|
|
4
|
-
import { PropertyName } from "./property-name.mjs";
|
|
5
|
-
import { TypeParameters } from "./type-parameters.mjs";
|
|
6
|
-
import { ClassDeclaration, ClassField, ClassMember, ClassMethod, ClassPropertyGet, ClassPropertySet } from "./class-declaration.mjs";
|
|
7
|
-
import { DynamicImportStatement } from "./dynamic-import-statement.mjs";
|
|
8
2
|
import { EntryFile } from "./entry-file.mjs";
|
|
9
|
-
import { TSDocObjectSchema, TSDocSchemaProperty } from "./tsdoc-schema.mjs";
|
|
10
|
-
import { InterfaceDeclaration, InterfaceDeclarationProperty, InterfaceExpression, InterfaceMember } from "./interface-declaration.mjs";
|
|
11
|
-
import { ObjectDeclaration, ObjectDeclarationProperty } from "./object-declaration.mjs";
|
|
12
|
-
import { RecordExpression } from "./record-expression.mjs";
|
|
13
|
-
import { TypeDeclaration } from "./type-declaration.mjs";
|
|
14
3
|
|
|
15
|
-
export { BuiltinFile,
|
|
4
|
+
export { BuiltinFile, EntryFile };
|