diff --git a/.nvmrc b/.nvmrc index 3c95b269..ee09fac7 100644 --- a/.nvmrc +++ b/.nvmrc @@ -1 +1 @@ -v16.1.0 +v20.11.1 diff --git a/TODO.md b/TODO.md index 3f43df15..c809f252 100644 --- a/TODO.md +++ b/TODO.md @@ -1 +1,7 @@ +## Should + +- Remove NODE_OPTIONS=--openssl-legacy-provider once I stop using the current webpack version + +## Could + - Store pings in the local storage diff --git a/package-lock.json b/package-lock.json index d414bf94..1e801e33 100644 --- a/package-lock.json +++ b/package-lock.json @@ -16,6 +16,7 @@ "@babel/preset-typescript": "^7.14.5", "@frosas/eslint-config": "^5.0.0", "@sentry/browser": "^6.19.7", + "@tsconfig/node20": "^20.1.4", "@types/babel__core": "^7.1.14", "@types/chai": "^4.2.18", "@types/copy-webpack-plugin": "~6.4.1", @@ -23,7 +24,7 @@ "@types/html-webpack-plugin": "^3.2.5", "@types/mini-css-extract-plugin": "1.2", "@types/mocha": "^9.0.0", - "@types/node": "^16.18.96", + "@types/node": "^20.12.7", "@types/react": "^17.0.11", "@types/react-dom": "^17.0.7", "@types/webpack-dev-server": "^3.11.4", @@ -57,6 +58,9 @@ "webpack": "^4.46.0", "webpack-cli": "^4.7.2", "webpack-dev-server": "^3.11.2" + }, + "engines": { + "node": "^20.11.1" } }, "node_modules/@ampproject/remapping": { @@ -2154,6 +2158,12 @@ "node": ">=6" } }, + "node_modules/@tsconfig/node20": { + "version": "20.1.4", + "resolved": "https://registry.npmjs.org/@tsconfig/node20/-/node20-20.1.4.tgz", + "integrity": "sha512-sqgsT69YFeLWf5NtJ4Xq/xAF8p4ZQHlmGW74Nu2tD4+g5fAsposc4ZfaaPixVu4y01BEiDCWLRDCvDM5JOsRxg==", + "dev": true + }, "node_modules/@types/babel__core": { "version": "7.1.19", "resolved": "https://registry.npmjs.org/@types/babel__core/-/babel__core-7.1.19.tgz", @@ -2362,10 +2372,13 @@ "dev": true }, "node_modules/@types/node": { - "version": "16.18.96", - "resolved": "https://registry.npmjs.org/@types/node/-/node-16.18.96.tgz", - "integrity": "sha512-84iSqGXoO+Ha16j8pRZ/L90vDMKX04QTYMTfYeE1WrjWaZXuchBehGUZEpNgx7JnmlrIHdnABmpjrQjhCnNldQ==", - "dev": true + "version": "20.12.7", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.12.7.tgz", + "integrity": "sha512-wq0cICSkRLVaf3UGLMGItu/PtdY7oaXaI/RVU+xliKVOtRna3PRY57ZDfztpDL0n11vfymMUnXv8QwYCO7L1wg==", + "dev": true, + "dependencies": { + "undici-types": "~5.26.4" + } }, "node_modules/@types/prop-types": { "version": "15.7.5", @@ -12171,6 +12184,12 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/undici-types": { + "version": "5.26.5", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz", + "integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==", + "dev": true + }, "node_modules/unicode-canonical-property-names-ecmascript": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/unicode-canonical-property-names-ecmascript/-/unicode-canonical-property-names-ecmascript-2.0.0.tgz", @@ -15672,6 +15691,12 @@ "tslib": "^1.9.3" } }, + "@tsconfig/node20": { + "version": "20.1.4", + "resolved": "https://registry.npmjs.org/@tsconfig/node20/-/node20-20.1.4.tgz", + "integrity": "sha512-sqgsT69YFeLWf5NtJ4Xq/xAF8p4ZQHlmGW74Nu2tD4+g5fAsposc4ZfaaPixVu4y01BEiDCWLRDCvDM5JOsRxg==", + "dev": true + }, "@types/babel__core": { "version": "7.1.19", "resolved": "https://registry.npmjs.org/@types/babel__core/-/babel__core-7.1.19.tgz", @@ -15880,10 +15905,13 @@ "dev": true }, "@types/node": { - "version": "16.18.96", - "resolved": "https://registry.npmjs.org/@types/node/-/node-16.18.96.tgz", - "integrity": "sha512-84iSqGXoO+Ha16j8pRZ/L90vDMKX04QTYMTfYeE1WrjWaZXuchBehGUZEpNgx7JnmlrIHdnABmpjrQjhCnNldQ==", - "dev": true + "version": "20.12.7", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.12.7.tgz", + "integrity": "sha512-wq0cICSkRLVaf3UGLMGItu/PtdY7oaXaI/RVU+xliKVOtRna3PRY57ZDfztpDL0n11vfymMUnXv8QwYCO7L1wg==", + "dev": true, + "requires": { + "undici-types": "~5.26.4" + } }, "@types/prop-types": { "version": "15.7.5", @@ -23492,6 +23520,12 @@ "which-boxed-primitive": "^1.0.2" } }, + "undici-types": { + "version": "5.26.5", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz", + "integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==", + "dev": true + }, "unicode-canonical-property-names-ecmascript": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/unicode-canonical-property-names-ecmascript/-/unicode-canonical-property-names-ecmascript-2.0.0.tgz", diff --git a/package.json b/package.json index 0c9bd96f..a8e15cca 100644 --- a/package.json +++ b/package.json @@ -15,9 +15,12 @@ "dev-lint-typescript": "npm run lint-typescript -- --watch --preserveWatchOutput --pretty", "dev-test-unit": "onchange -ki 'src/**/*.js' -- npm run test-unit", "prepare": "husky install", - "webpack": "npm run babel-node -- node_modules/.bin/webpack", + "webpack": "NODE_OPTIONS=--openssl-legacy-provider npm run babel-node -- node_modules/.bin/webpack", "webpack-analyze": "FILE=`mktemp -t stats` && npm run -s webpack -- --mode production --profile --json > $FILE && npx webpack-bundle-analyzer $FILE dist/browser", - "webpack-dev-server": "npm run babel-node -- node_modules/.bin/webpack serve --mode development" + "webpack-dev-server": "npm run webpack -- serve --mode development" + }, + "engines": { + "node": "^20.11.1" }, "devDependencies": { "@babel/core": "^7.14.5", @@ -29,6 +32,7 @@ "@babel/preset-typescript": "^7.14.5", "@frosas/eslint-config": "^5.0.0", "@sentry/browser": "^6.19.7", + "@tsconfig/node20": "^20.1.4", "@types/babel__core": "^7.1.14", "@types/chai": "^4.2.18", "@types/copy-webpack-plugin": "~6.4.1", @@ -36,7 +40,7 @@ "@types/html-webpack-plugin": "^3.2.5", "@types/mini-css-extract-plugin": "1.2", "@types/mocha": "^9.0.0", - "@types/node": "^16.18.96", + "@types/node": "^20.12.7", "@types/react": "^17.0.11", "@types/react-dom": "^17.0.7", "@types/webpack-dev-server": "^3.11.4", diff --git a/tsconfig.json b/tsconfig.json index af1d4afc..1fbf992e 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,34 +1,20 @@ // See https://www.typescriptlang.org/v2/en/tsconfig - { + "extends": "@tsconfig/node20/tsconfig.json", "compilerOptions": { "allowJs": true, - - "checkJs": true, - - // Aim for the latest ES version. Babel will take care of transpiling to the + "checkJs": true, // Aim for the latest ES version. Babel will take care of transpiling to the // final targets. - "target": "esnext", - - // Enables webpack tree-shaking (?) and code splitting - "module": "esnext", - - // Let Babel do it + "target": "esnext", // Enables webpack tree-shaking (?) and code splitting + "module": "esnext", // Let Babel do it "jsx": "preserve", - - "moduleResolution": "node", - - // Allow importing defaults from non-ES modules + "moduleResolution": "node", // Allow importing defaults from non-ES modules "esModuleInterop": true, - - "sourceMap": true, - - // Disallow features that require cross-file information for emit + "sourceMap": true, // Disallow features that require cross-file information for emit "isolatedModules": true, - "strict": true, - - "noEmit": true + "noEmit": true, + "lib": ["dom"] }, "exclude": ["node_modules", "dist"] }