@powerlines/plugin-react 0.1.136 → 0.1.138
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/plugin-alloy/src/types/components.d.cts +3 -4
- package/dist/plugin-alloy/src/types/components.d.mts +3 -4
- package/dist/plugin-alloy/src/types/index.d.cts +1 -1
- package/dist/plugin-alloy/src/types/index.d.mts +1 -1
- package/dist/plugin-alloy/src/typescript/components/typescript-file.cjs +14 -2
- package/dist/plugin-alloy/src/typescript/components/typescript-file.mjs +15 -3
- package/dist/powerlines/src/types/build.d.mts +0 -2
- package/dist/powerlines/src/types/resolved.d.mts +0 -1
- package/package.json +6 -6
|
@@ -15,9 +15,8 @@ interface TypescriptFileImportItem {
|
|
|
15
15
|
alias?: string;
|
|
16
16
|
type?: boolean;
|
|
17
17
|
}
|
|
18
|
-
type
|
|
19
|
-
|
|
20
|
-
$builtins?: TypescriptFileImportList;
|
|
18
|
+
type TypescriptFileImports = Record<string, null | Array<TypescriptFileImportItem | string>> & {
|
|
19
|
+
$builtins?: Record<string, null | Array<TypescriptFileImportItem | string>>;
|
|
21
20
|
};
|
|
22
21
|
//#endregion
|
|
23
|
-
export { ComponentProps, TypescriptFileImportItem,
|
|
22
|
+
export { ComponentProps, TypescriptFileImportItem, TypescriptFileImports };
|
|
@@ -16,9 +16,8 @@ interface TypescriptFileImportItem {
|
|
|
16
16
|
alias?: string;
|
|
17
17
|
type?: boolean;
|
|
18
18
|
}
|
|
19
|
-
type
|
|
20
|
-
|
|
21
|
-
$builtins?: TypescriptFileImportList;
|
|
19
|
+
type TypescriptFileImports = Record<string, null | Array<TypescriptFileImportItem | string>> & {
|
|
20
|
+
$builtins?: Record<string, null | Array<TypescriptFileImportItem | string>>;
|
|
22
21
|
};
|
|
23
22
|
//#endregion
|
|
24
|
-
export { ComponentProps, TypescriptFileImportItem,
|
|
23
|
+
export { ComponentProps, TypescriptFileImportItem, TypescriptFileImports };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { ComponentProps, TypescriptFileImportItem,
|
|
1
|
+
import { ComponentProps, TypescriptFileImportItem, TypescriptFileImports } from "./components.cjs";
|
|
2
2
|
import { AlloyPluginContext, AlloyPluginOptions, AlloyPluginResolvedConfig, AlloyPluginUserConfig } from "./plugin.cjs";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { ComponentProps, TypescriptFileImportItem,
|
|
1
|
+
import { ComponentProps, TypescriptFileImportItem, TypescriptFileImports } from "./components.mjs";
|
|
2
2
|
import { AlloyPluginContext, AlloyPluginOptions, AlloyPluginResolvedConfig, AlloyPluginUserConfig } from "./plugin.mjs";
|
|
@@ -167,8 +167,20 @@ function TypescriptFileHeaderImports(props) {
|
|
|
167
167
|
return !!imports && Object.keys(imports).length > 0;
|
|
168
168
|
},
|
|
169
169
|
get children() {
|
|
170
|
-
return
|
|
171
|
-
|
|
170
|
+
return (0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_core.For, {
|
|
171
|
+
get each() {
|
|
172
|
+
return Object.entries(imports ?? {});
|
|
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;
|
|
182
|
+
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
|
+
}
|
|
172
184
|
});
|
|
173
185
|
}
|
|
174
186
|
}),
|
|
@@ -4,7 +4,7 @@ import { SourceFile } from "../../core/components/source-file.mjs";
|
|
|
4
4
|
import { createComponent, createIntrinsic, memo, mergeProps } from "@alloy-js/core/jsx-runtime";
|
|
5
5
|
import { titleCase } from "@stryke/string-format/title-case";
|
|
6
6
|
import { isString } from "@stryke/type-checks/is-string";
|
|
7
|
-
import { Scope, Show, SourceDirectoryContext, code, splitProps, useContext, useScope } from "@alloy-js/core";
|
|
7
|
+
import { For, Scope, Show, SourceDirectoryContext, code, splitProps, useContext, useScope } from "@alloy-js/core";
|
|
8
8
|
import { appendPath } from "@stryke/path/append";
|
|
9
9
|
import { ImportStatements, PackageContext, SourceFileContext as SourceFileContext$1, TSModuleScope, getSourceDirectoryData, useSourceFile } from "@alloy-js/typescript";
|
|
10
10
|
import { isBoolean } from "@stryke/type-checks/is-boolean";
|
|
@@ -166,8 +166,20 @@ function TypescriptFileHeaderImports(props) {
|
|
|
166
166
|
return !!imports && Object.keys(imports).length > 0;
|
|
167
167
|
},
|
|
168
168
|
get children() {
|
|
169
|
-
return
|
|
170
|
-
|
|
169
|
+
return createComponent(For, {
|
|
170
|
+
get each() {
|
|
171
|
+
return Object.entries(imports ?? {});
|
|
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;
|
|
181
|
+
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
|
+
}
|
|
171
183
|
});
|
|
172
184
|
}
|
|
173
185
|
}),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@powerlines/plugin-react",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.138",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "A package containing a Powerlines plugin for building a React application.",
|
|
6
6
|
"repository": {
|
|
@@ -140,9 +140,9 @@
|
|
|
140
140
|
"@alloy-js/json": "^0.22.0",
|
|
141
141
|
"@alloy-js/markdown": "^0.22.0",
|
|
142
142
|
"@alloy-js/typescript": "^0.22.0",
|
|
143
|
-
"@powerlines/plugin-alloy": "^0.18.
|
|
144
|
-
"@powerlines/plugin-babel": "^0.12.
|
|
145
|
-
"@powerlines/plugin-env": "^0.15.
|
|
143
|
+
"@powerlines/plugin-alloy": "^0.18.7",
|
|
144
|
+
"@powerlines/plugin-babel": "^0.12.134",
|
|
145
|
+
"@powerlines/plugin-env": "^0.15.9",
|
|
146
146
|
"@storm-software/config-tools": "^1.188.75",
|
|
147
147
|
"@stryke/cli": "^0.12.37",
|
|
148
148
|
"@stryke/convert": "^0.6.30",
|
|
@@ -151,7 +151,7 @@
|
|
|
151
151
|
"@vitejs/plugin-react": "^5.1.2",
|
|
152
152
|
"babel-plugin-react-compiler": "^1.0.0",
|
|
153
153
|
"defu": "^6.1.4",
|
|
154
|
-
"powerlines": "^0.36.
|
|
154
|
+
"powerlines": "^0.36.29"
|
|
155
155
|
},
|
|
156
156
|
"devDependencies": {
|
|
157
157
|
"@babel/core": "^7.28.5",
|
|
@@ -162,5 +162,5 @@
|
|
|
162
162
|
"react-dom": "^19.2.3"
|
|
163
163
|
},
|
|
164
164
|
"publishConfig": { "access": "public" },
|
|
165
|
-
"gitHead": "
|
|
165
|
+
"gitHead": "8c096ca8c2383603e770532ec0f828761d525947"
|
|
166
166
|
}
|