@powerlines/plugin-oxc-transform 0.5.55 → 0.5.57

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 @@
1
+ export { };
@@ -0,0 +1 @@
1
+ export { };
package/dist/index.cjs CHANGED
@@ -1,7 +1 @@
1
- 'use strict';Object.defineProperty(exports,'__esModule',{value:true});var find=require('@stryke/path/find'),f=require('defu'),oxcTransform=require('oxc-transform'),types=require('./types');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}var f__default=/*#__PURE__*/_interopDefault(f);/*****************************************
2
- *
3
- * ⚡ Built by Storm Software
4
- *
5
- *****************************************/
6
-
7
- var e=Object.defineProperty;var s=(n,t)=>e(n,"name",{value:t,configurable:true});const c=s((n={})=>({name:"oxc-transform",config(){return {transform:{oxc:f__default.default(n,{sourceType:"module",cwd:this.config.projectRoot,envName:this.config.mode,outputPath:this.config.output.buildPath,sourcemap:this.config.mode==="development"})}}},async transform(t,o){const r=await oxcTransform.transformAsync(o,t,{lang:["d.ts","d.cts","d.mts"].includes(find.findFileExtensionSafe(o))?"dts":find.findFileExtension(o),...this.config.transform.oxc});return {id:o,code:r.code,map:r.map}}}),"plugin");var y=c;exports.default=y;exports.plugin=c;Object.keys(types).forEach(function(k){if(k!=='default'&&!Object.prototype.hasOwnProperty.call(exports,k))Object.defineProperty(exports,k,{enumerable:true,get:function(){return types[k]}})});
1
+ Object.defineProperty(exports,`__esModule`,{value:!0});var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},s=(n,r,a)=>(a=n==null?{}:e(i(n)),o(r||!n||!n.__esModule?t(a,`default`,{value:n,enumerable:!0}):a,n));require(`./plugin-DHXHjv16.cjs`),require(`./types-DHkg7xmX.cjs`);let c=require(`@stryke/path/find`),l=require(`defu`);l=s(l);let u=require(`oxc-transform`);const d=(e={})=>({name:`oxc-transform`,config(){return{transform:{oxc:(0,l.default)(e,{sourceType:`module`,cwd:this.config.projectRoot,envName:this.config.mode,outputPath:this.config.output.buildPath,sourcemap:this.config.mode===`development`})}}},async transform(e,t){let n=await(0,u.transform)(t,e,{lang:[`d.ts`,`d.cts`,`d.mts`].includes((0,c.findFileExtensionSafe)(t))?`dts`:(0,c.findFileExtension)(t),...this.config.transform.oxc});return{id:t,code:n.code,map:n.map}}});var f=d;exports.default=f,exports.plugin=d;
package/dist/index.d.cts CHANGED
@@ -1,24 +1,7 @@
1
- import { O as OxcTransformPluginContext, a as OxcTransformPluginOptions, P as Plugin } from './index-p1YnlJVC.cjs';
2
- export { c as OxcTransformPluginResolvedConfig, b as OxcTransformPluginUserConfig, f as __ΩOxcTransformPluginContext, _ as __ΩOxcTransformPluginOptions, e as __ΩOxcTransformPluginResolvedConfig, d as __ΩOxcTransformPluginUserConfig } from './index-p1YnlJVC.cjs';
3
- import 'oxc-transform';
4
- import '@storm-software/build-tools/types';
5
- import '@storm-software/config-tools/types';
6
- import '@storm-software/config/types';
7
- import '@stryke/types/base';
8
- import '@stryke/types/configuration';
9
- import '@stryke/types/file';
10
- import 'vite';
11
- import '@stryke/env/get-env-paths';
12
- import '@stryke/types/package-json';
13
- import 'jiti';
14
- import 'magic-string';
15
- import 'semver';
16
- import 'ts-morph';
17
- import 'unplugin';
18
- import '@stryke/fs/resolve';
19
- import '@stryke/types/tsconfig';
20
- import 'typescript';
21
- import '@stryke/types/array';
1
+ import { a as __ΩOxcTransformPluginContext, c as __ΩOxcTransformPluginUserConfig, i as OxcTransformPluginUserConfig, l as Plugin, n as OxcTransformPluginOptions, o as __ΩOxcTransformPluginOptions, r as OxcTransformPluginResolvedConfig, s as __ΩOxcTransformPluginResolvedConfig, t as OxcTransformPluginContext } from "./plugin-BCkzbClU.cjs";
2
+ import "./index-CEgs-Dz2.cjs";
3
+
4
+ //#region src/index.d.ts
22
5
 
23
6
  /**
24
7
  * A Powerlines plugin to integrate oxc-transform for code transformation.
@@ -27,5 +10,6 @@ import '@stryke/types/array';
27
10
  * @returns A Powerlines plugin instance.
28
11
  */
29
12
  declare const plugin: <TContext extends OxcTransformPluginContext = OxcTransformPluginContext>(options?: OxcTransformPluginOptions) => Plugin<TContext>;
