@powerlines/plugin-swc 0.5.372 → 0.5.375

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.
@@ -0,0 +1,29 @@
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;
@@ -0,0 +1,3 @@
1
+ import "node:module";
2
+
3
+ export { };
package/dist/index.cjs ADDED
@@ -0,0 +1,41 @@
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);
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;
@@ -0,0 +1,19 @@
1
+ import { SwcPluginContext, SwcPluginOptions, SwcPluginResolvedConfig, SwcPluginUserConfig, __ΩSwcPluginContext, __ΩSwcPluginOptions, __ΩSwcPluginResolvedConfig, __ΩSwcPluginUserConfig } from "./types/plugin.cjs";
2
+ import { Plugin } from "powerlines";
3
+
4
+ //#region src/index.d.ts
5
+ declare module "powerlines" {
6
+ interface Config {
7
+ swc?: SwcPluginOptions;
8
+ }
9
+ }
10
+ /**
11
+ * A Powerlines plugin to integrate SWC for code transformation.
12
+ *
13
+ * @param options - The plugin options.
14
+ * @returns A Powerlines plugin instance.
15
+ */
16
+ declare const plugin: <TContext extends SwcPluginContext = SwcPluginContext>(options?: SwcPluginOptions) => Plugin<TContext>;
17
+ //#endregion
18
+ export { SwcPluginContext, SwcPluginOptions, SwcPluginResolvedConfig, SwcPluginUserConfig, __ΩSwcPluginContext, __ΩSwcPluginOptions, __ΩSwcPluginResolvedConfig, __ΩSwcPluginUserConfig, plugin as default, plugin };
19
+ //# sourceMappingURL=index.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.cts","names":[],"sources":["../src/index.ts"],"mappings":";;;;;YA0BY,MAAA;IACR,GAAA,GAAM,gBAAA;EAAA;AAAA;;;;;;;cAUG,MAAA,oBAA2B,gBAAA,GAAmB,gBAAA,EACzD,OAAA,GAAS,gBAAA,KACR,MAAA,CAAO,QAAA"}
@@ -0,0 +1,19 @@
1
+ import { SwcPluginContext, SwcPluginOptions, SwcPluginResolvedConfig, SwcPluginUserConfig, __ΩSwcPluginContext, __ΩSwcPluginOptions, __ΩSwcPluginResolvedConfig, __ΩSwcPluginUserConfig } from "./types/plugin.mjs";
2
+ import { Plugin } from "powerlines";
3
+
4
+ //#region src/index.d.ts
5
+ declare module "powerlines" {
6
+ interface Config {
7
+ swc?: SwcPluginOptions;
8
+ }
9
+ }
10
+ /**
11
+ * A Powerlines plugin to integrate SWC for code transformation.
12
+ *
13
+ * @param options - The plugin options.
14
+ * @returns A Powerlines plugin instance.
15
+ */
16
+ declare const plugin: <TContext extends SwcPluginContext = SwcPluginContext>(options?: SwcPluginOptions) => Plugin<TContext>;
17
+ //#endregion
18
+ export { SwcPluginContext, SwcPluginOptions, SwcPluginResolvedConfig, SwcPluginUserConfig, __ΩSwcPluginContext, __ΩSwcPluginOptions, __ΩSwcPluginResolvedConfig, __ΩSwcPluginUserConfig, plugin as default, plugin };
19
+ //# sourceMappingURL=index.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.mts","names":[],"sources":["../src/index.ts"],"mappings":";;;;;YA0BY,MAAA;IACR,GAAA,GAAM,gBAAA;EAAA;AAAA;;;;;;;cAUG,MAAA,oBAA2B,gBAAA,GAAmB,gBAAA,EACzD,OAAA,GAAS,gBAAA,KACR,MAAA,CAAO,QAAA"}
package/dist/index.mjs ADDED
@@ -0,0 +1,38 @@
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 };
38
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +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":";;;;;;;;;;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"}
File without changes
@@ -0,0 +1,2 @@
1
+ import { SwcPluginContext, SwcPluginOptions, SwcPluginResolvedConfig, SwcPluginUserConfig, __ΩSwcPluginContext, __ΩSwcPluginOptions, __ΩSwcPluginResolvedConfig, __ΩSwcPluginUserConfig } from "./plugin.cjs";
2
+ export { SwcPluginContext, SwcPluginOptions, SwcPluginResolvedConfig, SwcPluginUserConfig, __ΩSwcPluginContext, __ΩSwcPluginOptions, __ΩSwcPluginResolvedConfig, __ΩSwcPluginUserConfig };
@@ -0,0 +1,2 @@
1
+ import { SwcPluginContext, SwcPluginOptions, SwcPluginResolvedConfig, SwcPluginUserConfig, __ΩSwcPluginContext, __ΩSwcPluginOptions, __ΩSwcPluginResolvedConfig, __ΩSwcPluginUserConfig } from "./plugin.mjs";
2
+ export { SwcPluginContext, SwcPluginOptions, SwcPluginResolvedConfig, SwcPluginUserConfig, __ΩSwcPluginContext, __ΩSwcPluginOptions, __ΩSwcPluginResolvedConfig, __ΩSwcPluginUserConfig };
@@ -0,0 +1 @@
1
+ export { };
File without changes
@@ -0,0 +1,19 @@
1
+ import { PluginContext, ResolvedConfig, UserConfig } from "powerlines";
2
+ import { Options } from "@swc/core";
3
+
4
+ //#region src/types/plugin.d.ts
5
+ type SwcPluginOptions = Partial<Omit<Options, "filename">>;
6
+ interface SwcPluginUserConfig extends UserConfig {
7
+ swc?: SwcPluginOptions;
8
+ }
9
+ interface SwcPluginResolvedConfig extends ResolvedConfig {
10
+ swc?: SwcPluginOptions;
11
+ }
12
+ type SwcPluginContext<TResolvedConfig extends SwcPluginResolvedConfig = SwcPluginResolvedConfig> = PluginContext<TResolvedConfig>;
13
+ declare type __ΩSwcPluginOptions = any[];
14
+ declare type __ΩSwcPluginUserConfig = any[];
15
+ declare type __ΩSwcPluginResolvedConfig = any[];
16
+ declare type __ΩSwcPluginContext = any[];
17
+ //#endregion
18
+ export { SwcPluginContext, SwcPluginOptions, SwcPluginResolvedConfig, SwcPluginUserConfig, __ΩSwcPluginContext, __ΩSwcPluginOptions, __ΩSwcPluginResolvedConfig, __ΩSwcPluginUserConfig };
19
+ //# sourceMappingURL=plugin.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plugin.d.cts","names":[],"sources":["../../src/types/plugin.ts"],"mappings":";;;;KAqBY,gBAAA,GAAmB,OAAA,CAAQ,IAAA,CAAK,OAAA;AAAA,UAE3B,mBAAA,SAA4B,UAAA;EAC3C,GAAA,GAAM,gBAAA;AAAA;AAAA,UAGS,uBAAA,SAAgC,cAAA;EAC/C,GAAA,GAAM,gBAAA;AAAA;AAAA,KAGI,gBAAA,yBACc,uBAAA,GAA0B,uBAAA,IAChD,aAAA,CAAc,eAAA;AAAA"}
@@ -0,0 +1,19 @@
1
+ import { Options } from "@swc/core";
2
+ import { PluginContext, ResolvedConfig, UserConfig } from "powerlines";
3
+
4
+ //#region src/types/plugin.d.ts
5
+ type SwcPluginOptions = Partial<Omit<Options, "filename">>;
6
+ interface SwcPluginUserConfig extends UserConfig {
7
+ swc?: SwcPluginOptions;
8
+ }
9
+ interface SwcPluginResolvedConfig extends ResolvedConfig {
10
+ swc?: SwcPluginOptions;
11
+ }
12
+ type SwcPluginContext<TResolvedConfig extends SwcPluginResolvedConfig = SwcPluginResolvedConfig> = PluginContext<TResolvedConfig>;
13
+ declare type __ΩSwcPluginOptions = any[];
14
+ declare type __ΩSwcPluginUserConfig = any[];
15
+ declare type __ΩSwcPluginResolvedConfig = any[];
16
+ declare type __ΩSwcPluginContext = any[];
17
+ //#endregion
18
+ export { SwcPluginContext, SwcPluginOptions, SwcPluginResolvedConfig, SwcPluginUserConfig, __ΩSwcPluginContext, __ΩSwcPluginOptions, __ΩSwcPluginResolvedConfig, __ΩSwcPluginUserConfig };
19
+ //# sourceMappingURL=plugin.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plugin.d.mts","names":[],"sources":["../../src/types/plugin.ts"],"mappings":";;;;KAqBY,gBAAA,GAAmB,OAAA,CAAQ,IAAA,CAAK,OAAA;AAAA,UAE3B,mBAAA,SAA4B,UAAA;EAC3C,GAAA,GAAM,gBAAA;AAAA;AAAA,UAGS,uBAAA,SAAgC,cAAA;EAC/C,GAAA,GAAM,gBAAA;AAAA;AAAA,KAGI,gBAAA,yBACc,uBAAA,GAA0B,uBAAA,IAChD,aAAA,CAAc,eAAA;AAAA"}
@@ -0,0 +1 @@
1
+ export { };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@powerlines/plugin-swc",
3
- "version": "0.5.372",
3
+ "version": "0.5.375",
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.18",
93
93
  "defu": "^6.1.4",
94
- "powerlines": "^0.42.4"
94
+ "powerlines": "^0.42.7"
95
95
  },
96
96
  "devDependencies": {
97
- "@powerlines/plugin-plugin": "^0.12.314",
97
+ "@powerlines/plugin-plugin": "^0.12.317",
98
98
  "@types/node": "^25.5.0"
99
99
  },
100
100
  "publishConfig": { "access": "public" },
101
101
  "types": "./dist/index.d.cts",
102
- "gitHead": "c3243c1ec0fbacb4afd4bd3db20432f443334076"
102
+ "gitHead": "8c25b27c36407abbd22351d8a9afba5bce5abc08"
103
103
  }