Fix bug when loading node package file. #3

Merged
jdb merged 1 commits from fix-node-packages into main 2025-07-17 19:16:34 +00:00
2 changed files with 6 additions and 5 deletions
Showing only changes of commit 4ff6d2bc95 - Show all commits
+5 -4
View File
@@ -85,7 +85,7 @@ Details:
Node: ^\s*export\s+const\s+\S*VERSION\S*\s*=\s*"(<old-version>)"\s*;?$ Node: ^\s*export\s+const\s+\S*VERSION\S*\s*=\s*"(<old-version>)"\s*;?$
""" """
const UV_VERSION = "1.2.0" const UV_VERSION = "1.2.1"
type type
LangType* = enum lNim, lNode LangType* = enum lNim, lNode
@@ -155,8 +155,9 @@ proc parseNimblePackage(dir: Path): PackageVersion =
proc parseNodePackage(dir: Path): PackageVersion = proc parseNodePackage(dir: Path): PackageVersion =
result = PackageVersion( result = PackageVersion(
file: dir / Path("package.json"), file: dir / Path("package.json"),
lang: lNode, lang: lNode)
nodePackage: parseFile($result.file))
result.nodePackage = parseFile($result.file)
if not result.nodePackage.hasKey("name") or if not result.nodePackage.hasKey("name") or
not result.nodePackage.hasKey("version") or not result.nodePackage.hasKey("version") or
@@ -174,7 +175,7 @@ proc detectAndParsePackage(dir: Path): PackageVersion =
except: except:
let nimEx = getCurrentException() let nimEx = getCurrentException()
try: result = parseNodePackage(dir) try: result = parseNodePackage(dir)
except: except Exception:
let nodeEx = getCurrentException() let nodeEx = getCurrentException()
stderr.writeLine( stderr.writeLine(
"Unable to find a package definitions file. Errors:\n\t$#\n\t$#" % "Unable to find a package definitions file. Errors:\n\t$#\n\t$#" %
+1 -1
View File
@@ -1,6 +1,6 @@
# Package # Package
version = "1.2.0" version = "1.2.1"
author = "Jonathan Bernard" author = "Jonathan Bernard"
description = "Small util to update version consistently for nim and node packages." description = "Small util to update version consistently for nim and node packages."
license = "MIT" license = "MIT"