Skip to content

Commit 7d3ce45

Browse files
committed
Bump dependencies and add jest test setup for editor
- allow running jest tests from `apps/editor` - allow inline require() ├── .eslintrc.json ├── apps │ ├── browser │ │ └── package.json │ ├── editor │ │ ├── jest.config.js │ │ ├── package.json │ │ ├── src │ │ │ ├── services │ │ │ │ └── websocket-server-process.ts │ │ │ └── utils │ │ │ └── shared-token.ts │ │ ├── tsconfig.json │ │ └── webpack.config.ts │ └── web │ └── package.json ├── jest.config.js ├── package.json └── packages ├── shared │ └── package.json └── ui └── package.json
1 parent 8d83aff commit 7d3ce45

7 files changed

Lines changed: 438 additions & 384 deletions

File tree

‎.eslintrc.json‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,8 @@
3232
"react/react-in-jsx-scope": "off",
3333
"@typescript-eslint/no-namespace": "off",
3434
"no-undef": "off",
35-
"no-constant-condition": ["error", { "checkLoops": false }]
35+
"no-constant-condition": ["error", { "checkLoops": false }],
36+
"@typescript-eslint/no-require-imports": "off"
3637
},
3738
"overrides": [
3839
{

‎apps/browser/package.json‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,14 @@
88
"@pmmmwh/react-refresh-webpack-plugin": "0.6.1",
99
"@svgr/webpack": "8.1.0",
1010
"@types/archiver": "6.0.3",
11-
"@types/chrome": "0.1.16",
11+
"@types/chrome": "0.3.7",
1212
"@types/jest": "29.5.14",
1313
"@types/node": "20.x",
1414
"@types/react": "18.2.60",
1515
"@types/react-dom": "18.2.19",
1616
"@types/webextension-polyfill": "0.12.4",
1717
"archiver": "6.0.1",
18-
"baseline-browser-mapping": "2.9.19",
18+
"baseline-browser-mapping": "2.11.35",
1919
"clean-webpack-plugin": "4.0.0",
2020
"copy-webpack-plugin": "12.0.2",
2121
"css-loader": "6.8.1",
@@ -28,9 +28,9 @@
2828
"ts-node": "10.9.2",
2929
"typescript": "6.0.2",
3030
"webextension-polyfill": "0.12.0",
31-
"webpack": "5.102.0",
31+
"webpack": "5.112.2",
3232
"webpack-cli": "5.1.4",
33-
"webpack-dev-server": "5.2.2"
33+
"webpack-dev-server": "5.2.7"
3434
},
3535
"dependencies": {
3636
"classnames": "2.5.1",

‎apps/editor/jest.config.js‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
/** @type {import('ts-jest').JestConfigWithTsJest} */
2+
module.exports = {
3+
...require('../../jest.config.js'),
4+
rootDir: '../../',
5+
testMatch: [
6+
'<rootDir>/apps/editor/**/*.spec.ts?(x)'
7+
]
8+
}

‎apps/editor/package.json‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@
88
"vscode:prepublish": "rimraf out && npm run compile",
99
"compile": "webpack --config ./webpack.config.ts --mode production",
1010
"watch": "webpack --config ./webpack.config.ts --watch --mode development",
11-
"bump": "node scripts/bump.js"
11+
"bump": "node scripts/bump.js",
12+
"test": "jest",
13+
"test:watch": "jest --watch"
1214
},
1315
"publisher": "robertpiosik",
1416
"homepage": "https://cwc.dev/",

‎apps/editor/src/services/websocket-server-process.ts‎

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import * as http from 'http'
33
import * as path from 'path'
44
import * as process from 'process'
55
import * as dotenv from 'dotenv'
6-
// eslint-disable-next-line @typescript-eslint/no-require-imports
76
const WebSocket = require('ws')
87
import { DEFAULT_PORT, CLIENT_TYPE } from '@shared/constants/websocket'
98

@@ -78,7 +77,6 @@ class WebSocketServer {
7877

7978
const {
8079
get_or_create_shared_token
81-
// eslint-disable-next-line @typescript-eslint/no-require-imports
8280
} = require('../utils/shared-token')
8381
const expected_token = get_or_create_shared_token()
8482

@@ -126,7 +124,6 @@ class WebSocketServer {
126124
if (challenge) {
127125
const {
128126
get_or_create_shared_token
129-
// eslint-disable-next-line @typescript-eslint/no-require-imports
130127
} = require('../utils/shared-token')
131128
const token = get_or_create_shared_token()
132129
const signature = crypto

‎package.json‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22
"name": "cwc",
33
"packageManager": "pnpm@12.17.0+sha512.b8d223ebec04b580a89ed206daa71d1bccb6a1ee1d52efa95cc3b0db75271561df8f0d8e2c43add39c5ec08018af7a8a95108e7090f95a29f88727b7a40fd53d",
44
"devDependencies": {
5-
"@types/chrome": "0.1.16",
5+
"@types/chrome": "0.3.7",
66
"@types/jest": "29.5.14",
7-
"@typescript-eslint/eslint-plugin": "8.54.0",
8-
"@typescript-eslint/parser": "8.54.0",
7+
"@typescript-eslint/eslint-plugin": "8.71.2",
8+
"@typescript-eslint/parser": "8.71.2",
99
"eslint": "8.57.1",
1010
"eslint-config-prettier": "10.1.8",
1111
"eslint-plugin-react": "7.37.5",

0 commit comments

Comments
 (0)