Best way to use bun for a js service?

Keeping the binary in git tracking seems janky...
13 Replies
Percy
Percy9mo ago
Project ID: N/A
Brody
Brody9mo ago
bun is detected when there is a bun lock file, if you have any other types of lock files node will be used
BenIsenstein
BenIsenstein9mo ago
Alright, I'm realising the bun.lockb is a lockfile for dependencies A little disorienting that it's not human readable, which made me think it was the binary itself
Brody
Brody9mo ago
indeed guess it just makes it faster for bun to read
BenIsenstein
BenIsenstein9mo ago
Still including nodejs in the build step..
BenIsenstein
BenIsenstein9mo ago
No description
BenIsenstein
BenIsenstein9mo ago
it is using bun, but why include node?
Brody
Brody9mo ago
there's still lots of deps that need node present even when using bun so it's a safe assumption to include it though it's odd that node came before bun, have you done any kind of nixpacks.toml stuff?
BenIsenstein
BenIsenstein9mo ago
Here's my railway.json:
{
"$schema": "https://railway.app/railway.schema.json",
"build": {
"watchPatterns": ["**/*.ts","**/*.js","**/*.json"],
"nixpacksPlan": {
"phases": {
"setup": {
"nixPkgs": ["...","python38","gnumake","gcc"]
}
}
}
},
"deploy": {
"healthcheckPath": "/health",
"healthcheckTimeout": 10
}
}
{
"$schema": "https://railway.app/railway.schema.json",
"build": {
"watchPatterns": ["**/*.ts","**/*.js","**/*.json"],
"nixpacksPlan": {
"phases": {
"setup": {
"nixPkgs": ["...","python38","gnumake","gcc"]
}
}
}
},
"deploy": {
"healthcheckPath": "/health",
"healthcheckTimeout": 10
}
}
Brody
Brody9mo ago
okay looks fine so does it work now that you have the bun lock file?
Dayblox
Dayblox9mo ago
You can install the bun VSCode extension in order to visualize the lockfile
BenIsenstein
BenIsenstein9mo ago
Yeah it works THanks!
Brody
Brody9mo ago
no problem!