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

yarn2nix: support new yarn workspace json #151995

Merged
merged 1 commit into from
Mar 5, 2022
Merged

Conversation

tbaggaley
Copy link
Contributor

@tbaggaley tbaggaley commented Dec 24, 2021

Motivation for this change

Yarn.lock files for workspace projects can now feature two types of syntax for the workspaces JSON attribute - a plain array of paths or a nested JSON object of form { packages: [...], nohoist: [...]}.

Currently yarn2nix handles the former case only, causing breakages building some workspace projects.

Fixes nix-community/yarn2nix#140.

This change checks to see if the attr is not a list - if it isn't, we pull out the nested packages attribute instead.

Things done
  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandbox = true set in nix.conf? (See Nix manual)
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 22.05 Release Notes (or backporting 21.11 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
    • (Release notes changes) Ran nixos/doc/manual/md-to-db.sh to update generated release notes
  • Fits CONTRIBUTING.md.

@ofborg ofborg bot added 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux labels Dec 24, 2021
Copy link

@tgunnoe tgunnoe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi, this works for me. Thanks!

@tgunnoe
Copy link

tgunnoe commented Feb 9, 2022

@tbaggaley can you check PR #158633 and see if it relates to "supporting new yarn workspace json" as well? We can roll these together potentially.

@tomberek tomberek merged commit e3a60c1 into NixOS:master Mar 5, 2022
@Janik-Haag Janik-Haag added the 12. first-time contribution This PR is the author's first one; please be gentle! label Jun 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux 12. first-time contribution This PR is the author's first one; please be gentle!
Projects
None yet
Development

Successfully merging this pull request may close these issues.

mkYarnWorkspace fails with nohoist dependencies
4 participants