Skip to content

Commit 08d7920

Browse files
Upgrade better-sqlite to move on from nodejs_20 (#710)
* upgrade better-sqlite to move on from nodejs_20 * Upgrade npm deps to latest (#711) * Upgrade safe npm dependencies - @aws-sdk/client-s3: 3.461.0 → 3.948.0 - fast-glob: 3.3.2 → 3.3.3 - fs-extra: 10.1.0 → 11.3.2 - semver: 7.5.4 → 7.7.3 - ssh2: 1.14.0 → 1.17.0 - tmp: 0.2.4 → 0.2.5 - yaml: 2.3.4 → 2.8.2 All packages are backward compatible with no breaking API changes. Tests pass successfully. * Upgrade jsonrepair to v3.13.1 and fix import syntax - jsonrepair: 2.2.1 → 3.13.1 - Changed from default export to named export: import { jsonrepair } - Updated foreign/src/Foreign/JsonRepair.js Breaking change in v3: jsonrepair changed from default export to named export. Tests pass successfully. * Upgrade tar to v7.5.2 and migrate to onReadEntry - tar: 6.2.1 → 7.5.2 - Migrated from deprecated 'onentry' to 'onReadEntry' callback - Updated foreign/src/Foreign/Tar.js Breaking change in v7: onentry callback deprecated in favor of onReadEntry. Requires Node.js 18+, compatible with Node.js 22. Tests pass successfully. * Upgrade fuse.js to v7.1.0 - fuse.js: 6.6.2 → 7.1.0 Despite the v7.0.0 'Extension changed' breaking change note, the core API remains compatible. No code changes required. Tests pass successfully. * Upgrade spdx-expression-parse to v4.0.0 - spdx-expression-parse: 3.0.1 → 4.0.0 - Added test for joinWith to ensure generated expressions are parseable Despite v4.0.0 being a major version bump with documented breaking changes around parentheses requirements, all existing usage patterns remain compatible. The generated expressions from joinWith (e.g., 'MIT AND Apache-2.0') parse correctly in v4 without modifications. Tests pass successfully, including new joinWith test. * Upgrade octokit versions to latest * use modern omit flags
1 parent 87c5900 commit 08d7920

File tree

9 files changed

+1604
-1295
lines changed

9 files changed

+1604
-1295
lines changed

app/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
"type": "module",
55
"license": "BSD-3-Clause",
66
"dependencies": {
7-
"better-sqlite3": "^8.4.0",
7+
"better-sqlite3": "^12.4.0",
88
"registry-foreign": "file:../foreign",
99
"registry-lib": "file:../lib",
10-
"yaml": "^2.2.2"
10+
"yaml": "^2.8.2"
1111
}
1212
}

flake.lock

Lines changed: 21 additions & 21 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

foreign/package.json

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,22 @@
11
{
22
"name": "registry-foreign",
3+
"type": "module",
34
"private": true,
45
"license": "BSD-3-Clause",
56
"dependencies": {
6-
"@aws-sdk/client-s3": "^3.461.0",
7-
"@octokit/plugin-retry": "^3.0.9",
8-
"@octokit/plugin-throttling": "^3.7.0",
9-
"@octokit/rest": "^18.12.0",
10-
"better-sqlite3": "^8.5.2",
11-
"fast-glob": "^3.2.11",
12-
"fs-extra": "^10.0.0",
13-
"fuse.js": "^6.6.2",
14-
"jsonrepair": "^2.2.1",
7+
"@aws-sdk/client-s3": "^3.948.0",
8+
"@octokit/plugin-retry": "^8.0.3",
9+
"@octokit/plugin-throttling": "^11.0.3",
10+
"@octokit/rest": "^22.0.1",
11+
"better-sqlite3": "^12.4.0",
12+
"fast-glob": "^3.3.3",
13+
"fs-extra": "^11.3.2",
14+
"fuse.js": "^7.1.0",
15+
"jsonrepair": "^3.13.1",
1516
"registry-lib": "file:../lib",
16-
"semver": "^7.5.2",
17-
"tar": "^6.2.1",
18-
"tmp": "^0.2.4",
19-
"yaml": "^2.3.1"
17+
"semver": "^7.7.3",
18+
"tar": "^7.5.2",
19+
"tmp": "^0.2.5",
20+
"yaml": "^2.8.2"
2021
}
2122
}

foreign/src/Foreign/JsonRepair.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import jsonrepair from "jsonrepair";
1+
import { jsonrepair } from "jsonrepair";
22

33
export const repairImpl = (onError, onSuccess, input) => {
44
try {

foreign/src/Foreign/Tar.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ export const getToplevelDirImpl = (filename) => () => {
1010
var topLevel = /^[^\/]+\/$/;
1111
return topLevel.exec(path);
1212
},
13-
onentry: (entry) => {
13+
onReadEntry: (entry) => {
1414
entries.push(entry.path);
1515
},
1616
});

lib/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"private": true,
44
"license": "BSD-3-Clause",
55
"dependencies": {
6-
"spdx-expression-parse": "^3.0.0",
7-
"ssh2": "^1.11.0"
6+
"spdx-expression-parse": "^4.0.0",
7+
"ssh2": "^1.17.0"
88
}
99
}

lib/test/Registry/License.purs

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ module Test.Registry.License (spec) where
33
import Prelude
44

55
import Data.Array as Array
6+
import Data.Either (Either(..))
67
import Data.String as String
78
import Registry.License as License
89
import Registry.Test.Assert as Assert
@@ -27,6 +28,22 @@ spec = do
2728
, Array.foldMap (append "\n - " <<< License.print) success
2829
]
2930

31+
Spec.it "joinWith creates valid parseable license expressions" do
32+
let
33+
licenses = [ License.parse "MIT", License.parse "Apache-2.0" ]
34+
{ fail, success } = Utils.partitionEithers licenses
35+
36+
unless (Array.null fail) do
37+
Assert.fail "Failed to parse test licenses"
38+
39+
let
40+
joined = License.joinWith License.And success
41+
reparsed = License.parse (License.print joined)
42+
43+
case reparsed of
44+
Left err -> Assert.fail $ "joinWith created unparseable expression: " <> License.print joined <> " - Error: " <> err
45+
Right _ -> pure unit
46+
3047
valid :: Array String
3148
valid =
3249
[ "MIT"

nix/overlay.nix

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -149,9 +149,6 @@ let
149149
};
150150
in
151151
{
152-
# Use Node.js 20 LTS for all registry components
153-
nodejs = prev.nodejs_20;
154-
155152
# Pin spago to the version we use
156153
spago = prev.spago-bin.spago-0_93_44;
157154

@@ -173,6 +170,7 @@ in
173170
version = "0.0.1";
174171
src = npmSrc;
175172
dontNpmBuild = true;
173+
npmFlags = [ "--omit=optional" ];
176174

177175
nativeBuildInputs =
178176
with prev;
@@ -183,7 +181,7 @@ in
183181
++ prev.lib.optionals prev.stdenv.isDarwin [ prev.darwin.cctools ];
184182

185183
# To update: run `nix build .#server` and copy the hash from the error
186-
npmDepsHash = "sha256-vm6k4DUDWUgPcPeym3YhA1hIg1LbHCDRBSH+7Zs52Uw=";
184+
npmDepsHash = "sha256-iWHvXmTcWr4A/VerriuewnH0qNIYBtYkQnqv1VO8Jhs=";
187185

188186
installPhase = ''
189187
mkdir -p $out

0 commit comments

Comments
 (0)