Skip to content

Commit 86612cb

Browse files
authored
Migrate to vite for webui (eclipse-openvsx#1399)
* migrate to vite * rework vite migration * add named volume for node_modules * chore: convert tabs to spaces * rebase on latest master * updates * clean up docker compose wrt webui * add changelog entry * fix docker compose * add babel/core as it is defined as a peer dependency, script cleanups * compose update to ensure the server is built before starting * bump package version
1 parent 7ab465d commit 86612cb

131 files changed

Lines changed: 2628 additions & 2283 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

docker-compose.yml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -189,9 +189,9 @@ services:
189189
entrypoint: >
190190
bash -c "
191191
sleep 10;
192-
echo yes | redis-cli --user openvsx --cluster create
193-
redis-node-1:7000 redis-node-2:7000 redis-node-3:7000
194-
redis-node-4:7000 redis-node-5:7000 redis-node-6:7000
192+
echo yes | redis-cli --user openvsx --cluster create
193+
redis-node-1:7000 redis-node-2:7000 redis-node-3:7000
194+
redis-node-4:7000 redis-node-5:7000 redis-node-6:7000
195195
--cluster-replicas 1"
196196
profiles:
197197
- redis
@@ -225,11 +225,12 @@ services:
225225
- backend
226226

227227
webui:
228-
image: node:18
228+
image: node:22
229229
working_dir: /app
230-
command: sh -c 'yarn && yarn build && yarn build:default && yarn watch & yarn watch:default & yarn start:default'
230+
command: sh -c 'yarn install --immutable && yarn build:server && yarn watch:default & yarn start:default'
231231
volumes:
232232
- ./webui:/app
233+
- /app/node_modules
233234
ports:
234235
- 3000:3000
235236
depends_on:
@@ -239,7 +240,7 @@ services:
239240
- frontend
240241

241242
cli:
242-
image: node:18
243+
image: node:22
243244
working_dir: /app
244245
command: sh -c 'yarn && yarn watch'
245246
volumes:

webui/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
!.yarn/releases
66
!.yarn/sdks
77
!.yarn/versions
8+
/dist/
89
/lib/
910
/static/bundle.*
1011
/static/*-report.html

webui/CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@
22

33
This change log covers only the frontend library (webui) of Open VSX.
44

5+
## [v0.19.0] (unreleased)
6+
7+
### Changed
8+
9+
- Switch from webpack to vite for building the bundle ([#1399](https://github.com/eclipse/openvsx/pull/1399))
10+
511
## [v0.18.0] (Feb. 2026)
612

713
### Added

webui/Dockerfile

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
1-
FROM node:20-alpine3.17 AS builder
1+
FROM node:22-alpine3.22 AS builder
22

33
# Copy sources
4-
COPY --chown=node:node package.json tsconfig.json yarn.lock .yarnrc.yml /home/node/builder/
4+
COPY --chown=node:node package.json tsconfig.json vite.config.ts yarn.lock .yarnrc.yml /home/node/builder/
55
WORKDIR /home/node/builder
66
COPY --chown=node:node .yarn ./.yarn/
77
COPY --chown=node:node configs ./configs/
8+
COPY --chown=node:node index.html ./
89
COPY --chown=node:node src ./src/
910
COPY --chown=node:node static ./static/
1011
COPY --chown=node:node test ./test/
@@ -14,14 +15,13 @@ RUN corepack enable
1415
RUN corepack prepare yarn@stable --activate
1516
RUN yarn install --immutable
1617
RUN yarn test
17-
RUN yarn build
1818
RUN yarn build:default
1919

2020

21-
FROM node:20-alpine3.17
21+
FROM node:22-alpine3.22
2222

2323
# Copy build result to runtime directory
24-
COPY --chown=node:node --from=builder /home/node/builder/static /home/node/webui/static/
24+
COPY --chown=node:node --from=builder /home/node/builder/dist /home/node/webui/dist/
2525
COPY --chown=node:node --from=builder /home/node/builder/lib/default/server.js /home/node/webui/lib/default/
2626
WORKDIR /home/node/webui
2727

webui/configs/app.tsconfig.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"extends": "./base.tsconfig.json",
3+
"compilerOptions": {
4+
"noEmit": true
5+
},
6+
"include": [
7+
"../src/**/*"
8+
],
9+
"exclude": [
10+
"../src/default/server.ts"
11+
]
12+
}

