From edf3f55246c5c23cf8cc39a35fc6e1fc90f83550 Mon Sep 17 00:00:00 2001 From: Martin Hochel Date: Fri, 11 Nov 2022 19:33:53 +0100 Subject: [PATCH] fixup! feat(scripts): remove @internal stripping and enable no deps build needed for api generation --- scripts/tasks/ts.ts | 2 +- scripts/tasks/utils.spec.ts | 1 + scripts/tasks/utils.ts | 8 +++++++- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/scripts/tasks/ts.ts b/scripts/tasks/ts.ts index 30a3e54b941dfc..94493729686123 100644 --- a/scripts/tasks/ts.ts +++ b/scripts/tasks/ts.ts @@ -34,7 +34,7 @@ function prepareTsTaskConfig(options: TscTaskOptions) { if (hasNewCompilationSetup) { options.outDir = `${tsConfigOutDir}/${options.outDir}`; } else { - // TODO: remove after all v9 is migrated to new build and .d.ts API stripping + // TODO: remove after all v9 is migrated to new tsc processing options.baseUrl = '.'; options.rootDir = './src'; } diff --git a/scripts/tasks/utils.spec.ts b/scripts/tasks/utils.spec.ts index 60bf26d83cd168..b6c36d6dfecae7 100644 --- a/scripts/tasks/utils.spec.ts +++ b/scripts/tasks/utils.spec.ts @@ -8,6 +8,7 @@ describe(`utils`, () => { const defaults = { tsConfig: { compilerOptions: { + outDir: '../../dist/out-tsc', ...options.tsConfig?.compilerOptions, }, }, diff --git a/scripts/tasks/utils.ts b/scripts/tasks/utils.ts index fcf640a97aed2a..60ac3cf3daaa32 100644 --- a/scripts/tasks/utils.ts +++ b/scripts/tasks/utils.ts @@ -60,7 +60,13 @@ export function getTsPathAliasesApiExtractorConfig(options: { packageJson: PackageJson; definitionsRootPath: string; }) { - const normalizedPaths = createNormalizedTsPaths({ definitionsRootPath: options.definitionsRootPath, rootTsConfig }); + 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: