fix(format): Fixed async issue in tsconfig module lookup and corrected property access

This commit is contained in:
Philipp Kunz 2024-10-27 02:09:04 +02:00
parent 4f0fb26a15
commit 3c5a8282ab
3 changed files with 7 additions and 3 deletions

View File

@ -1,5 +1,9 @@
# Changelog # Changelog
## 2024-10-27 - 1.10.1 - fix(format)
Fixed async issue in tsconfig module lookup and corrected property access
## 2024-10-27 - 1.10.0 - feat(mod_format) ## 2024-10-27 - 1.10.0 - feat(mod_format)
Add support for tsconfig.json formatting Add support for tsconfig.json formatting

View File

@ -3,6 +3,6 @@
*/ */
export const commitinfo = { export const commitinfo = {
name: '@git.zone/cli', name: '@git.zone/cli',
version: '1.10.0', version: '1.10.1',
description: 'A CLI toolbelt to streamline local development cycles by using various gitzone utilities.' description: 'A CLI toolbelt to streamline local development cycles by using various gitzone utilities.'
} }

View File

@ -13,10 +13,10 @@ export const run = async (projectArg: Project) => {
tsconfigObject.compilerOptions.paths = {}; tsconfigObject.compilerOptions.paths = {};
const tsPublishMod = await import('@git.zone/tspublish'); const tsPublishMod = await import('@git.zone/tspublish');
const tsPublishInstance = new tsPublishMod.TsPublish(); const tsPublishInstance = new tsPublishMod.TsPublish();
const publishModules = tsPublishInstance.getModuleSubDirs(paths.cwd); const publishModules = await tsPublishInstance.getModuleSubDirs(paths.cwd);
for (const publishModule of Object.keys(publishModules)) { for (const publishModule of Object.keys(publishModules)) {
const publishConfig = publishModules[publishModule]; const publishConfig = publishModules[publishModule];
tsconfigObject.compilerOptions.paths[`${publishConfig.moduleName}`] = [`./${publishModule}/index.ts`]; tsconfigObject.compilerOptions.paths[`${publishConfig.name}`] = [`./${publishModule}/index.ts`];
} }
tsconfigSmartfile.setContentsFromString(JSON.stringify(tsconfigObject, null, 2)); tsconfigSmartfile.setContentsFromString(JSON.stringify(tsconfigObject, null, 2));
await tsconfigSmartfile.write(); await tsconfigSmartfile.write();