Skip to content

Commit 2f92e4c

Browse files
committed
Migrate build system from Webpack to Rsbuild and update dependencies
- check for ts errors the whole codebase on every file save during 'pnpm watch' - [Pasted text] (web views are not showing up - blank screen) - in apps/editor - svg rendering is broken [Pasted text] - codicons doesn't appear (we see empty squares) ├── README.md ├── apps │ ├── browser │ │ ├── README.md │ │ └── package.json │ ├── editor │ │ ├── .vscodeignore │ │ ├── package.json │ │ ├── rsbuild.config.ts │ │ ├── src │ │ │ ├── extension.ts │ │ │ ├── services │ │ │ │ └── websocket-server-process.ts │ │ │ └── views │ │ │ ├── chats │ │ │ │ └── frontend │ │ │ │ └── App.tsx │ │ │ ├── prompt │ │ │ │ ├── backend │ │ │ │ │ ├── message-handlers │ │ │ │ │ │ └── handle-open-website.ts │ │ │ │ │ └── utils │ │ │ │ │ └── website-fetcher.ts │ │ │ │ └── frontend │ │ │ │ ├── App.tsx │ │ │ │ ├── Prompt.module.scss │ │ │ │ └── Prompt.tsx │ │ │ └── settings │ │ │ └── frontend │ │ │ ├── App.tsx │ │ │ ├── Home │ │ │ │ └── sections │ │ │ │ └── WebSection.tsx │ │ │ └── Settings.tsx │ │ ├── tsconfig.json │ │ └── webpack.config.ts │ └── web │ ├── package.json │ └── tsconfig.json ├── media │ └── README.md ├── package.json ├── packages │ ├── shared │ │ ├── package.json │ │ ├── tsconfig.build.json │ │ └── tsconfig.json │ └── ui │ ├── package.json │ ├── src │ │ ├── assets │ │ │ └── icons │ │ │ ├── ai-studio.svg │ │ │ ├── arena.svg │ │ │ ├── at-sign.svg │ │ │ ├── claude.svg │ │ │ ├── code-web-chat-logo.svg │ │ │ ├── code-web-chat-text.svg │ │ │ ├── copilot.svg │ │ │ ├── deepseek.svg │ │ │ ├── discord-logo.svg │ │ │ ├── doubao.svg │ │ │ ├── gemini.svg │ │ │ ├── github-copilot.svg │ │ │ ├── grok.svg │ │ │ ├── hash-sign.svg │ │ │ ├── hugging-chat.svg │ │ │ ├── kimi.svg │ │ │ ├── meta.svg │ │ │ ├── mistral.svg │ │ │ ├── open-webui.svg │ │ │ ├── openai.svg │ │ │ ├── openrouter.svg │ │ │ ├── qwen.svg │ │ │ ├── slash.svg │ │ │ ├── together.svg │ │ │ ├── x.svg │ │ │ ├── yuanbao.svg │ │ │ └── z-ai.svg │ │ ├── components │ │ │ └── editor │ │ │ └── common │ │ │ └── Icon │ │ │ ├── Icon.tsx │ │ │ └── index.ts │ │ └── types │ │ └── svg.d.ts │ └── tsconfig.json └── pnpm-workspace.yaml
1 parent 7bc844d commit 2f92e4c

23 files changed

Lines changed: 1689 additions & 2514 deletions

‎apps/browser/create-firefox-build.ts‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
import * as fs from 'fs'
22
import * as path from 'path'
3+
import { fileURLToPath } from 'url'
4+
5+
const __dirname = path.dirname(fileURLToPath(import.meta.url))
36

47
const manifest_path = path.join(__dirname, 'src', 'manifest.json')
58
const manifest = JSON.parse(fs.readFileSync(manifest_path, 'utf8'))

‎apps/browser/create-zip-archives.ts‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
import * as fs from 'fs'
22
import * as path from 'path'
33
import archiver from 'archiver'
4+
import { fileURLToPath } from 'url'
5+
6+
const __dirname = path.dirname(fileURLToPath(import.meta.url))
47

