@powerlines/plugin-oxc-transform 0.5.465 → 0.5.467

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.
@@ -1 +1,29 @@
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=(n,r,a)=>(a=n==null?{}:e(i(n)),o(r||!n||!n.__esModule?t(a,`default`,{value:n,enumerable:!0}):a,n));exports.__toESM=s;
1
+ //#region \0rolldown/runtime.js
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 __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
23
+ value: mod,
24
+ enumerable: true
25
+ }) : target, mod));
26
+
27
+ //#endregion
28
+
29
+ exports.__toESM = __toESM;
package/dist/index.cjs CHANGED
@@ -1 +1,47 @@
1
- Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});const e=require(`./_virtual/_rolldown/runtime.cjs`);let t=require(`@stryke/path/find`),n=require(`defu`);n=e.__toESM(n,1);let r=require(`oxc-transform`);const i=(e={})=>({name:`oxc-transform`,config(){return{oxcTransform:(0,n.default)(e,{sourceType:`module`,cwd:this.config.root,envName:this.config.mode,outputPath:this.config.output.path,sourcemap:this.config.mode===`development`})}},async transform(e,n){let i=await(0,r.transform)(n,e,{lang:[`d.ts`,`d.cts`,`d.mts`].includes((0,t.findFileExtensionSafe)(n))?`dts`:(0,t.findFileExtension)(n),...this.config.oxcTransform});return{id:n,code:i.code,map:i.map}}});exports.default=i,exports.plugin=i;
1
+ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: 'Module' } });
2
+ const require_runtime = require('./_virtual/_rolldown/runtime.cjs');
3
+ let _stryke_path_find = require("@stryke/path/find");
4
+ let defu = require("defu");
5
+ defu = require_runtime.__toESM(defu, 1);
6
+ let oxc_transform = require("oxc-transform");
7
+
8
+ //#region src/index.ts
9
+ /**
10
+ * A Powerlines plugin to integrate oxc-transform for code transformation.
11
+ *
12
+ * @param options - The plugin options.
13
+ * @returns A Powerlines plugin instance.
14
+ */
15
+ const plugin = (options = {}) => {
16
+ return {
17
+ name: "oxc-transform",
18
+ config() {
19
+ return { oxcTransform: (0, defu.default)(options, {
20
+ sourceType: "module",
21
+ cwd: this.config.root,
22
+ envName: this.config.mode,
23
+ outputPath: this.config.output.path,
24
+ sourcemap: this.config.mode === "development"
25
+ }) };
26
+ },
27
+ async transform(code, id) {
28
+ const result = await (0, oxc_transform.transform)(id, code, {
29
+ lang: [
30
+ "d.ts",
31
+ "d.cts",
32
+ "d.mts"
33
+ ].includes((0, _stryke_path_find.findFileExtensionSafe)(id)) ? "dts" : (0, _stryke_path_find.findFileExtension)(id),
34
+ ...this.config.oxcTransform
35
+ });
36
+ return {
37
+ id,
38
+ code: result.code,
39
+ map: result.map
40
+ };
41
+ }
42
+ };
43
+ };
44
+
45
+ //#endregion
46
+ exports.default = plugin;
47
+ exports.plugin = plugin;
package/dist/index.mjs CHANGED
@@ -1,2 +1,44 @@
1
- import{findFileExtension as e,findFileExtensionSafe as t}from"@stryke/path/find";import n from"defu";import{transform as r}from"oxc-transform";const i=(i={})=>({name:`oxc-transform`,config(){return{oxcTransform:n(i,{sourceType:`module`,cwd:this.config.root,envName:this.config.mode,outputPath:this.config.output.path,sourcemap:this.config.mode===`development`})}},async transform(n,i){let a=await r(i,n,{lang:[`d.ts`,`d.cts`,`d.mts`].includes(t(i))?`dts`:e(i),...this.config.oxcTransform});return{id:i,code:a.code,map:a.map}}});export{i as default,i as plugin};
1
+ import { findFileExtension, findFileExtensionSafe } from "@stryke/path/find";
2
+ import defu from "defu";
3
+ import { transform } from "oxc-transform";
4
+
5
+ //#region src/index.ts
6
+ /**
7
+ * A Powerlines plugin to integrate oxc-transform for code transformation.
8
+ *
9
+ * @param options - The plugin options.
10
+ * @returns A Powerlines plugin instance.
11
+ */
12
+ const plugin = (options = {}) => {
13
+ return {
14
+ name: "oxc-transform",
15
+ config() {
16
+ return { oxcTransform: defu(options, {
17
+ sourceType: "module",
18
+ cwd: this.config.root,
19
+ envName: this.config.mode,
20
+ outputPath: this.config.output.path,
21
+ sourcemap: this.config.mode === "development"
22
+ }) };
23
+ },
24
+ async transform(code, id) {
25
+ const result = await transform(id, code, {
26
+ lang: [
27
+ "d.ts",
28
+ "d.cts",
29
+ "d.mts"
30
+ ].includes(findFileExtensionSafe(id)) ? "dts" : findFileExtension(id),
31
+ ...this.config.oxcTransform
32
+ });
33
+ return {
34
+ id,
35
+ code: result.code,
36
+ map: result.map
37
+ };
38
+ }
39
+ };
40
+ };
41
+
42
+ //#endregion
43
+ export { plugin as default, plugin };
2
44
  //# sourceMappingURL=index.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","names":[],"sources":["../src/index.ts"],"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 { findFileExtension, findFileExtensionSafe } from \"@stryke/path/find\";\nimport defu from \"defu\";\nimport { transform } from \"oxc-transform\";\nimport { Plugin } from \"powerlines\";\nimport {\n OxcTransformPluginContext,\n OxcTransformPluginOptions\n} from \"./types/plugin\";\n\nexport * from \"./types\";\n\ndeclare module \"powerlines\" {\n interface Config {\n oxcTransform?: OxcTransformPluginOptions;\n }\n}\n\n/**\n * A Powerlines plugin to integrate oxc-transform for code transformation.\n *\n * @param options - The plugin options.\n * @returns A Powerlines plugin instance.\n */\nexport const plugin = <\n TContext extends OxcTransformPluginContext = OxcTransformPluginContext\n>(\n options: OxcTransformPluginOptions = {}\n): Plugin<TContext> => {\n return {\n name: \"oxc-transform\",\n config() {\n return {\n oxcTransform: defu(options, {\n sourceType: \"module\",\n cwd: this.config.root,\n envName: this.config.mode,\n outputPath: this.config.output.path,\n sourcemap: this.config.mode === \"development\"\n })\n };\n },\n async transform(code, id) {\n const result = await transform(id, code, {\n lang: ([\"d.ts\", \"d.cts\", \"d.mts\"].includes(findFileExtensionSafe(id))\n ? \"dts\"\n : findFileExtension(id)) as OxcTransformPluginOptions[\"lang\"],\n ...this.config.oxcTransform\n });\n\n return { id, code: result.code, map: result.map };\n }\n };\n};\n\nexport default plugin;\n"],"mappings":"+IAyCA,MAAa,GAGX,EAAqC,EAAE,IAEhC,CACL,KAAM,gBACN,QAAS,CACP,MAAO,CACL,aAAc,EAAK,EAAS,CAC1B,WAAY,SACZ,IAAK,KAAK,OAAO,KACjB,QAAS,KAAK,OAAO,KACrB,WAAY,KAAK,OAAO,OAAO,KAC/B,UAAW,KAAK,OAAO,OAAS,cACjC,CAAC,CACH,EAEH,MAAM,UAAU,EAAM,EAAI,CACxB,IAAM,EAAS,MAAM,EAAU,EAAI,EAAM,CACvC,KAAO,CAAC,OAAQ,QAAS,QAAQ,CAAC,SAAS,EAAsB,EAAG,CAAC,CACjE,MACA,EAAkB,EAAG,CACzB,GAAG,KAAK,OAAO,aAChB,CAAC,CAEF,MAAO,CAAE,KAAI,KAAM,EAAO,KAAM,IAAK,EAAO,IAAK,EAEpD"}
