Skip to content

Commit

Permalink
fixup! fix(scripts): resolve api-extractor execution issue within pac…
Browse files Browse the repository at this point in the history
…kages with new DX
  • Loading branch information
Hotell committed Aug 19, 2021
1 parent aff33a2 commit 1eb466e
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions scripts/tasks/api-extractor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ import * as path from 'path';
import jju from 'jju';
import { apiExtractorVerifyTask, task, series, resolveCwd, logger, TscTaskOptions, condition } from 'just-scripts';

const noop = () => {};

const apiExtractorConfigs = glob
.sync(path.join(process.cwd(), 'config/api-extractor*.json'))
.map(configPath => [configPath, configPath.replace(/.*\bapi-extractor(?:\.(.*))?\.json$/, '$1') || 'default'])
Expand All @@ -26,15 +24,15 @@ export function apiExtractor() {

const shouldExecOverrideTasks = () => overrideApi !== null;

const cleanupOverrides = overrideApi ? () => overrideApi.resetConfig() : () => noop;

task('api-extractor:override-config', () => {
if (overrideApi) {
overrideApi.overrideConfig();
}
});
task('api-extractor:cleanup-override-config', () => {
cleanupOverrides();
if (overrideApi) {
overrideApi.resetConfig();
}
});

const taskName = `api-extractor:${configName}`;
Expand Down

0 comments on commit 1eb466e

Please sign in to comment.