@powerlines/plugin-alloy 0.25.22 → 0.25.24
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.d.cts +5 -0
- package/dist/core/components/index.d.mts +5 -0
- package/dist/core/components/output.d.cts +25 -0
- package/dist/core/components/output.d.cts.map +1 -0
- package/dist/core/components/output.d.mts +25 -0
- package/dist/core/components/output.d.mts.map +1 -0
- package/dist/core/components/output.mjs +2 -1
- package/dist/core/components/output.mjs.map +1 -0
- package/dist/core/components/single-line-comment.d.cts +23 -0
- package/dist/core/components/single-line-comment.d.cts.map +1 -0
- package/dist/core/components/single-line-comment.d.mts +23 -0
- package/dist/core/components/single-line-comment.d.mts.map +1 -0
- package/dist/core/components/single-line-comment.mjs +2 -1
- package/dist/core/components/single-line-comment.mjs.map +1 -0
- package/dist/core/components/source-file.d.cts +33 -0
- package/dist/core/components/source-file.d.cts.map +1 -0
- package/dist/core/components/source-file.d.mts +33 -0
- package/dist/core/components/source-file.d.mts.map +1 -0
- package/dist/core/components/source-file.mjs +2 -1
- package/dist/core/components/source-file.mjs.map +1 -0
- package/dist/core/components/spacing.d.cts +24 -0
- package/dist/core/components/spacing.d.cts.map +1 -0
- package/dist/core/components/spacing.d.mts +24 -0
- package/dist/core/components/spacing.d.mts.map +1 -0
- package/dist/core/components/spacing.mjs +2 -1
- package/dist/core/components/spacing.mjs.map +1 -0
- package/dist/core/contexts/context.d.cts +30 -0
- package/dist/core/contexts/context.d.cts.map +1 -0
- package/dist/core/contexts/context.d.mts +30 -0
- package/dist/core/contexts/context.d.mts.map +1 -0
- package/dist/core/contexts/context.mjs +2 -1
- package/dist/core/contexts/context.mjs.map +1 -0
- package/dist/core/contexts/index.d.cts +4 -0
- package/dist/core/contexts/index.d.mts +4 -0
- package/dist/core/contexts/meta.d.cts +48 -0
- package/dist/core/contexts/meta.d.cts.map +1 -0
- package/dist/core/contexts/meta.d.mts +48 -0
- package/dist/core/contexts/meta.d.mts.map +1 -0
- package/dist/core/contexts/meta.mjs +2 -1
- package/dist/core/contexts/meta.mjs.map +1 -0
- package/dist/core/contexts/reflection.d.cts +53 -0
- package/dist/core/contexts/reflection.d.cts.map +1 -0
- package/dist/core/contexts/reflection.d.mts +53 -0
- package/dist/core/contexts/reflection.d.mts.map +1 -0
- package/dist/core/contexts/reflection.mjs +2 -1
- package/dist/core/contexts/reflection.mjs.map +1 -0
- package/dist/core/helpers/code.d.cts +30 -0
- package/dist/core/helpers/code.d.cts.map +1 -0
- package/dist/core/helpers/code.d.mts +30 -0
- package/dist/core/helpers/code.d.mts.map +1 -0
- package/dist/core/helpers/code.mjs +2 -1
- package/dist/core/helpers/code.mjs.map +1 -0
- package/dist/core/helpers/index.d.cts +2 -0
- package/dist/core/helpers/index.d.mts +2 -0
- package/dist/core/index.d.cts +12 -0
- package/dist/core/index.d.mts +12 -0
- package/dist/helpers/capnp.d.cts +88 -0
- package/dist/helpers/capnp.d.cts.map +1 -0
- package/dist/helpers/capnp.d.mts +88 -0
- package/dist/helpers/capnp.d.mts.map +1 -0
- package/dist/helpers/capnp.mjs +2 -1
- package/dist/helpers/capnp.mjs.map +1 -0
- package/dist/helpers/create-builtin.d.cts +16 -0
- package/dist/helpers/create-builtin.d.cts.map +1 -0
- package/dist/helpers/create-builtin.d.mts +16 -0
- package/dist/helpers/create-builtin.d.mts.map +1 -0
- package/dist/helpers/create-builtin.mjs +2 -1
- package/dist/helpers/create-builtin.mjs.map +1 -0
- package/dist/helpers/index.d.cts +5 -0
- package/dist/helpers/index.d.mts +5 -0
- package/dist/helpers/refkey.d.cts +14 -0
- package/dist/helpers/refkey.d.cts.map +1 -0
- package/dist/helpers/refkey.d.mts +14 -0
- package/dist/helpers/refkey.d.mts.map +1 -0
- package/dist/helpers/refkey.mjs +2 -1
- package/dist/helpers/refkey.mjs.map +1 -0
- package/dist/helpers/typescript.d.cts +26 -0
- package/dist/helpers/typescript.d.cts.map +1 -0
- package/dist/helpers/typescript.d.mts +26 -0
- package/dist/helpers/typescript.d.mts.map +1 -0
- package/dist/helpers/typescript.mjs +2 -1
- package/dist/helpers/typescript.mjs.map +1 -0
- package/dist/index.d.cts +19 -0
- package/dist/index.d.cts.map +1 -0
- package/dist/index.d.mts +19 -0
- package/dist/index.d.mts.map +1 -0
- package/dist/index.mjs +2 -1
- package/dist/index.mjs.map +1 -0
- package/dist/markdown/components/front-matter.d.cts +16 -0
- package/dist/markdown/components/front-matter.d.cts.map +1 -0
- package/dist/markdown/components/front-matter.d.mts +16 -0
- package/dist/markdown/components/front-matter.d.mts.map +1 -0
- package/dist/markdown/components/front-matter.mjs +2 -1
- package/dist/markdown/components/front-matter.mjs.map +1 -0
- package/dist/markdown/components/index.d.cts +4 -0
- package/dist/markdown/components/index.d.mts +4 -0
- package/dist/markdown/components/markdown-file.d.cts +29 -0
- package/dist/markdown/components/markdown-file.d.cts.map +1 -0
- package/dist/markdown/components/markdown-file.d.mts +29 -0
- package/dist/markdown/components/markdown-file.d.mts.map +1 -0
- package/dist/markdown/components/markdown-file.mjs +2 -1
- package/dist/markdown/components/markdown-file.mjs.map +1 -0
- package/dist/markdown/components/markdown-table.d.cts +28 -0
- package/dist/markdown/components/markdown-table.d.cts.map +1 -0
- package/dist/markdown/components/markdown-table.d.mts +28 -0
- package/dist/markdown/components/markdown-table.d.mts.map +1 -0
- package/dist/markdown/components/markdown-table.mjs +2 -1
- package/dist/markdown/components/markdown-table.mjs.map +1 -0
- package/dist/markdown/contexts/index.d.cts +2 -0
- package/dist/markdown/contexts/index.d.mts +2 -0
- package/dist/markdown/contexts/markdown-table.d.cts +38 -0
- package/dist/markdown/contexts/markdown-table.d.cts.map +1 -0
- package/dist/markdown/contexts/markdown-table.d.mts +38 -0
- package/dist/markdown/contexts/markdown-table.d.mts.map +1 -0
- package/dist/markdown/contexts/markdown-table.mjs +2 -1
- package/dist/markdown/contexts/markdown-table.mjs.map +1 -0
- package/dist/markdown/index.d.cts +7 -0
- package/dist/markdown/index.d.mts +7 -0
- package/dist/render.d.cts +39 -0
- package/dist/render.d.cts.map +1 -0
- package/dist/render.d.mts +39 -0
- package/dist/render.d.mts.map +1 -0
- package/dist/render.mjs +2 -1
- package/dist/render.mjs.map +1 -0
- package/dist/types/components.d.cts +142 -0
- package/dist/types/components.d.cts.map +1 -0
- package/dist/types/components.d.mts +142 -0
- package/dist/types/components.d.mts.map +1 -0
- package/dist/types/index.d.cts +3 -0
- package/dist/types/index.d.mts +3 -0
- package/dist/types/plugin.d.cts +39 -0
- package/dist/types/plugin.d.cts.map +1 -0
- package/dist/types/plugin.d.mts +39 -0
- package/dist/types/plugin.d.mts.map +1 -0
- package/dist/typescript/components/builtin-file.d.cts +35 -0
- package/dist/typescript/components/builtin-file.d.cts.map +1 -0
- package/dist/typescript/components/builtin-file.d.mts +35 -0
- package/dist/typescript/components/builtin-file.d.mts.map +1 -0
- package/dist/typescript/components/builtin-file.mjs +2 -1
- package/dist/typescript/components/builtin-file.mjs.map +1 -0
- package/dist/typescript/components/class-declaration.d.cts +145 -0
- package/dist/typescript/components/class-declaration.d.cts.map +1 -0
- package/dist/typescript/components/class-declaration.d.mts +145 -0
- package/dist/typescript/components/class-declaration.d.mts.map +1 -0
- package/dist/typescript/components/class-declaration.mjs +2 -1
- package/dist/typescript/components/class-declaration.mjs.map +1 -0
- package/dist/typescript/components/dynamic-import-statement.d.cts +33 -0
- package/dist/typescript/components/dynamic-import-statement.d.cts.map +1 -0
- package/dist/typescript/components/dynamic-import-statement.d.mts +33 -0
- package/dist/typescript/components/dynamic-import-statement.d.mts.map +1 -0
- package/dist/typescript/components/dynamic-import-statement.mjs +2 -1
- package/dist/typescript/components/dynamic-import-statement.mjs.map +1 -0
- package/dist/typescript/components/entry-file.d.cts +28 -0
- package/dist/typescript/components/entry-file.d.cts.map +1 -0
- package/dist/typescript/components/entry-file.d.mts +28 -0
- package/dist/typescript/components/entry-file.d.mts.map +1 -0
- package/dist/typescript/components/entry-file.mjs +2 -1
- package/dist/typescript/components/entry-file.mjs.map +1 -0
- package/dist/typescript/components/index.d.cts +15 -0
- package/dist/typescript/components/index.d.mts +15 -0
- package/dist/typescript/components/infrastructure-file.d.cts +21 -0
- package/dist/typescript/components/infrastructure-file.d.cts.map +1 -0
- package/dist/typescript/components/infrastructure-file.d.mts +21 -0
- package/dist/typescript/components/infrastructure-file.d.mts.map +1 -0
- package/dist/typescript/components/infrastructure-file.mjs +2 -1
- package/dist/typescript/components/infrastructure-file.mjs.map +1 -0
- package/dist/typescript/components/interface-declaration.d.cts +86 -0
- package/dist/typescript/components/interface-declaration.d.cts.map +1 -0
- package/dist/typescript/components/interface-declaration.d.mts +86 -0
- package/dist/typescript/components/interface-declaration.d.mts.map +1 -0
- package/dist/typescript/components/interface-declaration.mjs +2 -1
- package/dist/typescript/components/interface-declaration.mjs.map +1 -0
- package/dist/typescript/components/object-declaration.d.cts +30 -0
- package/dist/typescript/components/object-declaration.d.cts.map +1 -0
- package/dist/typescript/components/object-declaration.d.mts +30 -0
- package/dist/typescript/components/object-declaration.d.mts.map +1 -0
- package/dist/typescript/components/object-declaration.mjs +2 -1
- package/dist/typescript/components/object-declaration.mjs.map +1 -0
- package/dist/typescript/components/property-name.d.cts +24 -0
- package/dist/typescript/components/property-name.d.cts.map +1 -0
- package/dist/typescript/components/property-name.d.mts +24 -0
- package/dist/typescript/components/property-name.d.mts.map +1 -0
- package/dist/typescript/components/property-name.mjs +2 -1
- package/dist/typescript/components/property-name.mjs.map +1 -0
- package/dist/typescript/components/record-expression.d.cts +13 -0
- package/dist/typescript/components/record-expression.d.cts.map +1 -0
- package/dist/typescript/components/record-expression.d.mts +13 -0
- package/dist/typescript/components/record-expression.d.mts.map +1 -0
- package/dist/typescript/components/record-expression.mjs +2 -1
- package/dist/typescript/components/record-expression.mjs.map +1 -0
- package/dist/typescript/components/tsdoc-reflection.d.cts +44 -0
- package/dist/typescript/components/tsdoc-reflection.d.cts.map +1 -0
- package/dist/typescript/components/tsdoc-reflection.d.mts +44 -0
- package/dist/typescript/components/tsdoc-reflection.d.mts.map +1 -0
- package/dist/typescript/components/tsdoc-reflection.mjs +2 -1
- package/dist/typescript/components/tsdoc-reflection.mjs.map +1 -0
- package/dist/typescript/components/tsdoc.d.cts +164 -0
- package/dist/typescript/components/tsdoc.d.cts.map +1 -0
- package/dist/typescript/components/tsdoc.d.mts +164 -0
- package/dist/typescript/components/tsdoc.d.mts.map +1 -0
- package/dist/typescript/components/tsdoc.mjs +2 -1
- package/dist/typescript/components/tsdoc.mjs.map +1 -0
- package/dist/typescript/components/type-declaration.d.cts +18 -0
- package/dist/typescript/components/type-declaration.d.cts.map +1 -0
- package/dist/typescript/components/type-declaration.d.mts +18 -0
- package/dist/typescript/components/type-declaration.d.mts.map +1 -0
- package/dist/typescript/components/type-declaration.mjs +2 -1
- package/dist/typescript/components/type-declaration.mjs.map +1 -0
- package/dist/typescript/components/type-parameters.d.cts +24 -0
- package/dist/typescript/components/type-parameters.d.cts.map +1 -0
- package/dist/typescript/components/type-parameters.d.mts +24 -0
- package/dist/typescript/components/type-parameters.d.mts.map +1 -0
- package/dist/typescript/components/type-parameters.mjs +2 -1
- package/dist/typescript/components/type-parameters.mjs.map +1 -0
- package/dist/typescript/components/typescript-file.d.cts +50 -0
- package/dist/typescript/components/typescript-file.d.cts.map +1 -0
- package/dist/typescript/components/typescript-file.d.mts +50 -0
- package/dist/typescript/components/typescript-file.d.mts.map +1 -0
- package/dist/typescript/components/typescript-file.mjs +2 -1
- package/dist/typescript/components/typescript-file.mjs.map +1 -0
- package/dist/typescript/contexts/index.d.cts +2 -0
- package/dist/typescript/contexts/index.d.mts +2 -0
- package/dist/typescript/contexts/lexical-scope.d.cts +17 -0
- package/dist/typescript/contexts/lexical-scope.d.cts.map +1 -0
- package/dist/typescript/contexts/lexical-scope.d.mts +17 -0
- package/dist/typescript/contexts/lexical-scope.d.mts.map +1 -0
- package/dist/typescript/contexts/lexical-scope.mjs +2 -1
- package/dist/typescript/contexts/lexical-scope.mjs.map +1 -0
- package/dist/typescript/contexts/member-scope.d.cts +20 -0
- package/dist/typescript/contexts/member-scope.d.cts.map +1 -0
- package/dist/typescript/contexts/member-scope.d.mts +20 -0
- package/dist/typescript/contexts/member-scope.d.mts.map +1 -0
- package/dist/typescript/contexts/member-scope.mjs +2 -1
- package/dist/typescript/contexts/member-scope.mjs.map +1 -0
- package/dist/typescript/helpers/get-call-signature-props.d.cts +15 -0
- package/dist/typescript/helpers/get-call-signature-props.d.cts.map +1 -0
- package/dist/typescript/helpers/get-call-signature-props.d.mts +15 -0
- package/dist/typescript/helpers/get-call-signature-props.d.mts.map +1 -0
- package/dist/typescript/helpers/get-call-signature-props.mjs +2 -1
- package/dist/typescript/helpers/get-call-signature-props.mjs.map +1 -0
- package/dist/typescript/helpers/index.d.cts +3 -0
- package/dist/typescript/helpers/index.d.mts +3 -0
- package/dist/typescript/helpers/utilities.d.cts +11 -0
- package/dist/typescript/helpers/utilities.d.cts.map +1 -0
- package/dist/typescript/helpers/utilities.d.mts +11 -0
- package/dist/typescript/helpers/utilities.d.mts.map +1 -0
- package/dist/typescript/helpers/utilities.mjs +2 -1
- package/dist/typescript/helpers/utilities.mjs.map +1 -0
- package/dist/typescript/index.d.cts +21 -0
- package/dist/typescript/index.d.mts +21 -0
- package/dist/yaml/components/index.d.cts +2 -0
- package/dist/yaml/components/index.d.mts +2 -0
- package/dist/yaml/components/yaml-file.d.cts +34 -0
- package/dist/yaml/components/yaml-file.d.cts.map +1 -0
- package/dist/yaml/components/yaml-file.d.mts +34 -0
- package/dist/yaml/components/yaml-file.d.mts.map +1 -0
- package/dist/yaml/components/yaml-file.mjs +2 -1
- package/dist/yaml/components/yaml-file.mjs.map +1 -0
- package/dist/yaml/index.d.cts +3 -0
- package/dist/yaml/index.d.mts +3 -0
- package/package.json +6 -6
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { Children, PrintTreeOptions } from "@alloy-js/core";
|
|
2
|
+
import { PluginContext } from "powerlines";
|
|
3
|
+
|
|
4
|
+
//#region src/render.d.ts
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* A function to render children components within the [Alloy](https://alloy-framework.github.io) context, and write any saved content to the file system.
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* ```tsx
|
|
11
|
+
* import { render } from "@powerlines/plugin-alloy/render";
|
|
12
|
+
*
|
|
13
|
+
* await render(context, <> ... </>);
|
|
14
|
+
* ```
|
|
15
|
+
*
|
|
16
|
+
* @param context - The Powerlines plugin context.
|
|
17
|
+
* @param children - The children components to render.
|
|
18
|
+
* @returns A promise that resolves when rendering is complete.
|
|
19
|
+
*/
|
|
20
|
+
declare function render<TContext extends PluginContext>(context: TContext, children: Children): Promise<void>;
|
|
21
|
+
/**
|
|
22
|
+
* A function to render children components within the [Alloy](https://alloy-framework.github.io) context and return the rendered output as a string.
|
|
23
|
+
*
|
|
24
|
+
* @example
|
|
25
|
+
* ```tsx
|
|
26
|
+
* import { renderString } from "@powerlines/plugin-alloy/render";
|
|
27
|
+
*
|
|
28
|
+
* const output = await renderString(context, <> ... </>);
|
|
29
|
+
* ```
|
|
30
|
+
*
|
|
31
|
+
* @param context - The Powerlines plugin context.
|
|
32
|
+
* @param children - The children components to render.
|
|
33
|
+
* @param options - Optional print tree options.
|
|
34
|
+
* @returns The rendered output as a string.
|
|
35
|
+
*/
|
|
36
|
+
declare function renderString<TContext extends PluginContext>(context: TContext, children: Children, options?: PrintTreeOptions): string;
|
|
37
|
+
//#endregion
|
|
38
|
+
export { render, renderString };
|
|
39
|
+
//# sourceMappingURL=render.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"render.d.mts","names":[],"sources":["../src/render.tsx"],"sourcesContent":[],"mappings":";;;;;;;AA4CA;;;;;;AA6FA;;;;;;iBA7FsB,wBAAwB,wBACnC,oBACC,WAAQ;;;;;;;;;;;;;;;;iBA2FJ,8BAA8B,wBACnC,oBACC,oBACA"}
|
package/dist/render.mjs
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"render.mjs","names":["printTree","renderAsync","renderTree","traverseOutput","findFileExtension","Output","render","context","children","meta","output","_$createComponent","Object","keys","length","debug","visitDirectory","directory","fs","existsSync","path","mkdirSync","visitFile","file","metadata","kind","id","Error","emitBuiltinSync","contents","skipFormat","storage","extension","emitEntrySync","typeDefinition","emitInfrastructureSync","emitSync","copySync","sourcePath","renderString","options","tree"],"sources":["../src/render.tsx"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport {\n Children,\n printTree,\n PrintTreeOptions,\n renderAsync,\n renderTree,\n traverseOutput\n} from \"@alloy-js/core\";\nimport { findFileExtension } from \"@stryke/path/file-path-fns\";\nimport { PluginContext } from \"powerlines\";\nimport { MetaItem, Output } from \"./core\";\n\n/**\n * A function to render children components within the [Alloy](https://alloy-framework.github.io) context, and write any saved content to the file system.\n *\n * @example\n * ```tsx\n * import { render } from \"@powerlines/plugin-alloy/render\";\n *\n * await render(context, <> ... </>);\n * ```\n *\n * @param context - The Powerlines plugin context.\n * @param children - The children components to render.\n * @returns A promise that resolves when rendering is complete.\n */\nexport async function render<TContext extends PluginContext>(\n context: TContext,\n children: Children\n) {\n const meta = {} as Record<string, MetaItem>;\n const output = await renderAsync(\n <Output<TContext> context={context} meta={meta}>\n {children}\n </Output>\n );\n\n if (!Object.keys(output).length) {\n context.debug(\n \"No output files were rendered by Alloy-js component templates.\"\n );\n } else {\n context.debug(\n `Processing ${\n Object.keys(output).length\n } rendered output files from Alloy-js component templates.`\n );\n\n await traverseOutput(output, {\n visitDirectory: directory => {\n if (context.fs.existsSync(directory.path)) {\n return;\n }\n\n context.fs.mkdirSync(directory.path);\n },\n visitFile: file => {\n if (\"contents\" in file) {\n const metadata = meta[file.path] ?? {};\n if (metadata.kind === \"builtin\") {\n if (!metadata.id) {\n throw new Error(\n `Built-in file \"${\n file.path\n }\" is missing its ID in the render metadata.`\n );\n }\n\n context.emitBuiltinSync(file.contents, metadata.id, {\n skipFormat: metadata.skipFormat,\n storage: metadata.storage,\n extension: findFileExtension(file.path)\n });\n } else if (metadata.kind === \"entry\") {\n context.emitEntrySync(file.contents, file.path, {\n skipFormat: metadata.skipFormat,\n storage: metadata.storage,\n ...(metadata.typeDefinition ?? {})\n });\n } else if (metadata.kind === \"infrastructure\") {\n if (!metadata.id) {\n throw new Error(\n `Infrastructure file \"${\n file.path\n }\" is missing its ID in the render metadata.`\n );\n }\n\n context.emitInfrastructureSync(file.contents, metadata.id, {\n skipFormat: metadata.skipFormat,\n storage: metadata.storage,\n extension: findFileExtension(file.path)\n });\n } else {\n context.emitSync(file.contents, file.path, metadata);\n }\n } else {\n context.fs.copySync(file.sourcePath, file.path);\n }\n }\n });\n }\n}\n\n/**\n * A function to render children components within the [Alloy](https://alloy-framework.github.io) context and return the rendered output as a string.\n *\n * @example\n * ```tsx\n * import { renderString } from \"@powerlines/plugin-alloy/render\";\n *\n * const output = await renderString(context, <> ... </>);\n * ```\n *\n * @param context - The Powerlines plugin context.\n * @param children - The children components to render.\n * @param options - Optional print tree options.\n * @returns The rendered output as a string.\n */\nexport function renderString<TContext extends PluginContext>(\n context: TContext,\n children: Children,\n options?: PrintTreeOptions\n) {\n const tree = renderTree(\n <Output<TContext> context={context}>{children}</Output>\n );\n\n return printTree(tree, options);\n}\n"],"mappings":""}
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
import { Children, Context } from "@alloy-js/core";
|
|
2
|
+
import { ResolvedEntryTypeDefinition, StoragePreset } from "powerlines";
|
|
3
|
+
import { SourceFileContext } from "@alloy-js/typescript";
|
|
4
|
+
|
|
5
|
+
//#region src/types/components.d.ts
|
|
6
|
+
interface CopyOutputFile {
|
|
7
|
+
kind: "file";
|
|
8
|
+
path: string;
|
|
9
|
+
sourcePath: string;
|
|
10
|
+
/**
|
|
11
|
+
* The format of the output files
|
|
12
|
+
*
|
|
13
|
+
* @remarks
|
|
14
|
+
* If not specified, the output mode will be determined by the provided \`output.mode\` value.
|
|
15
|
+
*/
|
|
16
|
+
preset?: StoragePreset;
|
|
17
|
+
}
|
|
18
|
+
interface WriteOutputFile {
|
|
19
|
+
kind: "file" | "entry" | "builtin";
|
|
20
|
+
path: string;
|
|
21
|
+
contents: string;
|
|
22
|
+
filetype: string;
|
|
23
|
+
/**
|
|
24
|
+
* The format of the output files
|
|
25
|
+
*
|
|
26
|
+
* @remarks
|
|
27
|
+
* If not specified, the output mode will be determined by the provided \`output.mode\` value.
|
|
28
|
+
*/
|
|
29
|
+
preset?: StoragePreset;
|
|
30
|
+
}
|
|
31
|
+
type OutputFile = (WriteOutputFile & {
|
|
32
|
+
kind: "file";
|
|
33
|
+
}) | (WriteOutputFile & {
|
|
34
|
+
kind: "entry";
|
|
35
|
+
typeDefinition?: ResolvedEntryTypeDefinition;
|
|
36
|
+
}) | (WriteOutputFile & {
|
|
37
|
+
kind: "builtin";
|
|
38
|
+
id: string;
|
|
39
|
+
}) | CopyOutputFile;
|
|
40
|
+
interface OutputDirectory {
|
|
41
|
+
kind: "directory";
|
|
42
|
+
path: string;
|
|
43
|
+
contents: (OutputDirectory | OutputFile)[];
|
|
44
|
+
}
|
|
45
|
+
interface RenderEntryContext {
|
|
46
|
+
typeDefinition: ResolvedEntryTypeDefinition;
|
|
47
|
+
}
|
|
48
|
+
interface RenderBuiltinContext {
|
|
49
|
+
id: string;
|
|
50
|
+
}
|
|
51
|
+
interface RenderOutputContext {
|
|
52
|
+
mode?: StoragePreset;
|
|
53
|
+
}
|
|
54
|
+
interface CopyFileOutputContext {
|
|
55
|
+
path?: string;
|
|
56
|
+
sourcePath?: string;
|
|
57
|
+
}
|
|
58
|
+
interface RenderContext extends Context {
|
|
59
|
+
meta?: {
|
|
60
|
+
copyFile?: CopyFileOutputContext;
|
|
61
|
+
/**
|
|
62
|
+
* The current context for the built-in module.
|
|
63
|
+
*/
|
|
64
|
+
builtin?: RenderBuiltinContext;
|
|
65
|
+
/**
|
|
66
|
+
* The current context for the application entrypoint file being rendered.
|
|
67
|
+
*/
|
|
68
|
+
entry?: RenderEntryContext;
|
|
69
|
+
/**
|
|
70
|
+
* The current context for output rendering.
|
|
71
|
+
*/
|
|
72
|
+
output?: RenderOutputContext;
|
|
73
|
+
} & Record<string, any>;
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* A type that represents the props of a component that can have children.
|
|
77
|
+
*/
|
|
78
|
+
interface ComponentProps {
|
|
79
|
+
children?: Children;
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* A type that requires the `children` prop in a component.
|
|
83
|
+
*/
|
|
84
|
+
type ComponentPropsWithChildren = Omit<ComponentProps, "children"> & Required<Pick<ComponentProps, "children">>;
|
|
85
|
+
interface BuiltinSourceFileContext extends SourceFileContext {
|
|
86
|
+
/**
|
|
87
|
+
* The runtime module identifier.
|
|
88
|
+
*/
|
|
89
|
+
id: string;
|
|
90
|
+
}
|
|
91
|
+
interface ReflectionOverrideInterface<T> {
|
|
92
|
+
name?: string | Children;
|
|
93
|
+
type?: string | Children;
|
|
94
|
+
extends?: string | false;
|
|
95
|
+
defaultValue?: Partial<T>;
|
|
96
|
+
}
|
|
97
|
+
interface TypescriptFileImportItem {
|
|
98
|
+
name: string;
|
|
99
|
+
default?: boolean;
|
|
100
|
+
alias?: string;
|
|
101
|
+
type?: boolean;
|
|
102
|
+
}
|
|
103
|
+
type TypescriptFileImports = Record<string, null | string | Array<TypescriptFileImportItem | string>>;
|
|
104
|
+
interface SourceFileHeaderProps extends ComponentProps {
|
|
105
|
+
/**
|
|
106
|
+
* If true, disables the ESLint directive at the top of the file.
|
|
107
|
+
*
|
|
108
|
+
* @defaultValue true
|
|
109
|
+
*/
|
|
110
|
+
disableEslint?: boolean;
|
|
111
|
+
/**
|
|
112
|
+
* If true, disables the Biome directive at the top of the file.
|
|
113
|
+
*
|
|
114
|
+
* @defaultValue true
|
|
115
|
+
*/
|
|
116
|
+
disableBiome?: boolean;
|
|
117
|
+
/**
|
|
118
|
+
* If true, disables the Prettier directive at the top of the file.
|
|
119
|
+
*
|
|
120
|
+
* @defaultValue false
|
|
121
|
+
*/
|
|
122
|
+
disablePrettier?: boolean;
|
|
123
|
+
}
|
|
124
|
+
declare type __ΩCopyOutputFile = any[];
|
|
125
|
+
declare type __ΩWriteOutputFile = any[];
|
|
126
|
+
declare type __ΩOutputFile = any[];
|
|
127
|
+
declare type __ΩOutputDirectory = any[];
|
|
128
|
+
declare type __ΩRenderEntryContext = any[];
|
|
129
|
+
declare type __ΩRenderBuiltinContext = any[];
|
|
130
|
+
declare type __ΩRenderOutputContext = any[];
|
|
131
|
+
declare type __ΩCopyFileOutputContext = any[];
|
|
132
|
+
declare type __ΩRenderContext = any[];
|
|
133
|
+
declare type __ΩComponentProps = any[];
|
|
134
|
+
declare type __ΩComponentPropsWithChildren = any[];
|
|
135
|
+
declare type __ΩBuiltinSourceFileContext = any[];
|
|
136
|
+
declare type __ΩReflectionOverrideInterface = any[];
|
|
137
|
+
declare type __ΩTypescriptFileImportItem = any[];
|
|
138
|
+
declare type __ΩTypescriptFileImports = any[];
|
|
139
|
+
declare type __ΩSourceFileHeaderProps = any[];
|
|
140
|
+
//#endregion
|
|
141
|
+
export { BuiltinSourceFileContext, ComponentProps, ComponentPropsWithChildren, CopyFileOutputContext, CopyOutputFile, OutputDirectory, OutputFile, ReflectionOverrideInterface, RenderBuiltinContext, RenderContext, RenderEntryContext, RenderOutputContext, SourceFileHeaderProps, TypescriptFileImportItem, TypescriptFileImports, WriteOutputFile, __ΩBuiltinSourceFileContext, __ΩComponentProps, __ΩComponentPropsWithChildren, __ΩCopyFileOutputContext, __ΩCopyOutputFile, __ΩOutputDirectory, __ΩOutputFile, __ΩReflectionOverrideInterface, __ΩRenderBuiltinContext, __ΩRenderContext, __ΩRenderEntryContext, __ΩRenderOutputContext, __ΩSourceFileHeaderProps, __ΩTypescriptFileImportItem, __ΩTypescriptFileImports, __ΩWriteOutputFile };
|
|
142
|
+
//# sourceMappingURL=components.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"components.d.cts","names":[],"sources":["../../src/types/components.ts"],"sourcesContent":[],"mappings":";;;;;UAsBiB,cAAA;;EAAA,IAAA,EAAA,MAAA;EAcA,UAAA,EAAA,MAAe;EAepB;;;;;;EAOM,MAAA,CAAA,EAzBP,aAyBO;AAElB;AAMiB,UA9BA,eAAA,CA8BkB;EAIlB,IAAA,EAAA,MAAA,GAAA,OAAA,GAAoB,SAAA;EAIpB,IAAA,EAAA,MAAA;EAIA,QAAA,EAAA,MAAA;EAKA,QAAA,EAAA,MAAc;EAEhB;;;;;;EAF+B,MAAA,CAAA,EAnCnC,aAmCmC;AAwB9C;AAOY,KA/DA,UAAA,GA+DA,CA9DP,eA8DiC,GAAA;EAAQ,IAAA,EAAA,MAAA;CAAL,CAAA,GAAA,CA7DpC,eA6DoC,GAAA;EACzB,IAAA,EAAA,OAAA;EAAL,cAAA,CAAA,EA5DY,2BA4DZ;CAAT,CAAA,GAAA,CA1DG,eA0DH,GAAA;EAAQ,IAAA,EAAA,SAAA;EAEO,EAAA,EAAA,MAAA;AAOjB,CAAA,CAAA,GAlEI,cAkEa;AACC,UAjED,eAAA,CAiEC;EACA,IAAA,EAAA,WAAA;EAEO,IAAA,EAAA,MAAA;EAAR,QAAA,EAAA,CAjEJ,eAiEI,GAjEc,UAiEd,CAAA,EAAA;;AAGA,UAjEA,kBAAA,CAiEwB;EAO7B,cAAA,EAvEM,2BAuEe;;AAEf,UAtED,oBAAA,CAsEC;EAFkB,EAAA,EAAA,MAAA;;AAKnB,UArEA,mBAAA,CAqEsB;SApE9B;;UAGQ,qBAAA;;;;UAKA,aAAA,SAAsB;;eAExB;;;;cAKD;;;;YAKF;;;;aAKC;MACP;;;;;UAMW,cAAA;aACJ;;;;;KAMD,0BAAA,GAA6B,KAAK,8BAC5C,SAAS,KAAK;UAEC,wBAAA,SAAiC;;;;;;UAOjC;kBACC;kBACA;;iBAED,QAAQ;;UAGR,wBAAA;;;;;;KAOL,qBAAA,GAAwB,+BAElB,MAAM;UAGP,qBAAA,SAA8B"}
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
import { Children, Context } from "@alloy-js/core";
|
|
2
|
+
import { SourceFileContext as SourceFileContext$1 } from "@alloy-js/typescript";
|
|
3
|
+
import { ResolvedEntryTypeDefinition, StoragePreset } from "powerlines";
|
|
4
|
+
|
|
5
|
+
//#region src/types/components.d.ts
|
|
6
|
+
interface CopyOutputFile {
|
|
7
|
+
kind: "file";
|
|
8
|
+
path: string;
|
|
9
|
+
sourcePath: string;
|
|
10
|
+
/**
|
|
11
|
+
* The format of the output files
|
|
12
|
+
*
|
|
13
|
+
* @remarks
|
|
14
|
+
* If not specified, the output mode will be determined by the provided \`output.mode\` value.
|
|
15
|
+
*/
|
|
16
|
+
preset?: StoragePreset;
|
|
17
|
+
}
|
|
18
|
+
interface WriteOutputFile {
|
|
19
|
+
kind: "file" | "entry" | "builtin";
|
|
20
|
+
path: string;
|
|
21
|
+
contents: string;
|
|
22
|
+
filetype: string;
|
|
23
|
+
/**
|
|
24
|
+
* The format of the output files
|
|
25
|
+
*
|
|
26
|
+
* @remarks
|
|
27
|
+
* If not specified, the output mode will be determined by the provided \`output.mode\` value.
|
|
28
|
+
*/
|
|
29
|
+
preset?: StoragePreset;
|
|
30
|
+
}
|
|
31
|
+
type OutputFile = (WriteOutputFile & {
|
|
32
|
+
kind: "file";
|
|
33
|
+
}) | (WriteOutputFile & {
|
|
34
|
+
kind: "entry";
|
|
35
|
+
typeDefinition?: ResolvedEntryTypeDefinition;
|
|
36
|
+
}) | (WriteOutputFile & {
|
|
37
|
+
kind: "builtin";
|
|
38
|
+
id: string;
|
|
39
|
+
}) | CopyOutputFile;
|
|
40
|
+
interface OutputDirectory {
|
|
41
|
+
kind: "directory";
|
|
42
|
+
path: string;
|
|
43
|
+
contents: (OutputDirectory | OutputFile)[];
|
|
44
|
+
}
|
|
45
|
+
interface RenderEntryContext {
|
|
46
|
+
typeDefinition: ResolvedEntryTypeDefinition;
|
|
47
|
+
}
|
|
48
|
+
interface RenderBuiltinContext {
|
|
49
|
+
id: string;
|
|
50
|
+
}
|
|
51
|
+
interface RenderOutputContext {
|
|
52
|
+
mode?: StoragePreset;
|
|
53
|
+
}
|
|
54
|
+
interface CopyFileOutputContext {
|
|
55
|
+
path?: string;
|
|
56
|
+
sourcePath?: string;
|
|
57
|
+
}
|
|
58
|
+
interface RenderContext extends Context {
|
|
59
|
+
meta?: {
|
|
60
|
+
copyFile?: CopyFileOutputContext;
|
|
61
|
+
/**
|
|
62
|
+
* The current context for the built-in module.
|
|
63
|
+
*/
|
|
64
|
+
builtin?: RenderBuiltinContext;
|
|
65
|
+
/**
|
|
66
|
+
* The current context for the application entrypoint file being rendered.
|
|
67
|
+
*/
|
|
68
|
+
entry?: RenderEntryContext;
|
|
69
|
+
/**
|
|
70
|
+
* The current context for output rendering.
|
|
71
|
+
*/
|
|
72
|
+
output?: RenderOutputContext;
|
|
73
|
+
} & Record<string, any>;
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* A type that represents the props of a component that can have children.
|
|
77
|
+
*/
|
|
78
|
+
interface ComponentProps {
|
|
79
|
+
children?: Children;
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* A type that requires the `children` prop in a component.
|
|
83
|
+
*/
|
|
84
|
+
type ComponentPropsWithChildren = Omit<ComponentProps, "children"> & Required<Pick<ComponentProps, "children">>;
|
|
85
|
+
interface BuiltinSourceFileContext extends SourceFileContext$1 {
|
|
86
|
+
/**
|
|
87
|
+
* The runtime module identifier.
|
|
88
|
+
*/
|
|
89
|
+
id: string;
|
|
90
|
+
}
|
|
91
|
+
interface ReflectionOverrideInterface<T> {
|
|
92
|
+
name?: string | Children;
|
|
93
|
+
type?: string | Children;
|
|
94
|
+
extends?: string | false;
|
|
95
|
+
defaultValue?: Partial<T>;
|
|
96
|
+
}
|
|
97
|
+
interface TypescriptFileImportItem {
|
|
98
|
+
name: string;
|
|
99
|
+
default?: boolean;
|
|
100
|
+
alias?: string;
|
|
101
|
+
type?: boolean;
|
|
102
|
+
}
|
|
103
|
+
type TypescriptFileImports = Record<string, null | string | Array<TypescriptFileImportItem | string>>;
|
|
104
|
+
interface SourceFileHeaderProps extends ComponentProps {
|
|
105
|
+
/**
|
|
106
|
+
* If true, disables the ESLint directive at the top of the file.
|
|
107
|
+
*
|
|
108
|
+
* @defaultValue true
|
|
109
|
+
*/
|
|
110
|
+
disableEslint?: boolean;
|
|
111
|
+
/**
|
|
112
|
+
* If true, disables the Biome directive at the top of the file.
|
|
113
|
+
*
|
|
114
|
+
* @defaultValue true
|
|
115
|
+
*/
|
|
116
|
+
disableBiome?: boolean;
|
|
117
|
+
/**
|
|
118
|
+
* If true, disables the Prettier directive at the top of the file.
|
|
119
|
+
*
|
|
120
|
+
* @defaultValue false
|
|
121
|
+
*/
|
|
122
|
+
disablePrettier?: boolean;
|
|
123
|
+
}
|
|
124
|
+
declare type __ΩCopyOutputFile = any[];
|
|
125
|
+
declare type __ΩWriteOutputFile = any[];
|
|
126
|
+
declare type __ΩOutputFile = any[];
|
|
127
|
+
declare type __ΩOutputDirectory = any[];
|
|
128
|
+
declare type __ΩRenderEntryContext = any[];
|
|
129
|
+
declare type __ΩRenderBuiltinContext = any[];
|
|
130
|
+
declare type __ΩRenderOutputContext = any[];
|
|
131
|
+
declare type __ΩCopyFileOutputContext = any[];
|
|
132
|
+
declare type __ΩRenderContext = any[];
|
|
133
|
+
declare type __ΩComponentProps = any[];
|
|
134
|
+
declare type __ΩComponentPropsWithChildren = any[];
|
|
135
|
+
declare type __ΩBuiltinSourceFileContext = any[];
|
|
136
|
+
declare type __ΩReflectionOverrideInterface = any[];
|
|
137
|
+
declare type __ΩTypescriptFileImportItem = any[];
|
|
138
|
+
declare type __ΩTypescriptFileImports = any[];
|
|
139
|
+
declare type __ΩSourceFileHeaderProps = any[];
|
|
140
|
+
//#endregion
|
|
141
|
+
export { BuiltinSourceFileContext, ComponentProps, ComponentPropsWithChildren, CopyFileOutputContext, CopyOutputFile, OutputDirectory, OutputFile, ReflectionOverrideInterface, RenderBuiltinContext, RenderContext, RenderEntryContext, RenderOutputContext, SourceFileHeaderProps, TypescriptFileImportItem, TypescriptFileImports, WriteOutputFile, __ΩBuiltinSourceFileContext, __ΩComponentProps, __ΩComponentPropsWithChildren, __ΩCopyFileOutputContext, __ΩCopyOutputFile, __ΩOutputDirectory, __ΩOutputFile, __ΩReflectionOverrideInterface, __ΩRenderBuiltinContext, __ΩRenderContext, __ΩRenderEntryContext, __ΩRenderOutputContext, __ΩSourceFileHeaderProps, __ΩTypescriptFileImportItem, __ΩTypescriptFileImports, __ΩWriteOutputFile };
|
|
142
|
+
//# sourceMappingURL=components.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"components.d.mts","names":[],"sources":["../../src/types/components.ts"],"sourcesContent":[],"mappings":";;;;;UAsBiB,cAAA;;EAAA,IAAA,EAAA,MAAA;EAcA,UAAA,EAAA,MAAe;EAepB;;;;;;EAOM,MAAA,CAAA,EAzBP,aAyBO;AAElB;AAMiB,UA9BA,eAAA,CA8BkB;EAIlB,IAAA,EAAA,MAAA,GAAA,OAAA,GAAoB,SAAA;EAIpB,IAAA,EAAA,MAAA;EAIA,QAAA,EAAA,MAAA;EAKA,QAAA,EAAA,MAAc;EAEhB;;;;;;EAF+B,MAAA,CAAA,EAnCnC,aAmCmC;AAwB9C;AAOY,KA/DA,UAAA,GA+DA,CA9DP,eA8DiC,GAAA;EAAQ,IAAA,EAAA,MAAA;CAAL,CAAA,GAAA,CA7DpC,eA6DoC,GAAA;EACzB,IAAA,EAAA,OAAA;EAAL,cAAA,CAAA,EA5DY,2BA4DZ;CAAT,CAAA,GAAA,CA1DG,eA0DH,GAAA;EAAQ,IAAA,EAAA,SAAA;EAEO,EAAA,EAAA,MAAA;AAOjB,CAAA,CAAA,GAlEI,cAkEa;AACC,UAjED,eAAA,CAiEC;EACA,IAAA,EAAA,WAAA;EAEO,IAAA,EAAA,MAAA;EAAR,QAAA,EAAA,CAjEJ,eAiEI,GAjEc,UAiEd,CAAA,EAAA;;AAGA,UAjEA,kBAAA,CAiEwB;EAO7B,cAAA,EAvEM,2BAuEe;;AAEf,UAtED,oBAAA,CAsEC;EAFkB,EAAA,EAAA,MAAA;;AAKnB,UArEA,mBAAA,CAqEsB;SApE9B;;UAGQ,qBAAA;;;;UAKA,aAAA,SAAsB;;eAExB;;;;cAKD;;;;YAKF;;;;aAKC;MACP;;;;;UAMW,cAAA;aACJ;;;;;KAMD,0BAAA,GAA6B,KAAK,8BAC5C,SAAS,KAAK;UAEC,wBAAA,SAAiC;;;;;;UAOjC;kBACC;kBACA;;iBAED,QAAQ;;UAGR,wBAAA;;;;;;KAOL,qBAAA,GAAwB,+BAElB,MAAM;UAGP,qBAAA,SAA8B"}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { BuiltinSourceFileContext, ComponentProps, ComponentPropsWithChildren, CopyFileOutputContext, CopyOutputFile, OutputDirectory, OutputFile, ReflectionOverrideInterface, RenderBuiltinContext, RenderContext, RenderEntryContext, RenderOutputContext, SourceFileHeaderProps, TypescriptFileImportItem, TypescriptFileImports, WriteOutputFile, __ΩBuiltinSourceFileContext, __ΩComponentProps, __ΩComponentPropsWithChildren, __ΩCopyFileOutputContext, __ΩCopyOutputFile, __ΩOutputDirectory, __ΩOutputFile, __ΩReflectionOverrideInterface, __ΩRenderBuiltinContext, __ΩRenderContext, __ΩRenderEntryContext, __ΩRenderOutputContext, __ΩSourceFileHeaderProps, __ΩTypescriptFileImportItem, __ΩTypescriptFileImports, __ΩWriteOutputFile } from "./components.cjs";
|
|
2
|
+
import { AlloyPluginContext, AlloyPluginOptions, AlloyPluginResolvedConfig, AlloyPluginUserConfig, __ΩAlloyPluginContext, __ΩAlloyPluginOptions, __ΩAlloyPluginResolvedConfig, __ΩAlloyPluginUserConfig } from "./plugin.cjs";
|
|
3
|
+
export { AlloyPluginContext, AlloyPluginOptions, AlloyPluginResolvedConfig, AlloyPluginUserConfig, BuiltinSourceFileContext, ComponentProps, ComponentPropsWithChildren, CopyFileOutputContext, CopyOutputFile, OutputDirectory, OutputFile, ReflectionOverrideInterface, RenderBuiltinContext, RenderContext, RenderEntryContext, RenderOutputContext, SourceFileHeaderProps, TypescriptFileImportItem, TypescriptFileImports, WriteOutputFile, __ΩAlloyPluginContext, __ΩAlloyPluginOptions, __ΩAlloyPluginResolvedConfig, __ΩAlloyPluginUserConfig, __ΩBuiltinSourceFileContext, __ΩComponentProps, __ΩComponentPropsWithChildren, __ΩCopyFileOutputContext, __ΩCopyOutputFile, __ΩOutputDirectory, __ΩOutputFile, __ΩReflectionOverrideInterface, __ΩRenderBuiltinContext, __ΩRenderContext, __ΩRenderEntryContext, __ΩRenderOutputContext, __ΩSourceFileHeaderProps, __ΩTypescriptFileImportItem, __ΩTypescriptFileImports, __ΩWriteOutputFile };
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { BuiltinSourceFileContext, ComponentProps, ComponentPropsWithChildren, CopyFileOutputContext, CopyOutputFile, OutputDirectory, OutputFile, ReflectionOverrideInterface, RenderBuiltinContext, RenderContext, RenderEntryContext, RenderOutputContext, SourceFileHeaderProps, TypescriptFileImportItem, TypescriptFileImports, WriteOutputFile, __ΩBuiltinSourceFileContext, __ΩComponentProps, __ΩComponentPropsWithChildren, __ΩCopyFileOutputContext, __ΩCopyOutputFile, __ΩOutputDirectory, __ΩOutputFile, __ΩReflectionOverrideInterface, __ΩRenderBuiltinContext, __ΩRenderContext, __ΩRenderEntryContext, __ΩRenderOutputContext, __ΩSourceFileHeaderProps, __ΩTypescriptFileImportItem, __ΩTypescriptFileImports, __ΩWriteOutputFile } from "./components.mjs";
|
|
2
|
+
import { AlloyPluginContext, AlloyPluginOptions, AlloyPluginResolvedConfig, AlloyPluginUserConfig, __ΩAlloyPluginContext, __ΩAlloyPluginOptions, __ΩAlloyPluginResolvedConfig, __ΩAlloyPluginUserConfig } from "./plugin.mjs";
|
|
3
|
+
export { AlloyPluginContext, AlloyPluginOptions, AlloyPluginResolvedConfig, AlloyPluginUserConfig, BuiltinSourceFileContext, ComponentProps, ComponentPropsWithChildren, CopyFileOutputContext, CopyOutputFile, OutputDirectory, OutputFile, ReflectionOverrideInterface, RenderBuiltinContext, RenderContext, RenderEntryContext, RenderOutputContext, SourceFileHeaderProps, TypescriptFileImportItem, TypescriptFileImports, WriteOutputFile, __ΩAlloyPluginContext, __ΩAlloyPluginOptions, __ΩAlloyPluginResolvedConfig, __ΩAlloyPluginUserConfig, __ΩBuiltinSourceFileContext, __ΩComponentProps, __ΩComponentPropsWithChildren, __ΩCopyFileOutputContext, __ΩCopyOutputFile, __ΩOutputDirectory, __ΩOutputFile, __ΩReflectionOverrideInterface, __ΩRenderBuiltinContext, __ΩRenderContext, __ΩRenderEntryContext, __ΩRenderOutputContext, __ΩSourceFileHeaderProps, __ΩTypescriptFileImportItem, __ΩTypescriptFileImports, __ΩWriteOutputFile };
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { PrintTreeOptions } from "@alloy-js/core";
|
|
2
|
+
import { PluginContext } from "powerlines";
|
|
3
|
+
import { BabelPluginResolvedConfig, BabelPluginUserConfig } from "@powerlines/plugin-babel/types/plugin";
|
|
4
|
+
|
|
5
|
+
//#region src/types/plugin.d.ts
|
|
6
|
+
type AlloyPluginOptions = Partial<PrintTreeOptions> & {
|
|
7
|
+
/**
|
|
8
|
+
* If true, the Alloy framework is used to generate Typescript output files.
|
|
9
|
+
*
|
|
10
|
+
* @defaultValue true
|
|
11
|
+
*/
|
|
12
|
+
typescript?: boolean;
|
|
13
|
+
/**
|
|
14
|
+
* If true, the Alloy framework is used to generate JSON output files.
|
|
15
|
+
*
|
|
16
|
+
* @defaultValue false
|
|
17
|
+
*/
|
|
18
|
+
json?: boolean;
|
|
19
|
+
/**
|
|
20
|
+
* If true, the Alloy framework is used to generate Markdown output files.
|
|
21
|
+
*
|
|
22
|
+
* @defaultValue false
|
|
23
|
+
*/
|
|
24
|
+
markdown?: boolean;
|
|
25
|
+
};
|
|
26
|
+
type AlloyPluginUserConfig = BabelPluginUserConfig & {
|
|
27
|
+
alloy?: AlloyPluginOptions;
|
|
28
|
+
};
|
|
29
|
+
type AlloyPluginResolvedConfig = BabelPluginResolvedConfig & {
|
|
30
|
+
alloy: AlloyPluginOptions;
|
|
31
|
+
};
|
|
32
|
+
type AlloyPluginContext<TResolvedConfig extends AlloyPluginResolvedConfig = AlloyPluginResolvedConfig> = PluginContext<TResolvedConfig>;
|
|
33
|
+
declare type __ΩAlloyPluginOptions = any[];
|
|
34
|
+
declare type __ΩAlloyPluginUserConfig = any[];
|
|
35
|
+
declare type __ΩAlloyPluginResolvedConfig = any[];
|
|
36
|
+
declare type __ΩAlloyPluginContext = any[];
|
|
37
|
+
//#endregion
|
|
38
|
+
export { AlloyPluginContext, AlloyPluginOptions, AlloyPluginResolvedConfig, AlloyPluginUserConfig, __ΩAlloyPluginContext, __ΩAlloyPluginOptions, __ΩAlloyPluginResolvedConfig, __ΩAlloyPluginUserConfig };
|
|
39
|
+
//# sourceMappingURL=plugin.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugin.d.cts","names":[],"sources":["../../src/types/plugin.ts"],"sourcesContent":[],"mappings":";;;;;KAyBY,kBAAA,GAAqB,QAAQ;;AAAzC;AAuBA;AAIA;AAIA;EAC0B,UAAA,CAAA,EAAA,OAAA;EAA4B;;;;;;;;;;;;;KAT1C,qBAAA,GAAwB;UAC1B;;KAGE,yBAAA,GAA4B;SAC/B;;KAGG,2CACc,4BAA4B,6BAClD,cAAc"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { PrintTreeOptions } from "@alloy-js/core";
|
|
2
|
+
import { PluginContext } from "powerlines";
|
|
3
|
+
import { BabelPluginResolvedConfig, BabelPluginUserConfig } from "@powerlines/plugin-babel/types/plugin";
|
|
4
|
+
|
|
5
|
+
//#region src/types/plugin.d.ts
|
|
6
|
+
type AlloyPluginOptions = Partial<PrintTreeOptions> & {
|
|
7
|
+
/**
|
|
8
|
+
* If true, the Alloy framework is used to generate Typescript output files.
|
|
9
|
+
*
|
|
10
|
+
* @defaultValue true
|
|
11
|
+
*/
|
|
12
|
+
typescript?: boolean;
|
|
13
|
+
/**
|
|
14
|
+
* If true, the Alloy framework is used to generate JSON output files.
|
|
15
|
+
*
|
|
16
|
+
* @defaultValue false
|
|
17
|
+
*/
|
|
18
|
+
json?: boolean;
|
|
19
|
+
/**
|
|
20
|
+
* If true, the Alloy framework is used to generate Markdown output files.
|
|
21
|
+
*
|
|
22
|
+
* @defaultValue false
|
|
23
|
+
*/
|
|
24
|
+
markdown?: boolean;
|
|
25
|
+
};
|
|
26
|
+
type AlloyPluginUserConfig = BabelPluginUserConfig & {
|
|
27
|
+
alloy?: AlloyPluginOptions;
|
|
28
|
+
};
|
|
29
|
+
type AlloyPluginResolvedConfig = BabelPluginResolvedConfig & {
|
|
30
|
+
alloy: AlloyPluginOptions;
|
|
31
|
+
};
|
|
32
|
+
type AlloyPluginContext<TResolvedConfig extends AlloyPluginResolvedConfig = AlloyPluginResolvedConfig> = PluginContext<TResolvedConfig>;
|
|
33
|
+
declare type __ΩAlloyPluginOptions = any[];
|
|
34
|
+
declare type __ΩAlloyPluginUserConfig = any[];
|
|
35
|
+
declare type __ΩAlloyPluginResolvedConfig = any[];
|
|
36
|
+
declare type __ΩAlloyPluginContext = any[];
|
|
37
|
+
//#endregion
|
|
38
|
+
export { AlloyPluginContext, AlloyPluginOptions, AlloyPluginResolvedConfig, AlloyPluginUserConfig, __ΩAlloyPluginContext, __ΩAlloyPluginOptions, __ΩAlloyPluginResolvedConfig, __ΩAlloyPluginUserConfig };
|
|
39
|
+
//# sourceMappingURL=plugin.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugin.d.mts","names":[],"sources":["../../src/types/plugin.ts"],"sourcesContent":[],"mappings":";;;;;KAyBY,kBAAA,GAAqB,QAAQ;;AAAzC;AAuBA;AAIA;AAIA;EAC0B,UAAA,CAAA,EAAA,OAAA;EAA4B;;;;;;;;;;;;;KAT1C,qBAAA,GAAwB;UAC1B;;KAGE,yBAAA,GAA4B;SAC/B;;KAGG,2CACc,4BAA4B,6BAClD,cAAc"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { TSDocModuleProps } from "./tsdoc.cjs";
|
|
2
|
+
import { TypescriptFileProps } from "./typescript-file.cjs";
|
|
3
|
+
import * as _alloy_js_core21 from "@alloy-js/core";
|
|
4
|
+
|
|
5
|
+
//#region src/typescript/components/builtin-file.d.ts
|
|
6
|
+
type BuiltinFileProps = Omit<TypescriptFileProps, "path"> & Omit<TSDocModuleProps, "name"> & {
|
|
7
|
+
/**
|
|
8
|
+
* The runtime module identifier.
|
|
9
|
+
*
|
|
10
|
+
* @remarks
|
|
11
|
+
* This value will be included after the \`storm:\` prefix in the import statement.
|
|
12
|
+
*/
|
|
13
|
+
id: string;
|
|
14
|
+
/**
|
|
15
|
+
* The description for the builtin module.
|
|
16
|
+
*/
|
|
17
|
+
description?: string;
|
|
18
|
+
/**
|
|
19
|
+
* Whether the file is a TSX file.
|
|
20
|
+
*
|
|
21
|
+
* @defaultValue false
|
|
22
|
+
*/
|
|
23
|
+
tsx?: boolean;
|
|
24
|
+
};
|
|
25
|
+
/**
|
|
26
|
+
* A base component representing a Powerlines generated Typescript source file.
|
|
27
|
+
*
|
|
28
|
+
* @param props - The properties for the source file.
|
|
29
|
+
* @returns The rendered source file component.
|
|
30
|
+
*/
|
|
31
|
+
declare function BuiltinFile(props: BuiltinFileProps): _alloy_js_core21.Children;
|
|
32
|
+
declare type __ΩBuiltinFileProps = any[];
|
|
33
|
+
//#endregion
|
|
34
|
+
export { BuiltinFile, BuiltinFileProps, __ΩBuiltinFileProps };
|
|
35
|
+
//# sourceMappingURL=builtin-file.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"builtin-file.d.cts","names":[],"sources":["../../../src/typescript/components/builtin-file.tsx"],"sourcesContent":[],"mappings":";;;;;KAgCY,gBAAA,GAAmB,KAAK,+BAClC,KAAK;;;AADP;;;;EACE,EAAA,EAAA,MAAA;EAAI;AA4BN;;;;;;;;;;;;;;;;iBAAgB,WAAA,QAAmB,mBAAgB,gBAAA,CAAA"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { TSDocModuleProps } from "./tsdoc.mjs";
|
|
2
|
+
import { TypescriptFileProps } from "./typescript-file.mjs";
|
|
3
|
+
import * as _alloy_js_core12 from "@alloy-js/core";
|
|
4
|
+
|
|
5
|
+
//#region src/typescript/components/builtin-file.d.ts
|
|
6
|
+
type BuiltinFileProps = Omit<TypescriptFileProps, "path"> & Omit<TSDocModuleProps, "name"> & {
|
|
7
|
+
/**
|
|
8
|
+
* The runtime module identifier.
|
|
9
|
+
*
|
|
10
|
+
* @remarks
|
|
11
|
+
* This value will be included after the \`storm:\` prefix in the import statement.
|
|
12
|
+
*/
|
|
13
|
+
id: string;
|
|
14
|
+
/**
|
|
15
|
+
* The description for the builtin module.
|
|
16
|
+
*/
|
|
17
|
+
description?: string;
|
|
18
|
+
/**
|
|
19
|
+
* Whether the file is a TSX file.
|
|
20
|
+
*
|
|
21
|
+
* @defaultValue false
|
|
22
|
+
*/
|
|
23
|
+
tsx?: boolean;
|
|
24
|
+
};
|
|
25
|
+
/**
|
|
26
|
+
* A base component representing a Powerlines generated Typescript source file.
|
|
27
|
+
*
|
|
28
|
+
* @param props - The properties for the source file.
|
|
29
|
+
* @returns The rendered source file component.
|
|
30
|
+
*/
|
|
31
|
+
declare function BuiltinFile(props: BuiltinFileProps): _alloy_js_core12.Children;
|
|
32
|
+
declare type __ΩBuiltinFileProps = any[];
|
|
33
|
+
//#endregion
|
|
34
|
+
export { BuiltinFile, BuiltinFileProps, __ΩBuiltinFileProps };
|
|
35
|
+
//# sourceMappingURL=builtin-file.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"builtin-file.d.mts","names":[],"sources":["../../../src/typescript/components/builtin-file.tsx"],"sourcesContent":[],"mappings":";;;;;KAgCY,gBAAA,GAAmB,KAAK,+BAClC,KAAK;;;AADP;;;;EACE,EAAA,EAAA,MAAA;EAAI;AA4BN;;;;;;;;;;;;;;;;iBAAgB,WAAA,QAAmB,mBAAgB,gBAAA,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"builtin-file.mjs","names":["computed","splitProps","hasFileExtension","replaceExtension","replacePath","isSet","usePowerlinesSafe","TSDocModule","TypescriptFile","TypescriptFileHeader","TypescriptFileHeaderImports","BuiltinFile","props","children","imports","builtinImports","id","description","tsx","rest","context","path","builtinsPath","_$createComponent","_$mergeProps","header","name","meta","kind","extension","value"],"sources":["../../../src/typescript/components/builtin-file.tsx"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { computed, splitProps } from \"@alloy-js/core\";\nimport { hasFileExtension } from \"@stryke/path/file-path-fns\";\nimport { replaceExtension, replacePath } from \"@stryke/path/replace\";\nimport { isSet } from \"@stryke/type-checks/is-set\";\nimport { usePowerlinesSafe } from \"../../core/contexts/context\";\nimport type { TSDocModuleProps } from \"./tsdoc\";\nimport { TSDocModule } from \"./tsdoc\";\nimport {\n TypescriptFile,\n TypescriptFileHeader,\n TypescriptFileHeaderImports,\n TypescriptFileProps\n} from \"./typescript-file\";\n\nexport type BuiltinFileProps = Omit<TypescriptFileProps, \"path\"> &\n Omit<TSDocModuleProps, \"name\"> & {\n /**\n * The runtime module identifier.\n *\n * @remarks\n * This value will be included after the \\`storm:\\` prefix in the import statement.\n */\n id: string;\n\n /**\n * The description for the builtin module.\n */\n description?: string;\n\n /**\n * Whether the file is a TSX file.\n *\n * @defaultValue false\n */\n tsx?: boolean;\n };\n\n/**\n * A base component representing a Powerlines generated Typescript source file.\n *\n * @param props - The properties for the source file.\n * @returns The rendered source file component.\n */\nexport function BuiltinFile(props: BuiltinFileProps) {\n const [{ children, imports, builtinImports, id, description, tsx }, rest] =\n splitProps(props, [\n \"children\",\n \"imports\",\n \"builtinImports\",\n \"id\",\n \"description\",\n \"tsx\"\n ]);\n\n const context = usePowerlinesSafe();\n const path = computed(() =>\n replacePath(\n `${!isSet(tsx) ? id : replaceExtension(id)}${\n hasFileExtension(id) && !isSet(tsx) ? \"\" : tsx ? \".tsx\" : \".ts\"\n }`,\n context?.builtinsPath\n )\n );\n\n return (\n <TypescriptFile\n header={\n <TypescriptFileHeader\n header={<TSDocModule name={id}>{description}</TSDocModule>}>\n <TypescriptFileHeaderImports\n imports={imports}\n builtinImports={builtinImports}\n />\n </TypescriptFileHeader>\n }\n meta={{\n kind: \"builtin\",\n extension: tsx ? \"tsx\" : \"ts\",\n id: replaceExtension(id)\n }}\n {...rest}\n path={path.value}>\n {children}\n </TypescriptFile>\n );\n}\n"],"mappings":""}
|