feat(cli): Add new check command for type checking and update compiler options handling

This commit is contained in:
2025-05-15 09:31:57 +00:00
parent 6d68f35a9a
commit 960fc5f213
9 changed files with 402 additions and 49 deletions

View File

@ -1,6 +1,6 @@
import * as plugins from './plugins.js';
import type { CompilerOptions, ScriptTarget, ModuleKind } from 'typescript';
import { compiler, mergeCompilerOptions, emitCheck } from './tsbuild.classes.tsbuild.js';
import { compiler, mergeCompilerOptions, emitCheck, checkTypes } from './tsbuild.classes.tsbuild.js';
export type { CompilerOptions, ScriptTarget, ModuleKind };
@ -32,12 +32,16 @@ export let compileGlobStringObject = async (
) => {
let compiledFiles: any[] = [];
// Log the compilation tasks in a nice format
console.log('\n👷 TypeScript Compilation Tasks:');
Object.entries(globStringObjectArg).forEach(([source, dest]) => {
console.log(` 📂 ${source}${dest}`);
});
console.log('');
for (const keyArg in globStringObjectArg) {
// Type safety check for key
if (keyArg && typeof keyArg === 'string' && globStringObjectArg[keyArg]) {
console.log(
`TypeScript assignment: transpile from ${keyArg} to ${globStringObjectArg[keyArg]}`
);
// Get files matching the glob pattern
const fileTreeArray = await plugins.smartfile.fs.listFileTree(cwdArg, keyArg);