From fa41dbf332682483584e5b40bc3e32f5006dd538 Mon Sep 17 00:00:00 2001 From: Philipp Kunz Date: Sun, 21 Jul 2024 17:33:21 +0200 Subject: [PATCH] fix(cli): Ensure ts_shared folder is compiled sedond to interfaces when present --- changelog.md | 5 +++++ ts/00_commitinfo_data.ts | 2 +- ts/tsbuild.cli.ts | 15 ++++++++++++--- 3 files changed, 18 insertions(+), 4 deletions(-) diff --git a/changelog.md b/changelog.md index c766cd0..3255713 100644 --- a/changelog.md +++ b/changelog.md @@ -1,5 +1,10 @@ # Changelog +## 2024-07-21 - 2.1.83 - fix(cli) +Ensure 'ts_shared' folder is compiled first if present + +- Added logic to make sure the 'ts_shared' folder is compiled first when running 'tsfolders' command. + ## 2024-06-24 - 2.1.82 - fix(core) Minor improvements and optimizations in core TypeScript compiler integration. diff --git a/ts/00_commitinfo_data.ts b/ts/00_commitinfo_data.ts index 662c234..7fdc18e 100644 --- a/ts/00_commitinfo_data.ts +++ b/ts/00_commitinfo_data.ts @@ -3,6 +3,6 @@ */ export const commitinfo = { name: '@git.zone/tsbuild', - version: '2.1.82', + version: '2.1.83', description: 'TypeScript nightly to easily make use of latest features' } diff --git a/ts/tsbuild.cli.ts b/ts/tsbuild.cli.ts index f27e1cb..aea2081 100644 --- a/ts/tsbuild.cli.ts +++ b/ts/tsbuild.cli.ts @@ -37,14 +37,23 @@ export const runCli = async () => { */ tsbuildCli.addCommand('tsfolders').subscribe(async (argvArg) => { const tsFolders = await plugins.smartfile.fs.listFolders(paths.cwd, /^ts/); + // lets make sure shared is always transpiled first + const indexShared = tsFolders.indexOf('ts_shared'); + if (indexShared > -1) { + tsFolders.splice(indexShared, 1); + tsFolders.unshift('ts_interfaces'); + } + // lets make sure interfaces are always transpiled first - const index = tsFolders.indexOf('ts_interfaces'); - if (index > -1) { - tsFolders.splice(index, 1); + const indexInterfaces = tsFolders.indexOf('ts_interfaces'); + if (indexInterfaces > -1) { + tsFolders.splice(indexInterfaces, 1); tsFolders.unshift('ts_interfaces'); } const compilationCommandObject: { [key: string]: string } = {}; + console.log(`compiling in this order:`); + console.log(tsFolders); for (const tsFolder of tsFolders) { compilationCommandObject[`./${tsFolder}/**/*.ts`] = `./dist_${tsFolder}`; }