@powerlines/plugin-react 0.1.277 → 0.1.278
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 +6 -4
- package/dist/index.mjs +6 -4
- package/dist/index.mjs.map +1 -1
- package/package.json +4 -4
package/dist/index.cjs
CHANGED
|
@@ -92,10 +92,12 @@ const plugin = (options = {}) => {
|
|
|
92
92
|
});
|
|
93
93
|
},
|
|
94
94
|
async prepare() {
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
return
|
|
98
|
-
|
|
95
|
+
return this.render(() => {
|
|
96
|
+
const _self$ = this;
|
|
97
|
+
return (0, __alloy_js_core_jsx_runtime.createComponent)(require_react_optimized.ReactOptimizedBuiltin, { get override() {
|
|
98
|
+
return _self$.config.react.compiler === false ? false : void 0;
|
|
99
|
+
} });
|
|
100
|
+
});
|
|
99
101
|
}
|
|
100
102
|
}
|
|
101
103
|
];
|
package/dist/index.mjs
CHANGED
|
@@ -87,10 +87,12 @@ const plugin = (options = {}) => {
|
|
|
87
87
|
});
|
|
88
88
|
},
|
|
89
89
|
async prepare() {
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
return
|
|
93
|
-
|
|
90
|
+
return this.render(() => {
|
|
91
|
+
const _self$ = this;
|
|
92
|
+
return createComponent(ReactOptimizedBuiltin, { get override() {
|
|
93
|
+
return _self$.config.react.compiler === false ? false : void 0;
|
|
94
|
+
} });
|
|
95
|
+
});
|
|
94
96
|
}
|
|
95
97
|
}
|
|
96
98
|
];
|
package/dist/index.mjs.map
CHANGED
|
@@ -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,S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H,CAAC;;AAGH,QACE,KAAKnE,KAAKgE,OAAOhE,OACjB,CAAC,KAAKA,IAAIgE,MAAMhE,IAAIoE,YAAY,yBAAyB,CAEzD,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","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","render","_self$","_$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,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,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A;MAEpE;;GAEL;EACF;;AAGH,kBAAe5E"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@powerlines/plugin-react",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.278",
|
|
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.
|
|
144
|
+
"@powerlines/plugin-alloy": "^0.19.21",
|
|
145
145
|
"@powerlines/plugin-babel": "^0.12.254",
|
|
146
|
-
"@powerlines/plugin-env": "^0.15.
|
|
146
|
+
"@powerlines/plugin-env": "^0.15.149",
|
|
147
147
|
"@storm-software/config-tools": "^1.189.0",
|
|
148
148
|
"@stryke/cli": "^0.13.11",
|
|
149
149
|
"@stryke/convert": "^0.6.37",
|
|
@@ -162,5 +162,5 @@
|
|
|
162
162
|
},
|
|
163
163
|
"publishConfig": { "access": "public" },
|
|
164
164
|
"types": "./dist/index.d.cts",
|
|
165
|
-
"gitHead": "
|
|
165
|
+
"gitHead": "88803dd52e1cf64679d36eb93edaf56a2f80a8ef"
|
|
166
166
|
}
|