Closed
Description
Expected Behavior
- test are passing or have been updated to the new version
- commitlint can publish using lerna v7 (with installed prettier v3 dependency)
Current Behavior
Installing prettier v3 is breaking the current lerna (v6) setup in a way that yarn publish
doesn't work anymore.
Updating to lerna v7 (which works with prettier v3) leads to some failing tests:
@commitlint/config-lerna-scopes tests
FAIL @commitlint/config-lerna-scopes/index.test.js
✓ exports rules key (1 ms)
✓ rules hold object
✓ rules contain scope-enum
✓ scope-enum is function
✓ scope-enum does not throw for missing context (21 ms)
✓ scope-enum has expected severity (1 ms)
✓ scope-enum has expected modifier (1 ms)
✕ returns empty value for empty lerna repository (43 ms)
✕ returns expected value for basic lerna repository (34 ms)
✕ returns expected value for lerna repository containing modules (33 ms)
✕ returns expected value for scoped lerna repository (32 ms)
✓ returns expected value for yarn workspaces (2 ms)
✕ returns expected value for yarn workspaces has nested packages (36 ms)
● returns empty value for empty lerna repository
Could not resolve dependency lerna
41 | const sourcePath = (0, resolve_pkg_1.default)(dependency);
42 | if (!sourcePath) {
> 43 | throw new Error(`Could not resolve dependency ${dependency}`);
| ^
44 | }
45 | const sourceModulesPath = findParentPath(sourcePath, 'node_modules');
46 | if (!sourceModulesPath) {
at @packages/test/lib/npm.js:43:23
at Array.map (<anonymous>)
at map (@packages/test/lib/npm.js:40:32)
at Object.bootstrap (@packages/test/lib/npm.js:59:5)
at Object.<anonymous> (@commitlint/config-lerna-scopes/index.test.js:50:14)
● returns expected value for basic lerna repository
Could not resolve dependency lerna
41 | const sourcePath = (0, resolve_pkg_1.default)(dependency);
42 | if (!sourcePath) {
> 43 | throw new Error(`Could not resolve dependency ${dependency}`);
| ^
44 | }
45 | const sourceModulesPath = findParentPath(sourcePath, 'node_modules');
46 | if (!sourceModulesPath) {
at @packages/test/lib/npm.js:43:23
at Array.map (<anonymous>)
at map (@packages/test/lib/npm.js:40:32)
at Object.bootstrap (@packages/test/lib/npm.js:59:5)
at Object.<anonymous> (@commitlint/config-lerna-scopes/index.test.js:57:14)
● returns expected value for lerna repository containing modules
Could not resolve dependency lerna
41 | const sourcePath = (0, resolve_pkg_1.default)(dependency);
42 | if (!sourcePath) {
> 43 | throw new Error(`Could not resolve dependency ${dependency}`);
| ^
44 | }
45 | const sourceModulesPath = findParentPath(sourcePath, 'node_modules');
46 | if (!sourceModulesPath) {
at @packages/test/lib/npm.js:43:23
at Array.map (<anonymous>)
at map (@packages/test/lib/npm.js:40:32)
at Object.bootstrap (@packages/test/lib/npm.js:59:5)
at Object.<anonymous> (@commitlint/config-lerna-scopes/index.test.js:65:14)
● returns expected value for scoped lerna repository
Could not resolve dependency lerna
41 | const sourcePath = (0, resolve_pkg_1.default)(dependency);
42 | if (!sourcePath) {
> 43 | throw new Error(`Could not resolve dependency ${dependency}`);
| ^
44 | }
45 | const sourceModulesPath = findParentPath(sourcePath, 'node_modules');
46 | if (!sourceModulesPath) {
at @packages/test/lib/npm.js:43:23
at Array.map (<anonymous>)
at map (@packages/test/lib/npm.js:40:32)
at Object.bootstrap (@packages/test/lib/npm.js:59:5)
at Object.<anonymous> (@commitlint/config-lerna-scopes/index.test.js:73:14)
● returns expected value for yarn workspaces has nested packages
Could not resolve dependency lerna
41 | const sourcePath = (0, resolve_pkg_1.default)(dependency);
42 | if (!sourcePath) {
> 43 | throw new Error(`Could not resolve dependency ${dependency}`);
| ^
44 | }
45 | const sourceModulesPath = findParentPath(sourcePath, 'node_modules');
46 | if (!sourceModulesPath) {
at @packages/test/lib/npm.js:43:23
at Array.map (<anonymous>)
at map (@packages/test/lib/npm.js:40:32)
at Object.bootstrap (@packages/test/lib/npm.js:59:5)
at Object.<anonymous> (@commitlint/config-lerna-scopes/index.test.js:88:14)
Test Suites: 1 failed, 1 total
Tests: 5 failed, 8 passed, 13 total
Context
Created a branch here: #3636
commitlint --version
17.6.7
git --version
v2.41.0
node --version
v18.16.0