@powerlines/plugin-deepkit 0.10.67 → 0.10.69
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/_virtual/rolldown_runtime.cjs +1 -0
- package/dist/{chunk-X42XA8SV.mjs → _virtual/rolldown_runtime.mjs} +1 -1
- package/dist/deepkit/src/transformer.cjs +1 -0
- package/dist/deepkit/src/transformer.mjs +1 -0
- package/dist/deepkit/src/vendor/type-compiler/config.d.cts +7 -0
- package/dist/deepkit/src/vendor/type-compiler/config.d.mts +7 -0
- package/dist/deepkit/src/vendor/type-compiler/index.cjs +1 -0
- package/dist/deepkit/src/vendor/type-compiler/index.mjs +1 -0
- package/dist/index.cjs +1 -4
- package/dist/index.d.cts +2 -2
- package/dist/index.d.mts +3 -2
- package/dist/index.mjs +1 -4
- package/dist/plugin-tsc/src/helpers/index.cjs +1 -0
- package/dist/plugin-tsc/src/helpers/index.mjs +1 -0
- package/dist/plugin-tsc/src/helpers/type-check.cjs +4 -0
- package/dist/plugin-tsc/src/helpers/type-check.mjs +4 -0
- package/dist/plugin-tsc/src/index.cjs +1 -0
- package/dist/plugin-tsc/src/index.mjs +1 -0
- package/dist/plugin-tsc/src/types/plugin.d.cts +33 -0
- package/dist/plugin-tsc/src/types/plugin.d.mts +33 -0
- package/dist/powerlines/src/types/build.d.cts +139 -0
- package/dist/powerlines/src/types/build.d.mts +139 -0
- package/dist/powerlines/src/types/commands.d.cts +8 -0
- package/dist/powerlines/src/types/commands.d.mts +9 -0
- package/dist/powerlines/src/types/config.d.cts +345 -0
- package/dist/powerlines/src/types/config.d.mts +345 -0
- package/dist/powerlines/src/types/context.d.cts +347 -0
- package/dist/powerlines/src/types/context.d.mts +349 -0
- package/dist/powerlines/src/types/fs.d.cts +458 -0
- package/dist/powerlines/src/types/fs.d.mts +458 -0
- package/dist/powerlines/src/types/hooks.d.mts +2 -0
- package/dist/powerlines/src/types/plugin.d.cts +232 -0
- package/dist/powerlines/src/types/plugin.d.mts +232 -0
- package/dist/powerlines/src/types/resolved.d.cts +81 -0
- package/dist/powerlines/src/types/resolved.d.mts +81 -0
- package/dist/powerlines/src/types/tsconfig.d.cts +69 -0
- package/dist/powerlines/src/types/tsconfig.d.mts +69 -0
- package/dist/types/index.cjs +0 -1
- package/dist/types/index.d.cts +1 -2
- package/dist/types/index.d.mts +1 -2
- package/dist/types/index.mjs +1 -1
- package/dist/types/plugin.cjs +0 -1
- package/dist/types/plugin.d.cts +27 -1
- package/dist/types/plugin.d.mts +27 -1
- package/dist/types/plugin.mjs +1 -1
- package/package.json +7 -7
- package/dist/index-CEgs-Dz2.d.cts +0 -1
- package/dist/index-D9zIjQH9.d.mts +0 -1
- package/dist/plugin-BuZY17hY.d.mts +0 -1688
- package/dist/plugin-DHXHjv16.cjs +0 -0
- package/dist/plugin-DTzaqHqR.d.cts +0 -1690
- package/dist/plugin-DzeYlbKJ.mjs +0 -1
- package/dist/types-BKeuN6sy.mjs +0 -1
- package/dist/types-DHkg7xmX.cjs +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
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=(e,n,r,i)=>{i&&(t(e,Symbol.toStringTag,{value:`Module`}),r&&t(r,Symbol.toStringTag,{value:`Module`})),o(e,n,`default`),r&&o(r,n,`default`)},c=(n,r,a)=>(a=n==null?{}:e(i(n)),o(r||!n||!n.__esModule?t(a,`default`,{value:n,enumerable:!0}):a,n));exports.__reExport=s,exports.__toESM=c;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var e=Object.defineProperty,t=Object.getOwnPropertyDescriptor,n=Object.getOwnPropertyNames,r=Object.prototype.hasOwnProperty,i=(i,a,o,s)=>{if(a&&typeof a==`object`||typeof a==`function`)for(var c=n(a),l=0,u=c.length,d;l<u;l++)d=c[l],!r.call(i,d)&&d!==o&&e(i,d,{get:(e=>a[e]).bind(null,d),enumerable:!(s=t(a,d))||s.enumerable});return i},a=(t,n,r,a)=>{a&&(e(t,Symbol.toStringTag,{value:`Module`}),r&&e(r,Symbol.toStringTag,{value:`Module`})),i(t,n,`default`),r&&i(r,n,`default`)};export{a as
|
|
1
|
+
var e=Object.defineProperty,t=Object.getOwnPropertyDescriptor,n=Object.getOwnPropertyNames,r=Object.prototype.hasOwnProperty,i=(i,a,o,s)=>{if(a&&typeof a==`object`||typeof a==`function`)for(var c=n(a),l=0,u=c.length,d;l<u;l++)d=c[l],!r.call(i,d)&&d!==o&&e(i,d,{get:(e=>a[e]).bind(null,d),enumerable:!(s=t(a,d))||s.enumerable});return i},a=(t,n,r,a)=>{a&&(e(t,Symbol.toStringTag,{value:`Module`}),r&&e(r,Symbol.toStringTag,{value:`Module`})),i(t,n,`default`),r&&i(r,n,`default`)};export{a as __reExport};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=require(`../../_virtual/rolldown_runtime.cjs`),t=require(`./vendor/type-compiler/index.cjs`);let n=require(`defu`);n=e.__toESM(n);let r=!1;const i=new t.type_compiler_exports.Cache;function a(e,a={}){return function(o){return r||=!0,i.tick(),new t.type_compiler_exports.ReflectionTransformer(o,i).withReflection((0,n.default)(a,{reflection:e.tsconfig.tsconfigJson.compilerOptions?.reflection||e.tsconfig.tsconfigJson.reflection,reflectionLevel:e.tsconfig.tsconfigJson.compilerOptions?.reflectionLevel||e.tsconfig.tsconfigJson.reflectionLevel},{exclude:[],reflection:`default`,reflectionLevel:`minimal`}))}}function o(e,r={}){return function(a){return new t.type_compiler_exports.DeclarationTransformer(a,i).withReflection((0,n.default)(r,{reflection:e.tsconfig.tsconfigJson.compilerOptions?.reflection||e.tsconfig.tsconfigJson.reflection,reflectionLevel:e.tsconfig.tsconfigJson.compilerOptions?.reflectionLevel||e.tsconfig.tsconfigJson.reflectionLevel},{exclude:[],reflection:`default`,reflectionLevel:`minimal`}))}}exports.createDeclarationTransformer=o,exports.createTransformer=a;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{type_compiler_exports as e}from"./vendor/type-compiler/index.mjs";import t from"defu";let n=!1;const r=new e.Cache;function i(i,a={}){return function(o){return n||=!0,r.tick(),new e.ReflectionTransformer(o,r).withReflection(t(a,{reflection:i.tsconfig.tsconfigJson.compilerOptions?.reflection||i.tsconfig.tsconfigJson.reflection,reflectionLevel:i.tsconfig.tsconfigJson.compilerOptions?.reflectionLevel||i.tsconfig.tsconfigJson.reflectionLevel},{exclude:[],reflection:`default`,reflectionLevel:`minimal`}))}}function a(n,i={}){return function(a){return new e.DeclarationTransformer(a,r).withReflection(t(i,{reflection:n.tsconfig.tsconfigJson.compilerOptions?.reflection||n.tsconfig.tsconfigJson.reflection,reflectionLevel:n.tsconfig.tsconfigJson.compilerOptions?.reflectionLevel||n.tsconfig.tsconfigJson.reflectionLevel},{exclude:[],reflection:`default`,reflectionLevel:`minimal`}))}}export{a as createDeclarationTransformer,i as createTransformer};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export * from "@deepkit/type-compiler/config";
|
|
2
|
+
|
|
3
|
+
//#region ../deepkit/src/vendor/type-compiler/config.d.ts
|
|
4
|
+
|
|
5
|
+
import * as import___deepkit_type_compiler_config from "@deepkit/type-compiler/config";
|
|
6
|
+
//#endregion
|
|
7
|
+
export { import___deepkit_type_compiler_config as config_d_exports };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export * from "@deepkit/type-compiler/config";
|
|
2
|
+
|
|
3
|
+
//#region ../deepkit/src/vendor/type-compiler/config.d.ts
|
|
4
|
+
|
|
5
|
+
import * as import___deepkit_type_compiler_config from "@deepkit/type-compiler/config";
|
|
6
|
+
//#endregion
|
|
7
|
+
export { import___deepkit_type_compiler_config as config_d_exports };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=require(`../../../../_virtual/rolldown_runtime.cjs`);var t={};e.__reExport(t,require(`@deepkit/type-compiler`)),Object.defineProperty(exports,`type_compiler_exports`,{enumerable:!0,get:function(){return t}});var n=require(`@deepkit/type-compiler`);Object.keys(n).forEach(function(e){e!==`default`&&!Object.prototype.hasOwnProperty.call(exports,e)&&Object.defineProperty(exports,e,{enumerable:!0,get:function(){return n[e]}})});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{__reExport as e}from"../../../../_virtual/rolldown_runtime.mjs";export*from"@deepkit/type-compiler";var t={};import*as n from"@deepkit/type-compiler";e(t,n);export{t as type_compiler_exports};
|
package/dist/index.cjs
CHANGED
|
@@ -1,4 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,`__esModule`,{value:!0});
|
|
2
|
-
`)}`):n.push((0,u.flattenDiagnosticMessageText)(e.getMessageText().toString(),`
|
|
3
|
-
`))});let r=n.join(`
|
|
4
|
-
`);if(r)throw Error(`TypeScript compilation failed: \n\n${r.length>5e3?`${r.slice(0,5e3)}...`:r}`)}const v=(e={})=>({name:`tsc`,config(){return{transform:{tsc:(0,l.default)(e??{},{typeCheck:!1})}}},async lint(){this.config.transform.tsc.typeCheck&&await _(this)},async transform(e,t){let n=u.default.transpileModule(e,{...this.config.transform.tsc,compilerOptions:{...this.tsconfig.options,...this.config.transform.tsc.compilerOptions},fileName:t});if(n.diagnostics&&n.diagnostics.length>0&&n.diagnostics?.some(e=>e.category===u.default.DiagnosticCategory.Error))throw Error(`TypeScript Compiler - TypeScript transpilation errors in file: ${t}\n${u.default.formatDiagnostics(n.diagnostics,{getCanonicalFileName:e=>u.default.sys.useCaseSensitiveFileNames?e:e.toLowerCase(),getCurrentDirectory:()=>u.default.sys.getCurrentDirectory(),getNewLine:()=>u.default.sys.newLine})}`);if(!n.outputText)throw Error(`TypeScript Compiler - No output generated for file during TypeScript transpilation: ${t}`);return{code:n.outputText,id:t}}});var y=v;const b=(e={})=>({name:`deepkit`,dependsOn:[y(e)],config(){return{transform:{deepkit:e??{}}}},configResolved:{order:`post`,async handler(){let e=this.config.transform.deepkit.reflection||this.tsconfig.tsconfigJson.compilerOptions?.reflection||this.tsconfig.tsconfigJson.reflection||`default`,t=this.config.transform.deepkit.reflectionLevel||this.tsconfig.tsconfigJson.compilerOptions?.reflectionLevel||this.tsconfig.tsconfigJson.reflectionLevel||`minimal`;(!this.tsconfig.tsconfigJson.reflection||!this.tsconfig.tsconfigJson.reflectionLevel)&&(this.tsconfig.tsconfigJson.reflection??=e,this.tsconfig.tsconfigJson.reflectionLevel??=t,await this.fs.write(this.tsconfig.tsconfigFilePath,d.StormJSON.stringify(this.tsconfig.tsconfigJson))),this.config.transform.tsc??={},this.config.transform.tsc.compilerOptions={...this.config.transform.tsc.compilerOptions??{},exclude:this.config.transform.deepkit.exclude??[],reflection:e,reflectionLevel:t},this.config.transform.tsc.transformers??={before:[],after:[]},this.config.transform.tsc.transformers.before.push(h(this,this.config.transform.deepkit)),this.config.transform.tsc.transformers.after.push(g(this,this.config.transform.deepkit))}}});var x=b;exports.default=x,exports.plugin=b;
|
|
1
|
+
Object.defineProperty(exports,`__esModule`,{value:!0});const e=require(`./_virtual/rolldown_runtime.cjs`),t=require(`./deepkit/src/transformer.cjs`),n=require(`./plugin-tsc/src/index.cjs`);let r=require(`@stryke/json/storm-json`);const i=(e={})=>({name:`deepkit`,dependsOn:[n.default(e)],config(){return{transform:{deepkit:e??{}}}},configResolved:{order:`post`,async handler(){let e=this.config.transform.deepkit.reflection||this.tsconfig.tsconfigJson.compilerOptions?.reflection||this.tsconfig.tsconfigJson.reflection||`default`,n=this.config.transform.deepkit.reflectionLevel||this.tsconfig.tsconfigJson.compilerOptions?.reflectionLevel||this.tsconfig.tsconfigJson.reflectionLevel||`minimal`;(!this.tsconfig.tsconfigJson.reflection||!this.tsconfig.tsconfigJson.reflectionLevel)&&(this.tsconfig.tsconfigJson.reflection??=e,this.tsconfig.tsconfigJson.reflectionLevel??=n,await this.fs.write(this.tsconfig.tsconfigFilePath,r.StormJSON.stringify(this.tsconfig.tsconfigJson))),this.config.transform.tsc??={},this.config.transform.tsc.compilerOptions={...this.config.transform.tsc.compilerOptions??{},exclude:this.config.transform.deepkit.exclude??[],reflection:e,reflectionLevel:n},this.config.transform.tsc.transformers??={before:[],after:[]},this.config.transform.tsc.transformers.before.push(t.createTransformer(this,this.config.transform.deepkit)),this.config.transform.tsc.transformers.after.push(t.createDeclarationTransformer(this,this.config.transform.deepkit))}}});var a=i;exports.default=a,exports.plugin=i;
|
package/dist/index.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import "./
|
|
1
|
+
import { Plugin } from "./powerlines/src/types/plugin.cjs";
|
|
2
|
+
import { DeepkitPluginContext, DeepkitPluginOptions, DeepkitPluginResolvedConfig, DeepkitPluginUserConfig, __ΩDeepkitPluginContext, __ΩDeepkitPluginOptions, __ΩDeepkitPluginResolvedConfig, __ΩDeepkitPluginUserConfig } from "./types/plugin.cjs";
|
|
3
3
|
|
|
4
4
|
//#region src/index.d.ts
|
|
5
5
|
|
package/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import "./
|
|
1
|
+
import { Plugin } from "./powerlines/src/types/plugin.mjs";
|
|
2
|
+
import { DeepkitPluginContext, DeepkitPluginOptions, DeepkitPluginResolvedConfig, DeepkitPluginUserConfig, __ΩDeepkitPluginContext, __ΩDeepkitPluginOptions, __ΩDeepkitPluginResolvedConfig, __ΩDeepkitPluginUserConfig } from "./types/plugin.mjs";
|
|
3
|
+
import "./types/index.mjs";
|
|
3
4
|
|
|
4
5
|
//#region src/index.d.ts
|
|
5
6
|
|
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1 @@
|
|
|
1
|
-
import{
|
|
2
|
-
`)}`):n.push(r(e.getMessageText().toString(),`
|
|
3
|
-
`))});let i=n.join(`
|
|
4
|
-
`);if(i)throw Error(`TypeScript compilation failed: \n\n${i.length>5e3?`${i.slice(0,5e3)}...`:i}`)}var f=(e={})=>({name:`tsc`,config(){return{transform:{tsc:t(e??{},{typeCheck:!1})}}},async lint(){this.config.transform.tsc.typeCheck&&await d(this)},async transform(e,t){let r=n.transpileModule(e,{...this.config.transform.tsc,compilerOptions:{...this.tsconfig.options,...this.config.transform.tsc.compilerOptions},fileName:t});if(r.diagnostics&&r.diagnostics.length>0&&r.diagnostics?.some(e=>e.category===n.DiagnosticCategory.Error))throw Error(`TypeScript Compiler - TypeScript transpilation errors in file: ${t}\n${n.formatDiagnostics(r.diagnostics,{getCanonicalFileName:e=>n.sys.useCaseSensitiveFileNames?e:e.toLowerCase(),getCurrentDirectory:()=>n.sys.getCurrentDirectory(),getNewLine:()=>n.sys.newLine})}`);if(!r.outputText)throw Error(`TypeScript Compiler - No output generated for file during TypeScript transpilation: ${t}`);return{code:r.outputText,id:t}}});const p=(e={})=>({name:`deepkit`,dependsOn:[f(e)],config(){return{transform:{deepkit:e??{}}}},configResolved:{order:`post`,async handler(){let e=this.config.transform.deepkit.reflection||this.tsconfig.tsconfigJson.compilerOptions?.reflection||this.tsconfig.tsconfigJson.reflection||`default`,t=this.config.transform.deepkit.reflectionLevel||this.tsconfig.tsconfigJson.compilerOptions?.reflectionLevel||this.tsconfig.tsconfigJson.reflectionLevel||`minimal`;(!this.tsconfig.tsconfigJson.reflection||!this.tsconfig.tsconfigJson.reflectionLevel)&&(this.tsconfig.tsconfigJson.reflection??=e,this.tsconfig.tsconfigJson.reflectionLevel??=t,await this.fs.write(this.tsconfig.tsconfigFilePath,i.stringify(this.tsconfig.tsconfigJson))),this.config.transform.tsc??={},this.config.transform.tsc.compilerOptions={...this.config.transform.tsc.compilerOptions??{},exclude:this.config.transform.deepkit.exclude??[],reflection:e,reflectionLevel:t},this.config.transform.tsc.transformers??={before:[],after:[]},this.config.transform.tsc.transformers.before.push(l(this,this.config.transform.deepkit)),this.config.transform.tsc.transformers.after.push(u(this,this.config.transform.deepkit))}}});var m=p;export{m as default,p as plugin};
|
|
1
|
+
import{createDeclarationTransformer as e,createTransformer as t}from"./deepkit/src/transformer.mjs";import n from"./plugin-tsc/src/index.mjs";import{StormJSON as r}from"@stryke/json/storm-json";const i=(i={})=>({name:`deepkit`,dependsOn:[n(i)],config(){return{transform:{deepkit:i??{}}}},configResolved:{order:`post`,async handler(){let n=this.config.transform.deepkit.reflection||this.tsconfig.tsconfigJson.compilerOptions?.reflection||this.tsconfig.tsconfigJson.reflection||`default`,i=this.config.transform.deepkit.reflectionLevel||this.tsconfig.tsconfigJson.compilerOptions?.reflectionLevel||this.tsconfig.tsconfigJson.reflectionLevel||`minimal`;(!this.tsconfig.tsconfigJson.reflection||!this.tsconfig.tsconfigJson.reflectionLevel)&&(this.tsconfig.tsconfigJson.reflection??=n,this.tsconfig.tsconfigJson.reflectionLevel??=i,await this.fs.write(this.tsconfig.tsconfigFilePath,r.stringify(this.tsconfig.tsconfigJson))),this.config.transform.tsc??={},this.config.transform.tsc.compilerOptions={...this.config.transform.tsc.compilerOptions??{},exclude:this.config.transform.deepkit.exclude??[],reflection:n,reflectionLevel:i},this.config.transform.tsc.transformers??={before:[],after:[]},this.config.transform.tsc.transformers.before.push(t(this,this.config.transform.deepkit)),this.config.transform.tsc.transformers.after.push(e(this,this.config.transform.deepkit))}}});var a=i;export{a as default,i as plugin};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=require(`./type-check.cjs`);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{typeCheck as e}from"./type-check.mjs";export{};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
const e=require(`../../../_virtual/rolldown_runtime.cjs`);let t=require(`typescript`);async function n(e){let n=e.program.emitToMemory(),r=[];n.getDiagnostics().forEach(e=>{e.getSourceFile()?.getBaseName()?r.push(`${e.getSourceFile()?.getBaseName()} (${(e.getLineNumber()??0)+1}): ${(0,t.flattenDiagnosticMessageText)(e.getMessageText().toString(),`
|
|
2
|
+
`)}`):r.push((0,t.flattenDiagnosticMessageText)(e.getMessageText().toString(),`
|
|
3
|
+
`))});let i=r.join(`
|
|
4
|
+
`);if(i)throw Error(`TypeScript compilation failed: \n\n${i.length>5e3?`${i.slice(0,5e3)}...`:i}`)}exports.typeCheck=n;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import{flattenDiagnosticMessageText as e}from"typescript";async function t(t){let n=t.program.emitToMemory(),r=[];n.getDiagnostics().forEach(t=>{t.getSourceFile()?.getBaseName()?r.push(`${t.getSourceFile()?.getBaseName()} (${(t.getLineNumber()??0)+1}): ${e(t.getMessageText().toString(),`
|
|
2
|
+
`)}`):r.push(e(t.getMessageText().toString(),`
|
|
3
|
+
`))});let i=r.join(`
|
|
4
|
+
`);if(i)throw Error(`TypeScript compilation failed: \n\n${i.length>5e3?`${i.slice(0,5e3)}...`:i}`)}export{t as typeCheck};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=require(`../../_virtual/rolldown_runtime.cjs`),t=require(`./helpers/type-check.cjs`);require(`./helpers/index.cjs`);let n=require(`defu`);n=e.__toESM(n);let r=require(`typescript`);r=e.__toESM(r);const i=(e={})=>({name:`tsc`,config(){return{transform:{tsc:(0,n.default)(e??{},{typeCheck:!1})}}},async lint(){this.config.transform.tsc.typeCheck&&await t.typeCheck(this)},async transform(e,t){let n=r.default.transpileModule(e,{...this.config.transform.tsc,compilerOptions:{...this.tsconfig.options,...this.config.transform.tsc.compilerOptions},fileName:t});if(n.diagnostics&&n.diagnostics.length>0&&n.diagnostics?.some(e=>e.category===r.default.DiagnosticCategory.Error))throw Error(`TypeScript Compiler - TypeScript transpilation errors in file: ${t}\n${r.default.formatDiagnostics(n.diagnostics,{getCanonicalFileName:e=>r.default.sys.useCaseSensitiveFileNames?e:e.toLowerCase(),getCurrentDirectory:()=>r.default.sys.getCurrentDirectory(),getNewLine:()=>r.default.sys.newLine})}`);if(!n.outputText)throw Error(`TypeScript Compiler - No output generated for file during TypeScript transpilation: ${t}`);return{code:n.outputText,id:t}}});var a=i;exports.default=a;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{typeCheck as e}from"./helpers/type-check.mjs";import"./helpers/index.mjs";import t from"defu";import n from"typescript";var r=(r={})=>({name:`tsc`,config(){return{transform:{tsc:t(r??{},{typeCheck:!1})}}},async lint(){this.config.transform.tsc.typeCheck&&await e(this)},async transform(e,t){let r=n.transpileModule(e,{...this.config.transform.tsc,compilerOptions:{...this.tsconfig.options,...this.config.transform.tsc.compilerOptions},fileName:t});if(r.diagnostics&&r.diagnostics.length>0&&r.diagnostics?.some(e=>e.category===n.DiagnosticCategory.Error))throw Error(`TypeScript Compiler - TypeScript transpilation errors in file: ${t}\n${n.formatDiagnostics(r.diagnostics,{getCanonicalFileName:e=>n.sys.useCaseSensitiveFileNames?e:e.toLowerCase(),getCurrentDirectory:()=>n.sys.getCurrentDirectory(),getNewLine:()=>n.sys.newLine})}`);if(!r.outputText)throw Error(`TypeScript Compiler - No output generated for file during TypeScript transpilation: ${t}`);return{code:r.outputText,id:t}}});export{r as default};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { UserConfig } from "../../../powerlines/src/types/config.cjs";
|
|
2
|
+
import { ResolvedConfig } from "../../../powerlines/src/types/resolved.cjs";
|
|
3
|
+
import { PluginContext } from "../../../powerlines/src/types/context.cjs";
|
|
4
|
+
import ts from "typescript";
|
|
5
|
+
|
|
6
|
+
//#region ../plugin-tsc/src/types/plugin.d.ts
|
|
7
|
+
type TypeScriptCompilerPluginOptions = Partial<Omit<ts.TranspileOptions, "fileName">> & {
|
|
8
|
+
/**
|
|
9
|
+
* Whether to perform type checking during the `lint` task.
|
|
10
|
+
*
|
|
11
|
+
* @defaultValue false
|
|
12
|
+
*/
|
|
13
|
+
typeCheck?: boolean;
|
|
14
|
+
};
|
|
15
|
+
interface TypeScriptCompilerPluginUserConfig extends UserConfig {
|
|
16
|
+
transform: {
|
|
17
|
+
/**
|
|
18
|
+
* TypeScript Compiler transformation options
|
|
19
|
+
*/
|
|
20
|
+
tsc: Partial<Omit<TypeScriptCompilerPluginOptions, "typeCheck">> & Required<Pick<TypeScriptCompilerPluginOptions, "typeCheck">>;
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
interface TypeScriptCompilerPluginResolvedConfig extends ResolvedConfig {
|
|
24
|
+
transform: {
|
|
25
|
+
/**
|
|
26
|
+
* Resolved TypeScript Compiler transformation options
|
|
27
|
+
*/
|
|
28
|
+
tsc: Partial<Omit<TypeScriptCompilerPluginOptions, "typeCheck">> & Required<Pick<TypeScriptCompilerPluginOptions, "typeCheck">>;
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
type TypeScriptCompilerPluginContext<TResolvedConfig extends TypeScriptCompilerPluginResolvedConfig = TypeScriptCompilerPluginResolvedConfig> = PluginContext<TResolvedConfig>;
|
|
32
|
+
//#endregion
|
|
33
|
+
export { TypeScriptCompilerPluginContext, TypeScriptCompilerPluginOptions, TypeScriptCompilerPluginResolvedConfig, TypeScriptCompilerPluginUserConfig };
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { UserConfig } from "../../../powerlines/src/types/config.mjs";
|
|
2
|
+
import { ResolvedConfig } from "../../../powerlines/src/types/resolved.mjs";
|
|
3
|
+
import { PluginContext } from "../../../powerlines/src/types/context.mjs";
|
|
4
|
+
import ts from "typescript";
|
|
5
|
+
|
|
6
|
+
//#region ../plugin-tsc/src/types/plugin.d.ts
|
|
7
|
+
type TypeScriptCompilerPluginOptions = Partial<Omit<ts.TranspileOptions, "fileName">> & {
|
|
8
|
+
/**
|
|
9
|
+
* Whether to perform type checking during the `lint` task.
|
|
10
|
+
*
|
|
11
|
+
* @defaultValue false
|
|
12
|
+
*/
|
|
13
|
+
typeCheck?: boolean;
|
|
14
|
+
};
|
|
15
|
+
interface TypeScriptCompilerPluginUserConfig extends UserConfig {
|
|
16
|
+
transform: {
|
|
17
|
+
/**
|
|
18
|
+
* TypeScript Compiler transformation options
|
|
19
|
+
*/
|
|
20
|
+
tsc: Partial<Omit<TypeScriptCompilerPluginOptions, "typeCheck">> & Required<Pick<TypeScriptCompilerPluginOptions, "typeCheck">>;
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
interface TypeScriptCompilerPluginResolvedConfig extends ResolvedConfig {
|
|
24
|
+
transform: {
|
|
25
|
+
/**
|
|
26
|
+
* Resolved TypeScript Compiler transformation options
|
|
27
|
+
*/
|
|
28
|
+
tsc: Partial<Omit<TypeScriptCompilerPluginOptions, "typeCheck">> & Required<Pick<TypeScriptCompilerPluginOptions, "typeCheck">>;
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
type TypeScriptCompilerPluginContext<TResolvedConfig extends TypeScriptCompilerPluginResolvedConfig = TypeScriptCompilerPluginResolvedConfig> = PluginContext<TResolvedConfig>;
|
|
32
|
+
//#endregion
|
|
33
|
+
export { TypeScriptCompilerPluginContext, TypeScriptCompilerPluginOptions, TypeScriptCompilerPluginResolvedConfig, TypeScriptCompilerPluginUserConfig };
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
//#region ../powerlines/src/types/build.d.ts
|
|
2
|
+
|
|
3
|
+
type UnpluginBuildVariant = "rollup" | "webpack" | "rspack" | "vite" | "esbuild" | "farm" | "unloader" | "rolldown";
|
|
4
|
+
interface BuildConfig {
|
|
5
|
+
/**
|
|
6
|
+
* The platform to build the project for
|
|
7
|
+
*
|
|
8
|
+
* @defaultValue "neutral"
|
|
9
|
+
*/
|
|
10
|
+
platform?: "node" | "browser" | "neutral";
|
|
11
|
+
/**
|
|
12
|
+
* Array of strings indicating the polyfills to include for the build.
|
|
13
|
+
*
|
|
14
|
+
* @remarks
|
|
15
|
+
* This option allows you to specify which polyfills should be included in the build process to ensure compatibility with the target environment. The paths for the polyfills can use placeholder tokens (the `replacePathTokens` helper function will be used to resolve the actual values).
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* ```ts
|
|
19
|
+
* {
|
|
20
|
+
* polyfill: ['{projectRoot}/custom-polyfill.ts']
|
|
21
|
+
* }
|
|
22
|
+
* ```
|
|
23
|
+
*/
|
|
24
|
+
polyfill?: string[];
|
|
25
|
+
/**
|
|
26
|
+
* Array of strings indicating the order in which fields in a package.json file should be resolved to determine the entry point for a module.
|
|
27
|
+
*
|
|
28
|
+
* @defaultValue `['browser', 'module', 'jsnext:main', 'jsnext']`
|
|
29
|
+
*/
|
|
30
|
+
mainFields?: string[];
|
|
31
|
+
/**
|
|
32
|
+
* Array of strings indicating what conditions should be used for module resolution.
|
|
33
|
+
*/
|
|
34
|
+
conditions?: string[];
|
|
35
|
+
/**
|
|
36
|
+
* Array of strings indicating what file extensions should be used for module resolution.
|
|
37
|
+
*
|
|
38
|
+
* @defaultValue `['.mjs', '.js', '.mts', '.ts', '.jsx', '.tsx', '.json']`
|
|
39
|
+
*/
|
|
40
|
+
extensions?: string[];
|
|
41
|
+
/**
|
|
42
|
+
* Array of strings indicating what modules should be deduplicated to a single version in the build.
|
|
43
|
+
*
|
|
44
|
+
* @remarks
|
|
45
|
+
* This option is useful for ensuring that only one version of a module is included in the bundle, which can help reduce bundle size and avoid conflicts.
|
|
46
|
+
*/
|
|
47
|
+
dedupe?: string[];
|
|
48
|
+
/**
|
|
49
|
+
* Array of strings or regular expressions that indicate what modules are builtin for the environment.
|
|
50
|
+
*/
|
|
51
|
+
builtins?: (string | RegExp)[];
|
|
52
|
+
/**
|
|
53
|
+
* Define global variable replacements.
|
|
54
|
+
*
|
|
55
|
+
* @remarks
|
|
56
|
+
* This option allows you to specify global constants that will be replaced in the code during the build process. It is similar to the `define` option in esbuild and Vite, enabling you to replace specific identifiers with constant expressions at build time.
|
|
57
|
+
*
|
|
58
|
+
* @example
|
|
59
|
+
* ```ts
|
|
60
|
+
* {
|
|
61
|
+
* define: {
|
|
62
|
+
* __VERSION__: '"1.0.0"',
|
|
63
|
+
* __DEV__: 'process.env.NODE_ENV !== "production"'
|
|
64
|
+
* }
|
|
65
|
+
* }
|
|
66
|
+
* ```
|
|
67
|
+
*
|
|
68
|
+
* @see https://esbuild.github.io/api/#define
|
|
69
|
+
* @see https://vitejs.dev/config/build-options.html#define
|
|
70
|
+
* @see https://github.com/rollup/plugins/tree/master/packages/replace
|
|
71
|
+
*/
|
|
72
|
+
define?: Record<string, any>;
|
|
73
|
+
/**
|
|
74
|
+
* Global variables that will have import statements injected where necessary
|
|
75
|
+
*
|
|
76
|
+
* @remarks
|
|
77
|
+
* This option allows you to specify global variables that should be automatically imported from specified modules whenever they are used in the code. This is particularly useful for polyfilling Node.js globals in a browser environment.
|
|
78
|
+
*
|
|
79
|
+
* @example
|
|
80
|
+
* ```ts
|
|
81
|
+
* {
|
|
82
|
+
* inject: {
|
|
83
|
+
* process: 'process/browser',
|
|
84
|
+
* Buffer: ['buffer', 'Buffer'],
|
|
85
|
+
* }
|
|
86
|
+
* }
|
|
87
|
+
* ```
|
|
88
|
+
*
|
|
89
|
+
* @see https://github.com/rollup/plugins/tree/master/packages/inject
|
|
90
|
+
*/
|
|
91
|
+
inject?: Record<string, string | string[]>;
|
|
92
|
+
/**
|
|
93
|
+
* The alias mappings to use for module resolution during the build process.
|
|
94
|
+
*
|
|
95
|
+
* @remarks
|
|
96
|
+
* This option allows you to define custom path aliases for modules, which can be useful for simplifying imports and managing dependencies.
|
|
97
|
+
*
|
|
98
|
+
* @example
|
|
99
|
+
* ```ts
|
|
100
|
+
* {
|
|
101
|
+
* alias: {
|
|
102
|
+
* "@utils": "./src/utils",
|
|
103
|
+
* "@components": "./src/components"
|
|
104
|
+
* }
|
|
105
|
+
* }
|
|
106
|
+
* ```
|
|
107
|
+
*
|
|
108
|
+
* @see https://github.com/rollup/plugins/tree/master/packages/alias
|
|
109
|
+
*/
|
|
110
|
+
alias?: Record<string, string> | Array<{
|
|
111
|
+
find: string | RegExp;
|
|
112
|
+
replacement: string;
|
|
113
|
+
}>;
|
|
114
|
+
/**
|
|
115
|
+
* A list of modules that should not be bundled, even if they are external dependencies.
|
|
116
|
+
*
|
|
117
|
+
* @remarks
|
|
118
|
+
* This option is useful for excluding specific modules from the bundle, such as Node.js built-in modules or other libraries that should not be bundled.
|
|
119
|
+
*/
|
|
120
|
+
external?: (string | RegExp)[];
|
|
121
|
+
/**
|
|
122
|
+
* A list of modules that should always be bundled, even if they are external dependencies.
|
|
123
|
+
*/
|
|
124
|
+
noExternal?: (string | RegExp)[];
|
|
125
|
+
/**
|
|
126
|
+
* Should the Powerlines CLI processes skip bundling the `node_modules` directory?
|
|
127
|
+
*/
|
|
128
|
+
skipNodeModulesBundle?: boolean;
|
|
129
|
+
/**
|
|
130
|
+
* An optional set of override options to apply to the selected build variant.
|
|
131
|
+
*
|
|
132
|
+
* @remarks
|
|
133
|
+
* This option allows you to provide configuration options with the guarantee that they will **not** be overridden and will take precedence over other build configurations.
|
|
134
|
+
*/
|
|
135
|
+
override?: Record<string, any>;
|
|
136
|
+
}
|
|
137
|
+
type BuildResolvedConfig = Omit<BuildConfig, "override">;
|
|
138
|
+
//#endregion
|
|
139
|
+
export { BuildConfig, BuildResolvedConfig, UnpluginBuildVariant };
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
//#region ../powerlines/src/types/build.d.ts
|
|
2
|
+
|
|
3
|
+
type UnpluginBuildVariant = "rollup" | "webpack" | "rspack" | "vite" | "esbuild" | "farm" | "unloader" | "rolldown";
|
|
4
|
+
interface BuildConfig {
|
|
5
|
+
/**
|
|
6
|
+
* The platform to build the project for
|
|
7
|
+
*
|
|
8
|
+
* @defaultValue "neutral"
|
|
9
|
+
*/
|
|
10
|
+
platform?: "node" | "browser" | "neutral";
|
|
11
|
+
/**
|
|
12
|
+
* Array of strings indicating the polyfills to include for the build.
|
|
13
|
+
*
|
|
14
|
+
* @remarks
|
|
15
|
+
* This option allows you to specify which polyfills should be included in the build process to ensure compatibility with the target environment. The paths for the polyfills can use placeholder tokens (the `replacePathTokens` helper function will be used to resolve the actual values).
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* ```ts
|
|
19
|
+
* {
|
|
20
|
+
* polyfill: ['{projectRoot}/custom-polyfill.ts']
|
|
21
|
+
* }
|
|
22
|
+
* ```
|
|
23
|
+
*/
|
|
24
|
+
polyfill?: string[];
|
|
25
|
+
/**
|
|
26
|
+
* Array of strings indicating the order in which fields in a package.json file should be resolved to determine the entry point for a module.
|
|
27
|
+
*
|
|
28
|
+
* @defaultValue `['browser', 'module', 'jsnext:main', 'jsnext']`
|
|
29
|
+
*/
|
|
30
|
+
mainFields?: string[];
|
|
31
|
+
/**
|
|
32
|
+
* Array of strings indicating what conditions should be used for module resolution.
|
|
33
|
+
*/
|
|
34
|
+
conditions?: string[];
|
|
35
|
+
/**
|
|
36
|
+
* Array of strings indicating what file extensions should be used for module resolution.
|
|
37
|
+
*
|
|
38
|
+
* @defaultValue `['.mjs', '.js', '.mts', '.ts', '.jsx', '.tsx', '.json']`
|
|
39
|
+
*/
|
|
40
|
+
extensions?: string[];
|
|
41
|
+
/**
|
|
42
|
+
* Array of strings indicating what modules should be deduplicated to a single version in the build.
|
|
43
|
+
*
|
|
44
|
+
* @remarks
|
|
45
|
+
* This option is useful for ensuring that only one version of a module is included in the bundle, which can help reduce bundle size and avoid conflicts.
|
|
46
|
+
*/
|
|
47
|
+
dedupe?: string[];
|
|
48
|
+
/**
|
|
49
|
+
* Array of strings or regular expressions that indicate what modules are builtin for the environment.
|
|
50
|
+
*/
|
|
51
|
+
builtins?: (string | RegExp)[];
|
|
52
|
+
/**
|
|
53
|
+
* Define global variable replacements.
|
|
54
|
+
*
|
|
55
|
+
* @remarks
|
|
56
|
+
* This option allows you to specify global constants that will be replaced in the code during the build process. It is similar to the `define` option in esbuild and Vite, enabling you to replace specific identifiers with constant expressions at build time.
|
|
57
|
+
*
|
|
58
|
+
* @example
|
|
59
|
+
* ```ts
|
|
60
|
+
* {
|
|
61
|
+
* define: {
|
|
62
|
+
* __VERSION__: '"1.0.0"',
|
|
63
|
+
* __DEV__: 'process.env.NODE_ENV !== "production"'
|
|
64
|
+
* }
|
|
65
|
+
* }
|
|
66
|
+
* ```
|
|
67
|
+
*
|
|
68
|
+
* @see https://esbuild.github.io/api/#define
|
|
69
|
+
* @see https://vitejs.dev/config/build-options.html#define
|
|
70
|
+
* @see https://github.com/rollup/plugins/tree/master/packages/replace
|
|
71
|
+
*/
|
|
72
|
+
define?: Record<string, any>;
|
|
73
|
+
/**
|
|
74
|
+
* Global variables that will have import statements injected where necessary
|
|
75
|
+
*
|
|
76
|
+
* @remarks
|
|
77
|
+
* This option allows you to specify global variables that should be automatically imported from specified modules whenever they are used in the code. This is particularly useful for polyfilling Node.js globals in a browser environment.
|
|
78
|
+
*
|
|
79
|
+
* @example
|
|
80
|
+
* ```ts
|
|
81
|
+
* {
|
|
82
|
+
* inject: {
|
|
83
|
+
* process: 'process/browser',
|
|
84
|
+
* Buffer: ['buffer', 'Buffer'],
|
|
85
|
+
* }
|
|
86
|
+
* }
|
|
87
|
+
* ```
|
|
88
|
+
*
|
|
89
|
+
* @see https://github.com/rollup/plugins/tree/master/packages/inject
|
|
90
|
+
*/
|
|
91
|
+
inject?: Record<string, string | string[]>;
|
|
92
|
+
/**
|
|
93
|
+
* The alias mappings to use for module resolution during the build process.
|
|
94
|
+
*
|
|
95
|
+
* @remarks
|
|
96
|
+
* This option allows you to define custom path aliases for modules, which can be useful for simplifying imports and managing dependencies.
|
|
97
|
+
*
|
|
98
|
+
* @example
|
|
99
|
+
* ```ts
|
|
100
|
+
* {
|
|
101
|
+
* alias: {
|
|
102
|
+
* "@utils": "./src/utils",
|
|
103
|
+
* "@components": "./src/components"
|
|
104
|
+
* }
|
|
105
|
+
* }
|
|
106
|
+
* ```
|
|
107
|
+
*
|
|
108
|
+
* @see https://github.com/rollup/plugins/tree/master/packages/alias
|
|
109
|
+
*/
|
|
110
|
+
alias?: Record<string, string> | Array<{
|
|
111
|
+
find: string | RegExp;
|
|
112
|
+
replacement: string;
|
|
113
|
+
}>;
|
|
114
|
+
/**
|
|
115
|
+
* A list of modules that should not be bundled, even if they are external dependencies.
|
|
116
|
+
*
|
|
117
|
+
* @remarks
|
|
118
|
+
* This option is useful for excluding specific modules from the bundle, such as Node.js built-in modules or other libraries that should not be bundled.
|
|
119
|
+
*/
|
|
120
|
+
external?: (string | RegExp)[];
|
|
121
|
+
/**
|
|
122
|
+
* A list of modules that should always be bundled, even if they are external dependencies.
|
|
123
|
+
*/
|
|
124
|
+
noExternal?: (string | RegExp)[];
|
|
125
|
+
/**
|
|
126
|
+
* Should the Powerlines CLI processes skip bundling the `node_modules` directory?
|
|
127
|
+
*/
|
|
128
|
+
skipNodeModulesBundle?: boolean;
|
|
129
|
+
/**
|
|
130
|
+
* An optional set of override options to apply to the selected build variant.
|
|
131
|
+
*
|
|
132
|
+
* @remarks
|
|
133
|
+
* This option allows you to provide configuration options with the guarantee that they will **not** be overridden and will take precedence over other build configurations.
|
|
134
|
+
*/
|
|
135
|
+
override?: Record<string, any>;
|
|
136
|
+
}
|
|
137
|
+
type BuildResolvedConfig = Omit<BuildConfig, "override">;
|
|
138
|
+
//#endregion
|
|
139
|
+
export { BuildConfig, BuildResolvedConfig, UnpluginBuildVariant };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ArrayValues } from "@stryke/types/array";
|
|
2
|
+
import { MaybePromise } from "@stryke/types/base";
|
|
3
|
+
|
|
4
|
+
//#region ../powerlines/src/types/commands.d.ts
|
|
5
|
+
declare const SUPPORTED_COMMANDS: readonly ["new", "clean", "prepare", "lint", "test", "build", "docs", "deploy", "finalize"];
|
|
6
|
+
type CommandType = ArrayValues<typeof SUPPORTED_COMMANDS>;
|
|
7
|
+
//#endregion
|
|
8
|
+
export { CommandType };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import "./context.mjs";
|
|
2
|
+
import { ArrayValues } from "@stryke/types/array";
|
|
3
|
+
import { MaybePromise } from "@stryke/types/base";
|
|
4
|
+
|
|
5
|
+
//#region ../powerlines/src/types/commands.d.ts
|
|
6
|
+
declare const SUPPORTED_COMMANDS: readonly ["new", "clean", "prepare", "lint", "test", "build", "docs", "deploy", "finalize"];
|
|
7
|
+
type CommandType = ArrayValues<typeof SUPPORTED_COMMANDS>;
|
|
8
|
+
//#endregion
|
|
9
|
+
export { CommandType };
|