@powerlines/plugin-alloy 0.18.7 → 0.18.8

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.
Files changed (46) hide show
  1. package/dist/core/components/output.d.cts +2 -2
  2. package/dist/core/components/output.d.mts +2 -2
  3. package/dist/core/components/single-line-comment.d.cts +2 -2
  4. package/dist/core/components/single-line-comment.d.mts +2 -2
  5. package/dist/index.cjs +12 -5
  6. package/dist/index.mjs +12 -5
  7. package/dist/markdown/components/markdown-file.d.cts +3 -3
  8. package/dist/markdown/components/markdown-file.d.mts +3 -3
  9. package/dist/markdown/components/markdown-table.d.cts +4 -4
  10. package/dist/markdown/components/markdown-table.d.mts +4 -4
  11. package/dist/powerlines/src/internal/helpers/hooks.d.cts +47 -0
  12. package/dist/powerlines/src/internal/helpers/hooks.d.mts +47 -0
  13. package/dist/powerlines/src/types/api.d.cts +104 -0
  14. package/dist/powerlines/src/types/api.d.mts +104 -0
  15. package/dist/powerlines/src/types/build.d.cts +43 -3
  16. package/dist/powerlines/src/types/build.d.mts +43 -3
  17. package/dist/powerlines/src/types/config.d.cts +60 -4
  18. package/dist/powerlines/src/types/config.d.mts +60 -4
  19. package/dist/powerlines/src/types/context.d.cts +113 -1
  20. package/dist/powerlines/src/types/context.d.mts +113 -1
  21. package/dist/powerlines/src/types/hooks.d.cts +32 -0
  22. package/dist/powerlines/src/types/hooks.d.mts +32 -0
  23. package/dist/powerlines/src/types/plugin.d.cts +35 -61
  24. package/dist/powerlines/src/types/plugin.d.mts +35 -61
  25. package/dist/powerlines/src/types/resolved.d.cts +16 -4
  26. package/dist/powerlines/src/types/resolved.d.mts +16 -4
  27. package/dist/powerlines/src/types/unplugin.d.cts +22 -0
  28. package/dist/powerlines/src/types/unplugin.d.mts +22 -0
  29. package/dist/types/components.d.cts +1 -3
  30. package/dist/types/components.d.mts +1 -3
  31. package/dist/typescript/components/builtin-file.d.cts +2 -2
  32. package/dist/typescript/components/dynamic-import-statement.d.cts +2 -2
  33. package/dist/typescript/components/dynamic-import-statement.d.mts +2 -2
  34. package/dist/typescript/components/entry-file.d.cts +2 -2
  35. package/dist/typescript/components/entry-file.d.mts +2 -2
  36. package/dist/typescript/components/tsdoc-reflection.d.cts +4 -4
  37. package/dist/typescript/components/tsdoc-reflection.d.mts +4 -4
  38. package/dist/typescript/components/typescript-file.cjs +16 -10
  39. package/dist/typescript/components/typescript-file.d.cts +2 -0
  40. package/dist/typescript/components/typescript-file.d.mts +2 -0
  41. package/dist/typescript/components/typescript-file.mjs +16 -10
  42. package/dist/typescript/components/typescript-interface.d.cts +3 -3
  43. package/dist/typescript/components/typescript-interface.d.mts +3 -3
  44. package/dist/typescript/components/typescript-object.d.cts +3 -3
  45. package/dist/typescript/components/typescript-object.d.mts +3 -3
  46. package/package.json +5 -5
