@powerlines/plugin-swc 0.5.466 → 0.5.468

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,41 @@
1
- Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});const e=require(`./_virtual/_rolldown/runtime.cjs`);let t=require(`@swc/core`),n=require(`defu`);n=e.__toESM(n,1);const r=(e={})=>({name:`swc`,config(){return{swc:(0,n.default)(e,{outputPath:this.config.output.path,cwd:this.config.root,envName:this.config.mode,configFile:!1})}},async transform(e,n){let r=await(0,t.transform)(e,{...this.config.swc,filename:n});return{id:n,code:r.code,map:r.map}}});exports.default=r,exports.plugin=r;
1
+ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: 'Module' } });
2
+ const require_runtime = require('./_virtual/_rolldown/runtime.cjs');
3
+ let _swc_core = require("@swc/core");
4
+ let defu = require("defu");
5
+ defu = require_runtime.__toESM(defu, 1);
6
+
7
+ //#region src/index.ts
8
+ /**
9
+ * A Powerlines plugin to integrate SWC for code transformation.
10
+ *
11
+ * @param options - The plugin options.
12
+ * @returns A Powerlines plugin instance.
13
+ */
14
+ const plugin = (options = {}) => {
15
+ return {
16
+ name: "swc",
17
+ config() {
18
+ return { swc: (0, defu.default)(options, {
19
+ outputPath: this.config.output.path,
20
+ cwd: this.config.root,
21
+ envName: this.config.mode,
22
+ configFile: false
23
+ }) };
24
+ },
25
+ async transform(code, id) {
26
+ const result = await (0, _swc_core.transform)(code, {
27
+ ...this.config.swc,
28
+ filename: id
29
+ });
30
+ return {
31
+ id,
32
+ code: result.code,
33
+ map: result.map
34
+ };
35
+ }
36
+ };
37
+ };
38
+
39
+ //#endregion
40
+ exports.default = plugin;
41
+ exports.plugin = plugin;
package/dist/index.mjs CHANGED
@@ -1,2 +1,38 @@
1
- import{transform as e}from"@swc/core";import t from"defu";const n=(n={})=>({name:`swc`,config(){return{swc:t(n,{outputPath:this.config.output.path,cwd:this.config.root,envName:this.config.mode,configFile:!1})}},async transform(t,n){let r=await e(t,{...this.config.swc,filename:n});return{id:n,code:r.code,map:r.map}}});export{n as default,n as plugin};
1
+ import { transform } from "@swc/core";
2
+ import defu from "defu";
3
+
4
+ //#region src/index.ts
5
+ /**
6
+ * A Powerlines plugin to integrate SWC for code transformation.
7
+ *
8
+ * @param options - The plugin options.
9
+ * @returns A Powerlines plugin instance.
10
+ */
11
+ const plugin = (options = {}) => {
12
+ return {
13
+ name: "swc",
14
+ config() {
15
+ return { swc: defu(options, {
16
+ outputPath: this.config.output.path,
17
+ cwd: this.config.root,
18
+ envName: this.config.mode,
19
+ configFile: false
20
+ }) };
21
+ },
22
+ async transform(code, id) {
23
+ const result = await transform(code, {
24
+ ...this.config.swc,
25
+ filename: id
26
+ });
27
+ return {
28
+ id,
29
+ code: result.code,
30
+ map: result.map
31
+ };
32
+ }
33
+ };
34
+ };
35
+
36
+ //#endregion
37
+ export { plugin as default, plugin };
2
38
  //# 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 { transform } from \"@swc/core\";\nimport defu from \"defu\";\nimport { Plugin } from \"powerlines\";\nimport { SwcPluginContext, SwcPluginOptions } from \"./types/plugin\";\n\nexport * from \"./types\";\n\ndeclare module \"powerlines\" {\n interface Config {\n swc?: SwcPluginOptions;\n }\n}\n\n/**\n * A Powerlines plugin to integrate SWC for code transformation.\n *\n * @param options - The plugin options.\n * @returns A Powerlines plugin instance.\n */\nexport const plugin = <TContext extends SwcPluginContext = SwcPluginContext>(\n options: SwcPluginOptions = {}\n): Plugin<TContext> => {\n return {\n name: \"swc\",\n config() {\n return {\n swc: defu(options, {\n outputPath: this.config.output.path,\n cwd: this.config.root,\n envName: this.config.mode,\n configFile: false\n })\n };\n },\n async transform(code, id) {\n const result = await transform(code, {\n ...this.config.swc,\n filename: id\n });\n\n return { id, code: result.code, map: result.map };\n }\n };\n};\n\nexport default plugin;\n"],"mappings":"0DAqCA,MAAa,GACX,EAA4B,EAAE,IAEvB,CACL,KAAM,MACN,QAAS,CACP,MAAO,CACL,IAAK,EAAK,EAAS,CACjB,WAAY,KAAK,OAAO,OAAO,KAC/B,IAAK,KAAK,OAAO,KACjB,QAAS,KAAK,OAAO,KACrB,WAAY,GACb,CAAC,CACH,EAEH,MAAM,UAAU,EAAM,EAAI,CACxB,IAAM,EAAS,MAAM,EAAU,EAAM,CACnC,GAAG,KAAK,OAAO,IACf,SAAU,EACX,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 { transform } from \"@swc/core\";\nimport defu from \"defu\";\nimport { Plugin } from \"powerlines\";\nimport { SwcPluginContext, SwcPluginOptions } from \"./types/plugin\";\n\nexport * from \"./types\";\n\ndeclare module \"powerlines\" {\n interface Config {\n swc?: SwcPluginOptions;\n }\n}\n\n/**\n * A Powerlines plugin to integrate SWC for code transformation.\n *\n * @param options - The plugin options.\n * @returns A Powerlines plugin instance.\n */\nexport const plugin = <TContext extends SwcPluginContext = SwcPluginContext>(\n options: SwcPluginOptions = {}\n): Plugin<TContext> => {\n return {\n name: \"swc\",\n config() {\n return {\n swc: defu(options, {\n outputPath: this.config.output.path,\n cwd: this.config.root,\n envName: this.config.mode,\n configFile: false\n })\n };\n },\n async transform(code, id) {\n const result = await transform(code, {\n ...this.config.swc,\n filename: id\n });\n\n return { id, code: result.code, map: result.map };\n }\n };\n};\n\nexport default plugin;\n"],"mappings":";;;;;;;;;;AAqCA,MAAa,UACX,UAA4B,EAAE,KACT;AACrB,QAAO;EACL,MAAM;EACN,SAAS;AACP,UAAO,EACL,KAAK,KAAK,SAAS;IACjB,YAAY,KAAK,OAAO,OAAO;IAC/B,KAAK,KAAK,OAAO;IACjB,SAAS,KAAK,OAAO;IACrB,YAAY;IACb,CAAC,EACH;;EAEH,MAAM,UAAU,MAAM,IAAI;GACxB,MAAM,SAAS,MAAM,UAAU,MAAM;IACnC,GAAG,KAAK,OAAO;IACf,UAAU;IACX,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-swc",
3
- "version": "0.5.466",
3
+ "version": "0.5.468",
4
4
  "type": "module",
5
5
  "description": "A Powerlines plugin to transform project code with SWC.",
6
6
  "repository": {
@@ -91,13 +91,13 @@
91
91
  "dependencies": {
92
92
  "@swc/core": "^1.15.32",
93
93
  "defu": "^6.1.7",
94
- "powerlines": "^0.46.4"
94
+ "powerlines": "^0.46.6"
95
95
  },
96
96
  "devDependencies": {
97
- "@powerlines/plugin-plugin": "^0.12.408",
97
+ "@powerlines/plugin-plugin": "^0.12.410",
98
98
  "@types/node": "^25.6.0"
99
99
  },
100
100
  "publishConfig": { "access": "public" },
101
101
  "types": "./dist/index.d.cts",
102
- "gitHead": "2e5eff0d36cb4a1a54242017a16c5af5d9ce2cc3"
102
+ "gitHead": "610c4c943933458c5f433b9002d8c187625b2d3f"
103
103
  }