@powerlines/plugin-alloy 0.25.29 → 0.25.30

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
@@ -2,6 +2,7 @@ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toString
2
2
  const require_runtime = require('./_virtual/_rolldown/runtime.cjs');
3
3
  let _alloy_js_rollup_plugin = require("@alloy-js/rollup-plugin");
4
4
  _alloy_js_rollup_plugin = require_runtime.__toESM(_alloy_js_rollup_plugin);
5
+ let _powerlines_plugin_babel_helpers = require("@powerlines/plugin-babel/helpers");
5
6
  let _stryke_json_storm_json = require("@stryke/json/storm-json");
6
7
 
7
8
  //#region src/index.tsx
@@ -39,6 +40,10 @@ const plugin = (options = {}) => {
39
40
  if (this.tsconfig.tsconfigJson.compilerOptions.jsxImportSource !== "@alloy-js/core") this.tsconfig.tsconfigJson.compilerOptions.jsxImportSource = "@alloy-js/core";
40
41
  await this.fs.write(this.tsconfig.tsconfigFilePath, _stryke_json_storm_json.StormJSON.stringify(this.tsconfig.tsconfigJson));
41
42
  }
43
+ if (this.config.babel && (!this.config.babel.plugins || !(0, _powerlines_plugin_babel_helpers.isDuplicatePlugin)(this.config.babel.plugins, "@babel/plugin-syntax-jsx"))) {
44
+ this.config.babel.plugins ??= [];
45
+ this.config.babel.plugins.push("@babel/plugin-syntax-jsx");
46
+ }
42
47
  }
43
48
  }];
44
49
  };
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.cts","names":[],"sources":["../src/index.tsx"],"mappings":";;;;;YAwBY,MAAA;IACR,KAAA,GAAQ,kBAAA;EAAA;AAAA;;;;;;;cAUC,MAAA,oBACM,kBAAA,GAAqB,kBAAA,EAEtC,OAAA,GAAS,kBAAA,KA2DJ,MAAA,CAAO,QAAA"}
1
+ {"version":3,"file":"index.d.cts","names":[],"sources":["../src/index.tsx"],"mappings":";;;;;YAyBY,MAAA;IACR,KAAA,GAAQ,kBAAA;EAAA;AAAA;;;;;;;cAUC,MAAA,oBACM,kBAAA,GAAqB,kBAAA,EAEtC,OAAA,GAAS,kBAAA,KAuEJ,MAAA,CAAO,QAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.mts","names":[],"sources":["../src/index.tsx"],"mappings":";;;;;YAwBY,MAAA;IACR,KAAA,GAAQ,kBAAA;EAAA;AAAA;;;;;;;cAUC,MAAA,oBACM,kBAAA,GAAqB,kBAAA,EAEtC,OAAA,GAAS,kBAAA,KA2DJ,MAAA,CAAO,QAAA"}
1
+ {"version":3,"file":"index.d.mts","names":[],"sources":["../src/index.tsx"],"mappings":";;;;;YAyBY,MAAA;IACR,KAAA,GAAQ,kBAAA;EAAA;AAAA;;;;;;;cAUC,MAAA,oBACM,kBAAA,GAAqB,kBAAA,EAEtC,OAAA,GAAS,kBAAA,KAuEJ,MAAA,CAAO,QAAA"}
package/dist/index.mjs CHANGED
@@ -1,4 +1,5 @@
1
1
  import rollupPlugin from "@alloy-js/rollup-plugin";
2
+ import { isDuplicatePlugin } from "@powerlines/plugin-babel/helpers";
2
3
  import { StormJSON } from "@stryke/json/storm-json";
3
4
 
4
5
  //#region src/index.tsx
