Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 2 additions & 41 deletions .github/workflows/build-vscode-extension.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,49 +43,10 @@ jobs:
- name: Build and Test VS Code Extension
run: npm run test:vscode

integration-test:
name: Integration Test (VSCode ${{ matrix.vscode-version }})
runs-on: ubuntu-latest
needs: build-and-test
# Stable is an informational matrix entry (CDN-resolved, can flake on
# transient network issues); pinned versions are the real gate.
continue-on-error: ${{ matrix.vscode-version == 'stable' }}
strategy:
fail-fast: false
matrix:
# 1.115.0 is the last known-good version for issue #2361.
# 1.116.0 is the first version exhibiting the blank-paint regression.
# 'stable' tracks whatever is current β€” early warning for new regressions.
vscode-version: ['1.115.0', '1.116.0', 'stable']

steps:
- name: Checkout code
uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6

- name: Setup Node.js
uses: actions/setup-node@249970729cb0ef3589644e2896645e5dc5ba9c38 # v6
with:
node-version-file: '.nvmrc'

- name: Install workspace
run: npm ci

- name: Build workspace dependencies
# tsup in the vscode extension needs @finos/calm-shared and
# @finos/calm-models pre-built (they're file:../../ workspace deps).
run: npm run build:shared

- name: Integration Test VS Code Extension (Xvfb)
# Xvfb provides a virtual display so @vscode/test-electron can launch
# a real VSCode instance headlessly. xvfb-run wraps the command.
env:
VSCODE_VERSION: ${{ matrix.vscode-version }}
run: xvfb-run -a npm run test:integration --workspace=calm-plugins/vscode

package-and-publish:
name: Package and Publish VS Code Extension
runs-on: ubuntu-latest
needs: [build-and-test, integration-test]
needs: [build-and-test]

steps:
- name: Checkout code
Expand All @@ -105,7 +66,7 @@ jobs:
- name: Publish to VS Code Marketplace
if: github.event.inputs.publish_to_marketplace == 'true'
working-directory: ./calm-plugins/vscode
run: npx vsce publish --packagePath *.vsix
run: npx vsce publish --pre-release --packagePath *.vsix
env:
VSCE_PAT: ${{ secrets.VSCE_PAT }}

Expand Down
57 changes: 0 additions & 57 deletions .github/workflows/build-vscode-screenshots.yml

This file was deleted.

31 changes: 4 additions & 27 deletions calm-plugins/vscode/.vscodeignore
Original file line number Diff line number Diff line change
@@ -1,29 +1,6 @@
# Strict bundle-only .vscodeignore
# Ignore everything by default, then allow only essential files for the VSIX
**

