Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[rush] Fix an issue about dependency using NPM alias with workspace protocol is not selected by selectors (eg: --to .) #4731

Merged

Conversation

depressedX
Copy link

Summary

currently, when declaring dependency with NPM alias with workspace protocol workspace:, the dependency won't be picked up by selectors (eg: --to-except)

eg: "alias-for-my-controls": "workspace:my-controls@^1.0.0"

Details

2 dependencies added in package.json:

  "name": "my-app",
  "dependencies": {
    "my-toolchain": "workspace:^1.0.0",
    "alias-for-my-controls": "workspace:my-controls@^1.0.0"
  },
  ... 

when running rush list --to-except my-app
the output will only print my-toolchain, while my-controls is absent.

Starting "rush list"

my-toolchain

How it was tested

TODO

Impacted documentation

@depressedX
Copy link
Author

@microsoft-github-policy-service agree

@depressedX
Copy link
Author

noticed other codes that invoked getProjectByName like this might also have same problem? (using aliased package name to get dependency info)

for (const project of this._projects) {
project.decoupledLocalDependencies.forEach((decoupledLocalDependency: string) => {
if (!this.getProjectByName(decoupledLocalDependency)) {
throw new Error(
`In ${RushConstants.rushJsonFilename}, the "${decoupledLocalDependency}" project does not exist,` +
` but was referenced by the decoupledLocalDependencies (previously cyclicDependencyProjects) for ${project.packageName}`
);
}
});
this.versionPolicyConfiguration.validate(this.projectsByName);

@depressedX depressedX requested a review from octogonz May 28, 2024 02:42
@depressedX depressedX marked this pull request as ready for review June 12, 2024 03:59
@iclanton iclanton force-pushed the fix/alias-workspace-protocol-selector branch from 7efc865 to e0b36d4 Compare June 12, 2024 19:30
@iclanton iclanton enabled auto-merge June 12, 2024 19:30
@iclanton iclanton merged commit a3faa35 into microsoft:main Jun 12, 2024
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Closed
Development

Successfully merging this pull request may close these issues.

None yet

4 participants