diff --git a/.github/workflows/CI.yaml b/.github/workflows/CI.yaml index 73c7a976..5190d47f 100644 --- a/.github/workflows/CI.yaml +++ b/.github/workflows/CI.yaml @@ -28,7 +28,7 @@ jobs: - uses: actions/setup-node@v6 with: - node-version: 25.x + node-version: 26.x cache: npm - run: npm ci diff --git a/README.md b/README.md index 1ae340a8..4119fb65 100644 --- a/README.md +++ b/README.md @@ -30,7 +30,7 @@ Du hast 2 Optionen: [Lokale installation](#lokale-installation) und [GitHub Code ### Lokale Installation -node Version: >=25 +node Version: >=26 1. Terminal aufmachen und dorthin navigieren, wo man es downloaden möchte 2. Sichergehen, dass [Node.js](https://nodejs.org) installiert ist. Teste mit: `node --version`. Wenn es eine Versionsnummer zurückgibt, ist Node.js installiert. diff --git a/package-lock.json b/package-lock.json index 16a6b071..3d723b12 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,7 +10,6 @@ "license": "MIT", "dependencies": { "@discordjs/voice": "^0.19.2", - "@js-temporal/polyfill": "^0.5.1", "@napi-rs/canvas": "1.0.0", "@resvg/resvg-js": "^2.6.2", "@sentry/node": "^10.51.0", @@ -44,7 +43,7 @@ "oxlint-tsgolint": "^0.22.1" }, "engines": { - "node": ">=25.6.1" + "node": ">=26" } }, "node_modules/@asamuzakjp/css-color": { @@ -750,18 +749,6 @@ "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" } }, - "node_modules/@js-temporal/polyfill": { - "version": "0.5.1", - "resolved": "https://registry.npmjs.org/@js-temporal/polyfill/-/polyfill-0.5.1.tgz", - "integrity": "sha512-hloP58zRVCRSpgDxmqCWJNlizAlUgJFqG2ypq79DCvyv9tHjRYMDOcPFjzfl/A1/YxDvRCZz8wvZvmapQnKwFQ==", - "license": "ISC", - "dependencies": { - "jsbi": "^4.3.0" - }, - "engines": { - "node": ">=12" - } - }, "node_modules/@kikobeats/time-span": { "version": "1.0.10", "resolved": "https://registry.npmjs.org/@kikobeats/time-span/-/time-span-1.0.10.tgz", @@ -4155,12 +4142,6 @@ "dev": true, "license": "MIT" }, - "node_modules/jsbi": { - "version": "4.3.2", - "resolved": "https://registry.npmjs.org/jsbi/-/jsbi-4.3.2.tgz", - "integrity": "sha512-9fqMSQbhJykSeii05nxKl4m6Eqn2P6rOlYiS+C5Dr/HPIU/7yZxu5qzbs40tgaFORiw2Amd0mirjxatXYMkIew==", - "license": "Apache-2.0" - }, "node_modules/jsdom": { "version": "29.1.1", "resolved": "https://registry.npmjs.org/jsdom/-/jsdom-29.1.1.tgz", diff --git a/package.json b/package.json index c8c41f6c..639391d5 100644 --- a/package.json +++ b/package.json @@ -31,7 +31,6 @@ }, "dependencies": { "@discordjs/voice": "^0.19.2", - "@js-temporal/polyfill": "^0.5.1", "@napi-rs/canvas": "1.0.0", "@resvg/resvg-js": "^2.6.2", "@sentry/node": "^10.51.0", @@ -65,7 +64,7 @@ "oxlint-tsgolint": "^0.22.1" }, "engines": { - "node": ">=25.6.1" + "node": ">=26" }, "trustedDependencies": [ "lefthook" diff --git a/src/polyfills.test.ts b/src/polyfills.test.ts deleted file mode 100644 index 5f63c7ab..00000000 --- a/src/polyfills.test.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { describe, test } from "node:test"; - -import { expect } from "expect"; - -void describe("map polyfills", () => { - void test("getOrInsert", () => { - const m = new Map(); - expect(m.getOrInsert("hi", "lol")).toBe("lol"); - expect(m.getOrInsert("hi", "nope")).toBe("lol"); - }); - void test("getOrInsertComputed", () => { - const m = new Map(); - expect(m.getOrInsertComputed("hi", k => `${k}-lol`)).toBe("hi-lol"); - expect(m.getOrInsertComputed("hi", k => `${k}-nope`)).toBe("hi-lol"); - }); -}); diff --git a/src/polyfills.ts b/src/polyfills.ts index ec2e40c8..5630c7b9 100644 --- a/src/polyfills.ts +++ b/src/polyfills.ts @@ -1,5 +1,3 @@ -import { Temporal as PolyfillTemporal } from "@js-temporal/polyfill"; - declare global { // type polyfill for Math.sumPrecise (currently in stage 2): // https://github.com/tc39/proposal-math-sum @@ -7,53 +5,9 @@ declare global { interface Math { sumPrecise: (values: number[]) => number; } - - // https://github.com/tc39/proposal-upsert - interface Map { - getOrInsert(key: K, defaultValue: V): V; - getOrInsertComputed(key: TK, callbackFunction: (key: TK) => V): V; - } -} - -globalThis.Temporal = PolyfillTemporal as typeof Temporal; - -// TODO: Remove this once temporal is available in Node.js, see: https://github.com/nodejs/node/issues/57127 -if (typeof Date.prototype.toTemporalInstant !== "function") { - Date.prototype.toTemporalInstant = function () { - return Temporal.Instant.fromEpochMilliseconds(this.getTime()); - }; } if (typeof Math.sumPrecise !== "function") { // intentionally very cheap implementation. But does the thing. Math.sumPrecise = (values: number[]) => values.reduce((a, b) => a + b, 0); } - -// https://github.com/tc39/proposal-upsert -if (typeof Map.prototype.getOrInsert === "undefined") { - Map.prototype.getOrInsert = function (this: Map, key: K, defaultValue: V): V { - const v = this.get(key); - if (v !== undefined) { - return v; - } - - this.set(key, defaultValue); - return defaultValue; - }; -} -if (typeof Map.prototype.getOrInsertComputed === "undefined") { - Map.prototype.getOrInsertComputed = function ( - this: Map, - key: K, - callbackFunction: (key: K) => V, - ): V { - const v = this.get(key); - if (v !== undefined) { - return v; - } - - const defaultValue = callbackFunction(key); - this.set(key, defaultValue); - return defaultValue; - }; -}