30
-
31
- export { OxcTransformPluginContext, OxcTransformPluginOptions, plugin as default, plugin };
13
+ //#endregion
14
+ export { OxcTransformPluginContext, OxcTransformPluginOptions, OxcTransformPluginResolvedConfig, OxcTransformPluginUserConfig, __ΩOxcTransformPluginContext, __ΩOxcTransformPluginOptions, __ΩOxcTransformPluginResolvedConfig, __ΩOxcTransformPluginUserConfig, plugin as default, plugin };
15
+ //# sourceMappingURL=index.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.cts","names":[],"sources":["../src/index.ts"],"sourcesContent":[],"mappings":";;;;;;AAoCA;;;;;AAIG,cAJU,MAIV,EAAA,CAAA,iBAHgB,yBAGhB,GAH4C,yBAG5C,CAAA,CAAA,OAAA,CAAA,EADQ,yBACR,EAAA,GAAA,MAAA,CAAO,QAAP,CAAA"}
@@ -0,0 +1,15 @@
1
+ import { a as __ΩOxcTransformPluginContext, c as __ΩOxcTransformPluginUserConfig, i as OxcTransformPluginUserConfig, l as Plugin, n as OxcTransformPluginOptions, o as __ΩOxcTransformPluginOptions, r as OxcTransformPluginResolvedConfig, s as __ΩOxcTransformPluginResolvedConfig, t as OxcTransformPluginContext } from "./plugin-BgseOCS7.mjs";
2
+ import "./index-BgAdqTbb.mjs";
3
+
4
+ //#region src/index.d.ts
5
+
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
+ declare const plugin: <TContext extends OxcTransformPluginContext = OxcTransformPluginContext>(options?: OxcTransformPluginOptions) => Plugin<TContext>;
13
+ //#endregion
14
+ export { OxcTransformPluginContext, OxcTransformPluginOptions, OxcTransformPluginResolvedConfig, OxcTransformPluginUserConfig, __ΩOxcTransformPluginContext, __ΩOxcTransformPluginOptions, __ΩOxcTransformPluginResolvedConfig, __ΩOxcTransformPluginUserConfig, plugin as default, plugin };
15
+ //# sourceMappingURL=index.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.mts","names":[],"sources":["../src/index.ts"],"sourcesContent":[],"mappings":";;;;;;AAoCA;;;;;AAIG,cAJU,MAIV,EAAA,CAAA,iBAHgB,yBAGhB,GAH4C,yBAG5C,CAAA,CAAA,OAAA,CAAA,EADQ,yBACR,EAAA,GAAA,MAAA,CAAO,QAAP,CAAA"}
package/dist/index.mjs ADDED
@@ -0,0 +1,2 @@
1
+ import"./plugin-Bvn-he2n.mjs";import"./types-B7VYa_Pp.mjs";import{findFileExtension as e,findFileExtensionSafe as t}from"@stryke/path/find";import n from"defu";import{transform as r}from"oxc-transform";const i=(i={})=>({name:`oxc-transform`,config(){return{transform:{oxc:n(i,{sourceType:`module`,cwd:this.config.projectRoot,envName:this.config.mode,outputPath:this.config.output.buildPath,sourcemap:this.config.mode===`development`})}}},async transform(n,i){let a=await r(i,n,{lang:[`d.ts`,`d.cts`,`d.mts`].includes(t(i))?`dts`:e(i),...this.config.transform.oxc});return{id:i,code:a.code,map:a.map}}});var a=i;export{a as default,i as plugin};
2
+ //# 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 { findFileExtension, findFileExtensionSafe } from \"@stryke/path/find\";\nimport defu from \"defu\";\nimport { transform } from \"oxc-transform\";\nimport { Plugin } from \"powerlines/types/plugin\";\nimport {\n OxcTransformPluginContext,\n OxcTransformPluginOptions,\n OxcTransformPluginUserConfig\n} from \"./types/plugin\";\n\nexport * from \"./types\";\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 transform: {\n oxc: defu(options, {\n sourceType: \"module\",\n cwd: this.config.projectRoot,\n envName: this.config.mode,\n outputPath: this.config.output.buildPath,\n sourcemap: this.config.mode === \"development\"\n })\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.transform.oxc\n });\n\n return { id, code: result.code, map: result.map };\n }\n };\n};\n\nexport default plugin;\n"],"mappings":"0MAoCA,MAAa,GAGX,EAAqC,EAAE,IAEhC,CACL,KAAM,gBACN,QAAS,CACP,MAAO,CACL,UAAW,CACT,IAAK,EAAK,EAAS,CACjB,WAAY,SACZ,IAAK,KAAK,OAAO,YACjB,QAAS,KAAK,OAAO,KACrB,WAAY,KAAK,OAAO,OAAO,UAC/B,UAAW,KAAK,OAAO,OAAS,cACjC,CAAC,CACH,CACF,EAEH,MAAM,UAAU,EAAM,EAAI,CACxB,IAAM,EAAS,MAAM,EAAU,EAAI,EAAM,CACvC,KAAO,CAAC,OAAQ,QAAS,QAAQ,CAAC,SAAS,EAAsB,EAAG,CAAC,CACjE,MACA,EAAkB,EAAG,CACzB,GAAG,KAAK,OAAO,UAAU,IAC1B,CAAC,CAEF,MAAO,CAAE,KAAI,KAAM,EAAO,KAAM,IAAK,EAAO,IAAK,EAEpD,EAGH,IAAA,EAAe"}