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

View file

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