@powerlines/plugin-react 0.1.108 → 0.1.110

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.
@@ -3,6 +3,7 @@ import { PrintTreeOptions } from "@alloy-js/core";
3
3
  import { DotenvConfiguration, TypeDefinition, TypeDefinitionParameter } from "@stryke/types/configuration";
4
4
  import { Children } from "@alloy-js/core/jsx-runtime";
5
5
  import * as $ from "@stryke/capnp";
6
+ import "@alloy-js/typescript";
6
7
  import { Config } from "automd";
7
8
  import { DotenvParseOutput } from "@stryke/env/types";
8
9
  import { PluginOptions } from "babel-plugin-react-compiler";
@@ -1604,6 +1605,9 @@ type AlloyPluginOptions = Partial<PrintTreeOptions> & {
1604
1605
  */
1605
1606
  markdown?: boolean;
1606
1607
  };
1608
+ type AlloyPluginUserConfig = UserConfig & {
1609
+ alloy?: AlloyPluginOptions;
1610
+ };
1607
1611
  type AlloyPluginResolvedConfig = ResolvedConfig & {
1608
1612
  alloy: AlloyPluginOptions;
1609
1613
  };
@@ -1723,11 +1727,18 @@ type EnvPluginOptions = Omit<DotenvConfiguration, "types"> & {
1723
1727
  * The README.md file should contain the `<!-- automd:env --><!-- /automd -->` comment block where the documentation will be injected.
1724
1728
  */
1725
1729
  automd?: AutoMDPluginOptions;
1730
+ /**
1731
+ * Alloy configuration options to use when injecting environment variables into the source code.
1732
+ *
1733
+ * @remarks
1734
+ * This option allows you to customize the Alloy transformation process used to inject environment variables into the source code. If not provided, the plugin will use default Alloy settings.
1735
+ */
1736
+ alloy?: AlloyPluginOptions;
1726
1737
  };
