Skip to content

Sync your package manager to the package.json `packageManager` field based on the devenv version

Notifications You must be signed in to change notification settings

Oak-Digital/devenv-sync-pm

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 

Repository files navigation

Simple flake for syncing the package manager defined in devenv to the packageManager field in package.json on enterShell.

Usage with flakes

Add the flake to your inputs

{
    inputs = {
        # ...
        sync-pm.url = "github:Oak-Digital/devenv-sync-pm";
    };
}

Add the module (devenv-sync-pm-module) which takes pkgs and packageManager as it's inputs.

let
    pkgs = nixpkgs.legacyPackages.${system};
    packageManager = pkgs.nodePackages.pnpm;
in
{
default =
    devenv.lib.mkShell {
        inherit inputs pkgs;
        modules = [
            (sync-pm.lib.devenv-sync-pm-module {
                inherit pkgs packageManager;
            })
            # Your other modules...
        ];
    };
};

Now whenever you trigger the enterShell from devenv, the packageManager field will get updated to what is defined in nix.

About

Sync your package manager to the package.json `packageManager` field based on the devenv version

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages