refactor: update build system and oneper script for commit SHA versioning

- Update main.yaml workflow to use reusable build-vscode-extension.yml
- Fix oneper script to properly handle commit SHA-based versioning
- Switch packages to use local file:// references for better dev experience
- Update build scripts to handle fetch package dependencies correctly
- Add VS Code task for building packages with extension

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Patrick Erichsen 2025-07-24 19:10:16 -07:00
parent f173cf4dc1
commit 0bab51eae5
13 changed files with 184 additions and 237 deletions

View file

@ -29,44 +29,65 @@ jobs:
build:
needs: check_release_name
if: needs.check_release_name.outputs.should_run == 'true' || github.event_name == 'workflow_dispatch'
strategy:
matrix:
include:
- os: windows-latest
platform: win32
arch: x64
npm_config_arch: x64
- os: windows-latest
platform: win32
arch: arm64
npm_config_arch: arm
- os: ubuntu-latest
platform: linux
arch: x64
npm_config_arch: x64
- os: ubuntu-latest
platform: linux
arch: arm64
npm_config_arch: arm64
- os: ubuntu-latest
platform: linux
arch: armhf
npm_config_arch: arm
- os: ubuntu-latest
platform: alpine
arch: x64
npm_config_arch: x64
- os: macos-13
platform: darwin
arch: x64
npm_config_arch: x64
- os: macos-13
platform: darwin
arch: arm64
npm_config_arch: arm64
runs-on: ${{ matrix.os }}
uses: ./.github/workflows/build-vscode-extension.yml
with:
platforms: |
[
{
"os": "windows-latest",
"platform": "win32",
"arch": "x64",
"npm_config_arch": "x64"
},
{
"os": "windows-latest",
"platform": "win32",
"arch": "arm64",
"npm_config_arch": "arm"
},
{
"os": "ubuntu-latest",
"platform": "linux",
"arch": "x64",
"npm_config_arch": "x64"
},
{
"os": "ubuntu-latest",
"platform": "linux",
"arch": "arm64",
"npm_config_arch": "arm64"
},
{
"os": "ubuntu-latest",
"platform": "linux",
"arch": "armhf",
"npm_config_arch": "arm"
},
{
"os": "ubuntu-latest",
"platform": "alpine",
"arch": "x64",
"npm_config_arch": "x64"
},
{
"os": "macos-13",
"platform": "darwin",
"arch": "x64",
"npm_config_arch": "x64"
},
{
"os": "macos-13",
"platform": "darwin",
"arch": "arm64",
"npm_config_arch": "arm64"
}
]
pre-release: false
secrets: inherit
check-version:
runs-on: ubuntu-latest
steps:
# 1. Check-out repository
- name: Checkout
uses: actions/checkout@v4
with:
@ -80,107 +101,6 @@ jobs:
cd extensions/vscode
node scripts/versionCheck.js
# 2. Install npm dependencies
- name: Use Node.js from .nvmrc
uses: actions/setup-node@v4
with:
node-version-file: ".nvmrc"
- name: Cache extension node_modules
uses: actions/cache@v3
with:
path: extensions/vscode/node_modules
key: ${{ runner.os }}-node-${{ hashFiles('extensions/vscode/package-lock.json') }}
- name: Cache core node_modules
uses: actions/cache@v3
with:
path: core/node_modules
key: ${{ runner.os }}-node-${{ hashFiles('core/package-lock.json') }}
- name: Cache gui node_modules
uses: actions/cache@v3
with:
path: gui/node_modules
key: ${{ runner.os }}-node-${{ hashFiles('gui/package-lock.json') }}
- name: Build packages (Windows)
run: ./scripts/build-packages.ps1
if: matrix.os == 'windows-latest'
- name: Build packages (Unix)
run: ./scripts/build-packages.sh
if: matrix.os != 'windows-latest'
- name: Install extension Dependencies
run: |
cd extensions/vscode
npm ci
env:
# https://github.com/microsoft/vscode-ripgrep/issues/9#issuecomment-643965333
GITHUB_TOKEN: ${{ secrets.CI_GITHUB_TOKEN }}
- name: Install gui Dependencies
run: |
cd gui
npm ci
# npm ci doesn't end up capturing the @lancedb/... dep because it's not in the package-lock.json
- name: Install Core Dependencies
run: |
cd core
npm ci
npm i vectordb
# - name: Run core tests
# run: |
# cd core
# npm run test
# env:
# OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
# 2.5. Pre package
- name: Set var for environment info
shell: pwsh
run: echo "target=${{ matrix.platform }}-${{ matrix.arch }}" >> $env:GITHUB_ENV
- name: Prepackage the extension
run: |
cd extensions/vscode
npm run prepackage -- --target ${{ env.target }}
# 3. Re-install esbuild (for cases that we force installed for another arch in prepackage.js)
- name: Re-install esbuild
run: |
cd extensions/vscode
npm install -f esbuild
# 4. Run tests for the extension
# - name: Install Xvfb for Linux and run tests
# run: |
# sudo apt-get install -y xvfb # Install Xvfb
# Xvfb :99 & # Start Xvfb
# export DISPLAY=:99 # Export the display number to the environment
# cd extensions/vscode
# npm run test
# if: matrix.os == 'ubuntu-latest'
# - name: Run extension tests
# run: |
# cd extensions/vscode
# npm run test
# if: matrix.os != 'ubuntu-latest'
# 5. Package the extension
- name: Package the extension
run: cd extensions/vscode && npx vsce package --no-dependencies --target ${{ env.target }}
# 6. Upload the .vsix as an artifact
- uses: actions/upload-artifact@v4
with:
name: ${{ env.target }}-vsix
path: "extensions/vscode/*.vsix"
release:
permissions:
contents: write

