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 diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index fcac400..53327b2 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 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..6a815d4 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -22,6 +22,16 @@ "@/*": ["./src/*"] } }, - "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts", ".next/dev/types/**/*.ts", "**/*.mts"], + // 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-*"] } 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"] }