File tree Expand file tree Collapse file tree 3 files changed +100
-2
lines changed
acceptance-tests/pkg-tests-specs/sources/commands Expand file tree Collapse file tree 3 files changed +100
-2
lines changed Original file line number Diff line number Diff line change
1
+ releases :
2
+ " @yarnpkg/cli " : patch
3
+ " @yarnpkg/core " : patch
4
+
5
+ declined :
6
+ - " @yarnpkg/plugin-compat"
7
+ - " @yarnpkg/plugin-constraints"
8
+ - " @yarnpkg/plugin-dlx"
9
+ - " @yarnpkg/plugin-essentials"
10
+ - " @yarnpkg/plugin-exec"
11
+ - " @yarnpkg/plugin-file"
12
+ - " @yarnpkg/plugin-git"
13
+ - " @yarnpkg/plugin-github"
14
+ - " @yarnpkg/plugin-http"
15
+ - " @yarnpkg/plugin-init"
16
+ - " @yarnpkg/plugin-interactive-tools"
17
+ - " @yarnpkg/plugin-link"
18
+ - " @yarnpkg/plugin-nm"
19
+ - " @yarnpkg/plugin-npm"
20
+ - " @yarnpkg/plugin-npm-cli"
21
+ - " @yarnpkg/plugin-pack"
22
+ - " @yarnpkg/plugin-patch"
23
+ - " @yarnpkg/plugin-pnp"
24
+ - " @yarnpkg/plugin-pnpm"
25
+ - " @yarnpkg/plugin-stage"
26
+ - " @yarnpkg/plugin-typescript"
27
+ - " @yarnpkg/plugin-version"
28
+ - " @yarnpkg/plugin-workspace-tools"
29
+ - " @yarnpkg/builder"
30
+ - " @yarnpkg/doctor"
31
+ - " @yarnpkg/extensions"
32
+ - " @yarnpkg/nm"
33
+ - " @yarnpkg/pnpify"
34
+ - " @yarnpkg/sdks"
Original file line number Diff line number Diff line change @@ -444,6 +444,70 @@ describe(`Commands`, () => {
444
444
) ,
445
445
) ;
446
446
447
+ test (
448
+ `should support a self-referencing build dependency` ,
449
+ makeTemporaryEnv (
450
+ {
451
+ name : `foo` ,
452
+ dependencies : {
453
+ 'no-deps' : `1.0.0` ,
454
+ } ,
455
+ scripts : {
456
+ postinstall : `echo foo` ,
457
+ } ,
458
+ } ,
459
+ async ( { path, run, source} ) => {
460
+ await xfs . writeJsonPromise ( ppath . join ( path , Filename . rc ) , {
461
+ packageExtensions : {
462
+ 'no-deps@*' : {
463
+ dependencies : {
464
+ foo : `workspace:*` ,
465
+ } ,
466
+ } ,
467
+ } ,
468
+ } ) ;
469
+
470
+ await expect ( run ( `install` , `--inline-builds` ) ) . resolves . toMatchObject ( {
471
+ code : 0 ,
472
+ } ) ;
473
+ } ,
474
+ ) ,
475
+ ) ;
476
+
477
+ test (
478
+ `should support a self-referencing virtual workspace build dependency` ,
479
+ makeTemporaryMonorepoEnv (
480
+ {
481
+ workspaces : [ `packages/*` ] ,
482
+ } ,
483
+ {
484
+ 'packages/foo' : {
485
+ name : `foo` ,
486
+ peerDependencies : {
487
+ 'no-deps' : `1.0.0` ,
488
+ } ,
489
+ dependencies : {
490
+ bar : `workspace:*` ,
491
+ } ,
492
+ scripts : {
493
+ postinstall : `echo foo` ,
494
+ } ,
495
+ } ,
496
+ 'packages/bar' : {
497
+ name : `bar` ,
498
+ dependencies : {
499
+ foo : `workspace:*` ,
500
+ } ,
501
+ } ,
502
+ } ,
503
+ async ( { path, run, source} ) => {
504
+ await expect ( run ( `install` , `--inline-builds` ) ) . resolves . toMatchObject ( {
505
+ code : 0 ,
506
+ } ) ;
507
+ } ,
508
+ ) ,
509
+ ) ;
510
+
447
511
test (
448
512
`it should print a warning when using \`enableScripts: false\`` ,
449
513
makeTemporaryEnv ( {
Original file line number Diff line number Diff line change @@ -1328,7 +1328,7 @@ export class Project {
1328
1328
if ( ! resolution )
1329
1329
throw new Error ( `Assertion failed: The resolution (${ structUtils . prettyDescriptor ( this . configuration , dependency ) } ) should have been registered` ) ;
1330
1330
1331
- if ( buildablePackages . has ( resolution ) )
1331
+ if ( resolution !== locator . locatorHash && buildablePackages . has ( resolution ) )
1332
1332
return false ;
1333
1333
1334
1334
// Virtual workspaces don't have build scripts but the original might so we need to check it.
@@ -1338,7 +1338,7 @@ export class Project {
1338
1338
1339
1339
const workspace = this . tryWorkspaceByLocator ( dependencyPkg ) ;
1340
1340
if ( workspace ) {
1341
- if ( buildablePackages . has ( workspace . anchoredLocator . locatorHash ) )
1341
+ if ( workspace . anchoredLocator . locatorHash !== locator . locatorHash && buildablePackages . has ( workspace . anchoredLocator . locatorHash ) )
1342
1342
return false ;
1343
1343
1344
1344
hashesToCheck . add ( workspace . anchoredLocator . locatorHash ) ;
You can’t perform that action at this time.
0 commit comments