@powerlines/plugin-swc 0.5.349 → 0.5.351
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/README.md +14 -16
- package/dist/_virtual/{rolldown_runtime.cjs → _rolldown/runtime.cjs} +1 -1
- package/dist/_virtual/_rolldown/runtime.mjs +3 -0
- package/dist/index.cjs +6 -7
- package/dist/index.d.cts +0 -1
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.mts +0 -1
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +1 -2
- package/dist/index.mjs.map +1 -1
- package/dist/types/plugin.d.cts.map +1 -1
- package/dist/types/plugin.d.mts.map +1 -1
- package/package.json +5 -5
package/README.md
CHANGED
|
@@ -27,7 +27,7 @@ This package is part of the <b>🔌 Powerlines</b> monorepo. Powerlines is the "
|
|
|
27
27
|
|
|
28
28
|
<h3 align="center">💻 Visit <a href="https://stormsoftware.com" target="_blank">stormsoftware.com</a> to stay up to date with this developer</h3><br />
|
|
29
29
|
|
|
30
|
-
[](https://stormsoftware.com/projects/powerlines) [](http://commitizen.github.io/cz-cli/)  
|
|
31
31
|
|
|
32
32
|
<!-- prettier-ignore-start -->
|
|
33
33
|
<!-- markdownlint-disable -->
|
|
@@ -58,21 +58,19 @@ A Powerlines plugin to transform project code with [SWC](https://swc.rs/).
|
|
|
58
58
|
|
|
59
59
|
## Table of Contents
|
|
60
60
|
|
|
61
|
-
- [
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
- [
|
|
65
|
-
- [
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
- [Contributing](#contributing)
|
|
75
|
-
- [Contributors](#contributors)
|
|
61
|
+
- [Installing](#installing)
|
|
62
|
+
- [Reduced Package Size](#reduced-package-size)
|
|
63
|
+
- [Development](#development)
|
|
64
|
+
- [Building](#building)
|
|
65
|
+
- [Running unit tests](#running-unit-tests)
|
|
66
|
+
- [Linting](#linting)
|
|
67
|
+
- [Storm Workspaces](#storm-workspaces)
|
|
68
|
+
- [Roadmap](#roadmap)
|
|
69
|
+
- [Support](#support)
|
|
70
|
+
- [License](#license)
|
|
71
|
+
- [Changelog](#changelog)
|
|
72
|
+
- [Contributing](#contributing)
|
|
73
|
+
- [Contributors](#contributors)
|
|
76
74
|
|
|
77
75
|
<!-- END doctoc -->
|
|
78
76
|
|
package/dist/index.cjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
Object.
|
|
2
|
-
const
|
|
3
|
-
let
|
|
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
4
|
let defu = require("defu");
|
|
5
|
-
defu =
|
|
5
|
+
defu = require_runtime.__toESM(defu);
|
|
6
6
|
|
|
7
7
|
//#region src/index.ts
|
|
8
8
|
/**
|
|
@@ -23,7 +23,7 @@ const plugin = (options = {}) => {
|
|
|
23
23
|
}) };
|
|
24
24
|
},
|
|
25
25
|
async transform(code, id) {
|
|
26
|
-
const result = await (0,
|
|
26
|
+
const result = await (0, _swc_core.transform)(code, {
|
|
27
27
|
...this.config.swc,
|
|
28
28
|
filename: id
|
|
29
29
|
});
|
|
@@ -35,8 +35,7 @@ const plugin = (options = {}) => {
|
|
|
35
35
|
}
|
|
36
36
|
};
|
|
37
37
|
};
|
|
38
|
-
var src_default = plugin;
|
|
39
38
|
|
|
40
39
|
//#endregion
|
|
41
|
-
exports.default =
|
|
40
|
+
exports.default = plugin;
|
|
42
41
|
exports.plugin = plugin;
|
package/dist/index.d.cts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { SwcPluginContext, SwcPluginOptions, SwcPluginResolvedConfig, SwcPluginUserConfig, __ΩSwcPluginContext, __ΩSwcPluginOptions, __ΩSwcPluginResolvedConfig, __ΩSwcPluginUserConfig } from "./types/plugin.cjs";
|
|
2
|
-
import "./types/index.cjs";
|
|
3
2
|
import { Plugin } from "powerlines";
|
|
4
3
|
|
|
5
4
|
//#region src/index.d.ts
|
package/dist/index.d.cts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.cts","names":[],"sources":["../src/index.ts"],"
|
|
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"}
|
package/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { SwcPluginContext, SwcPluginOptions, SwcPluginResolvedConfig, SwcPluginUserConfig, __ΩSwcPluginContext, __ΩSwcPluginOptions, __ΩSwcPluginResolvedConfig, __ΩSwcPluginUserConfig } from "./types/plugin.mjs";
|
|
2
|
-
import "./types/index.mjs";
|
|
3
2
|
import { Plugin } from "powerlines";
|
|
4
3
|
|
|
5
4
|
//#region src/index.d.ts
|
package/dist/index.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.mts","names":[],"sources":["../src/index.ts"],"
|
|
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
CHANGED
package/dist/index.mjs.map
CHANGED
|
@@ -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.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
|
|
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"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.d.cts","names":[],"sources":["../../src/types/plugin.ts"],"
|
|
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"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.d.mts","names":[],"sources":["../../src/types/plugin.ts"],"
|
|
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"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@powerlines/plugin-swc",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.351",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "A Powerlines plugin to transform project code with SWC.",
|
|
6
6
|
"repository": {
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
"default": "./dist/index.mjs"
|
|
56
56
|
}
|
|
57
57
|
},
|
|
58
|
-
"
|
|
58
|
+
"./package.json": "./package.json",
|
|
59
59
|
"./types": {
|
|
60
60
|
"require": {
|
|
61
61
|
"types": "./dist/types/index.d.cts",
|
|
@@ -91,13 +91,13 @@
|
|
|
91
91
|
"dependencies": {
|
|
92
92
|
"@swc/core": "^1.15.18",
|
|
93
93
|
"defu": "^6.1.4",
|
|
94
|
-
"powerlines": "^0.41.
|
|
94
|
+
"powerlines": "^0.41.7"
|
|
95
95
|
},
|
|
96
96
|
"devDependencies": {
|
|
97
|
-
"@powerlines/plugin-plugin": "^0.12.
|
|
97
|
+
"@powerlines/plugin-plugin": "^0.12.293",
|
|
98
98
|
"@types/node": "^25.4.0"
|
|
99
99
|
},
|
|
100
100
|
"publishConfig": { "access": "public" },
|
|
101
101
|
"types": "./dist/index.d.cts",
|
|
102
|
-
"gitHead": "
|
|
102
|
+
"gitHead": "2fb48143904805988bac9bdbc04cdc4a35ff398b"
|
|
103
103
|
}
|