@powerlines/plugin-react 0.1.122 → 0.1.123
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/_virtual/rolldown_runtime.cjs +37 -1
- package/dist/_virtual/rolldown_runtime.mjs +29 -1
- package/dist/components/index.cjs +3 -1
- package/dist/components/index.mjs +3 -1
- package/dist/components/react-optimized.cjs +45 -1
- package/dist/components/react-optimized.mjs +43 -1
- package/dist/deepkit/schemas/reflection.cjs +3940 -1
- package/dist/deepkit/schemas/reflection.mjs +3938 -1
- package/dist/deepkit/schemas/reflection2.cjs +4112 -1
- package/dist/deepkit/schemas/reflection2.mjs +4110 -1
- package/dist/deepkit/src/capnp.cjs +913 -1
- package/dist/deepkit/src/capnp.mjs +911 -1
- package/dist/deepkit/src/esbuild-plugin.cjs +47 -4
- package/dist/deepkit/src/esbuild-plugin.mjs +46 -4
- package/dist/deepkit/src/reflect-type.cjs +22 -1
- package/dist/deepkit/src/reflect-type.mjs +20 -1
- package/dist/deepkit/src/resolve-reflections.cjs +16 -1
- package/dist/deepkit/src/resolve-reflections.mjs +15 -1
- package/dist/deepkit/src/transformer.cjs +52 -1
- package/dist/deepkit/src/transformer.mjs +49 -1
- package/dist/deepkit/src/transpile.cjs +29 -1
- package/dist/deepkit/src/transpile.mjs +27 -1
- package/dist/deepkit/src/utilities.cjs +66 -1
- package/dist/deepkit/src/utilities.mjs +65 -1
- package/dist/deepkit/src/vendor/type-compiler/index.cjs +38 -1
- package/dist/deepkit/src/vendor/type-compiler/index.mjs +19 -1
- package/dist/deepkit/src/vendor/type.cjs +20 -1
- package/dist/deepkit/src/vendor/type.mjs +11 -1
- package/dist/index.cjs +104 -1
- package/dist/index.mjs +98 -1
- package/dist/plugin-alloy/src/core/components/output.cjs +45 -1
- package/dist/plugin-alloy/src/core/components/output.mjs +44 -1
- package/dist/plugin-alloy/src/core/contexts/context.cjs +11 -1
- package/dist/plugin-alloy/src/core/contexts/context.mjs +10 -1
- package/dist/plugin-alloy/src/index.cjs +93 -1
- package/dist/plugin-alloy/src/index.mjs +91 -1
- package/dist/plugin-automd/src/index.cjs +101 -1
- package/dist/plugin-automd/src/index.mjs +98 -1
- package/dist/plugin-babel/src/helpers/ast-utils.cjs +10 -1
- package/dist/plugin-babel/src/helpers/ast-utils.mjs +9 -1
- package/dist/plugin-babel/src/helpers/create-plugin.cjs +41 -1
- package/dist/plugin-babel/src/helpers/create-plugin.mjs +39 -1
- package/dist/plugin-babel/src/helpers/filters.cjs +23 -1
- package/dist/plugin-babel/src/helpers/filters.mjs +21 -1
- package/dist/plugin-babel/src/helpers/index.cjs +5 -1
- package/dist/plugin-babel/src/helpers/index.mjs +7 -1
- package/dist/plugin-babel/src/helpers/module-helpers.cjs +38 -1
- package/dist/plugin-babel/src/helpers/module-helpers.mjs +35 -1
- package/dist/plugin-babel/src/helpers/options.cjs +50 -1
- package/dist/plugin-babel/src/helpers/options.mjs +47 -1
- package/dist/plugin-babel/src/index.cjs +91 -1
- package/dist/plugin-babel/src/index.mjs +89 -1
- package/dist/plugin-env/src/babel/index.cjs +1 -1
- package/dist/plugin-env/src/babel/index.mjs +3 -1
- package/dist/plugin-env/src/babel/plugin.cjs +120 -4
- package/dist/plugin-env/src/babel/plugin.mjs +118 -4
- package/dist/plugin-env/src/components/docs.cjs +9 -1
- package/dist/plugin-env/src/components/docs.mjs +11 -1
- package/dist/plugin-env/src/components/env.cjs +432 -11
- package/dist/plugin-env/src/components/env.mjs +430 -9
- package/dist/plugin-env/src/components/index.cjs +2 -1
- package/dist/plugin-env/src/components/index.mjs +4 -1
- package/dist/plugin-env/src/helpers/automd-generator.cjs +22 -1
- package/dist/plugin-env/src/helpers/automd-generator.mjs +21 -1
- package/dist/plugin-env/src/helpers/create-reflection-resource.cjs +55 -1
- package/dist/plugin-env/src/helpers/create-reflection-resource.mjs +54 -1
- package/dist/plugin-env/src/helpers/index.cjs +6 -1
- package/dist/plugin-env/src/helpers/index.mjs +8 -1
- package/dist/plugin-env/src/helpers/load.cjs +83 -1
- package/dist/plugin-env/src/helpers/load.mjs +80 -1
- package/dist/plugin-env/src/helpers/persistence.cjs +200 -1
- package/dist/plugin-env/src/helpers/persistence.mjs +189 -1
- package/dist/plugin-env/src/helpers/reflect.cjs +111 -1
- package/dist/plugin-env/src/helpers/reflect.mjs +103 -1
- package/dist/plugin-env/src/helpers/source-file-env.cjs +24 -1
- package/dist/plugin-env/src/helpers/source-file-env.mjs +23 -1
- package/dist/plugin-env/src/helpers/template-helpers.cjs +2 -1
- package/dist/plugin-env/src/helpers/template-helpers.mjs +4 -1
- package/dist/plugin-env/src/index.cjs +170 -5
- package/dist/plugin-env/src/index.mjs +168 -5
- package/dist/powerlines/src/lib/build/esbuild.cjs +102 -14
- package/dist/powerlines/src/lib/build/esbuild.mjs +100 -14
- package/dist/powerlines/src/lib/entry.cjs +12 -1
- package/dist/powerlines/src/lib/entry.mjs +14 -1
- package/dist/powerlines/src/lib/logger.cjs +41 -1
- package/dist/powerlines/src/lib/logger.mjs +39 -1
- package/dist/powerlines/src/lib/typescript/tsconfig.cjs +38 -1
- package/dist/powerlines/src/lib/typescript/tsconfig.mjs +35 -1
- package/dist/powerlines/src/lib/utilities/bundle.cjs +35 -1
- package/dist/powerlines/src/lib/utilities/bundle.mjs +34 -1
- package/dist/powerlines/src/lib/utilities/resolve.cjs +30 -1
- package/dist/powerlines/src/lib/utilities/resolve.mjs +29 -1
- package/dist/powerlines/src/plugin-utils/paths.cjs +1 -1
- package/dist/powerlines/src/plugin-utils/paths.mjs +3 -1
- package/dist/powerlines/src/types/context.d.cts +27 -3
- package/dist/powerlines/src/types/context.d.mts +27 -3
- package/dist/types/index.mjs +1 -1
- package/dist/types/plugin.mjs +1 -1
- package/dist/types/runtime.mjs +1 -1
- package/package.json +10 -10
|
@@ -1 +1,37 @@
|
|
|
1
|
-
|
|
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 __reExport = (target, mod, secondTarget, symbols) => {
|
|
23
|
+
if (symbols) {
|
|
24
|
+
__defProp(target, Symbol.toStringTag, { value: "Module" });
|
|
25
|
+
secondTarget && __defProp(secondTarget, Symbol.toStringTag, { value: "Module" });
|
|
26
|
+
}
|
|
27
|
+
__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default");
|
|
28
|
+
};
|
|
29
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
30
|
+
value: mod,
|
|
31
|
+
enumerable: true
|
|
32
|
+
}) : target, mod));
|
|
33
|
+
|
|
34
|
+
//#endregion
|
|
35
|
+
|
|
36
|
+
exports.__reExport = __reExport;
|
|
37
|
+
exports.__toESM = __toESM;
|
|
@@ -1 +1,29 @@
|
|
|
1
|
-
|
|
1
|
+
//#region rolldown:runtime
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __copyProps = (to, from, except, desc) => {
|
|
7
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
8
|
+
for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
9
|
+
key = keys[i];
|
|
10
|
+
if (!__hasOwnProp.call(to, key) && key !== except) {
|
|
11
|
+
__defProp(to, key, {
|
|
12
|
+
get: ((k) => from[k]).bind(null, key),
|
|
13
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __reExport = (target, mod, secondTarget, symbols) => {
|
|
21
|
+
if (symbols) {
|
|
22
|
+
__defProp(target, Symbol.toStringTag, { value: "Module" });
|
|
23
|
+
secondTarget && __defProp(secondTarget, Symbol.toStringTag, { value: "Module" });
|
|
24
|
+
}
|
|
25
|
+
__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default");
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
//#endregion
|
|
29
|
+
export { __reExport };
|
|
@@ -1 +1,45 @@
|
|
|
1
|
-
const
|
|
1
|
+
const require_rolldown_runtime = require('../_virtual/rolldown_runtime.cjs');
|
|
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_alloy_core_contexts_context = require("@powerlines/alloy/core/contexts/context");
|
|
8
|
+
let __powerlines_alloy_helpers_refkey = require("@powerlines/alloy/helpers/refkey");
|
|
9
|
+
let __powerlines_alloy_typescript_components_builtin_file = require("@powerlines/alloy/typescript/components/builtin-file");
|
|
10
|
+
let __powerlines_alloy_typescript_components_tsdoc = require("@powerlines/alloy/typescript/components/tsdoc");
|
|
11
|
+
|
|
12
|
+
//#region src/components/react-optimized.tsx
|
|
13
|
+
const isOptimizationEnabledRefkey = (0, __powerlines_alloy_helpers_refkey.refkey)("isOptimizationEnabled");
|
|
14
|
+
/**
|
|
15
|
+
* Generates the `react/optimized` builtin module for the Powerlines project.
|
|
16
|
+
*/
|
|
17
|
+
function ReactOptimizedBuiltin(props) {
|
|
18
|
+
const [{ override }, rest] = (0, __alloy_js_core.splitProps)(props, ["override"]);
|
|
19
|
+
const context = (0, __powerlines_alloy_core_contexts_context.usePowerlines)();
|
|
20
|
+
return (0, __alloy_js_core_jsx_runtime.createComponent)(__powerlines_alloy_typescript_components_builtin_file.BuiltinFile, (0, __alloy_js_core_jsx_runtime.mergeProps)(rest, {
|
|
21
|
+
id: "react/optimized",
|
|
22
|
+
description: "A built-in module to provide access to environment configuration to determine React optimizations.",
|
|
23
|
+
get imports() {
|
|
24
|
+
return (0, defu.default)({ [`${context?.config.output.builtinPrefix}:env`]: ["env", "isDevelopment"] }, rest.imports ?? {});
|
|
25
|
+
},
|
|
26
|
+
get children() {
|
|
27
|
+
return [(0, __alloy_js_core_jsx_runtime.createComponent)(__powerlines_alloy_typescript_components_tsdoc.TSDoc, {
|
|
28
|
+
heading: "A gating function to determine if the optimized [React compiler](https://react.dev/reference/react-compiler) source code should be used.",
|
|
29
|
+
get children() {
|
|
30
|
+
return [(0, __alloy_js_core_jsx_runtime.createComponent)(__powerlines_alloy_typescript_components_tsdoc.TSDocLink, { children: `https://react.dev/reference/react-compiler/gating` }), (0, __alloy_js_core_jsx_runtime.createComponent)(__powerlines_alloy_typescript_components_tsdoc.TSDocReturns, { children: `A boolean indicating if the React compiler's optimizations should be used.` })];
|
|
31
|
+
}
|
|
32
|
+
}), (0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_typescript.FunctionDeclaration, {
|
|
33
|
+
refkey: isOptimizationEnabledRefkey,
|
|
34
|
+
async: false,
|
|
35
|
+
"export": true,
|
|
36
|
+
name: "isOptimizationEnabled",
|
|
37
|
+
returnType: "boolean",
|
|
38
|
+
children: override !== void 0 ? __alloy_js_core.code`return ${override};` : __alloy_js_core.code`return !env.DISABLE_REACT_COMPILER && !isDevelopment; `
|
|
39
|
+
})];
|
|
40
|
+
}
|
|
41
|
+
}));
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
//#endregion
|
|
45
|
+
exports.ReactOptimizedBuiltin = ReactOptimizedBuiltin;
|
|
@@ -1 +1,43 @@
|
|
|
1
|
-
import{createComponent
|
|
1
|
+
import { createComponent, mergeProps } from "@alloy-js/core/jsx-runtime";
|
|
2
|
+
import defu from "defu";
|
|
3
|
+
import { code, splitProps } from "@alloy-js/core";
|
|
4
|
+
import { FunctionDeclaration } from "@alloy-js/typescript";
|
|
5
|
+
import { usePowerlines } from "@powerlines/alloy/core/contexts/context";
|
|
6
|
+
import { refkey } from "@powerlines/alloy/helpers/refkey";
|
|
7
|
+
import { BuiltinFile } from "@powerlines/alloy/typescript/components/builtin-file";
|
|
8
|
+
import { TSDoc, TSDocLink, TSDocReturns } from "@powerlines/alloy/typescript/components/tsdoc";
|
|
9
|
+
|
|
10
|
+
//#region src/components/react-optimized.tsx
|
|
11
|
+
const isOptimizationEnabledRefkey = refkey("isOptimizationEnabled");
|
|
12
|
+
/**
|
|
13
|
+
* Generates the `react/optimized` builtin module for the Powerlines project.
|
|
14
|
+
*/
|
|
15
|
+
function ReactOptimizedBuiltin(props) {
|
|
16
|
+
const [{ override }, rest] = splitProps(props, ["override"]);
|
|
17
|
+
const context = usePowerlines();
|
|
18
|
+
return createComponent(BuiltinFile, mergeProps(rest, {
|
|
19
|
+
id: "react/optimized",
|
|
20
|
+
description: "A built-in module to provide access to environment configuration to determine React optimizations.",
|
|
21
|
+
get imports() {
|
|
22
|
+
return defu({ [`${context?.config.output.builtinPrefix}:env`]: ["env", "isDevelopment"] }, rest.imports ?? {});
|
|
23
|
+
},
|
|
24
|
+
get children() {
|
|
25
|
+
return [createComponent(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 [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.` })];
|
|
29
|
+
}
|
|
30
|
+
}), createComponent(FunctionDeclaration, {
|
|
31
|
+
refkey: isOptimizationEnabledRefkey,
|
|
32
|
+
async: false,
|
|
33
|
+
"export": true,
|
|
34
|
+
name: "isOptimizationEnabled",
|
|
35
|
+
returnType: "boolean",
|
|
36
|
+
children: override !== void 0 ? code`return ${override};` : code`return !env.DISABLE_REACT_COMPILER && !isDevelopment; `
|
|
37
|
+
})];
|
|
38
|
+
}
|
|
39
|
+
}));
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
//#endregion
|
|
43
|
+
export { ReactOptimizedBuiltin };
|