Merge branch 'deno-2.2.0' into 'main'

Upgrade Deno to v2.2.0

See merge request soapbox-pub/ditto!679
This commit is contained in:
Alex Gleason 2025-02-19 02:04:29 +00:00
commit 3488ba622c
4 changed files with 4 additions and 14 deletions

View file

@ -1,4 +1,4 @@
image: denoland/deno:2.1.10
image: denoland/deno:2.2.0
default:
interruptible: true

View file

@ -1 +1 @@
deno 2.1.10
deno 2.2.0

View file

@ -1,4 +1,4 @@
FROM denoland/deno:2.1.10
FROM denoland/deno:2.2.0
ENV PORT 5000
WORKDIR /app

View file

@ -1,4 +1,3 @@
import Module from 'node:module';
import os from 'node:os';
import path from 'node:path';
@ -354,7 +353,7 @@ export class DittoConf {
/** Absolute path to the data directory used by Ditto. */
get dataDir(): string {
return this.env.get('DITTO_DATA_DIR') || path.join(cwd(), 'data');
return this.env.get('DITTO_DATA_DIR') || path.join(Deno.cwd(), 'data');
}
/** Absolute path of the Deno directory. */
@ -465,12 +464,3 @@ export class DittoConf {
return Number(this.env.get('STREAK_WINDOW') || 129600);
}
}
/**
* HACK: get cwd without read permissions.
* https://github.com/denoland/deno/issues/27080#issuecomment-2504150155
*/
function cwd() {
// @ts-ignore Internal method, but it does exist.
return Module._nodeModulePaths('a')[0].slice(0, -15);
}