fix(core): enable intelligent tsconfig changes in tsconfig.base.json (#3768)
This commit is contained in:
parent
66038891ec
commit
c2a1946fe6
@ -37,7 +37,10 @@ describe('getTouchedProjectsFromTsConfig', () => {
|
||||
},
|
||||
};
|
||||
});
|
||||
it('should not return changes when tsconfig.json is not touched', () => {
|
||||
|
||||
['tsconfig.json', 'tsconfig.base.json'].forEach((tsConfig) => {
|
||||
describe(`(${tsConfig})`, () => {
|
||||
it(`should not return changes when ${tsConfig} is not touched`, () => {
|
||||
const result = getTouchedProjectsFromTsConfig(
|
||||
[
|
||||
{
|
||||
@ -65,7 +68,7 @@ describe('getTouchedProjectsFromTsConfig', () => {
|
||||
const result = getTouchedProjectsFromTsConfig(
|
||||
[
|
||||
{
|
||||
file: 'tsconfig.json',
|
||||
file: tsConfig,
|
||||
ext: '.json',
|
||||
hash: 'some-hash',
|
||||
getChanges: () => [new WholeFileChange()],
|
||||
@ -85,7 +88,7 @@ describe('getTouchedProjectsFromTsConfig', () => {
|
||||
const result = getTouchedProjectsFromTsConfig(
|
||||
[
|
||||
{
|
||||
file: 'tsconfig.json',
|
||||
file: tsConfig,
|
||||
ext: '.json',
|
||||
hash: 'some-hash',
|
||||
getChanges: () =>
|
||||
@ -117,7 +120,7 @@ describe('getTouchedProjectsFromTsConfig', () => {
|
||||
const result = getTouchedProjectsFromTsConfig(
|
||||
[
|
||||
{
|
||||
file: 'tsconfig.json',
|
||||
file: tsConfig,
|
||||
ext: '.json',
|
||||
hash: 'some-hash',
|
||||
getChanges: () =>
|
||||
@ -149,7 +152,7 @@ describe('getTouchedProjectsFromTsConfig', () => {
|
||||
const result = getTouchedProjectsFromTsConfig(
|
||||
[
|
||||
{
|
||||
file: 'tsconfig.json',
|
||||
file: tsConfig,
|
||||
ext: '.json',
|
||||
hash: 'some-hash',
|
||||
getChanges: () =>
|
||||
@ -183,7 +186,7 @@ describe('getTouchedProjectsFromTsConfig', () => {
|
||||
const result = getTouchedProjectsFromTsConfig(
|
||||
[
|
||||
{
|
||||
file: 'tsconfig.json',
|
||||
file: tsConfig,
|
||||
ext: '.json',
|
||||
hash: 'some-hash',
|
||||
getChanges: () =>
|
||||
@ -215,7 +218,7 @@ describe('getTouchedProjectsFromTsConfig', () => {
|
||||
const result = getTouchedProjectsFromTsConfig(
|
||||
[
|
||||
{
|
||||
file: 'tsconfig.json',
|
||||
file: tsConfig,
|
||||
ext: '.json',
|
||||
hash: 'some-hash',
|
||||
getChanges: () =>
|
||||
@ -252,7 +255,7 @@ describe('getTouchedProjectsFromTsConfig', () => {
|
||||
const result = getTouchedProjectsFromTsConfig(
|
||||
[
|
||||
{
|
||||
file: 'tsconfig.json',
|
||||
file: tsConfig,
|
||||
ext: '.json',
|
||||
hash: 'some-hash',
|
||||
getChanges: () =>
|
||||
@ -287,7 +290,7 @@ describe('getTouchedProjectsFromTsConfig', () => {
|
||||
const result = getTouchedProjectsFromTsConfig(
|
||||
[
|
||||
{
|
||||
file: 'tsconfig.json',
|
||||
file: tsConfig,
|
||||
ext: '.json',
|
||||
hash: 'some-hash',
|
||||
getChanges: () =>
|
||||
@ -318,4 +321,6 @@ describe('getTouchedProjectsFromTsConfig', () => {
|
||||
expect(result).toContainEqual('proj2');
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
@ -14,7 +14,8 @@ export const getTouchedProjectsFromTsConfig: TouchedProjectLocator<
|
||||
WholeFileChange | JsonChange
|
||||
> = (touchedFiles, _a, _b, _c, graph): string[] => {
|
||||
const tsConfigJsonChanges = touchedFiles.find(
|
||||
(change) => change.file === 'tsconfig.json'
|
||||
(change) =>
|
||||
change.file === 'tsconfig.json' || change.file === 'tsconfig.base.json'
|
||||
);
|
||||
if (!tsConfigJsonChanges) {
|
||||
return [];
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user