update dependencies & bump minimum node version (#1329)

- bump all dependences
- add github-actions reporter to jest
- convert (most) webpack configs to ESM
  - manifest.cjs cannot be converted since there is no native .json import until node 17
This commit is contained in:
Michael C 2022-05-24 21:14:36 -04:00
parent 4738c1897f
commit 2665327729
No known key found for this signature in database
GPG key ID: FFB04FB3B878B7B4
7 changed files with 3436 additions and 2793 deletions

View file

@ -5,4 +5,5 @@ module.exports = {
"transform": { "transform": {
"^.+\\.ts$": "ts-jest" "^.+\\.ts$": "ts-jest"
}, },
"reporters": ["github-actions"]
}; };

6152
package-lock.json generated

File diff suppressed because it is too large Load diff

View file

@ -3,39 +3,40 @@
"version": "1.0.0", "version": "1.0.0",
"description": "", "description": "",
"main": "background.js", "main": "background.js",
"type": "module",
"dependencies": { "dependencies": {
"react": "^17.0.2", "react": "^17.0.2",
"react-dom": "^17.0.2" "react-dom": "^17.0.2"
}, },
"devDependencies": { "devDependencies": {
"@types/chrome": "^0.0.180", "@types/chrome": "^0.0.188",
"@types/firefox-webext-browser": "^94.0.1", "@types/firefox-webext-browser": "^94.0.1",
"@types/jest": "^27.4.1", "@types/jest": "^27.5.1",
"@types/react": "^17.0.43", "@types/react": "^17.0.43",
"@types/react-dom": "^17.0.14", "@types/react-dom": "^17.0.14",
"@types/selenium-webdriver": "^4.0.18", "@types/selenium-webdriver": "^4.1.0",
"@types/wicg-mediasession": "^1.1.3", "@types/wicg-mediasession": "^1.1.3",
"@typescript-eslint/eslint-plugin": "^5.17.0", "@typescript-eslint/eslint-plugin": "^5.26.0",
"@typescript-eslint/parser": "^5.17.0", "@typescript-eslint/parser": "^5.26.0",
"chromedriver": "^100.0.0", "chromedriver": "^101.0.0",
"concurrently": "^7.0.0", "concurrently": "^7.2.1",
"copy-webpack-plugin": "^10.2.4", "copy-webpack-plugin": "^11.0.0",
"eslint": "^8.12.0", "eslint": "^8.16.0",
"eslint-plugin-react": "^7.29.4", "eslint-plugin-react": "^7.30.0",
"fork-ts-checker-webpack-plugin": "^7.2.1", "fork-ts-checker-webpack-plugin": "^7.2.11",
"jest": "^27.5.1", "jest": "^28.1.0",
"rimraf": "^3.0.2", "rimraf": "^3.0.2",
"schema-utils": "^4.0.0", "schema-utils": "^4.0.0",
"selenium-webdriver": "^4.1.1", "selenium-webdriver": "^4.1.2",
"speed-measure-webpack-plugin": "^1.5.0", "speed-measure-webpack-plugin": "^1.5.0",
"ts-jest": "^27.1.4", "ts-jest": "^28.0.3",
"ts-loader": "^9.2.8", "ts-loader": "^9.3.0",
"ts-node": "^10.7.0", "ts-node": "^10.8.0",
"typescript": "4.6", "typescript": "4.7",
"web-ext": "^6.8.0", "web-ext": "^6.8.0",
"webpack": "^5.64.4", "webpack": "^5.72.1",
"webpack-cli": "^4.9.2", "webpack-cli": "^4.9.2",
"webpack-merge": "^4.2.2" "webpack-merge": "^5.8.0"
}, },
"scripts": { "scripts": {
"web-run": "npm run web-run:chrome", "web-run": "npm run web-run:chrome",
@ -65,7 +66,7 @@
"lint:fix": "eslint src --fix" "lint:fix": "eslint src --fix"
}, },
"engines": { "engines": {
"node": ">=12.20.0" "node": ">=16"
}, },
"funding": [ "funding": [
{ {

View file

@ -1,12 +1,15 @@
/* eslint-disable @typescript-eslint/no-var-requires */
// eslint-disable-next-line @typescript-eslint/no-unused-vars // eslint-disable-next-line @typescript-eslint/no-unused-vars
const webpack = require("webpack"); import webpack from "webpack"
const path = require('path'); import path from "path"
const CopyPlugin = require('copy-webpack-plugin'); import { fileURLToPath } from "url"
const BuildManifest = require('./webpack.manifest'); import CopyPlugin from "copy-webpack-plugin"
const srcDir = '../src/'; import BuildManifest from "./webpack.manifest.cjs";
const fs = require("fs"); const srcDir = "../src/";
const ForkTsCheckerWebpackPlugin = require('fork-ts-checker-webpack-plugin'); import fs from "fs";
import ForkTsCheckerWebpackPlugin from "fork-ts-checker-webpack-plugin";
const __filename = fileURLToPath(import.meta.url)
const __dirname = path.dirname(__filename)
const edgeLanguages = [ const edgeLanguages = [
"de", "de",
@ -24,7 +27,7 @@ const edgeLanguages = [
"zh_CN" "zh_CN"
] ]
module.exports = env => ({ export default env => ({
entry: { entry: {
popup: path.join(__dirname, srcDir + 'popup.ts'), popup: path.join(__dirname, srcDir + 'popup.ts'),
background: path.join(__dirname, srcDir + 'background.ts'), background: path.join(__dirname, srcDir + 'background.ts'),

View file

@ -1,8 +1,7 @@
/* eslint-disable @typescript-eslint/no-var-requires */ import { merge } from "webpack-merge";
const merge = require('webpack-merge'); import common from './webpack.common.js';
const common = require('./webpack.common.js');
module.exports = env => merge(common(env), { export default env => merge(common(env), {
devtool: 'inline-source-map', devtool: 'inline-source-map',
mode: 'development' mode: 'development'
}); });

View file

@ -1,8 +1,7 @@
/* eslint-disable @typescript-eslint/no-var-requires */ import { merge } from "webpack-merge";
const merge = require('webpack-merge'); import common from './webpack.common.js';
const common = require('./webpack.common.js');
module.exports = env => { export default env => {
let mode = "production"; let mode = "production";
env.mode = mode; env.mode = mode;