-
Notifications
You must be signed in to change notification settings - Fork 563
/
yarn.config.cjs
759 lines (670 loc) · 23.9 KB
/
yarn.config.cjs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
// @ts-check
// This file is used to define, among other configuration, rules that Yarn will
// execute when you run `yarn constraints`. These rules primarily check the
// manifests of each package in the monorepo to ensure they follow a standard
// format, but also check the presence of certain files as well.
/* eslint-disable jsdoc/valid-types */
const { defineConfig } = require('@yarnpkg/types');
const { readFile } = require('fs/promises');
const { get } = require('lodash');
const { basename, resolve, join, relative } = require('path');
const { inspect } = require('util');
const BASE_KEYWORDS = ['MetaMask', 'Snaps', 'Ethereum'];
/**
* Aliases for the Yarn type definitions, to make the code more readable.
*
* @typedef {import('@yarnpkg/types').Yarn.Constraints.Yarn} Yarn
* @typedef {import('@yarnpkg/types').Yarn.Constraints.Workspace} Workspace
* @typedef {import('@yarnpkg/types').Yarn.Constraints.Dependency} Dependency
* @typedef {import('@yarnpkg/types').Yarn.Constraints.DependencyType} DependencyType
*/
module.exports = defineConfig({
async constraints({ Yarn }) {
const rootWorkspace = Yarn.workspace({ cwd: '.' });
if (rootWorkspace === null) {
throw new Error('Could not find root workspace.');
}
const repositoryUri = rootWorkspace.manifest.repository.url.replace(
/\.git$/u,
'',
);
for (const workspace of Yarn.workspaces()) {
const workspaceBasename = getWorkspaceBasename(workspace);
const isChildWorkspace = workspace.cwd !== '.';
const isPrivate =
'private' in workspace.manifest && workspace.manifest.private === true;
const dependenciesByIdentAndType = getDependenciesByIdentAndType(
Yarn.dependencies({ workspace }),
);
const isExample = workspace.cwd.startsWith('packages/examples');
// All packages must have a name.
expectWorkspaceField(workspace, 'name');
if (isChildWorkspace) {
if (!isExample) {
// All non-root, non-example packages must have a name that matches its
// directory (e.g., a package in a workspace directory called `foo` must
// be called `@metamask/foo`).
expectWorkspaceField(
workspace,
'name',
`@metamask/${workspaceBasename}`,
);
}
// All non-root packages must have a version.
expectWorkspaceField(workspace, 'version');
// All non-root packages must have a description that ends in a period.
expectWorkspaceDescription(workspace);
// All non-root packages must include the same set of NPM keywords.
const customKeywords = get(workspace.manifest, 'keywords').filter(
(keyword) => !BASE_KEYWORDS.includes(keyword),
);
expectWorkspaceField(workspace, 'keywords', [
...BASE_KEYWORDS,
...customKeywords,
]);
// All non-root packages must have a homepage URL that includes its name.
expectWorkspaceField(
workspace,
'homepage',
`${repositoryUri}/tree/main/${relative(
__dirname,
workspace.cwd,
)}#readme`,
);
// All non-root packages must have a URL for reporting bugs that points
// to the Issues page for the repository.
expectWorkspaceField(workspace, 'bugs.url', `${repositoryUri}/issues`);
// All non-root packages must specify a Git repository within the
// MetaMask GitHub organization.
expectWorkspaceField(workspace, 'repository.type', 'git');
expectWorkspaceField(
workspace,
'repository.url',
`${repositoryUri}.git`,
);
// All non-root packages must have a license, defaulting to MIT.
await expectWorkspaceLicense(workspace);
// All non-root packages must not have side effects.
expectWorkspaceField(workspace, 'sideEffects', false);
if (!isPrivate && !isExample) {
// All non-root, non-example packages must set up ESM- and
// CommonJS-compatible exports correctly.
expectCorrectWorkspaceExports(workspace);
}
// All non-root, non-example packages must have the same "build" script.
if (
!isExample &&
workspace.cwd !== 'packages/test-snaps' &&
workspace.cwd !== 'packages/snaps-simulator'
) {
expectWorkspaceField(
workspace,
'scripts.build',
'ts-bridge --project tsconfig.build.json --verbose --clean --no-references',
);
}
if (isPrivate) {
// All private, non-root packages must not have a "publish:preview"
// script.
workspace.unset('scripts.publish:preview');
} else {
// All non-private, non-root packages must have the same
// "publish:preview" script.
expectWorkspaceField(
workspace,
'scripts.publish:preview',
'yarn npm publish --tag preview',
);
}
// No non-root packages may have a "prepack" script.
workspace.unset('scripts.prepack');
// All non-root package must have valid "changelog:update" and
// "changelog:validate" scripts.
expectWorkspaceField(
workspace,
'scripts.changelog:validate',
`${getRelativePath(workspace, 'scripts/validate-changelog.sh')} ${
workspace.manifest.name
}`,
);
expectWorkspaceField(
workspace,
'scripts.changelog:validate',
`${getRelativePath(workspace, 'scripts/validate-changelog.sh')} ${
workspace.manifest.name
}`,
);
// All non-root packages must have a valid "since-latest-release" script.
expectWorkspaceField(
workspace,
'scripts.since-latest-release',
getRelativePath(workspace, 'scripts', 'since-latest-release.sh'),
);
if (workspace.cwd !== 'packages/examples') {
// All non-root packages must have the same "test" script.
if (workspace.manifest.scripts['test:browser']) {
expectWorkspaceField(
workspace,
'scripts.test',
'jest --reporters=jest-silent-reporter && yarn test:browser',
);
} else {
expectWorkspaceField(
workspace,
'scripts.test',
'jest --reporters=jest-silent-reporter',
);
}
// All non-root packages must have the same "test:clean" script.
expectWorkspaceField(
workspace,
'scripts.test:clean',
'jest --clearCache',
);
// All non-root packages must have the same "test:verbose" script.
expectWorkspaceField(
workspace,
'scripts.test:verbose',
'jest --verbose',
);
// All non-root packages must have the same "test:watch" script.
expectWorkspaceField(workspace, 'scripts.test:watch', 'jest --watch');
}
}
if (isChildWorkspace && !isPrivate) {
// The list of files included in all non-root packages must only include
// files generated during the build process.
expectWorkspaceArrayField(workspace, 'files', 'dist');
} else {
// The root package must specify an empty set of published files. (This
// is required in order to be able to import anything in
// development-only scripts, as otherwise the
// `node/no-unpublished-require` ESLint rule will disallow it.)
expectWorkspaceField(workspace, 'files', []);
}
// If one workspace package lists another workspace package within
// `dependencies` or `devDependencies`, the version used within the
// dependency range must match the current version of the dependency.
expectUpToDateWorkspaceDependenciesAndDevDependencies(Yarn, workspace);
// If one workspace package lists another workspace package within
// `peerDependencies`, the dependency range must satisfy the current
// version of that package.
expectUpToDateWorkspacePeerDependencies(Yarn, workspace);
// No dependency may be listed under both `dependencies` and
// `devDependencies`.
expectDependenciesNotInBothProdAndDev(
workspace,
dependenciesByIdentAndType,
);
// The root workspace (and only the root workspace) must specify the Yarn
// version required for development.
if (isChildWorkspace) {
workspace.unset('packageManager');
} else {
expectWorkspaceField(workspace, 'packageManager', '[email protected]');
}
// All packages must specify a minimum Node.js version of 18.18.
expectWorkspaceField(workspace, 'engines.node', '^18.16 || >=20');
// All non-root public packages should be published to the NPM registry;
// all non-root private packages should not.
if (isPrivate) {
workspace.unset('publishConfig');
} else {
expectWorkspaceField(workspace, 'publishConfig.access', 'public');
expectWorkspaceField(
workspace,
'publishConfig.registry',
'https://registry.npmjs.org/',
);
}
}
// All version ranges in `dependencies` and `devDependencies` for the same
// dependency across the monorepo must be the same.
expectConsistentDependenciesAndDevDependencies(Yarn);
},
});
/**
* Get the relative path to a file from the workspace root.
*
* @param {Workspace} workspace - The workspace.
* @param {string} path - The path to the file, relative to the workspace
* root.
* @returns {string} The relative path to the script.
*/
function getRelativePath(workspace, ...path) {
return join(relative(workspace.cwd, __dirname), ...path);
}
/**
* Construct a nested map of dependencies. The inner layer categorizes
* instances of the same dependency by its location in the manifest; the outer
* layer categorizes the inner layer by the name of the dependency.
*
* @param {Dependency[]} dependencies - The list of dependencies to transform.
* @returns {Map<string, Map<DependencyType, Dependency>>} The resulting map.
*/
function getDependenciesByIdentAndType(dependencies) {
const dependenciesByIdentAndType = new Map();
for (const dependency of dependencies) {
const dependenciesForIdent = dependenciesByIdentAndType.get(
dependency.ident,
);
if (dependenciesForIdent === undefined) {
dependenciesByIdentAndType.set(
dependency.ident,
new Map([[dependency.type, dependency]]),
);
} else {
dependenciesForIdent.set(dependency.type, dependency);
}
}
return dependenciesByIdentAndType;
}
/**
* Construct a nested map of non-peer dependencies (`dependencies` and
* `devDependencies`). The inner layer categorizes instances of the same
* dependency by the version range specified; the outer layer categorizes the
* inner layer by the name of the dependency itself.
*
* @param {Dependency[]} dependencies - The list of dependencies to transform.
* @returns {Map<string, Map<string, Dependency[]>>} The resulting map.
*/
function getNonPeerDependenciesByIdent(dependencies) {
const nonPeerDependenciesByIdent = new Map();
for (const dependency of dependencies) {
if (dependency.type === 'peerDependencies') {
continue;
}
const dependencyRangesForIdent = nonPeerDependenciesByIdent.get(
dependency.ident,
);
if (dependencyRangesForIdent === undefined) {
nonPeerDependenciesByIdent.set(
dependency.ident,
new Map([[dependency.range, [dependency]]]),
);
} else {
const dependenciesForDependencyRange = dependencyRangesForIdent.get(
dependency.range,
);
if (dependenciesForDependencyRange === undefined) {
dependencyRangesForIdent.set(dependency.range, [dependency]);
} else {
dependenciesForDependencyRange.push(dependency);
}
}
}
return nonPeerDependenciesByIdent;
}
/**
* Get the basename of the workspace's directory. The workspace directory is
* expected to be in the form `<directory>/<package-name>`, and this function
* will extract `<package-name>`.
*
* @param {Workspace} workspace - The workspace.
* @returns {string} The name of the workspace.
*/
function getWorkspaceBasename(workspace) {
return basename(workspace.cwd);
}
/**
* Get the absolute path to a file within the workspace.
*
* @param {Workspace} workspace - The workspace.
* @param {string} path - The path to the file, relative to the workspace root.
* @returns {string} The absolute path to the file.
*/
function getWorkspacePath(workspace, path) {
return resolve(__dirname, workspace.cwd, path);
}
/**
* Get the contents of a file within the workspace. The file is expected to be
* encoded as UTF-8.
*
* @param {Workspace} workspace - The workspace.
* @param {string} path - The path to the file, relative to the workspace root.
* @returns {Promise<string>} The contents of the file.
*/
async function getWorkspaceFile(workspace, path) {
return await readFile(getWorkspacePath(workspace, path), 'utf8');
}
/**
* Attempts to access the given file to know whether the file exists.
*
* @param {Workspace} workspace - The workspace.
* @param {string} path - The path to the file, relative to the workspace root.
* @returns {Promise<boolean>} True if the file exists, false otherwise.
*/
async function workspaceFileExists(workspace, path) {
try {
await getWorkspaceFile(workspace, path);
} catch (error) {
if ('code' in error && error.code === 'ENOENT') {
return false;
}
throw error;
}
return true;
}
/**
* Expect that the workspace has the given field, and that it is a non-null
* value. If the field is not present, or is null, this will log an error, and
* cause the constraint to fail.
*
* If a value is provided, this will also verify that the field is equal to the
* given value.
*
* @param {Workspace} workspace - The workspace to check.
* @param {string} fieldName - The field to check.
* @param {unknown} [expectedValue] - The value to check.
*/
function expectWorkspaceField(workspace, fieldName, expectedValue = undefined) {
const fieldValue = get(workspace.manifest, fieldName);
if (expectedValue !== undefined && expectedValue !== null) {
workspace.set(fieldName, expectedValue);
} else if (expectedValue === null) {
workspace.unset(fieldName);
} else if (
expectedValue === undefined &&
(fieldValue === undefined || fieldValue === null)
) {
workspace.error(`Missing required field "${fieldName}".`);
}
}
/**
* Expect that the workspace has the given field, and that it is an array-like
* property containing the specified value. If the field is not present, is not
* an array, or does not contain the value, this will log an error, and cause
* the constraint to fail.
*
* @param {Workspace} workspace - The workspace to check.
* @param {string} fieldName - The field to check.
* @param {unknown} expectedValue - The value that should be contained in the array.
*/
function expectWorkspaceArrayField(
workspace,
fieldName,
expectedValue = undefined,
) {
let fieldValue = get(workspace.manifest, fieldName);
if (expectedValue) {
if (!Array.isArray(fieldValue)) {
fieldValue = [];
}
if (!fieldValue.includes(expectedValue)) {
fieldValue.push(expectedValue);
workspace.set(fieldName, fieldValue);
}
} else if (fieldValue === undefined || fieldValue === null) {
workspace.error(`Missing required field "${fieldName}".`);
}
}
/**
* Expect that the workspace has a description, and that it is a non-empty
* string. If the description is not present, or is null, this will log an
* error, and cause the constraint to fail.
*
* This will also verify that the description does not end with a period.
*
* @param {Workspace} workspace - The workspace to check.
*/
function expectWorkspaceDescription(workspace) {
expectWorkspaceField(workspace, 'description');
const { description } = workspace.manifest;
if (typeof description !== 'string') {
workspace.error(
`Expected description to be a string, but got ${typeof description}.`,
);
return;
}
if (description === '') {
workspace.error(`Expected description not to be an empty string.`);
return;
}
if (description.endsWith('.')) {
workspace.set('description', description.slice(0, -1));
}
}
/**
* Expect that the workspace has a license file, and that the `license` field is
* set.
*
* @param {Workspace} workspace - The workspace to check.
*/
async function expectWorkspaceLicense(workspace) {
if (
!(await workspaceFileExists(workspace, 'LICENSE')) &&
!(await workspaceFileExists(workspace, 'LICENSE.MIT0')) &&
!(await workspaceFileExists(workspace, 'LICENSE.APACHE2'))
) {
workspace.error('Could not find LICENSE file');
}
expectWorkspaceField(workspace, 'license');
}
/**
* Expect that the workspace has a `types` and `default` field in the `exports`
* object, and that they are in the correct order.
*
* @param {Workspace} workspace - The workspace to check.
* @param {string} exportKey - The key to check.
*/
function expectCorrectWorkspaceExportsOrder(workspace, exportKey) {
const exportValue = get(workspace.manifest, `exports["${exportKey}"]`);
if (typeof exportValue === 'string') {
return;
}
const importKeys = Object.keys(exportValue.import || {});
if (importKeys[0] !== 'types') {
workspace.error(
`Expected exports["${exportKey}"].import to specify "types" as first key`,
);
}
if (importKeys[1] !== 'default') {
workspace.error(
`Expected exports["${exportKey}"].import to specify "default" as second key`,
);
}
const requireKeys = Object.keys(exportValue.require || {});
if (requireKeys[0] !== 'types') {
workspace.error(
`Expected exports["${exportKey}"].require to specify "types" as first key`,
);
}
if (requireKeys[1] !== 'default') {
workspace.error(
`Expected exports["${exportKey}"].require to specify "default" as second key`,
);
}
}
/**
* Expect that the workspace has the correct extension for the given export
* field.
*
* @param {Workspace} workspace - The workspace to check.
* @param {string} key - The key to check.
* @param {string} extension - The expected extension.
*/
function expectExportExtension(workspace, key, extension) {
const exportValue = get(workspace.manifest, key);
if (!exportValue.endsWith(extension)) {
workspace.error(
`Expected ${key} to end with ${extension}, but got ${exportValue}`,
);
}
}
/**
* Expect that the workspace has exports set up correctly.
*
* @param {Workspace} workspace - The workspace to check.
*/
function expectCorrectWorkspaceExports(workspace) {
const exportKeys = Object.keys(workspace.manifest.exports);
if (!exportKeys.includes('.')) {
workspace.error('Expected exports to include "."');
}
// All non-root packages must provide the location of the ESM-compatible
// JavaScript entrypoint and its matching type declaration file.
expectWorkspaceField(
workspace,
'exports["."].import.types',
'./dist/index.d.mts',
);
expectWorkspaceField(
workspace,
'exports["."].import.default',
'./dist/index.mjs',
);
// All non-root package must provide the location of the CommonJS-compatible
// entrypoint and its matching type declaration file.
expectWorkspaceField(
workspace,
'exports["."].require.types',
'./dist/index.d.cts',
);
expectWorkspaceField(
workspace,
'exports["."].require.default',
'./dist/index.cjs',
);
for (const exportKey of exportKeys) {
const exportValue = get(workspace.manifest, `exports["${exportKey}"]`);
if (typeof exportValue === 'string') {
continue;
}
expectCorrectWorkspaceExportsOrder(workspace, exportKey);
expectExportExtension(
workspace,
`exports["${exportKey}"].import.types`,
'.mts',
);
expectExportExtension(
workspace,
`exports["${exportKey}"].import.default`,
'.mjs',
);
expectExportExtension(
workspace,
`exports["${exportKey}"].require.types`,
'.cts',
);
expectExportExtension(
workspace,
`exports["${exportKey}"].require.default`,
'.cjs',
);
// Types should not be set in the export object directly, but rather in the
// `import` and `require` subfields.
expectWorkspaceField(workspace, `exports["${exportKey}"].types`, null);
}
expectWorkspaceField(workspace, 'main', './dist/index.cjs');
expectWorkspaceField(workspace, 'types', './dist/index.d.cts');
// All non-root packages must export a `package.json` file.
expectWorkspaceField(
workspace,
'exports["./package.json"]',
'./package.json',
);
}
/**
* Expect that if the workspace package lists another workspace package within
* `dependencies` or `devDependencies`, the version used within the dependency
* is `workspace:^`.
*
* @param {Yarn} Yarn - The Yarn "global".
* @param {Workspace} workspace - The workspace to check.
*/
function expectUpToDateWorkspaceDependenciesAndDevDependencies(
Yarn,
workspace,
) {
for (const dependency of Yarn.dependencies({ workspace })) {
const dependencyWorkspace = Yarn.workspace({ ident: dependency.ident });
if (
dependencyWorkspace !== null &&
dependency.type !== 'peerDependencies'
) {
dependency.update('workspace:^');
}
}
}
/**
* Expect that if the workspace package lists another workspace package within
* `peerDependencies`, the dependency range satisfies the current version of
* that package.
*
* @param {Yarn} Yarn - The Yarn "global".
* @param {Workspace} workspace - The workspace to check.
*/
function expectUpToDateWorkspacePeerDependencies(Yarn, workspace) {
for (const dependency of Yarn.dependencies({ workspace })) {
const dependencyWorkspace = Yarn.workspace({ ident: dependency.ident });
if (
dependencyWorkspace !== null &&
dependency.type === 'peerDependencies'
) {
expectWorkspaceField(
workspace,
`peerDependencies["${dependency.ident}"]`,
`workspace:^`,
);
}
}
}
/**
* Expect that a workspace package does not list a dependency in both
* `dependencies` and `devDependencies`.
*
* @param {Workspace} workspace - The workspace to check.
* @param {Map<string, Map<DependencyType, Dependency>>} dependenciesByIdentAndType - Map of
* dependency ident to dependency type and dependency.
*/
function expectDependenciesNotInBothProdAndDev(
workspace,
dependenciesByIdentAndType,
) {
for (const [
dependencyIdent,
dependencyInstancesByType,
] of dependenciesByIdentAndType.entries()) {
if (
dependencyInstancesByType.size > 1 &&
!dependencyInstancesByType.has('peerDependencies')
) {
workspace.error(
`\`${dependencyIdent}\` cannot be listed in both \`dependencies\` and \`devDependencies\``,
);
}
}
}
/**
* Expect that all version ranges in `dependencies` and `devDependencies` for
* the same dependency across the entire monorepo are the same. As it is
* impossible to compare NPM version ranges, let the user decide if there are
* conflicts. (`peerDependencies` is a special case, and we handle that
* particularly for workspace packages elsewhere).
*
* @param {Yarn} Yarn - The Yarn "global".
*/
function expectConsistentDependenciesAndDevDependencies(Yarn) {
const nonPeerDependenciesByIdent = getNonPeerDependenciesByIdent(
Yarn.dependencies(),
);
for (const [
dependencyIdent,
dependenciesByRange,
] of nonPeerDependenciesByIdent.entries()) {
const dependencyRanges = [...dependenciesByRange.keys()].sort();
if (dependenciesByRange.size > 1) {
for (const dependencies of dependenciesByRange.values()) {
for (const dependency of dependencies) {
dependency.error(
`Expected version range for ${dependencyIdent} (in ${
dependency.type
}) to be consistent across monorepo. Pick one: ${inspect(
dependencyRanges,
)}`,
);
}
}
}
}
}