@powerlines/plugin-alloy 0.26.25 → 0.26.27

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 (105) hide show
  1. package/dist/core/components/infrastructure-file.cjs +13 -8
  2. package/dist/core/components/infrastructure-file.mjs +13 -8
  3. package/dist/core/components/infrastructure-file.mjs.map +1 -1
  4. package/dist/core/components/output.cjs +17 -10
  5. package/dist/core/components/output.mjs +17 -10
  6. package/dist/core/components/output.mjs.map +1 -1
  7. package/dist/core/components/single-line-comment.cjs +6 -4
  8. package/dist/core/components/single-line-comment.mjs +6 -4
  9. package/dist/core/components/single-line-comment.mjs.map +1 -1
  10. package/dist/core/components/source-file.cjs +10 -6
  11. package/dist/core/components/source-file.mjs +10 -6
  12. package/dist/core/components/source-file.mjs.map +1 -1
  13. package/dist/core/components/spacing.cjs +6 -4
  14. package/dist/core/components/spacing.mjs +6 -4
  15. package/dist/core/components/spacing.mjs.map +1 -1
  16. package/dist/core/contexts/context.mjs.map +1 -1
  17. package/dist/core/contexts/meta.mjs.map +1 -1
  18. package/dist/core/contexts/reflection.mjs.map +1 -1
  19. package/dist/core/helpers/code.mjs.map +1 -1
  20. package/dist/hcl/components/block-declaration.cjs +12 -8
  21. package/dist/hcl/components/block-declaration.mjs +12 -8
  22. package/dist/hcl/components/block-declaration.mjs.map +1 -1
  23. package/dist/hcl/components/hcl-file.cjs +35 -21
  24. package/dist/hcl/components/hcl-file.mjs +36 -22
  25. package/dist/hcl/components/hcl-file.mjs.map +1 -1
  26. package/dist/hcl/components/packer-file.cjs +8 -8
  27. package/dist/hcl/components/packer-file.mjs +8 -8
  28. package/dist/hcl/components/packer-file.mjs.map +1 -1
  29. package/dist/hcl/components/terraform-file.cjs +8 -8
  30. package/dist/hcl/components/terraform-file.mjs +8 -8
  31. package/dist/hcl/components/terraform-file.mjs.map +1 -1
  32. package/dist/helpers/capnp.mjs.map +1 -1
  33. package/dist/helpers/create-builtin.mjs.map +1 -1
  34. package/dist/helpers/refkey.mjs.map +1 -1
  35. package/dist/helpers/typescript.mjs.map +1 -1
  36. package/dist/index.cjs +16 -8
  37. package/dist/index.d.cts.map +1 -1
  38. package/dist/index.d.mts.map +1 -1
  39. package/dist/index.mjs +15 -8
  40. package/dist/index.mjs.map +1 -1
  41. package/dist/markdown/components/front-matter.cjs +9 -7
  42. package/dist/markdown/components/front-matter.mjs +9 -7
  43. package/dist/markdown/components/front-matter.mjs.map +1 -1
  44. package/dist/markdown/components/markdown-file.cjs +76 -44
  45. package/dist/markdown/components/markdown-file.mjs +76 -44
  46. package/dist/markdown/components/markdown-file.mjs.map +1 -1
  47. package/dist/markdown/components/markdown-table.cjs +49 -28
  48. package/dist/markdown/components/markdown-table.mjs +49 -28
  49. package/dist/markdown/components/markdown-table.mjs.map +1 -1
  50. package/dist/markdown/contexts/markdown-table.mjs.map +1 -1
  51. package/dist/render.cjs +3 -3
  52. package/dist/render.mjs +4 -4
  53. package/dist/render.mjs.map +1 -1
  54. package/dist/types/components.cjs +9 -0
  55. package/dist/types/components.mjs +10 -1
  56. package/dist/types/components.mjs.map +1 -0
  57. package/dist/typescript/components/builtin-file.cjs +30 -20
  58. package/dist/typescript/components/builtin-file.mjs +30 -20
  59. package/dist/typescript/components/builtin-file.mjs.map +1 -1
  60. package/dist/typescript/components/class-declaration.cjs +180 -100
  61. package/dist/typescript/components/class-declaration.mjs +180 -100
  62. package/dist/typescript/components/class-declaration.mjs.map +1 -1
  63. package/dist/typescript/components/dynamic-import-statement.cjs +2 -6
  64. package/dist/typescript/components/dynamic-import-statement.mjs +2 -6
  65. package/dist/typescript/components/dynamic-import-statement.mjs.map +1 -1
  66. package/dist/typescript/components/entry-file.cjs +10 -7
  67. package/dist/typescript/components/entry-file.mjs +10 -7
  68. package/dist/typescript/components/entry-file.mjs.map +1 -1
  69. package/dist/typescript/components/interface-declaration.cjs +127 -74
  70. package/dist/typescript/components/interface-declaration.mjs +127 -74
  71. package/dist/typescript/components/interface-declaration.mjs.map +1 -1
  72. package/dist/typescript/components/object-declaration.cjs +84 -50
  73. package/dist/typescript/components/object-declaration.mjs +84 -50
  74. package/dist/typescript/components/object-declaration.mjs.map +1 -1
  75. package/dist/typescript/components/property-name.cjs +3 -3
  76. package/dist/typescript/components/property-name.mjs +3 -3
  77. package/dist/typescript/components/property-name.mjs.map +1 -1
  78. package/dist/typescript/components/record-expression.mjs.map +1 -1
  79. package/dist/typescript/components/tsdoc-reflection.cjs +241 -108
  80. package/dist/typescript/components/tsdoc-reflection.mjs +241 -108
  81. package/dist/typescript/components/tsdoc-reflection.mjs.map +1 -1
  82. package/dist/typescript/components/tsdoc.cjs +265 -168
  83. package/dist/typescript/components/tsdoc.mjs +265 -168
  84. package/dist/typescript/components/tsdoc.mjs.map +1 -1
  85. package/dist/typescript/components/type-declaration.cjs +20 -15
  86. package/dist/typescript/components/type-declaration.mjs +20 -15
  87. package/dist/typescript/components/type-declaration.mjs.map +1 -1
  88. package/dist/typescript/components/type-parameters.cjs +56 -29
  89. package/dist/typescript/components/type-parameters.mjs +56 -29
  90. package/dist/typescript/components/type-parameters.mjs.map +1 -1
  91. package/dist/typescript/components/typescript-file.cjs +135 -74
  92. package/dist/typescript/components/typescript-file.mjs +135 -74
  93. package/dist/typescript/components/typescript-file.mjs.map +1 -1
  94. package/dist/typescript/contexts/lexical-scope.cjs +5 -3
  95. package/dist/typescript/contexts/lexical-scope.mjs +5 -3
  96. package/dist/typescript/contexts/lexical-scope.mjs.map +1 -1
  97. package/dist/typescript/contexts/member-scope.cjs +5 -3
  98. package/dist/typescript/contexts/member-scope.mjs +5 -3
  99. package/dist/typescript/contexts/member-scope.mjs.map +1 -1
  100. package/dist/typescript/helpers/get-call-signature-props.mjs.map +1 -1
  101. package/dist/typescript/helpers/utilities.mjs.map +1 -1
  102. package/dist/yaml/components/yaml-file.cjs +92 -47
  103. package/dist/yaml/components/yaml-file.mjs +92 -47
  104. package/dist/yaml/components/yaml-file.mjs.map +1 -1
  105. package/package.json +6 -6