1727
- type EnvPluginUserConfig = BabelPluginUserConfig & {
1738
+ type EnvPluginUserConfig = BabelPluginUserConfig & AlloyPluginUserConfig & {
1728
1739
  env: EnvPluginOptions;
1729
1740
  };
1730
- type EnvPluginResolvedConfig = BabelPluginResolvedConfig & {
1741
+ type EnvPluginResolvedConfig = BabelPluginResolvedConfig & AlloyPluginResolvedConfig & {
1731
1742
  env: Required<Pick<DotenvConfiguration, "additionalFiles">> & Required<Pick<EnvPluginOptions, "defaultConfig">> & {
1732
1743
  /**
1733
1744
  * The type definition for the expected env variable parameters
@@ -1,10 +1,10 @@
1
- import { a as BabelResolvedConfig, c as UserConfig, i as PluginContext, n as SecretsInterface, o as ResolvedConfig, s as BabelUserConfig, t as EnvInterface } from "./runtime-CbWds61u.mjs";
1
+ import { a as BabelResolvedConfig, c as UserConfig, i as PluginContext, n as SecretsInterface, o as ResolvedConfig, s as BabelUserConfig, t as EnvInterface } from "./runtime-Do9xjHUb.mjs";
2
+ import { Children } from "@alloy-js/core/jsx-runtime";
3
+ import { PrintTreeOptions } from "@alloy-js/core";
4
+ import "@alloy-js/typescript";
2
5
  import { Config } from "automd";
3
6
  import { DotenvParseOutput } from "@stryke/env/types";
4
7
  import * as $ from "@stryke/capnp";
5
- import { PrintTreeOptions } from "@alloy-js/core";
6
- import "@alloy-js/typescript";
7
- import { Children } from "@alloy-js/core/jsx-runtime";
8
8
  import { DotenvConfiguration, TypeDefinition, TypeDefinitionParameter } from "@stryke/types/configuration";
9
9
  import { PluginOptions } from "babel-plugin-react-compiler";
10
10
 
@@ -1603,6 +1603,9 @@ type AlloyPluginOptions = Partial<PrintTreeOptions> & {
1603
1603
  */
1604
1604
  markdown?: boolean;
1605
1605
  };
1606
+ type AlloyPluginUserConfig = UserConfig & {
1607
+ alloy?: AlloyPluginOptions;
1608
+ };
1606
1609
  type AlloyPluginResolvedConfig = ResolvedConfig & {
1607
1610
  alloy: AlloyPluginOptions;
1608
1611
  };
@@ -1722,11 +1725,18 @@ type EnvPluginOptions = Omit<DotenvConfiguration, "types"> & {
1722
1725
  * The README.md file should contain the `<!-- automd:env --><!-- /automd -->` comment block where the documentation will be injected.
1723
1726
  */
1724
1727
  automd?: AutoMDPluginOptions;
1728
+ /**
1729
+ * Alloy configuration options to use when injecting environment variables into the source code.
1730
+ *
1731
+ * @remarks
1732
+ * This option allows you to customize the Alloy transformation process used to inject environment variables into the source code. If not provided, the plugin will use default Alloy settings.
1733
+ */
1734
+ alloy?: AlloyPluginOptions;
1725
1735
  };
1726
- type EnvPluginUserConfig = BabelPluginUserConfig & {
1736
+ type EnvPluginUserConfig = BabelPluginUserConfig & AlloyPluginUserConfig & {
1727
1737
  env: EnvPluginOptions;
1728
1738
  };
1729
- type EnvPluginResolvedConfig = BabelPluginResolvedConfig & {
1739
+ type EnvPluginResolvedConfig = BabelPluginResolvedConfig & AlloyPluginResolvedConfig & {
1730
1740
  env: Required<Pick<DotenvConfiguration, "additionalFiles">> & Required<Pick<EnvPluginOptions, "defaultConfig">> & {
1731
1741
  /**
1732
1742
  * The type definition for the expected env variable parameters
@@ -0,0 +1 @@
1
+ var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},s=(e,n,r,i)=>{i&&(t(e,Symbol.toStringTag,{value:`Module`}),r&&t(r,Symbol.toStringTag,{value:`Module`})),o(e,n,`default`),r&&o(r,n,`default`)},c=(n,r,a)=>(a=n==null?{}:e(i(n)),o(r||!n||!n.__esModule?t(a,`default`,{value:n,enumerable:!0}):a,n));let l=require(`@alloy-js/core/jsx-runtime`),u=require(`defu`);u=c(u);let d=require(`@alloy-js/core`),f=require(`@alloy-js/typescript`),p=require(`@powerlines/alloy/core/contexts/context`),m=require(`@powerlines/alloy/helpers/refkey`),h=require(`@powerlines/alloy/typescript/components/builtin-file`),g=require(`@powerlines/alloy/typescript/components/tsdoc`);const _=(0,m.refkey)(`isOptimizationEnabled`);function v(e){let[{override:t},n]=(0,d.splitProps)(e,[`override`]),r=(0,p.usePowerlines)();return(0,l.createComponent)(h.BuiltinFile,(0,l.mergeProps)(n,{id:`react/optimized`,description:`A built-in module to provide access to environment configuration to determine React optimizations.`,get imports(){return(0,u.default)({[`${r?.config.output.builtinPrefix}:env`]:[`env`,`isDevelopment`]},n.imports??{})},get children(){return[(0,l.createComponent)(g.TSDoc,{heading:`A gating function to determine if the optimized [React compiler](https://react.dev/reference/react-compiler) source code should be used.`,get children(){return[(0,l.createComponent)(g.TSDocLink,{children:`https://react.dev/reference/react-compiler/gating`}),(0,l.createComponent)(g.TSDocReturns,{children:`A boolean indicating if the React compiler's optimizations should be used.`})]}}),(0,l.createComponent)(f.FunctionDeclaration,{refkey:_,async:!1,export:!0,name:`isOptimizationEnabled`,returnType:`boolean`,children:t===void 0?d.code`return !env.DISABLE_REACT_COMPILER && !isDevelopment; `:d.code`return ${t};`})]}}))}Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return s}}),Object.defineProperty(exports,`r`,{enumerable:!0,get:function(){return c}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return v}});
@@ -0,0 +1 @@
1
+ import{createComponent as e,mergeProps as t}from"@alloy-js/core/jsx-runtime";import n from"defu";import{code as r,splitProps as i}from"@alloy-js/core";import{FunctionDeclaration as a}from"@alloy-js/typescript";import{usePowerlines as o}from"@powerlines/alloy/core/contexts/context";import{refkey as s}from"@powerlines/alloy/helpers/refkey";import{BuiltinFile as c}from"@powerlines/alloy/typescript/components/builtin-file";import{TSDoc as l,TSDocLink as u,TSDocReturns as d}from"@powerlines/alloy/typescript/components/tsdoc";const f=s(`isOptimizationEnabled`);function p(s){let[{override:p},m]=i(s,[`override`]),h=o();return e(c,t(m,{id:`react/optimized`,description:`A built-in module to provide access to environment configuration to determine React optimizations.`,get imports(){return n({[`${h?.config.output.builtinPrefix}:env`]:[`env`,`isDevelopment`]},m.imports??{})},get children(){return[e(l,{heading:`A gating function to determine if the optimized [React compiler](https://react.dev/reference/react-compiler) source code should be used.`,get children(){return[e(u,{children:`https://react.dev/reference/react-compiler/gating`}),e(d,{children:`A boolean indicating if the React compiler's optimizations should be used.`})]}}),e(a,{refkey:f,async:!1,export:!0,name:`isOptimizationEnabled`,returnType:`boolean`,children:p===void 0?r`return !env.DISABLE_REACT_COMPILER && !isDevelopment; `:r`return ${p};`})]}}))}export{p as t};
@@ -3,7 +3,6 @@ import { LogLevelLabel } from "@storm-software/config-tools/types";
3
3
  import { BabelAPI } from "@babel/helper-plugin-utils";
4
4
  import "c12";
5
5
  import { ResolveOptions } from "@stryke/fs/resolve";
6
- import "esbuild";
7
6
  import ts from "typescript";
8
7
  import { ArrayValues } from "@stryke/types/array";
9
8
  import { FunctionLike, MaybePromise, NonUndefined } from "@stryke/types/base";
@@ -1,4 +1,4 @@
1
- import { t as EnvInterface } from "./runtime-CbWds61u.mjs";
1
+ import { t as EnvInterface } from "./runtime-Do9xjHUb.mjs";
2
2
 
3
3
  //#region src/types/runtime.d.ts
4
4
  interface ReactEnvInterface extends EnvInterface {
@@ -1,4 +1,4 @@
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-C1nLepnu.cjs";
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-CP9_29iU.cjs";
2
2
  import "../runtime-BNQjyQ7l.cjs";
3
3
  import { n as __ΩReactEnvInterface, t as ReactEnvInterface } from "../runtime-CKObV75t.cjs";
4
4
  import "../index-CtCMUyZA.cjs";
@@ -1,5 +1,5 @@
1
- import "../runtime-CbWds61u.mjs";
2
- 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-CCWbVJ0P.mjs";
3
- import { n as __ΩReactEnvInterface, t as ReactEnvInterface } from "../runtime-CKyYLoHU.mjs";
1
+ import "../runtime-Do9xjHUb.mjs";
2
+ 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-qpXdqfDo.mjs";
3
+ import { n as __ΩReactEnvInterface, t as ReactEnvInterface } from "../runtime-IEYS5R9b.mjs";
4
4
  import "../index-C-svZlpj.mjs";
5
5
  export { ReactCompilerOptions, ReactEnvInterface, ReactPluginContext, ReactPluginOptions, ReactPluginResolvedConfig, ReactPluginUserConfig, __ΩReactCompilerOptions, __ΩReactEnvInterface, __ΩReactPluginContext, __ΩReactPluginOptions, __ΩReactPluginResolvedConfig, __ΩReactPluginUserConfig };
@@ -1,3 +1,3 @@
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-C1nLepnu.cjs";
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-CP9_29iU.cjs";
2
2
  import "../runtime-BNQjyQ7l.cjs";
3
3
  export { ReactCompilerOptions, ReactPluginContext, ReactPluginOptions, ReactPluginResolvedConfig, ReactPluginUserConfig, __ΩReactCompilerOptions, __ΩReactPluginContext, __ΩReactPluginOptions, __ΩReactPluginResolvedConfig, __ΩReactPluginUserConfig };
@@ -1,3 +1,3 @@
1
- import "../runtime-CbWds61u.mjs";
2
- 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-CCWbVJ0P.mjs";
1
+ import "../runtime-Do9xjHUb.mjs";
2
+ 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-qpXdqfDo.mjs";
3
3
  export { ReactCompilerOptions, ReactPluginContext, ReactPluginOptions, ReactPluginResolvedConfig, ReactPluginUserConfig, __ΩReactCompilerOptions, __ΩReactPluginContext, __ΩReactPluginOptions, __ΩReactPluginResolvedConfig, __ΩReactPluginUserConfig };
@@ -1,3 +1,3 @@
1
- import "../runtime-CbWds61u.mjs";
2
- import { n as __ΩReactEnvInterface, t as ReactEnvInterface } from "../runtime-CKyYLoHU.mjs";
1
+ import "../runtime-Do9xjHUb.mjs";
2
+ import { n as __ΩReactEnvInterface, t as ReactEnvInterface } from "../runtime-IEYS5R9b.mjs";
3
3
  export { ReactEnvInterface, __ΩReactEnvInterface };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@powerlines/plugin-react",
3
- "version": "0.1.108",
3
+ "version": "0.1.110",
4
4
  "type": "module",
5
5
  "description": "A package containing a Powerlines plugin for building a React application.",
6
6
  "repository": {
@@ -136,9 +136,13 @@
136
136
  "react-dom": { "optional": false }
137
137
  },
138
138
  "dependencies": {
139
- "@powerlines/plugin-alloy": "^0.15.1",
140
- "@powerlines/plugin-babel": "^0.12.113",
141
- "@powerlines/plugin-env": "^0.14.7",
139
+ "@alloy-js/core": "^0.22.0",
140
+ "@alloy-js/json": "^0.22.0",
141
+ "@alloy-js/markdown": "^0.22.0",
142
+ "@alloy-js/typescript": "^0.22.0",
143
+ "@powerlines/plugin-alloy": "^0.15.3",
144
+ "@powerlines/plugin-babel": "^0.12.115",
145
+ "@powerlines/plugin-env": "^0.14.9",
142
146
  "@storm-software/config-tools": "^1.188.74",
143
147
  "@stryke/cli": "^0.12.36",
144
148
  "@stryke/convert": "^0.6.29",
@@ -147,15 +151,13 @@
147
151
  "@vitejs/plugin-react": "^5.1.2",
148
152
  "babel-plugin-react-compiler": "^1.0.0",
149
153
  "defu": "^6.1.4",
150
- "powerlines": "^0.36.9"
154
+ "powerlines": "^0.36.11"
151
155
  },
152
156
  "devDependencies": {
153
- "@alloy-js/core": "^0.21.0",
154
- "@alloy-js/typescript": "^0.21.0",
155
157
  "@babel/core": "^7.28.5",
156
- "@powerlines/nx": "^0.11.35",
157
- "@powerlines/plugin-alloy": "^0.15.1",
158
- "@powerlines/plugin-plugin": "^0.12.56",
158
+ "@powerlines/nx": "^0.11.37",
159
+ "@powerlines/plugin-alloy": "^0.15.3",
160
+ "@powerlines/plugin-plugin": "^0.12.58",
159
161
  "@types/node": "^24.10.4",
160
162
  "@types/react": "^19.2.7",
161
163
  "@types/react-dom": "^19.2.3",
@@ -163,5 +165,5 @@
163
165
  "react-dom": "^19.2.3"
164
166
  },
165
167
  "publishConfig": { "access": "public" },
166
- "gitHead": "e9fb959df894f1aa67074af9fbb126978a450a45"
168
+ "gitHead": "298fe30390297c676ffd571284b2b62f10d8ecc9"
167
169
  }
@@ -1 +0,0 @@
1
- var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},s=(e,n,r,i)=>{i&&(t(e,Symbol.toStringTag,{value:`Module`}),r&&t(r,Symbol.toStringTag,{value:`Module`})),o(e,n,`default`),r&&o(r,n,`default`)},c=(n,r,a)=>(a=n==null?{}:e(i(n)),o(r||!n||!n.__esModule?t(a,`default`,{value:n,enumerable:!0}):a,n));let l=require(`defu`);l=c(l);let u=require(`@alloy-js/core`),d=require(`@alloy-js/typescript`),f=require(`@powerlines/alloy/core/contexts/context`),p=require(`@powerlines/alloy/helpers/refkey`),m=require(`@powerlines/alloy/typescript/components/builtin-file`),h=require(`@powerlines/alloy/typescript/components/tsdoc`),g=require(`@alloy-js/core/jsx-runtime`);const _=(0,p.refkey)(`isOptimizationEnabled`);function v(e){let[{override:t},n]=(0,u.splitProps)(e,[`override`]),r=(0,f.usePowerlines)();return(0,g.jsxs)(m.BuiltinFile,{...n,id:`react/optimized`,description:`A built-in module to provide access to environment configuration to determine React optimizations.`,imports:(0,l.default)({[`${r?.config.output.builtinPrefix}:env`]:[`env`,`isDevelopment`]},n.imports??{}),children:[(0,g.jsxs)(h.TSDoc,{heading:`A gating function to determine if the optimized [React compiler](https://react.dev/reference/react-compiler) source code should be used.`,children:[(0,g.jsx)(h.TSDocLink,{children:`https://react.dev/reference/react-compiler/gating`}),(0,g.jsx)(h.TSDocReturns,{children:`A boolean indicating if the React compiler's optimizations should be used.`})]}),(0,g.jsx)(d.FunctionDeclaration,{refkey:_,async:!1,export:!0,name:`isOptimizationEnabled`,returnType:`boolean`,children:t===void 0?u.code`return !env.DISABLE_REACT_COMPILER && !isDevelopment; `:u.code`return ${t};`})]})}Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return s}}),Object.defineProperty(exports,`r`,{enumerable:!0,get:function(){return c}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return v}});
@@ -1 +0,0 @@
1
- import e from"defu";import{code as t,splitProps as n}from"@alloy-js/core";import{FunctionDeclaration as r}from"@alloy-js/typescript";import{usePowerlines as i}from"@powerlines/alloy/core/contexts/context";import{refkey as a}from"@powerlines/alloy/helpers/refkey";import{BuiltinFile as o}from"@powerlines/alloy/typescript/components/builtin-file";import{TSDoc as s,TSDocLink as c,TSDocReturns as l}from"@powerlines/alloy/typescript/components/tsdoc";import{jsx as u,jsxs as d}from"@alloy-js/core/jsx-runtime";const f=a(`isOptimizationEnabled`);function p(a){let[{override:p},m]=n(a,[`override`]),h=i();return d(o,{...m,id:`react/optimized`,description:`A built-in module to provide access to environment configuration to determine React optimizations.`,imports:e({[`${h?.config.output.builtinPrefix}:env`]:[`env`,`isDevelopment`]},m.imports??{}),children:[d(s,{heading:`A gating function to determine if the optimized [React compiler](https://react.dev/reference/react-compiler) source code should be used.`,children:[u(c,{children:`https://react.dev/reference/react-compiler/gating`}),u(l,{children:`A boolean indicating if the React compiler's optimizations should be used.`})]}),u(r,{refkey:f,async:!1,export:!0,name:`isOptimizationEnabled`,returnType:`boolean`,children:p===void 0?t`return !env.DISABLE_REACT_COMPILER && !isDevelopment; `:t`return ${p};`})]})}export{p as t};