chore: upgrade runtime and dependencies (#52)
All checks were successful
continuous-integration/drone/push Build is passing

Upgrade runtimes:

* `node` from 21.7.3 to 22.6.0
* `yarn` from 4.1.0 to 4.4.0

Upgrade dependencies:

* `@types/node` from 20.6.3 to 22.4.0
* `typescript` from 5.2.2 to 5.5.4

Add [`outdated`](https://github.com/mskelton/yarn-plugin-outdated) plugin.

Reviewed-on: #52
Co-authored-by: Joao P Dubas <joao.dubas+gitea@gmail.com>
Co-committed-by: Joao P Dubas <joao.dubas+gitea@gmail.com>
This commit is contained in:
João Paulo Dubas 2024-08-18 21:57:43 +00:00 committed by João Paulo Dubas
parent ba4b18c5cc
commit 189a7a95a9
11 changed files with 1794 additions and 1580 deletions

View File

@ -27,9 +27,9 @@ steps:
restore: true restore: true
- name: test - name: test
image: 'node:21.7.3-slim' image: 'node:22.6.0-slim'
commands: commands:
- yarn set version 4.1.0 - yarn set version 4.4.0
- yarn install - yarn install
- yarn run jest - yarn run jest

1346
.pnp.cjs generated

File diff suppressed because it is too large Load Diff

106
.pnp.loader.mjs generated
View File

@ -1,9 +1,12 @@
/* eslint-disable */
// @ts-nocheck
import fs from 'fs'; import fs from 'fs';
import { URL as URL$1, fileURLToPath, pathToFileURL } from 'url'; import { URL as URL$1, fileURLToPath, pathToFileURL } from 'url';
import path from 'path'; import path from 'path';
import { createHash } from 'crypto'; import { createHash } from 'crypto';
import { EOL } from 'os'; import { EOL } from 'os';
import moduleExports, { isBuiltin } from 'module'; import esmModule, { createRequire, isBuiltin } from 'module';
import assert from 'assert'; import assert from 'assert';
const SAFE_TIME = 456789e3; const SAFE_TIME = 456789e3;
@ -283,6 +286,7 @@ async function copySymlink(prelayout, postlayout, destinationFs, destination, de
} }
class FakeFS { class FakeFS {
pathUtils;
constructor(pathUtils) { constructor(pathUtils) {
this.pathUtils = pathUtils; this.pathUtils = pathUtils;
} }
@ -830,6 +834,12 @@ class ProxiedFS extends FakeFS {
rmdirSync(p, opts) { rmdirSync(p, opts) {
return this.baseFs.rmdirSync(this.mapToBase(p), opts); return this.baseFs.rmdirSync(this.mapToBase(p), opts);
} }
async rmPromise(p, opts) {
return this.baseFs.rmPromise(this.mapToBase(p), opts);
}
rmSync(p, opts) {
return this.baseFs.rmSync(this.mapToBase(p), opts);
}
async linkPromise(existingP, newP) { async linkPromise(existingP, newP) {
return this.baseFs.linkPromise(this.mapToBase(existingP), this.mapToBase(newP)); return this.baseFs.linkPromise(this.mapToBase(existingP), this.mapToBase(newP));
} }
@ -885,6 +895,7 @@ class ProxiedFS extends FakeFS {
watch(p, a, b) { watch(p, a, b) {
return this.baseFs.watch( return this.baseFs.watch(
this.mapToBase(p), this.mapToBase(p),
// @ts-expect-error
a, a,
b b
); );
@ -892,6 +903,7 @@ class ProxiedFS extends FakeFS {
watchFile(p, a, b) { watchFile(p, a, b) {
return this.baseFs.watchFile( return this.baseFs.watchFile(
this.mapToBase(p), this.mapToBase(p),
// @ts-expect-error
a, a,
b b
); );
@ -915,6 +927,7 @@ function direntToPortable(dirent) {
return portableDirent; return portableDirent;
} }
class NodeFS extends BasePortableFakeFS { class NodeFS extends BasePortableFakeFS {
realFs;
constructor(realFs = fs) { constructor(realFs = fs) {
super(); super();
this.realFs = realFs; this.realFs = realFs;
@ -1211,6 +1224,18 @@ class NodeFS extends BasePortableFakeFS {
rmdirSync(p, opts) { rmdirSync(p, opts) {
return this.realFs.rmdirSync(npath.fromPortablePath(p), opts); return this.realFs.rmdirSync(npath.fromPortablePath(p), opts);
} }
async rmPromise(p, opts) {
return await new Promise((resolve, reject) => {
if (opts) {
this.realFs.rm(npath.fromPortablePath(p), opts, this.makeCallback(resolve, reject));
} else {
this.realFs.rm(npath.fromPortablePath(p), this.makeCallback(resolve, reject));
}
});
}
rmSync(p, opts) {
return this.realFs.rmSync(npath.fromPortablePath(p), opts);
}
async linkPromise(existingP, newP) { async linkPromise(existingP, newP) {
return await new Promise((resolve, reject) => { return await new Promise((resolve, reject) => {
this.realFs.link(npath.fromPortablePath(existingP), npath.fromPortablePath(newP), this.makeCallback(resolve, reject)); this.realFs.link(npath.fromPortablePath(existingP), npath.fromPortablePath(newP), this.makeCallback(resolve, reject));
@ -1298,6 +1323,7 @@ class NodeFS extends BasePortableFakeFS {
watch(p, a, b) { watch(p, a, b) {
return this.realFs.watch( return this.realFs.watch(
npath.fromPortablePath(p), npath.fromPortablePath(p),
// @ts-expect-error
a, a,
b b
); );
@ -1305,6 +1331,7 @@ class NodeFS extends BasePortableFakeFS {
watchFile(p, a, b) { watchFile(p, a, b) {
return this.realFs.watchFile( return this.realFs.watchFile(
npath.fromPortablePath(p), npath.fromPortablePath(p),
// @ts-expect-error
a, a,
b b
); );
@ -1327,10 +1354,7 @@ const NUMBER_REGEXP = /^[0-9]+$/;
const VIRTUAL_REGEXP = /^(\/(?:[^/]+\/)*?(?:\$\$virtual|__virtual__))((?:\/((?:[^/]+-)?[a-f0-9]+)(?:\/([^/]+))?)?((?:\/.*)?))$/; const VIRTUAL_REGEXP = /^(\/(?:[^/]+\/)*?(?:\$\$virtual|__virtual__))((?:\/((?:[^/]+-)?[a-f0-9]+)(?:\/([^/]+))?)?((?:\/.*)?))$/;
const VALID_COMPONENT = /^([^/]+-)?[a-f0-9]+$/; const VALID_COMPONENT = /^([^/]+-)?[a-f0-9]+$/;
class VirtualFS extends ProxiedFS { class VirtualFS extends ProxiedFS {
constructor({ baseFs = new NodeFS() } = {}) { baseFs;
super(ppath);
this.baseFs = baseFs;
}
static makeVirtualPath(base, component, to) { static makeVirtualPath(base, component, to) {
if (ppath.basename(base) !== `__virtual__`) if (ppath.basename(base) !== `__virtual__`)
throw new Error(`Assertion failed: Virtual folders must be named "__virtual__"`); throw new Error(`Assertion failed: Virtual folders must be named "__virtual__"`);
@ -1360,6 +1384,10 @@ class VirtualFS extends ProxiedFS {
const subpath = match[5] || `.`; const subpath = match[5] || `.`;
return VirtualFS.resolveVirtual(ppath.join(target, backstep, subpath)); return VirtualFS.resolveVirtual(ppath.join(target, backstep, subpath));
} }
constructor({ baseFs = new NodeFS() } = {}) {
super(ppath);
this.baseFs = baseFs;
}
getExtractHint(hints) { getExtractHint(hints) {
return this.baseFs.getExtractHint(hints); return this.baseFs.getExtractHint(hints);
} }
@ -1403,6 +1431,8 @@ const URL = Number(process.versions.node.split('.', 1)[0]) < 20 ? URL$1 : global
const [major, minor] = process.versions.node.split(`.`).map((value) => parseInt(value, 10)); const [major, minor] = process.versions.node.split(`.`).map((value) => parseInt(value, 10));
const WATCH_MODE_MESSAGE_USES_ARRAYS = major > 19 || major === 19 && minor >= 2 || major === 18 && minor >= 13; const WATCH_MODE_MESSAGE_USES_ARRAYS = major > 19 || major === 19 && minor >= 2 || major === 18 && minor >= 13;
const HAS_LAZY_LOADED_TRANSLATORS = major === 20 && minor < 6 || major === 19 && minor >= 3; const HAS_LAZY_LOADED_TRANSLATORS = major === 20 && minor < 6 || major === 19 && minor >= 3;
const SUPPORTS_IMPORT_ATTRIBUTES = major >= 21 || major === 20 && minor >= 10 || major === 18 && minor >= 20;
const SUPPORTS_IMPORT_ATTRIBUTES_ONLY = major >= 22;
function readPackageScope(checkPath) { function readPackageScope(checkPath) {
const rootSeparatorIndex = checkPath.indexOf(npath.sep); const rootSeparatorIndex = checkPath.indexOf(npath.sep);
@ -1493,10 +1523,21 @@ async function load$1(urlString, context, nextLoad) {
const format = getFileFormat(filePath); const format = getFileFormat(filePath);
if (!format) if (!format)
return nextLoad(urlString, context, nextLoad); return nextLoad(urlString, context, nextLoad);
if (format === `json` && context.importAssertions?.type !== `json`) { if (format === `json`) {
const err = new TypeError(`[ERR_IMPORT_ASSERTION_TYPE_MISSING]: Module "${urlString}" needs an import assertion of type "json"`); if (SUPPORTS_IMPORT_ATTRIBUTES_ONLY) {
err.code = `ERR_IMPORT_ASSERTION_TYPE_MISSING`; if (context.importAttributes?.type !== `json`) {
throw err; const err = new TypeError(`[ERR_IMPORT_ATTRIBUTE_MISSING]: Module "${urlString}" needs an import attribute of "type: json"`);
err.code = `ERR_IMPORT_ATTRIBUTE_MISSING`;
throw err;
}
} else {
const type = `importAttributes` in context ? context.importAttributes?.type : context.importAssertions?.type;
if (type !== `json`) {
const err = new TypeError(`[ERR_IMPORT_ASSERTION_TYPE_MISSING]: Module "${urlString}" needs an import ${SUPPORTS_IMPORT_ATTRIBUTES ? `attribute` : `assertion`} of type "json"`);
err.code = `ERR_IMPORT_ASSERTION_TYPE_MISSING`;
throw err;
}
}
} }
if (process.env.WATCH_REPORT_DEPENDENCIES && process.send) { if (process.env.WATCH_REPORT_DEPENDENCIES && process.send) {
const pathToSend = pathToFileURL( const pathToSend = pathToFileURL(
@ -1743,8 +1784,7 @@ function resolvePackageTargetString(target, subpath, match, packageJSONUrl, base
const packagePath = new URL(".", packageJSONUrl).pathname; const packagePath = new URL(".", packageJSONUrl).pathname;
if (!StringPrototypeStartsWith(resolvedPath, packagePath)) if (!StringPrototypeStartsWith(resolvedPath, packagePath))
throwInvalidPackageTarget(match, target, packageJSONUrl, internal, base); throwInvalidPackageTarget(match, target, packageJSONUrl, internal, base);
if (subpath === "") if (subpath === "") return resolved;
return resolved;
if (RegExpPrototypeExec(invalidSegmentRegEx, subpath) !== null) { if (RegExpPrototypeExec(invalidSegmentRegEx, subpath) !== null) {
const request = pattern ? StringPrototypeReplace(match, "*", () => subpath) : match + subpath; const request = pattern ? StringPrototypeReplace(match, "*", () => subpath) : match + subpath;
throwInvalidSubpath(request, packageJSONUrl, internal, base); throwInvalidSubpath(request, packageJSONUrl, internal, base);
@ -1758,8 +1798,7 @@ function resolvePackageTargetString(target, subpath, match, packageJSONUrl, base
} }
function isArrayIndex(key) { function isArrayIndex(key) {
const keyNum = +key; const keyNum = +key;
if (`${keyNum}` !== key) if (`${keyNum}` !== key) return false;
return false;
return keyNum >= 0 && keyNum < 4294967295; return keyNum >= 0 && keyNum < 4294967295;
} }
function resolvePackageTarget(packageJSONUrl, target, subpath, packageSubpath, base, pattern, internal, conditions) { function resolvePackageTarget(packageJSONUrl, target, subpath, packageSubpath, base, pattern, internal, conditions) {
@ -1836,8 +1875,7 @@ function resolvePackageTarget(packageJSONUrl, target, subpath, packageSubpath, b
internal, internal,
conditions conditions
); );
if (resolveResult === void 0) if (resolveResult === void 0) continue;
continue;
return resolveResult; return resolveResult;
} }
} }
@ -1858,18 +1896,12 @@ function patternKeyCompare(a, b) {
const bPatternIndex = StringPrototypeIndexOf(b, "*"); const bPatternIndex = StringPrototypeIndexOf(b, "*");
const baseLenA = aPatternIndex === -1 ? a.length : aPatternIndex + 1; const baseLenA = aPatternIndex === -1 ? a.length : aPatternIndex + 1;
const baseLenB = bPatternIndex === -1 ? b.length : bPatternIndex + 1; const baseLenB = bPatternIndex === -1 ? b.length : bPatternIndex + 1;
if (baseLenA > baseLenB) if (baseLenA > baseLenB) return -1;
return -1; if (baseLenB > baseLenA) return 1;
if (baseLenB > baseLenA) if (aPatternIndex === -1) return 1;
return 1; if (bPatternIndex === -1) return -1;
if (aPatternIndex === -1) if (a.length > b.length) return -1;
return 1; if (b.length > a.length) return 1;
if (bPatternIndex === -1)
return -1;
if (a.length > b.length)
return -1;
if (b.length > a.length)
return 1;
return 0; return 0;
} }
function packageImportsResolve({ name, base, conditions, readFileSyncFn }) { function packageImportsResolve({ name, base, conditions, readFileSyncFn }) {
@ -1941,6 +1973,13 @@ function packageImportsResolve({ name, base, conditions, readFileSyncFn }) {
throwImportNotDefined(name, packageJSONUrl, base); throwImportNotDefined(name, packageJSONUrl, base);
} }
let findPnpApi = esmModule.findPnpApi;
if (!findPnpApi) {
const require = createRequire(import.meta.url);
const pnpApi = require(`./.pnp.cjs`);
pnpApi.setup();
findPnpApi = esmModule.findPnpApi;
}
const pathRegExp = /^(?![a-zA-Z]:[\\/]|\\\\|\.{0,2}(?:\/|$))((?:node:)?(?:@[^/]+\/)?[^/]+)\/*(.*|)$/; const pathRegExp = /^(?![a-zA-Z]:[\\/]|\\\\|\.{0,2}(?:\/|$))((?:node:)?(?:@[^/]+\/)?[^/]+)\/*(.*|)$/;
const isRelativeRegexp = /^\.{0,2}\//; const isRelativeRegexp = /^\.{0,2}\//;
function tryReadFile(filePath) { function tryReadFile(filePath) {
@ -1968,7 +2007,6 @@ async function resolvePrivateRequest(specifier, issuer, context, nextResolve) {
} }
} }
async function resolve$1(originalSpecifier, context, nextResolve) { async function resolve$1(originalSpecifier, context, nextResolve) {
const { findPnpApi } = moduleExports;
if (!findPnpApi || isBuiltin(originalSpecifier)) if (!findPnpApi || isBuiltin(originalSpecifier))
return nextResolve(originalSpecifier, context, nextResolve); return nextResolve(originalSpecifier, context, nextResolve);
let specifier = originalSpecifier; let specifier = originalSpecifier;
@ -2004,6 +2042,7 @@ async function resolve$1(originalSpecifier, context, nextResolve) {
try { try {
result = pnpapi.resolveRequest(specifier, issuer, { result = pnpapi.resolveRequest(specifier, issuer, {
conditions: new Set(conditions), conditions: new Set(conditions),
// TODO: Handle --experimental-specifier-resolution=node
extensions: allowLegacyResolve ? void 0 : [] extensions: allowLegacyResolve ? void 0 : []
}); });
} catch (err) { } catch (err) {
@ -2034,6 +2073,9 @@ if (!HAS_LAZY_LOADED_TRANSLATORS) {
try { try {
return fs.readFileSync(args[0], { return fs.readFileSync(args[0], {
encoding: `utf8`, encoding: `utf8`,
// @ts-expect-error - The docs says it needs to be a string but
// links to https://nodejs.org/dist/latest-v20.x/docs/api/fs.html#file-system-flags
// which says it can be a number which matches the implementation.
flag: args[1] flag: args[1]
}); });
} catch { } catch {
@ -2061,6 +2103,14 @@ if (!HAS_LAZY_LOADED_TRANSLATORS) {
stats.ino, stats.ino,
stats.size, stats.size,
stats.blocks stats.blocks
// atime sec
// atime ns
// mtime sec
// mtime ns
// ctime sec
// ctime ns
// birthtime sec
// birthtime ns
]); ]);
} catch { } catch {
} }

View File

@ -1,2 +1,2 @@
nodejs 21.7.3 nodejs 22.6.0
yarn 1.22.19 yarn 4.4.0

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

925
.yarn/releases/yarn-4.4.0.cjs vendored Executable file

File diff suppressed because one or more lines are too long

View File

@ -1 +1,6 @@
yarnPath: .yarn/releases/yarn-4.1.0.cjs plugins:
- checksum: 5e73a1acbb9741fce1e8335e243c9480ea2107b9b4b65ed7643785ddea9e3019aee254a92a853b1cd71023b16fff5b7d3afd5256fe57cd35a54f8785b8c30281
path: .yarn/plugins/@yarnpkg/plugin-outdated.cjs
spec: "https://go.mskelton.dev/yarn-outdated/v4"
yarnPath: .yarn/releases/yarn-4.4.0.cjs

View File

@ -1,10 +1,10 @@
FROM node:21.7.3-slim FROM node:22.6.0-slim
WORKDIR /opt/app WORKDIR /opt/app
RUN apt-get update \ RUN apt-get update \
&& apt-get -y install make \ && apt-get -y install make \
&& yarn set version 3.6.3 && yarn set version 4.4.0
COPY ./Makefile ./ COPY ./Makefile ./
COPY ./package.json ./ COPY ./package.json ./

View File

@ -1,12 +1,12 @@
{ {
"name": "clean-architecture", "name": "clean-architecture",
"packageManager": "yarn@4.1.0", "packageManager": "yarn@4.4.0",
"dependencies": { "dependencies": {
"@types/jest": "^29.5.4", "@types/jest": "^29.5.4",
"@types/node": "^20.6.3", "@types/node": "^22.4.0",
"jest": "^29.6.4", "jest": "^29.6.4",
"ts-jest": "^29.1.1", "ts-jest": "^29.1.1",
"ts-node": "^10.9.1", "ts-node": "^10.9.1",
"typescript": "^5.2.2" "typescript": "^5.5.4"
} }
} }

View File

@ -912,12 +912,12 @@ __metadata:
languageName: node languageName: node
linkType: hard linkType: hard
"@types/node@npm:^20.6.3": "@types/node@npm:^22.4.0":
version: 20.14.14 version: 22.4.0
resolution: "@types/node@npm:20.14.14" resolution: "@types/node@npm:22.4.0"
dependencies: dependencies:
undici-types: "npm:~5.26.4" undici-types: "npm:~6.19.2"
checksum: 10c0/4fc8d368df2b6f5497698327b30db68d7d20e32221ce7d057fb15cbd5834685b2fde0440609e4cb2204e5d305b928f008faf41b950a425f3fd55b60cb1b997cf checksum: 10c0/84cd094b19a27e0db425f1d02614e4f7ac59b5eb3b21e288c8f8d4d0a4c9ad370107bc1a649d4c2b4e810cd133feea26e0bbf7e7c617f93e9e139d6d2568cf50
languageName: node languageName: node
linkType: hard linkType: hard
@ -1352,11 +1352,11 @@ __metadata:
resolution: "clean-architecture@workspace:." resolution: "clean-architecture@workspace:."
dependencies: dependencies:
"@types/jest": "npm:^29.5.4" "@types/jest": "npm:^29.5.4"
"@types/node": "npm:^20.6.3" "@types/node": "npm:^22.4.0"
jest: "npm:^29.6.4" jest: "npm:^29.6.4"
ts-jest: "npm:^29.1.1" ts-jest: "npm:^29.1.1"
ts-node: "npm:^10.9.1" ts-node: "npm:^10.9.1"
typescript: "npm:^5.2.2" typescript: "npm:^5.5.4"
languageName: unknown languageName: unknown
linkType: soft linkType: soft
@ -3792,30 +3792,23 @@ __metadata:
languageName: node languageName: node
linkType: hard linkType: hard
"typescript@npm:^5.2.2": "typescript@npm:^5.5.4":
version: 5.3.3 version: 5.5.4
resolution: "typescript@npm:5.3.3" resolution: "typescript@npm:5.5.4"
bin: bin:
tsc: bin/tsc tsc: bin/tsc
tsserver: bin/tsserver tsserver: bin/tsserver
checksum: 10c0/e33cef99d82573624fc0f854a2980322714986bc35b9cb4d1ce736ed182aeab78e2cb32b385efa493b2a976ef52c53e20d6c6918312353a91850e2b76f1ea44f checksum: 10c0/422be60f89e661eab29ac488c974b6cc0a660fb2228003b297c3d10c32c90f3bcffc1009b43876a082515a3c376b1eefcce823d6e78982e6878408b9a923199c
languageName: node languageName: node
linkType: hard linkType: hard
"typescript@patch:typescript@npm%3A^5.2.2#optional!builtin<compat/typescript>": "typescript@patch:typescript@npm%3A^5.5.4#optional!builtin<compat/typescript>":
version: 5.3.3 version: 5.5.4
resolution: "typescript@patch:typescript@npm%3A5.3.3#optional!builtin<compat/typescript>::version=5.3.3&hash=e012d7" resolution: "typescript@patch:typescript@npm%3A5.5.4#optional!builtin<compat/typescript>::version=5.5.4&hash=379a07"
bin: bin:
tsc: bin/tsc tsc: bin/tsc
tsserver: bin/tsserver tsserver: bin/tsserver
checksum: 10c0/1d0a5f4ce496c42caa9a30e659c467c5686eae15d54b027ee7866744952547f1be1262f2d40de911618c242b510029d51d43ff605dba8fb740ec85ca2d3f9500 checksum: 10c0/73409d7b9196a5a1217b3aaad929bf76294d3ce7d6e9766dd880ece296ee91cf7d7db6b16c6c6c630ee5096eccde726c0ef17c7dfa52b01a243e57ae1f09ef07
languageName: node
linkType: hard
"undici-types@npm:~5.26.4":
version: 5.26.5
resolution: "undici-types@npm:5.26.5"
checksum: 10c0/bb673d7876c2d411b6eb6c560e0c571eef4a01c1c19925175d16e3a30c4c428181fb8d7ae802a261f283e4166a0ac435e2f505743aa9e45d893f9a3df017b501
languageName: node languageName: node
linkType: hard linkType: hard
@ -3826,6 +3819,13 @@ __metadata:
languageName: node languageName: node
linkType: hard linkType: hard
"undici-types@npm:~6.19.2":
version: 6.19.6
resolution: "undici-types@npm:6.19.6"
checksum: 10c0/9b2264c5700e7169c6c62c643aac56cd8984c5fd7e18ed31ff11780260e137f6340dee8317a2e6e0ae3c49f5e5ef6fa577ea07193cbaa535265cba76a267cae9
languageName: node
linkType: hard
"unique-filename@npm:^3.0.0": "unique-filename@npm:^3.0.0":
version: 3.0.0 version: 3.0.0
resolution: "unique-filename@npm:3.0.0" resolution: "unique-filename@npm:3.0.0"