From 34630a55c8781b05fecff5cfa5b4b1b7f1c2c650 Mon Sep 17 00:00:00 2001 From: Ben Hollis Date: Mon, 16 Jun 2025 18:39:28 -0700 Subject: [PATCH] Node 24 --- .nvmrc | 2 +- config/content-security-policy.ts | 2 +- config/notify-webpack-plugin.ts | 2 +- config/webpack.ts | 15 +++++++++------ docker-compose.yml | 2 +- package.json | 1 + pnpm-lock.yaml | 3 +++ 7 files changed, 17 insertions(+), 10 deletions(-) diff --git a/.nvmrc b/.nvmrc index 8fdd954df9..cabf43b5dd 100644 --- a/.nvmrc +++ b/.nvmrc @@ -1 +1 @@ -22 \ No newline at end of file +24 \ No newline at end of file diff --git a/config/content-security-policy.ts b/config/content-security-policy.ts index 7d700f5bef..90a4d36d6d 100644 --- a/config/content-security-policy.ts +++ b/config/content-security-policy.ts @@ -1,5 +1,5 @@ import builder from 'content-security-policy-builder'; -import { FeatureFlags } from './feature-flags'; +import { type FeatureFlags } from './feature-flags.ts'; const SELF = "'self'"; diff --git a/config/notify-webpack-plugin.ts b/config/notify-webpack-plugin.ts index bddf3c322f..f97cee446e 100644 --- a/config/notify-webpack-plugin.ts +++ b/config/notify-webpack-plugin.ts @@ -1,6 +1,6 @@ // Originally from https://github.com/joshhunt/notify-webpack-plugin/, converted to TypeScript -import { Compiler, Stats } from 'webpack'; +import { type Compiler, type Stats } from 'webpack'; import chalk from 'chalk'; diff --git a/config/webpack.ts b/config/webpack.ts index 16535055d4..cf9ef3a5a4 100644 --- a/config/webpack.ts +++ b/config/webpack.ts @@ -21,23 +21,24 @@ import 'webpack-dev-server'; import WebpackNotifierPlugin from 'webpack-notifier'; import { InjectManifest } from 'workbox-webpack-plugin'; import zlib from 'zlib'; -import csp from './content-security-policy'; -import { makeFeatureFlags } from './feature-flags'; +import csp from './content-security-policy.ts'; +import { makeFeatureFlags } from './feature-flags.ts'; import TsconfigPathsPlugin from 'tsconfig-paths-webpack-plugin'; import { StatsWriterPlugin } from 'webpack-stats-plugin'; -import NotifyPlugin from './notify-webpack-plugin'; +import NotifyPlugin from './notify-webpack-plugin.ts'; const ASSET_NAME_PATTERN = 'static/[name]-[contenthash:6][ext]'; -import packageJson from '../package.json'; -import createWebAppManifest from './manifest-webapp'; +import packageJson from '../package.json' with { type: 'json' }; +import createWebAppManifest from './manifest-webapp.ts'; import cssnano from 'cssnano'; import sortMediaQueries from 'postcss-sort-media-queries'; -import splash from '../icons/splash.json'; +import { fileURLToPath } from 'url'; +import splash from '../icons/splash.json' with { type: 'json' }; // https://stackoverflow.com/questions/69584268/what-is-the-type-of-the-webpack-config-function-when-it-comes-to-typescript type CLIValues = boolean | string; @@ -524,6 +525,7 @@ export default (env: Env) => { if (process.env.SNORETOAST_DISABLE) { console.log("Disabling build notifications as 'SNORETOAST_DISABLE' was defined"); } else { + const __dirname = path.dirname(fileURLToPath(import.meta.url)); plugins.push( new WebpackNotifierPlugin({ title: 'DIM', @@ -564,6 +566,7 @@ export default (env: Env) => { format: 'html', outputDir: 'sonda-report', open: false, + deep: true, sources: true, gzip: false, brotli: true, diff --git a/docker-compose.yml b/docker-compose.yml index 8586d60d5b..6bbad9d7a6 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -3,7 +3,7 @@ version: '3' services: webpack: container_name: dim-webpack - image: node:18 + image: node:24 ports: - 8080:8080 working_dir: /usr/src/app diff --git a/package.json b/package.json index 2ff925ab67..1d9c5cbdb3 100644 --- a/package.json +++ b/package.json @@ -119,6 +119,7 @@ "babel-plugin-optimize-clsx": "^2.6.2", "babel-plugin-transform-imports": "^2.0.0", "browserslist": "^4.25.0", + "chalk": "^5.4.1", "clean-webpack-plugin": "^4.0.0", "compression-webpack-plugin": "^11.1.0", "content-security-policy-builder": "^2.3.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 5570c1e26b..dce589fe73 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -289,6 +289,9 @@ devDependencies: browserslist: specifier: ^4.25.0 version: 4.25.0 + chalk: + specifier: ^5.4.1 + version: 5.4.1 clean-webpack-plugin: specifier: ^4.0.0 version: 4.0.0(webpack@5.99.9)