Skip to content

Commit adb5713

Browse files
authored
ci: typecheck TS and build Docker container (#13)
* ci: typecheck TS and build Docker * fix: build extension before docker * fix: next dev and lint
1 parent 905f46d commit adb5713

10 files changed

Lines changed: 49 additions & 13 deletions

File tree

.github/workflows/release.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,15 @@ jobs:
1717
steps:
1818
- uses: actions/checkout@v4
1919

20+
- uses: actions/setup-node@v4
21+
with:
22+
node-version: 24
23+
cache: npm
24+
25+
- run: npm clean-install
26+
27+
- run: make vscode-workbench.vsix
28+
2029
- uses: docker/login-action@v3
2130
with:
2231
registry: ghcr.io

.github/workflows/test.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,15 @@ jobs:
1515

1616
- uses: actions/setup-node@v4
1717
with:
18-
node-version: 22
18+
node-version: 24
1919
cache: npm
2020

21-
- run: npm ci
21+
- run: npm clean-install
22+
23+
- run: npm run tsc
2224

2325
- run: npm run lint
26+
27+
- run: make container
28+
29+
# TODO: tests

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@ dev: container-dev
4242
# Ports bound on localhost by the container:
4343
# 3000: Nginx
4444
# 9229: Node.js debugger
45-
npx concurrently --names vscode-workbench,docker \
46-
'npm run watch:vscode-workbench' \
45+
npx concurrently --names host,docker \
46+
'npm run watch' \
4747
'$(DOCKER_RUN) -p 127.0.0.1:3000:3000 \
4848
-p 127.0.0.1:9229:9229 \
4949
-v $(CURDIR):/app/workbench:ro \

collab-server/package.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@
33
"version": "0.1.0",
44
"private": true,
55
"type": "module",
6+
"scripts": {
7+
"watch": "tsc --watch --preserveWatchOutput",
8+
"tsc": "tsc"
9+
},
610
"dependencies": {
711
"@hocuspocus/server": "^4.0.0"
812
}

collab-server/tsconfig.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"extends": "../tsconfig.json",
3+
"include": ["server.ts"]
4+
}

package.json

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,13 @@
99
],
1010
"scripts": {
1111
"prepare": "husky && next typegen && prisma generate",
12-
"watch": "concurrently --names vscode-workbench,next 'npm run watch:vscode-workbench' 'npm run dev'",
12+
"watch": "concurrently --names collab-server,vscode-workbench 'npm run watch:collab-server' 'npm run watch:vscode-workbench'",
13+
"watch:collab-server": "npm --workspace collab-server run watch",
1314
"watch:vscode-workbench": "npm --workspace vscode-workbench run watch",
14-
"dev": "next dev",
15-
"build": "npm --workspace vscode-workbench run build && next build",
16-
"start": "next start",
15+
"tsc": "concurrently --names collab-server,vscode-workbench,workbench-app 'npm run tsc:collab-server' 'npm run tsc:vscode-workbench' 'npm run tsc:workbench-app'",
16+
"tsc:collab-server": "npm --workspace collab-server run tsc",
17+
"tsc:vscode-workbench": "npm --workspace vscode-workbench run tsc",
18+
"tsc:workbench-app": "tsc",
1719
"lint": "prettier --check . && eslint"
1820
},
1921
"dependencies": {

start.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ else
3636
done
3737

3838
# Rebuild native SQLite bindings before starting in case Docker and host are different platforms
39-
cd "${SCRIPT_DIR}" && npm rebuild better-sqlite3 && npm run dev -- --port 3002 &
39+
cd "${SCRIPT_DIR}" && npm rebuild better-sqlite3 && node_modules/.bin/next dev --port 3002 &
4040
fi
4141
APP_PID=$!
4242
trap 'kill $APP_PID 2>/dev/null' EXIT

tsconfig.json

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,16 @@
2222
"@/*": ["./src/*"]
2323
}
2424
},
25-
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts", ".next/dev/types/**/*.ts", "**/*.mts"],
25+
// Subfolders of `.next/` duplicated since without that `next dev` tries to rewrite this config.
26+
"include": [
27+
".next/**/*.ts",
28+
".next/types/**/*.ts",
29+
".next/dev/types/**/*.ts",
30+
"src/**/*.ts",
31+
"src/**/*.tsx",
32+
"next-env.d.ts",
33+
"next.config.ts",
34+
"prisma.config.ts"
35+
],
2636
"exclude": ["node_modules", "branch-*"]
2737
}

vscode-workbench/package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,10 @@
2323
"watch": "concurrently --names esbuild,tsc 'npm run watch:esbuild' 'npm run watch:tsc'",
2424
"watch:esbuild": "node esbuild.mjs --watch",
2525
"watch:tsc": "tsc --noEmit --watch --preserveWatchOutput",
26+
"tsc": "tsc --noEmit",
2627
"build": "tsc --noEmit && node esbuild.mjs --production",
27-
"test": "tsc && vscode-test",
28-
"vscode:prepublish": "npm run build"
28+
"vscode:prepublish": "npm run build",
29+
"test": "tsc && vscode-test"
2930
},
3031
"devDependencies": {
3132
"@types/mocha": "^10.0",

vscode-workbench/tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@
44
"noEmit": false,
55
"outDir": "out"
66
},
7-
"include": ["src/**/*", "test/**/*"]
7+
"include": ["src/**/*.ts", "test/**/*.ts"]
88
}

0 commit comments

Comments
 (0)