@powerlines/plugin-oxc-transform 0.5.370 → 0.5.372

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@powerlines/plugin-oxc-transform",
3
- "version": "0.5.370",
3
+ "version": "0.5.372",
4
4
  "type": "module",
5
5
  "description": "A Powerlines plugin to transform project code with Oxc Transformer.",
6
6
  "repository": {
@@ -97,13 +97,13 @@
97
97
  "@stryke/path": "^0.27.2",
98
98
  "defu": "^6.1.4",
99
99
  "oxc-transform": "^0.99.0",
100
- "powerlines": "^0.42.2"
100
+ "powerlines": "^0.42.4"
101
101
  },
102
102
  "devDependencies": {
103
- "@powerlines/plugin-plugin": "^0.12.312",
103
+ "@powerlines/plugin-plugin": "^0.12.314",
104
104
  "@types/node": "^25.5.0"
105
105
  },
106
106
  "publishConfig": { "access": "public" },
107
107
  "types": "./dist/index.d.cts",
108
- "gitHead": "d00a8306c2e4bc7b8fd853b0f935b5ef5f32d845"
108
+ "gitHead": "c3243c1ec0fbacb4afd4bd3db20432f443334076"
109
109
  }
@@ -1,29 +0,0 @@
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;
@@ -1,3 +0,0 @@
1
- import "node:module";
2
-
3
- export { };
package/dist/index.cjs DELETED
@@ -1,47 +0,0 @@
1
- Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: 'Module' } });
2
- const require_runtime = require('./_virtual/_rolldown/runtime.cjs');
3
- let _stryke_path_find = require("@stryke/path/find");
4
- let defu = require("defu");
5
- defu = require_runtime.__toESM(defu);
6
- let oxc_transform = require("oxc-transform");
7
-
8
- //#region src/index.ts
9
- /**
10
- * A Powerlines plugin to integrate oxc-transform for code transformation.
11
- *
12
- * @param options - The plugin options.
13
- * @returns A Powerlines plugin instance.
14
- */
15
- const plugin = (options = {}) => {
16
- return {
17
- name: "oxc-transform",
18
- config() {
19
- return { oxcTransform: (0, defu.default)(options, {
20
- sourceType: "module",
21
- cwd: this.config.root,
22
- envName: this.config.mode,
23
- outputPath: this.config.output.path,
24
- sourcemap: this.config.mode === "development"
25
- }) };
26
- },
27
- async transform(code, id) {
28
- const result = await (0, oxc_transform.transform)(id, code, {
29
- lang: [
30
- "d.ts",
31
- "d.cts",
32
- "d.mts"
33
- ].includes((0, _stryke_path_find.findFileExtensionSafe)(id)) ? "dts" : (0, _stryke_path_find.findFileExtension)(id),
34
- ...this.config.oxcTransform
35
- });
36
- return {
37
- id,
38
- code: result.code,
39
- map: result.map
40
- };
41
- }
42
- };
43
- };
44
-
45
- //#endregion
46
- exports.default = plugin;
47
- exports.plugin = plugin;
package/dist/index.d.cts DELETED
@@ -1,19 +0,0 @@
1
- import { OxcTransformPluginContext, OxcTransformPluginOptions, OxcTransformPluginResolvedConfig, OxcTransformPluginUserConfig, __ΩOxcTransformPluginContext, __ΩOxcTransformPluginOptions, __ΩOxcTransformPluginResolvedConfig, __ΩOxcTransformPluginUserConfig } from "./types/plugin.cjs";
2
- import { Plugin } from "powerlines";
3
-
4
- //#region src/index.d.ts
5
- declare module "powerlines" {
6
- interface Config {
7
- oxcTransform?: OxcTransformPluginOptions;
8
- }
9
- }
10
- /**
11
- * A Powerlines plugin to integrate oxc-transform for code transformation.
12
- *
13
- * @param options - The plugin options.
14
- * @returns A Powerlines plugin instance.
15
- */
16
- declare const plugin: <TContext extends OxcTransformPluginContext = OxcTransformPluginContext>(options?: OxcTransformPluginOptions) => Plugin<TContext>;
17
- //#endregion
18
- export { OxcTransformPluginContext, OxcTransformPluginOptions, OxcTransformPluginResolvedConfig, OxcTransformPluginUserConfig, __ΩOxcTransformPluginContext, __ΩOxcTransformPluginOptions, __ΩOxcTransformPluginResolvedConfig, __ΩOxcTransformPluginUserConfig, plugin as default, plugin };
19
- //# sourceMappingURL=index.d.cts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.cts","names":[],"sources":["../src/index.ts"],"mappings":";;;;;YA+BY,MAAA;IACR,YAAA,GAAe,yBAAA;EAAA;AAAA;;;;;;;cAUN,MAAA,oBACM,yBAAA,GAA4B,yBAAA,EAE7C,OAAA,GAAS,yBAAA,KACR,MAAA,CAAO,QAAA"}
package/dist/index.d.mts DELETED
@@ -1,19 +0,0 @@
1
- import { OxcTransformPluginContext, OxcTransformPluginOptions, OxcTransformPluginResolvedConfig, OxcTransformPluginUserConfig, __ΩOxcTransformPluginContext, __ΩOxcTransformPluginOptions, __ΩOxcTransformPluginResolvedConfig, __ΩOxcTransformPluginUserConfig } from "./types/plugin.mjs";
2
- import { Plugin } from "powerlines";
3
-
4
- //#region src/index.d.ts
5
- declare module "powerlines" {
6
- interface Config {
7
- oxcTransform?: OxcTransformPluginOptions;
8
- }
9
- }
10
- /**
11
- * A Powerlines plugin to integrate oxc-transform for code transformation.
12
- *
13
- * @param options - The plugin options.
14
- * @returns A Powerlines plugin instance.
15
- */
16
- declare const plugin: <TContext extends OxcTransformPluginContext = OxcTransformPluginContext>(options?: OxcTransformPluginOptions) => Plugin<TContext>;
17
- //#endregion
18
- export { OxcTransformPluginContext, OxcTransformPluginOptions, OxcTransformPluginResolvedConfig, OxcTransformPluginUserConfig, __ΩOxcTransformPluginContext, __ΩOxcTransformPluginOptions, __ΩOxcTransformPluginResolvedConfig, __ΩOxcTransformPluginUserConfig, plugin as default, plugin };
19
- //# sourceMappingURL=index.d.mts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.mts","names":[],"sources":["../src/index.ts"],"mappings":";;;;;YA+BY,MAAA;IACR,YAAA,GAAe,yBAAA;EAAA;AAAA;;;;;;;cAUN,MAAA,oBACM,yBAAA,GAA4B,yBAAA,EAE7C,OAAA,GAAS,yBAAA,KACR,MAAA,CAAO,QAAA"}
package/dist/index.mjs DELETED
@@ -1,44 +0,0 @@
1
- import { findFileExtension, findFileExtensionSafe } from "@stryke/path/find";
2
- import defu from "defu";
3
- import { transform } from "oxc-transform";
4
-
5
- //#region src/index.ts
6
- /**
7
- * A Powerlines plugin to integrate oxc-transform for code transformation.
8
- *
9
- * @param options - The plugin options.
10
- * @returns A Powerlines plugin instance.
11
- */
12
- const plugin = (options = {}) => {
13
- return {
14
- name: "oxc-transform",
15
- config() {
16
- return { oxcTransform: defu(options, {
17
- sourceType: "module",
18
- cwd: this.config.root,
19
- envName: this.config.mode,
20
- outputPath: this.config.output.path,
21
- sourcemap: this.config.mode === "development"
22
- }) };
23
- },
24
- async transform(code, id) {
25
- const result = await transform(id, code, {
26
- lang: [
27
- "d.ts",
28
- "d.cts",
29
- "d.mts"
30
- ].includes(findFileExtensionSafe(id)) ? "dts" : findFileExtension(id),
31
- ...this.config.oxcTransform
32
- });
33
- return {
34
- id,
35
- code: result.code,
36
- map: result.map
37
- };
38
- }
39
- };
40
- };
41
-
42
- //#endregion
43
- export { plugin as default, plugin };
44
- //# sourceMappingURL=index.mjs.map
@@ -1 +0,0 @@
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 { findFileExtension, findFileExtensionSafe } from \"@stryke/path/find\";\nimport defu from \"defu\";\nimport { transform } from \"oxc-transform\";\nimport { Plugin } from \"powerlines\";\nimport {\n OxcTransformPluginContext,\n OxcTransformPluginOptions,\n OxcTransformPluginUserConfig\n} from \"./types/plugin\";\n\nexport * from \"./types\";\n\ndeclare module \"powerlines\" {\n interface Config {\n oxcTransform?: OxcTransformPluginOptions;\n }\n}\n\n/**\n * A Powerlines plugin to integrate oxc-transform for code transformation.\n *\n * @param options - The plugin options.\n * @returns A Powerlines plugin instance.\n */\nexport const plugin = <\n TContext extends OxcTransformPluginContext = OxcTransformPluginContext\n>(\n options: OxcTransformPluginOptions = {}\n): Plugin<TContext> => {\n return {\n name: \"oxc-transform\",\n config() {\n return {\n oxcTransform: defu(options, {\n sourceType: \"module\",\n cwd: this.config.root,\n envName: this.config.mode,\n outputPath: this.config.output.path,\n sourcemap: this.config.mode === \"development\"\n })\n } as Partial<OxcTransformPluginUserConfig>;\n },\n async transform(code, id) {\n const result = await transform(id, code, {\n lang: ([\"d.ts\", \"d.cts\", \"d.mts\"].includes(findFileExtensionSafe(id))\n ? \"dts\"\n : findFileExtension(id)) as OxcTransformPluginOptions[\"lang\"],\n ...this.config.oxcTransform\n });\n\n return { id, code: result.code, map: result.map };\n }\n };\n};\n\nexport default plugin;\n"],"mappings":";;;;;;;;;;;AA0CA,MAAa,UAGX,UAAqC,EAAE,KAClB;AACrB,QAAO;EACL,MAAM;EACN,SAAS;AACP,UAAO,EACL,cAAc,KAAK,SAAS;IAC1B,YAAY;IACZ,KAAK,KAAK,OAAO;IACjB,SAAS,KAAK,OAAO;IACrB,YAAY,KAAK,OAAO,OAAO;IAC/B,WAAW,KAAK,OAAO,SAAS;IACjC,CAAC,EACH;;EAEH,MAAM,UAAU,MAAM,IAAI;GACxB,MAAM,SAAS,MAAM,UAAU,IAAI,MAAM;IACvC,MAAO;KAAC;KAAQ;KAAS;KAAQ,CAAC,SAAS,sBAAsB,GAAG,CAAC,GACjE,QACA,kBAAkB,GAAG;IACzB,GAAG,KAAK,OAAO;IAChB,CAAC;AAEF,UAAO;IAAE;IAAI,MAAM,OAAO;IAAM,KAAK,OAAO;IAAK;;EAEpD"}
File without changes
@@ -1,2 +0,0 @@
1
- import { OxcTransformPluginContext, OxcTransformPluginOptions, OxcTransformPluginResolvedConfig, OxcTransformPluginUserConfig, __ΩOxcTransformPluginContext, __ΩOxcTransformPluginOptions, __ΩOxcTransformPluginResolvedConfig, __ΩOxcTransformPluginUserConfig } from "./plugin.cjs";
2
- export { OxcTransformPluginContext, OxcTransformPluginOptions, OxcTransformPluginResolvedConfig, OxcTransformPluginUserConfig, __ΩOxcTransformPluginContext, __ΩOxcTransformPluginOptions, __ΩOxcTransformPluginResolvedConfig, __ΩOxcTransformPluginUserConfig };
@@ -1,2 +0,0 @@
1
- import { OxcTransformPluginContext, OxcTransformPluginOptions, OxcTransformPluginResolvedConfig, OxcTransformPluginUserConfig, __ΩOxcTransformPluginContext, __ΩOxcTransformPluginOptions, __ΩOxcTransformPluginResolvedConfig, __ΩOxcTransformPluginUserConfig } from "./plugin.mjs";
2
- export { OxcTransformPluginContext, OxcTransformPluginOptions, OxcTransformPluginResolvedConfig, OxcTransformPluginUserConfig, __ΩOxcTransformPluginContext, __ΩOxcTransformPluginOptions, __ΩOxcTransformPluginResolvedConfig, __ΩOxcTransformPluginUserConfig };
@@ -1 +0,0 @@
1
- export { };
File without changes
@@ -1,19 +0,0 @@
1
- import { PluginContext, ResolvedConfig, UserConfig } from "powerlines";
2
- import { TransformOptions } from "oxc-transform";
3
-
4
- //#region src/types/plugin.d.ts
5
- type OxcTransformPluginOptions = Partial<TransformOptions>;
6
- type OxcTransformPluginUserConfig = UserConfig & {
7
- oxcTransform?: OxcTransformPluginOptions;
8
- };
9
- type OxcTransformPluginResolvedConfig = ResolvedConfig & {
10
- oxcTransform?: OxcTransformPluginOptions;
11
- };
12
- type OxcTransformPluginContext<TResolvedConfig extends OxcTransformPluginResolvedConfig = OxcTransformPluginResolvedConfig> = PluginContext<TResolvedConfig>;
13
- declare type __ΩOxcTransformPluginOptions = any[];
14
- declare type __ΩOxcTransformPluginUserConfig = any[];
15
- declare type __ΩOxcTransformPluginResolvedConfig = any[];
16
- declare type __ΩOxcTransformPluginContext = any[];
17
- //#endregion
18
- export { OxcTransformPluginContext, OxcTransformPluginOptions, OxcTransformPluginResolvedConfig, OxcTransformPluginUserConfig, __ΩOxcTransformPluginContext, __ΩOxcTransformPluginOptions, __ΩOxcTransformPluginResolvedConfig, __ΩOxcTransformPluginUserConfig };
19
- //# sourceMappingURL=plugin.d.cts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"plugin.d.cts","names":[],"sources":["../../src/types/plugin.ts"],"mappings":";;;;KAqBY,yBAAA,GAA4B,OAAA,CAAQ,gBAAA;AAAA,KAEpC,4BAAA,GAA+B,UAAA;EACzC,YAAA,GAAe,yBAAA;AAAA;AAAA,KAGL,gCAAA,GAAmC,cAAA;EAC7C,YAAA,GAAe,yBAAA;AAAA;AAAA,KAGL,yBAAA,yBACc,gCAAA,GACtB,gCAAA,IACA,aAAA,CAAc,eAAA;AAAA"}
@@ -1,19 +0,0 @@
1
- import { TransformOptions } from "oxc-transform";
2
- import { PluginContext, ResolvedConfig, UserConfig } from "powerlines";
3
-
4
- //#region src/types/plugin.d.ts
5
- type OxcTransformPluginOptions = Partial<TransformOptions>;
6
- type OxcTransformPluginUserConfig = UserConfig & {
7
- oxcTransform?: OxcTransformPluginOptions;
8
- };
9
- type OxcTransformPluginResolvedConfig = ResolvedConfig & {
10
- oxcTransform?: OxcTransformPluginOptions;
11
- };
12
- type OxcTransformPluginContext<TResolvedConfig extends OxcTransformPluginResolvedConfig = OxcTransformPluginResolvedConfig> = PluginContext<TResolvedConfig>;
13
- declare type __ΩOxcTransformPluginOptions = any[];
14
- declare type __ΩOxcTransformPluginUserConfig = any[];
15
- declare type __ΩOxcTransformPluginResolvedConfig = any[];
16
- declare type __ΩOxcTransformPluginContext = any[];
17
- //#endregion
18
- export { OxcTransformPluginContext, OxcTransformPluginOptions, OxcTransformPluginResolvedConfig, OxcTransformPluginUserConfig, __ΩOxcTransformPluginContext, __ΩOxcTransformPluginOptions, __ΩOxcTransformPluginResolvedConfig, __ΩOxcTransformPluginUserConfig };
19
- //# sourceMappingURL=plugin.d.mts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"plugin.d.mts","names":[],"sources":["../../src/types/plugin.ts"],"mappings":";;;;KAqBY,yBAAA,GAA4B,OAAA,CAAQ,gBAAA;AAAA,KAEpC,4BAAA,GAA+B,UAAA;EACzC,YAAA,GAAe,yBAAA;AAAA;AAAA,KAGL,gCAAA,GAAmC,cAAA;EAC7C,YAAA,GAAe,yBAAA;AAAA;AAAA,KAGL,yBAAA,yBACc,gCAAA,GACtB,gCAAA,IACA,aAAA,CAAc,eAAA;AAAA"}
@@ -1 +0,0 @@
1
- export { };