2
.vscode/launch.json vendored
View file

@ -18,7 +18,7 @@
],
"pauseForSourceMap": false,
"outFiles": ["${workspaceFolder}/extensions/vscode/out/extension.js"],
"preLaunchTask": "vscode-extension:build",
"preLaunchTask": "vscode-extension:build-with-packages",
"env": {
// "CONTROL_PLANE_ENV": "local",
"CONTINUE_GLOBAL_DIR": "${workspaceFolder}/extensions/.continue-debug"

20
.vscode/tasks.json vendored
View file

@ -223,6 +223,26 @@
],
"type": "shell",
"problemMatcher": []
},
{
"label": "build-packages",
"type": "shell",
"windows": { "command": "./scripts/build-packages.ps1" },
"command": "./scripts/build-packages.sh",
"problemMatcher": [],
"presentation": {
"reveal": "silent",
"panel": "shared"
}
},
{
"label": "vscode-extension:build-with-packages",
"dependsOn": [
"build-packages",
"vscode-extension:build"
],
"type": "shell",
"problemMatcher": []
}
]
}

46
core/package-lock.json generated
View file

@ -14,7 +14,7 @@
"@aws-sdk/credential-providers": "^3.778.0",
"@continuedev/config-types": "^1.0.13",
"@continuedev/config-yaml": "file:../packages/config-yaml",
"@continuedev/fetch": "^1.0.14",
"@continuedev/fetch": "file:../packages/fetch",
"@continuedev/llm-info": "^1.0.8",
"@continuedev/openai-adapters": "file:../packages/openai-adapters",
"@modelcontextprotocol/sdk": "^1.12.0",
@ -38,6 +38,7 @@
"handlebars": "^4.7.8",
"http-proxy-agent": "^7.0.1",
"https-proxy-agent": "^7.0.3",
"iconv-lite": "^0.6.3",
"ignore": "^5.3.1",
"is-localhost-ip": "^2.0.0",
"jinja-js": "0.1.8",
@ -167,17 +168,34 @@
"zod-to-json-schema": "^3.24.5"
}
},
"../packages/fetch": {
"name": "@continuedev/fetch",
"version": "1.0.15",
"license": "Apache-2.0",
"dependencies": {
"@continuedev/config-types": "^1.0.5",
"follow-redirects": "^1.15.6",
"http-proxy-agent": "^7.0.2",
"https-proxy-agent": "^7.0.5",
"node-fetch": "^3.3.2"
},
"devDependencies": {
"@types/follow-redirects": "^1.14.4",
"vitest": "^3.2.0"
}
},
"../packages/openai-adapters": {
"name": "@continuedev/openai-adapters",
"version": "1.0.45",
"version": "1.0.46",
"license": "Apache-2.0",
"dependencies": {
"@aws-sdk/client-bedrock-runtime": "^3.842.0",
"@aws-sdk/credential-providers": "^3.840.0",
"@continuedev/config-types": "^1.0.5",
"@continuedev/config-yaml": "^1.0.51",
"@continuedev/fetch": "^1.0.15",
"@continuedev/fetch": "file:../packages/fetch",
"dotenv": "^16.5.0",
"google-auth-library": "^10.1.0",
"json-schema": "^0.4.0",
"node-fetch": "^3.3.2",
"openai": "^4.104.0",
@ -185,13 +203,20 @@
"zod": "^3.24.2"
},
"devDependencies": {
"@semantic-release/changelog": "^6.0.3",
"@semantic-release/commit-analyzer": "^13.0.1",
"@semantic-release/git": "^10.0.1",
"@semantic-release/github": "^11.0.3",
"@semantic-release/npm": "^12.0.2",
"@semantic-release/release-notes-generator": "^14.0.3",
"@types/follow-redirects": "^1.14.4",
"@types/jest": "^29.5.14",
"@types/json-schema": "^7.0.15",
"cross-env": "^7.0.3",
"semantic-release": "^24.2.7",
"ts-jest": "^29.2.3",
"ts-node": "^10.9.2",
"vitest": "^1.6.1"
"vitest": "^3.2.4"
}
},
"node_modules/@75lb/deep-merge": {
@ -2918,17 +2943,8 @@
"link": true
},
"node_modules/@continuedev/fetch": {
"version": "1.0.14",
"resolved": "https://registry.npmjs.org/@continuedev/fetch/-/fetch-1.0.14.tgz",
"integrity": "sha512-r/CUwW0tt7VrjLVNeowA281aq7VQvToE+Ro9+0EhfINBMNre4eU2MbNOgbRmYCr5VkIuSnltPUDI357Kns7uCw==",
"license": "Apache-2.0",
"dependencies": {
"@continuedev/config-types": "^1.0.5",
"follow-redirects": "^1.15.6",
"http-proxy-agent": "^7.0.2",
"https-proxy-agent": "^7.0.5",
"node-fetch": "^3.3.2"
}
"resolved": "../packages/fetch",
"link": true
},
"node_modules/@continuedev/llm-info": {
"version": "1.0.8",

View file

@ -54,7 +54,7 @@
"@aws-sdk/credential-providers": "^3.778.0",
"@continuedev/config-types": "^1.0.13",
"@continuedev/config-yaml": "file:../packages/config-yaml",
"@continuedev/fetch": "^1.0.14",
"@continuedev/fetch": "file:../packages/fetch",
"@continuedev/llm-info": "^1.0.8",
"@continuedev/openai-adapters": "file:../packages/openai-adapters",
"@modelcontextprotocol/sdk": "^1.12.0",

View file

@ -718,7 +718,7 @@
},
"dependencies": {
"@continuedev/config-types": "^1.0.14",
"@continuedev/fetch": "^1.0.10",
"@continuedev/fetch": "file:../packages/fetch",
"@electron/rebuild": "^3.2.10",
"@reduxjs/toolkit": "^1.9.3",
"@vscode/ripgrep": "^1.15.9",

View file

@ -13,7 +13,7 @@
"@aws-sdk/credential-providers": "^3.840.0",
"@continuedev/config-types": "^1.0.5",
"@continuedev/config-yaml": "^1.0.51",
"@continuedev/fetch": "^1.0.15",
"@continuedev/fetch": "file:../fetch",
"dotenv": "^16.5.0",
"google-auth-library": "^10.1.0",
"json-schema": "^0.4.0",
@ -39,6 +39,25 @@
"vitest": "^3.2.4"
}
},
"../fetch": {
"name": "@continuedev/fetch",
"version": "1.0.15",
"license": "Apache-2.0",
"dependencies": {
"@continuedev/config-types": "^1.0.5",
"follow-redirects": "^1.15.6",
"http-proxy-agent": "^7.0.2",
"https-proxy-agent": "^7.0.5",
"node-fetch": "^3.3.2"
},
"devDependencies": {
"@types/follow-redirects": "^1.14.4",
"vitest": "^3.2.0"
}
},
"../packages/fetch": {
"extraneous": true
},
"node_modules/@ampproject/remapping": {
"version": "2.3.0",
"resolved": "https://registry.npmjs.org/@ampproject/remapping/-/remapping-2.3.0.tgz",
@ -1352,17 +1371,8 @@
}
},
"node_modules/@continuedev/fetch": {
"version": "1.0.15",
"resolved": "https://registry.npmjs.org/@continuedev/fetch/-/fetch-1.0.15.tgz",
"integrity": "sha512-49jLwAwAOczcFLfa2Og9+c+qxrq+Z6+p+B5BbXgHENrQIsuST1liKTXEiga5gSVAyHD+m+1Ftl4jqRq2oxMngw==",
"license": "Apache-2.0",
"dependencies": {
"@continuedev/config-types": "^1.0.5",
"follow-redirects": "^1.15.6",
"http-proxy-agent": "^7.0.2",
"https-proxy-agent": "^7.0.5",
"node-fetch": "^3.3.2"
}
"resolved": "../fetch",
"link": true
},
"node_modules/@cspotcode/source-map-support": {
"version": "0.8.1",
@ -5858,25 +5868,6 @@
"url": "https://github.com/sponsors/sindresorhus"
}
},
"node_modules/follow-redirects": {
"version": "1.15.6",
"resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.6.tgz",
"integrity": "sha512-wWN62YITEaOpSK584EZXJafH1AGpO8RVgElfkuXbTOrPX4fIfOyEpW/CsiNd8JdYrAoOvafRTOEnvsO++qCqFA==",
"funding": [
{
"type": "individual",
"url": "https://github.com/sponsors/RubenVerborgh"
}
],
"engines": {
"node": ">=4.0"
},
"peerDependenciesMeta": {
"debug": {
"optional": true
}
}
},
"node_modules/form-data": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz",
@ -6303,6 +6294,7 @@
"version": "7.0.2",
"resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-7.0.2.tgz",
"integrity": "sha512-T1gkAiYYDWYx3V5Bmyu7HcfcvL7mUrTWiM6yOfa3PIphViJ/gFPbvidQ+veqSOHci/PxBcDabeUNCzpOODJZig==",
"dev": true,
"dependencies": {
"agent-base": "^7.1.0",
"debug": "^4.3.4"

View file

@ -16,7 +16,7 @@
"@aws-sdk/credential-providers": "^3.840.0",
"@continuedev/config-types": "^1.0.5",
"@continuedev/config-yaml": "^1.0.51",
"@continuedev/fetch": "^1.0.15",
"@continuedev/fetch": "file:../fetch",
"dotenv": "^16.5.0",
"google-auth-library": "^10.1.0",
"json-schema": "^0.4.0",

View file

@ -1,12 +1,27 @@
# Use npm ci in CI, npm install in development
if ($env:CI -eq "true") {
$npmInstallCmd = "npm ci"
} else {
$npmInstallCmd = "npm install"
}
Push-Location packages
Push-Location "openai-adapters"
npm ci
# Build fetch first
Push-Location "fetch"
& cmd /c $npmInstallCmd
npm run build
Pop-Location
# After building fetch, reinstall openai-adapters to pick up the new build
Push-Location "openai-adapters"
& cmd /c $npmInstallCmd
npm run build
Pop-Location
# Build config-yaml
Push-Location "config-yaml"
npm ci
& cmd /c $npmInstallCmd
npm run build
Pop-Location

View file

@ -1,13 +1,27 @@
# Build @continuedev packages for monorepo style linking
# Use npm ci in CI, npm install in development
if [ "$CI" = "true" ]; then
NPM_INSTALL_CMD="npm ci"
else
NPM_INSTALL_CMD="npm install"
fi
cd packages
cd openai-adapters
npm ci
# Build fetch first
cd fetch
$NPM_INSTALL_CMD
npm run build
cd ..
cd config-yaml
npm ci
# After building fetch, reinstall openai-adapters to pick up the new build
cd openai-adapters
$NPM_INSTALL_CMD
npm run build
cd ..
# Build config-yaml
cd config-yaml
$NPM_INSTALL_CMD
npm run build

View file

@ -82,11 +82,8 @@ npm install
npm run build
Pop-Location
Write-Host "`nBuilding fetch..." -ForegroundColor White
Push-Location packages/fetch
npm install
npm run build
Pop-Location
Write-Host "`nBuilding packages (fetch, openai-adapters, config-yaml)..." -ForegroundColor White
& .\scripts\build-packages.ps1
Write-Host "`nBuilding llm-info..." -ForegroundColor White
Push-Location packages/llm-info
@ -94,18 +91,6 @@ npm install
npm run build
Pop-Location
Write-Host "`nBuilding config-yaml..." -ForegroundColor White
Push-Location packages/config-yaml
npm install
npm run build
Pop-Location
Write-Host "`nBuilding openai-adapters..." -ForegroundColor White
Push-Location packages/openai-adapters
npm install
npm run build
Pop-Location
Write-Host "`nBuilding hub..." -ForegroundColor White
Push-Location packages/hub
npm install

View file

@ -36,11 +36,8 @@ npm install
npm run build
popd
echo "Building fetch..."
pushd packages/fetch
npm install
npm run build
popd
echo "Building packages (fetch, openai-adapters, config-yaml)..."
./scripts/build-packages.sh
echo "Building llm-info..."
pushd packages/llm-info
@ -48,18 +45,6 @@ npm install
npm run build
popd
echo "Building config-yaml..."
pushd packages/config-yaml
npm install
npm run build
popd
echo "Building openai-adapters..."
pushd packages/openai-adapters
npm install
npm run build
popd
echo "Building hub..."
pushd packages/hub
npm install

View file

@ -154,17 +154,17 @@ install_from_pr() {
exit 1
fi
# Extract version from the original VSIX filename (e.g., continue-1.1.66.vsix -> 1.1.66)
# Extract full version from the original VSIX filename (e.g., continue-1.1.66-a1b2c3d.vsix -> 1.1.66-a1b2c3d)
local original_filename=$(basename "$vsix_file")
local version=$(echo "$original_filename" | sed 's/continue-\(.*\)\.vsix/\1/')
local full_version=$(echo "$original_filename" | sed 's/continue-\(.*\)\.vsix/\1/')
if [ -z "$version" ]; then
if [ -z "$full_version" ]; then
echo "⚠️ Could not extract version from filename: $original_filename"
version="unknown"
full_version="unknown-pr${pr_number}"
fi
# Create new VSIX name with version and PR number
local target_path="$ONEPER_DIR/continue-${version}-${pr_number}.vsix"
# Use the full version (which includes commit SHA) for the target filename
local target_path="$ONEPER_DIR/continue-${full_version}.vsix"
# Check if file already exists and notify about overwrite
if [ -f "$target_path" ]; then
@ -182,7 +182,7 @@ install_from_pr() {
if code --install-extension "$target_path"; then
echo "✅ Successfully installed Continue extension from PR #$pr_number"
echo "📄 VSIX file saved to: $target_path"
echo "🔖 Extension version: ${version}-<commit-sha> (set by workflow)"
echo "🔖 Extension version: ${full_version} (includes commit SHA)"
echo ""
echo "💡 To use the new extension version, reload your VS Code window:"
echo " • Press Ctrl+Shift+P (Cmd+Shift+P on Mac)"