@powerlines/plugin-react 0.1.269 → 0.1.271
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/components/index.cjs +3 -2
- package/dist/components/index.d.cts +2 -1
- package/dist/components/index.d.mts +2 -1
- package/dist/components/index.mjs +2 -1
- package/dist/components/react-optimized.cjs +2 -48
- package/dist/components/react-optimized.d.cts +1 -13
- package/dist/components/react-optimized.d.mts +1 -13
- package/dist/components/react-optimized.mjs +1 -45
- package/dist/components-BWLXb7a2.cjs +0 -0
- package/dist/components-D-mbfYAe.mjs +1 -0
- package/dist/index-BL32-cvv.d.cts +1 -0
- package/dist/index-Bk0eNZmQ.d.mts +1 -0
- package/dist/index-CmCelmEL.d.cts +1 -0
- package/dist/index-vkGVyY9v.d.mts +1 -0
- package/dist/index.cjs +11 -9
- package/dist/index.d.cts +7 -6
- package/dist/index.d.cts.map +1 -0
- package/dist/index.d.mts +7 -6
- package/dist/index.d.mts.map +1 -0
- package/dist/index.mjs +7 -3
- package/dist/index.mjs.map +1 -0
- package/dist/plugin-DVsOZIzd.d.cts +74 -0
- package/dist/plugin-DVsOZIzd.d.cts.map +1 -0
- package/dist/plugin-DhNM9Rg6.d.mts +74 -0
- package/dist/plugin-DhNM9Rg6.d.mts.map +1 -0
- package/dist/plugin-jZ9N9Mz-.mjs +1 -0
- package/dist/plugin-pBKbb5K9.cjs +0 -0
- package/dist/react-optimized-CTa8f7Os.d.mts +15 -0
- package/dist/react-optimized-CTa8f7Os.d.mts.map +1 -0
- package/dist/react-optimized-D1ur_Vdk.d.cts +15 -0
- package/dist/react-optimized-D1ur_Vdk.d.cts.map +1 -0
- package/dist/react-optimized-DR69Ucl1.mjs +48 -0
- package/dist/react-optimized-DR69Ucl1.mjs.map +1 -0
- package/dist/react-optimized-Da8x1wtW.cjs +86 -0
- package/dist/runtime-BKY6WvHV.mjs +1 -0
- package/dist/runtime-Bj2UD25S.d.mts +16 -0
- package/dist/runtime-Bj2UD25S.d.mts.map +1 -0
- package/dist/runtime-Bp9G0scd.cjs +0 -0
- package/dist/runtime-Co2VNPJW.d.cts +16 -0
- package/dist/runtime-Co2VNPJW.d.cts.map +1 -0
- package/dist/types/index.cjs +3 -0
- package/dist/types/index.d.cts +3 -2
- package/dist/types/index.d.mts +3 -2
- package/dist/types/index.mjs +4 -0
- package/dist/types/plugin.cjs +1 -0
- package/dist/types/plugin.d.cts +1 -72
- package/dist/types/plugin.d.mts +1 -72
- package/dist/types/plugin.mjs +2 -0
- package/dist/types/runtime.cjs +1 -0
- package/dist/types/runtime.d.cts +1 -14
- package/dist/types/runtime.d.mts +1 -14
- package/dist/types/runtime.mjs +2 -0
- package/dist/types--fVOUYBq.mjs +1 -0
- package/dist/types-a8gm_IaQ.cjs +0 -0
- package/package.json +7 -7
- package/dist/_virtual/rolldown_runtime.cjs +0 -29
|
@@ -1,3 +1,4 @@
|
|
|
1
|
-
const
|
|
1
|
+
const require_react_optimized = require('../react-optimized-Da8x1wtW.cjs');
|
|
2
|
+
require('../components-BWLXb7a2.cjs');
|
|
2
3
|
|
|
3
|
-
exports.ReactOptimizedBuiltin =
|
|
4
|
+
exports.ReactOptimizedBuiltin = require_react_optimized.ReactOptimizedBuiltin;
|
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { n as ReactOptimizedBuiltinProps, r as __ΩReactOptimizedBuiltinProps, t as ReactOptimizedBuiltin } from "../react-optimized-D1ur_Vdk.cjs";
|
|
2
|
+
import "../index-CmCelmEL.cjs";
|
|
2
3
|
export { ReactOptimizedBuiltin, ReactOptimizedBuiltinProps, __ΩReactOptimizedBuiltinProps };
|
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { n as ReactOptimizedBuiltinProps, r as __ΩReactOptimizedBuiltinProps, t as ReactOptimizedBuiltin } from "../react-optimized-CTa8f7Os.mjs";
|
|
2
|
+
import "../index-vkGVyY9v.mjs";
|
|
2
3
|
export { ReactOptimizedBuiltin, ReactOptimizedBuiltinProps, __ΩReactOptimizedBuiltinProps };
|
|
@@ -1,49 +1,3 @@
|
|
|
1
|
-
const
|
|
2
|
-
let __alloy_js_core_jsx_runtime = require("@alloy-js/core/jsx-runtime");
|
|
3
|
-
let defu = require("defu");
|
|
4
|
-
defu = require_rolldown_runtime.__toESM(defu);
|
|
5
|
-
let __alloy_js_core = require("@alloy-js/core");
|
|
6
|
-
let __alloy_js_typescript = require("@alloy-js/typescript");
|
|
7
|
-
let __powerlines_plugin_alloy_helpers_refkey = require("@powerlines/plugin-alloy/helpers/refkey");
|
|
8
|
-
let __powerlines_plugin_alloy_typescript_components_builtin_file = require("@powerlines/plugin-alloy/typescript/components/builtin-file");
|
|
9
|
-
let __powerlines_plugin_alloy_typescript_components_tsdoc = require("@powerlines/plugin-alloy/typescript/components/tsdoc");
|
|
1
|
+
const require_react_optimized = require('../react-optimized-Da8x1wtW.cjs');
|
|
10
2
|
|
|
11
|
-
|
|
12
|
-
const isOptimizationEnabledRefkey = (0, __powerlines_plugin_alloy_helpers_refkey.refkey)("isOptimizationEnabled");
|
|
13
|
-
/**
|
|
14
|
-
* Generates the `react/optimized` builtin module for the Powerlines project.
|
|
15
|
-
*/
|
|
16
|
-
function ReactOptimizedBuiltin(props) {
|
|
17
|
-
const [{ override }, rest] = (0, __alloy_js_core.splitProps)(props, ["override"]);
|
|
18
|
-
return (0, __alloy_js_core_jsx_runtime.createComponent)(__powerlines_plugin_alloy_typescript_components_builtin_file.BuiltinFile, (0, __alloy_js_core_jsx_runtime.mergeProps)(rest, {
|
|
19
|
-
id: "react/optimized",
|
|
20
|
-
description: "A built-in module to provide access to environment configuration to determine React optimizations.",
|
|
21
|
-
get builtinImports() {
|
|
22
|
-
return (0, defu.default)({ env: ["env", "isDevelopment"] }, rest.builtinImports ?? {});
|
|
23
|
-
},
|
|
24
|
-
get children() {
|
|
25
|
-
return [(0, __alloy_js_core_jsx_runtime.createComponent)(__powerlines_plugin_alloy_typescript_components_tsdoc.TSDoc, {
|
|
26
|
-
heading: "A gating function to determine if the optimized [React compiler](https://react.dev/reference/react-compiler) source code should be used.",
|
|
27
|
-
get children() {
|
|
28
|
-
return [(0, __alloy_js_core_jsx_runtime.createComponent)(__powerlines_plugin_alloy_typescript_components_tsdoc.TSDocLink, { children: `https://react.dev/reference/react-compiler/gating` }), (0, __alloy_js_core_jsx_runtime.createComponent)(__powerlines_plugin_alloy_typescript_components_tsdoc.TSDocReturns, { children: `A boolean indicating if the React compiler's optimizations should be used.` })];
|
|
29
|
-
}
|
|
30
|
-
}), (0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_typescript.FunctionDeclaration, {
|
|
31
|
-
refkey: isOptimizationEnabledRefkey,
|
|
32
|
-
async: false,
|
|
33
|
-
"export": true,
|
|
34
|
-
name: "isOptimizationEnabled",
|
|
35
|
-
returnType: "boolean",
|
|
36
|
-
get children() {
|
|
37
|
-
return [(0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_core.Show, {
|
|
38
|
-
when: override !== void 0,
|
|
39
|
-
fallback: __alloy_js_core.code`return !env.DISABLE_REACT_COMPILER && !isDevelopment; `,
|
|
40
|
-
children: __alloy_js_core.code`return ${override};`
|
|
41
|
-
}), (0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {})];
|
|
42
|
-
}
|
|
43
|
-
})];
|
|
44
|
-
}
|
|
45
|
-
}));
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
//#endregion
|
|
49
|
-
exports.ReactOptimizedBuiltin = ReactOptimizedBuiltin;
|
|
3
|
+
exports.ReactOptimizedBuiltin = require_react_optimized.ReactOptimizedBuiltin;
|
|
@@ -1,14 +1,2 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { BuiltinFileProps } from "@powerlines/plugin-alloy/typescript/components/builtin-file";
|
|
3
|
-
|
|
4
|
-
//#region src/components/react-optimized.d.ts
|
|
5
|
-
interface ReactOptimizedBuiltinProps extends Omit<BuiltinFileProps, "id"> {
|
|
6
|
-
override?: boolean;
|
|
7
|
-
}
|
|
8
|
-
/**
|
|
9
|
-
* Generates the `react/optimized` builtin module for the Powerlines project.
|
|
10
|
-
*/
|
|
11
|
-
declare function ReactOptimizedBuiltin(props: ReactOptimizedBuiltinProps): _alloy_js_core0.Children;
|
|
12
|
-
declare type __ΩReactOptimizedBuiltinProps = any[];
|
|
13
|
-
//#endregion
|
|
1
|
+
import { n as ReactOptimizedBuiltinProps, r as __ΩReactOptimizedBuiltinProps, t as ReactOptimizedBuiltin } from "../react-optimized-D1ur_Vdk.cjs";
|
|
14
2
|
export { ReactOptimizedBuiltin, ReactOptimizedBuiltinProps, __ΩReactOptimizedBuiltinProps };
|
|
@@ -1,14 +1,2 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { BuiltinFileProps } from "@powerlines/plugin-alloy/typescript/components/builtin-file";
|
|
3
|
-
|
|
4
|
-
//#region src/components/react-optimized.d.ts
|
|
5
|
-
interface ReactOptimizedBuiltinProps extends Omit<BuiltinFileProps, "id"> {
|
|
6
|
-
override?: boolean;
|
|
7
|
-
}
|
|
8
|
-
/**
|
|
9
|
-
* Generates the `react/optimized` builtin module for the Powerlines project.
|
|
10
|
-
*/
|
|
11
|
-
declare function ReactOptimizedBuiltin(props: ReactOptimizedBuiltinProps): _alloy_js_core0.Children;
|
|
12
|
-
declare type __ΩReactOptimizedBuiltinProps = any[];
|
|
13
|
-
//#endregion
|
|
1
|
+
import { n as ReactOptimizedBuiltinProps, r as __ΩReactOptimizedBuiltinProps, t as ReactOptimizedBuiltin } from "../react-optimized-CTa8f7Os.mjs";
|
|
14
2
|
export { ReactOptimizedBuiltin, ReactOptimizedBuiltinProps, __ΩReactOptimizedBuiltinProps };
|
|
@@ -1,47 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import defu from "defu";
|
|
3
|
-
import { Show, code, splitProps } from "@alloy-js/core";
|
|
4
|
-
import { FunctionDeclaration } from "@alloy-js/typescript";
|
|
5
|
-
import { refkey } from "@powerlines/plugin-alloy/helpers/refkey";
|
|
6
|
-
import { BuiltinFile } from "@powerlines/plugin-alloy/typescript/components/builtin-file";
|
|
7
|
-
import { TSDoc, TSDocLink, TSDocReturns } from "@powerlines/plugin-alloy/typescript/components/tsdoc";
|
|
1
|
+
import { t as ReactOptimizedBuiltin } from "../react-optimized-DR69Ucl1.mjs";
|
|
8
2
|
|
|
9
|
-
//#region src/components/react-optimized.tsx
|
|
10
|
-
const isOptimizationEnabledRefkey = refkey("isOptimizationEnabled");
|
|
11
|
-
/**
|
|
12
|
-
* Generates the `react/optimized` builtin module for the Powerlines project.
|
|
13
|
-
*/
|
|
14
|
-
function ReactOptimizedBuiltin(props) {
|
|
15
|
-
const [{ override }, rest] = splitProps(props, ["override"]);
|
|
16
|
-
return createComponent(BuiltinFile, mergeProps(rest, {
|
|
17
|
-
id: "react/optimized",
|
|
18
|
-
description: "A built-in module to provide access to environment configuration to determine React optimizations.",
|
|
19
|
-
get builtinImports() {
|
|
20
|
-
return defu({ env: ["env", "isDevelopment"] }, rest.builtinImports ?? {});
|
|
21
|
-
},
|
|
22
|
-
get children() {
|
|
23
|
-
return [createComponent(TSDoc, {
|
|
24
|
-
heading: "A gating function to determine if the optimized [React compiler](https://react.dev/reference/react-compiler) source code should be used.",
|
|
25
|
-
get children() {
|
|
26
|
-
return [createComponent(TSDocLink, { children: `https://react.dev/reference/react-compiler/gating` }), createComponent(TSDocReturns, { children: `A boolean indicating if the React compiler's optimizations should be used.` })];
|
|
27
|
-
}
|
|
28
|
-
}), createComponent(FunctionDeclaration, {
|
|
29
|
-
refkey: isOptimizationEnabledRefkey,
|
|
30
|
-
async: false,
|
|
31
|
-
"export": true,
|
|
32
|
-
name: "isOptimizationEnabled",
|
|
33
|
-
returnType: "boolean",
|
|
34
|
-
get children() {
|
|
35
|
-
return [createComponent(Show, {
|
|
36
|
-
when: override !== void 0,
|
|
37
|
-
fallback: code`return !env.DISABLE_REACT_COMPILER && !isDevelopment; `,
|
|
38
|
-
children: code`return ${override};`
|
|
39
|
-
}), createIntrinsic("hbr", {})];
|
|
40
|
-
}
|
|
41
|
-
})];
|
|
42
|
-
}
|
|
43
|
-
}));
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
//#endregion
|
|
47
3
|
export { ReactOptimizedBuiltin };
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { };
|
package/dist/index.cjs
CHANGED
|
@@ -1,18 +1,20 @@
|
|
|
1
1
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
2
|
-
const
|
|
3
|
-
|
|
4
|
-
require('./
|
|
2
|
+
const require_react_optimized = require('./react-optimized-Da8x1wtW.cjs');
|
|
3
|
+
require('./components-BWLXb7a2.cjs');
|
|
4
|
+
require('./plugin-pBKbb5K9.cjs');
|
|
5
|
+
require('./runtime-Bp9G0scd.cjs');
|
|
6
|
+
require('./types-a8gm_IaQ.cjs');
|
|
5
7
|
let __alloy_js_core_jsx_runtime = require("@alloy-js/core/jsx-runtime");
|
|
6
8
|
let __powerlines_deepkit_vendor_type = require("@powerlines/deepkit/vendor/type");
|
|
7
9
|
let __powerlines_plugin_babel = require("@powerlines/plugin-babel");
|
|
8
|
-
__powerlines_plugin_babel =
|
|
10
|
+
__powerlines_plugin_babel = require_react_optimized.__toESM(__powerlines_plugin_babel);
|
|
9
11
|
let __powerlines_plugin_env = require("@powerlines/plugin-env");
|
|
10
|
-
__powerlines_plugin_env =
|
|
12
|
+
__powerlines_plugin_env = require_react_optimized.__toESM(__powerlines_plugin_env);
|
|
11
13
|
let __storm_software_config_tools_types = require("@storm-software/config-tools/types");
|
|
12
14
|
let __vitejs_plugin_react = require("@vitejs/plugin-react");
|
|
13
|
-
__vitejs_plugin_react =
|
|
15
|
+
__vitejs_plugin_react = require_react_optimized.__toESM(__vitejs_plugin_react);
|
|
14
16
|
let defu = require("defu");
|
|
15
|
-
defu =
|
|
17
|
+
defu = require_react_optimized.__toESM(defu);
|
|
16
18
|
let powerlines_lib_typescript_tsconfig = require("powerlines/lib/typescript/tsconfig");
|
|
17
19
|
|
|
18
20
|
//#region src/index.tsx
|
|
@@ -91,7 +93,7 @@ const plugin = (options = {}) => {
|
|
|
91
93
|
},
|
|
92
94
|
async prepare() {
|
|
93
95
|
const _self$ = this;
|
|
94
|
-
return this.render((0, __alloy_js_core_jsx_runtime.createComponent)(
|
|
96
|
+
return this.render((0, __alloy_js_core_jsx_runtime.createComponent)(require_react_optimized.ReactOptimizedBuiltin, { get override() {
|
|
95
97
|
return _self$.config.react.compiler === false ? false : void 0;
|
|
96
98
|
} }));
|
|
97
99
|
}
|
|
@@ -101,6 +103,6 @@ const plugin = (options = {}) => {
|
|
|
101
103
|
var src_default = plugin;
|
|
102
104
|
|
|
103
105
|
//#endregion
|
|
104
|
-
exports.ReactOptimizedBuiltin =
|
|
106
|
+
exports.ReactOptimizedBuiltin = require_react_optimized.ReactOptimizedBuiltin;
|
|
105
107
|
exports.default = src_default;
|
|
106
108
|
exports.plugin = plugin;
|
package/dist/index.d.cts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import "./
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import "./
|
|
1
|
+
import { n as ReactOptimizedBuiltinProps, r as __ΩReactOptimizedBuiltinProps, t as ReactOptimizedBuiltin } from "./react-optimized-D1ur_Vdk.cjs";
|
|
2
|
+
import "./index-CmCelmEL.cjs";
|
|
3
|
+
import { a as ReactPluginUserConfig, c as __ΩReactPluginOptions, i as ReactPluginResolvedConfig, l as __ΩReactPluginResolvedConfig, n as ReactPluginContext, o as __ΩReactCompilerOptions, r as ReactPluginOptions, s as __ΩReactPluginContext, t as ReactCompilerOptions, u as __ΩReactPluginUserConfig } from "./plugin-DVsOZIzd.cjs";
|
|
4
|
+
import { n as __ΩReactEnvInterface, t as ReactEnvInterface } from "./runtime-Co2VNPJW.cjs";
|
|
5
|
+
import "./index-BL32-cvv.cjs";
|
|
6
6
|
import { Plugin } from "powerlines/types/plugin";
|
|
7
7
|
|
|
8
8
|
//#region src/index.d.ts
|
|
@@ -11,4 +11,5 @@ import { Plugin } from "powerlines/types/plugin";
|
|
|
11
11
|
*/
|
|
12
12
|
declare const plugin: <TContext extends ReactPluginContext = ReactPluginContext>(options?: ReactPluginOptions) => Plugin<TContext>[];
|
|
13
13
|
//#endregion
|
|
14
|
-
export { ReactCompilerOptions, ReactEnvInterface, ReactOptimizedBuiltin, ReactOptimizedBuiltinProps, ReactPluginContext, ReactPluginOptions, ReactPluginResolvedConfig, ReactPluginUserConfig, __ΩReactCompilerOptions, __ΩReactEnvInterface, __ΩReactOptimizedBuiltinProps, __ΩReactPluginContext, __ΩReactPluginOptions, __ΩReactPluginResolvedConfig, __ΩReactPluginUserConfig, plugin as default, plugin };
|
|
14
|
+
export { ReactCompilerOptions, ReactEnvInterface, ReactOptimizedBuiltin, ReactOptimizedBuiltinProps, ReactPluginContext, ReactPluginOptions, ReactPluginResolvedConfig, ReactPluginUserConfig, __ΩReactCompilerOptions, __ΩReactEnvInterface, __ΩReactOptimizedBuiltinProps, __ΩReactPluginContext, __ΩReactPluginOptions, __ΩReactPluginResolvedConfig, __ΩReactPluginUserConfig, plugin as default, plugin };
|
|
15
|
+
//# sourceMappingURL=index.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.cts","names":[],"sources":["../src/index.tsx"],"sourcesContent":[],"mappings":";;;;;;;;;;;cAyCa,0BACM,qBAAqB,8BAE7B,uBAiMJ,OAAO"}
|
package/dist/index.d.mts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import "./
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import "./
|
|
1
|
+
import { n as ReactOptimizedBuiltinProps, r as __ΩReactOptimizedBuiltinProps, t as ReactOptimizedBuiltin } from "./react-optimized-CTa8f7Os.mjs";
|
|
2
|
+
import "./index-vkGVyY9v.mjs";
|
|
3
|
+
import { a as ReactPluginUserConfig, c as __ΩReactPluginOptions, i as ReactPluginResolvedConfig, l as __ΩReactPluginResolvedConfig, n as ReactPluginContext, o as __ΩReactCompilerOptions, r as ReactPluginOptions, s as __ΩReactPluginContext, t as ReactCompilerOptions, u as __ΩReactPluginUserConfig } from "./plugin-DhNM9Rg6.mjs";
|
|
4
|
+
import { n as __ΩReactEnvInterface, t as ReactEnvInterface } from "./runtime-Bj2UD25S.mjs";
|
|
5
|
+
import "./index-Bk0eNZmQ.mjs";
|
|
6
6
|
import { Plugin } from "powerlines/types/plugin";
|
|
7
7
|
|
|
8
8
|
//#region src/index.d.ts
|
|
@@ -11,4 +11,5 @@ import { Plugin } from "powerlines/types/plugin";
|
|
|
11
11
|
*/
|
|
12
12
|
declare const plugin: <TContext extends ReactPluginContext = ReactPluginContext>(options?: ReactPluginOptions) => Plugin<TContext>[];
|
|
13
13
|
//#endregion
|
|
14
|
-
export { ReactCompilerOptions, ReactEnvInterface, ReactOptimizedBuiltin, ReactOptimizedBuiltinProps, ReactPluginContext, ReactPluginOptions, ReactPluginResolvedConfig, ReactPluginUserConfig, __ΩReactCompilerOptions, __ΩReactEnvInterface, __ΩReactOptimizedBuiltinProps, __ΩReactPluginContext, __ΩReactPluginOptions, __ΩReactPluginResolvedConfig, __ΩReactPluginUserConfig, plugin as default, plugin };
|
|
14
|
+
export { ReactCompilerOptions, ReactEnvInterface, ReactOptimizedBuiltin, ReactOptimizedBuiltinProps, ReactPluginContext, ReactPluginOptions, ReactPluginResolvedConfig, ReactPluginUserConfig, __ΩReactCompilerOptions, __ΩReactEnvInterface, __ΩReactOptimizedBuiltinProps, __ΩReactPluginContext, __ΩReactPluginOptions, __ΩReactPluginResolvedConfig, __ΩReactPluginUserConfig, plugin as default, plugin };
|
|
15
|
+
//# sourceMappingURL=index.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.mts","names":[],"sources":["../src/index.tsx"],"sourcesContent":[],"mappings":";;;;;;;;;;;cAyCa,0BACM,qBAAqB,8BAE7B,uBAiMJ,OAAO"}
|
package/dist/index.mjs
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
|
-
import { ReactOptimizedBuiltin } from "./
|
|
2
|
-
import "./components
|
|
1
|
+
import { t as ReactOptimizedBuiltin } from "./react-optimized-DR69Ucl1.mjs";
|
|
2
|
+
import "./components-D-mbfYAe.mjs";
|
|
3
|
+
import "./plugin-jZ9N9Mz-.mjs";
|
|
4
|
+
import "./runtime-BKY6WvHV.mjs";
|
|
5
|
+
import "./types--fVOUYBq.mjs";
|
|
3
6
|
import { createComponent } from "@alloy-js/core/jsx-runtime";
|
|
4
7
|
import { ReflectionKind, ReflectionVisibility } from "@powerlines/deepkit/vendor/type";
|
|
5
8
|
import babel from "@powerlines/plugin-babel";
|
|
@@ -95,4 +98,5 @@ const plugin = (options = {}) => {
|
|
|
95
98
|
var src_default = plugin;
|
|
96
99
|
|
|
97
100
|
//#endregion
|
|
98
|
-
export { ReactOptimizedBuiltin, src_default as default, plugin };
|
|
101
|
+
export { ReactOptimizedBuiltin, src_default as default, plugin };
|
|
102
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.mjs","names":["ReflectionKind","ReflectionVisibility","babel","env","LogLevelLabel","viteReactPlugin","defu","isMatchFound","ReactOptimizedBuiltin","plugin","options","name","config","react","jsxImportSource","tsconfig","tsconfigJson","compilerOptions","jsxRuntime","compiler","target","compilationMode","gating","source","framework","importSpecifierName","enableReanimatedCheck","logger","logEvent","filename","event","log","kind","SUCCESS","INFO","DEBUG","TRACE","ERROR","depArrayLoc","identifierName","decorations","filter","dec","map","join","reason","detail","category","description","measurement","entryType","duration","fnLoc","configResolved","dependencies","devDependencies","transform","plugins","push","lib","module","jsx","environment","consumer","resolveJsonModule","build","variant","types","viteBuildConfig","unshift","reactRefreshHost","hasProperty","addProperty","optional","readonly","visibility","public","type","boolean","default","prepare","_self$","render","_$createComponent","override","undefined"],"sources":["../src/index.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 {\n ReflectionKind,\n ReflectionVisibility\n} from \"@powerlines/deepkit/vendor/type\";\nimport babel from \"@powerlines/plugin-babel\";\nimport env from \"@powerlines/plugin-env\";\nimport { LogLevelLabel } from \"@storm-software/config-tools/types\";\nimport viteReactPlugin from \"@vitejs/plugin-react\";\nimport type { LoggerEvent } from \"babel-plugin-react-compiler\";\nimport defu from \"defu\";\nimport { isMatchFound } from \"powerlines/lib/typescript/tsconfig\";\nimport type { ViteResolvedBuildConfig } from \"powerlines/types/build\";\nimport { Plugin } from \"powerlines/types/plugin\";\nimport type { BabelResolvedConfig } from \"powerlines/types/resolved\";\nimport { ReactOptimizedBuiltin } from \"./components/react-optimized\";\nimport type { ReactPluginContext, ReactPluginOptions } from \"./types/plugin\";\n\nexport * from \"./components\";\nexport * from \"./types\";\n\n/**\n * A package containing a Powerlines plugin for building a React application.\n */\nexport const plugin = <\n TContext extends ReactPluginContext = ReactPluginContext\n>(\n options: ReactPluginOptions = {}\n) => {\n return [\n babel(options.babel),\n env(options.env),\n {\n name: \"react\",\n config() {\n return defu(\n {\n react: options\n },\n {\n react: {\n jsxImportSource: this.tsconfig.tsconfigJson.compilerOptions\n ?.jsxImportSource as string\n }\n },\n {\n react: {\n jsxRuntime: \"automatic\",\n jsxImportSource: \"react\",\n compiler: {\n target: \"19\",\n compilationMode: \"infer\",\n gating: {\n source: `${this.config.framework}:react/optimized`,\n importSpecifierName: \"isOptimizationEnabled\"\n },\n enableReanimatedCheck: true,\n logger: {\n logEvent: (filename: string | null, event: LoggerEvent) => {\n this.log(\n event.kind === \"CompileSuccess\"\n ? LogLevelLabel.SUCCESS\n : event.kind === \"AutoDepsEligible\" ||\n event.kind === \"AutoDepsDecorations\"\n ? LogLevelLabel.INFO\n : event.kind === \"CompileSkip\" ||\n event.kind === \"CompileDiagnostic\"\n ? LogLevelLabel.DEBUG\n : event.kind === \"Timing\"\n ? LogLevelLabel.TRACE\n : LogLevelLabel.ERROR,\n `(${filename}) ${\n event.kind === \"CompileSuccess\"\n ? `React Compiler Success`\n : event.kind === \"AutoDepsEligible\"\n ? `React AutoDeps Eligible - ${\n event.depArrayLoc.identifierName ||\n \"No identifier\"\n }`\n : event.kind === \"AutoDepsDecorations\"\n ? `React AutoDeps Decorations - ${event.decorations\n .filter(dec => dec.identifierName)\n .map(dec => dec.identifierName)\n .join(\", \")}`\n : event.kind === \"CompileSkip\"\n ? `React Compile Skip - ${event.reason}`\n : event.kind === \"CompileDiagnostic\"\n ? `React Compile Diagnostic - (Category: ${\n event.detail.category\n }) ${event.detail.reason}${\n event.detail.description\n ? `\\n${event.detail.description}`\n : \"\"\n }`\n : event.kind === \"Timing\"\n ? `React ${event.measurement.entryType} Timing (${event.measurement.name}) - ${event.measurement.duration}ms`\n : `React Compiler Error - ${event.fnLoc?.identifierName || \"unknown location\"}`\n }`\n );\n }\n }\n }\n } as ReactPluginOptions\n }\n );\n },\n configResolved() {\n this.dependencies.react = \"^19.2.3\";\n this.dependencies[\"react-dom\"] = \"^19.2.3\";\n\n this.devDependencies[\"@types/react\"] = \"^19.2.3\";\n this.devDependencies[\"@types/react-dom\"] = \"^19.2.3\";\n\n if (this.config.react.compiler !== false) {\n this.config.transform.babel ??= {} as BabelResolvedConfig;\n\n this.config.transform.babel.plugins ??= [];\n this.config.transform.babel.plugins.push([\n \"babel-plugin-react-compiler\",\n this.config.react.compiler\n ]);\n }\n\n this.tsconfig.tsconfigJson.compilerOptions ??= {};\n this.tsconfig.tsconfigJson.compilerOptions.lib ??= [];\n this.tsconfig.tsconfigJson.compilerOptions.module ??= \"esnext\";\n this.tsconfig.tsconfigJson.compilerOptions.jsxImportSource =\n this.config.react.jsxImportSource;\n\n if (this.tsconfig.options.jsxImportSource === \"react\") {\n this.tsconfig.tsconfigJson.compilerOptions.jsx ??= \"react-jsx\";\n } else {\n this.tsconfig.tsconfigJson.compilerOptions.jsx ??= \"preserve\";\n }\n\n // Client platform\n if (this.environment.consumer === \"client\") {\n if (\n !isMatchFound(\"dom\", this.tsconfig.tsconfigJson.compilerOptions.lib)\n ) {\n this.tsconfig.tsconfigJson.compilerOptions.lib.push(\"DOM\");\n }\n\n if (\n !isMatchFound(\n \"dom.iterable\",\n this.tsconfig.tsconfigJson.compilerOptions.lib\n )\n ) {\n this.tsconfig.tsconfigJson.compilerOptions.lib.push(\"DOM.Iterable\");\n }\n }\n\n if (\n !isMatchFound(\n \"esnext\",\n this.tsconfig.tsconfigJson.compilerOptions.lib\n )\n ) {\n this.tsconfig.tsconfigJson.compilerOptions.lib.push(\"ESNext\");\n }\n\n if (this.tsconfig.options.resolveJsonModule !== true) {\n this.tsconfig.tsconfigJson.compilerOptions.resolveJsonModule = true;\n }\n\n if (this.config.build.variant === \"vite\") {\n this.tsconfig.tsconfigJson.compilerOptions.types ??= [];\n\n if (\n !isMatchFound(\n \"vite/client\",\n this.tsconfig.tsconfigJson.compilerOptions.types\n )\n ) {\n this.tsconfig.tsconfigJson.compilerOptions.types.push(\n \"vite/client\"\n );\n }\n\n const viteBuildConfig = this.config.build as ViteResolvedBuildConfig;\n viteBuildConfig.build ??= {};\n viteBuildConfig.build.target = \"chrome95\";\n\n viteBuildConfig.plugins ??= [];\n viteBuildConfig.plugins.unshift(\n viteReactPlugin({\n babel: this.config.transform.babel,\n jsxImportSource: this.config.react.jsxImportSource,\n jsxRuntime: this.config.react.jsxRuntime,\n reactRefreshHost: this.config.react.reactRefreshHost\n })\n );\n }\n\n if (\n this.env?.types?.env &&\n !this.env.types.env.hasProperty(\"DISABLE_REACT_COMPILER\")\n ) {\n this.env.types.env.addProperty({\n name: \"DISABLE_REACT_COMPILER\",\n optional: true,\n readonly: true,\n description: \"Disables the React compiler optimizations.\",\n visibility: ReflectionVisibility.public,\n type: {\n kind: ReflectionKind.boolean\n },\n default: false\n });\n }\n },\n async prepare() {\n return this.render(\n <ReactOptimizedBuiltin\n override={this.config.react.compiler === false ? false : undefined}\n />\n );\n }\n }\n ] as Plugin<TContext>[];\n};\n\nexport default plugin;\n"],"mappings":"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"}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { BabelPluginOptions } from "@powerlines/plugin-babel/types/plugin";
|
|
2
|
+
import { EnvPluginContext, EnvPluginOptions, EnvPluginResolvedConfig, EnvPluginUserConfig } from "@powerlines/plugin-env/types/plugin";
|
|
3
|
+
import { PluginOptions } from "babel-plugin-react-compiler";
|
|
4
|
+
|
|
5
|
+
//#region src/types/plugin.d.ts
|
|
6
|
+
type ReactCompilerOptions = Omit<PluginOptions, "logger">;
|
|
7
|
+
interface ReactPluginOptions {
|
|
8
|
+
/**
|
|
9
|
+
* Control where the JSX factory is imported from.
|
|
10
|
+
*
|
|
11
|
+
* @see https://esbuild.github.io/api/#jsx-import-source
|
|
12
|
+
*
|
|
13
|
+
* @defaultValue "react"
|
|
14
|
+
*/
|
|
15
|
+
jsxImportSource?: string;
|
|
16
|
+
/**
|
|
17
|
+
* Control how JSX is transformed.
|
|
18
|
+
*
|
|
19
|
+
* @remarks
|
|
20
|
+
* Skipping React import with classic runtime is not supported from v4
|
|
21
|
+
*
|
|
22
|
+
* @defaultValue "automatic"
|
|
23
|
+
*/
|
|
24
|
+
jsxRuntime?: "classic" | "automatic";
|
|
25
|
+
/**
|
|
26
|
+
* Options provided to the [React Compiler](https://npmjs.com/package/babel-plugin-react-compiler).
|
|
27
|
+
*
|
|
28
|
+
* @see https://github.com/facebook/react/blob/main/compiler/packages/babel-plugin-react-compiler/src/Entrypoint/Options.ts#L55
|
|
29
|
+
* @see https://react.dev/blog/2025/04/21/react-compiler-rc
|
|
30
|
+
*
|
|
31
|
+
* @remarks
|
|
32
|
+
* Set to `false` to disable the React Compiler. By default, the React Compiler is enabled and target is set to React 19.
|
|
33
|
+
*/
|
|
34
|
+
compiler?: ReactCompilerOptions | false;
|
|
35
|
+
/**
|
|
36
|
+
* React Fast Refresh runtime URL prefix.
|
|
37
|
+
*
|
|
38
|
+
* @remarks
|
|
39
|
+
* Useful in a module federation context to enable HMR by specifying the host application URL in the Vite config of a remote application.
|
|
40
|
+
*
|
|
41
|
+
* @example
|
|
42
|
+
* reactRefreshHost: 'http://localhost:3000'
|
|
43
|
+
*/
|
|
44
|
+
reactRefreshHost?: string;
|
|
45
|
+
/**
|
|
46
|
+
* Options to pass to the [Babel plugin](https://npmjs.com/package/\@powerlines/plugin-babel).
|
|
47
|
+
*/
|
|
48
|
+
babel?: Partial<BabelPluginOptions>;
|
|
49
|
+
/**
|
|
50
|
+
* Options to pass to the [Env plugin](https://npmjs.com/package/\@powerlines/plugin-env).
|
|
51
|
+
*/
|
|
52
|
+
env?: Partial<Omit<EnvPluginOptions, "babel">>;
|
|
53
|
+
}
|
|
54
|
+
type ReactPluginUserConfig = EnvPluginUserConfig & {
|
|
55
|
+
/**
|
|
56
|
+
* Options for the React plugin.
|
|
57
|
+
*/
|
|
58
|
+
react?: ReactPluginOptions;
|
|
59
|
+
};
|
|
60
|
+
type ReactPluginResolvedConfig = EnvPluginResolvedConfig & {
|
|
61
|
+
/**
|
|
62
|
+
* Options for the React plugin.
|
|
63
|
+
*/
|
|
64
|
+
react: ReactPluginOptions;
|
|
65
|
+
};
|
|
66
|
+
interface ReactPluginContext<TResolvedConfig extends ReactPluginResolvedConfig = ReactPluginResolvedConfig> extends EnvPluginContext<TResolvedConfig> {}
|
|
67
|
+
declare type __ΩReactCompilerOptions = any[];
|
|
68
|
+
declare type __ΩReactPluginOptions = any[];
|
|
69
|
+
declare type __ΩReactPluginUserConfig = any[];
|
|
70
|
+
declare type __ΩReactPluginResolvedConfig = any[];
|
|
71
|
+
declare type __ΩReactPluginContext = any[];
|
|
72
|
+
//#endregion
|
|
73
|
+
export { ReactPluginUserConfig as a, __ΩReactPluginOptions as c, ReactPluginResolvedConfig as i, __ΩReactPluginResolvedConfig as l, ReactPluginContext as n, __ΩReactCompilerOptions as o, ReactPluginOptions as r, __ΩReactPluginContext as s, ReactCompilerOptions as t, __ΩReactPluginUserConfig as u };
|
|
74
|
+
//# sourceMappingURL=plugin-DVsOZIzd.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugin-DVsOZIzd.d.cts","names":[],"sources":["../src/types/plugin.ts"],"sourcesContent":[],"mappings":";;;;;KA2BY,oBAAA,GAAuB,KAAK;UAEvB,kBAAA;EAFL;AAEZ;;;;;;EAkDQ,eAAA,CAAA,EAAA,MAAA;EAAO;AAGf;AAOA;AAOA;;;;;EAE0B,UAAA,CAAA,EAAA,SAAA,GAAA,WAAA;;;;;;;;;;aAxCb;;;;;;;;;;;;;;UAgBH,QAAQ;;;;QAKV,QAAQ,KAAK;;KAGT,qBAAA,GAAwB;;;;UAI1B;;KAGE,yBAAA,GAA4B;;;;SAI/B;;UAGQ,2CACS,4BAA4B,mCAC5C,iBAAiB"}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { BabelPluginOptions } from "@powerlines/plugin-babel/types/plugin";
|
|
2
|
+
import { EnvPluginContext, EnvPluginOptions, EnvPluginResolvedConfig, EnvPluginUserConfig } from "@powerlines/plugin-env/types/plugin";
|
|
3
|
+
import { PluginOptions } from "babel-plugin-react-compiler";
|
|
4
|
+
|
|
5
|
+
//#region src/types/plugin.d.ts
|
|
6
|
+
type ReactCompilerOptions = Omit<PluginOptions, "logger">;
|
|
7
|
+
interface ReactPluginOptions {
|
|
8
|
+
/**
|
|
9
|
+
* Control where the JSX factory is imported from.
|
|
10
|
+
*
|
|
11
|
+
* @see https://esbuild.github.io/api/#jsx-import-source
|
|
12
|
+
*
|
|
13
|
+
* @defaultValue "react"
|
|
14
|
+
*/
|
|
15
|
+
jsxImportSource?: string;
|
|
16
|
+
/**
|
|
17
|
+
* Control how JSX is transformed.
|
|
18
|
+
*
|
|
19
|
+
* @remarks
|
|
20
|
+
* Skipping React import with classic runtime is not supported from v4
|
|
21
|
+
*
|
|
22
|
+
* @defaultValue "automatic"
|
|
23
|
+
*/
|
|
24
|
+
jsxRuntime?: "classic" | "automatic";
|
|
25
|
+
/**
|
|
26
|
+
* Options provided to the [React Compiler](https://npmjs.com/package/babel-plugin-react-compiler).
|
|
27
|
+
*
|
|
28
|
+
* @see https://github.com/facebook/react/blob/main/compiler/packages/babel-plugin-react-compiler/src/Entrypoint/Options.ts#L55
|
|
29
|
+
* @see https://react.dev/blog/2025/04/21/react-compiler-rc
|
|
30
|
+
*
|
|
31
|
+
* @remarks
|
|
32
|
+
* Set to `false` to disable the React Compiler. By default, the React Compiler is enabled and target is set to React 19.
|
|
33
|
+
*/
|
|
34
|
+
compiler?: ReactCompilerOptions | false;
|
|
35
|
+
/**
|
|
36
|
+
* React Fast Refresh runtime URL prefix.
|
|
37
|
+
*
|
|
38
|
+
* @remarks
|
|
39
|
+
* Useful in a module federation context to enable HMR by specifying the host application URL in the Vite config of a remote application.
|
|
40
|
+
*
|
|
41
|
+
* @example
|
|
42
|
+
* reactRefreshHost: 'http://localhost:3000'
|
|
43
|
+
*/
|
|
44
|
+
reactRefreshHost?: string;
|
|
45
|
+
/**
|
|
46
|
+
* Options to pass to the [Babel plugin](https://npmjs.com/package/\@powerlines/plugin-babel).
|
|
47
|
+
*/
|
|
48
|
+
babel?: Partial<BabelPluginOptions>;
|
|
49
|
+
/**
|
|
50
|
+
* Options to pass to the [Env plugin](https://npmjs.com/package/\@powerlines/plugin-env).
|
|
51
|
+
*/
|
|
52
|
+
env?: Partial<Omit<EnvPluginOptions, "babel">>;
|
|
53
|
+
}
|
|
54
|
+
type ReactPluginUserConfig = EnvPluginUserConfig & {
|
|
55
|
+
/**
|
|
56
|
+
* Options for the React plugin.
|
|
57
|
+
*/
|
|
58
|
+
react?: ReactPluginOptions;
|
|
59
|
+
};
|
|
60
|
+
type ReactPluginResolvedConfig = EnvPluginResolvedConfig & {
|
|
61
|
+
/**
|
|
62
|
+
* Options for the React plugin.
|
|
63
|
+
*/
|
|
64
|
+
react: ReactPluginOptions;
|
|
65
|
+
};
|
|
66
|
+
interface ReactPluginContext<TResolvedConfig extends ReactPluginResolvedConfig = ReactPluginResolvedConfig> extends EnvPluginContext<TResolvedConfig> {}
|
|
67
|
+
declare type __ΩReactCompilerOptions = any[];
|
|
68
|
+
declare type __ΩReactPluginOptions = any[];
|
|
69
|
+
declare type __ΩReactPluginUserConfig = any[];
|
|
70
|
+
declare type __ΩReactPluginResolvedConfig = any[];
|
|
71
|
+
declare type __ΩReactPluginContext = any[];
|
|
72
|
+
//#endregion
|
|
73
|
+
export { ReactPluginUserConfig as a, __ΩReactPluginOptions as c, ReactPluginResolvedConfig as i, __ΩReactPluginResolvedConfig as l, ReactPluginContext as n, __ΩReactCompilerOptions as o, ReactPluginOptions as r, __ΩReactPluginContext as s, ReactCompilerOptions as t, __ΩReactPluginUserConfig as u };
|
|
74
|
+
//# sourceMappingURL=plugin-DhNM9Rg6.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugin-DhNM9Rg6.d.mts","names":[],"sources":["../src/types/plugin.ts"],"sourcesContent":[],"mappings":";;;;;KA2BY,oBAAA,GAAuB,KAAK;UAEvB,kBAAA;EAFL;AAEZ;;;;;;EAkDQ,eAAA,CAAA,EAAA,MAAA;EAAO;AAGf;AAOA;AAOA;;;;;EAE0B,UAAA,CAAA,EAAA,SAAA,GAAA,WAAA;;;;;;;;;;aAxCb;;;;;;;;;;;;;;UAgBH,QAAQ;;;;QAKV,QAAQ,KAAK;;KAGT,qBAAA,GAAwB;;;;UAI1B;;KAGE,yBAAA,GAA4B;;;;SAI/B;;UAGQ,2CACS,4BAA4B,mCAC5C,iBAAiB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { };
|
|
File without changes
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import * as _alloy_js_core0 from "@alloy-js/core";
|
|
2
|
+
import { BuiltinFileProps } from "@powerlines/plugin-alloy/typescript/components/builtin-file";
|
|
3
|
+
|
|
4
|
+
//#region src/components/react-optimized.d.ts
|
|
5
|
+
interface ReactOptimizedBuiltinProps extends Omit<BuiltinFileProps, "id"> {
|
|
6
|
+
override?: boolean;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Generates the `react/optimized` builtin module for the Powerlines project.
|
|
10
|
+
*/
|
|
11
|
+
declare function ReactOptimizedBuiltin(props: ReactOptimizedBuiltinProps): _alloy_js_core0.Children;
|
|
12
|
+
declare type __ΩReactOptimizedBuiltinProps = any[];
|
|
13
|
+
//#endregion
|
|
14
|
+
export { ReactOptimizedBuiltinProps as n, __ΩReactOptimizedBuiltinProps as r, ReactOptimizedBuiltin as t };
|
|
15
|
+
//# sourceMappingURL=react-optimized-CTa8f7Os.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"react-optimized-CTa8f7Os.d.mts","names":[],"sources":["../src/components/react-optimized.tsx"],"sourcesContent":[],"mappings":";;;;UAgCiB,0BAAA,SAAmC,KAClD;;;AADF;AAYA;;iBAAgB,qBAAA,QAA6B,6BAA0B,eAAA,CAAA"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import * as _alloy_js_core0 from "@alloy-js/core";
|
|
2
|
+
import { BuiltinFileProps } from "@powerlines/plugin-alloy/typescript/components/builtin-file";
|
|
3
|
+
|
|
4
|
+
//#region src/components/react-optimized.d.ts
|
|
5
|
+
interface ReactOptimizedBuiltinProps extends Omit<BuiltinFileProps, "id"> {
|
|
6
|
+
override?: boolean;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Generates the `react/optimized` builtin module for the Powerlines project.
|
|
10
|
+
*/
|
|
11
|
+
declare function ReactOptimizedBuiltin(props: ReactOptimizedBuiltinProps): _alloy_js_core0.Children;
|
|
12
|
+
declare type __ΩReactOptimizedBuiltinProps = any[];
|
|
13
|
+
//#endregion
|
|
14
|
+
export { ReactOptimizedBuiltinProps as n, __ΩReactOptimizedBuiltinProps as r, ReactOptimizedBuiltin as t };
|
|
15
|
+
//# sourceMappingURL=react-optimized-D1ur_Vdk.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"react-optimized-D1ur_Vdk.d.cts","names":[],"sources":["../src/components/react-optimized.tsx"],"sourcesContent":[],"mappings":";;;;UAgCiB,0BAAA,SAAmC,KAClD;;;AADF;AAYA;;iBAAgB,qBAAA,QAA6B,6BAA0B,eAAA,CAAA"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { createComponent, createIntrinsic, mergeProps } from "@alloy-js/core/jsx-runtime";
|
|
2
|
+
import defu from "defu";
|
|
3
|
+
import { Show, code, splitProps } from "@alloy-js/core";
|
|
4
|
+
import { FunctionDeclaration } from "@alloy-js/typescript";
|
|
5
|
+
import { refkey } from "@powerlines/plugin-alloy/helpers/refkey";
|
|
6
|
+
import { BuiltinFile } from "@powerlines/plugin-alloy/typescript/components/builtin-file";
|
|
7
|
+
import { TSDoc, TSDocLink, TSDocReturns } from "@powerlines/plugin-alloy/typescript/components/tsdoc";
|
|
8
|
+
|
|
9
|
+
//#region src/components/react-optimized.tsx
|
|
10
|
+
const isOptimizationEnabledRefkey = refkey("isOptimizationEnabled");
|
|
11
|
+
/**
|
|
12
|
+
* Generates the `react/optimized` builtin module for the Powerlines project.
|
|
13
|
+
*/
|
|
14
|
+
function ReactOptimizedBuiltin(props) {
|
|
15
|
+
const [{ override }, rest] = splitProps(props, ["override"]);
|
|
16
|
+
return createComponent(BuiltinFile, mergeProps(rest, {
|
|
17
|
+
id: "react/optimized",
|
|
18
|
+
description: "A built-in module to provide access to environment configuration to determine React optimizations.",
|
|
19
|
+
get builtinImports() {
|
|
20
|
+
return defu({ env: ["env", "isDevelopment"] }, rest.builtinImports ?? {});
|
|
21
|
+
},
|
|
22
|
+
get children() {
|
|
23
|
+
return [createComponent(TSDoc, {
|
|
24
|
+
heading: "A gating function to determine if the optimized [React compiler](https://react.dev/reference/react-compiler) source code should be used.",
|
|
25
|
+
get children() {
|
|
26
|
+
return [createComponent(TSDocLink, { children: `https://react.dev/reference/react-compiler/gating` }), createComponent(TSDocReturns, { children: `A boolean indicating if the React compiler's optimizations should be used.` })];
|
|
27
|
+
}
|
|
28
|
+
}), createComponent(FunctionDeclaration, {
|
|
29
|
+
refkey: isOptimizationEnabledRefkey,
|
|
30
|
+
async: false,
|
|
31
|
+
"export": true,
|
|
32
|
+
name: "isOptimizationEnabled",
|
|
33
|
+
returnType: "boolean",
|
|
34
|
+
get children() {
|
|
35
|
+
return [createComponent(Show, {
|
|
36
|
+
when: override !== void 0,
|
|
37
|
+
fallback: code`return !env.DISABLE_REACT_COMPILER && !isDevelopment; `,
|
|
38
|
+
children: code`return ${override};`
|
|
39
|
+
}), createIntrinsic("hbr", {})];
|
|
40
|
+
}
|
|
41
|
+
})];
|
|
42
|
+
}
|
|
43
|
+
}));
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
//#endregion
|
|
47
|
+
export { ReactOptimizedBuiltin as t };
|
|
48
|
+
//# sourceMappingURL=react-optimized-DR69Ucl1.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"react-optimized-DR69Ucl1.mjs","names":["code","Show","splitProps","FunctionDeclaration","refkey","BuiltinFile","TSDoc","TSDocLink","TSDocReturns","defu","isOptimizationEnabledRefkey","ReactOptimizedBuiltin","props","override","rest","_$createComponent","_$mergeProps","id","description","builtinImports","env","children","heading","async","name","returnType","when","undefined","fallback","_$createIntrinsic"],"sources":["../src/components/react-optimized.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 { code, Show, splitProps } from \"@alloy-js/core\";\nimport { FunctionDeclaration } from \"@alloy-js/typescript\";\nimport { refkey } from \"@powerlines/plugin-alloy/helpers/refkey\";\nimport {\n BuiltinFile,\n BuiltinFileProps\n} from \"@powerlines/plugin-alloy/typescript/components/builtin-file\";\nimport {\n TSDoc,\n TSDocLink,\n TSDocReturns\n} from \"@powerlines/plugin-alloy/typescript/components/tsdoc\";\nimport defu from \"defu\";\n\nexport interface ReactOptimizedBuiltinProps extends Omit<\n BuiltinFileProps,\n \"id\"\n> {\n override?: boolean;\n}\n\nconst isOptimizationEnabledRefkey = refkey(\"isOptimizationEnabled\");\n\n/**\n * Generates the `react/optimized` builtin module for the Powerlines project.\n */\nexport function ReactOptimizedBuiltin(props: ReactOptimizedBuiltinProps) {\n const [{ override }, rest] = splitProps(props, [\"override\"]);\n\n return (\n <BuiltinFile\n {...rest}\n id=\"react/optimized\"\n description=\"A built-in module to provide access to environment configuration to determine React optimizations.\"\n builtinImports={defu(\n { env: [\"env\", \"isDevelopment\"] },\n rest.builtinImports ?? {}\n )}>\n <TSDoc heading=\"A gating function to determine if the optimized [React compiler](https://react.dev/reference/react-compiler) source code should be used.\">\n <TSDocLink>\n {`https://react.dev/reference/react-compiler/gating`}\n </TSDocLink>\n <TSDocReturns>\n {`A boolean indicating if the React compiler's optimizations should be used.`}\n </TSDocReturns>\n </TSDoc>\n <FunctionDeclaration\n refkey={isOptimizationEnabledRefkey}\n async={false}\n export={true}\n name=\"isOptimizationEnabled\"\n returnType=\"boolean\">\n <Show\n when={override !== undefined}\n fallback={code`return !env.DISABLE_REACT_COMPILER && !isDevelopment; `}>{code`return ${override};`}</Show>\n <hbr />\n </FunctionDeclaration>\n </BuiltinFile>\n );\n}\n"],"mappings":";;;;;;;;;AAuCA,MAAMU,8BAA8BN,OAAO,wBAAwB;;;;AAKnE,SAAgBO,sBAAsBC,OAAmC;CACvE,MAAM,CAAC,EAAEC,YAAYC,QAAQZ,WAAWU,OAAO,CAAC,WAAW,CAAC;AAE5D,QAAAG,gBACGV,aAAWW,WACNF,MAAI;EACRG,IAAE;EACFC,aAAW;EAAA,IACXC,iBAAc;AAAA,UAAEV,KACd,EAAEW,KAAK,CAAC,OAAO,gBAAe,EAAG,EACjCN,KAAKK,kBAAkB,EACzB,CAAC;;EAAA,IAAAE,WAAA;AAAA,UAAA,CAAAN,gBACAT,OAAK;IAACgB,SAAO;IAAA,IAAAD,WAAA;AAAA,YAAA,CAAAN,gBACXR,WAAS,EAAAc,UACP,qDAAmD,CAAA,EAAAN,gBAErDP,cAAY,EAAAa,UACV,8EAA4E,CAAA,CAAA;;IAAA,CAAA,EAAAN,gBAGhFZ,qBAAmB;IAClBC,QAAQM;IACRa,OAAO;IAAK,UACJ;IACRC,MAAI;IACJC,YAAU;IAAA,IAAAJ,WAAA;AAAA,YAAA,CAAAN,gBACTd,MAAI;MACHyB,MAAMb,aAAac;MACnBC,UAAU5B,IAAI;MAAwDqB,UAAGrB,IAAI,UAAUa,SAAQ;MAAG,CAAA,EAAAgB,gBAAA,OAAA,EAAA,CAAA,CAAA;;IAAA,CAAA,CAAA;;EAAA,CAAA,CAAA"}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
//#region rolldown:runtime
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __copyProps = (to, from, except, desc) => {
|
|
9
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
10
|
+
for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
11
|
+
key = keys[i];
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except) {
|
|
13
|
+
__defProp(to, key, {
|
|
14
|
+
get: ((k) => from[k]).bind(null, key),
|
|
15
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
return to;
|
|
21
|
+
};
|
|
22
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
23
|
+
value: mod,
|
|
24
|
+
enumerable: true
|
|
25
|
+
}) : target, mod));
|
|
26
|
+
|
|
27
|
+
//#endregion
|
|
28
|
+
let __alloy_js_core_jsx_runtime = require("@alloy-js/core/jsx-runtime");
|
|
29
|
+
let defu = require("defu");
|
|
30
|
+
defu = __toESM(defu);
|
|
31
|
+
let __alloy_js_core = require("@alloy-js/core");
|
|
32
|
+
let __alloy_js_typescript = require("@alloy-js/typescript");
|
|
33
|
+
let __powerlines_plugin_alloy_helpers_refkey = require("@powerlines/plugin-alloy/helpers/refkey");
|
|
34
|
+
let __powerlines_plugin_alloy_typescript_components_builtin_file = require("@powerlines/plugin-alloy/typescript/components/builtin-file");
|
|
35
|
+
let __powerlines_plugin_alloy_typescript_components_tsdoc = require("@powerlines/plugin-alloy/typescript/components/tsdoc");
|
|
36
|
+
|
|
37
|
+
//#region src/components/react-optimized.tsx
|
|
38
|
+
const isOptimizationEnabledRefkey = (0, __powerlines_plugin_alloy_helpers_refkey.refkey)("isOptimizationEnabled");
|
|
39
|
+
/**
|
|
40
|
+
* Generates the `react/optimized` builtin module for the Powerlines project.
|
|
41
|
+
*/
|
|
42
|
+
function ReactOptimizedBuiltin(props) {
|
|
43
|
+
const [{ override }, rest] = (0, __alloy_js_core.splitProps)(props, ["override"]);
|
|
44
|
+
return (0, __alloy_js_core_jsx_runtime.createComponent)(__powerlines_plugin_alloy_typescript_components_builtin_file.BuiltinFile, (0, __alloy_js_core_jsx_runtime.mergeProps)(rest, {
|
|
45
|
+
id: "react/optimized",
|
|
46
|
+
description: "A built-in module to provide access to environment configuration to determine React optimizations.",
|
|
47
|
+
get builtinImports() {
|
|
48
|
+
return (0, defu.default)({ env: ["env", "isDevelopment"] }, rest.builtinImports ?? {});
|
|
49
|
+
},
|
|
50
|
+
get children() {
|
|
51
|
+
return [(0, __alloy_js_core_jsx_runtime.createComponent)(__powerlines_plugin_alloy_typescript_components_tsdoc.TSDoc, {
|
|
52
|
+
heading: "A gating function to determine if the optimized [React compiler](https://react.dev/reference/react-compiler) source code should be used.",
|
|
53
|
+
get children() {
|
|
54
|
+
return [(0, __alloy_js_core_jsx_runtime.createComponent)(__powerlines_plugin_alloy_typescript_components_tsdoc.TSDocLink, { children: `https://react.dev/reference/react-compiler/gating` }), (0, __alloy_js_core_jsx_runtime.createComponent)(__powerlines_plugin_alloy_typescript_components_tsdoc.TSDocReturns, { children: `A boolean indicating if the React compiler's optimizations should be used.` })];
|
|
55
|
+
}
|
|
56
|
+
}), (0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_typescript.FunctionDeclaration, {
|
|
57
|
+
refkey: isOptimizationEnabledRefkey,
|
|
58
|
+
async: false,
|
|
59
|
+
"export": true,
|
|
60
|
+
name: "isOptimizationEnabled",
|
|
61
|
+
returnType: "boolean",
|
|
62
|
+
get children() {
|
|
63
|
+
return [(0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_core.Show, {
|
|
64
|
+
when: override !== void 0,
|
|
65
|
+
fallback: __alloy_js_core.code`return !env.DISABLE_REACT_COMPILER && !isDevelopment; `,
|
|
66
|
+
children: __alloy_js_core.code`return ${override};`
|
|
67
|
+
}), (0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {})];
|
|
68
|
+
}
|
|
69
|
+
})];
|
|
70
|
+
}
|
|
71
|
+
}));
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
//#endregion
|
|
75
|
+
Object.defineProperty(exports, 'ReactOptimizedBuiltin', {
|
|
76
|
+
enumerable: true,
|
|
77
|
+
get: function () {
|
|
78
|
+
return ReactOptimizedBuiltin;
|
|
79
|
+
}
|
|
80
|
+
});
|
|
81
|
+
Object.defineProperty(exports, '__toESM', {
|
|
82
|
+
enumerable: true,
|
|
83
|
+
get: function () {
|
|
84
|
+
return __toESM;
|
|
85
|
+
}
|
|
86
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { EnvInterface } from "@powerlines/plugin-env/types/runtime";
|
|
2
|
+
|
|
3
|
+
//#region src/types/runtime.d.ts
|
|
4
|
+
interface ReactEnvInterface extends EnvInterface {
|
|
5
|
+
/**
|
|
6
|
+
* Disables the React compiler optimizations when set to true.
|
|
7
|
+
*
|
|
8
|
+
* @remarks
|
|
9
|
+
* This environment variable can be used to turn off the optimizations provided by the React compiler, which may be useful for debugging or development purposes.
|
|
10
|
+
*/
|
|
11
|
+
DISABLE_REACT_COMPILER: boolean;
|
|
12
|
+
}
|
|
13
|
+
declare type __ΩReactEnvInterface = any[];
|
|
14
|
+
//#endregion
|
|
15
|
+
export { __ΩReactEnvInterface as n, ReactEnvInterface as t };
|
|
16
|
+
//# sourceMappingURL=runtime-Bj2UD25S.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runtime-Bj2UD25S.d.mts","names":[],"sources":["../src/types/runtime.ts"],"sourcesContent":[],"mappings":";;;UAoBiB,iBAAA,SAA0B;;AAA3C"}
|
|
File without changes
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { EnvInterface } from "@powerlines/plugin-env/types/runtime";
|
|
2
|
+
|
|
3
|
+
//#region src/types/runtime.d.ts
|
|
4
|
+
interface ReactEnvInterface extends EnvInterface {
|
|
5
|
+
/**
|
|
6
|
+
* Disables the React compiler optimizations when set to true.
|
|
7
|
+
*
|
|
8
|
+
* @remarks
|
|
9
|
+
* This environment variable can be used to turn off the optimizations provided by the React compiler, which may be useful for debugging or development purposes.
|
|
10
|
+
*/
|
|
11
|
+
DISABLE_REACT_COMPILER: boolean;
|
|
12
|
+
}
|
|
13
|
+
declare type __ΩReactEnvInterface = any[];
|
|
14
|
+
//#endregion
|
|
15
|
+
export { __ΩReactEnvInterface as n, ReactEnvInterface as t };
|
|
16
|
+
//# sourceMappingURL=runtime-Co2VNPJW.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runtime-Co2VNPJW.d.cts","names":[],"sources":["../src/types/runtime.ts"],"sourcesContent":[],"mappings":";;;UAoBiB,iBAAA,SAA0B;;AAA3C"}
|
package/dist/types/index.cjs
CHANGED
package/dist/types/index.d.cts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { a as ReactPluginUserConfig, c as __ΩReactPluginOptions, i as ReactPluginResolvedConfig, l as __ΩReactPluginResolvedConfig, n as ReactPluginContext, o as __ΩReactCompilerOptions, r as ReactPluginOptions, s as __ΩReactPluginContext, t as ReactCompilerOptions, u as __ΩReactPluginUserConfig } from "../plugin-DVsOZIzd.cjs";
|
|
2
|
+
import { n as __ΩReactEnvInterface, t as ReactEnvInterface } from "../runtime-Co2VNPJW.cjs";
|
|
3
|
+
import "../index-BL32-cvv.cjs";
|
|
3
4
|
export { ReactCompilerOptions, ReactEnvInterface, ReactPluginContext, ReactPluginOptions, ReactPluginResolvedConfig, ReactPluginUserConfig, __ΩReactCompilerOptions, __ΩReactEnvInterface, __ΩReactPluginContext, __ΩReactPluginOptions, __ΩReactPluginResolvedConfig, __ΩReactPluginUserConfig };
|
package/dist/types/index.d.mts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { a as ReactPluginUserConfig, c as __ΩReactPluginOptions, i as ReactPluginResolvedConfig, l as __ΩReactPluginResolvedConfig, n as ReactPluginContext, o as __ΩReactCompilerOptions, r as ReactPluginOptions, s as __ΩReactPluginContext, t as ReactCompilerOptions, u as __ΩReactPluginUserConfig } from "../plugin-DhNM9Rg6.mjs";
|
|
2
|
+
import { n as __ΩReactEnvInterface, t as ReactEnvInterface } from "../runtime-Bj2UD25S.mjs";
|
|
3
|
+
import "../index-Bk0eNZmQ.mjs";
|
|
3
4
|
export { ReactCompilerOptions, ReactEnvInterface, ReactPluginContext, ReactPluginOptions, ReactPluginResolvedConfig, ReactPluginUserConfig, __ΩReactCompilerOptions, __ΩReactEnvInterface, __ΩReactPluginContext, __ΩReactPluginOptions, __ΩReactPluginResolvedConfig, __ΩReactPluginUserConfig };
|
package/dist/types/index.mjs
CHANGED
package/dist/types/plugin.cjs
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
require('../plugin-pBKbb5K9.cjs');
|
package/dist/types/plugin.d.cts
CHANGED
|
@@ -1,73 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { EnvPluginContext, EnvPluginOptions, EnvPluginResolvedConfig, EnvPluginUserConfig } from "@powerlines/plugin-env/types/plugin";
|
|
3
|
-
import { PluginOptions } from "babel-plugin-react-compiler";
|
|
4
|
-
|
|
5
|
-
//#region src/types/plugin.d.ts
|
|
6
|
-
type ReactCompilerOptions = Omit<PluginOptions, "logger">;
|
|
7
|
-
interface ReactPluginOptions {
|
|
8
|
-
/**
|
|
9
|
-
* Control where the JSX factory is imported from.
|
|
10
|
-
*
|
|
11
|
-
* @see https://esbuild.github.io/api/#jsx-import-source
|
|
12
|
-
*
|
|
13
|
-
* @defaultValue "react"
|
|
14
|
-
*/
|
|
15
|
-
jsxImportSource?: string;
|
|
16
|
-
/**
|
|
17
|
-
* Control how JSX is transformed.
|
|
18
|
-
*
|
|
19
|
-
* @remarks
|
|
20
|
-
* Skipping React import with classic runtime is not supported from v4
|
|
21
|
-
*
|
|
22
|
-
* @defaultValue "automatic"
|
|
23
|
-
*/
|
|
24
|
-
jsxRuntime?: "classic" | "automatic";
|
|
25
|
-
/**
|
|
26
|
-
* Options provided to the [React Compiler](https://npmjs.com/package/babel-plugin-react-compiler).
|
|
27
|
-
*
|
|
28
|
-
* @see https://github.com/facebook/react/blob/main/compiler/packages/babel-plugin-react-compiler/src/Entrypoint/Options.ts#L55
|
|
29
|
-
* @see https://react.dev/blog/2025/04/21/react-compiler-rc
|
|
30
|
-
*
|
|
31
|
-
* @remarks
|
|
32
|
-
* Set to `false` to disable the React Compiler. By default, the React Compiler is enabled and target is set to React 19.
|
|
33
|
-
*/
|
|
34
|
-
compiler?: ReactCompilerOptions | false;
|
|
35
|
-
/**
|
|
36
|
-
* React Fast Refresh runtime URL prefix.
|
|
37
|
-
*
|
|
38
|
-
* @remarks
|
|
39
|
-
* Useful in a module federation context to enable HMR by specifying the host application URL in the Vite config of a remote application.
|
|
40
|
-
*
|
|
41
|
-
* @example
|
|
42
|
-
* reactRefreshHost: 'http://localhost:3000'
|
|
43
|
-
*/
|
|
44
|
-
reactRefreshHost?: string;
|
|
45
|
-
/**
|
|
46
|
-
* Options to pass to the [Babel plugin](https://npmjs.com/package/\@powerlines/plugin-babel).
|
|
47
|
-
*/
|
|
48
|
-
babel?: Partial<BabelPluginOptions>;
|
|
49
|
-
/**
|
|
50
|
-
* Options to pass to the [Env plugin](https://npmjs.com/package/\@powerlines/plugin-env).
|
|
51
|
-
*/
|
|
52
|
-
env?: Partial<Omit<EnvPluginOptions, "babel">>;
|
|
53
|
-
}
|
|
54
|
-
type ReactPluginUserConfig = EnvPluginUserConfig & {
|
|
55
|
-
/**
|
|
56
|
-
* Options for the React plugin.
|
|
57
|
-
*/
|
|
58
|
-
react?: ReactPluginOptions;
|
|
59
|
-
};
|
|
60
|
-
type ReactPluginResolvedConfig = EnvPluginResolvedConfig & {
|
|
61
|
-
/**
|
|
62
|
-
* Options for the React plugin.
|
|
63
|
-
*/
|
|
64
|
-
react: ReactPluginOptions;
|
|
65
|
-
};
|
|
66
|
-
interface ReactPluginContext<TResolvedConfig extends ReactPluginResolvedConfig = ReactPluginResolvedConfig> extends EnvPluginContext<TResolvedConfig> {}
|
|
67
|
-
declare type __ΩReactCompilerOptions = any[];
|
|
68
|
-
declare type __ΩReactPluginOptions = any[];
|
|
69
|
-
declare type __ΩReactPluginUserConfig = any[];
|
|
70
|
-
declare type __ΩReactPluginResolvedConfig = any[];
|
|
71
|
-
declare type __ΩReactPluginContext = any[];
|
|
72
|
-
//#endregion
|
|
1
|
+
import { a as ReactPluginUserConfig, c as __ΩReactPluginOptions, i as ReactPluginResolvedConfig, l as __ΩReactPluginResolvedConfig, n as ReactPluginContext, o as __ΩReactCompilerOptions, r as ReactPluginOptions, s as __ΩReactPluginContext, t as ReactCompilerOptions, u as __ΩReactPluginUserConfig } from "../plugin-DVsOZIzd.cjs";
|
|
73
2
|
export { ReactCompilerOptions, ReactPluginContext, ReactPluginOptions, ReactPluginResolvedConfig, ReactPluginUserConfig, __ΩReactCompilerOptions, __ΩReactPluginContext, __ΩReactPluginOptions, __ΩReactPluginResolvedConfig, __ΩReactPluginUserConfig };
|
package/dist/types/plugin.d.mts
CHANGED
|
@@ -1,73 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { EnvPluginContext, EnvPluginOptions, EnvPluginResolvedConfig, EnvPluginUserConfig } from "@powerlines/plugin-env/types/plugin";
|
|
3
|
-
import { PluginOptions } from "babel-plugin-react-compiler";
|
|
4
|
-
|
|
5
|
-
//#region src/types/plugin.d.ts
|
|
6
|
-
type ReactCompilerOptions = Omit<PluginOptions, "logger">;
|
|
7
|
-
interface ReactPluginOptions {
|
|
8
|
-
/**
|
|
9
|
-
* Control where the JSX factory is imported from.
|
|
10
|
-
*
|
|
11
|
-
* @see https://esbuild.github.io/api/#jsx-import-source
|
|
12
|
-
*
|
|
13
|
-
* @defaultValue "react"
|
|
14
|
-
*/
|
|
15
|
-
jsxImportSource?: string;
|
|
16
|
-
/**
|
|
17
|
-
* Control how JSX is transformed.
|
|
18
|
-
*
|
|
19
|
-
* @remarks
|
|
20
|
-
* Skipping React import with classic runtime is not supported from v4
|
|
21
|
-
*
|
|
22
|
-
* @defaultValue "automatic"
|
|
23
|
-
*/
|
|
24
|
-
jsxRuntime?: "classic" | "automatic";
|
|
25
|
-
/**
|
|
26
|
-
* Options provided to the [React Compiler](https://npmjs.com/package/babel-plugin-react-compiler).
|
|
27
|
-
*
|
|
28
|
-
* @see https://github.com/facebook/react/blob/main/compiler/packages/babel-plugin-react-compiler/src/Entrypoint/Options.ts#L55
|
|
29
|
-
* @see https://react.dev/blog/2025/04/21/react-compiler-rc
|
|
30
|
-
*
|
|
31
|
-
* @remarks
|
|
32
|
-
* Set to `false` to disable the React Compiler. By default, the React Compiler is enabled and target is set to React 19.
|
|
33
|
-
*/
|
|
34
|
-
compiler?: ReactCompilerOptions | false;
|
|
35
|
-
/**
|
|
36
|
-
* React Fast Refresh runtime URL prefix.
|
|
37
|
-
*
|
|
38
|
-
* @remarks
|
|
39
|
-
* Useful in a module federation context to enable HMR by specifying the host application URL in the Vite config of a remote application.
|
|
40
|
-
*
|
|
41
|
-
* @example
|
|
42
|
-
* reactRefreshHost: 'http://localhost:3000'
|
|
43
|
-
*/
|
|
44
|
-
reactRefreshHost?: string;
|
|
45
|
-
/**
|
|
46
|
-
* Options to pass to the [Babel plugin](https://npmjs.com/package/\@powerlines/plugin-babel).
|
|
47
|
-
*/
|
|
48
|
-
babel?: Partial<BabelPluginOptions>;
|
|
49
|
-
/**
|
|
50
|
-
* Options to pass to the [Env plugin](https://npmjs.com/package/\@powerlines/plugin-env).
|
|
51
|
-
*/
|
|
52
|
-
env?: Partial<Omit<EnvPluginOptions, "babel">>;
|
|
53
|
-
}
|
|
54
|
-
type ReactPluginUserConfig = EnvPluginUserConfig & {
|
|
55
|
-
/**
|
|
56
|
-
* Options for the React plugin.
|
|
57
|
-
*/
|
|
58
|
-
react?: ReactPluginOptions;
|
|
59
|
-
};
|
|
60
|
-
type ReactPluginResolvedConfig = EnvPluginResolvedConfig & {
|
|
61
|
-
/**
|
|
62
|
-
* Options for the React plugin.
|
|
63
|
-
*/
|
|
64
|
-
react: ReactPluginOptions;
|
|
65
|
-
};
|
|
66
|
-
interface ReactPluginContext<TResolvedConfig extends ReactPluginResolvedConfig = ReactPluginResolvedConfig> extends EnvPluginContext<TResolvedConfig> {}
|
|
67
|
-
declare type __ΩReactCompilerOptions = any[];
|
|
68
|
-
declare type __ΩReactPluginOptions = any[];
|
|
69
|
-
declare type __ΩReactPluginUserConfig = any[];
|
|
70
|
-
declare type __ΩReactPluginResolvedConfig = any[];
|
|
71
|
-
declare type __ΩReactPluginContext = any[];
|
|
72
|
-
//#endregion
|
|
1
|
+
import { a as ReactPluginUserConfig, c as __ΩReactPluginOptions, i as ReactPluginResolvedConfig, l as __ΩReactPluginResolvedConfig, n as ReactPluginContext, o as __ΩReactCompilerOptions, r as ReactPluginOptions, s as __ΩReactPluginContext, t as ReactCompilerOptions, u as __ΩReactPluginUserConfig } from "../plugin-DhNM9Rg6.mjs";
|
|
73
2
|
export { ReactCompilerOptions, ReactPluginContext, ReactPluginOptions, ReactPluginResolvedConfig, ReactPluginUserConfig, __ΩReactCompilerOptions, __ΩReactPluginContext, __ΩReactPluginOptions, __ΩReactPluginResolvedConfig, __ΩReactPluginUserConfig };
|
package/dist/types/plugin.mjs
CHANGED
package/dist/types/runtime.cjs
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
require('../runtime-Bp9G0scd.cjs');
|
package/dist/types/runtime.d.cts
CHANGED
|
@@ -1,15 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
//#region src/types/runtime.d.ts
|
|
4
|
-
interface ReactEnvInterface extends EnvInterface {
|
|
5
|
-
/**
|
|
6
|
-
* Disables the React compiler optimizations when set to true.
|
|
7
|
-
*
|
|
8
|
-
* @remarks
|
|
9
|
-
* This environment variable can be used to turn off the optimizations provided by the React compiler, which may be useful for debugging or development purposes.
|
|
10
|
-
*/
|
|
11
|
-
DISABLE_REACT_COMPILER: boolean;
|
|
12
|
-
}
|
|
13
|
-
declare type __ΩReactEnvInterface = any[];
|
|
14
|
-
//#endregion
|
|
1
|
+
import { n as __ΩReactEnvInterface, t as ReactEnvInterface } from "../runtime-Co2VNPJW.cjs";
|
|
15
2
|
export { ReactEnvInterface, __ΩReactEnvInterface };
|
package/dist/types/runtime.d.mts
CHANGED
|
@@ -1,15 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
//#region src/types/runtime.d.ts
|
|
4
|
-
interface ReactEnvInterface extends EnvInterface {
|
|
5
|
-
/**
|
|
6
|
-
* Disables the React compiler optimizations when set to true.
|
|
7
|
-
*
|
|
8
|
-
* @remarks
|
|
9
|
-
* This environment variable can be used to turn off the optimizations provided by the React compiler, which may be useful for debugging or development purposes.
|
|
10
|
-
*/
|
|
11
|
-
DISABLE_REACT_COMPILER: boolean;
|
|
12
|
-
}
|
|
13
|
-
declare type __ΩReactEnvInterface = any[];
|
|
14
|
-
//#endregion
|
|
1
|
+
import { n as __ΩReactEnvInterface, t as ReactEnvInterface } from "../runtime-Bj2UD25S.mjs";
|
|
15
2
|
export { ReactEnvInterface, __ΩReactEnvInterface };
|
package/dist/types/runtime.mjs
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { };
|
|
File without changes
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@powerlines/plugin-react",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.271",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "A package containing a Powerlines plugin for building a React application.",
|
|
6
6
|
"repository": {
|
|
@@ -141,9 +141,9 @@
|
|
|
141
141
|
"@alloy-js/markdown": "^0.22.0",
|
|
142
142
|
"@alloy-js/typescript": "^0.22.0",
|
|
143
143
|
"@babel/core": "^7.28.6",
|
|
144
|
-
"@powerlines/plugin-alloy": "^0.19.
|
|
145
|
-
"@powerlines/plugin-babel": "^0.12.
|
|
146
|
-
"@powerlines/plugin-env": "^0.15.
|
|
144
|
+
"@powerlines/plugin-alloy": "^0.19.14",
|
|
145
|
+
"@powerlines/plugin-babel": "^0.12.248",
|
|
146
|
+
"@powerlines/plugin-env": "^0.15.142",
|
|
147
147
|
"@storm-software/config-tools": "^1.189.0",
|
|
148
148
|
"@stryke/cli": "^0.13.11",
|
|
149
149
|
"@stryke/convert": "^0.6.37",
|
|
@@ -152,15 +152,15 @@
|
|
|
152
152
|
"@vitejs/plugin-react": "^5.1.2",
|
|
153
153
|
"babel-plugin-react-compiler": "^1.0.0",
|
|
154
154
|
"defu": "^6.1.4",
|
|
155
|
-
"powerlines": "^0.38.
|
|
155
|
+
"powerlines": "^0.38.6"
|
|
156
156
|
},
|
|
157
157
|
"devDependencies": {
|
|
158
|
-
"@powerlines/plugin-plugin": "^0.12.
|
|
158
|
+
"@powerlines/plugin-plugin": "^0.12.190",
|
|
159
159
|
"@types/node": "^24.10.9",
|
|
160
160
|
"@types/react": "^19.2.10",
|
|
161
161
|
"@types/react-dom": "^19.2.3"
|
|
162
162
|
},
|
|
163
163
|
"publishConfig": { "access": "public" },
|
|
164
164
|
"types": "./dist/index.d.cts",
|
|
165
|
-
"gitHead": "
|
|
165
|
+
"gitHead": "f90d675c44d4323d447a46c8a4c833420543cc0a"
|
|
166
166
|
}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
//#region rolldown:runtime
|
|
2
|
-
var __create = Object.create;
|
|
3
|
-
var __defProp = Object.defineProperty;
|
|
4
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var __copyProps = (to, from, except, desc) => {
|
|
9
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
10
|
-
for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
11
|
-
key = keys[i];
|
|
12
|
-
if (!__hasOwnProp.call(to, key) && key !== except) {
|
|
13
|
-
__defProp(to, key, {
|
|
14
|
-
get: ((k) => from[k]).bind(null, key),
|
|
15
|
-
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
16
|
-
});
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
return to;
|
|
21
|
-
};
|
|
22
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
23
|
-
value: mod,
|
|
24
|
-
enumerable: true
|
|
25
|
-
}) : target, mod));
|
|
26
|
-
|
|
27
|
-
//#endregion
|
|
28
|
-
|
|
29
|
-
exports.__toESM = __toESM;
|