@powerlines/plugin-react 0.1.281 → 0.1.283

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/index.cjs CHANGED
@@ -6,6 +6,7 @@ require('./runtime-Bp9G0scd.cjs');
6
6
  require('./types-a8gm_IaQ.cjs');
7
7
  let __alloy_js_core_jsx_runtime = require("@alloy-js/core/jsx-runtime");
8
8
  let __powerlines_deepkit_vendor_type = require("@powerlines/deepkit/vendor/type");
9
+ let __powerlines_plugin_alloy_core_components_output = require("@powerlines/plugin-alloy/core/components/output");
9
10
  let __powerlines_plugin_babel = require("@powerlines/plugin-babel");
10
11
  __powerlines_plugin_babel = require_react_optimized.__toESM(__powerlines_plugin_babel);
11
12
  let __powerlines_plugin_env = require("@powerlines/plugin-env");
@@ -93,9 +94,14 @@ const plugin = (options = {}) => {
93
94
  },
94
95
  async prepare() {
95
96
  const _self$ = this;
96
- return this.render((0, __alloy_js_core_jsx_runtime.createComponent)(require_react_optimized.ReactOptimizedBuiltin, { get override() {
97
- return _self$.config.react.compiler === false ? false : void 0;
98
- } }));
97
+ return this.render((0, __alloy_js_core_jsx_runtime.createComponent)(__powerlines_plugin_alloy_core_components_output.Output, {
98
+ context: _self$,
99
+ get children() {
100
+ return (0, __alloy_js_core_jsx_runtime.createComponent)(require_react_optimized.ReactOptimizedBuiltin, { get override() {
101
+ return _self$.config.react.compiler === false ? false : void 0;
102
+ } });
103
+ }
104
+ }));
99
105
  }
100
106
  }
101
107
  ];
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.cts","names":[],"sources":["../src/index.tsx"],"sourcesContent":[],"mappings":";;;;;;;;;;;cAyCa,0BACM,qBAAqB,8BAE7B,uBAiMJ,OAAO"}
1
+ {"version":3,"file":"index.d.cts","names":[],"sources":["../src/index.tsx"],"sourcesContent":[],"mappings":";;;;;;;;;;;cA0Ca,0BACM,qBAAqB,8BAE7B,uBAqMJ,OAAO"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.mts","names":[],"sources":["../src/index.tsx"],"sourcesContent":[],"mappings":";;;;;;;;;;;cAyCa,0BACM,qBAAqB,8BAE7B,uBAiMJ,OAAO"}
1
+ {"version":3,"file":"index.d.mts","names":[],"sources":["../src/index.tsx"],"sourcesContent":[],"mappings":";;;;;;;;;;;cA0Ca,0BACM,qBAAqB,8BAE7B,uBAqMJ,OAAO"}
package/dist/index.mjs CHANGED
@@ -5,6 +5,7 @@ import "./runtime-BKY6WvHV.mjs";
5
5
  import "./types--fVOUYBq.mjs";
6
6
  import { createComponent } from "@alloy-js/core/jsx-runtime";
7
7
  import { ReflectionKind, ReflectionVisibility } from "@powerlines/deepkit/vendor/type";
8
+ import { Output } from "@powerlines/plugin-alloy/core/components/output";
8
9
  import babel from "@powerlines/plugin-babel";
9
10
  import env from "@powerlines/plugin-env";
10
11
  import { LogLevelLabel } from "@storm-software/config-tools/types";
@@ -88,9 +89,14 @@ const plugin = (options = {}) => {
88
89
  },
89
90
  async prepare() {
90
91
  const _self$ = this;
91
- return this.render(createComponent(ReactOptimizedBuiltin, { get override() {
92
- return _self$.config.react.compiler === false ? false : void 0;
93
- } }));
92
+ return this.render(createComponent(Output, {
93
+ context: _self$,
94
+ get children() {
95
+ return createComponent(ReactOptimizedBuiltin, { get override() {
96
+ return _self$.config.react.compiler === false ? false : void 0;
97
+ } });
98
+ }
99
+ }));
94
100
  }
95
101
  }
96
102
  ];