@@ -4,9 +4,9 @@ const require_core_contexts_context = require('../../core/contexts/context.cjs')
4
4
  const require_core_components_source_file = require('../../core/components/source-file.cjs');
5
5
  const require_core_components_single_line_comment = require('../../core/components/single-line-comment.cjs');
6
6
  const require_core_helpers_code = require('../../core/helpers/code.cjs');
7
+ let _alloy_js_core_jsx_runtime = require("@alloy-js/core/jsx-runtime");
7
8
  let _alloy_js_core = require("@alloy-js/core");
8
9
  let _stryke_path_append = require("@stryke/path/append");
9
- let _alloy_js_core_jsx_runtime = require("@alloy-js/core/jsx-runtime");
10
10
  let _stryke_string_format_title_case = require("@stryke/string-format/title-case");
11
11
  let powerlines_utils = require("powerlines/utils");
12
12
  let _stryke_helpers_get_unique = require("@stryke/helpers/get-unique");
@@ -42,25 +42,32 @@ function TypescriptFile(props) {
42
42
  if (pkg) if ((0, _stryke_type_checks_is_boolean.isBoolean)(props.export)) pkg.scope.addExport(modulePath, scope);
43
43
  else pkg.scope.addExport(props.export, scope);
44
44
  }
45
- return /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(_alloy_js_typescript.SourceFileContext.Provider, {
45
+ return (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.SourceFileContext.Provider, {
46
46
  value: { scope },
47
- children: /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(_alloy_js_core.Scope, {
48
- value: scope,
49
- children: /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(require_core_components_source_file.SourceFile, {
50
- ...rest,
51
- path: modulePath,
52
- header: header ?? /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(TypescriptFileHeader, {
53
- hashbang,
54
- children: /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(TypescriptFileHeaderImports, {
55
- imports,
56
- builtinImports,
57
- scope
58
- })
59
- }),
60
- filetype: tsx ? "tsx" : "typescript",
61
- children
62
- })
63
- })
47
+ get children() {
48
+ return (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Scope, {
49
+ value: scope,
50
+ get children() {
51
+ return (0, _alloy_js_core_jsx_runtime.createComponent)(require_core_components_source_file.SourceFile, (0, _alloy_js_core_jsx_runtime.mergeProps)(rest, {
52
+ path: modulePath,
53
+ get header() {
54
+ return header ?? (0, _alloy_js_core_jsx_runtime.createComponent)(TypescriptFileHeader, {
55
+ hashbang,
56
+ get children() {
57
+ return (0, _alloy_js_core_jsx_runtime.createComponent)(TypescriptFileHeaderImports, {
58
+ imports,
59
+ builtinImports,
60
+ scope
61
+ });
62
+ }
63
+ });
64
+ },
65
+ filetype: tsx ? "tsx" : "typescript",
66
+ children
67
+ }));
68
+ }
69
+ });
70
+ }
64
71
  });
65
72
  }
66
73
  /**
@@ -72,40 +79,68 @@ function TypescriptFile(props) {
72
79
  function TypescriptFileHeader(props) {
73
80
  const { header, hashbang, disableEslint = true, disableBiome = true, children } = props;
74
81
  const context = require_core_contexts_context.usePowerlinesSafe();
75
- return /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsxs)(_alloy_js_core_jsx_runtime.Fragment, { children: [
76
- /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsxs)(_alloy_js_core.Show, {
77
- when: Boolean(hashbang),
78
- children: [hashbang === true ? require_core_helpers_code.code`#!/usr/bin/env ${context?.config.mode === "development" ? "-S NODE_OPTIONS=--enable-source-maps" : ""} node` : hashbang, /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)("hbr", {})]
82
+ return [
83
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Show, {
84
+ get when() {
85
+ return Boolean(hashbang);
86
+ },
87
+ get children() {
88
+ return [(0, _alloy_js_core_jsx_runtime.memo)(() => hashbang === true ? require_core_helpers_code.code`#!/usr/bin/env ${context?.config.mode === "development" ? "-S NODE_OPTIONS=--enable-source-maps" : ""} node` : hashbang), (0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {})];
89
+ }
79
90
  }),
80
- /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsxs)(_alloy_js_core.Show, {
81
- when: Boolean(header),
82
- children: [header, /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)("hbr", {})]
91
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Show, {
92
+ get when() {
93
+ return Boolean(header);
94
+ },
95
+ get children() {
96
+ return [header, (0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {})];
97
+ }
83
98
  }),
84
- /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)("hbr", {}),
85
- /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsxs)(_alloy_js_core.Show, {
86
- when: Boolean(disableEslint),
87
- children: [/* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(require_core_components_single_line_comment.SingleLineComment, {
88
- variant: "slash-star",
89
- children: "eslint-disable"
90
- }), /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)("hbr", {})]
99
+ (0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
100
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Show, {
101
+ get when() {
102
+ return Boolean(disableEslint);
103
+ },
104
+ get children() {
105
+ return [(0, _alloy_js_core_jsx_runtime.createComponent)(require_core_components_single_line_comment.SingleLineComment, {
106
+ variant: "slash-star",
107
+ children: "eslint-disable"
108
+ }), (0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {})];
109
+ }
91
110
  }),
92
- /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsxs)(_alloy_js_core.Show, {
93
- when: Boolean(disableBiome),
94
- children: [/* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(require_core_components_single_line_comment.SingleLineComment, { children: "biome-ignore lint: disable" }), /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)("hbr", {})]
111
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Show, {
112
+ get when() {
113
+ return Boolean(disableBiome);
114
+ },
115
+ get children() {
116
+ return [(0, _alloy_js_core_jsx_runtime.createComponent)(require_core_components_single_line_comment.SingleLineComment, { children: "biome-ignore lint: disable" }), (0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {})];
117
+ }
95
118
  }),
96
- /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(_alloy_js_core.Show, {
97
- when: Boolean(disableEslint) || Boolean(disableBiome),
98
- children: /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)("hbr", {})
119
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Show, {
120
+ get when() {
121
+ return Boolean(disableEslint) || Boolean(disableBiome);
122
+ },
123
+ get children() {
124
+ return (0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {});
125
+ }
99
126
  }),
100
- /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsxs)(_alloy_js_core.Show, {
101
- when: Boolean(children),
102
- children: [children, /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)("hbr", {})]
127
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Show, {
128
+ get when() {
129
+ return Boolean(children);
130
+ },
131
+ get children() {
132
+ return [children, (0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {})];
133
+ }
103
134
  }),
104
- /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(require_core_components_single_line_comment.SingleLineComment, { children: `Generated by ${(0, _stryke_string_format_title_case.titleCase)(context?.config?.framework) || "Powerlines"}` }),
105
- /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)("hbr", {}),
106
- /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(require_core_components_single_line_comment.SingleLineComment, { children: (0, powerlines_utils.getFileHeaderWarning)(context) }),
107
- /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)("hbr", {})
108
- ] });
135
+ (0, _alloy_js_core_jsx_runtime.createComponent)(require_core_components_single_line_comment.SingleLineComment, { get children() {
136
+ return `Generated by ${(0, _stryke_string_format_title_case.titleCase)(context?.config?.framework) || "Powerlines"}`;
137
+ } }),
138
+ (0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
139
+ (0, _alloy_js_core_jsx_runtime.createComponent)(require_core_components_single_line_comment.SingleLineComment, { get children() {
140
+ return (0, powerlines_utils.getFileHeaderWarning)(context);
141
+ } }),
142
+ (0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {})
143
+ ];
109
144
  }
110
145
  /**
111
146
  * Renders the header for a Powerlines Typescript source file.
@@ -124,33 +159,59 @@ function TypescriptFileHeaderImports(props) {
124
159
  const builtinImports = (0, _alloy_js_core.computed)(() => {
125
160
  return Object.fromEntries(Object.entries(builtinImportsProps ?? {}).map(([module, importItem]) => [module, Array.isArray(importItem) ? (0, _stryke_helpers_get_unique.getUniqueBy)(importItem, (i) => (0, _stryke_type_checks_is_string.isString)(i) ? i : i.alias || i.name) : importItem]));
126
161
  });
127
- return /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsxs)(_alloy_js_core.Show, {
128
- when: scope.importedModules.size > 0 || !!imports.value && Object.keys(imports.value).length > 0 || !!builtinImports.value && Object.keys(builtinImports.value).length > 0,
129
- children: [
130
- /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(_alloy_js_core.Show, {
131
- when: !!imports.value && Object.keys(imports.value).length > 0,
132
- children: /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(_alloy_js_core.For, {
133
- each: Object.entries(imports.value ?? {}),
134
- hardline: true,
135
- ender: /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)("hbr", {}),
136
- children: ([module, importItem]) => require_core_helpers_code.code`import ${importItem === null ? "" : (0, _stryke_type_checks_is_string.isString)(importItem) ? importItem : `${importItem.filter((i) => !(0, _stryke_type_checks_is_string.isString)(i) && i.default).map((i) => `${i.type ? "type " : ""}${i.alias ? i.alias : i.name}`).join(", ") + (importItem.filter((i) => !(0, _stryke_type_checks_is_string.isString)(i) && i.default).length > 0 && importItem.filter((i) => (0, _stryke_type_checks_is_string.isString)(i) || !i.default).length > 0 ? ", " : "") + (importItem.filter((i) => (0, _stryke_type_checks_is_string.isString)(i) || !i.default).length > 0 ? `{ ${importItem.filter((i) => (0, _stryke_type_checks_is_string.isString)(i) || !i.default).map((i) => (0, _stryke_type_checks_is_string.isString)(i) ? i : `${i.type ? "type " : ""}${i.alias ? `${i.name} as ${i.alias}` : i.name}`).join(", ")} }` : "")}`} from "${module}";`
137
- })
138
- }),
139
- /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(_alloy_js_core.Show, {
140
- when: builtinImports.value && Object.keys(builtinImports.value).length > 0,
141
- children: /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(_alloy_js_core.For, {
142
- each: Object.entries(builtinImports.value ?? {}),
143
- hardline: true,
144
- ender: /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)("hbr", {}),
145
- children: ([module, importItem]) => require_core_helpers_code.code`import ${importItem === null ? "" : (0, _stryke_type_checks_is_string.isString)(importItem) ? importItem : `${importItem.filter((i) => !(0, _stryke_type_checks_is_string.isString)(i) && i.default).map((i) => `${i.type ? "type " : ""}${i.alias ? i.alias : i.name}`).join(", ") + (importItem.filter((i) => !(0, _stryke_type_checks_is_string.isString)(i) && i.default).length > 0 && importItem.filter((i) => (0, _stryke_type_checks_is_string.isString)(i) || !i.default).length > 0 ? ", " : "") + (importItem.filter((i) => (0, _stryke_type_checks_is_string.isString)(i) || !i.default).length > 0 ? `{ ${importItem.filter((i) => (0, _stryke_type_checks_is_string.isString)(i) || !i.default).map((i) => (0, _stryke_type_checks_is_string.isString)(i) ? i : `${i.type ? "type " : ""}${i.alias ? `${i.name} as ${i.alias}` : i.name}`).join(", ")} }` : "")}`} from "${module.includes(":") ? module : `${context?.config?.framework || "powerlines"}:${module}`}";`
146
- })
147
- }),
148
- /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(_alloy_js_core.Show, {
149
- when: scope.importedModules.size > 0,
150
- children: /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(_alloy_js_typescript.ImportStatements, { records: scope.importedModules })
151
- }),
152
- /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)("hbr", {})
153
- ]
162
+ return (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Show, {
163
+ get when() {
164
+ return scope.importedModules.size > 0 || !!imports.value && Object.keys(imports.value).length > 0 || !!builtinImports.value && Object.keys(builtinImports.value).length > 0;
165
+ },
166
+ get children() {
167
+ return [
168
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Show, {
169
+ get when() {
170
+ return (0, _alloy_js_core_jsx_runtime.memo)(() => !!!!imports.value)() && Object.keys(imports.value).length > 0;
171
+ },
172
+ get children() {
173
+ return (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.For, {
174
+ get each() {
175
+ return Object.entries(imports.value ?? {});
176
+ },
177
+ hardline: true,
178
+ get ender() {
179
+ return (0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {});
180
+ },
181
+ children: ([module, importItem]) => require_core_helpers_code.code`import ${importItem === null ? "" : (0, _stryke_type_checks_is_string.isString)(importItem) ? importItem : `${importItem.filter((i) => !(0, _stryke_type_checks_is_string.isString)(i) && i.default).map((i) => `${i.type ? "type " : ""}${i.alias ? i.alias : i.name}`).join(", ") + (importItem.filter((i) => !(0, _stryke_type_checks_is_string.isString)(i) && i.default).length > 0 && importItem.filter((i) => (0, _stryke_type_checks_is_string.isString)(i) || !i.default).length > 0 ? ", " : "") + (importItem.filter((i) => (0, _stryke_type_checks_is_string.isString)(i) || !i.default).length > 0 ? `{ ${importItem.filter((i) => (0, _stryke_type_checks_is_string.isString)(i) || !i.default).map((i) => (0, _stryke_type_checks_is_string.isString)(i) ? i : `${i.type ? "type " : ""}${i.alias ? `${i.name} as ${i.alias}` : i.name}`).join(", ")} }` : "")}`} from "${module}";`
182
+ });
183
+ }
184
+ }),
185
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Show, {
186
+ get when() {
187
+ return (0, _alloy_js_core_jsx_runtime.memo)(() => !!builtinImports.value)() && Object.keys(builtinImports.value).length > 0;
188
+ },
189
+ get children() {
190
+ return (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.For, {
191
+ get each() {
192
+ return Object.entries(builtinImports.value ?? {});
193
+ },
194
+ hardline: true,
195
+ get ender() {
196
+ return (0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {});
197
+ },
198
+ children: ([module, importItem]) => require_core_helpers_code.code`import ${importItem === null ? "" : (0, _stryke_type_checks_is_string.isString)(importItem) ? importItem : `${importItem.filter((i) => !(0, _stryke_type_checks_is_string.isString)(i) && i.default).map((i) => `${i.type ? "type " : ""}${i.alias ? i.alias : i.name}`).join(", ") + (importItem.filter((i) => !(0, _stryke_type_checks_is_string.isString)(i) && i.default).length > 0 && importItem.filter((i) => (0, _stryke_type_checks_is_string.isString)(i) || !i.default).length > 0 ? ", " : "") + (importItem.filter((i) => (0, _stryke_type_checks_is_string.isString)(i) || !i.default).length > 0 ? `{ ${importItem.filter((i) => (0, _stryke_type_checks_is_string.isString)(i) || !i.default).map((i) => (0, _stryke_type_checks_is_string.isString)(i) ? i : `${i.type ? "type " : ""}${i.alias ? `${i.name} as ${i.alias}` : i.name}`).join(", ")} }` : "")}`} from "${module.includes(":") ? module : `${context?.config?.framework || "powerlines"}:${module}`}";`
199
+ });
200
+ }
201
+ }),
202
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Show, {
203
+ get when() {
204
+ return scope.importedModules.size > 0;
205
+ },
206
+ get children() {
207
+ return (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.ImportStatements, { get records() {
208
+ return scope.importedModules;
209
+ } });
210
+ }
211
+ }),
212
+ (0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {})
213
+ ];
214
+ }
154
215
  });
155
216
  }
156
217
 
@@ -2,9 +2,9 @@ import { usePowerlinesSafe } from "../../core/contexts/context.mjs";
2
2
  import { SourceFile } from "../../core/components/source-file.mjs";
3
3
  import { SingleLineComment } from "../../core/components/single-line-comment.mjs";
4
4
  import { code as code$1 } from "../../core/helpers/code.mjs";
5
+ import { createComponent, createIntrinsic, memo, mergeProps } from "@alloy-js/core/jsx-runtime";
5
6
  import { For, Scope, Show, SourceDirectoryContext, computed, splitProps, useContext, useScope } from "@alloy-js/core";
6
7
  import { appendPath } from "@stryke/path/append";
7
- import { Fragment, jsx, jsxs } from "@alloy-js/core/jsx-runtime";
8
8
  import { titleCase } from "@stryke/string-format/title-case";
9
9
  import { getFileHeaderWarning } from "powerlines/utils";
10
10
  import { getUniqueBy } from "@stryke/helpers/get-unique";
@@ -40,25 +40,32 @@ function TypescriptFile(props) {
40
40
  if (pkg) if (isBoolean(props.export)) pkg.scope.addExport(modulePath, scope);
41
41
  else pkg.scope.addExport(props.export, scope);
42
42
  }
43
- return /* @__PURE__ */ jsx(SourceFileContext$1.Provider, {
43
+ return createComponent(SourceFileContext$1.Provider, {
44
44
  value: { scope },
45
- children: /* @__PURE__ */ jsx(Scope, {
46
- value: scope,
47
- children: /* @__PURE__ */ jsx(SourceFile, {
48
- ...rest,
49
- path: modulePath,
50
- header: header ?? /* @__PURE__ */ jsx(TypescriptFileHeader, {
51
- hashbang,
52
- children: /* @__PURE__ */ jsx(TypescriptFileHeaderImports, {
53
- imports,
54
- builtinImports,
55
- scope
56
- })
57
- }),
58
- filetype: tsx ? "tsx" : "typescript",
59
- children
60
- })
61
- })
45
+ get children() {
46
+ return createComponent(Scope, {
47
+ value: scope,
48
+ get children() {
49
+ return createComponent(SourceFile, mergeProps(rest, {
50
+ path: modulePath,
51
+ get header() {
52
+ return header ?? createComponent(TypescriptFileHeader, {
53
+ hashbang,
54
+ get children() {
55
+ return createComponent(TypescriptFileHeaderImports, {
56
+ imports,
57
+ builtinImports,
58
+ scope
59
+ });
60
+ }
61
+ });
62
+ },
63
+ filetype: tsx ? "tsx" : "typescript",
64
+ children
65
+ }));
66
+ }
67
+ });
68
+ }
62
69
  });
63
70
  }
64
71
  /**
@@ -70,40 +77,68 @@ function TypescriptFile(props) {
70
77
  function TypescriptFileHeader(props) {
71
78
  const { header, hashbang, disableEslint = true, disableBiome = true, children } = props;
72
79
  const context = usePowerlinesSafe();
73
- return /* @__PURE__ */ jsxs(Fragment, { children: [
74
- /* @__PURE__ */ jsxs(Show, {
75
- when: Boolean(hashbang),
76
- children: [hashbang === true ? code$1`#!/usr/bin/env ${context?.config.mode === "development" ? "-S NODE_OPTIONS=--enable-source-maps" : ""} node` : hashbang, /* @__PURE__ */ jsx("hbr", {})]
80
+ return [
81
+ createComponent(Show, {
82
+ get when() {
83
+ return Boolean(hashbang);
84
+ },
85
+ get children() {
86
+ return [memo(() => hashbang === true ? code$1`#!/usr/bin/env ${context?.config.mode === "development" ? "-S NODE_OPTIONS=--enable-source-maps" : ""} node` : hashbang), createIntrinsic("hbr", {})];
87
+ }
77
88
  }),
78
- /* @__PURE__ */ jsxs(Show, {
79
- when: Boolean(header),
80
- children: [header, /* @__PURE__ */ jsx("hbr", {})]
89
+ createComponent(Show, {
90
+ get when() {
91
+ return Boolean(header);
92
+ },
93
+ get children() {
94
+ return [header, createIntrinsic("hbr", {})];
95
+ }
81
96
  }),
82
- /* @__PURE__ */ jsx("hbr", {}),
83
- /* @__PURE__ */ jsxs(Show, {
84
- when: Boolean(disableEslint),
85
- children: [/* @__PURE__ */ jsx(SingleLineComment, {
86
- variant: "slash-star",
87
- children: "eslint-disable"
88
- }), /* @__PURE__ */ jsx("hbr", {})]
97
+ createIntrinsic("hbr", {}),
98
+ createComponent(Show, {
99
+ get when() {
100
+ return Boolean(disableEslint);
101
+ },
102
+ get children() {
103
+ return [createComponent(SingleLineComment, {
104
+ variant: "slash-star",
105
+ children: "eslint-disable"
106
+ }), createIntrinsic("hbr", {})];
107
+ }
89
108
  }),
90
- /* @__PURE__ */ jsxs(Show, {
91
- when: Boolean(disableBiome),
92
- children: [/* @__PURE__ */ jsx(SingleLineComment, { children: "biome-ignore lint: disable" }), /* @__PURE__ */ jsx("hbr", {})]
109
+ createComponent(Show, {
110
+ get when() {
111
+ return Boolean(disableBiome);
112
+ },
113
+ get children() {
114
+ return [createComponent(SingleLineComment, { children: "biome-ignore lint: disable" }), createIntrinsic("hbr", {})];
115
+ }
93
116
  }),
94
- /* @__PURE__ */ jsx(Show, {
95
- when: Boolean(disableEslint) || Boolean(disableBiome),
96
- children: /* @__PURE__ */ jsx("hbr", {})
117
+ createComponent(Show, {
118
+ get when() {
119
+ return Boolean(disableEslint) || Boolean(disableBiome);
120
+ },
121
+ get children() {
122
+ return createIntrinsic("hbr", {});
123
+ }
97
124
  }),
98
- /* @__PURE__ */ jsxs(Show, {
99
- when: Boolean(children),
100
- children: [children, /* @__PURE__ */ jsx("hbr", {})]
125
+ createComponent(Show, {
126
+ get when() {
127
+ return Boolean(children);
128
+ },
129
+ get children() {
130
+ return [children, createIntrinsic("hbr", {})];
131
+ }
101
132
  }),
102
- /* @__PURE__ */ jsx(SingleLineComment, { children: `Generated by ${titleCase(context?.config?.framework) || "Powerlines"}` }),
103
- /* @__PURE__ */ jsx("hbr", {}),
104
- /* @__PURE__ */ jsx(SingleLineComment, { children: getFileHeaderWarning(context) }),
105
- /* @__PURE__ */ jsx("hbr", {})
106
- ] });
133
+ createComponent(SingleLineComment, { get children() {
134
+ return `Generated by ${titleCase(context?.config?.framework) || "Powerlines"}`;
135
+ } }),
136
+ createIntrinsic("hbr", {}),
137
+ createComponent(SingleLineComment, { get children() {
138
+ return getFileHeaderWarning(context);
139
+ } }),
140
+ createIntrinsic("hbr", {})
141
+ ];
107
142
  }
108
143
  /**
109
144
  * Renders the header for a Powerlines Typescript source file.
@@ -122,33 +157,59 @@ function TypescriptFileHeaderImports(props) {
122
157
  const builtinImports = computed(() => {
123
158
  return Object.fromEntries(Object.entries(builtinImportsProps ?? {}).map(([module, importItem]) => [module, Array.isArray(importItem) ? getUniqueBy(importItem, (i) => isString(i) ? i : i.alias || i.name) : importItem]));
124
159
  });
125
- return /* @__PURE__ */ jsxs(Show, {
126
- when: scope.importedModules.size > 0 || !!imports.value && Object.keys(imports.value).length > 0 || !!builtinImports.value && Object.keys(builtinImports.value).length > 0,
127
- children: [
128
- /* @__PURE__ */ jsx(Show, {
129
- when: !!imports.value && Object.keys(imports.value).length > 0,
130
- children: /* @__PURE__ */ jsx(For, {
131
- each: Object.entries(imports.value ?? {}),
132
- hardline: true,
133
- ender: /* @__PURE__ */ jsx("hbr", {}),
134
- children: ([module, importItem]) => code$1`import ${importItem === null ? "" : isString(importItem) ? importItem : `${importItem.filter((i) => !isString(i) && i.default).map((i) => `${i.type ? "type " : ""}${i.alias ? i.alias : i.name}`).join(", ") + (importItem.filter((i) => !isString(i) && i.default).length > 0 && importItem.filter((i) => isString(i) || !i.default).length > 0 ? ", " : "") + (importItem.filter((i) => isString(i) || !i.default).length > 0 ? `{ ${importItem.filter((i) => isString(i) || !i.default).map((i) => isString(i) ? i : `${i.type ? "type " : ""}${i.alias ? `${i.name} as ${i.alias}` : i.name}`).join(", ")} }` : "")}`} from "${module}";`
135
- })
136
- }),
137
- /* @__PURE__ */ jsx(Show, {
138
- when: builtinImports.value && Object.keys(builtinImports.value).length > 0,
139
- children: /* @__PURE__ */ jsx(For, {
140
- each: Object.entries(builtinImports.value ?? {}),
141
- hardline: true,
142
- ender: /* @__PURE__ */ jsx("hbr", {}),
143
- children: ([module, importItem]) => code$1`import ${importItem === null ? "" : isString(importItem) ? importItem : `${importItem.filter((i) => !isString(i) && i.default).map((i) => `${i.type ? "type " : ""}${i.alias ? i.alias : i.name}`).join(", ") + (importItem.filter((i) => !isString(i) && i.default).length > 0 && importItem.filter((i) => isString(i) || !i.default).length > 0 ? ", " : "") + (importItem.filter((i) => isString(i) || !i.default).length > 0 ? `{ ${importItem.filter((i) => isString(i) || !i.default).map((i) => isString(i) ? i : `${i.type ? "type " : ""}${i.alias ? `${i.name} as ${i.alias}` : i.name}`).join(", ")} }` : "")}`} from "${module.includes(":") ? module : `${context?.config?.framework || "powerlines"}:${module}`}";`
144
- })
145
- }),
146
- /* @__PURE__ */ jsx(Show, {
147
- when: scope.importedModules.size > 0,
148
- children: /* @__PURE__ */ jsx(ImportStatements, { records: scope.importedModules })
149
- }),
150
- /* @__PURE__ */ jsx("hbr", {})
151
- ]
160
+ return createComponent(Show, {
161
+ get when() {
162
+ return scope.importedModules.size > 0 || !!imports.value && Object.keys(imports.value).length > 0 || !!builtinImports.value && Object.keys(builtinImports.value).length > 0;
163
+ },
164
+ get children() {
165
+ return [
166
+ createComponent(Show, {
167
+ get when() {
168
+ return memo(() => !!!!imports.value)() && Object.keys(imports.value).length > 0;
169
+ },
170
+ get children() {
171
+ return createComponent(For, {
172
+ get each() {
173
+ return Object.entries(imports.value ?? {});
174
+ },
175
+ hardline: true,
176
+ get ender() {
177
+ return createIntrinsic("hbr", {});
178
+ },
179
+ children: ([module, importItem]) => code$1`import ${importItem === null ? "" : isString(importItem) ? importItem : `${importItem.filter((i) => !isString(i) && i.default).map((i) => `${i.type ? "type " : ""}${i.alias ? i.alias : i.name}`).join(", ") + (importItem.filter((i) => !isString(i) && i.default).length > 0 && importItem.filter((i) => isString(i) || !i.default).length > 0 ? ", " : "") + (importItem.filter((i) => isString(i) || !i.default).length > 0 ? `{ ${importItem.filter((i) => isString(i) || !i.default).map((i) => isString(i) ? i : `${i.type ? "type " : ""}${i.alias ? `${i.name} as ${i.alias}` : i.name}`).join(", ")} }` : "")}`} from "${module}";`
180
+ });
181
+ }
182
+ }),
183
+ createComponent(Show, {
184
+ get when() {
185
+ return memo(() => !!builtinImports.value)() && Object.keys(builtinImports.value).length > 0;
186
+ },
187
+ get children() {
188
+ return createComponent(For, {
189
+ get each() {
190
+ return Object.entries(builtinImports.value ?? {});
191
+ },
192
+ hardline: true,
193
+ get ender() {
194
+ return createIntrinsic("hbr", {});
195
+ },
196
+ children: ([module, importItem]) => code$1`import ${importItem === null ? "" : isString(importItem) ? importItem : `${importItem.filter((i) => !isString(i) && i.default).map((i) => `${i.type ? "type " : ""}${i.alias ? i.alias : i.name}`).join(", ") + (importItem.filter((i) => !isString(i) && i.default).length > 0 && importItem.filter((i) => isString(i) || !i.default).length > 0 ? ", " : "") + (importItem.filter((i) => isString(i) || !i.default).length > 0 ? `{ ${importItem.filter((i) => isString(i) || !i.default).map((i) => isString(i) ? i : `${i.type ? "type " : ""}${i.alias ? `${i.name} as ${i.alias}` : i.name}`).join(", ")} }` : "")}`} from "${module.includes(":") ? module : `${context?.config?.framework || "powerlines"}:${module}`}";`
197
+ });
198
+ }
199
+ }),
200
+ createComponent(Show, {
201
+ get when() {
202
+ return scope.importedModules.size > 0;
203
+ },
204
+ get children() {
205
+ return createComponent(ImportStatements, { get records() {
206
+ return scope.importedModules;
207
+ } });
208
+ }
209
+ }),
210
+ createIntrinsic("hbr", {})
211
+ ];
212
+ }
152
213
  });
153
214
  }
154
215
 
@@ -1 +1 @@
1
- {"version":3,"file":"typescript-file.mjs","names":["SourceFileContext"],"sources":["../../../src/typescript/components/typescript-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 type { Children } from \"@alloy-js/core\";\nimport {\n computed,\n For,\n Scope,\n Show,\n SourceDirectoryContext,\n splitProps,\n useContext,\n useScope\n} from \"@alloy-js/core\";\nimport {\n getSourceDirectoryData,\n ImportStatements,\n PackageContext,\n SourceFileContext,\n TSModuleScope,\n useSourceFile\n} from \"@alloy-js/typescript\";\nimport { getUniqueBy } from \"@stryke/helpers/get-unique\";\nimport { appendPath } from \"@stryke/path/append\";\nimport { titleCase } from \"@stryke/string-format/title-case\";\nimport { isBoolean } from \"@stryke/type-checks/is-boolean\";\nimport { isString } from \"@stryke/type-checks/is-string\";\nimport { getFileHeaderWarning } from \"powerlines/utils\";\nimport { SingleLineComment } from \"../../core/components/single-line-comment\";\nimport { SourceFile, SourceFileProps } from \"../../core/components/source-file\";\nimport { usePowerlinesSafe } from \"../../core/contexts/context\";\nimport { code } from \"../../core/helpers/code\";\nimport {\n ComponentProps,\n SourceFileHeaderProps,\n TypescriptFileImportItem,\n TypescriptFileImports\n} from \"../../types/components\";\n\nexport type TypescriptFileProps = Omit<SourceFileProps, \"filetype\"> &\n ComponentProps & {\n hashbang?: Children | true;\n header?: Children;\n imports?: TypescriptFileImports;\n builtinImports?: TypescriptFileImports;\n export?: boolean | string;\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 TypescriptFile(props: TypescriptFileProps) {\n const [\n { children, path, imports, builtinImports, tsx, header, hashbang },\n rest\n ] = splitProps(props, [\n \"children\",\n \"path\",\n \"imports\",\n \"builtinImports\",\n \"tsx\",\n \"header\",\n \"hashbang\"\n ]);\n\n const directoryContext = useContext(SourceDirectoryContext)!;\n const sdData = getSourceDirectoryData(directoryContext);\n\n const modulePath = appendPath(path, directoryContext.path);\n const scope = new TSModuleScope(modulePath, useScope());\n sdData.modules.add(scope);\n\n const pkg = useContext(PackageContext);\n if (pkg) {\n pkg.scope.addModule(scope);\n }\n\n if (props.export) {\n if (pkg) {\n if (isBoolean(props.export)) {\n pkg.scope.addExport(modulePath, scope);\n } else {\n pkg.scope.addExport(props.export, scope);\n }\n }\n }\n\n return (\n <SourceFileContext.Provider\n value={{\n scope\n }}>\n <Scope value={scope}>\n <SourceFile\n {...rest}\n path={modulePath}\n header={\n header ?? (\n <TypescriptFileHeader hashbang={hashbang}>\n <TypescriptFileHeaderImports\n imports={imports}\n builtinImports={builtinImports}\n scope={scope}\n />\n </TypescriptFileHeader>\n )\n }\n filetype={tsx ? \"tsx\" : \"typescript\"}>\n {children}\n </SourceFile>\n </Scope>\n </SourceFileContext.Provider>\n );\n}\n\nexport interface TypescriptFileHeaderProps extends SourceFileHeaderProps {\n header?: Children;\n hashbang?: Children | true;\n}\n\n/**\n * Renders the header for a Powerlines Typescript source file.\n *\n * @param props - The properties for the source file header.\n * @returns The rendered source file header.\n */\nexport function TypescriptFileHeader(props: TypescriptFileHeaderProps) {\n const {\n header,\n hashbang,\n disableEslint = true,\n disableBiome = true,\n children\n } = props;\n\n const context = usePowerlinesSafe();\n\n return (\n <>\n <Show when={Boolean(hashbang)}>\n {hashbang === true\n ? code`#!/usr/bin/env ${\n context?.config.mode === \"development\"\n ? \"-S NODE_OPTIONS=--enable-source-maps\"\n : \"\"\n } node`\n : hashbang}\n <hbr />\n </Show>\n <Show when={Boolean(header)}>\n {header}\n <hbr />\n </Show>\n <hbr />\n <Show when={Boolean(disableEslint)}>\n <SingleLineComment variant=\"slash-star\">\n {\"eslint-disable\"}\n </SingleLineComment>\n <hbr />\n </Show>\n <Show when={Boolean(disableBiome)}>\n <SingleLineComment>{\"biome-ignore lint: disable\"}</SingleLineComment>\n <hbr />\n </Show>\n <Show when={Boolean(disableEslint) || Boolean(disableBiome)}>\n <hbr />\n </Show>\n <Show when={Boolean(children)}>\n {children}\n <hbr />\n </Show>\n <SingleLineComment>{`Generated by ${\n titleCase(context?.config?.framework) || \"Powerlines\"\n }`}</SingleLineComment>\n <hbr />\n <SingleLineComment>{getFileHeaderWarning(context!)}</SingleLineComment>\n <hbr />\n </>\n );\n}\n\nexport interface TypescriptFileHeaderImportsProps extends SourceFileHeaderProps {\n imports?: TypescriptFileImports;\n builtinImports?: TypescriptFileImports;\n scope?: TSModuleScope;\n}\n\n/**\n * Renders the header for a Powerlines Typescript source file.\n *\n * @param props - The properties for the source file header.\n * @returns The rendered source file header.\n */\nexport function TypescriptFileHeaderImports(\n props: TypescriptFileHeaderImportsProps\n) {\n const { imports: importProps, builtinImports: builtinImportsProps } = props;\n\n const context = usePowerlinesSafe();\n const sourceFile = useSourceFile();\n\n const scope = props.scope ?? sourceFile.scope;\n\n const imports = computed(() => {\n return Object.fromEntries(\n Object.entries(importProps ?? {}).map(([module, importItem]) => [\n module,\n Array.isArray(importItem)\n ? getUniqueBy(importItem, i => (isString(i) ? i : i.alias || i.name))\n : importItem\n ])\n );\n });\n const builtinImports = computed(() => {\n return Object.fromEntries(\n Object.entries(builtinImportsProps ?? {}).map(([module, importItem]) => [\n module,\n Array.isArray(importItem)\n ? getUniqueBy(importItem, i => (isString(i) ? i : i.alias || i.name))\n : importItem\n ])\n );\n });\n\n return (\n <Show\n when={\n scope.importedModules.size > 0 ||\n (!!imports.value && Object.keys(imports.value).length > 0) ||\n (!!builtinImports.value && Object.keys(builtinImports.value).length > 0)\n }>\n <Show when={!!imports.value && Object.keys(imports.value).length > 0}>\n <For\n each={Object.entries(imports.value ?? {})}\n hardline\n ender={<hbr />}>\n {([module, importItem]) =>\n code`import ${\n importItem === null\n ? \"\"\n : isString(importItem)\n ? importItem\n : `${\n (\n importItem.filter(\n i => !isString(i) && i.default\n ) as TypescriptFileImportItem[]\n )\n .map(\n i =>\n `${i.type ? \"type \" : \"\"}${\n i.alias ? i.alias : i.name\n }`\n )\n .join(\", \") +\n (importItem.filter(i => !isString(i) && i.default)\n .length > 0 &&\n importItem.filter(i => isString(i) || !i.default).length >\n 0\n ? \", \"\n : \"\") +\n (importItem.filter(i => isString(i) || !i.default)\n .length > 0\n ? `{ ${importItem\n .filter(i => isString(i) || !i.default)\n .map(i =>\n isString(i)\n ? i\n : `${i.type ? \"type \" : \"\"}${\n i.alias ? `${i.name} as ${i.alias}` : i.name\n }`\n )\n .join(\", \")} }`\n : \"\")\n }`\n } from \"${module}\";`\n }\n </For>\n </Show>\n <Show\n when={\n builtinImports.value && Object.keys(builtinImports.value).length > 0\n }>\n <For\n each={Object.entries(\n (builtinImports.value ?? {}) as Record<\n string,\n null | Array<TypescriptFileImportItem | string>\n >\n )}\n hardline\n ender={<hbr />}>\n {([module, importItem]) =>\n code`import ${\n importItem === null\n ? \"\"\n : isString(importItem)\n ? importItem\n : `${\n (\n importItem.filter(\n i => !isString(i) && i.default\n ) as TypescriptFileImportItem[]\n )\n .map(\n i =>\n `${i.type ? \"type \" : \"\"}${\n i.alias ? i.alias : i.name\n }`\n )\n .join(\", \") +\n (importItem.filter(i => !isString(i) && i.default)\n .length > 0 &&\n importItem.filter(i => isString(i) || !i.default).length >\n 0\n ? \", \"\n : \"\") +\n (importItem.filter(i => isString(i) || !i.default)\n .length > 0\n ? `{ ${importItem\n .filter(i => isString(i) || !i.default)\n .map(i =>\n isString(i)\n ? i\n : `${i.type ? \"type \" : \"\"}${\n i.alias ? `${i.name} as ${i.alias}` : i.name\n }`\n )\n .join(\", \")} }`\n : \"\")\n }`\n } from \"${\n module.includes(\":\")\n ? module\n : `${context?.config?.framework || \"powerlines\"}:${module}`\n }\";`\n }\n </For>\n </Show>\n <Show when={scope.importedModules.size > 0}>\n <ImportStatements records={scope.importedModules} />\n </Show>\n <hbr />\n </Show>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAsEA,SAAgB,eAAe,OAA4B;CACzD,MAAM,CACJ,EAAE,UAAU,MAAM,SAAS,gBAAgB,KAAK,QAAQ,YACxD,QACE,WAAW,OAAO;EACpB;EACA;EACA;EACA;EACA;EACA;EACA;EACD,CAAC;CAEF,MAAM,mBAAmB,WAAW,uBAAuB;CAC3D,MAAM,SAAS,uBAAuB,iBAAiB;CAEvD,MAAM,aAAa,WAAW,MAAM,iBAAiB,KAAK;CAC1D,MAAM,QAAQ,IAAI,cAAc,YAAY,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IACZ,WAAW,QAAO,MAAK,CAAC,SAAS,EAAE,IAAI,EAAE,QAAQ,CAC/C,SAAS,KACZ,WAAW,QAAO,MAAK,SAAS,EAAE,IAAI,CAAC,EAAE,QAAQ,CAAC,SAChD,IACE,OACA,OACH,WAAW,QAAO,MAAK,SAAS,EAAE,IAAI,CAAC,EAAE,QAAQ,CAC/C,SAAS,IACR,KAAK,WACF,QAAO,MAAK,SAAS,EAAE,IAAI,CAAC,EAAE,QAAQ,CACtC,KAAI,MACH,SAAS,EAAE,GACP,IACA,GAAG,EAAE,OAAO,UAAU,KACpB,EAAE,QAAQ,GAAG,EAAE,KAAK,MAAM,EAAE,UAAU,EAAE,OAE/C,CACA,KAAK,KAAK,CAAC,MACd,MAEb,SACC,OAAO,SAAS,IAAI,GAChB,SACA,GAAG,SAAS,QAAQ,aAAa,aAAa,GAAG,SACtD;KAEC;IACD;GACP,oBAAC,MAAD;IAAM,MAAM,MAAM,gBAAgB,OAAO;cACvC,oBAAC,kBAAD,EAAkB,SAAS,MAAM,iBAAmB;IAC/C;GACP,oBAAC,OAAD,EAAO;GACF"}
1
+ {"version":3,"file":"typescript-file.mjs","names":[],"sources":["../../../src/typescript/components/typescript-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 type { Children } from \"@alloy-js/core\";\nimport {\n computed,\n For,\n Scope,\n Show,\n SourceDirectoryContext,\n splitProps,\n useContext,\n useScope\n} from \"@alloy-js/core\";\nimport {\n getSourceDirectoryData,\n ImportStatements,\n PackageContext,\n SourceFileContext,\n TSModuleScope,\n useSourceFile\n} from \"@alloy-js/typescript\";\nimport { getUniqueBy } from \"@stryke/helpers/get-unique\";\nimport { appendPath } from \"@stryke/path/append\";\nimport { titleCase } from \"@stryke/string-format/title-case\";\nimport { isBoolean } from \"@stryke/type-checks/is-boolean\";\nimport { isString } from \"@stryke/type-checks/is-string\";\nimport { getFileHeaderWarning } from \"powerlines/utils\";\nimport { SingleLineComment } from \"../../core/components/single-line-comment\";\nimport { SourceFile, SourceFileProps } from \"../../core/components/source-file\";\nimport { usePowerlinesSafe } from \"../../core/contexts/context\";\nimport { code } from \"../../core/helpers/code\";\nimport {\n ComponentProps,\n SourceFileHeaderProps,\n TypescriptFileImportItem,\n TypescriptFileImports\n} from \"../../types/components\";\n\nexport type TypescriptFileProps = Omit<SourceFileProps, \"filetype\"> &\n ComponentProps & {\n hashbang?: Children | true;\n header?: Children;\n imports?: TypescriptFileImports;\n builtinImports?: TypescriptFileImports;\n export?: boolean | string;\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 TypescriptFile(props: TypescriptFileProps) {\n const [\n { children, path, imports, builtinImports, tsx, header, hashbang },\n rest\n ] = splitProps(props, [\n \"children\",\n \"path\",\n \"imports\",\n \"builtinImports\",\n \"tsx\",\n \"header\",\n \"hashbang\"\n ]);\n\n const directoryContext = useContext(SourceDirectoryContext)!;\n const sdData = getSourceDirectoryData(directoryContext);\n\n const modulePath = appendPath(path, directoryContext.path);\n const scope = new TSModuleScope(modulePath, useScope());\n sdData.modules.add(scope);\n\n const pkg = useContext(PackageContext);\n if (pkg) {\n pkg.scope.addModule(scope);\n }\n\n if (props.export) {\n if (pkg) {\n if (isBoolean(props.export)) {\n pkg.scope.addExport(modulePath, scope);\n } else {\n pkg.scope.addExport(props.export, scope);\n }\n }\n }\n\n return (\n <SourceFileContext.Provider\n value={{\n scope\n }}>\n <Scope value={scope}>\n <SourceFile\n {...rest}\n path={modulePath}\n header={\n header ?? (\n <TypescriptFileHeader hashbang={hashbang}>\n <TypescriptFileHeaderImports\n imports={imports}\n builtinImports={builtinImports}\n scope={scope}\n />\n </TypescriptFileHeader>\n )\n }\n filetype={tsx ? \"tsx\" : \"typescript\"}>\n {children}\n </SourceFile>\n </Scope>\n </SourceFileContext.Provider>\n );\n}\n\nexport interface TypescriptFileHeaderProps extends SourceFileHeaderProps {\n header?: Children;\n hashbang?: Children | true;\n}\n\n/**\n * Renders the header for a Powerlines Typescript source file.\n *\n * @param props - The properties for the source file header.\n * @returns The rendered source file header.\n */\nexport function TypescriptFileHeader(props: TypescriptFileHeaderProps) {\n const {\n header,\n hashbang,\n disableEslint = true,\n disableBiome = true,\n children\n } = props;\n\n const context = usePowerlinesSafe();\n\n return (\n <>\n <Show when={Boolean(hashbang)}>\n {hashbang === true\n ? code`#!/usr/bin/env ${\n context?.config.mode === \"development\"\n ? \"-S NODE_OPTIONS=--enable-source-maps\"\n : \"\"\n } node`\n : hashbang}\n <hbr />\n </Show>\n <Show when={Boolean(header)}>\n {header}\n <hbr />\n </Show>\n <hbr />\n <Show when={Boolean(disableEslint)}>\n <SingleLineComment variant=\"slash-star\">\n {\"eslint-disable\"}\n </SingleLineComment>\n <hbr />\n </Show>\n <Show when={Boolean(disableBiome)}>\n <SingleLineComment>{\"biome-ignore lint: disable\"}</SingleLineComment>\n <hbr />\n </Show>\n <Show when={Boolean(disableEslint) || Boolean(disableBiome)}>\n <hbr />\n </Show>\n <Show when={Boolean(children)}>\n {children}\n <hbr />\n </Show>\n <SingleLineComment>{`Generated by ${\n titleCase(context?.config?.framework) || \"Powerlines\"\n }`}</SingleLineComment>\n <hbr />\n <SingleLineComment>{getFileHeaderWarning(context!)}</SingleLineComment>\n <hbr />\n </>\n );\n}\n\nexport interface TypescriptFileHeaderImportsProps extends SourceFileHeaderProps {\n imports?: TypescriptFileImports;\n builtinImports?: TypescriptFileImports;\n scope?: TSModuleScope;\n}\n\n/**\n * Renders the header for a Powerlines Typescript source file.\n *\n * @param props - The properties for the source file header.\n * @returns The rendered source file header.\n */\nexport function TypescriptFileHeaderImports(\n props: TypescriptFileHeaderImportsProps\n) {\n const { imports: importProps, builtinImports: builtinImportsProps } = props;\n\n const context = usePowerlinesSafe();\n const sourceFile = useSourceFile();\n\n const scope = props.scope ?? sourceFile.scope;\n\n const imports = computed(() => {\n return Object.fromEntries(\n Object.entries(importProps ?? {}).map(([module, importItem]) => [\n module,\n Array.isArray(importItem)\n ? getUniqueBy(importItem, i => (isString(i) ? i : i.alias || i.name))\n : importItem\n ])\n );\n });\n const builtinImports = computed(() => {\n return Object.fromEntries(\n Object.entries(builtinImportsProps ?? {}).map(([module, importItem]) => [\n module,\n Array.isArray(importItem)\n ? getUniqueBy(importItem, i => (isString(i) ? i : i.alias || i.name))\n : importItem\n ])\n );\n });\n\n return (\n <Show\n when={\n scope.importedModules.size > 0 ||\n (!!imports.value && Object.keys(imports.value).length > 0) ||\n (!!builtinImports.value && Object.keys(builtinImports.value).length > 0)\n }>\n <Show when={!!imports.value && Object.keys(imports.value).length > 0}>\n <For\n each={Object.entries(imports.value ?? {})}\n hardline\n ender={<hbr />}>\n {([module, importItem]) =>\n code`import ${\n importItem === null\n ? \"\"\n : isString(importItem)\n ? importItem\n : `${\n (\n importItem.filter(\n i => !isString(i) && i.default\n ) as TypescriptFileImportItem[]\n )\n .map(\n i =>\n `${i.type ? \"type \" : \"\"}${\n i.alias ? i.alias : i.name\n }`\n )\n .join(\", \") +\n (importItem.filter(i => !isString(i) && i.default)\n .length > 0 &&\n importItem.filter(i => isString(i) || !i.default).length >\n 0\n ? \", \"\n : \"\") +\n (importItem.filter(i => isString(i) || !i.default)\n .length > 0\n ? `{ ${importItem\n .filter(i => isString(i) || !i.default)\n .map(i =>\n isString(i)\n ? i\n : `${i.type ? \"type \" : \"\"}${\n i.alias ? `${i.name} as ${i.alias}` : i.name\n }`\n )\n .join(\", \")} }`\n : \"\")\n }`\n } from \"${module}\";`\n }\n </For>\n </Show>\n <Show\n when={\n builtinImports.value && Object.keys(builtinImports.value).length > 0\n }>\n <For\n each={Object.entries(\n (builtinImports.value ?? {}) as Record<\n string,\n null | Array<TypescriptFileImportItem | string>\n >\n )}\n hardline\n ender={<hbr />}>\n {([module, importItem]) =>\n code`import ${\n importItem === null\n ? \"\"\n : isString(importItem)\n ? importItem\n : `${\n (\n importItem.filter(\n i => !isString(i) && i.default\n ) as TypescriptFileImportItem[]\n )\n .map(\n i =>\n `${i.type ? \"type \" : \"\"}${\n i.alias ? i.alias : i.name\n }`\n )\n .join(\", \") +\n (importItem.filter(i => !isString(i) && i.default)\n .length > 0 &&\n importItem.filter(i => isString(i) || !i.default).length >\n 0\n ? \", \"\n : \"\") +\n (importItem.filter(i => isString(i) || !i.default)\n .length > 0\n ? `{ ${importItem\n .filter(i => isString(i) || !i.default)\n .map(i =>\n isString(i)\n ? i\n : `${i.type ? \"type \" : \"\"}${\n i.alias ? `${i.name} as ${i.alias}` : i.name\n }`\n )\n .join(\", \")} }`\n : \"\")\n }`\n } from \"${\n module.includes(\":\")\n ? module\n : `${context?.config?.framework || \"powerlines\"}:${module}`\n }\";`\n }\n </For>\n </Show>\n <Show when={scope.importedModules.size > 0}>\n <ImportStatements records={scope.importedModules} />\n </Show>\n <hbr />\n </Show>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAsCA,SAAS,eAAoB,OAAO;CACpC,MAAQ,CAAC,EACT,UACA,MACA,SACA,gBACA,KACA,QACA,YACA,QAAO,WAAA,OAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA,CAAA;CACL,MAAA,mBAAc,WAAA,uBAAA;CACd,MAAA,SAAA,uBAAqB,iBAAA;CACrB,MAAA,aAAA,WAAwB,MAAA,iBAAA,KAAA;CACxB,MAAA,QAAA,IAAA,cAAA,YAAA,UAAA,CAAA;AACA,QAAO,QAAK,IAAM,MAAA;;AAEpB,KAAM,IACJ,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OAAM;AACJ,aAAE,MAAW,gBAAgB,OAAG;;KAEnC,IAAA,WAAA;AACF,aAAA,gBAAA,kBAAA,EACD,IAAA,UAAA;AACI,cAAA,MAAiB;SAEnB,CAAM;;KAEL,CAAC;IAAA,gBAAc,OAAU,EAAA,CAAA;IAAA;;EAE7B,CAAC"}
@@ -1,7 +1,7 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
2
  const require_runtime = require('../../_virtual/_rolldown/runtime.cjs');
3
- let _alloy_js_core = require("@alloy-js/core");
4
3
  let _alloy_js_core_jsx_runtime = require("@alloy-js/core/jsx-runtime");
4
+ let _alloy_js_core = require("@alloy-js/core");
5
5
  let _alloy_js_typescript = require("@alloy-js/typescript");
6
6
 
7
7
  //#region src/typescript/contexts/lexical-scope.tsx
@@ -14,9 +14,11 @@ function LexicalScope(props) {
14
14
  if (!(props.value instanceof _alloy_js_typescript.TSLexicalScope)) throw new TypeError("LexicalScope value must be a TSLexicalScope instance");
15
15
  scope = props.value;
16
16
  } else scope = (0, _alloy_js_typescript.createLexicalScope)(props.name ?? "Lexical scope", props);
17
- return /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(_alloy_js_core.Scope, {
17
+ return (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Scope, {
18
18
  value: scope,
19
- children: props.children
19
+ get children() {
20
+ return props.children;
21
+ }
20
22
  });
21
23
  }
22
24