webui/configs/base.tsconfig.json

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,24 @@
11
{
2-
"compilerOptions": {
3-
"target": "es6",
4-
"module": "es6",
5-
"moduleResolution": "node",
6-
"allowSyntheticDefaultImports": true,
7-
"lib": [
8-
"es6", "es2020.string", "dom"
9-
],
10-
"typeRoots": [
11-
"node_modules/@types", "typings"
12-
],
13-
"sourceMap": true,
14-
"declaration": true,
15-
"declarationMap": true,
16-
"noImplicitAny": true,
17-
"noImplicitThis": true,
18-
"noImplicitReturns": true,
19-
"noUnusedLocals": true,
20-
"strictNullChecks": true,
21-
"jsx": "react",
22-
"baseUrl": "./src"
23-
}
24-
}
2+
"compilerOptions": {
3+
"target": "es6",
4+
"module": "es6",
5+
"moduleResolution": "bundler",
6+
"allowSyntheticDefaultImports": true,
7+
"lib": [
8+
"es6", "es2020.string", "dom"
9+
],
10+
"typeRoots": [
11+
"node_modules/@types", "typings"
12+
],
13+
"sourceMap": true,
14+
"declaration": true,
15+
"declarationMap": true,
16+
"noImplicitAny": true,
17+
"noImplicitThis": true,
18+
"noImplicitReturns": true,
19+
"noUnusedLocals": true,
20+
"strictNullChecks": true,
21+
"jsx": "react-jsx",
22+
"baseUrl": "./src"
23+
}
24+
}

webui/configs/eslintrc.mjs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ export default [...compat.extends(
6565
"@/semi": ["error", "always"],
6666
"@stylistic/type-annotation-spacing": "warn",
6767
"react/prop-types": "off",
68+
"react/react-in-jsx-scope": ["off"],
6869
"array-bracket-spacing": ["warn", "never"],
6970

7071
"arrow-spacing": ["warn", {

webui/configs/lib.tsconfig.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"extends": "./base.tsconfig.json",
3+
"compilerOptions": {
4+
"outDir": "../lib"
5+
},
6+
"include": [
7+
"../src/**/*"
8+
],
9+
"exclude": [
10+
"../src/default/server.ts"
11+
]
12+
}

webui/configs/node.tsconfig.json

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
{
2+
"compilerOptions": {
3+
"target": "ESNext",
4+
5+
"lib": [
6+
"ESNext"
7+
],
8+
9+
"module": "ESNext",
10+
"skipLibCheck": true,
11+
12+
"moduleResolution": "bundler",
13+
"allowImportingTsExtensions": true,
14+
"moduleDetection": "force",
15+
"noEmit": true,
16+
17+
"strict": true,
18+
"noUnusedLocals": true,
19+
"noUnusedParameters": true,
20+
"noFallthroughCasesInSwitch": true
21+
},
22+
23+
"include": [
24+
"../vite.config.ts",
25+
"../configs/**.ts"
26+
]
27+
}

webui/configs/server.tsconfig.json

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
{
2-
"extends": "./base.tsconfig.json",
3-
"compilerOptions": {
4-
"module": "commonjs",
5-
"lib": ["es6"],
6-
"outDir": "../lib/default"
7-
},
8-
"files": [
9-
"../src/default/server.ts"
10-
]
11-
}
2+
"extends": "./base.tsconfig.json",
3+
"compilerOptions": {
4+
"module": "commonjs",
5+
"moduleResolution": "node",
6+
"lib": ["es6"],
7+
"skipLibCheck": true,
8+
"outDir": "../lib/default"
9+
},
10+
"include": [
11+
"../src/default/server.ts"
12+
]
13+
}

0 commit comments

Comments
 (0)