1
+ {"version":3,"file":"index.mjs","names":[],"sources":["../src/index.ts"],"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 { findFileExtension, findFileExtensionSafe } from \"@stryke/path/find\";\nimport defu from \"defu\";\nimport { transform } from \"oxc-transform\";\nimport { Plugin } from \"powerlines\";\nimport {\n OxcTransformPluginContext,\n OxcTransformPluginOptions\n} from \"./types/plugin\";\n\nexport * from \"./types\";\n\ndeclare module \"powerlines\" {\n interface Config {\n oxcTransform?: OxcTransformPluginOptions;\n }\n}\n\n/**\n * A Powerlines plugin to integrate oxc-transform for code transformation.\n *\n * @param options - The plugin options.\n * @returns A Powerlines plugin instance.\n */\nexport const plugin = <\n TContext extends OxcTransformPluginContext = OxcTransformPluginContext\n>(\n options: OxcTransformPluginOptions = {}\n): Plugin<TContext> => {\n return {\n name: \"oxc-transform\",\n config() {\n return {\n oxcTransform: defu(options, {\n sourceType: \"module\",\n cwd: this.config.root,\n envName: this.config.mode,\n outputPath: this.config.output.path,\n sourcemap: this.config.mode === \"development\"\n })\n };\n },\n async transform(code, id) {\n const result = await transform(id, code, {\n lang: ([\"d.ts\", \"d.cts\", \"d.mts\"].includes(findFileExtensionSafe(id))\n ? \"dts\"\n : findFileExtension(id)) as OxcTransformPluginOptions[\"lang\"],\n ...this.config.oxcTransform\n });\n\n return { id, code: result.code, map: result.map };\n }\n };\n};\n\nexport default plugin;\n"],"mappings":";;;;;;;;;;;AAyCA,MAAa,UAGX,UAAqC,EAAE,KAClB;AACrB,QAAO;EACL,MAAM;EACN,SAAS;AACP,UAAO,EACL,cAAc,KAAK,SAAS;IAC1B,YAAY;IACZ,KAAK,KAAK,OAAO;IACjB,SAAS,KAAK,OAAO;IACrB,YAAY,KAAK,OAAO,OAAO;IAC/B,WAAW,KAAK,OAAO,SAAS;IACjC,CAAC,EACH;;EAEH,MAAM,UAAU,MAAM,IAAI;GACxB,MAAM,SAAS,MAAM,UAAU,IAAI,MAAM;IACvC,MAAO;KAAC;KAAQ;KAAS;KAAQ,CAAC,SAAS,sBAAsB,GAAG,CAAC,GACjE,QACA,kBAAkB,GAAG;IACzB,GAAG,KAAK,OAAO;IAChB,CAAC;AAEF,UAAO;IAAE;IAAI,MAAM,OAAO;IAAM,KAAK,OAAO;IAAK;;EAEpD"}
@@ -1 +1 @@
1
- export{};
1
+ export { };
@@ -1 +1 @@
1
- export{};
1
+ export { };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@powerlines/plugin-oxc-transform",
3
- "version": "0.5.465",
3
+ "version": "0.5.467",
4
4
  "type": "module",
5
5
  "description": "A Powerlines plugin to transform project code with Oxc Transformer.",
6
6
  "repository": {
@@ -97,13 +97,13 @@
97
97
  "@stryke/path": "^0.28.2",
98
98
  "defu": "^6.1.7",
99
99
  "oxc-transform": "^0.99.0",
100
- "powerlines": "^0.46.3"
100
+ "powerlines": "^0.46.5"
101
101
  },
102
102
  "devDependencies": {
103
- "@powerlines/plugin-plugin": "^0.12.407",
103
+ "@powerlines/plugin-plugin": "^0.12.409",
104
104
  "@types/node": "^25.6.0"
105
105
  },
106
106
  "publishConfig": { "access": "public" },
107
107
  "types": "./dist/index.d.cts",
108
- "gitHead": "9a51041e0817e438c49db05bb757b3bdbaf497ef"
108
+ "gitHead": "9af888c54e58a82744cc334a6b80da52429fa0ac"
109
109
  }