@powerlines/plugin-swc 0.5.299 → 0.5.301
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/dist/index.cjs +4 -4
- package/dist/index.d.cts +6 -2
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.mts +6 -2
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +4 -4
- package/dist/index.mjs.map +1 -1
- package/dist/types/plugin.d.cts +7 -13
- package/dist/types/plugin.d.cts.map +1 -1
- package/dist/types/plugin.d.mts +7 -13
- package/dist/types/plugin.d.mts.map +1 -1
- package/package.json +6 -6
package/dist/index.cjs
CHANGED
|
@@ -15,16 +15,16 @@ const plugin = (options = {}) => {
|
|
|
15
15
|
return {
|
|
16
16
|
name: "swc",
|
|
17
17
|
config() {
|
|
18
|
-
return {
|
|
18
|
+
return { swc: (0, defu.default)(options, {
|
|
19
19
|
outputPath: this.config.output.buildPath,
|
|
20
|
-
cwd: this.config.
|
|
20
|
+
cwd: this.config.root,
|
|
21
21
|
envName: this.config.mode,
|
|
22
22
|
configFile: false
|
|
23
|
-
}) }
|
|
23
|
+
}) };
|
|
24
24
|
},
|
|
25
25
|
async transform(code, id) {
|
|
26
26
|
const result = await (0, __swc_core.transform)(code, {
|
|
27
|
-
...this.config.
|
|
27
|
+
...this.config.swc,
|
|
28
28
|
filename: id
|
|
29
29
|
});
|
|
30
30
|
return {
|
package/dist/index.d.cts
CHANGED
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
import { SwcPluginContext, SwcPluginOptions, SwcPluginResolvedConfig, SwcPluginUserConfig, __ΩSwcPluginContext, __ΩSwcPluginOptions, __ΩSwcPluginResolvedConfig, __ΩSwcPluginUserConfig } from "./types/plugin.cjs";
|
|
2
2
|
import "./types/index.cjs";
|
|
3
|
-
import { Plugin } from "powerlines
|
|
3
|
+
import { Plugin } from "powerlines";
|
|
4
4
|
|
|
5
5
|
//#region src/index.d.ts
|
|
6
|
-
|
|
6
|
+
declare module "powerlines" {
|
|
7
|
+
interface UserConfig {
|
|
8
|
+
swc?: SwcPluginOptions;
|
|
9
|
+
}
|
|
10
|
+
}
|
|
7
11
|
/**
|
|
8
12
|
* A Powerlines plugin to integrate SWC for code transformation.
|
|
9
13
|
*
|
package/dist/index.d.cts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.cts","names":[],"sources":["../src/index.ts"],"sourcesContent":[],"mappings":"
|
|
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"}
|
package/dist/index.d.mts
CHANGED
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
import { SwcPluginContext, SwcPluginOptions, SwcPluginResolvedConfig, SwcPluginUserConfig, __ΩSwcPluginContext, __ΩSwcPluginOptions, __ΩSwcPluginResolvedConfig, __ΩSwcPluginUserConfig } from "./types/plugin.mjs";
|
|
2
2
|
import "./types/index.mjs";
|
|
3
|
-
import { Plugin } from "powerlines
|
|
3
|
+
import { Plugin } from "powerlines";
|
|
4
4
|
|
|
5
5
|
//#region src/index.d.ts
|
|
6
|
-
|
|
6
|
+
declare module "powerlines" {
|
|
7
|
+
interface UserConfig {
|
|
8
|
+
swc?: SwcPluginOptions;
|
|
9
|
+
}
|
|
10
|
+
}
|
|
7
11
|
/**
|
|
8
12
|
* A Powerlines plugin to integrate SWC for code transformation.
|
|
9
13
|
*
|
package/dist/index.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.mts","names":[],"sources":["../src/index.ts"],"sourcesContent":[],"mappings":"
|
|
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
|
@@ -12,16 +12,16 @@ const plugin = (options = {}) => {
|
|
|
12
12
|
return {
|
|
13
13
|
name: "swc",
|
|
14
14
|
config() {
|
|
15
|
-
return {
|
|
15
|
+
return { swc: defu(options, {
|
|
16
16
|
outputPath: this.config.output.buildPath,
|
|
17
|
-
cwd: this.config.
|
|
17
|
+
cwd: this.config.root,
|
|
18
18
|
envName: this.config.mode,
|
|
19
19
|
configFile: false
|
|
20
|
-
}) }
|
|
20
|
+
}) };
|
|
21
21
|
},
|
|
22
22
|
async transform(code, id) {
|
|
23
23
|
const result = await transform(code, {
|
|
24
|
-
...this.config.
|
|
24
|
+
...this.config.swc,
|
|
25
25
|
filename: id
|
|
26
26
|
});
|
|
27
27
|
return {
|
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
|
|
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 export interface UserConfig {\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"}
|
package/dist/types/plugin.d.cts
CHANGED
|
@@ -1,20 +1,14 @@
|
|
|
1
|
+
import { PluginContext, ResolvedConfig, UserConfig } from "powerlines";
|
|
1
2
|
import { Options } from "@swc/core";
|
|
2
|
-
import { UserConfig } from "powerlines/types/config";
|
|
3
|
-
import { PluginContext } from "powerlines/types/context";
|
|
4
|
-
import { ResolvedConfig } from "powerlines/types/resolved";
|
|
5
3
|
|
|
6
4
|
//#region src/types/plugin.d.ts
|
|
7
5
|
type SwcPluginOptions = Partial<Omit<Options, "filename">>;
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
transform?: {
|
|
15
|
-
swc?: SwcPluginOptions;
|
|
16
|
-
};
|
|
17
|
-
};
|
|
6
|
+
interface SwcPluginUserConfig extends UserConfig {
|
|
7
|
+
swc?: SwcPluginOptions;
|
|
8
|
+
}
|
|
9
|
+
interface SwcPluginResolvedConfig extends ResolvedConfig {
|
|
10
|
+
swc?: SwcPluginOptions;
|
|
11
|
+
}
|
|
18
12
|
type SwcPluginContext<TResolvedConfig extends SwcPluginResolvedConfig = SwcPluginResolvedConfig> = PluginContext<TResolvedConfig>;
|
|
19
13
|
declare type __ΩSwcPluginOptions = any[];
|
|
20
14
|
declare type __ΩSwcPluginUserConfig = any[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.d.cts","names":[],"sources":["../../src/types/plugin.ts"],"sourcesContent":[],"mappings":"
|
|
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"}
|
package/dist/types/plugin.d.mts
CHANGED
|
@@ -1,20 +1,14 @@
|
|
|
1
1
|
import { Options } from "@swc/core";
|
|
2
|
-
import { UserConfig } from "powerlines
|
|
3
|
-
import { PluginContext } from "powerlines/types/context";
|
|
4
|
-
import { ResolvedConfig } from "powerlines/types/resolved";
|
|
2
|
+
import { PluginContext, ResolvedConfig, UserConfig } from "powerlines";
|
|
5
3
|
|
|
6
4
|
//#region src/types/plugin.d.ts
|
|
7
5
|
type SwcPluginOptions = Partial<Omit<Options, "filename">>;
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
transform?: {
|
|
15
|
-
swc?: SwcPluginOptions;
|
|
16
|
-
};
|
|
17
|
-
};
|
|
6
|
+
interface SwcPluginUserConfig extends UserConfig {
|
|
7
|
+
swc?: SwcPluginOptions;
|
|
8
|
+
}
|
|
9
|
+
interface SwcPluginResolvedConfig extends ResolvedConfig {
|
|
10
|
+
swc?: SwcPluginOptions;
|
|
11
|
+
}
|
|
18
12
|
type SwcPluginContext<TResolvedConfig extends SwcPluginResolvedConfig = SwcPluginResolvedConfig> = PluginContext<TResolvedConfig>;
|
|
19
13
|
declare type __ΩSwcPluginOptions = any[];
|
|
20
14
|
declare type __ΩSwcPluginUserConfig = any[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.d.mts","names":[],"sources":["../../src/types/plugin.ts"],"sourcesContent":[],"mappings":"
|
|
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.
|
|
3
|
+
"version": "0.5.301",
|
|
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
|
+
"./*": "./*",
|
|
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.8",
|
|
93
93
|
"defu": "^6.1.4",
|
|
94
|
-
"powerlines": "^0.
|
|
94
|
+
"powerlines": "^0.39.1"
|
|
95
95
|
},
|
|
96
96
|
"devDependencies": {
|
|
97
|
-
"@powerlines/plugin-plugin": "^0.12.
|
|
98
|
-
"@types/node": "^25.3.
|
|
97
|
+
"@powerlines/plugin-plugin": "^0.12.243",
|
|
98
|
+
"@types/node": "^25.3.3"
|
|
99
99
|
},
|
|
100
100
|
"publishConfig": { "access": "public" },
|
|
101
101
|
"types": "./dist/index.d.cts",
|
|
102
|
-
"gitHead": "
|
|
102
|
+
"gitHead": "30a096fed42d3462dbc028b16145250c373f3d99"
|
|
103
103
|
}
|