@@ -1 +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":";;;;;;;;;;;;;;;;;;AAyCA,MAAaS,UAGXC,UAA8B,EAAE,KAC7B;AACH,QAAO;EACLR,MAAMQ,QAAQR,MAAM;EACpBC,IAAIO,QAAQP,IAAI;EAChB;GACEQ,MAAM;GACNC,SAAS;AACP,WAAON,KACL,EACEO,OAAOH,SACR,EACD,EACEG,OAAO,EACLC,iBAAiB,KAAKC,SAASC,aAAaC,iBACxCH,iBACN,EACD,EACD,EACED,OAAO;KACLK,YAAY;KACZJ,iBAAiB;KACjBK,UAAU;MACRC,QAAQ;MACRC,iBAAiB;MACjBC,QAAQ;OACNC,QAAQ,GAAG,KAAKX,OAAOY,UAAS;OAChCC,qBAAqB;OACtB;MACDC,uBAAuB;MACvBC,QAAQ,EACNC,WAAWC,UAAyBC,UAAuB;AACzD,YAAKC,IACHD,MAAME,SAAS,mBACX5B,cAAc6B,UACdH,MAAME,SAAS,sBACbF,MAAME,SAAS,wBACf5B,cAAc8B,OACdJ,MAAME,SAAS,iBACbF,MAAME,SAAS,sBACf5B,cAAc+B,QACdL,MAAME,SAAS,WACb5B,cAAcgC,QACdhC,cAAciC,OACxB,IAAIR,SAAQ,IACVC,MAAME,SAAS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EzD,MAAKpE,IAAIgE,MAAMhE,IAAIqE,YAAY;KAC7B7D,MAAM;KACN8D,UAAU;KACVC,UAAU;KACV1B,aAAa;KACb2B,YAAY1E,qBAAqB2E;KACjCC,MAAM,EACJ7C,MAAMhC,eAAe8E,SACtB;KACDC,SAAS;KACV,CAAC;;GAGN,MAAMC,UAAU;IAAA,MAAAC,SAAA;AACd,WAAO,KAAKC,OAAMC,gBACf3E,uBAAqB,EAAA,IACpB4E,WAAQ;AAAA,YAAEH,OAAKrE,OAAOC,MAAMM,aAAa,QAAQ,QAAQkE;OAAS,CAEtE,CAAC;;GAEJ;EACF;;AAGH,kBAAe5E"}
1
+ {"version":3,"file":"index.mjs","names":["ReflectionKind","ReflectionVisibility","Output","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","context","children","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 { Output } from \"@powerlines/plugin-alloy/core/components/output\";\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 <Output context={this}>\n <ReactOptimizedBuiltin\n override={\n this.config.react.compiler === false ? false : undefined\n }\n />\n </Output>\n );\n }\n }\n ] as Plugin<TContext>[];\n};\n\nexport default plugin;\n"],"mappings":";;;;;;;;;;;;;;;;;;;AA0CA,MAAaU,UAGXC,UAA8B,EAAE,KAC7B;AACH,QAAO;EACLR,MAAMQ,QAAQR,MAAM;EACpBC,IAAIO,QAAQP,IAAI;EAChB;GACEQ,MAAM;GACNC,SAAS;AACP,WAAON,KACL,EACEO,OAAOH,SACR,EACD,EACEG,OAAO,EACLC,iBAAiB,KAAKC,SAASC,aAAaC,iBACxCH,iBACN,EACD,EACD,EACED,OAAO;KACLK,YAAY;KACZJ,iBAAiB;KACjBK,UAAU;MACRC,QAAQ;MACRC,iBAAiB;MACjBC,QAAQ;OACNC,QAAQ,GAAG,KAAKX,OAAOY,UAAS;OAChCC,qBAAqB;OACtB;MACDC,uBAAuB;MACvBC,QAAQ,EACNC,WAAWC,UAAyBC,UAAuB;AACzD,YAAKC,IACHD,MAAME,SAAS,mBACX5B,cAAc6B,UACdH,MAAME,SAAS,sBACbF,MAAME,SAAS,wBACf5B,cAAc8B,OACdJ,MAAME,SAAS,iBACbF,MAAME,SAAS,sBACf5B,cAAc+B,QACdL,MAAME,SAAS,WACb5B,cAAcgC,QACdhC,cAAciC,OACxB,IAAIR,SAAQ,IACVC,MAAME,SAAS,mBACX,2BACAF,MAAME,SAAS,qBACb,6BACEF,MAAMQ,YAAYC,kBAClB,oBAEFT,MAAME,SAAS,wBACb,gCAAgCF,MAAMU,YACnCC,QAAOC,QAAOA,IAAIH,eAAe,CACjCI,KAAID,QAAOA,IAAIH,eAAe,CAC9BK,KAAK,KAAK,KACbd,MAAME,SAAS,gBACb,wBAAwBF,MAAMe,WAC9Bf,MAAME,SAAS,sBACb,yCACEF,MAAMgB,OAAOC,SAAQ,IAClBjB,MAAMgB,OAAOD,SAChBf,MAAMgB,OAAOE,cACT,KAAKlB,MAAMgB,OAAOE,gBAClB,OAENlB,MAAME,SAAS,WACb,SAASF,MAAMmB,YAAYC,U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A;;KAAA,CAIhE,CAAC;;GAEJ;EACF;;AAGH,kBAAe9E"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@powerlines/plugin-react",
3
- "version": "0.1.281",
3
+ "version": "0.1.283",
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.24",
145
- "@powerlines/plugin-babel": "^0.12.257",
146
- "@powerlines/plugin-env": "^0.15.152",
144
+ "@powerlines/plugin-alloy": "^0.19.26",
145
+ "@powerlines/plugin-babel": "^0.12.258",
146
+ "@powerlines/plugin-env": "^0.15.154",
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.15"
155
+ "powerlines": "^0.38.16"
156
156
  },
157
157
  "devDependencies": {
158
- "@powerlines/plugin-plugin": "^0.12.199",
158
+ "@powerlines/plugin-plugin": "^0.12.200",
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": "3137c5a27017b9c9a371a0e8997014f994edb1ee"
165
+ "gitHead": "ae1829e47caf25992a6b047398bfebf06420e325"
166
166
  }