@powerlines/plugin-tsc 0.2.44 → 0.2.46

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.
@@ -1,5 +1,5 @@
1
1
  export { typeCheck } from './type-check.cjs';
2
- import '../plugin-ya8wkjpy.cjs';
2
+ import '../plugin-CMe3Y7uE.cjs';
3
3
  import '@stryke/types/base';
4
4
  import 'unplugin';
5
5
  import '@stryke/types/array';
@@ -16,6 +16,5 @@ import 'magic-string';
16
16
  import 'semver';
17
17
  import 'ts-morph';
18
18
  import '@stryke/fs/resolve';
19
- import 'node:fs';
20
19
  import '@stryke/types/tsconfig';
21
20
  import 'typescript';
@@ -1,5 +1,5 @@
1
1
  export { typeCheck } from './type-check.js';
2
- import '../plugin-ya8wkjpy.js';
2
+ import '../plugin-CMe3Y7uE.js';
3
3
  import '@stryke/types/base';
4
4
  import 'unplugin';
5
5
  import '@stryke/types/array';
@@ -16,6 +16,5 @@ import 'magic-string';
16
16
  import 'semver';
17
17
  import 'ts-morph';
18
18
  import '@stryke/fs/resolve';
19
- import 'node:fs';
20
19
  import '@stryke/types/tsconfig';
21
20
  import 'typescript';
@@ -1,9 +1,12 @@
1
- 'use strict';var chunkFBBMZ4NC_cjs=require('../chunk-FBBMZ4NC.cjs'),types=require('@storm-software/config-tools/types'),program=require('powerlines/lib/typescript/program'),i=require('typescript');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}var i__default=/*#__PURE__*/_interopDefault(i);/*****************************************
1
+ 'use strict';var chunkFBBMZ4NC_cjs=require('../chunk-FBBMZ4NC.cjs'),typescript=require('typescript');/*****************************************
2
2
  *
3
3
  * ⚡ Built by Storm Software
4
4
  *
5
5
  *****************************************/
6
6
 
7
- async function h(t,a){a&&await Promise.all(a.entries().map(async([e,s])=>t.fs.writeFile(e,s)));const r=await program.createVirtualProgram(a?Array.from(a.keys()):[],t,{noEmit:true,lib:["lib.esnext.d.ts"],types:[]}),m=r.emit();i__default.default.getPreEmitDiagnostics(r).concat(m.diagnostics).forEach(e=>{if(e.file){const{line:s,character:n}=i__default.default.getLineAndCharacterOfPosition(e.file,e.start),f=i__default.default.flattenDiagnosticMessageText(e.messageText,`
8
- `);t.log(types.LogLevelLabel.ERROR,`${e.file.fileName}:${s+1}:${n+1} : ${f}`);}else t.log(types.LogLevelLabel.ERROR,i__default.default.flattenDiagnosticMessageText(e.messageText,`
9
- `));});}chunkFBBMZ4NC_cjs.a(h,"typeCheck");exports.typeCheck=h;
7
+ async function p(r){const i=r.program.emitToMemory(),o=[];i.getDiagnostics().forEach(e=>{e.getSourceFile()?.getBaseName()?o.push(`${e.getSourceFile()?.getBaseName()} (${(e.getLineNumber()??0)+1}): ${typescript.flattenDiagnosticMessageText(e.getMessageText().toString(),`
8
+ `)}`):o.push(typescript.flattenDiagnosticMessageText(e.getMessageText().toString(),`
9
+ `));});const t=o.join(`
10
+ `);if(t)throw new Error(`TypeScript compilation failed:
11
+
12
+ ${t.length>5e3?`${t.slice(0,5e3)}...`:t}`)}chunkFBBMZ4NC_cjs.a(p,"typeCheck");exports.typeCheck=p;
@@ -1,4 +1,4 @@
1
- import { C as Context } from '../plugin-ya8wkjpy.cjs';
1
+ import { C as Context } from '../plugin-CMe3Y7uE.cjs';
2
2
  import '@stryke/types/base';
3
3
  import 'unplugin';
4
4
  import '@stryke/types/array';
@@ -15,25 +15,14 @@ import 'magic-string';
15
15
  import 'semver';
16
16
  import 'ts-morph';
17
17
  import '@stryke/fs/resolve';
18
- import 'node:fs';
19
18
  import '@stryke/types/tsconfig';
20
19
  import 'typescript';
21
20
 
22
- declare const SourcesMap: {
23
- new (entries?: readonly (readonly [string, string])[] | null | undefined): Map<string, string>;
24
- new (iterable?: Iterable<readonly [string, string]> | null | undefined): Map<string, string>;
25
- readonly prototype: Map<any, any>;
26
- groupBy<K, T>(items: Iterable<T>, keySelector: (item: T, index: number) => K): Map<K, T[]>;
27
- readonly [Symbol.species]: MapConstructor;
28
- };
29
- type SourcesMap = InstanceType<typeof SourcesMap>;
30
-
31
21
  /**
32
22
  * Perform type checks on the provided sources using TypeScript's compiler API.
33
23
  *
34
24
  * @param context - The build context containing information about the current build.
35
- * @param sources - The source files to check.
36
25
  */
37
- declare function typeCheck(context: Context, sources?: SourcesMap): Promise<void>;
26
+ declare function typeCheck(context: Context): Promise<void>;
38
27
 
39
28
  export { typeCheck };
@@ -1,4 +1,4 @@
1
- import { C as Context } from '../plugin-ya8wkjpy.js';
1
+ import { C as Context } from '../plugin-CMe3Y7uE.js';
2
2
  import '@stryke/types/base';
3
3
  import 'unplugin';
