fix(core): Fixes handling of undefined paths in tsconfig generation.

This commit is contained in:
2024-10-28 01:24:52 +01:00
parent 5f9bd73904
commit 2b518722df
4 changed files with 17 additions and 4 deletions

View File

@ -3,6 +3,6 @@
*/
export const commitinfo = {
name: '@git.zone/tspublish',
version: '1.5.0',
version: '1.5.1',
description: 'A tool to publish multiple, concise, and small packages from monorepos, specifically for TypeScript projects within a git environment.'
}

View File

@ -80,8 +80,10 @@ export class PublishModule {
const originalTsConfig = plugins.smartfile.fs.toObjectSync(
plugins.path.join(paths.cwd, 'tsconfig.json')
);
for (const path of originalTsConfig.compilerOptions.paths) {
originalTsConfig.compilerOptions.paths[path][0] = `.${originalTsConfig.compilerOptions.paths[path][0]}`;
if (originalTsConfig?.compilerOptions?.paths) {
for (const path of originalTsConfig.compilerOptions.paths) {
originalTsConfig.compilerOptions.paths[path][0] = `.${originalTsConfig.compilerOptions.paths[path][0]}`;
}
}
const tsconfigJson = {
compilerOptions: {
@ -92,7 +94,7 @@ export class PublishModule {
moduleResolution: 'NodeNext',
esModuleInterop: true,
verbatimModuleSyntax: true,
paths: originalTsConfig.compilerOptions.paths,
paths: originalTsConfig?.compilerOptions?.paths,
},
exclude: [
'dist_*/**/*.d.ts',