@rsdk/depdoc.cli 6.0.0-next.45 → 6.0.0-next.46
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -70,6 +70,16 @@ describe('parsePeerFailureLine', () => {
|
|
|
70
70
|
expect(result.consumer).toBe('@docusaurus/types');
|
|
71
71
|
});
|
|
72
72
|
|
|
73
|
+
it('parses the "provides a mismatched version" shape, not just "doesn\'t provide"', () => {
|
|
74
|
+
const result = parsePeerFailureLine(
|
|
75
|
+
"pd75455 → ✘ @mcteam/eslint-config.frontend@workspace:packages/mcteam.eslint-config.frontend provides eslint@npm:10.5.0 [5c646] to @eslint/js@npm:10.0.1 [5c646] and 8 other dependencies",
|
|
76
|
+
);
|
|
77
|
+
|
|
78
|
+
expect(result.provider).toBe('@mcteam/eslint-config.frontend');
|
|
79
|
+
expect(result.peer).toBe('eslint');
|
|
80
|
+
expect(result.consumer).toBe('@eslint/js');
|
|
81
|
+
});
|
|
82
|
+
|
|
73
83
|
it('returns nulls for an unparseable line rather than guessing', () => {
|
|
74
84
|
const result = parsePeerFailureLine('✘ something unexpected happened');
|
|
75
85
|
|
|
@@ -113,6 +123,18 @@ describe('classifyPeerFailures', () => {
|
|
|
113
123
|
expect(ownershipFailures).toHaveLength(1);
|
|
114
124
|
});
|
|
115
125
|
|
|
126
|
+
it('treats a workspace-provided version-mismatch as blocking, not vendor-only noise', () => {
|
|
127
|
+
const line =
|
|
128
|
+
"pd75455 → ✘ @mcteam/eslint-config.frontend@workspace:packages/mcteam.eslint-config.frontend provides eslint@npm:10.5.0 [5c646] to @eslint/js@npm:10.0.1 [5c646] and 8 other dependencies";
|
|
129
|
+
const { vendorFailures, ownershipFailures } = classifyPeerFailures(
|
|
130
|
+
line,
|
|
131
|
+
new Set(['@mcteam/eslint-config.frontend']),
|
|
132
|
+
);
|
|
133
|
+
|
|
134
|
+
expect(vendorFailures).toHaveLength(0);
|
|
135
|
+
expect(ownershipFailures).toHaveLength(1);
|
|
136
|
+
});
|
|
137
|
+
|
|
116
138
|
it('treats an unparseable failure line as blocking', () => {
|
|
117
139
|
const { vendorFailures, ownershipFailures } = classifyPeerFailures(
|
|
118
140
|
'✘ garbled output',
|
|
@@ -16,6 +16,12 @@ export interface PeerFailure {
|
|
|
16
16
|
* Local workspaces use a `@workspace:` reference instead of `@npm:`.
|
|
17
17
|
*/
|
|
18
18
|
export declare function extractPackageIdent(token: string): string;
|
|
19
|
+
/**
|
|
20
|
+
* `yarn explain peer-requirements` reports two distinct failure shapes:
|
|
21
|
+
* "X doesn't provide Y to Z" (peer missing entirely) and "X provides Y to Z"
|
|
22
|
+
* (peer present but its version does not satisfy all requests). Both count
|
|
23
|
+
* as a failed requirement; only the reason differs.
|
|
24
|
+
*/
|
|
19
25
|
export declare function parsePeerFailureLine(line: string): PeerFailure;
|
|
20
26
|
/**
|
|
21
27
|
* A failure only qualifies as vendor-only when both sides were parsed and
|
|
@@ -24,15 +24,23 @@ function extractPackageIdent(token) {
|
|
|
24
24
|
? withoutHash.slice(0, protocolMatch.index)
|
|
25
25
|
: withoutHash).trim();
|
|
26
26
|
}
|
|
27
|
+
/**
|
|
28
|
+
* `yarn explain peer-requirements` reports two distinct failure shapes:
|
|
29
|
+
* "X doesn't provide Y to Z" (peer missing entirely) and "X provides Y to Z"
|
|
30
|
+
* (peer present but its version does not satisfy all requests). Both count
|
|
31
|
+
* as a failed requirement; only the reason differs.
|
|
32
|
+
*/
|
|
27
33
|
function parsePeerFailureLine(line) {
|
|
28
|
-
|
|
34
|
+
// The peer token may carry its own locator hash before " to " -
|
|
35
|
+
// e.g. "provides eslint@npm:10.5.0 [5c646] to ...".
|
|
36
|
+
const match = line.match(/✘\s+(.+?)\s+(?:doesn't provide|provides)\s+(\S+)(?:\s+\[[0-9a-f]+\])?\s+to\s+(.+)$/);
|
|
29
37
|
if (!match)
|
|
30
38
|
return { raw: line, provider: null, peer: '', consumer: null };
|
|
31
|
-
const [, providerToken,
|
|
39
|
+
const [, providerToken, peerToken, consumerToken] = match;
|
|
32
40
|
return {
|
|
33
41
|
raw: line,
|
|
34
42
|
provider: extractPackageIdent(providerToken),
|
|
35
|
-
peer:
|
|
43
|
+
peer: extractPackageIdent(peerToken),
|
|
36
44
|
consumer: extractPackageIdent(consumerToken),
|
|
37
45
|
};
|
|
38
46
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"peer-requirements.js","sourceRoot":"","sources":["../../src/lib/peer-requirements.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;AAcH,kDAeC;
|
|
1
|
+
{"version":3,"file":"peer-requirements.js","sourceRoot":"","sources":["../../src/lib/peer-requirements.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;AAcH,kDAeC;AAQD,oDAiBC;AAOD,oCAUC;AAOD,oDAaC;AAOD,kEAuBC;AAhHD;;;;GAIG;AACH,SAAgB,mBAAmB,CAAC,KAAa;IAC/C,MAAM,aAAa,GAAG,KAAK,CAAC,OAAO,CACjC,+CAA+C,EAC/C,EAAE,CACH,CAAC;IACF,MAAM,WAAW,GAAG,aAAa,CAAC,OAAO,CAAC,sBAAsB,EAAE,EAAE,CAAC,CAAC;IACtE,MAAM,aAAa,GAAG,WAAW,CAAC,KAAK,CACrC,uCAAuC,CACxC,CAAC;IAEF,OAAO,CACL,aAAa;QACX,CAAC,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC,EAAE,aAAa,CAAC,KAAK,CAAC;QAC3C,CAAC,CAAC,WAAW,CAChB,CAAC,IAAI,EAAE,CAAC;AACX,CAAC;AAED;;;;;GAKG;AACH,SAAgB,oBAAoB,CAAC,IAAY;IAC/C,gEAAgE;IAChE,oDAAoD;IACpD,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CACtB,oFAAoF,CACrF,CAAC;IAEF,IAAI,CAAC,KAAK;QAAE,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,EAAE,E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MAAM,OAAO,IAAI,QAAQ,EAAE,CAAC;QAC/B,IAAI,CAAC,OAAO,CAAC,QAAQ,IAAI,CAAC,OAAO,CAAC,IAAI;YAAE,SAAS;QACjD,IAAI,CAAC,eAAe,CAAC,GAAG,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,CAAC;YAC3C,eAAe,CAAC,GAAG,CAAC,OAAO,CAAC,QAAQ,EAAE,IAAI,GAAG,EAAE,CAAC,CAAC;QACnD,CAAC;QACD,eAAe,CAAC,GAAG,CAAC,OAAO,CAAC,QAAQ,CAAE,CAAC,GAAG,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;IAC3D,CAAC;IAED,MAAM,KAAK,GAAG,CAAC,oBAAoB,CAAC,CAAC;IAErC,KAAK,MAAM,CAAC,QAAQ,EAAE,KAAK,CAAC,IAAI,eAAe,EAAE,CAAC;QAChD,KAAK,CAAC,IAAI,CAAC,MAAM,QAAQ,MAAM,CAAC,CAAC;QACjC,KAAK,CAAC,IAAI,CAAC,mBAAmB,CAAC,CAAC;QAChC,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;YACzB,KAAK,CAAC,IAAI,CAAC,UAAU,IAAI,QAAQ,CAAC,CAAC;QACrC,CAAC;IACH,CAAC;IACD,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC1B,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rsdk/depdoc.cli",
|
|
3
3
|
"role": "cli",
|
|
4
|
-
"version": "6.0.0-next.
|
|
4
|
+
"version": "6.0.0-next.46",
|
|
5
5
|
"description": "CLI for monorepo dependency management",
|
|
6
6
|
"license": "Apache License 2.0",
|
|
7
7
|
"publishConfig": {
|
|
@@ -18,5 +18,5 @@
|
|
|
18
18
|
"typescript": "5.7.3",
|
|
19
19
|
"yaml": "^2.6.1"
|
|
20
20
|
},
|
|
21
|
-
"gitHead": "
|
|
21
|
+
"gitHead": "15565c93102217c4866939ea7b646016acdb73d6"
|
|
22
22
|
}
|
|
@@ -34,17 +34,27 @@ export function extractPackageIdent(token: string): string {
|
|
|
34
34
|
).trim();
|
|
35
35
|
}
|
|
36
36
|
|
|
37
|
+
/**
|
|
38
|
+
* `yarn explain peer-requirements` reports two distinct failure shapes:
|
|
39
|
+
* "X doesn't provide Y to Z" (peer missing entirely) and "X provides Y to Z"
|
|
40
|
+
* (peer present but its version does not satisfy all requests). Both count
|
|
41
|
+
* as a failed requirement; only the reason differs.
|
|
42
|
+
*/
|
|
37
43
|
export function parsePeerFailureLine(line: string): PeerFailure {
|
|
38
|
-
|
|
44
|
+
// The peer token may carry its own locator hash before " to " -
|
|
45
|
+
// e.g. "provides eslint@npm:10.5.0 [5c646] to ...".
|
|
46
|
+
const match = line.match(
|
|
47
|
+
/✘\s+(.+?)\s+(?:doesn't provide|provides)\s+(\S+)(?:\s+\[[0-9a-f]+\])?\s+to\s+(.+)$/,
|
|
48
|
+
);
|
|
39
49
|
|
|
40
50
|
if (!match) return { raw: line, provider: null, peer: '', consumer: null };
|
|
41
51
|
|
|
42
|
-
const [, providerToken,
|
|
52
|
+
const [, providerToken, peerToken, consumerToken] = match;
|
|
43
53
|
|
|
44
54
|
return {
|
|
45
55
|
raw: line,
|
|
46
56
|
provider: extractPackageIdent(providerToken!),
|
|
47
|
-
peer:
|
|
57
|
+
peer: extractPackageIdent(peerToken!),
|
|
48
58
|
consumer: extractPackageIdent(consumerToken!),
|
|
49
59
|
};
|
|
50
60
|
}
|