@@ -36,6 +37,10 @@ const plugin = (options = {}) => {
36
37
  if (this.tsconfig.tsconfigJson.compilerOptions.jsxImportSource !== "@alloy-js/core") this.tsconfig.tsconfigJson.compilerOptions.jsxImportSource = "@alloy-js/core";
37
38
  await this.fs.write(this.tsconfig.tsconfigFilePath, StormJSON.stringify(this.tsconfig.tsconfigJson));
38
39
  }
40
+ if (this.config.babel && (!this.config.babel.plugins || !isDuplicatePlugin(this.config.babel.plugins, "@babel/plugin-syntax-jsx"))) {
41
+ this.config.babel.plugins ??= [];
42
+ this.config.babel.plugins.push("@babel/plugin-syntax-jsx");
43
+ }
39
44
  }
40
45
  }];
41
46
  };
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","names":[],"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 rollupPlugin from \"@alloy-js/rollup-plugin\";\nimport { StormJSON } from \"@stryke/json/storm-json\";\nimport type { Plugin } from \"powerlines\";\nimport type { AlloyPluginContext, AlloyPluginOptions } from \"./types/plugin\";\n\ndeclare module \"powerlines\" {\n interface Config {\n alloy?: AlloyPluginOptions;\n }\n}\n\n/**\n * Alloy-js plugin for Powerlines.\n *\n * @param options - The Alloy-js plugin user configuration options.\n * @returns A Powerlines plugin that integrates Alloy-js transformations.\n */\nexport const plugin = <\n TContext extends AlloyPluginContext = AlloyPluginContext\n>(\n options: AlloyPluginOptions = {}\n) => {\n return [\n {\n name: \"alloy\",\n config() {\n this.debug(\n \"Updating configuration options to support Alloy-js builds.\"\n );\n\n return {\n alloy: {\n typescript: true,\n ...options\n },\n resolve: {\n external: [/^@alloy-js\\//]\n },\n tsdown: {\n inputOptions: {\n transform: {\n jsx: {\n runtime: \"automatic\",\n importSource: \"@alloy-js/core\"\n }\n }\n },\n plugins: [rollupPlugin()]\n }\n };\n },\n async configResolved() {\n this.debug(\"Ensuring TypeScript configuration is set up for Alloy-js.\");\n if (\n this.tsconfig.tsconfigJson.compilerOptions?.jsx !== \"react-jsx\" ||\n this.tsconfig.tsconfigJson.compilerOptions?.jsxImportSource !==\n \"@alloy-js/core\"\n ) {\n this.tsconfig.tsconfigJson.compilerOptions ??= {};\n\n if (this.tsconfig.tsconfigJson.compilerOptions.jsx !== \"react-jsx\") {\n this.tsconfig.tsconfigJson.compilerOptions.jsx = \"react-jsx\";\n }\n\n if (\n this.tsconfig.tsconfigJson.compilerOptions.jsxImportSource !==\n \"@alloy-js/core\"\n ) {\n this.tsconfig.tsconfigJson.compilerOptions.jsxImportSource =\n \"@alloy-js/core\";\n }\n\n await this.fs.write(\n this.tsconfig.tsconfigFilePath,\n StormJSON.stringify(this.tsconfig.tsconfigJson)\n );\n }\n }\n }\n ] as Plugin<TContext>[];\n};\n\nexport default plugin;\n"],"mappings":";;;;;;;;;;AAmCA,MAAa,UAGX,UAA8B,EAAE,KAC7B;AACH,QAAO,CACL;EACE,MAAM;EACN,SAAS;AACP,QAAK,MACH,6DACD;AAED,UAAO;IACL,OAAO;KACL,YAAY;KACZ,GAAG;KACJ;IACD,SAAS,EACP,UAAU,CAAC,eAAe,EAC3B;IACD,QAAQ;KACN,cAAc,EACZ,WAAW,EACT,KAAK;MACH,SAAS;MACT,cAAc;MACf,EACF,EACF;KACD,SAAS,CAAC,cAAc,CAAC;KAC1B;IACF;;EAEH,MAAM,iBAAiB;AACrB,QAAK,MAAM,4DAA4D;AACvE,OACE,KAAK,SAAS,aAAa,iBAAiB,QAAQ,eACpD,KAAK,SAAS,aAAa,iBAAiB,oBAC1C,kBACF;AACA,SAAK,SAAS,aAAa,oBAAoB,EAAE;AAEjD,QAAI,KAAK,SAAS,aAAa,gBAAgB,QAAQ,YACrD,MAAK,SAAS,aAAa,gBAAgB,MAAM;AAGnD,QACE,KAAK,SAAS,aAAa,gBAAgB,oBAC3C,iBAEA,MAAK,SAAS,aAAa,gBAAgB,kBACzC;AAGJ,UAAM,KAAK,GAAG,MACZ,KAAK,SAAS,kBACd,UAAU,UAAU,KAAK,SAAS,aAAa,CAChD;;;EAGN,CACF"}
1
+ {"version":3,"file":"index.mjs","names":[],"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 rollupPlugin from \"@alloy-js/rollup-plugin\";\nimport { isDuplicatePlugin } from \"@powerlines/plugin-babel/helpers\";\nimport { StormJSON } from \"@stryke/json/storm-json\";\nimport type { Plugin } from \"powerlines\";\nimport type { AlloyPluginContext, AlloyPluginOptions } from \"./types/plugin\";\n\ndeclare module \"powerlines\" {\n interface Config {\n alloy?: AlloyPluginOptions;\n }\n}\n\n/**\n * Alloy-js plugin for Powerlines.\n *\n * @param options - The Alloy-js plugin user configuration options.\n * @returns A Powerlines plugin that integrates Alloy-js transformations.\n */\nexport const plugin = <\n TContext extends AlloyPluginContext = AlloyPluginContext\n>(\n options: AlloyPluginOptions = {}\n) => {\n return [\n {\n name: \"alloy\",\n config() {\n this.debug(\n \"Updating configuration options to support Alloy-js builds.\"\n );\n\n return {\n alloy: {\n typescript: true,\n ...options\n },\n resolve: {\n external: [/^@alloy-js\\//]\n },\n tsdown: {\n inputOptions: {\n transform: {\n jsx: {\n runtime: \"automatic\",\n importSource: \"@alloy-js/core\"\n }\n }\n },\n plugins: [rollupPlugin()]\n }\n };\n },\n async configResolved() {\n this.debug(\"Ensuring TypeScript configuration is set up for Alloy-js.\");\n if (\n this.tsconfig.tsconfigJson.compilerOptions?.jsx !== \"react-jsx\" ||\n this.tsconfig.tsconfigJson.compilerOptions?.jsxImportSource !==\n \"@alloy-js/core\"\n ) {\n this.tsconfig.tsconfigJson.compilerOptions ??= {};\n\n if (this.tsconfig.tsconfigJson.compilerOptions.jsx !== \"react-jsx\") {\n this.tsconfig.tsconfigJson.compilerOptions.jsx = \"react-jsx\";\n }\n\n if (\n this.tsconfig.tsconfigJson.compilerOptions.jsxImportSource !==\n \"@alloy-js/core\"\n ) {\n this.tsconfig.tsconfigJson.compilerOptions.jsxImportSource =\n \"@alloy-js/core\";\n }\n\n await this.fs.write(\n this.tsconfig.tsconfigFilePath,\n StormJSON.stringify(this.tsconfig.tsconfigJson)\n );\n }\n\n if (\n this.config.babel &&\n (!this.config.babel.plugins ||\n !isDuplicatePlugin(\n this.config.babel.plugins,\n \"@babel/plugin-syntax-jsx\"\n ))\n ) {\n this.config.babel.plugins ??= [];\n this.config.babel.plugins.push(\"@babel/plugin-syntax-jsx\");\n }\n }\n }\n ] as Plugin<TContext>[];\n};\n\nexport default plugin;\n"],"mappings":";;;;;;;;;;;AAoCA,MAAa,UAGX,UAA8B,EAAE,KAC7B;AACH,QAAO,CACL;EACE,MAAM;EACN,SAAS;AACP,QAAK,MACH,6DACD;AAED,UAAO;IACL,OAAO;KACL,YAAY;KACZ,GAAG;KACJ;IACD,SAAS,EACP,UAAU,CAAC,eAAe,EAC3B;IACD,QAAQ;KACN,cAAc,EACZ,WAAW,EACT,KAAK;MACH,SAAS;MACT,cAAc;MACf,EACF,EACF;KACD,SAAS,CAAC,cAAc,CAAC;KAC1B;IACF;;EAEH,MAAM,iBAAiB;AACrB,QAAK,MAAM,4DAA4D;AACvE,OACE,KAAK,SAAS,aAAa,iBAAiB,QAAQ,eACpD,KAAK,SAAS,aAAa,iBAAiB,oBAC1C,kBACF;AACA,SAAK,SAAS,aAAa,oBAAoB,EAAE;AAEjD,QAAI,KAAK,SAAS,aAAa,gBAAgB,QAAQ,YACrD,MAAK,SAAS,aAAa,gBAAgB,MAAM;AAGnD,QACE,KAAK,SAAS,aAAa,gBAAgB,oBAC3C,iBAEA,MAAK,SAAS,aAAa,gBAAgB,kBACzC;AAGJ,UAAM,KAAK,GAAG,MACZ,KAAK,SAAS,kBACd,UAAU,UAAU,KAAK,SAAS,aAAa,CAChD;;AAGH,OACE,KAAK,OAAO,UACX,CAAC,KAAK,OAAO,MAAM,WAClB,CAAC,kBACC,KAAK,OAAO,MAAM,SAClB,2BACD,GACH;AACA,SAAK,OAAO,MAAM,YAAY,EAAE;AAChC,SAAK,OAAO,MAAM,QAAQ,KAAK,2BAA2B;;;EAG/D,CACF"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@powerlines/plugin-alloy",
3
- "version": "0.25.29",
3
+ "version": "0.25.30",
4
4
  "type": "module",
