Repository navigation
chore(deps-dev): bump better-sqlite3 to 12.4.1 - #11683
pkuczynski wants to merge 2 commits into
Conversation
WalkthroughUpdated the devDependency for better-sqlite3 from ^8.7.0 to ^12.4.1 and updated the package generation logic to use the new version string. No public API, control flow, or error handling changes. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Suggested reviewers
Poem
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches
🧪 Generate unit tests
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (18)
🔇 Additional comments (1)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
commit: |
There was a problem hiding this comment.
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
package-lock.jsonis excluded by!**/package-lock.json
📒 Files selected for processing (1)
package.json(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (20)
- GitHub Check: tests-linux (20) / cockroachdb
- GitHub Check: tests-linux (20) / oracle
- GitHub Check: tests-linux (20) / sqljs
- GitHub Check: tests-linux (20) / sqlite
- GitHub Check: tests-linux (20) / better-sqlite3
- GitHub Check: tests-linux (18) / sap
- GitHub Check: tests-linux (18) / sqlite
- GitHub Check: tests-linux (18) / oracle
- GitHub Check: tests-linux (18) / mysql_mariadb
- GitHub Check: tests-linux (18) / postgres (17)
- GitHub Check: tests-linux (18) / postgres (14)
- GitHub Check: tests-linux (18) / sqljs
- GitHub Check: tests-linux (18) / better-sqlite3
- GitHub Check: tests-linux (18) / mongodb
- GitHub Check: tests-linux (18) / mssql
- GitHub Check: tests-linux (18) / mysql_mariadb_latest
- GitHub Check: tests-windows / sqljs
- GitHub Check: tests-windows / better-sqlite3
- GitHub Check: tests-windows / sqlite
- GitHub Check: Analyze (javascript-typescript)
| "@types/source-map-support": "^0.5.10", | ||
| "@types/yargs": "^17.0.33", | ||
| "better-sqlite3": "^8.7.0", | ||
| "better-sqlite3": "^12.4.1", |
There was a problem hiding this comment.
🧩 Analysis chain
Looks compatible; please verify Node engine support and macOS prebuilds for 12.4.1
- Peer range already includes ^12.x — good.
- Risk: [email protected] may require Node >=18. Your engines field is >=16.13.0. If engines < required, dev installs will fail.
Action: verify engines and that prebuilt binaries exist for macOS 15 (Sequoia) darwin-arm64 to satisfy the PR rationale.
Run:
If engines >=18 is required, consider bumping package.json "engines.node" and aligning @types/node accordingly in a follow-up.
🏁 Script executed:
#!/bin/bash
set -euo pipefail
echo "Repo engines.node:"
jq -r '.engines.node' package.json || true
echo
echo "[email protected] engines (npm registry):"
curl -s https://registry.npmjs.org/better-sqlite3/12.4.1 | jq -r '.engines.node // "not specified"'
echo
echo "Release assets for darwin prebuilds (better-sqlite3 v12.4.1):"
gh release view v12.4.1 -R JoshuaWise/better-sqlite3 --json assets --jq '.assets[].name' | rg -nP '(?i)darwin|mac' -n -C0 || echo "No darwin assets detected (could indicate build-at-install or different naming)."Length of output: 1785
Action: align Node engine or change better-sqlite3
Repo package.json declares "engines.node": ">=16.13.0" but [email protected] requires "20.x || 22.x || 23.x || 24.x" (npm). Release assets include darwin node-v115/127/131/137 arm64/x64 prebuilds (covers those Node ranges).
- Options: bump package.json "engines.node" to >=20 (and update @types/node) OR pin/downgrade better-sqlite3 to a version compatible with Node 16/18.
- Location: package.json — engines.node and dependency "better-sqlite3" (dependency at line ~130).
| "@types/source-map-support": "^0.5.10", | ||
| "@types/yargs": "^17.0.33", | ||
| "better-sqlite3": "^8.7.0", | ||
| "better-sqlite3": "^12.4.1", |
There was a problem hiding this comment.
I'm not sure about this change, in the peerDeps we already have
"better-sqlite3": "^8.0.0 || ^9.0.0 || ^10.0.0 || ^11.0.0 || ^12.0.0",
🤔
cc @alumni
There was a problem hiding this comment.
Yes, this is for peer deps. The one I made was for dev deps. Version 8.7.0 is not distributed as binary anymore and requires compilation from source, at least on macOS Tahoe. So is it worth to be base for our tests, or would it be better to test with the latest version? I would vote for the second option. Alternatively we could (and probably should) setup testing for the whole supported matrix in CI. But for local dev, I would stick with the latest as it will always get most support.
There was a problem hiding this comment.
The reason we didn't do this in the past was because we are still officially supporting Node.js 16, so we wanted the tests to be able to run on that version, even if we removed them from the CI.
[email protected] requires Node.js 20 and higher. We'll drop support for EOL node in our next major version, so we can upgrade this then.
There was a problem hiding this comment.
I kind of sense that answer. And how do you install version 8 on macOS? I could not find any instruction here...
There was a problem hiding this comment.
Okay, so better-sqlite3 does not compile on node 22 (probably not just on MacOS). I am still running 20 locally in this repo - mainly because I want to generate a lockfile that still works in CI (and node 22 upgrades npm - we'll probably introduce corepack at some point to avoid such issues).
What if we use ^11.10.0? It already has prebuilds for node 18 and 20 (our CI runs on that, so it won't have to compile it), even up to node 23. I also managed to build it locally on MacOS on node 24.
There was a problem hiding this comment.
I am on Node 24, and 11.x does not have binaries and needs to be compiled from scratch. And since Node 24 is the current version, I think it's fine to stick to it, as most people will start with Node 24. And then they will have issues with installing dev depenedencies to create a PR.
How about we use latest version in dev deps, but test in a matrix in CI like this: #11688
I udated InitCommand but it got me wondering, if we should not reach to npm to get the latets version compatible with current node. What do you think?
There was a problem hiding this comment.
I am on Node 24, and 11.x does not have binaries and needs to be compiled from scratch.
Compiling on MacOS/Linux is not difficult. Compiling in the CI takes time and makes the CI slow.
And since Node 24 is the current version, I think it's fine to stick to it, as most people will start with Node 24
In production most companies use the LTS version of Node.js, currently 22. The stable version is seen as a development build.
How about we use latest version in dev deps, but test in a matrix in CI like this: #11688
We had this in the past with the mssql driver and we realized it does not bring any value and only makes the CI slow.
I udated InitCommand but it got me wondering, if we should not reach to npm to get the latets version compatible with current node.
This is not how Node.js works. We have some ideas to handle the lockfile better by pinning the package manager version using corepack, but I personally don't want to invest any effort in the 0.3.x releases in such things due to the fact that we need to keep support for old Node versions. Such things will happen in 1.0, including dropping support for old better-sqlite3. But until then, we can't use 12.x.
There was a problem hiding this comment.
Compiling on MacOS/Linux is not difficult.
Not in this example, as it requires setting up Python env, so pain in the neck...
In production most companies use the LTS version of Node.js, currently 22.
Depends on the company. In most of those I worked for, current Node was always selected as the prime env...
We had this in the past with the mssql driver and we realized it does not bring any value and only makes the CI slow.
Yes, this would be the downside for too many jobs. It's either CI testing or users...
This is not how Node.js works.
Maybe you misunderstood what I was saying. I didn't refered to package.json but to to command which generates one when you call init (this is what InitCommand does, right?).
And updating devDependencies, which is proposed in this PR does not mean dropping support for older node, as the better-sqlite3 would not be installed for the end users. It's only for developers like me, right?
Feel free to close this PR if you feel it's unwanted. No offence taken :)
There was a problem hiding this comment.
Maybe you misunderstood what I was saying
Aaaah you meant to get the version of better-sqlite3 from npm for the nodejs version that the user has. Sorry, I thought you meant to request smth from the nodejs team. Honestly, I'd don't like the init command at all and I'd remove it in the next major version if it were just for me. We have to talk about it with the rest of the maintainers, but it has little value nowadays.
Feel free to close this PR if you feel it's unwanted. No offence taken :)
For the better-sqlite3 version used as dev dependency, v11 is okay for most of the things, just v12 will make the current workflows slower. So no need to close this PR. We can merge it with v11 into 0.3 or with v12 into the next major.
We will have a meeting on Monday and talk about the next major, we'd like to start introducing breaking changes (removing deprecations, dropping support for old versions etc.) that are necessary to continue maintaining this repo.
BTW, I see you have quite a few PRs open, if you are interesting in contributing more feel free to reach out on Discord ;)
There was a problem hiding this comment.
Aaaah you meant to get the version of better-sqlite3 from npm for the nodejs version that the user has.
Yeah, that's what I meant :) It does not make sense to propose user 8.x when user is already on node 22 or 24, since it would not even install. As we fund out in case of this PR :)
BTW, I see you have quite a few PRs open, if you are interesting in contributing more feel free to reach out on Discord ;)
Yeah, that was my intent to contribute a bit more :) I will reach out on Discord, sure. I am already there...
|
#11382 was merged into |
Description of change
There are no binaries provided for macOS Tahoe and compiling package from source requires extensive setup, which is cumbersome. I propose we move forward with
better-sqlite3to make it easier for developers to contribute.Pull-Request Checklist
masterbranchFixes #00000Summary by CodeRabbit
Chores
Documentation
General