@@ -152,13 +152,13 @@ function TypescriptFileHeader(props) {
152
152
  * @returns The rendered source file header.
153
153
  */
154
154
  function TypescriptFileHeaderImports(props) {
155
- const { imports } = props;
155
+ const { imports, builtinImports } = props;
156
156
  const context = require_core_contexts_context.usePowerlines();
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, {
160
160
  get when() {
161
- return scope.importedModules.size > 0 || !!imports && Object.keys(imports).length > 0;
161
+ return scope.importedModules.size > 0 || !!builtinImports && Object.keys(builtinImports).length > 0 || !!imports && Object.keys(imports).length > 0;
162
162
  },
163
163
  get children() {
164
164
  return [
@@ -171,19 +171,25 @@ function TypescriptFileHeaderImports(props) {
171
171
  get each() {
172
172
  return Object.entries(imports ?? {});
173
173
  },
174
- children: ([module$1, imported]) => {
175
- if (module$1 === "$builtins") return (0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_core.For, {
176
- get each() {
177
- return Object.entries(imported ?? {});
178
- },
179
- children: ([builtinModule, builtinImports]) => __alloy_js_core.code`import ${builtinImports === null ? "" : ` from ${builtinImports.filter((i) => !(0, __stryke_type_checks_is_string.isString)(i) && i.default).map((i) => i.alias ? i.alias : i.name).join(", ") + (builtinImports.filter((i) => !(0, __stryke_type_checks_is_string.isString)(i) && i.default).length > 0 && builtinImports.filter((i) => (0, __stryke_type_checks_is_string.isString)(i) || !i.default).length > 0 ? ", " : "") + (builtinImports.filter((i) => (0, __stryke_type_checks_is_string.isString)(i) || !i.default).length > 0 ? `{ ${builtinImports.map((i) => (0, __stryke_type_checks_is_string.isString)(i) ? i : i.alias ? `${i.name} as ${i.alias}` : i.name).join(", ")} }` : "")} `} "${builtinModule.includes(":") ? builtinModule : `${context.config.output.builtinPrefix}:${builtinModule}`}";`
180
- });
181
- const normalImports = imported;
174
+ children: ([module$1, normalImports]) => {
182
175
  return __alloy_js_core.code`import ${normalImports === null ? "" : ` from ${normalImports.filter((i) => !(0, __stryke_type_checks_is_string.isString)(i) && i.default).map((i) => i.alias ? i.alias : i.name).join(", ") + (normalImports.filter((i) => !(0, __stryke_type_checks_is_string.isString)(i) && i.default).length > 0 && normalImports.filter((i) => (0, __stryke_type_checks_is_string.isString)(i) || !i.default).length > 0 ? ", " : "") + (normalImports.filter((i) => (0, __stryke_type_checks_is_string.isString)(i) || !i.default).length > 0 ? `{ ${normalImports.map((i) => (0, __stryke_type_checks_is_string.isString)(i) ? i : i.alias ? `${i.name} as ${i.alias}` : i.name).join(", ")} }` : "")} `} "${module$1}";`;
183
176
  }
184
177
  });
185
178
  }
186
179
  }),
180
+ (0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_core.Show, {
181
+ get when() {
182
+ return builtinImports && Object.keys(builtinImports).length > 0;
183
+ },
184
+ get children() {
185
+ return (0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_core.For, {
186
+ get each() {
187
+ return Object.entries(builtinImports ?? {});
188
+ },
189
+ children: ([builtinModule, builtinImports$1]) => __alloy_js_core.code`import ${builtinImports$1 === null ? "" : ` from ${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(", ")} }` : "")} `} "${builtinModule.includes(":") ? builtinModule : `${context.config.output.builtinPrefix}:${builtinModule}`}";`
190
+ });
191
+ }
192
+ }),
187
193
  (0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_core.Show, {
188
194
  get when() {
189
195
  return scope.importedModules.size > 0;
@@ -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, imported]) => {
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 _alloy_js_core5 from "@alloy-js/core";
2
+ import * as _alloy_js_core9 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>): _alloy_js_core5.Children;
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): _alloy_js_core5.Children;
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.mjs";
2
- import * as _alloy_js_core7 from "@alloy-js/core";
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>): _alloy_js_core7.Children;
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): _alloy_js_core7.Children;
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 _alloy_js_core2 from "@alloy-js/core";
2
+ import * as _alloy_js_core15 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>): _alloy_js_core2.Children;
18
+ declare function TypescriptObject<T extends Record<string, any> = Record<string, any>>(props: TypescriptObjectProps<T>): _alloy_js_core15.Children;
19
19
  /**
20
20
  * Generates a TypeScript object property for the given reflection class.
21
21
  */
22
- declare function TypescriptObjectProperty(props: TypescriptObjectPropertyProps): _alloy_js_core2.Children;
22
+ declare function TypescriptObjectProperty(props: TypescriptObjectPropertyProps): _alloy_js_core15.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 _alloy_js_core9 from "@alloy-js/core";
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>): _alloy_js_core9.Children;
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): _alloy_js_core9.Children;
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.7",
3
+ "version": "0.18.8",
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.40",
364
- "@powerlines/plugin-plugin": "^0.12.77",
363
+ "@powerlines/deepkit": "^0.5.41",
364
+ "@powerlines/plugin-plugin": "^0.12.78",
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.36.29",
377
+ "powerlines": "^0.37.0",
378
378
  "prettier": "^3.7.4"
379
379
  },
380
380
  "devDependencies": { "@types/node": "^24.10.4" },
381
381
  "publishConfig": { "access": "public" },
382
- "gitHead": "8c096ca8c2383603e770532ec0f828761d525947"
382
+ "gitHead": "00141b82214ec2772cec7ec7873aba06f593289b"
383
383
  }