update to smartconfig

This commit is contained in:
2026-03-24 16:10:51 +00:00
parent eda67395fe
commit d0d922e53b
41 changed files with 425 additions and 2091 deletions

View File

@@ -30,9 +30,10 @@ export class TsconfigFormatter extends BaseFormatter {
const tsconfigObject = JSON.parse(currentContent);
tsconfigObject.compilerOptions = tsconfigObject.compilerOptions || {};
tsconfigObject.compilerOptions.baseUrl = '.';
tsconfigObject.compilerOptions.paths = {};
const existingPaths = tsconfigObject.compilerOptions.paths || {};
// Get module paths from tspublish
// Get module paths from tspublish, merging with existing custom paths
const tspublishPaths: Record<string, string[]> = {};
try {
const tsPublishMod = await import('@git.zone/tspublish');
const tsPublishInstance = new tsPublishMod.TsPublish();
@@ -40,7 +41,7 @@ export class TsconfigFormatter extends BaseFormatter {
for (const publishModule of Object.keys(publishModules)) {
const publishConfig = publishModules[publishModule];
tsconfigObject.compilerOptions.paths[`${publishConfig.name}`] = [
tspublishPaths[`${publishConfig.name}`] = [
`./${publishModule}/index.js`,
];
}
@@ -48,6 +49,8 @@ export class TsconfigFormatter extends BaseFormatter {
logVerbose(`Could not get tspublish modules: ${error.message}`);
}
tsconfigObject.compilerOptions.paths = { ...existingPaths, ...tspublishPaths };
const newContent = JSON.stringify(tsconfigObject, null, 2);
// Only add change if content differs