58
const get_version = (): string => {
69
const manifest_path = path.join(__dirname, 'src', 'manifest.json')

‎apps/browser/package.json‎

Lines changed: 10 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,18 @@
11
{
22
"name": "gemini-coder-connector",
3+
"type": "module",
34
"scripts": {
4-
"build": "webpack --mode production && ts-node create-firefox-build.ts && ts-node create-zip-archives.ts",
5+
"build": "rsbuild build && node --experimental-strip-types create-firefox-build.ts && node --experimental-strip-types create-zip-archives.ts",
56
"lint": "eslint src --ext ts,tsx",
67
"lint:fix": "eslint src --ext ts,tsx --fix"
78
},
89
"devDependencies": {
910
"@pmmmwh/react-refresh-webpack-plugin": "^0.6.1",
10-
"@svgr/webpack": "^8.1.0",
11+
"@rsbuild/core": "^1.1.12",
12+
"@rsbuild/plugin-react": "^1.0.6",
13+
"@rsbuild/plugin-sass": "^1.1.2",
14+
"@rsbuild/plugin-svgr": "^1.0.1",
15+
"@rsbuild/plugin-type-check": "^1.1.1",
1116
"@types/archiver": "^6.0.3",
1217
"@types/jest": "^29.5.14",
1318
"@types/node": "20.x",
@@ -16,24 +21,13 @@
1621
"@typescript-eslint/parser": "^8.54.0",
1722
"archiver": "^6.0.1",
1823
"baseline-browser-mapping": "^2.9.19",
19-
"clean-webpack-plugin": "^4.0.0",
20-
"copy-webpack-plugin": "^12.0.2",
21-
"css-loader": "^6.8.1",
2224
"eslint": "^8.57.1",
2325
"eslint-config-prettier": "^10.1.8",
2426
"eslint-plugin-react": "^7.37.5",
25-
"mini-css-extract-plugin": "^2.9.4",
2627
"react-refresh": "^0.17.0",
2728
"sass": "^1.93.2",
28-
"sass-loader": "^13.3.3",
29-
"style-loader": "^3.3.3",
30-
"ts-node": "^10.9.2",
31-
"ts-loader": "^9.5.4",
32-
"typescript": "^5.9.3",
33-
"webextension-polyfill": "^0.12.0",
34-
"webpack": "^5.102.0",
35-
"webpack-cli": "^5.1.4",
36-
"webpack-dev-server": "^5.2.2"
29+
"typescript": "^7.0.0",
30+
"webextension-polyfill": "^0.12.0"
3731
},
3832
"dependencies": {
3933
"@types/chrome": "^0.1.16",
@@ -42,7 +36,6 @@
4236
"@types/webextension-polyfill": "^0.12.4",
4337
"classnames": "^2.5.1",
4438
"react": "^18.2.0",
45-
"react-dom": "^18.2.0",
46-
"tsconfig-paths-webpack-plugin": "^4.2.0"
39+
"react-dom": "^18.2.0"
4740
}
4841
}

‎apps/browser/rsbuild.config.ts‎

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
import { defineConfig } from '@rsbuild/core'
2+
import { pluginReact } from '@rsbuild/plugin-react'
3+
import { pluginTypeCheck } from '@rsbuild/plugin-type-check'
4+
import { pluginSass } from '@rsbuild/plugin-sass'
5+
6+
export default defineConfig({
7+
output: {
8+
distPath: {
9+
root: 'dist',
10+
js: '',
11+
css: ''
12+
},
13+
filenameHash: false,
14+
assetPrefix: './',
15+
copy: [
16+
{ from: 'src/manifest.json', to: 'manifest.json' },
17+
{ from: 'src/icons', to: 'icons' },
18+
{ from: 'src/fonts', to: 'fonts' },
19+
{ from: 'src/views/popup/index.css', to: 'index.css' }
20+
]
21+
},
22+
html: {
23+
template({ entryName }) {
24+
if (entryName === 'popup') {
25+
return './src/views/popup/index.html'
26+
}
27+
}
28+
},
29+
source: {
30+
entry: {
31+
'send-prompt-content-script':
32+
'./src/content-scripts/send-prompt-content-script/send-prompt-content-script.ts',
33+
background: './src/background/main.ts',
34+
popup: './src/views/popup/App.tsx'
35+
}
36+
},
37+
performance: {
38+
chunkSplit: {
39+
strategy: 'all-in-one'
40+
}
41+
},
42+
plugins: [pluginReact(), pluginTypeCheck(), pluginSass()]
43+
})

‎apps/browser/src/views/popup/index.html‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,8 @@
77
content="width=device-width, initial-scale=1.0, user-scalable=no"
88
/>
99
<link rel="stylesheet" href="index.css" />
10-
<link rel="stylesheet" href="popup.css" />
1110
</head>
1211
<body>
1312
<div id="root"></div>
14-
<script src="popup.js"></script>
1513
</body>
1614
</html>

‎apps/browser/tsconfig.json‎

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,10 @@
22
"compilerOptions": {
33
"target": "ESNext",
44
"lib": ["dom", "ESNext"],
5-
"module": "commonjs",
6-
"outDir": "out",
7-
"sourceMap": true,
5+
"module": "ESNext",
6+
"noEmit": true,
7+
"rootDir": "../..",
88
"esModuleInterop": true,
9-
"baseUrl": ".",
109
"strict": true,
1110
"jsx": "react-jsx",
1211
"types": ["chrome", "webextension-polyfill", "node", "jest"],

‎apps/browser/webpack.config.ts‎

Lines changed: 0 additions & 86 deletions
This file was deleted.

‎apps/editor/.vscodeignore‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,5 @@ src
22
.gitignore
33
tsconfig.json
44
__mocks__
5-
jest.config.js
5+
jest.config.js
6+
rsbuild.config.ts

‎apps/editor/package.json‎

Lines changed: 9 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55
"version": "2026.1028.300",
66
"scripts": {
77
"build": "npx vsce package --no-dependencies",
8-
"vscode:prepublish": "rimraf out && npm run compile",
9-
"compile": "webpack --config ./webpack.config.ts --mode production",
10-
"watch": "webpack --config ./webpack.config.ts --watch --mode development",
8+
"vscode:prepublish": "npm run compile",
9+
"compile": "rsbuild build",
10+
"watch": "rsbuild dev",
1111
"lint": "eslint src --ext ts,tsx",
1212
"lint:fix": "eslint src --ext ts,tsx --fix",
1313
"test": "jest",
@@ -1312,28 +1312,22 @@
13121312
"@types/turndown": "^5.0.5",
13131313
"@typescript-eslint/eslint-plugin": "^7.18.0",
13141314
"@typescript-eslint/parser": "^7.18.0",
1315-
"clean-webpack-plugin": "^4.0.0",
1316-
"copy-webpack-plugin": "^12.0.2",
1317-
"css-loader": "^6.5.1",
1315+
"@rsbuild/core": "^1.1.12",
1316+
"@rsbuild/plugin-react": "^1.0.6",
1317+
"@rsbuild/plugin-sass": "^1.1.2",
1318+
"@rsbuild/plugin-svgr": "^1.0.1",
1319+
"@rsbuild/plugin-type-check": "^1.1.1",
13181320
"eslint": "^8.57.1",
13191321
"eslint-config-prettier": "^10.1.5",
1320-
"esbuild-loader": "^4.2.2",
13211322
"eslint-plugin-react": "^7.37.5",
1322-
"fork-ts-checker-webpack-plugin": "^9.0.2",
1323-
"mini-css-extract-plugin": "^2.9.2",
13241323
"sass-embedded": "^1.89.2",
1325-
"sass-loader": "^12.6.0",
1326-
"style-loader": "^3.3.4",
1327-
"ts-node": "^10.9.2",
13281324
"typed-css-modules": "^0.9.1",
1329-
"webpack": "^5.109.2",
1330-
"webpack-cli": "^6.0.1"
1325+
"typescript": "^7.0.0"
13311326
},
13321327
"dependencies": {
13331328
"@joplin/turndown": "^4.0.81",
13341329
"@joplin/turndown-plugin-gfm": "^1.0.63",
13351330
"@mozilla/readability": "^0.6.0",
1336-
"@svgr/webpack": "^8.1.0",
13371331
"@vscode/codicons": "^0.0.46-38",
13381332
"axios": "^1.18.1",
13391333
"bufferutil": "^4.0.9",

0 commit comments

Comments
 (0)