4
4
  import '@stryke/types/array';
@@ -15,25 +15,14 @@ import 'magic-string';
15
15
  import 'semver';
16
16
  import 'ts-morph';
17
17
  import '@stryke/fs/resolve';
18
- import 'node:fs';
19
18
  import '@stryke/types/tsconfig';
20
19
  import 'typescript';
21
20
 
22
- declare const SourcesMap: {
23
- new (entries?: readonly (readonly [string, string])[] | null | undefined): Map<string, string>;
24
- new (iterable?: Iterable<readonly [string, string]> | null | undefined): Map<string, string>;
25
- readonly prototype: Map<any, any>;
26
- groupBy<K, T>(items: Iterable<T>, keySelector: (item: T, index: number) => K): Map<K, T[]>;
27
- readonly [Symbol.species]: MapConstructor;
28
- };
29
- type SourcesMap = InstanceType<typeof SourcesMap>;
30
-
31
21
  /**
32
22
  * Perform type checks on the provided sources using TypeScript's compiler API.
33
23
  *
34
24
  * @param context - The build context containing information about the current build.
35
- * @param sources - The source files to check.
36
25
  */
37
- declare function typeCheck(context: Context, sources?: SourcesMap): Promise<void>;
26
+ declare function typeCheck(context: Context): Promise<void>;
38
27
 
39
28
  export { typeCheck };
@@ -1,9 +1,12 @@
1
- import {a}from'../chunk-UCUR73HG.js';import {LogLevelLabel}from'@storm-software/config-tools/types';import {createVirtualProgram}from'powerlines/lib/typescript/program';import i from'typescript';/*****************************************
1
+ import {a}from'../chunk-UCUR73HG.js';import {flattenDiagnosticMessageText}from'typescript';/*****************************************
2
2
  *
3
3
  * ⚡ Built by Storm Software
4
4
  *
5
5
  *****************************************/
6
6
 
7
- async function C(t,a){a&&await Promise.all(a.entries().map(async([e,s])=>t.fs.writeFile(e,s)));const r=await createVirtualProgram(a?Array.from(a.keys()):[],t,{noEmit:true,lib:["lib.esnext.d.ts"],types:[]}),m=r.emit();i.getPreEmitDiagnostics(r).concat(m.diagnostics).forEach(e=>{if(e.file){const{line:s,character:n}=i.getLineAndCharacterOfPosition(e.file,e.start),f=i.flattenDiagnosticMessageText(e.messageText,`
8
- `);t.log(LogLevelLabel.ERROR,`${e.file.fileName}:${s+1}:${n+1} : ${f}`);}else t.log(LogLevelLabel.ERROR,i.flattenDiagnosticMessageText(e.messageText,`
9
- `));});}a(C,"typeCheck");export{C as typeCheck};
7
+ async function l(r){const i=r.program.emitToMemory(),o=[];i.getDiagnostics().forEach(e=>{e.getSourceFile()?.getBaseName()?o.push(`${e.getSourceFile()?.getBaseName()} (${(e.getLineNumber()??0)+1}): ${flattenDiagnosticMessageText(e.getMessageText().toString(),`
8
+ `)}`):o.push(flattenDiagnosticMessageText(e.getMessageText().toString(),`
9
+ `));});const t=o.join(`
10
+ `);if(t)throw new Error(`TypeScript compilation failed:
11
+
12
+ ${t.length>5e3?`${t.slice(0,5e3)}...`:t}`)}a(l,"typeCheck");export{l as typeCheck};
package/dist/index.d.cts CHANGED
@@ -1,4 +1,4 @@
1
- import { P as Plugin } from './plugin-ya8wkjpy.cjs';
1
+ import { P as Plugin } from './plugin-CMe3Y7uE.cjs';
2
2
  import { TypeScriptCompilerPluginContext, TypeScriptCompilerPluginOptions } from './types/plugin.cjs';
3
3
  export { TypeScriptCompilerPluginResolvedConfig, TypeScriptCompilerPluginUserConfig, __ΩTypeScriptCompilerPluginContext, __ΩTypeScriptCompilerPluginOptions, __ΩTypeScriptCompilerPluginResolvedConfig, __ΩTypeScriptCompilerPluginUserConfig } from './types/plugin.cjs';
4
4
  export { typeCheck } from './helpers/type-check.cjs';
@@ -18,7 +18,6 @@ import 'magic-string';
18
18
  import 'semver';
19
19
  import 'ts-morph';
20
20
  import '@stryke/fs/resolve';
21
- import 'node:fs';
22
21
  import '@stryke/types/tsconfig';
23
22
  import 'typescript';
24
23
 
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { P as Plugin } from './plugin-ya8wkjpy.js';
1
+ import { P as Plugin } from './plugin-CMe3Y7uE.js';
2
2
  import { TypeScriptCompilerPluginContext, TypeScriptCompilerPluginOptions } from './types/plugin.js';
3
3
  export { TypeScriptCompilerPluginResolvedConfig, TypeScriptCompilerPluginUserConfig, __ΩTypeScriptCompilerPluginContext, __ΩTypeScriptCompilerPluginOptions, __ΩTypeScriptCompilerPluginResolvedConfig, __ΩTypeScriptCompilerPluginUserConfig } from './types/plugin.js';
4
4
  export { typeCheck } from './helpers/type-check.js';
@@ -18,7 +18,6 @@ import 'magic-string';
18
18
  import 'semver';
19
19
  import 'ts-morph';
20
20
  import '@stryke/fs/resolve';
21
- import 'node:fs';
22
21
  import '@stryke/types/tsconfig';
23
22
  import 'typescript';
24
23