# Keep package metadata
!package.json
!README.md
!CHANGELOG.md
!LICENSE
!docs/**

# Explicitly exclude developer documentation
DEVELOPER.md

# Keep built extension bundles
**/*
!dist/**

# Keep media/icons used by the extension (if present)
!media/**
!icons/**

# Keep this ignore file itself
!.vscodeignore

# Include the templates directory
!templates/**

# Exclude node_modules entirely to avoid pulling workspace symlinks or repo-top files
# (If you need to vendor runtime packages, copy just their runtime output into `dist/` before packaging.)
!package.json
!LICENSE
!README.md
46 changes: 46 additions & 0 deletions calm-plugins/vscode/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
PKG_JSON := package.json
CURRENT_VERSION := $(shell node -p "require('./$(PKG_JSON)').version")
VSIX_NAME := calm-vscode-plugin-$(CURRENT_VERSION).vsix

MAJOR := $(word 1,$(subst ., ,$(CURRENT_VERSION)))
MINOR := $(word 2,$(subst ., ,$(CURRENT_VERSION)))
PATCH := $(word 3,$(subst ., ,$(CURRENT_VERSION)))

.PHONY: build package install install-nobump bump-patch bump-minor bump-major clean version

version:
@echo "Current version: $(CURRENT_VERSION)"

build:
node esbuild.mjs
npx vite build --config vite.webview.config.ts

package: bump-patch build
npx @vscode/vsce package --no-dependencies
@echo "Built: calm-vscode-plugin-$$(node -p "require('./$(PKG_JSON)').version").vsix"

install: package
code --install-extension calm-vscode-plugin-$$(node -p "require('./$(PKG_JSON)').version").vsix --force
@echo "Installed extension v$$(node -p "require('./$(PKG_JSON)').version")"

install-nobump: build
npx @vscode/vsce package --no-dependencies
code --install-extension calm-vscode-plugin-$(CURRENT_VERSION).vsix --force
@echo "Installed extension v$(CURRENT_VERSION) (no version bump)"

bump-patch:
@node -e "const p=require('./$(PKG_JSON)');const v=p.version.split('.');v[2]=+v[2]+1;p.version=v.join('.');require('fs').writeFileSync('./$(PKG_JSON)',JSON.stringify(p,null,2)+'\n')"
@echo "Bumped to $$(node -p "require('./$(PKG_JSON)').version")"

bump-minor:
@node -e "const p=require('./$(PKG_JSON)');const v=p.version.split('.');v[1]=+v[1]+1;v[2]=0;p.version=v.join('.');require('fs').writeFileSync('./$(PKG_JSON)',JSON.stringify(p,null,2)+'\n')"
@echo "Bumped to $$(node -p "require('./$(PKG_JSON)').version")"

bump-major:
@node -e "const p=require('./$(PKG_JSON)');const v=p.version.split('.');v[0]=+v[0]+1;v[1]=0;v[2]=0;p.version=v.join('.');require('fs').writeFileSync('./$(PKG_JSON)',JSON.stringify(p,null,2)+'\n')"
@echo "Bumped to $$(node -p "require('./$(PKG_JSON)').version")"

clean:
rm -f *.vsix
rm -rf dist/
@echo "Cleaned"
25 changes: 25 additions & 0 deletions calm-plugins/vscode/esbuild.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import * as esbuild from 'esbuild';

const production = process.argv.includes('--production');
const watch = process.argv.includes('--watch');

const ctx = await esbuild.context({
entryPoints: ['src/extension/extension.ts'],
bundle: true,
format: 'cjs',
platform: 'node',
target: 'node18',
outfile: 'dist/extension.js',
external: ['vscode'],
sourcemap: !production,
minify: production,
logLevel: 'info',
});

if (watch) {
await ctx.watch();
console.log('[esbuild] watching extension...');
} else {
await ctx.rebuild();
await ctx.dispose();
}
77 changes: 56 additions & 21 deletions calm-plugins/vscode/eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -1,25 +1,60 @@
import globals from 'globals'
import tseslint from '@typescript-eslint/eslint-plugin'
import tsparser from '@typescript-eslint/parser'
import importPlugin from 'eslint-plugin-import'
import js from '@eslint/js';
import globals from 'globals';
import reactHooks from 'eslint-plugin-react-hooks';
import tseslint from 'typescript-eslint';

export default [
{
files: ['src/**/*.ts'],
languageOptions: {
parser: tsparser,
parserOptions: { project: false, ecmaVersion: 'latest', sourceType: 'module' },
globals: globals.node
export default tseslint.config(
{ ignores: ['dist', 'node_modules', '**/*.vsix'] },
{
// Webview (React) sources β€” browser environment.
extends: [js.configs.recommended, ...tseslint.configs.recommended],
files: ['src/webview/**/*.{ts,tsx}'],
languageOptions: {
ecmaVersion: 2020,
globals: globals.browser,
},
plugins: {
'react-hooks': reactHooks,
},
rules: {
...reactHooks.configs.recommended.rules,
// The canvas transforms lean on `any` for the loosely-typed CALM JSON.
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-unused-vars': [
'warn',
{ argsIgnorePattern: '^_', varsIgnorePattern: '^_' },
],
},
},
plugins: {
'@typescript-eslint': tseslint,
'import': importPlugin
{
// Extension host sources β€” Node environment.
extends: [js.configs.recommended, ...tseslint.configs.recommended],
files: ['src/extension/**/*.ts'],
languageOptions: {
ecmaVersion: 2020,
globals: globals.node,
},
rules: {
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-unused-vars': [
'warn',
{ argsIgnorePattern: '^_', varsIgnorePattern: '^_' },
],
},
},
rules: {
'no-unused-vars': 'off',
'@typescript-eslint/no-unused-vars': ['warn', { argsIgnorePattern: '^_', varsIgnorePattern: '^_' }],
'no-console': 'off',
'import/no-useless-path-segments': 'error'
{
// Test files + the vscode mock use both environments and TS syntax.
extends: [js.configs.recommended, ...tseslint.configs.recommended],
files: ['src/**/*.test.{ts,tsx}', 'src/test/**/*.ts'],
languageOptions: {
globals: { ...globals.node, ...globals.browser },
},
rules: {
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-unused-vars': [
'warn',
{ argsIgnorePattern: '^_', varsIgnorePattern: '^_' },
],
},
}
}
]
);
19 changes: 19 additions & 0 deletions calm-plugins/vscode/media/calm-canvas.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading