Skip to content

Commit

Permalink
chore(scripts): remove unused logic from tsc,api-extractor used for p…
Browse files Browse the repository at this point in the history
…artial migration
  • Loading branch information
Hotell committed Nov 15, 2022
1 parent 5a3e1e9 commit def9c4b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 20 deletions.
12 changes: 1 addition & 11 deletions scripts/tasks/ts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,17 +28,7 @@ function prepareTsTaskConfig(options: TscTaskOptions) {
logger.info(`📣 TSC: package is using TS path aliases. Overriding tsconfig settings.`);

const tsConfigOutDir = tsConfig.compilerOptions.outDir as string;

const hasNewCompilationSetup = tsConfigOutDir.includes('dist/out-tsc');

if (hasNewCompilationSetup) {
options.outDir = `${tsConfigOutDir}/${options.outDir}`;
} else {
// TODO: remove after all v9 is migrated to new tsc processing
options.baseUrl = '.';
options.rootDir = './src';
}

options.outDir = `${tsConfigOutDir}/${options.outDir}`;
options.project = tsConfigFile;
}

Expand Down
10 changes: 1 addition & 9 deletions scripts/tasks/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,14 +60,6 @@ export function getTsPathAliasesApiExtractorConfig(options: {
packageJson: PackageJson;
definitionsRootPath: string;
}) {
const hasNewCompilationSetup = ((options.tsConfig.compilerOptions as unknown) as { outDir: string }).outDir.includes(
'dist/out-tsc',
);
// TODO: after all v9 is migrated to new tsc processing use only createNormalizedTsPaths
const normalizedPaths = hasNewCompilationSetup
? createNormalizedTsPaths({ definitionsRootPath: options.definitionsRootPath, rootTsConfig })
: undefined;

/**
* Customized TSConfig that uses `tsconfig.lib.json` as base with some required overrides:
*
Expand Down Expand Up @@ -96,7 +88,7 @@ export function getTsPathAliasesApiExtractorConfig(options: {
* just-scripts provides invalid types for tsconfig, thus `paths` cannot be set to dictionary,nor null or `{}`
*/
// @ts-expect-error - just-scripts provides invalid types
paths: normalizedPaths,
paths: createNormalizedTsPaths({ definitionsRootPath: options.definitionsRootPath, rootTsConfig }),
},
};

Expand Down

0 comments on commit def9c4b

Please sign in to comment.