patch(providence-analytics): expose skipCheckMatchCompatibility)

This commit is contained in:
Thijs Louisse 2022-03-28 17:11:39 +02:00 committed by Thijs Louisse
parent 85318e3b1c
commit ab7cc1e026
3 changed files with 17 additions and 0 deletions

View file

@ -0,0 +1,5 @@
---
'providence-analytics': patch
---
providence-analytics: expose skipCheckMatchCompatibility: skips semver checks when targets and reference projects are matched. Handy for forward compatible libs and libs below v1

View file

@ -129,6 +129,7 @@ async function cli({ cwd, providenceConf } = {}) {
referenceProjectPaths: referencePaths,
targetProjectRootPaths: searchTargetPaths,
writeLogFile: commander.writeLogFile,
skipCheckMatchCompatibility: commander.skipCheckMatchCompatibility,
});
}
@ -225,6 +226,10 @@ async function cli({ cwd, providenceConf } = {}) {
.option(
'--allowlist-mode-reference [allowlist-mode-reference]',
`allowlist mode applied to refernce project`,
)
.option(
'--skip-check-match-compatibility',
`skips semver checks, handy for forward compatible libs or libs below v1`,
);
commander
@ -312,6 +317,7 @@ async function cli({ cwd, providenceConf } = {}) {
extensions: commander.extensions,
allowlist: commander.allowlist,
allowlistReference: commander.allowlistReference,
skipCheckMatchCompatibility: commander.skipCheckMatchCompatibility,
cwd,
})
.then(resolveCli)

View file

@ -299,6 +299,11 @@ describe('Providence CLI', () => {
await runCli(`${analyzeCmd} --target-dependencies /^mock-/`, rootDir);
expect(appendProjectDependencyPathsStub.args[0][1]).to.equal('/^mock-/');
});
it('"--skip-check-match-compatibility"', async () => {
await runCli(`${analyzeCmd} --skip-check-match-compatibility`, rootDir);
expect(providenceStub.args[0][1].skipCheckMatchCompatibility).to.equal(true);
});
});
describe('Commands', () => {
@ -385,6 +390,7 @@ describe('Providence CLI', () => {
allowlist: ['al'],
allowlistReference: ['alr'],
cwd: undefined,
skipCheckMatchCompatibility: true,
});
});
});