- partial support for project references #139

This commit is contained in:
Eugene Zolenko 2019-02-25 14:33:04 -07:00
parent 9188132749
commit f4ee39c979
6 changed files with 73 additions and 84 deletions

View File

@ -1 +1 @@
{"version":3,"file":"get-options-overrides.d.ts","sourceRoot":"","sources":["src/get-options-overrides.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,OAAO,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAGtC,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAKrC,wBAAgB,mBAAmB,CAAC,EAAE,yBAAyB,EAAE,SAAS,EAAE,EAAE,QAAQ,EAAE,iBAAiB,CAAC,EAAE,OAAO,CAAC,iBAAiB,GAAG,OAAO,CAAC,eAAe,CA+B9J;AAED,wBAAgB,YAAY,CAAC,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,QAAQ,EAAE,YAAY,EAAE,OAAO,CAAC,iBAAiB,OAsC/G"}
{"version":3,"file":"get-options-overrides.d.ts","sourceRoot":"","sources":["src/get-options-overrides.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,OAAO,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAGtC,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAKrC,wBAAgB,mBAAmB,CAAC,EAAE,yBAAyB,EAAE,SAAS,EAAE,EAAE,QAAQ,EAAE,iBAAiB,CAAC,EAAE,OAAO,CAAC,iBAAiB,GAAG,OAAO,CAAC,eAAe,CA+B9J;AAiBD,wBAAgB,YAAY,CAAC,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,QAAQ,EAAE,YAAY,EAAE,OAAO,CAAC,iBAAiB,OAoB/G"}

View File

@ -24975,35 +24975,31 @@ function getOptionsOverrides({ useTsconfigDeclarationDir, cacheRoot }, preParsed
}
return overrides;
}
function expandIncludeWithDirs(include, dirs) {
return lodash_16(dirs)
.flatMap((root) => {
if (include instanceof Array)
return include.map((x) => path.join(root, x));
else
return path.join(root, include);
})
.uniq()
.value();
}
function createFilter(context, pluginOptions, parsedConfig) {
let included = pluginOptions.include;
let excluded = pluginOptions.exclude;
if (parsedConfig.options.rootDirs) {
const included = lodash_16(parsedConfig.options.rootDirs)
.flatMap((root) => {
if (pluginOptions.include instanceof Array)
return pluginOptions.include.map((include) => path.join(root, include));
else
return path.join(root, pluginOptions.include);
})
.uniq()
.value();
const excluded = lodash_16(parsedConfig.options.rootDirs)
.flatMap((root) => {
if (pluginOptions.exclude instanceof Array)
return pluginOptions.exclude.map((exclude) => path.join(root, exclude));
else
return path.join(root, pluginOptions.exclude);
})
.uniq()
.value();
context.debug(() => `included:\n${JSON.stringify(included, undefined, 4)}`);
context.debug(() => `excluded:\n${JSON.stringify(excluded, undefined, 4)}`);
return createRollupFilter(included, excluded);
included = expandIncludeWithDirs(included, parsedConfig.options.rootDirs);
excluded = expandIncludeWithDirs(excluded, parsedConfig.options.rootDirs);
}
else {
context.debug(() => `included:\n'${JSON.stringify(pluginOptions.include, undefined, 4)}'`);
context.debug(() => `excluded:\n'${JSON.stringify(pluginOptions.exclude, undefined, 4)}'`);
return createRollupFilter(pluginOptions.include, pluginOptions.exclude);
if (parsedConfig.projectReferences) {
included = lodash_10(included, expandIncludeWithDirs(included, parsedConfig.projectReferences.map((x) => x.path)));
excluded = lodash_10(excluded, expandIncludeWithDirs(excluded, parsedConfig.projectReferences.map((x) => x.path)));
}
context.debug(() => `included:\n${JSON.stringify(included, undefined, 4)}`);
context.debug(() => `excluded:\n${JSON.stringify(excluded, undefined, 4)}`);
return createRollupFilter(included, excluded);
}
function checkTsConfig(parsedConfig) {

File diff suppressed because one or more lines are too long

View File

@ -24971,35 +24971,31 @@ function getOptionsOverrides({ useTsconfigDeclarationDir, cacheRoot }, preParsed
}
return overrides;
}
function expandIncludeWithDirs(include, dirs) {
return lodash_16(dirs)
.flatMap((root) => {
if (include instanceof Array)
return include.map((x) => join(root, x));
else
return join(root, include);
})
.uniq()
.value();
}
function createFilter(context, pluginOptions, parsedConfig) {
let included = pluginOptions.include;
let excluded = pluginOptions.exclude;
if (parsedConfig.options.rootDirs) {
const included = lodash_16(parsedConfig.options.rootDirs)
.flatMap((root) => {
if (pluginOptions.include instanceof Array)
return pluginOptions.include.map((include) => join(root, include));
else
return join(root, pluginOptions.include);
})
.uniq()
.value();
const excluded = lodash_16(parsedConfig.options.rootDirs)
.flatMap((root) => {
if (pluginOptions.exclude instanceof Array)
return pluginOptions.exclude.map((exclude) => join(root, exclude));
else
return join(root, pluginOptions.exclude);
})
.uniq()
.value();
context.debug(() => `included:\n${JSON.stringify(included, undefined, 4)}`);
context.debug(() => `excluded:\n${JSON.stringify(excluded, undefined, 4)}`);
return createRollupFilter(included, excluded);
included = expandIncludeWithDirs(included, parsedConfig.options.rootDirs);
excluded = expandIncludeWithDirs(excluded, parsedConfig.options.rootDirs);
}
else {
context.debug(() => `included:\n'${JSON.stringify(pluginOptions.include, undefined, 4)}'`);
context.debug(() => `excluded:\n'${JSON.stringify(pluginOptions.exclude, undefined, 4)}'`);
return createRollupFilter(pluginOptions.include, pluginOptions.exclude);
if (parsedConfig.projectReferences) {
included = lodash_10(included, expandIncludeWithDirs(included, parsedConfig.projectReferences.map((x) => x.path)));
excluded = lodash_10(excluded, expandIncludeWithDirs(excluded, parsedConfig.projectReferences.map((x) => x.path)));
}
context.debug(() => `included:\n${JSON.stringify(included, undefined, 4)}`);
context.debug(() => `excluded:\n${JSON.stringify(excluded, undefined, 4)}`);
return createRollupFilter(included, excluded);
}
function checkTsConfig(parsedConfig) {

File diff suppressed because one or more lines are too long

View File

@ -41,42 +41,39 @@ export function getOptionsOverrides({ useTsconfigDeclarationDir, cacheRoot }: IO
return overrides;
}
function expandIncludeWithDirs(include: string | string[], dirs: string[])
{
return _
.chain(dirs)
.flatMap((root) =>
{
if (include instanceof Array)
return include.map((x) => join(root, x));
else
return join(root, include);
})
.uniq()
.value();
}
export function createFilter(context: IContext, pluginOptions: IOptions, parsedConfig: tsTypes.ParsedCommandLine)
{
let included = pluginOptions.include;
let excluded = pluginOptions.exclude;
if (parsedConfig.options.rootDirs)
{
const included = _
.chain(parsedConfig.options.rootDirs)
.flatMap((root) =>
{
if (pluginOptions.include instanceof Array)
return pluginOptions.include.map((include) => join(root, include));
else
return join(root, pluginOptions.include);
})
.uniq()
.value();
const excluded = _
.chain(parsedConfig.options.rootDirs)
.flatMap((root) =>
{
if (pluginOptions.exclude instanceof Array)
return pluginOptions.exclude.map((exclude) => join(root, exclude));
else
return join(root, pluginOptions.exclude);
})
.uniq()
.value();
context.debug(() => `included:\n${JSON.stringify(included, undefined, 4)}`);
context.debug(() => `excluded:\n${JSON.stringify(excluded, undefined, 4)}`);
return createRollupFilter(included, excluded);
included = expandIncludeWithDirs(included, parsedConfig.options.rootDirs);
excluded = expandIncludeWithDirs(excluded, parsedConfig.options.rootDirs);
}
else
if (parsedConfig.projectReferences)
{
context.debug(() => `included:\n'${JSON.stringify(pluginOptions.include, undefined, 4)}'`);
context.debug(() => `excluded:\n'${JSON.stringify(pluginOptions.exclude, undefined, 4)}'`);
return createRollupFilter(pluginOptions.include, pluginOptions.exclude);
included = _.concat(included, expandIncludeWithDirs(included, parsedConfig.projectReferences.map((x) => x.path)));
excluded = _.concat(excluded, expandIncludeWithDirs(excluded, parsedConfig.projectReferences.map((x) => x.path)));
}
context.debug(() => `included:\n${JSON.stringify(included, undefined, 4)}`);
context.debug(() => `excluded:\n${JSON.stringify(excluded, undefined, 4)}`);
return createRollupFilter(included, excluded);
}