5
5
  "description": "A package containing various Alloy framework components and helper utilities.",
6
6
  "repository": {
@@ -810,8 +810,8 @@
810
810
  "@alloy-js/markdown": "0.23.0-dev.1",
811
811
  "@alloy-js/rollup-plugin": "^0.1.0",
812
812
  "@alloy-js/typescript": "0.23.0-dev.4",
813
- "@powerlines/deepkit": "^0.6.124",
814
- "@powerlines/plugin-babel": "^0.12.348",
813
+ "@powerlines/deepkit": "^0.6.125",
814
+ "@powerlines/plugin-babel": "^0.12.349",
815
815
  "@storm-software/config-tools": "1.189.28",
816
816
  "@stryke/capnp": "^0.12.83",
817
817
  "@stryke/convert": "^0.6.53",
@@ -824,14 +824,14 @@
824
824
  "@stryke/types": "^0.10.52",
825
825
  "@stryke/unique-id": "^0.3.68",
826
826
  "defu": "^6.1.4",
827
- "powerlines": "^0.41.10",
827
+ "powerlines": "^0.41.11",
828
828
  "prettier": "^3.8.1",
829
829
  "unctx": "^2.5.0"
830
830
  },
831
831
  "devDependencies": {
832
- "@powerlines/plugin-plugin": "^0.12.296",
832
+ "@powerlines/plugin-plugin": "^0.12.297",
833
833
  "@types/node": "^25.5.0"
834
834
  },
835
835
  "publishConfig": { "access": "public" },
836
- "gitHead": "8ab1d6e9a7ab44ee184b19c58d6de2c4c101ec01"
836
+ "gitHead": "c13dc78b9ef6d6418df534f4ea7181162d06ff1d"
837
837
  }