@powerlines/plugin-swc 0.5.347 → 0.5.349

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,20 @@
1
+ import { SwcPluginContext, SwcPluginOptions, SwcPluginResolvedConfig, SwcPluginUserConfig, __ΩSwcPluginContext, __ΩSwcPluginOptions, __ΩSwcPluginResolvedConfig, __ΩSwcPluginUserConfig } from "./types/plugin.cjs";
2
+ import "./types/index.cjs";
3
+ import { Plugin } from "powerlines";
4
+
5
+ //#region src/index.d.ts
6
+ declare module "powerlines" {
7
+ interface Config {
8
+ swc?: SwcPluginOptions;
9
+ }
10
+ }
11
+ /**
12
+ * A Powerlines plugin to integrate SWC for code transformation.
13
+ *
14
+ * @param options - The plugin options.
15
+ * @returns A Powerlines plugin instance.
16
+ */
17
+ declare const plugin: <TContext extends SwcPluginContext = SwcPluginContext>(options?: SwcPluginOptions) => Plugin<TContext>;
18
+ //#endregion
19
+ export { SwcPluginContext, SwcPluginOptions, SwcPluginResolvedConfig, SwcPluginUserConfig, __ΩSwcPluginContext, __ΩSwcPluginOptions, __ΩSwcPluginResolvedConfig, __ΩSwcPluginUserConfig, plugin as default, plugin };
20
+ //# sourceMappingURL=index.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.cts","names":[],"sources":["../src/index.ts"],"sourcesContent":[],"mappings":";;;;;;;IAuBwB,GAAA,CAAA,EAId,gBAJc;EAAA;;;;AAcxB;;;;AAEU,cAFG,MAEH,EAAA,CAAA,iBAF8B,gBAE9B,GAFiD,gBAEjD,CAAA,CAAA,OAAA,CAAA,EADC,gBACD,EAAA,GAAP,MAAO,CAAA,QAAA,CAAA"}
@@ -0,0 +1,20 @@
1
+ import { SwcPluginContext, SwcPluginOptions, SwcPluginResolvedConfig, SwcPluginUserConfig, __ΩSwcPluginContext, __ΩSwcPluginOptions, __ΩSwcPluginResolvedConfig, __ΩSwcPluginUserConfig } from "./types/plugin.mjs";
2
+ import "./types/index.mjs";
3
+ import { Plugin } from "powerlines";
4
+
5
+ //#region src/index.d.ts
6
+ declare module "powerlines" {
7
+ interface Config {
8
+ swc?: SwcPluginOptions;
9
+ }
10
+ }
11
+ /**
12
+ * A Powerlines plugin to integrate SWC for code transformation.
13
+ *
14
+ * @param options - The plugin options.
15
+ * @returns A Powerlines plugin instance.
16
+ */
17
+ declare const plugin: <TContext extends SwcPluginContext = SwcPluginContext>(options?: SwcPluginOptions) => Plugin<TContext>;
18
+ //#endregion
19
+ export { SwcPluginContext, SwcPluginOptions, SwcPluginResolvedConfig, SwcPluginUserConfig, __ΩSwcPluginContext, __ΩSwcPluginOptions, __ΩSwcPluginResolvedConfig, __ΩSwcPluginUserConfig, plugin as default, plugin };
20
+ //# sourceMappingURL=index.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.mts","names":[],"sources":["../src/index.ts"],"sourcesContent":[],"mappings":";;;;;;;IAuBwB,GAAA,CAAA,EAId,gBAJc;EAAA;;;;AAcxB;;;;AAEU,cAFG,MAEH,EAAA,CAAA,iBAF8B,gBAE9B,GAFiD,gBAEjD,CAAA,CAAA,OAAA,CAAA,EADC,gBACD,EAAA,GAAP,MAAO,CAAA,QAAA,CAAA"}
package/dist/index.mjs CHANGED
@@ -35,4 +35,5 @@ const plugin = (options = {}) => {
35
35
  var src_default = plugin;
36
36
 
37
37
  //#endregion
38
- export { src_default as default, plugin };
38
+ export { src_default as default, plugin };
39
+ //# 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.buildPath,\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;;AAGH,kBAAe"}
@@ -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,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"],"sourcesContent":[],"mappings":";;;;KAqBY,gBAAA,GAAmB,QAAQ,KAAK;UAE3B,mBAAA,SAA4B;EAFjC,GAAA,CAAA,EAGJ,gBAHoB;;AAAW,UAMtB,uBAAA,SAAgC,cANV,CAAA;EAAR,GAAA,CAAA,EAOvB,gBAPuB;;AAEd,KAQL,gBARyB,CAAA,wBASX,uBAT6B,GASH,uBATG,CAAA,GAUnD,aAVmD,CAUrC,eAVqC,CAAA;AAItC,mCACT,GAAA,EAAA;AAGI,sCAAgB,GAAA,EAAA;AACF,0CAAA,GAAA,EAAA;AAA0B,mCAAA,GAAA,EAAA"}
@@ -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"],"sourcesContent":[],"mappings":";;;;KAqBY,gBAAA,GAAmB,QAAQ,KAAK;UAE3B,mBAAA,SAA4B;EAFjC,GAAA,CAAA,EAGJ,gBAHoB;;AAAW,UAMtB,uBAAA,SAAgC,cANV,CAAA;EAAR,GAAA,CAAA,EAOvB,gBAPuB;;AAEd,KAQL,gBARyB,CAAA,wBASX,uBAT6B,GASH,uBATG,CAAA,GAUnD,aAVmD,CAUrC,eAVqC,CAAA;AAItC,mCACT,GAAA,EAAA;AAGI,sCAAgB,GAAA,EAAA;AACF,0CAAA,GAAA,EAAA;AAA0B,mCAAA,GAAA,EAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@powerlines/plugin-swc",
3
- "version": "0.5.347",
3
+ "version": "0.5.349",
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.41.3"
94
+ "powerlines": "^0.41.5"
95
95
  },
96
96
  "devDependencies": {
97
- "@powerlines/plugin-plugin": "^0.12.289",
97
+ "@powerlines/plugin-plugin": "^0.12.291",
98
98
  "@types/node": "^25.4.0"
99
99
  },
100
100
  "publishConfig": { "access": "public" },
101
101
  "types": "./dist/index.d.cts",
102
- "gitHead": "df3c5d736cd0fce20967864a4920af034e9434e3"
102
+ "gitHead": "0ed0ad0cd6f440d1584ac705987ef985931161db"
103
103
  }