From aee81d3a7ac65e879744146ec75a6e3bfdb3177d Mon Sep 17 00:00:00 2001 From: Wojciech Nawrocki Date: Tue, 5 May 2026 21:59:53 -0400 Subject: [PATCH 1/3] ci: typecheck TS and build Docker --- .github/workflows/test.yml | 10 ++++++++-- Makefile | 4 ++-- collab-server/package.json | 4 ++++ collab-server/tsconfig.json | 4 ++++ package.json | 10 ++++++---- start.sh | 2 +- tsconfig.json | 2 +- vscode-workbench/package.json | 5 +++-- vscode-workbench/tsconfig.json | 2 +- 9 files changed, 30 insertions(+), 13 deletions(-) create mode 100644 collab-server/tsconfig.json diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index fcac400..51cbf63 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -15,9 +15,15 @@ jobs: - uses: actions/setup-node@v4 with: - node-version: 22 + node-version: 24 cache: npm - - run: npm ci + - run: npm clean-install + + - run: npm run tsc - run: npm run lint + + - run: make container + + # TODO: tests \ No newline at end of file diff --git a/Makefile b/Makefile index 2189175..cca2005 100644 --- a/Makefile +++ b/Makefile @@ -42,8 +42,8 @@ dev: container-dev # Ports bound on localhost by the container: # 3000: Nginx # 9229: Node.js debugger - npx concurrently --names vscode-workbench,docker \ - 'npm run watch:vscode-workbench' \ + npx concurrently --names host,docker \ + 'npm run watch' \ '$(DOCKER_RUN) -p 127.0.0.1:3000:3000 \ -p 127.0.0.1:9229:9229 \ -v $(CURDIR):/app/workbench:ro \ diff --git a/collab-server/package.json b/collab-server/package.json index df998a8..6c7cebb 100644 --- a/collab-server/package.json +++ b/collab-server/package.json @@ -3,6 +3,10 @@ "version": "0.1.0", "private": true, "type": "module", + "scripts": { + "watch": "tsc --watch --preserveWatchOutput", + "tsc": "tsc" + }, "dependencies": { "@hocuspocus/server": "^4.0.0" } diff --git a/collab-server/tsconfig.json b/collab-server/tsconfig.json new file mode 100644 index 0000000..2153f53 --- /dev/null +++ b/collab-server/tsconfig.json @@ -0,0 +1,4 @@ +{ + "extends": "../tsconfig.json", + "include": ["server.ts"] +} diff --git a/package.json b/package.json index bedbeae..05bb9c6 100644 --- a/package.json +++ b/package.json @@ -9,11 +9,13 @@ ], "scripts": { "prepare": "husky && next typegen && prisma generate", - "watch": "concurrently --names vscode-workbench,next 'npm run watch:vscode-workbench' 'npm run dev'", + "watch": "concurrently --names collab-server,vscode-workbench 'npm run watch:collab-server' 'npm run watch:vscode-workbench'", + "watch:collab-server": "npm --workspace collab-server run watch", "watch:vscode-workbench": "npm --workspace vscode-workbench run watch", - "dev": "next dev", - "build": "npm --workspace vscode-workbench run build && next build", - "start": "next start", + "tsc": "concurrently --names collab-server,vscode-workbench,workbench-app 'npm run tsc:collab-server' 'npm run tsc:vscode-workbench' 'npm run tsc:workbench-app'", + "tsc:collab-server": "npm --workspace collab-server run tsc", + "tsc:vscode-workbench": "npm --workspace vscode-workbench run tsc", + "tsc:workbench-app": "tsc", "lint": "prettier --check . && eslint" }, "dependencies": { diff --git a/start.sh b/start.sh index 463df3e..0b11450 100755 --- a/start.sh +++ b/start.sh @@ -36,7 +36,7 @@ else done # Rebuild native SQLite bindings before starting in case Docker and host are different platforms - cd "${SCRIPT_DIR}" && npm rebuild better-sqlite3 && npm run dev -- --port 3002 & + cd "${SCRIPT_DIR}" && npm rebuild better-sqlite3 && node_modules/.bin/next dev --port 3002 & fi APP_PID=$! trap 'kill $APP_PID 2>/dev/null' EXIT diff --git a/tsconfig.json b/tsconfig.json index 8eb71dc..6788bab 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -22,6 +22,6 @@ "@/*": ["./src/*"] } }, - "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts", ".next/dev/types/**/*.ts", "**/*.mts"], + "include": [".next/**/*.ts", "src/**/*.ts", "src/**/*.tsx", "next-env.d.ts", "next.config.ts", "prisma.config.ts"], "exclude": ["node_modules", "branch-*"] } diff --git a/vscode-workbench/package.json b/vscode-workbench/package.json index 6f840ef..574c3f6 100644 --- a/vscode-workbench/package.json +++ b/vscode-workbench/package.json @@ -23,9 +23,10 @@ "watch": "concurrently --names esbuild,tsc 'npm run watch:esbuild' 'npm run watch:tsc'", "watch:esbuild": "node esbuild.mjs --watch", "watch:tsc": "tsc --noEmit --watch --preserveWatchOutput", + "tsc": "tsc --noEmit", "build": "tsc --noEmit && node esbuild.mjs --production", - "test": "tsc && vscode-test", - "vscode:prepublish": "npm run build" + "vscode:prepublish": "npm run build", + "test": "tsc && vscode-test" }, "devDependencies": { "@types/mocha": "^10.0", diff --git a/vscode-workbench/tsconfig.json b/vscode-workbench/tsconfig.json index d27b114..23d772a 100644 --- a/vscode-workbench/tsconfig.json +++ b/vscode-workbench/tsconfig.json @@ -4,5 +4,5 @@ "noEmit": false, "outDir": "out" }, - "include": ["src/**/*", "test/**/*"] + "include": ["src/**/*.ts", "test/**/*.ts"] } From f4baadbf1c47e591d5ba9b0a35fc2a5321ef0036 Mon Sep 17 00:00:00 2001 From: Wojciech Nawrocki Date: Tue, 5 May 2026 22:01:12 -0400 Subject: [PATCH 2/3] fix: build extension before docker --- .github/workflows/release.yml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 1782388..86aa5d6 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -17,6 +17,15 @@ jobs: steps: - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: 24 + cache: npm + + - run: npm clean-install + + - run: make vscode-workbench.vsix + - uses: docker/login-action@v3 with: registry: ghcr.io From 940a4d6c448c6cb3cf10f981c2173721f105c885 Mon Sep 17 00:00:00 2001 From: Wojciech Nawrocki Date: Tue, 5 May 2026 22:07:30 -0400 Subject: [PATCH 3/3] fix: next dev and lint --- .github/workflows/test.yml | 4 ++-- tsconfig.json | 12 +++++++++++- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 51cbf63..53327b2 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -25,5 +25,5 @@ jobs: - run: npm run lint - run: make container - - # TODO: tests \ No newline at end of file + + # TODO: tests diff --git a/tsconfig.json b/tsconfig.json index 6788bab..6a815d4 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -22,6 +22,16 @@ "@/*": ["./src/*"] } }, - "include": [".next/**/*.ts", "src/**/*.ts", "src/**/*.tsx", "next-env.d.ts", "next.config.ts", "prisma.config.ts"], + // Subfolders of `.next/` duplicated since without that `next dev` tries to rewrite this config. + "include": [ + ".next/**/*.ts", + ".next/types/**/*.ts", + ".next/dev/types/**/*.ts", + "src/**/*.ts", + "src/**/*.tsx", + "next-env.d.ts", + "next.config.ts", + "prisma.config.ts" + ], "exclude": ["node_modules", "branch-*"] }