From 5c763222e549c6239ea4b88499ac8f3274d83f9a Mon Sep 17 00:00:00 2001 From: "Julian K. Arni" Date: Fri, 13 Dec 2024 12:21:14 +0100 Subject: [PATCH] Allow not setting version in package.json This is in fact the default behavior with e.g. npx create-remix. Previously, if you created a package with that command and tried running dream2nix, you'd get a missing attribute error. --- modules/dream2nix/nodejs-granular-v3/default.nix | 2 +- modules/dream2nix/nodejs-package-lock-v3/default.nix | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/dream2nix/nodejs-granular-v3/default.nix b/modules/dream2nix/nodejs-granular-v3/default.nix index 7b527404f8..ee1a66788c 100644 --- a/modules/dream2nix/nodejs-granular-v3/default.nix +++ b/modules/dream2nix/nodejs-granular-v3/default.nix @@ -34,7 +34,7 @@ pdefs = config.nodejs-package-lock-v3.pdefs; defaultPackageName = config.nodejs-package-lock-v3.packageLock.name; - defaultPackageVersion = config.nodejs-package-lock-v3.packageLock.version; + defaultPackageVersion = config.nodejs-package-lock-v3.packageLock.version or ""; nodejs = config.deps.nodejs; diff --git a/modules/dream2nix/nodejs-package-lock-v3/default.nix b/modules/dream2nix/nodejs-package-lock-v3/default.nix index 73186e87f9..6c8bedc473 100644 --- a/modules/dream2nix/nodejs-package-lock-v3/default.nix +++ b/modules/dream2nix/nodejs-package-lock-v3/default.nix @@ -54,7 +54,7 @@ # Root level package name = entry.name; value = { - ${entry.version} = { + ${entry.version or ""} = { dependencies = getDependencies lock path entry; }; };