update to smartconfig
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user