Skip to content

Commit 88ff318

Browse files
committed
refactor: parallelize build pipeline and simplify package config
- Run webview builds and extension bundling concurrently (~1s vs 3.3s) - Separate type-checking from build into dedicated typecheck script - Remove unused composite project references and declaration emit - Add per-package typecheck scripts, auto-discovered via pnpm -r - Unify production detection: esbuild and Vite both read NODE_ENV - Replace vscode:prepublish with explicit build in package scripts/CI - Clean up stale .gitignore and eslint ignores for packages/*/dist - Fix vi.mock("vscode") placement warning in certificate error tests
1 parent ee3f6cd commit 88ff318

File tree

14 files changed

+33
-40
lines changed

14 files changed

+33
-40
lines changed

.github/workflows/ci.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,9 @@ jobs:
118118
PACKAGE_NAME="${EXTENSION_NAME}-${{ steps.version.outputs.version }}-${SHORT_SHA}.vsix"
119119
echo "packageName=$PACKAGE_NAME" >> $GITHUB_OUTPUT
120120
121+
- name: Build extension
122+
run: pnpm build:production
123+
121124
- name: Package extension
122125
run: pnpm vsce package --no-dependencies --out "${{ steps.setup.outputs.packageName }}"
123126

.github/workflows/pre-release.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,9 @@ jobs:
5757
PACKAGE_NAME="${EXTENSION_NAME}-${{ steps.version.outputs.version }}-pre.vsix"
5858
echo "packageName=$PACKAGE_NAME" >> $GITHUB_OUTPUT
5959
60+
- name: Build extension
61+
run: pnpm build:production
62+
6063
- name: Package extension
6164
run: pnpm vsce package --no-dependencies --pre-release --out "${{ steps.setup.outputs.packageName }}"
6265

.github/workflows/release.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,9 @@ jobs:
5757
PACKAGE_NAME="${EXTENSION_NAME}-${{ steps.version.outputs.version }}.vsix"
5858
echo "packageName=$PACKAGE_NAME" >> $GITHUB_OUTPUT
5959
60+
- name: Build extension
61+
run: pnpm build:production
62+
6063
- name: Package extension
6164
run: pnpm vsce package --no-dependencies --out "${{ steps.setup.outputs.packageName }}"
6265

.gitignore

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,5 @@
88
pnpm-debug.log
99
.eslintcache
1010

11-
# Webview packages build artifacts
11+
# Workspace packages
1212
packages/*/node_modules/
13-
packages/*/dist/
14-
packages/*/*.tsbuildinfo

esbuild.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// @ts-check
22
import { context, build } from "esbuild";
33

4-
const production = process.argv.includes("--production");
4+
const production = process.env.NODE_ENV === "production";
55
const watch = process.argv.includes("--watch");
66

77
/** @type {import("esbuild").Plugin} */

eslint.config.mjs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ export default defineConfig(
1414
globalIgnores([
1515
"out/**",
1616
"dist/**",
17-
"packages/*/dist/**",
1817
"**/*.d.ts",
1918
"vitest.config.ts",
2019
"**/vite.config*.ts",

package.json

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,22 +18,22 @@
1818
"type": "commonjs",
1919
"main": "./dist/extension.js",
2020
"scripts": {
21-
"build": "pnpm build:webviews && tsc --noEmit && node esbuild.mjs",
22-
"build:production": "NODE_ENV=production pnpm build:webviews && tsc --noEmit && node esbuild.mjs --production",
23-
"build:webviews": "pnpm -r --filter \"./packages/*\" build",
21+
"build": "concurrently -g -n webviews,extension \"pnpm build:webviews\" \"node esbuild.mjs\"",
22+
"build:production": "NODE_ENV=production pnpm build",
23+
"build:webviews": "pnpm -r --filter \"./packages/*\" --parallel build",
2424
"format": "prettier --write --cache --cache-strategy content .",
2525
"format:check": "prettier --check --cache --cache-strategy content .",
2626
"lint": "eslint --cache --cache-strategy content .",
2727
"lint:fix": "pnpm lint --fix",
28-
"package": "vsce package --no-dependencies",
29-
"package:prerelease": "vsce package --pre-release --no-dependencies",
28+
"package": "pnpm build:production && vsce package --no-dependencies",
29+
"package:prerelease": "pnpm build:production && vsce package --pre-release --no-dependencies",
3030
"test": "CI=true pnpm test:extension && CI=true pnpm test:webview",
3131
"test:extension": "ELECTRON_RUN_AS_NODE=1 electron node_modules/vitest/vitest.mjs --project extension",
3232
"test:integration": "tsc -p test/integration --outDir out --noCheck && node esbuild.mjs && vscode-test",
3333
"test:webview": "vitest --project webview",
34-
"typecheck": "concurrently -g \"tsc --noEmit\" \"tsc --noEmit -p test\"",
35-
"vscode:prepublish": "pnpm build:production",
36-
"watch": "concurrently -n extension,webviews \"pnpm watch:extension\" \"pnpm watch:webviews\"",
34+
"typecheck": "concurrently -g -n extension,tests,packages \"tsc --noEmit\" \"tsc --noEmit -p test\" \"pnpm typecheck:packages\"",
35+
"typecheck:packages": "pnpm -r --filter \"./packages/*\" --parallel typecheck",
36+
"watch": "concurrently -g -n extension,webviews \"pnpm watch:extension\" \"pnpm watch:webviews\"",
3737
"watch:extension": "node esbuild.mjs --watch",
3838
"watch:webviews": "pnpm -r --filter \"./packages/*\" --parallel dev"
3939
},

packages/shared/package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@
1010
"default": "./src/index.ts"
1111
}
1212
},
13+
"scripts": {
14+
"typecheck": "tsc --noEmit"
15+
},
1316
"devDependencies": {
1417
"typescript": "catalog:"
1518
}

packages/shared/tsconfig.json

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,4 @@
11
{
22
"extends": "../tsconfig.packages.json",
3-
"compilerOptions": {
4-
"composite": true,
5-
"declaration": true,
6-
"noEmit": false,
7-
"outDir": "dist",
8-
"rootDir": "src",
9-
"tsBuildInfoFile": "dist/.tsbuildinfo"
10-
},
113
"include": ["src"]
124
}

packages/tasks/package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,9 @@
55
"private": true,
66
"type": "module",
77
"scripts": {
8-
"build": "tsc -b && vite build",
9-
"dev": "vite build --watch"
8+
"build": "vite build",
9+
"dev": "vite build --watch",
10+
"typecheck": "tsc --noEmit"
1011
},
1112
"dependencies": {
1213
"@repo/shared": "workspace:*",

0 commit comments

Comments
 (0)