@powerlines/plugin-alloy 0.18.20 → 0.18.22
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/output.d.cts +2 -2
- package/dist/core/components/output.d.mts +2 -2
- package/dist/core/components/source-file.d.cts +2 -2
- package/dist/markdown/components/markdown-file.cjs +2 -2
- package/dist/markdown/components/markdown-file.d.cts +3 -3
- package/dist/markdown/components/markdown-file.d.mts +3 -3
- package/dist/markdown/components/markdown-file.mjs +3 -3
- package/dist/markdown/components/markdown-table.d.cts +4 -4
- package/dist/markdown/components/markdown-table.d.mts +4 -4
- package/dist/typescript/components/builtin-file.cjs +2 -2
- package/dist/typescript/components/builtin-file.mjs +3 -3
- package/dist/typescript/components/dynamic-import-statement.d.cts +2 -2
- package/dist/typescript/components/dynamic-import-statement.d.mts +2 -2
- package/dist/typescript/components/entry-file.cjs +2 -2
- package/dist/typescript/components/entry-file.d.mts +2 -2
- package/dist/typescript/components/entry-file.mjs +3 -3
- package/dist/typescript/components/tsdoc-reflection.cjs +4 -0
- package/dist/typescript/components/tsdoc-reflection.d.cts +4 -4
- package/dist/typescript/components/tsdoc-reflection.d.mts +4 -4
- package/dist/typescript/components/tsdoc-reflection.mjs +4 -0
- package/dist/typescript/components/tsdoc.cjs +12 -7
- package/dist/typescript/components/tsdoc.d.cts +15 -4
- package/dist/typescript/components/tsdoc.d.mts +15 -4
- package/dist/typescript/components/tsdoc.mjs +13 -8
- package/dist/typescript/components/typescript-file.cjs +4 -4
- package/dist/typescript/components/typescript-file.mjs +5 -5
- package/dist/typescript/components/typescript-interface.d.cts +3 -3
- package/dist/typescript/components/typescript-interface.d.mts +3 -3
- package/dist/typescript/components/typescript-object.d.cts +3 -3
- package/dist/typescript/components/typescript-object.d.mts +3 -3
- package/package.json +5 -5
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { PluginContext } from "../../powerlines/src/types/context.cjs";
|
|
2
2
|
import { MetaItem } from "../contexts/context.cjs";
|
|
3
|
-
import * as
|
|
3
|
+
import * as _alloy_js_core0 from "@alloy-js/core";
|
|
4
4
|
import { OutputProps as OutputProps$1 } from "@alloy-js/core";
|
|
5
5
|
|
|
6
6
|
//#region src/core/components/output.d.ts
|
|
@@ -17,7 +17,7 @@ interface OutputProps<TContext extends PluginContext = PluginContext, TMeta exte
|
|
|
17
17
|
/**
|
|
18
18
|
* Output component for rendering the Powerlines plugin's output files via templates.
|
|
19
19
|
*/
|
|
20
|
-
declare function Output<TContext extends PluginContext = PluginContext, TMeta extends Record<string, MetaItem> = Record<string, MetaItem>>(props: OutputProps<TContext, TMeta>):
|
|
20
|
+
declare function Output<TContext extends PluginContext = PluginContext, TMeta extends Record<string, MetaItem> = Record<string, MetaItem>>(props: OutputProps<TContext, TMeta>): _alloy_js_core0.Children;
|
|
21
21
|
declare type __ΩOutputProps = any[];
|
|
22
22
|
//#endregion
|
|
23
23
|
export { Output, OutputProps, __ΩOutputProps };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { PluginContext } from "../../powerlines/src/types/context.mjs";
|
|
2
2
|
import { MetaItem } from "../contexts/context.mjs";
|
|
3
|
-
import * as
|
|
3
|
+
import * as _alloy_js_core1 from "@alloy-js/core";
|
|
4
4
|
import { OutputProps as OutputProps$1 } from "@alloy-js/core";
|
|
5
5
|
|
|
6
6
|
//#region src/core/components/output.d.ts
|
|
@@ -17,7 +17,7 @@ interface OutputProps<TContext extends PluginContext = PluginContext, TMeta exte
|
|
|
17
17
|
/**
|
|
18
18
|
* Output component for rendering the Powerlines plugin's output files via templates.
|
|
19
19
|
*/
|
|
20
|
-
declare function Output<TContext extends PluginContext = PluginContext, TMeta extends Record<string, MetaItem> = Record<string, MetaItem>>(props: OutputProps<TContext, TMeta>):
|
|
20
|
+
declare function Output<TContext extends PluginContext = PluginContext, TMeta extends Record<string, MetaItem> = Record<string, MetaItem>>(props: OutputProps<TContext, TMeta>): _alloy_js_core1.Children;
|
|
21
21
|
declare type __ΩOutputProps = any[];
|
|
22
22
|
//#endregion
|
|
23
23
|
export { Output, OutputProps, __ΩOutputProps };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { StoragePreset } from "../../powerlines/src/types/fs.cjs";
|
|
2
2
|
import { ComponentProps } from "../../types/components.cjs";
|
|
3
|
-
import * as
|
|
3
|
+
import * as _alloy_js_core13 from "@alloy-js/core";
|
|
4
4
|
import { SourceFileProps as SourceFileProps$1 } from "@alloy-js/core";
|
|
5
5
|
|
|
6
6
|
//#region src/core/components/source-file.d.ts
|
|
@@ -26,7 +26,7 @@ type SourceFileProps = SourceFileProps$1 & ComponentProps & {
|
|
|
26
26
|
* @param props - The properties for the source file.
|
|
27
27
|
* @returns The rendered source file component.
|
|
28
28
|
*/
|
|
29
|
-
declare function SourceFile(props: SourceFileProps):
|
|
29
|
+
declare function SourceFile(props: SourceFileProps): _alloy_js_core13.Children;
|
|
30
30
|
declare type __ΩSourceFileProps = any[];
|
|
31
31
|
//#endregion
|
|
32
32
|
export { SourceFile, SourceFileProps, __ΩSourceFileProps };
|
|
@@ -45,7 +45,7 @@ function MarkdownFileHeader(props) {
|
|
|
45
45
|
"disableBiome",
|
|
46
46
|
"disablePrettier"
|
|
47
47
|
]);
|
|
48
|
-
const context = require_core_contexts_context.
|
|
48
|
+
const context = require_core_contexts_context.usePowerlinesSafe();
|
|
49
49
|
return [
|
|
50
50
|
(0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_core.Show, {
|
|
51
51
|
get when() {
|
|
@@ -99,7 +99,7 @@ function MarkdownFileHeader(props) {
|
|
|
99
99
|
(0, __alloy_js_core_jsx_runtime.createComponent)(require_core_components_single_line_comment.SingleLineComment, {
|
|
100
100
|
variant: "markdown",
|
|
101
101
|
get children() {
|
|
102
|
-
return __alloy_js_core.code`Generated by
|
|
102
|
+
return __alloy_js_core.code`Generated by ${(0, __stryke_string_format_title_case.titleCase)(context?.config?.framework) || "Powerlines"}`;
|
|
103
103
|
}
|
|
104
104
|
}),
|
|
105
105
|
(0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ComponentProps, SourceFileHeaderProps } from "../../types/components.cjs";
|
|
2
2
|
import { SourceFileProps as SourceFileProps$1 } from "../../core/components/source-file.cjs";
|
|
3
|
-
import * as
|
|
3
|
+
import * as _alloy_js_core11 from "@alloy-js/core";
|
|
4
4
|
|
|
5
5
|
//#region src/markdown/components/markdown-file.d.ts
|
|
6
6
|
type MarkdownFileProps = Omit<SourceFileProps$1, "filetype"> & ComponentProps;
|
|
@@ -10,14 +10,14 @@ type MarkdownFileProps = Omit<SourceFileProps$1, "filetype"> & ComponentProps;
|
|
|
10
10
|
* @param props - The properties for the source file.
|
|
11
11
|
* @returns The rendered source file component.
|
|
12
12
|
*/
|
|
13
|
-
declare function MarkdownFile(props: MarkdownFileProps):
|
|
13
|
+
declare function MarkdownFile(props: MarkdownFileProps): _alloy_js_core11.Children;
|
|
14
14
|
/**
|
|
15
15
|
* Renders the header for a Powerlines Typescript source file.
|
|
16
16
|
*
|
|
17
17
|
* @param props - The properties for the source file header.
|
|
18
18
|
* @returns The rendered source file header.
|
|
19
19
|
*/
|
|
20
|
-
declare function MarkdownFileHeader(props: SourceFileHeaderProps):
|
|
20
|
+
declare function MarkdownFileHeader(props: SourceFileHeaderProps): _alloy_js_core11.Children;
|
|
21
21
|
declare type __ΩMarkdownFileProps = any[];
|
|
22
22
|
//#endregion
|
|
23
23
|
export { MarkdownFile, MarkdownFileHeader, MarkdownFileProps, __ΩMarkdownFileProps };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ComponentProps, SourceFileHeaderProps } from "../../types/components.mjs";
|
|
2
2
|
import { SourceFileProps as SourceFileProps$1 } from "../../core/components/source-file.mjs";
|
|
3
|
-
import * as
|
|
3
|
+
import * as _alloy_js_core5 from "@alloy-js/core";
|
|
4
4
|
|
|
5
5
|
//#region src/markdown/components/markdown-file.d.ts
|
|
6
6
|
type MarkdownFileProps = Omit<SourceFileProps$1, "filetype"> & ComponentProps;
|
|
@@ -10,14 +10,14 @@ type MarkdownFileProps = Omit<SourceFileProps$1, "filetype"> & ComponentProps;
|
|
|
10
10
|
* @param props - The properties for the source file.
|
|
11
11
|
* @returns The rendered source file component.
|
|
12
12
|
*/
|
|
13
|
-
declare function MarkdownFile(props: MarkdownFileProps):
|
|
13
|
+
declare function MarkdownFile(props: MarkdownFileProps): _alloy_js_core5.Children;
|
|
14
14
|
/**
|
|
15
15
|
* Renders the header for a Powerlines Typescript source file.
|
|
16
16
|
*
|
|
17
17
|
* @param props - The properties for the source file header.
|
|
18
18
|
* @returns The rendered source file header.
|
|
19
19
|
*/
|
|
20
|
-
declare function MarkdownFileHeader(props: SourceFileHeaderProps):
|
|
20
|
+
declare function MarkdownFileHeader(props: SourceFileHeaderProps): _alloy_js_core5.Children;
|
|
21
21
|
declare type __ΩMarkdownFileProps = any[];
|
|
22
22
|
//#endregion
|
|
23
23
|
export { MarkdownFile, MarkdownFileHeader, MarkdownFileProps, __ΩMarkdownFileProps };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { usePowerlinesSafe } from "../../core/contexts/context.mjs";
|
|
2
2
|
import { SingleLineComment } from "../../core/components/single-line-comment.mjs";
|
|
3
3
|
import { SourceFile } from "../../core/components/source-file.mjs";
|
|
4
4
|
import { createComponent, createIntrinsic, mergeProps } from "@alloy-js/core/jsx-runtime";
|
|
@@ -44,7 +44,7 @@ function MarkdownFileHeader(props) {
|
|
|
44
44
|
"disableBiome",
|
|
45
45
|
"disablePrettier"
|
|
46
46
|
]);
|
|
47
|
-
const context =
|
|
47
|
+
const context = usePowerlinesSafe();
|
|
48
48
|
return [
|
|
49
49
|
createComponent(Show, {
|
|
50
50
|
get when() {
|
|
@@ -98,7 +98,7 @@ function MarkdownFileHeader(props) {
|
|
|
98
98
|
createComponent(SingleLineComment, {
|
|
99
99
|
variant: "markdown",
|
|
100
100
|
get children() {
|
|
101
|
-
return code`Generated by
|
|
101
|
+
return code`Generated by ${titleCase(context?.config?.framework) || "Powerlines"}`;
|
|
102
102
|
}
|
|
103
103
|
}),
|
|
104
104
|
createIntrinsic("hbr", {}),
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ComponentProps } from "../../types/components.cjs";
|
|
2
2
|
import { MarkdownTableColumnContextInterface } from "../contexts/markdown-table.cjs";
|
|
3
|
-
import * as
|
|
3
|
+
import * as _alloy_js_core1 from "@alloy-js/core";
|
|
4
4
|
|
|
5
5
|
//#region src/markdown/components/markdown-table.d.ts
|
|
6
6
|
interface MarkdownTableProps<T extends Record<string, any> = Record<string, any>> extends ComponentProps {
|
|
@@ -9,18 +9,18 @@ interface MarkdownTableProps<T extends Record<string, any> = Record<string, any>
|
|
|
9
9
|
/**
|
|
10
10
|
* Component that provides a context for rendering markdown tables.
|
|
11
11
|
*/
|
|
12
|
-
declare function MarkdownTable<T extends Record<string, any> = Record<string, any>>(props: MarkdownTableProps<T>):
|
|
12
|
+
declare function MarkdownTable<T extends Record<string, any> = Record<string, any>>(props: MarkdownTableProps<T>): _alloy_js_core1.Children;
|
|
13
13
|
type MarkdownTableColumnProps = ComponentProps & Partial<Pick<MarkdownTableColumnContextInterface, "align">> & Required<Pick<MarkdownTableColumnContextInterface, "name">> & {
|
|
14
14
|
width?: number;
|
|
15
15
|
};
|
|
16
16
|
/**
|
|
17
17
|
* Component that provides a context for rendering markdown tables.
|
|
18
18
|
*/
|
|
19
|
-
declare function MarkdownTableColumn(props: MarkdownTableColumnProps):
|
|
19
|
+
declare function MarkdownTableColumn(props: MarkdownTableColumnProps): _alloy_js_core1.Children;
|
|
20
20
|
/**
|
|
21
21
|
* Component that provides a context for rendering markdown tables.
|
|
22
22
|
*/
|
|
23
|
-
declare function MarkdownTableColumnHeader(props: MarkdownTableColumnProps):
|
|
23
|
+
declare function MarkdownTableColumnHeader(props: MarkdownTableColumnProps): _alloy_js_core1.Children;
|
|
24
24
|
declare type __ΩMarkdownTableProps = any[];
|
|
25
25
|
declare type __ΩMarkdownTableColumnProps = any[];
|
|
26
26
|
//#endregion
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ComponentProps } from "../../types/components.mjs";
|
|
2
2
|
import { MarkdownTableColumnContextInterface } from "../contexts/markdown-table.mjs";
|
|
3
|
-
import * as
|
|
3
|
+
import * as _alloy_js_core2 from "@alloy-js/core";
|
|
4
4
|
|
|
5
5
|
//#region src/markdown/components/markdown-table.d.ts
|
|
6
6
|
interface MarkdownTableProps<T extends Record<string, any> = Record<string, any>> extends ComponentProps {
|
|
@@ -9,18 +9,18 @@ interface MarkdownTableProps<T extends Record<string, any> = Record<string, any>
|
|
|
9
9
|
/**
|
|
10
10
|
* Component that provides a context for rendering markdown tables.
|
|
11
11
|
*/
|
|
12
|
-
declare function MarkdownTable<T extends Record<string, any> = Record<string, any>>(props: MarkdownTableProps<T>):
|
|
12
|
+
declare function MarkdownTable<T extends Record<string, any> = Record<string, any>>(props: MarkdownTableProps<T>): _alloy_js_core2.Children;
|
|
13
13
|
type MarkdownTableColumnProps = ComponentProps & Partial<Pick<MarkdownTableColumnContextInterface, "align">> & Required<Pick<MarkdownTableColumnContextInterface, "name">> & {
|
|
14
14
|
width?: number;
|
|
15
15
|
};
|
|
16
16
|
/**
|
|
17
17
|
* Component that provides a context for rendering markdown tables.
|
|
18
18
|
*/
|
|
19
|
-
declare function MarkdownTableColumn(props: MarkdownTableColumnProps):
|
|
19
|
+
declare function MarkdownTableColumn(props: MarkdownTableColumnProps): _alloy_js_core2.Children;
|
|
20
20
|
/**
|
|
21
21
|
* Component that provides a context for rendering markdown tables.
|
|
22
22
|
*/
|
|
23
|
-
declare function MarkdownTableColumnHeader(props: MarkdownTableColumnProps):
|
|
23
|
+
declare function MarkdownTableColumnHeader(props: MarkdownTableColumnProps): _alloy_js_core2.Children;
|
|
24
24
|
declare type __ΩMarkdownTableProps = any[];
|
|
25
25
|
declare type __ΩMarkdownTableColumnProps = any[];
|
|
26
26
|
//#endregion
|
|
@@ -23,8 +23,8 @@ function BuiltinFile(props) {
|
|
|
23
23
|
"description",
|
|
24
24
|
"tsx"
|
|
25
25
|
]);
|
|
26
|
-
const context = require_core_contexts_context.
|
|
27
|
-
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
|
|
26
|
+
const context = require_core_contexts_context.usePowerlinesSafe();
|
|
27
|
+
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 ?? "builtins"));
|
|
28
28
|
return (0, __alloy_js_core_jsx_runtime.createComponent)(require_typescript_components_typescript_file.TypescriptFile, (0, __alloy_js_core_jsx_runtime.mergeProps)({
|
|
29
29
|
get header() {
|
|
30
30
|
return (0, __alloy_js_core_jsx_runtime.createComponent)(require_typescript_components_typescript_file.TypescriptFileHeader, {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { usePowerlinesSafe } from "../../core/contexts/context.mjs";
|
|
2
2
|
import { TSDocModule } from "./tsdoc.mjs";
|
|
3
3
|
import { TypescriptFile, TypescriptFileHeader, TypescriptFileHeaderImports } from "./typescript-file.mjs";
|
|
4
4
|
import { createComponent, mergeProps } from "@alloy-js/core/jsx-runtime";
|
|
@@ -22,8 +22,8 @@ function BuiltinFile(props) {
|
|
|
22
22
|
"description",
|
|
23
23
|
"tsx"
|
|
24
24
|
]);
|
|
25
|
-
const context =
|
|
26
|
-
const path = computed(() => replacePath(`${!isSet(tsx) ? id : replaceExtension(id)}${hasFileExtension(id) && !isSet(tsx) ? "" : tsx ? ".tsx" : ".ts"}`, context
|
|
25
|
+
const context = usePowerlinesSafe();
|
|
26
|
+
const path = computed(() => replacePath(`${!isSet(tsx) ? id : replaceExtension(id)}${hasFileExtension(id) && !isSet(tsx) ? "" : tsx ? ".tsx" : ".ts"}`, context?.builtinsPath ?? "builtins"));
|
|
27
27
|
return createComponent(TypescriptFile, mergeProps({
|
|
28
28
|
get header() {
|
|
29
29
|
return createComponent(TypescriptFileHeader, {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as _alloy_js_core14 from "@alloy-js/core";
|
|
2
2
|
import { VarDeclarationProps } from "@alloy-js/typescript";
|
|
3
3
|
|
|
4
4
|
//#region src/typescript/components/dynamic-import-statement.d.ts
|
|
@@ -26,7 +26,7 @@ interface DynamicImportStatementProps extends Omit<VarDeclarationProps, "initial
|
|
|
26
26
|
* @param props - The properties for the dynamic import statement.
|
|
27
27
|
* @returns A `VarDeclaration` component representing the dynamic import statement.
|
|
28
28
|
*/
|
|
29
|
-
declare function DynamicImportStatement(props: DynamicImportStatementProps):
|
|
29
|
+
declare function DynamicImportStatement(props: DynamicImportStatementProps): _alloy_js_core14.Children;
|
|
30
30
|
declare type __ΩDynamicImportStatementProps = any[];
|
|
31
31
|
//#endregion
|
|
32
32
|
export { DynamicImportStatement, DynamicImportStatementProps, __ΩDynamicImportStatementProps };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as _alloy_js_core11 from "@alloy-js/core";
|
|
2
2
|
import { VarDeclarationProps } from "@alloy-js/typescript";
|
|
3
3
|
|
|
4
4
|
//#region src/typescript/components/dynamic-import-statement.d.ts
|
|
@@ -26,7 +26,7 @@ interface DynamicImportStatementProps extends Omit<VarDeclarationProps, "initial
|
|
|
26
26
|
* @param props - The properties for the dynamic import statement.
|
|
27
27
|
* @returns A `VarDeclaration` component representing the dynamic import statement.
|
|
28
28
|
*/
|
|
29
|
-
declare function DynamicImportStatement(props: DynamicImportStatementProps):
|
|
29
|
+
declare function DynamicImportStatement(props: DynamicImportStatementProps): _alloy_js_core11.Children;
|
|
30
30
|
declare type __ΩDynamicImportStatementProps = any[];
|
|
31
31
|
//#endregion
|
|
32
32
|
export { DynamicImportStatement, DynamicImportStatementProps, __ΩDynamicImportStatementProps };
|
|
@@ -24,8 +24,8 @@ function EntryFile(props) {
|
|
|
24
24
|
"path",
|
|
25
25
|
"typeDefinition"
|
|
26
26
|
]);
|
|
27
|
-
const context = require_core_contexts_context.
|
|
28
|
-
const fullPath = (0, __alloy_js_core.computed)(() => (0, __stryke_path_replace.replacePath)(`${!(0, __stryke_type_checks_is_set.isSet)(tsx) ? path : (0, __stryke_path_replace.replaceExtension)(path)}${(0, __stryke_path_file_path_fns.hasFileExtension)(path) && !(0, __stryke_type_checks_is_set.isSet)(tsx) ? "" : tsx ? ".tsx" : ".ts"}`, context
|
|
27
|
+
const context = require_core_contexts_context.usePowerlinesSafe();
|
|
28
|
+
const fullPath = (0, __alloy_js_core.computed)(() => (0, __stryke_path_replace.replacePath)(`${!(0, __stryke_type_checks_is_set.isSet)(tsx) ? path : (0, __stryke_path_replace.replaceExtension)(path)}${(0, __stryke_path_file_path_fns.hasFileExtension)(path) && !(0, __stryke_type_checks_is_set.isSet)(tsx) ? "" : tsx ? ".tsx" : ".ts"}`, context?.entryPath || "entry"));
|
|
29
29
|
return (0, __alloy_js_core_jsx_runtime.createComponent)(require_typescript_components_typescript_file.TypescriptFile, (0, __alloy_js_core_jsx_runtime.mergeProps)(rest, {
|
|
30
30
|
get path() {
|
|
31
31
|
return fullPath.value;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ResolvedEntryTypeDefinition } from "../../powerlines/src/types/resolved.mjs";
|
|
2
2
|
import { TypescriptFileProps } from "./typescript-file.mjs";
|
|
3
|
-
import * as
|
|
3
|
+
import * as _alloy_js_core10 from "@alloy-js/core";
|
|
4
4
|
|
|
5
5
|
//#region src/typescript/components/entry-file.d.ts
|
|
6
6
|
type EntryFileProps = TypescriptFileProps & {
|
|
@@ -21,7 +21,7 @@ type EntryFileProps = TypescriptFileProps & {
|
|
|
21
21
|
* @param props - The properties for the source file.
|
|
22
22
|
* @returns The rendered source file component.
|
|
23
23
|
*/
|
|
24
|
-
declare function EntryFile(props: EntryFileProps):
|
|
24
|
+
declare function EntryFile(props: EntryFileProps): _alloy_js_core10.Children;
|
|
25
25
|
declare type __ΩEntryFileProps = any[];
|
|
26
26
|
//#endregion
|
|
27
27
|
export { EntryFile, EntryFileProps, __ΩEntryFileProps };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { usePowerlinesSafe } from "../../core/contexts/context.mjs";
|
|
2
2
|
import { TypescriptFile } from "./typescript-file.mjs";
|
|
3
3
|
import { createComponent, mergeProps } from "@alloy-js/core/jsx-runtime";
|
|
4
4
|
import { computed, splitProps } from "@alloy-js/core";
|
|
@@ -22,8 +22,8 @@ function EntryFile(props) {
|
|
|
22
22
|
"path",
|
|
23
23
|
"typeDefinition"
|
|
24
24
|
]);
|
|
25
|
-
const context =
|
|
26
|
-
const fullPath = computed(() => replacePath(`${!isSet(tsx) ? path : replaceExtension(path)}${hasFileExtension(path) && !isSet(tsx) ? "" : tsx ? ".tsx" : ".ts"}`, context
|
|
25
|
+
const context = usePowerlinesSafe();
|
|
26
|
+
const fullPath = computed(() => replacePath(`${!isSet(tsx) ? path : replaceExtension(path)}${hasFileExtension(path) && !isSet(tsx) ? "" : tsx ? ".tsx" : ".ts"}`, context?.entryPath || "entry"));
|
|
27
27
|
return createComponent(TypescriptFile, mergeProps(rest, {
|
|
28
28
|
get path() {
|
|
29
29
|
return fullPath.value;
|
|
@@ -84,6 +84,7 @@ function TSDocReflectionProperty(props) {
|
|
|
84
84
|
return context.getDescription();
|
|
85
85
|
} }, rest, { get children() {
|
|
86
86
|
return [(0, __alloy_js_core_jsx_runtime.createComponent)(require_typescript_components_tsdoc.TSDocAttributesTags, {
|
|
87
|
+
type: context,
|
|
87
88
|
get title() {
|
|
88
89
|
return context.getTitle();
|
|
89
90
|
},
|
|
@@ -107,6 +108,9 @@ function TSDocReflectionProperty(props) {
|
|
|
107
108
|
},
|
|
108
109
|
get hidden() {
|
|
109
110
|
return context.isHidden();
|
|
111
|
+
},
|
|
112
|
+
get defaultValue() {
|
|
113
|
+
return context.getDefaultValue();
|
|
110
114
|
}
|
|
111
115
|
}), (0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_core.Show, {
|
|
112
116
|
get when() {
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import { TSDocProps } from "./tsdoc.cjs";
|
|
2
|
-
import * as
|
|
2
|
+
import * as _alloy_js_core8 from "@alloy-js/core";
|
|
3
3
|
|
|
4
4
|
//#region src/typescript/components/tsdoc-reflection.d.ts
|
|
5
5
|
/**
|
|
6
6
|
* Generates a TypeScript interface property for the given reflection class.
|
|
7
7
|
*/
|
|
8
|
-
declare function TSDocReflectionClass<T extends Record<string, any> = Record<string, any>>(props: TSDocProps):
|
|
8
|
+
declare function TSDocReflectionClass<T extends Record<string, any> = Record<string, any>>(props: TSDocProps): _alloy_js_core8.Children;
|
|
9
9
|
/**
|
|
10
10
|
* Generates a TypeScript interface property for the given reflection class.
|
|
11
11
|
*/
|
|
12
|
-
declare function TSDocReflectionProperty(props: TSDocProps):
|
|
12
|
+
declare function TSDocReflectionProperty(props: TSDocProps): _alloy_js_core8.Children;
|
|
13
13
|
/**
|
|
14
14
|
* Generates a TypeScript interface property for the given reflection class.
|
|
15
15
|
*/
|
|
16
|
-
declare function TSDocReflectionMethod(props: TSDocProps):
|
|
16
|
+
declare function TSDocReflectionMethod(props: TSDocProps): _alloy_js_core8.Children;
|
|
17
17
|
//#endregion
|
|
18
18
|
export { TSDocReflectionClass, TSDocReflectionMethod, TSDocReflectionProperty };
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import { TSDocProps } from "./tsdoc.mjs";
|
|
2
|
-
import * as
|
|
2
|
+
import * as _alloy_js_core7 from "@alloy-js/core";
|
|
3
3
|
|
|
4
4
|
//#region src/typescript/components/tsdoc-reflection.d.ts
|
|
5
5
|
/**
|
|
6
6
|
* Generates a TypeScript interface property for the given reflection class.
|
|
7
7
|
*/
|
|
8
|
-
declare function TSDocReflectionClass<T extends Record<string, any> = Record<string, any>>(props: TSDocProps):
|
|
8
|
+
declare function TSDocReflectionClass<T extends Record<string, any> = Record<string, any>>(props: TSDocProps): _alloy_js_core7.Children;
|
|
9
9
|
/**
|
|
10
10
|
* Generates a TypeScript interface property for the given reflection class.
|
|
11
11
|
*/
|
|
12
|
-
declare function TSDocReflectionProperty(props: TSDocProps):
|
|
12
|
+
declare function TSDocReflectionProperty(props: TSDocProps): _alloy_js_core7.Children;
|
|
13
13
|
/**
|
|
14
14
|
* Generates a TypeScript interface property for the given reflection class.
|
|
15
15
|
*/
|
|
16
|
-
declare function TSDocReflectionMethod(props: TSDocProps):
|
|
16
|
+
declare function TSDocReflectionMethod(props: TSDocProps): _alloy_js_core7.Children;
|
|
17
17
|
//#endregion
|
|
18
18
|
export { TSDocReflectionClass, TSDocReflectionMethod, TSDocReflectionProperty };
|
|
@@ -83,6 +83,7 @@ function TSDocReflectionProperty(props) {
|
|
|
83
83
|
return context.getDescription();
|
|
84
84
|
} }, rest, { get children() {
|
|
85
85
|
return [createComponent(TSDocAttributesTags, {
|
|
86
|
+
type: context,
|
|
86
87
|
get title() {
|
|
87
88
|
return context.getTitle();
|
|
88
89
|
},
|
|
@@ -106,6 +107,9 @@ function TSDocReflectionProperty(props) {
|
|
|
106
107
|
},
|
|
107
108
|
get hidden() {
|
|
108
109
|
return context.isHidden();
|
|
110
|
+
},
|
|
111
|
+
get defaultValue() {
|
|
112
|
+
return context.getDefaultValue();
|
|
109
113
|
}
|
|
110
114
|
}), createComponent(Show, {
|
|
111
115
|
get when() {
|
|
@@ -146,18 +146,19 @@ function TSDocPermission(props) {
|
|
|
146
146
|
* Create a TSDoc `@defaultValue` tag.
|
|
147
147
|
*/
|
|
148
148
|
function TSDocDefaultValue(props) {
|
|
149
|
+
const [{ type, defaultValue }] = (0, __alloy_js_core.splitProps)(props, ["type", "defaultValue"]);
|
|
149
150
|
return [
|
|
150
151
|
"@defaultValue ",
|
|
151
152
|
(0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_core.Show, {
|
|
152
153
|
get when() {
|
|
153
|
-
return !(0, __stryke_type_checks_is_undefined.isUndefined)(
|
|
154
|
+
return !(0, __stryke_type_checks_is_undefined.isUndefined)(defaultValue);
|
|
154
155
|
},
|
|
155
156
|
get children() {
|
|
156
157
|
return (0, __alloy_js_core_jsx_runtime.createIntrinsic)("align", {
|
|
157
158
|
width: 2,
|
|
158
159
|
get children() {
|
|
159
160
|
return (0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_core.Prose, { get children() {
|
|
160
|
-
return (0, __powerlines_deepkit_utilities.stringifyDefaultValue)(
|
|
161
|
+
return (0, __powerlines_deepkit_utilities.stringifyDefaultValue)(type, defaultValue);
|
|
161
162
|
} });
|
|
162
163
|
}
|
|
163
164
|
});
|
|
@@ -247,7 +248,8 @@ function TSDocHidden() {
|
|
|
247
248
|
* Generates a TypeScript interface property for the given reflection class.
|
|
248
249
|
*/
|
|
249
250
|
function TSDocAttributesTags(props) {
|
|
250
|
-
const [{ title, alias, permission, domain, readonly, internal, ignore, hidden, defaultValue }] = (0, __alloy_js_core.splitProps)(props, [
|
|
251
|
+
const [{ type, title, alias, permission, domain, readonly, internal, ignore, hidden, defaultValue }] = (0, __alloy_js_core.splitProps)(props, [
|
|
252
|
+
"type",
|
|
251
253
|
"title",
|
|
252
254
|
"alias",
|
|
253
255
|
"permission",
|
|
@@ -323,10 +325,13 @@ function TSDocAttributesTags(props) {
|
|
|
323
325
|
}),
|
|
324
326
|
(0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_core.Show, {
|
|
325
327
|
get when() {
|
|
326
|
-
return !(0, __stryke_type_checks_is_undefined.isUndefined)(
|
|
328
|
+
return !(0, __stryke_type_checks_is_undefined.isUndefined)(type);
|
|
327
329
|
},
|
|
328
330
|
get children() {
|
|
329
|
-
return (0, __alloy_js_core_jsx_runtime.createComponent)(TSDocDefaultValue, {
|
|
331
|
+
return (0, __alloy_js_core_jsx_runtime.createComponent)(TSDocDefaultValue, {
|
|
332
|
+
type,
|
|
333
|
+
defaultValue
|
|
334
|
+
});
|
|
330
335
|
}
|
|
331
336
|
})
|
|
332
337
|
];
|
|
@@ -416,7 +421,7 @@ function TSDocModule(props) {
|
|
|
416
421
|
"name",
|
|
417
422
|
"prefix"
|
|
418
423
|
]);
|
|
419
|
-
const context = require_core_contexts_context.
|
|
424
|
+
const context = require_core_contexts_context.usePowerlinesSafe();
|
|
420
425
|
return [
|
|
421
426
|
"/**",
|
|
422
427
|
(0, __alloy_js_core_jsx_runtime.createIntrinsic)("align", {
|
|
@@ -442,7 +447,7 @@ function TSDocModule(props) {
|
|
|
442
447
|
}
|
|
443
448
|
}),
|
|
444
449
|
"@module ",
|
|
445
|
-
(0, __alloy_js_core_jsx_runtime.memo)(() => prefix || context?.config
|
|
450
|
+
(0, __alloy_js_core_jsx_runtime.memo)(() => prefix || context?.config?.output?.builtinPrefix || "powerlines"),
|
|
446
451
|
":",
|
|
447
452
|
name
|
|
448
453
|
];
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { ComponentProps } from "../../types/components.cjs";
|
|
2
2
|
import { Children } from "@alloy-js/core";
|
|
3
3
|
import { JSDocExampleProps, ParameterDescriptor } from "@alloy-js/typescript";
|
|
4
|
+
import { ReflectionKind, ReflectionParameter, ReflectionProperty } from "@powerlines/deepkit/vendor/type";
|
|
4
5
|
|
|
5
6
|
//#region src/typescript/components/tsdoc.d.ts
|
|
6
7
|
interface TSDocProps extends ComponentProps {
|
|
@@ -41,7 +42,8 @@ declare function TSDocAlias(props: ComponentProps): Children;
|
|
|
41
42
|
*/
|
|
42
43
|
declare function TSDocPermission(props: ComponentProps): Children;
|
|
43
44
|
interface TSDocDefaultValueProps extends ComponentProps {
|
|
44
|
-
|
|
45
|
+
type: ReflectionKind | ReflectionProperty | ReflectionParameter;
|
|
46
|
+
defaultValue: any;
|
|
45
47
|
}
|
|
46
48
|
/**
|
|
47
49
|
* Create a TSDoc `@defaultValue` tag.
|
|
@@ -84,6 +86,7 @@ declare function TSDocIgnore(): Children;
|
|
|
84
86
|
*/
|
|
85
87
|
declare function TSDocHidden(): Children;
|
|
86
88
|
interface TSDocAttributesTagsProps {
|
|
89
|
+
type?: ReflectionKind | ReflectionProperty | ReflectionParameter;
|
|
87
90
|
title?: string;
|
|
88
91
|
alias?: string[];
|
|
89
92
|
permission?: string[];
|
|
@@ -118,9 +121,17 @@ declare function TSDocReturns(props: ComponentProps): Children;
|
|
|
118
121
|
declare function TSDocThrows(props: ComponentProps): Children;
|
|
119
122
|
interface TSDocModuleProps extends ComponentProps {
|
|
120
123
|
/**
|
|
121
|
-
*
|
|
124
|
+
* The prefix for the builtin module name
|
|
122
125
|
*
|
|
123
|
-
* @
|
|
126
|
+
* @remarks
|
|
127
|
+
* This value is populated from the Powerlines configuration output builtin prefix by default.
|
|
128
|
+
*
|
|
129
|
+
* @example
|
|
130
|
+
* ```ts
|
|
131
|
+
* /**
|
|
132
|
+
* @module powerlines:my-module
|
|
133
|
+
* \/
|
|
134
|
+
* ```
|
|
124
135
|
*/
|
|
125
136
|
prefix?: string;
|
|
126
137
|
/**
|
|
@@ -131,7 +142,7 @@ interface TSDocModuleProps extends ComponentProps {
|
|
|
131
142
|
*
|
|
132
143
|
* @example
|
|
133
144
|
* ```ts
|
|
134
|
-
* import { MyModule } from "
|
|
145
|
+
* import { MyModule } from "powerlines:my-module";
|
|
135
146
|
* ```
|
|
136
147
|
*/
|
|
137
148
|
name: Children;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { ComponentProps } from "../../types/components.mjs";
|
|
2
2
|
import { Children } from "@alloy-js/core";
|
|
3
|
+
import { ReflectionKind, ReflectionParameter, ReflectionProperty } from "@powerlines/deepkit/vendor/type";
|
|
3
4
|
import { JSDocExampleProps, ParameterDescriptor } from "@alloy-js/typescript";
|
|
4
5
|
|
|
5
6
|
//#region src/typescript/components/tsdoc.d.ts
|
|
@@ -41,7 +42,8 @@ declare function TSDocAlias(props: ComponentProps): Children;
|
|
|
41
42
|
*/
|
|
42
43
|
declare function TSDocPermission(props: ComponentProps): Children;
|
|
43
44
|
interface TSDocDefaultValueProps extends ComponentProps {
|
|
44
|
-
|
|
45
|
+
type: ReflectionKind | ReflectionProperty | ReflectionParameter;
|
|
46
|
+
defaultValue: any;
|
|
45
47
|
}
|
|
46
48
|
/**
|
|
47
49
|
* Create a TSDoc `@defaultValue` tag.
|
|
@@ -84,6 +86,7 @@ declare function TSDocIgnore(): Children;
|
|
|
84
86
|
*/
|
|
85
87
|
declare function TSDocHidden(): Children;
|
|
86
88
|
interface TSDocAttributesTagsProps {
|
|
89
|
+
type?: ReflectionKind | ReflectionProperty | ReflectionParameter;
|
|
87
90
|
title?: string;
|
|
88
91
|
alias?: string[];
|
|
89
92
|
permission?: string[];
|
|
@@ -118,9 +121,17 @@ declare function TSDocReturns(props: ComponentProps): Children;
|
|
|
118
121
|
declare function TSDocThrows(props: ComponentProps): Children;
|
|
119
122
|
interface TSDocModuleProps extends ComponentProps {
|
|
120
123
|
/**
|
|
121
|
-
*
|
|
124
|
+
* The prefix for the builtin module name
|
|
122
125
|
*
|
|
123
|
-
* @
|
|
126
|
+
* @remarks
|
|
127
|
+
* This value is populated from the Powerlines configuration output builtin prefix by default.
|
|
128
|
+
*
|
|
129
|
+
* @example
|
|
130
|
+
* ```ts
|
|
131
|
+
* /**
|
|
132
|
+
* @module powerlines:my-module
|
|
133
|
+
* \/
|
|
134
|
+
* ```
|
|
124
135
|
*/
|
|
125
136
|
prefix?: string;
|
|
126
137
|
/**
|
|
@@ -131,7 +142,7 @@ interface TSDocModuleProps extends ComponentProps {
|
|
|
131
142
|
*
|
|
132
143
|
* @example
|
|
133
144
|
* ```ts
|
|
134
|
-
* import { MyModule } from "
|
|
145
|
+
* import { MyModule } from "powerlines:my-module";
|
|
135
146
|
* ```
|
|
136
147
|
*/
|
|
137
148
|
name: Children;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { usePowerlinesSafe } from "../../core/contexts/context.mjs";
|
|
2
2
|
import { createComponent, createIntrinsic, memo, mergeProps } from "@alloy-js/core/jsx-runtime";
|
|
3
3
|
import { For, List, Prose, Show, childrenArray, splitProps } from "@alloy-js/core";
|
|
4
4
|
import { stringifyDefaultValue } from "@powerlines/deepkit/utilities";
|
|
@@ -145,18 +145,19 @@ function TSDocPermission(props) {
|
|
|
145
145
|
* Create a TSDoc `@defaultValue` tag.
|
|
146
146
|
*/
|
|
147
147
|
function TSDocDefaultValue(props) {
|
|
148
|
+
const [{ type, defaultValue }] = splitProps(props, ["type", "defaultValue"]);
|
|
148
149
|
return [
|
|
149
150
|
"@defaultValue ",
|
|
150
151
|
createComponent(Show, {
|
|
151
152
|
get when() {
|
|
152
|
-
return !isUndefined(
|
|
153
|
+
return !isUndefined(defaultValue);
|
|
153
154
|
},
|
|
154
155
|
get children() {
|
|
155
156
|
return createIntrinsic("align", {
|
|
156
157
|
width: 2,
|
|
157
158
|
get children() {
|
|
158
159
|
return createComponent(Prose, { get children() {
|
|
159
|
-
return stringifyDefaultValue(
|
|
160
|
+
return stringifyDefaultValue(type, defaultValue);
|
|
160
161
|
} });
|
|
161
162
|
}
|
|
162
163
|
});
|
|
@@ -246,7 +247,8 @@ function TSDocHidden() {
|
|
|
246
247
|
* Generates a TypeScript interface property for the given reflection class.
|
|
247
248
|
*/
|
|
248
249
|
function TSDocAttributesTags(props) {
|
|
249
|
-
const [{ title, alias, permission, domain, readonly, internal, ignore, hidden, defaultValue }] = splitProps(props, [
|
|
250
|
+
const [{ type, title, alias, permission, domain, readonly, internal, ignore, hidden, defaultValue }] = splitProps(props, [
|
|
251
|
+
"type",
|
|
250
252
|
"title",
|
|
251
253
|
"alias",
|
|
252
254
|
"permission",
|
|
@@ -322,10 +324,13 @@ function TSDocAttributesTags(props) {
|
|
|
322
324
|
}),
|
|
323
325
|
createComponent(Show, {
|
|
324
326
|
get when() {
|
|
325
|
-
return !isUndefined(
|
|
327
|
+
return !isUndefined(type);
|
|
326
328
|
},
|
|
327
329
|
get children() {
|
|
328
|
-
return createComponent(TSDocDefaultValue, {
|
|
330
|
+
return createComponent(TSDocDefaultValue, {
|
|
331
|
+
type,
|
|
332
|
+
defaultValue
|
|
333
|
+
});
|
|
329
334
|
}
|
|
330
335
|
})
|
|
331
336
|
];
|
|
@@ -415,7 +420,7 @@ function TSDocModule(props) {
|
|
|
415
420
|
"name",
|
|
416
421
|
"prefix"
|
|
417
422
|
]);
|
|
418
|
-
const context =
|
|
423
|
+
const context = usePowerlinesSafe();
|
|
419
424
|
return [
|
|
420
425
|
"/**",
|
|
421
426
|
createIntrinsic("align", {
|
|
@@ -441,7 +446,7 @@ function TSDocModule(props) {
|
|
|
441
446
|
}
|
|
442
447
|
}),
|
|
443
448
|
"@module ",
|
|
444
|
-
memo(() => prefix || context?.config
|
|
449
|
+
memo(() => prefix || context?.config?.output?.builtinPrefix || "powerlines"),
|
|
445
450
|
":",
|
|
446
451
|
name
|
|
447
452
|
];
|
|
@@ -72,7 +72,7 @@ function TypescriptFile(props) {
|
|
|
72
72
|
*/
|
|
73
73
|
function TypescriptFileHeader(props) {
|
|
74
74
|
const { header, hashbang, disableEslint = true, disableBiome = true, disablePrettier = false, children } = props;
|
|
75
|
-
const context = require_core_contexts_context.
|
|
75
|
+
const context = require_core_contexts_context.usePowerlinesSafe();
|
|
76
76
|
return [
|
|
77
77
|
(0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_core.Show, {
|
|
78
78
|
get when() {
|
|
@@ -138,7 +138,7 @@ function TypescriptFileHeader(props) {
|
|
|
138
138
|
}
|
|
139
139
|
}),
|
|
140
140
|
(0, __alloy_js_core_jsx_runtime.createComponent)(require_core_components_single_line_comment.SingleLineComment, { get children() {
|
|
141
|
-
return __alloy_js_core.code`Generated by ${(0, __stryke_string_format_title_case.titleCase)(context?.config
|
|
141
|
+
return __alloy_js_core.code`Generated by ${(0, __stryke_string_format_title_case.titleCase)(context?.config?.framework) || "Powerlines"}`;
|
|
142
142
|
} }),
|
|
143
143
|
(0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
|
|
144
144
|
(0, __alloy_js_core_jsx_runtime.createComponent)(require_core_components_single_line_comment.SingleLineComment, { children: __alloy_js_core.code`NOTE: Do not edit this file manually - it will be overwritten automatically by the "prepare" command` }),
|
|
@@ -153,7 +153,7 @@ function TypescriptFileHeader(props) {
|
|
|
153
153
|
*/
|
|
154
154
|
function TypescriptFileHeaderImports(props) {
|
|
155
155
|
const { imports, builtinImports } = props;
|
|
156
|
-
const context = require_core_contexts_context.
|
|
156
|
+
const context = require_core_contexts_context.usePowerlinesSafe();
|
|
157
157
|
const sourceFile = (0, __alloy_js_typescript.useSourceFile)();
|
|
158
158
|
const scope = props.scope ?? sourceFile.scope;
|
|
159
159
|
return (0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_core.Show, {
|
|
@@ -186,7 +186,7 @@ function TypescriptFileHeaderImports(props) {
|
|
|
186
186
|
get each() {
|
|
187
187
|
return Object.entries(builtinImports ?? {});
|
|
188
188
|
},
|
|
189
|
-
children: ([builtinModule, builtinImports$1]) => __alloy_js_core.code`import ${builtinImports$1 === null ? "" : (0, __stryke_type_checks_is_string.isString)(builtinImports$1) ? builtinImports$1 : ` ${builtinImports$1.filter((i) => !(0, __stryke_type_checks_is_string.isString)(i) && i.default).map((i) => i.alias ? i.alias : i.name).join(", ") + (builtinImports$1.filter((i) => !(0, __stryke_type_checks_is_string.isString)(i) && i.default).length > 0 && builtinImports$1.filter((i) => (0, __stryke_type_checks_is_string.isString)(i) || !i.default).length > 0 ? ", " : "") + (builtinImports$1.filter((i) => (0, __stryke_type_checks_is_string.isString)(i) || !i.default).length > 0 ? `{ ${builtinImports$1.map((i) => (0, __stryke_type_checks_is_string.isString)(i) ? i : i.alias ? `${i.name} as ${i.alias}` : i.name).join(", ")} }` : "")} `} from "${builtinModule.includes(":") ? builtinModule : `${context
|
|
189
|
+
children: ([builtinModule, builtinImports$1]) => __alloy_js_core.code`import ${builtinImports$1 === null ? "" : (0, __stryke_type_checks_is_string.isString)(builtinImports$1) ? builtinImports$1 : ` ${builtinImports$1.filter((i) => !(0, __stryke_type_checks_is_string.isString)(i) && i.default).map((i) => i.alias ? i.alias : i.name).join(", ") + (builtinImports$1.filter((i) => !(0, __stryke_type_checks_is_string.isString)(i) && i.default).length > 0 && builtinImports$1.filter((i) => (0, __stryke_type_checks_is_string.isString)(i) || !i.default).length > 0 ? ", " : "") + (builtinImports$1.filter((i) => (0, __stryke_type_checks_is_string.isString)(i) || !i.default).length > 0 ? `{ ${builtinImports$1.map((i) => (0, __stryke_type_checks_is_string.isString)(i) ? i : i.alias ? `${i.name} as ${i.alias}` : i.name).join(", ")} }` : "")} `} from "${builtinModule.includes(":") ? builtinModule : `${context?.config?.output?.builtinPrefix || "powerlines"}:${builtinModule}`}";`
|
|
190
190
|
});
|
|
191
191
|
}
|
|
192
192
|
}),
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { usePowerlinesSafe } from "../../core/contexts/context.mjs";
|
|
2
2
|
import { SingleLineComment } from "../../core/components/single-line-comment.mjs";
|
|
3
3
|
import { SourceFile } from "../../core/components/source-file.mjs";
|
|
4
4
|
import { createComponent, createIntrinsic, memo, mergeProps } from "@alloy-js/core/jsx-runtime";
|
|
@@ -71,7 +71,7 @@ function TypescriptFile(props) {
|
|
|
71
71
|
*/
|
|
72
72
|
function TypescriptFileHeader(props) {
|
|
73
73
|
const { header, hashbang, disableEslint = true, disableBiome = true, disablePrettier = false, children } = props;
|
|
74
|
-
const context =
|
|
74
|
+
const context = usePowerlinesSafe();
|
|
75
75
|
return [
|
|
76
76
|
createComponent(Show, {
|
|
77
77
|
get when() {
|
|
@@ -137,7 +137,7 @@ function TypescriptFileHeader(props) {
|
|
|
137
137
|
}
|
|
138
138
|
}),
|
|
139
139
|
createComponent(SingleLineComment, { get children() {
|
|
140
|
-
return code`Generated by ${titleCase(context?.config
|
|
140
|
+
return code`Generated by ${titleCase(context?.config?.framework) || "Powerlines"}`;
|
|
141
141
|
} }),
|
|
142
142
|
createIntrinsic("hbr", {}),
|
|
143
143
|
createComponent(SingleLineComment, { children: code`NOTE: Do not edit this file manually - it will be overwritten automatically by the "prepare" command` }),
|
|
@@ -152,7 +152,7 @@ function TypescriptFileHeader(props) {
|
|
|
152
152
|
*/
|
|
153
153
|
function TypescriptFileHeaderImports(props) {
|
|
154
154
|
const { imports, builtinImports } = props;
|
|
155
|
-
const context =
|
|
155
|
+
const context = usePowerlinesSafe();
|
|
156
156
|
const sourceFile = useSourceFile();
|
|
157
157
|
const scope = props.scope ?? sourceFile.scope;
|
|
158
158
|
return createComponent(Show, {
|
|
@@ -185,7 +185,7 @@ function TypescriptFileHeaderImports(props) {
|
|
|
185
185
|
get each() {
|
|
186
186
|
return Object.entries(builtinImports ?? {});
|
|
187
187
|
},
|
|
188
|
-
children: ([builtinModule, builtinImports$1]) => code`import ${builtinImports$1 === null ? "" : isString(builtinImports$1) ? builtinImports$1 : ` ${builtinImports$1.filter((i) => !isString(i) && i.default).map((i) => i.alias ? i.alias : i.name).join(", ") + (builtinImports$1.filter((i) => !isString(i) && i.default).length > 0 && builtinImports$1.filter((i) => isString(i) || !i.default).length > 0 ? ", " : "") + (builtinImports$1.filter((i) => isString(i) || !i.default).length > 0 ? `{ ${builtinImports$1.map((i) => isString(i) ? i : i.alias ? `${i.name} as ${i.alias}` : i.name).join(", ")} }` : "")} `} from "${builtinModule.includes(":") ? builtinModule : `${context
|
|
188
|
+
children: ([builtinModule, builtinImports$1]) => code`import ${builtinImports$1 === null ? "" : isString(builtinImports$1) ? builtinImports$1 : ` ${builtinImports$1.filter((i) => !isString(i) && i.default).map((i) => i.alias ? i.alias : i.name).join(", ") + (builtinImports$1.filter((i) => !isString(i) && i.default).length > 0 && builtinImports$1.filter((i) => isString(i) || !i.default).length > 0 ? ", " : "") + (builtinImports$1.filter((i) => isString(i) || !i.default).length > 0 ? `{ ${builtinImports$1.map((i) => isString(i) ? i : i.alias ? `${i.name} as ${i.alias}` : i.name).join(", ")} }` : "")} `} from "${builtinModule.includes(":") ? builtinModule : `${context?.config?.output?.builtinPrefix || "powerlines"}:${builtinModule}`}";`
|
|
189
189
|
});
|
|
190
190
|
}
|
|
191
191
|
}),
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ComponentProps } from "../../types/components.cjs";
|
|
2
|
-
import * as
|
|
2
|
+
import * as _alloy_js_core6 from "@alloy-js/core";
|
|
3
3
|
import { InterfaceDeclarationProps, InterfaceMemberProps } from "@alloy-js/typescript";
|
|
4
4
|
import { ReflectionClass, ReflectionProperty } from "@powerlines/deepkit/vendor/type";
|
|
5
5
|
|
|
@@ -14,11 +14,11 @@ interface TypescriptInterfacePropertyProps extends Omit<InterfaceMemberProps, "n
|
|
|
14
14
|
/**
|
|
15
15
|
* Generates a TypeScript interface for the given reflection class.
|
|
16
16
|
*/
|
|
17
|
-
declare function TypeScriptInterface<T extends Record<string, any> = Record<string, any>>(props: TypeScriptInterfaceProps<T>):
|
|
17
|
+
declare function TypeScriptInterface<T extends Record<string, any> = Record<string, any>>(props: TypeScriptInterfaceProps<T>): _alloy_js_core6.Children;
|
|
18
18
|
/**
|
|
19
19
|
* Generates a TypeScript interface property for the given reflection class.
|
|
20
20
|
*/
|
|
21
|
-
declare function TypescriptInterfaceProperty(props: TypescriptInterfacePropertyProps):
|
|
21
|
+
declare function TypescriptInterfaceProperty(props: TypescriptInterfacePropertyProps): _alloy_js_core6.Children;
|
|
22
22
|
declare type __ΩTypeScriptInterfaceProps = any[];
|
|
23
23
|
declare type __ΩTypescriptInterfacePropertyProps = any[];
|
|
24
24
|
//#endregion
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ComponentProps } from "../../types/components.mjs";
|
|
2
|
-
import * as
|
|
2
|
+
import * as _alloy_js_core12 from "@alloy-js/core";
|
|
3
3
|
import { ReflectionClass, ReflectionProperty } from "@powerlines/deepkit/vendor/type";
|
|
4
4
|
import { InterfaceDeclarationProps, InterfaceMemberProps } from "@alloy-js/typescript";
|
|
5
5
|
|
|
@@ -14,11 +14,11 @@ interface TypescriptInterfacePropertyProps extends Omit<InterfaceMemberProps, "n
|
|
|
14
14
|
/**
|
|
15
15
|
* Generates a TypeScript interface for the given reflection class.
|
|
16
16
|
*/
|
|
17
|
-
declare function TypeScriptInterface<T extends Record<string, any> = Record<string, any>>(props: TypeScriptInterfaceProps<T>):
|
|
17
|
+
declare function TypeScriptInterface<T extends Record<string, any> = Record<string, any>>(props: TypeScriptInterfaceProps<T>): _alloy_js_core12.Children;
|
|
18
18
|
/**
|
|
19
19
|
* Generates a TypeScript interface property for the given reflection class.
|
|
20
20
|
*/
|
|
21
|
-
declare function TypescriptInterfaceProperty(props: TypescriptInterfacePropertyProps):
|
|
21
|
+
declare function TypescriptInterfaceProperty(props: TypescriptInterfacePropertyProps): _alloy_js_core12.Children;
|
|
22
22
|
declare type __ΩTypeScriptInterfaceProps = any[];
|
|
23
23
|
declare type __ΩTypescriptInterfacePropertyProps = any[];
|
|
24
24
|
//#endregion
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ComponentProps } from "../../types/components.cjs";
|
|
2
|
-
import * as
|
|
2
|
+
import * as _alloy_js_core4 from "@alloy-js/core";
|
|
3
3
|
import { VarDeclarationProps } from "@alloy-js/typescript";
|
|
4
4
|
import { ReflectionClass, ReflectionProperty } from "@powerlines/deepkit/vendor/type";
|
|
5
5
|
import { ComputedRef } from "@vue/reactivity";
|
|
@@ -15,11 +15,11 @@ interface TypescriptObjectPropertyProps extends ComponentProps {
|
|
|
15
15
|
/**
|
|
16
16
|
* Generates a TypeScript object for the given reflection class.
|
|
17
17
|
*/
|
|
18
|
-
declare function TypescriptObject<T extends Record<string, any> = Record<string, any>>(props: TypescriptObjectProps<T>):
|
|
18
|
+
declare function TypescriptObject<T extends Record<string, any> = Record<string, any>>(props: TypescriptObjectProps<T>): _alloy_js_core4.Children;
|
|
19
19
|
/**
|
|
20
20
|
* Generates a TypeScript object property for the given reflection class.
|
|
21
21
|
*/
|
|
22
|
-
declare function TypescriptObjectProperty(props: TypescriptObjectPropertyProps):
|
|
22
|
+
declare function TypescriptObjectProperty(props: TypescriptObjectPropertyProps): _alloy_js_core4.Children;
|
|
23
23
|
declare type __ΩTypescriptObjectProps = any[];
|
|
24
24
|
declare type __ΩTypescriptObjectPropertyProps = any[];
|
|
25
25
|
//#endregion
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ComponentProps } from "../../types/components.mjs";
|
|
2
|
-
import * as
|
|
2
|
+
import * as _alloy_js_core14 from "@alloy-js/core";
|
|
3
3
|
import { ReflectionClass, ReflectionProperty } from "@powerlines/deepkit/vendor/type";
|
|
4
4
|
import { VarDeclarationProps } from "@alloy-js/typescript";
|
|
5
5
|
import { ComputedRef } from "@vue/reactivity";
|
|
@@ -15,11 +15,11 @@ interface TypescriptObjectPropertyProps extends ComponentProps {
|
|
|
15
15
|
/**
|
|
16
16
|
* Generates a TypeScript object for the given reflection class.
|
|
17
17
|
*/
|
|
18
|
-
declare function TypescriptObject<T extends Record<string, any> = Record<string, any>>(props: TypescriptObjectProps<T>):
|
|
18
|
+
declare function TypescriptObject<T extends Record<string, any> = Record<string, any>>(props: TypescriptObjectProps<T>): _alloy_js_core14.Children;
|
|
19
19
|
/**
|
|
20
20
|
* Generates a TypeScript object property for the given reflection class.
|
|
21
21
|
*/
|
|
22
|
-
declare function TypescriptObjectProperty(props: TypescriptObjectPropertyProps):
|
|
22
|
+
declare function TypescriptObjectProperty(props: TypescriptObjectPropertyProps): _alloy_js_core14.Children;
|
|
23
23
|
declare type __ΩTypescriptObjectProps = any[];
|
|
24
24
|
declare type __ΩTypescriptObjectPropertyProps = any[];
|
|
25
25
|
//#endregion
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@powerlines/plugin-alloy",
|
|
3
|
-
"version": "0.18.
|
|
3
|
+
"version": "0.18.22",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "A package containing various Alloy framework components and helper utilities.",
|
|
6
6
|
"repository": {
|
|
@@ -360,7 +360,7 @@
|
|
|
360
360
|
"@alloy-js/markdown": "^0.22.0",
|
|
361
361
|
"@alloy-js/rollup-plugin": "^0.1.0",
|
|
362
362
|
"@alloy-js/typescript": "^0.22.0",
|
|
363
|
-
"@powerlines/deepkit": "^0.5.
|
|
363
|
+
"@powerlines/deepkit": "^0.5.55",
|
|
364
364
|
"@storm-software/config-tools": "^1.188.75",
|
|
365
365
|
"@stryke/capnp": "^0.12.52",
|
|
366
366
|
"@stryke/convert": "^0.6.30",
|
|
@@ -373,13 +373,13 @@
|
|
|
373
373
|
"@stryke/types": "^0.10.29",
|
|
374
374
|
"@stryke/unique-id": "^0.3.38",
|
|
375
375
|
"defu": "^6.1.4",
|
|
376
|
-
"powerlines": "^0.37.
|
|
376
|
+
"powerlines": "^0.37.13",
|
|
377
377
|
"prettier": "^3.7.4"
|
|
378
378
|
},
|
|
379
379
|
"devDependencies": {
|
|
380
|
-
"@powerlines/plugin-plugin": "^0.12.
|
|
380
|
+
"@powerlines/plugin-plugin": "^0.12.91",
|
|
381
381
|
"@types/node": "^24.10.4"
|
|
382
382
|
},
|
|
383
383
|
"publishConfig": { "access": "public" },
|
|
384
|
-
"gitHead": "
|
|
384
|
+
"gitHead": "89197ee86a51c3310c3a6a7062dcbccba969583d"
|
|
385
385
|
}
|