@powerlines/plugin-alloy 0.18.7 → 0.18.9
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/index.cjs +12 -5
- package/dist/index.mjs +12 -5
- package/dist/markdown/components/markdown-file.d.cts +3 -3
- package/dist/markdown/components/markdown-table.d.cts +4 -4
- package/dist/markdown/components/markdown-table.d.mts +4 -4
- package/dist/powerlines/src/internal/helpers/hooks.d.cts +47 -0
- package/dist/powerlines/src/internal/helpers/hooks.d.mts +47 -0
- package/dist/powerlines/src/types/api.d.cts +104 -0
- package/dist/powerlines/src/types/api.d.mts +104 -0
- package/dist/powerlines/src/types/build.d.cts +43 -3
- package/dist/powerlines/src/types/build.d.mts +43 -3
- package/dist/powerlines/src/types/config.d.cts +60 -4
- package/dist/powerlines/src/types/config.d.mts +60 -4
- package/dist/powerlines/src/types/context.d.cts +113 -1
- package/dist/powerlines/src/types/context.d.mts +113 -1
- package/dist/powerlines/src/types/hooks.d.cts +32 -0
- package/dist/powerlines/src/types/hooks.d.mts +32 -0
- package/dist/powerlines/src/types/plugin.d.cts +35 -61
- package/dist/powerlines/src/types/plugin.d.mts +35 -61
- package/dist/powerlines/src/types/resolved.d.cts +16 -4
- package/dist/powerlines/src/types/resolved.d.mts +16 -4
- package/dist/powerlines/src/types/unplugin.d.cts +22 -0
- package/dist/powerlines/src/types/unplugin.d.mts +22 -0
- package/dist/types/components.d.cts +1 -3
- package/dist/types/components.d.mts +1 -3
- package/dist/typescript/components/builtin-file.d.cts +2 -2
- package/dist/typescript/components/builtin-file.d.mts +2 -2
- 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.d.cts +2 -2
- package/dist/typescript/components/tsdoc-reflection.d.cts +4 -4
- package/dist/typescript/components/typescript-file.cjs +16 -10
- package/dist/typescript/components/typescript-file.d.cts +2 -0
- package/dist/typescript/components/typescript-file.d.mts +2 -0
- package/dist/typescript/components/typescript-file.mjs +16 -10
- 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
|
@@ -8,6 +8,7 @@ type TypescriptFileProps = Omit<SourceFileProps$1, "filetype"> & ComponentProps
|
|
|
8
8
|
hashbang?: Children | true;
|
|
9
9
|
header?: Children;
|
|
10
10
|
imports?: TypescriptFileImports;
|
|
11
|
+
builtinImports?: TypescriptFileImports;
|
|
11
12
|
export?: boolean | string;
|
|
12
13
|
tsx?: boolean;
|
|
13
14
|
};
|
|
@@ -31,6 +32,7 @@ interface TypescriptFileHeaderProps extends SourceFileHeaderProps {
|
|
|
31
32
|
declare function TypescriptFileHeader(props: TypescriptFileHeaderProps): Children;
|
|
32
33
|
interface TypescriptFileHeaderImportsProps extends SourceFileHeaderProps {
|
|
33
34
|
imports?: TypescriptFileImports;
|
|
35
|
+
builtinImports?: TypescriptFileImports;
|
|
34
36
|
scope?: TSModuleScope;
|
|
35
37
|
}
|
|
36
38
|
/**
|
|
@@ -8,6 +8,7 @@ type TypescriptFileProps = Omit<SourceFileProps$1, "filetype"> & ComponentProps
|
|
|
8
8
|
hashbang?: Children | true;
|
|
9
9
|
header?: Children;
|
|
10
10
|
imports?: TypescriptFileImports;
|
|
11
|
+
builtinImports?: TypescriptFileImports;
|
|
11
12
|
export?: boolean | string;
|
|
12
13
|
tsx?: boolean;
|
|
13
14
|
};
|
|
@@ -31,6 +32,7 @@ interface TypescriptFileHeaderProps extends SourceFileHeaderProps {
|
|
|
31
32
|
declare function TypescriptFileHeader(props: TypescriptFileHeaderProps): Children;
|
|
32
33
|
interface TypescriptFileHeaderImportsProps extends SourceFileHeaderProps {
|
|
33
34
|
imports?: TypescriptFileImports;
|
|
35
|
+
builtinImports?: TypescriptFileImports;
|
|
34
36
|
scope?: TSModuleScope;
|
|
35
37
|
}
|
|
36
38
|
/**
|
|
@@ -151,13 +151,13 @@ function TypescriptFileHeader(props) {
|
|
|
151
151
|
* @returns The rendered source file header.
|
|
152
152
|
*/
|
|
153
153
|
function TypescriptFileHeaderImports(props) {
|
|
154
|
-
const { imports } = props;
|
|
154
|
+
const { imports, builtinImports } = props;
|
|
155
155
|
const context = usePowerlines();
|
|
156
156
|
const sourceFile = useSourceFile();
|
|
157
157
|
const scope = props.scope ?? sourceFile.scope;
|
|
158
158
|
return createComponent(Show, {
|
|
159
159
|
get when() {
|
|
160
|
-
return scope.importedModules.size > 0 || !!imports && Object.keys(imports).length > 0;
|
|
160
|
+
return scope.importedModules.size > 0 || !!builtinImports && Object.keys(builtinImports).length > 0 || !!imports && Object.keys(imports).length > 0;
|
|
161
161
|
},
|
|
162
162
|
get children() {
|
|
163
163
|
return [
|
|
@@ -170,19 +170,25 @@ function TypescriptFileHeaderImports(props) {
|
|
|
170
170
|
get each() {
|
|
171
171
|
return Object.entries(imports ?? {});
|
|
172
172
|
},
|
|
173
|
-
children: ([module,
|
|
174
|
-
if (module === "$builtins") return createComponent(For, {
|
|
175
|
-
get each() {
|
|
176
|
-
return Object.entries(imported ?? {});
|
|
177
|
-
},
|
|
178
|
-
children: ([builtinModule, builtinImports]) => code`import ${builtinImports === null ? "" : ` from ${builtinImports.filter((i) => !isString(i) && i.default).map((i) => i.alias ? i.alias : i.name).join(", ") + (builtinImports.filter((i) => !isString(i) && i.default).length > 0 && builtinImports.filter((i) => isString(i) || !i.default).length > 0 ? ", " : "") + (builtinImports.filter((i) => isString(i) || !i.default).length > 0 ? `{ ${builtinImports.map((i) => isString(i) ? i : i.alias ? `${i.name} as ${i.alias}` : i.name).join(", ")} }` : "")} `} "${builtinModule.includes(":") ? builtinModule : `${context.config.output.builtinPrefix}:${builtinModule}`}";`
|
|
179
|
-
});
|
|
180
|
-
const normalImports = imported;
|
|
173
|
+
children: ([module, normalImports]) => {
|
|
181
174
|
return code`import ${normalImports === null ? "" : ` from ${normalImports.filter((i) => !isString(i) && i.default).map((i) => i.alias ? i.alias : i.name).join(", ") + (normalImports.filter((i) => !isString(i) && i.default).length > 0 && normalImports.filter((i) => isString(i) || !i.default).length > 0 ? ", " : "") + (normalImports.filter((i) => isString(i) || !i.default).length > 0 ? `{ ${normalImports.map((i) => isString(i) ? i : i.alias ? `${i.name} as ${i.alias}` : i.name).join(", ")} }` : "")} `} "${module}";`;
|
|
182
175
|
}
|
|
183
176
|
});
|
|
184
177
|
}
|
|
185
178
|
}),
|
|
179
|
+
createComponent(Show, {
|
|
180
|
+
get when() {
|
|
181
|
+
return builtinImports && Object.keys(builtinImports).length > 0;
|
|
182
|
+
},
|
|
183
|
+
get children() {
|
|
184
|
+
return createComponent(For, {
|
|
185
|
+
get each() {
|
|
186
|
+
return Object.entries(builtinImports ?? {});
|
|
187
|
+
},
|
|
188
|
+
children: ([builtinModule, builtinImports$1]) => code`import ${builtinImports$1 === null ? "" : ` from ${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(", ")} }` : "")} `} "${builtinModule.includes(":") ? builtinModule : `${context.config.output.builtinPrefix}:${builtinModule}`}";`
|
|
189
|
+
});
|
|
190
|
+
}
|
|
191
|
+
}),
|
|
186
192
|
createComponent(Show, {
|
|
187
193
|
get when() {
|
|
188
194
|
return scope.importedModules.size > 0;
|
|
@@ -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 { 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_core4.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_core4.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_core9 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_core9.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_core9.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_core13 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_core13.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_core13.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_core7 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_core7.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_core7.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.9",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "A package containing various Alloy framework components and helper utilities.",
|
|
6
6
|
"repository": {
|
|
@@ -360,8 +360,8 @@
|
|
|
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.
|
|
364
|
-
"@powerlines/plugin-plugin": "^0.12.
|
|
363
|
+
"@powerlines/deepkit": "^0.5.42",
|
|
364
|
+
"@powerlines/plugin-plugin": "^0.12.79",
|
|
365
365
|
"@storm-software/config-tools": "^1.188.75",
|
|
366
366
|
"@stryke/capnp": "^0.12.52",
|
|
367
367
|
"@stryke/convert": "^0.6.30",
|
|
@@ -374,10 +374,10 @@
|
|
|
374
374
|
"@stryke/types": "^0.10.29",
|
|
375
375
|
"@stryke/unique-id": "^0.3.38",
|
|
376
376
|
"defu": "^6.1.4",
|
|
377
|
-
"powerlines": "^0.
|
|
377
|
+
"powerlines": "^0.37.1",
|
|
378
378
|
"prettier": "^3.7.4"
|
|
379
379
|
},
|
|
380
380
|
"devDependencies": { "@types/node": "^24.10.4" },
|
|
381
381
|
"publishConfig": { "access": "public" },
|
|
382
|
-
"gitHead": "
|
|
382
|
+
"gitHead": "de1cf37aba4595c9b10fbe4e26a87f8609d2ad1f"
|
|
383
383
|
}
|