Skip to content

Commit d1cfa5d

Browse files
build: upgrade node, yarn and deps (#40)
* build: upgrade node and yarn * build(deps): bump dependencies * build: maybe node v24? * test: fix tests
1 parent de9d8d1 commit d1cfa5d

File tree

7 files changed

+557
-1423
lines changed

7 files changed

+557
-1423
lines changed

.github/workflows/check.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818

1919
- uses: actions/setup-node@v4
2020
with:
21-
node-version: 20
21+
node-version: 24
2222

2323
- run: |
2424
corepack enable
@@ -54,7 +54,7 @@ jobs:
5454

5555
- uses: actions/setup-node@v4
5656
with:
57-
node-version: 22
57+
node-version: 24
5858

5959
# - uses: supercharge/[email protected]
6060
# with:
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
/* eslint-disable */
2+
//prettier-ignore
3+
module.exports = {
4+
name: "@yarnpkg/plugin-engines",
5+
factory: function (require) {
6+
var plugin=(()=>{var m=Object.defineProperty;var C=Object.getOwnPropertyDescriptor;var N=Object.getOwnPropertyNames;var P=Object.prototype.hasOwnProperty;var s=(o=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(o,{get:(r,t)=>(typeof require<"u"?require:r)[t]}):o)(function(o){if(typeof require<"u")return require.apply(this,arguments);throw new Error('Dynamic require of "'+o+'" is not supported')});var k=(o,r)=>{for(var t in r)m(o,t,{get:r[t],enumerable:!0})},j=(o,r,t,e)=>{if(r&&typeof r=="object"||typeof r=="function")for(let n of N(r))!P.call(o,n)&&n!==t&&m(o,n,{get:()=>r[n],enumerable:!(e=C(r,n))||e.enumerable});return o};var V=o=>j(m({},"__esModule",{value:!0}),o);var T={};k(T,{default:()=>S});var i=s("@yarnpkg/core");var p=class{constructor(r){this.throwWrongEngineError=(r,t)=>{let e=this.formatErrorMessage(r,t);this.throwError(e)};this.throwError=r=>{switch(this.errorReporter){case"Yarn":this.reportYarnError(r);break;case"Console":default:this.reportConsoleError(r);break}};this.reportYarnError=r=>{throw new i.ReportError(i.MessageName.UNNAMED,r)};this.reportConsoleError=r=>{console.error(r),process.exit(1)};this.formatErrorMessage=(r,t)=>{let{configuration:e}=this.project,n=i.formatUtils.applyStyle(e,i.formatUtils.pretty(e,this.engine,"green"),2),c=i.formatUtils.pretty(e,r,"cyan"),g=i.formatUtils.pretty(e,t,"cyan"),l=`The current ${n} version ${c} does not satisfy the required version ${g}.`;return i.formatUtils.pretty(e,l,"red")};this.project=r.project,this.errorReporter=r.errorReporter}};var f=s("fs"),v=s("path"),h=s("semver"),y=s("@yarnpkg/fslib"),a=s("@yarnpkg/core");var Y=".nvmrc",b=".node-version",d=class extends p{constructor(){super(...arguments);this.resolveNodeFromFileRequiredVersion=t=>{let{configuration:e,cwd:n}=this.project,c=(0,v.resolve)(y.npath.fromPortablePath(n),t),g=a.formatUtils.applyStyle(e,a.formatUtils.pretty(e,this.engine,"green"),2);if(!(0,f.existsSync)(c)){this.throwError(a.formatUtils.pretty(e,`Unable to verify the ${g} version. The ${t} file does not exist.`,"red"));return}let l=(0,f.readFileSync)(c,"utf-8").trim();if((0,h.validRange)(l))return l;let w=a.formatUtils.pretty(e,t,"yellow");this.throwError(a.formatUtils.pretty(e,`Unable to verify the ${g} version. The ${w} file contains an invalid semver range.`,"red"))}}get engine(){return"Node"}verifyEngine(t){let e=t.node;e!=null&&([Y,b].forEach(n=>{e===n&&(e=this.resolveNodeFromFileRequiredVersion(n))}),(0,h.satisfies)(process.version,e,{includePrerelease:!0})||this.throwWrongEngineError(process.version.replace(/^v/i,""),e.replace(/^v/i,"")))}};var R=s("semver"),u=s("@yarnpkg/core");var E=class extends p{get engine(){return"Yarn"}verifyEngine(r){let t=r.yarn;t!=null&&((0,R.satisfies)(u.YarnVersion,t,{includePrerelease:!0})||this.throwWrongEngineError(u.YarnVersion,t))}};var x=o=>r=>{if(process.env.PLUGIN_YARN_ENGINES_DISABLE!=null)return;let{engines:t={}}=r.getWorkspaceByCwd(r.cwd).manifest.raw,e={project:r,errorReporter:o};[new d(e),new E(e)].forEach(c=>c.verifyEngine(t))},F={hooks:{validateProject:x("Yarn"),setupScriptEnvironment:x("Console")}},S=F;return V(T);})();
7+
return plugin;
8+
}
9+
};

.yarnrc.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,18 @@
11
nodeLinker: node-modules
2+
3+
plugins:
4+
# Yarn plugin to enforce engine constraints
5+
- checksum: e5e6e2885ab0e6521b70b0af7c6d8ca2c75dcae2403706fc4600a783b339a6530a476dafb9450c9436ca4050eb6bdee9b62e6e2cebfecf1e81dd709a2480dc07
6+
path: .yarn/plugins/@yarnpkg/plugin-engines.cjs
7+
spec: "https://raw.githubusercontent.com/devoto13/yarn-plugin-engines/main/bundles/%40yarnpkg/plugin-engines.js"
8+
9+
packageExtensions:
10+
# commitlint does not configure its peer dependencies properly...
11+
"@commitlint/load@*":
12+
peerDependencies:
13+
"typescript": "*"
14+
"@types/node": "*"
15+
"@commitlint/cli@*":
16+
peerDependencies:
17+
"typescript": "*"
18+
"@types/node": "*"

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# syntax=docker/dockerfile:1
22
# https://docs.docker.com/go/dockerfile-reference/
33

4-
ARG NODE_VERSION=22.6.0
4+
ARG NODE_VERSION=24
55

66
FROM node:${NODE_VERSION}-alpine AS builder
77

package.json

Lines changed: 25 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"test": "test"
99
},
1010
"scripts": {
11-
"test": "yarn build && tsc -p test/tsconfig.json && FASTIFY_AUTOLOAD_TYPESCRIPT=1 tsx --test --experimental-test-coverage test/**/*.ts",
11+
"test": "yarn build && tsc -p test/tsconfig.json && FASTIFY_AUTOLOAD_TYPESCRIPT=1 node --test --experimental-test-coverage 'dist/test/**/*.js'",
1212
"build": "tsc",
1313
"watch": "tsc -w",
1414
"start": "fastify start -l info dist/src/app.js --options",
@@ -19,46 +19,47 @@
1919
"commitlint": "commitlint --last --strict --verbose",
2020
"prepare": "husky"
2121
},
22+
"engines": {
23+
"node": ">= 24"
24+
},
2225
"keywords": [],
2326
"author": "Flandia",
2427
"license": "MIT",
2528
"dependencies": {
2629
"@fastify/autoload": "^6.3.1",
27-
"@fastify/cors": "^11.0.1",
30+
"@fastify/cors": "^11.1.0",
2831
"@fastify/mongodb": "^9.0.2",
29-
"@fastify/sensible": "^6.0.3",
30-
"@fastify/swagger": "^9.5.1",
32+
"@fastify/sensible": "^6.0.4",
33+
"@fastify/swagger": "^9.6.1",
3134
"@fastify/swagger-ui": "^5.2.3",
3235
"@fastify/type-provider-typebox": "^5.2.0",
33-
"@scalar/fastify-api-reference": "^1.32.9",
34-
"@sinclair/typebox": "^0.34.38",
35-
"fastify": "^5.4.0",
36-
"fastify-cli": "^7.4.0",
37-
"fastify-plugin": "^5.0.1",
36+
"@scalar/fastify-api-reference": "^1.40.0",
37+
"@sinclair/typebox": "^0.34.41",
38+
"fastify": "^5.6.2",
39+
"fastify-cli": "7.4.1",
40+
"fastify-plugin": "^5.1.0",
3841
"jsonwebtoken": "^9.0.2",
3942
"jwks-rsa": "^3.2.0",
40-
"openid-client": "^6.6.2"
43+
"openid-client": "^6.8.1"
4144
},
4245
"devDependencies": {
4346
"@commitlint/cli": "^20.1.0",
4447
"@commitlint/config-conventional": "^20.0.0",
45-
"@eslint/js": "^9.31.0",
48+
"@eslint/js": "^9.39.1",
4649
"@trivago/prettier-plugin-sort-imports": "^5.2.2",
47-
"@types/jsonwebtoken": "^9",
48-
"@types/node": "^22.12.0",
49-
"c8": "^10.1.3",
50-
"concurrently": "^9.2.0",
51-
"eslint": "^9.31.0",
50+
"@types/jsonwebtoken": "^9.0.10",
51+
"@types/node": "^24.10.1",
52+
"concurrently": "^9.2.1",
53+
"eslint": "^9.39.1",
5254
"eslint-config-prettier": "^10.1.8",
53-
"eslint-plugin-prettier": "^5.5.3",
55+
"eslint-plugin-prettier": "^5.5.4",
5456
"fastify-tsconfig": "^3.0.0",
55-
"globals": "^16.3.0",
57+
"globals": "^16.5.0",
5658
"husky": "^9.1.7",
57-
"prettier": "3.6.2",
58-
"prettier-plugin-jsdoc": "^1.3.3",
59-
"tsx": "^4.20.3",
60-
"typescript": "^5.8.3",
61-
"typescript-eslint": "^8.37.0"
59+
"prettier": "3.7.4",
60+
"prettier-plugin-jsdoc": "^1.7.0",
61+
"typescript": "^5.9.3",
62+
"typescript-eslint": "^8.48.1"
6263
},
63-
"packageManager": "yarn@4.9.2+sha512.1fc009bc09d13cfd0e19efa44cbfc2b9cf6ca61482725eb35bbc5e257e093ebf4130db6dfe15d604ff4b79efd8e1e8e99b25fa7d0a6197c9f9826358d4d65c3c"
64+
"packageManager": "yarn@4.12.0+sha512.f45ab632439a67f8bc759bf32ead036a1f413287b9042726b7cc4818b7b49e14e9423ba49b18f9e06ea4941c1ad062385b1d8760a8d5091a1a31e5f6219afca8"
6465
}

test/helper.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ export type TestContext = {
1111

1212
const __filename = fileURLToPath(import.meta.url);
1313
const __dirname = path.dirname(__filename);
14-
const AppPath = path.join(__dirname, "..", "src", "app.ts");
14+
const AppPath = path.join(__dirname, "..", "src", "app.js");
1515

1616
// Fill in this config with all the configurations
1717
// needed for testing the application

0 commit comments

Comments
 (0)