Skip to content
Open
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
16 changes: 0 additions & 16 deletions build/artifacts/artifacts.lock.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,3 @@
metadata:
version: "1.0"
artifacts:
# ms-vscode.js-debug-companion
- download_url: https://open-vsx.org/api/ms-vscode/js-debug-companion/1.1.3/file/ms-vscode.js-debug-companion-1.1.3.vsix
filename: ms-vscode.js-debug-companion.1.1.3.vsix
checksum: sha256:7380a890787452f14b2db7835dfa94de538caf358ebc263f9d46dd68ac52de93
# ms-vscode.js-debug
- download_url: https://open-vsx.org/api/ms-vscode/js-debug/1.117.0/file/ms-vscode.js-debug-1.117.0.vsix
filename: ms-vscode.js-debug.1.117.0.vsix
checksum: sha256:854eeb8a785b1f41ba2bd02d7ccd4fdbe10021b61473293973c7e96d036c7fb8
# ms-vscode.vscode-js-profile-table
- download_url: https://open-vsx.org/api/ms-vscode/vscode-js-profile-table/1.0.10/file/ms-vscode.vscode-js-profile-table-1.0.10.vsix
filename: ms-vscode.vscode-js-profile-table.1.0.10.vsix
checksum: sha256:7361748ddf9fd09d8a2ed1f2a2d7376a2cf9aae708692820b799708385c38e08
# devfile.vscode-devfile
- download_url: https://open-vsx.org/api/devfile/vscode-devfile/0.0.4/file/devfile.vscode-devfile-0.0.4.vsix
filename: devfile.vscode-devfile.0.0.4.vsix
checksum: sha256:c55a6c1d087e7715bfacb01c0c2b52ef0f935d85f0707265d9068cd64143744c
46 changes: 46 additions & 0 deletions code/build/copy-extension-build-scripts.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
#!/usr/bin/env node

import fs from 'fs';
import path from 'path';

const scriptDir = import.meta.dirname;
const codeDir = path.join(scriptDir, '..');

// Map of build script filename -> target extension directory
const scripts = {
'js-debug.esbuild.ts': 'extensions/js-debug',
'js-debug-companion.esbuild.ts': 'extensions/js-debug-companion',
'js-profile-visualizer.esbuild.ts': 'extensions/js-profile-visualizer',
'js-profile-visualizer.webpack.override.js': 'extensions/js-profile-visualizer',
'devfile.esbuild.ts': 'extensions/devfile',
};

for (const [scriptFile, extensionDir] of Object.entries(scripts)) {
const src = path.join(scriptDir, 'extension-build-scripts', scriptFile);
const destDir = path.join(codeDir, extensionDir);

// Extract the actual filename (remove the prefix before the first dot)
let destFile;
if (scriptFile.includes('.esbuild.ts')) {
destFile = '.esbuild.ts';
} else if (scriptFile.includes('.webpack.override.js')) {
destFile = 'webpack.override.js';
} else {
destFile = scriptFile;
}

const dest = path.join(destDir, destFile);

if (!fs.existsSync(src)) {
console.warn(`Warning: ${src} not found, skipping`);
continue;
}

if (!fs.existsSync(destDir)) {
console.warn(`Warning: ${destDir} not found, skipping`);
continue;
}
Comment thread
rgrunber marked this conversation as resolved.

fs.copyFileSync(src, dest);
console.log(`Copied ${scriptFile} -> ${extensionDir}/${destFile}`);
}
20 changes: 20 additions & 0 deletions code/build/extension-build-scripts/devfile.esbuild.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
const path = require('path');
const esbuild = require('esbuild');

const srcDir = path.join(__dirname, 'src');
const outDir = path.join(__dirname, 'dist');

esbuild.build({
platform: 'node',
bundle: true,
minify: true,
treeShaking: true,
sourcemap: true,
target: ['es2020'],
external: ['vscode'],
format: 'cjs',
entryPoints: {
'devfile-extension': path.join(srcDir, 'devfile-extension.ts'),
},
outdir: outDir,
}).catch(() => process.exit(1));
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
const path = require('path');
const esbuild = require('esbuild');

esbuild.build({
entryPoints: [path.join(__dirname, 'src', 'extension.ts')],
tsconfig: path.join(__dirname, 'tsconfig.json'),
bundle: true,
external: ['vscode'],
minify: true,
platform: 'node',
outdir: path.join(__dirname, 'dist'),
packages: 'bundle',
}).catch(() => process.exit(1));
16 changes: 16 additions & 0 deletions code/build/extension-build-scripts/js-debug.esbuild.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
const cp = require('child_process');
const fs = require('fs');
const path = require('path');

// Run js-debug's own gulp build which populates dist/
cp.execFileSync(process.execPath, [path.join(__dirname, 'node_modules', 'gulp', 'bin', 'gulp.js'), 'compile'], {
cwd: __dirname,
stdio: 'inherit',
});

// Rewrite main to point into dist/ so the packaged extension resolves correctly
const pkgPath = path.join(__dirname, 'package.json');
const pkg = JSON.parse(fs.readFileSync(pkgPath, 'utf8'));
pkg.main = './dist/src/extension.js';
pkg.activationEvents = [];
fs.writeFileSync(pkgPath, JSON.stringify(pkg, null, 2));
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
const cp = require('child_process');
const fs = require('fs');
const path = require('path');

const rootDir = __dirname;
const coreDir = path.join(rootDir, 'packages', 'vscode-js-profile-core');
const tableDir = path.join(rootDir, 'packages', 'vscode-js-profile-table');
const tsc = path.join(rootDir, 'node_modules', '.bin', 'tsc');
const cpy = path.join(rootDir, 'node_modules', '.bin', 'cpy');
const webpack = path.join(rootDir, 'node_modules', '.bin', 'webpack');

// Build the core package first (table depends on it)
// Type errors are non-fatal - tsc still emits output even when it exits with error code
try {
cp.execFileSync(tsc, ['-p', 'tsconfig.json'], { cwd: coreDir, stdio: 'inherit' });
} catch (e) {
// Ignore tsc errors - output files are still generated
}
try {
cp.execFileSync(tsc, ['-p', 'tsconfig.browser.json'], { cwd: coreDir, stdio: 'inherit' });
} catch (e) {
// Ignore tsc errors - output files are still generated
}
Comment thread
coderabbitai[bot] marked this conversation as resolved.
cp.execFileSync(cpy, ['src/**/*.css', 'out/esm'], { cwd: coreDir, stdio: 'inherit' });

// Build the table package with webpack using override config that disables type-checking
cp.execFileSync(webpack, ['--mode', 'production', '--config', path.join(rootDir, 'webpack.override.js')], { cwd: tableDir, stdio: 'inherit' });

// Copy the sub-package's package.json to root so the build system picks up
// the correct extension manifest (with engines, contributes, main, etc.)
const tablePkg = JSON.parse(fs.readFileSync(path.join(tableDir, 'package.json'), 'utf8'));
tablePkg.main = './packages/vscode-js-profile-table/out/extension.js';
if (tablePkg.browser) {
tablePkg.browser = './packages/vscode-js-profile-table/out/extension.web.js';
}
fs.writeFileSync(path.join(rootDir, 'package.json'), JSON.stringify(tablePkg, null, 2));
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
// Webpack config override for .esbuild.ts build - disables type-checking to avoid build failures
const baseConfig = require('./packages/vscode-js-profile-table/webpack.config.js');

module.exports = baseConfig.map(config => {
if (config.module && config.module.rules) {
config.module.rules = config.module.rules.map(rule => {
if (rule.loader === 'ts-loader') {
return {
...rule,
options: {
...rule.options,
transpileOnly: true, // Disable type-checking to avoid build failures
},
};
}
return rule;
});
}
return config;
});
4 changes: 4 additions & 0 deletions code/build/gulpfile.extensions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ const compilations = [
'extensions/css-language-features/server/tsconfig.json',
'extensions/debug-auto-launch/tsconfig.json',
'extensions/debug-server-ready/tsconfig.json',
'extensions/devfile/tsconfig.json',
'extensions/emmet/tsconfig.json',
'extensions/extension-editing/tsconfig.json',
'extensions/git/tsconfig.json',
Expand All @@ -77,6 +78,9 @@ const compilations = [
'extensions/html-language-features/server/tsconfig.json',
'extensions/ipynb/tsconfig.json',
'extensions/jake/tsconfig.json',
'extensions/js-debug/tsconfig.json',
'extensions/js-debug-companion/tsconfig.json',
'extensions/js-profile-visualizer/packages/vscode-js-profile-table/tsconfig.json',
'extensions/json-language-features/client/tsconfig.json',
'extensions/json-language-features/server/tsconfig.json',
'extensions/markdown-language-features/tsconfig.json',
Expand Down
4 changes: 4 additions & 0 deletions code/build/npm/dirs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ export const dirs = [
'extensions/css-language-features/server',
'extensions/debug-auto-launch',
'extensions/debug-server-ready',
'extensions/devfile',
'extensions/emmet',
'extensions/extension-editing',
'extensions/git',
Expand All @@ -40,6 +41,9 @@ export const dirs = [
'extensions/html-language-features/server',
'extensions/ipynb',
'extensions/jake',
'extensions/js-debug',
'extensions/js-debug-companion',
'extensions/js-profile-visualizer',
'extensions/json-language-features',
'extensions/json-language-features/server',
'extensions/markdown-language-features',
Expand Down
24 changes: 24 additions & 0 deletions code/extensions/devfile/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"root": true,
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": 6,
"sourceType": "module"
},
"plugins": [
"@typescript-eslint"
],
"rules": {
"@typescript-eslint/naming-convention": "warn",
"@typescript-eslint/semi": "warn",
"curly": "warn",
"eqeqeq": "warn",
"no-throw-literal": "warn",
"semi": "off"
},
"ignorePatterns": [
"out",
"dist",
"**/*.d.ts"
]
}
17 changes: 17 additions & 0 deletions code/extensions/devfile/.github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
day: "sunday"
time: "16:00"
groups:
all-actions:
patterns: [ "*" ]
- package-ecosystem: "npm"
directory: "/"
schedule:
interval: "weekly"
day: "sunday"
time: "16:00"
21 changes: 21 additions & 0 deletions code/extensions/devfile/.github/workflows/pr-verify.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: pr-verify

on: [push, pull_request]

jobs:
pr-verify-job:
runs-on: ubuntu-latest
steps:
- name: Check Out Code
uses: actions/checkout@v2
- name: Set Up NodeJS
uses: actions/setup-node@v2
with:
node-version: '18'
- run: npm install -g typescript "vsce"
- run: npm install
- run: npm run compile
- run: npm run vscode:prepublish
- run: npm run build-vsix
- run: ls -ll *.vsix
- run: npm run eslint
94 changes: 94 additions & 0 deletions code/extensions/devfile/.github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
name: release

on:
workflow_dispatch:
inputs:
publishToMarketPlace:
description: "Publish to VS Code Marketplace ?"
required: true
type: choice
options:
- "true"
- "false"
default: "false"
publishToOVSX:
description: "Publish to OpenVSX Registry ?"
required: true
type: choice
options:
- "true"
- "false"
default: "false"
jobs:
packaging-job:
runs-on: ubuntu-latest
steps:
- name: Check Out vscode-devfile
uses: actions/checkout@v2
- name: Set Up NodeJS
uses: actions/setup-node@v2
with:
node-version: "18"
- name: Install NodeJS dependencies
run: npm install -g typescript "@vscode/vsce" "ovsx"
- name: Build vscode-devfile
run: |
npm install
npm run vscode:prepublish
npm run compile
echo "EXT_VERSION=$(cat package.json | jq -r .version)" >> $GITHUB_ENV
- name: Package vscode-devfile
run: |
vsce package -o vscode-devfile-${{ env.EXT_VERSION }}-${GITHUB_RUN_NUMBER}.vsix
ls -lash *.vsix
- name: Calculate SHA256 Hash
run: |
sha256sum vscode-devfile-${{ env.EXT_VERSION }}-${GITHUB_RUN_NUMBER}.vsix
- name: Upload VSIX Artifacts
uses: actions/upload-artifact@v4.6.1
with:
name: vscode-devfile
path: |
vscode-devfile-${{ env.EXT_VERSION }}-${{ github.run_number }}.vsix
if-no-files-found: error
- name: Publish to GH Release Tab
if: ${{ inputs.publishToMarketPlace == 'true' && inputs.publishToOVSX == 'true' }}
uses: "marvinpinto/action-automatic-releases@919008cf3f741b179569b7a6fb4d8860689ab7f0"
with:
repo_token: "${{ secrets.RELEASE_GITHUB_TOKEN }}"
automatic_release_tag: "v${{ env.EXT_VERSION }}"
title: "${{ env.EXT_VERSION }}"
draft: true
files: |
vscode-devfile-${{ env.EXT_VERSION }}-${{ github.run_number }}.vsix
release-job:
environment: ${{ (inputs.publishToMarketPlace == 'true' || inputs.publishToOVSX == 'true') && 'release' || 'pre-release' }}
runs-on: ubuntu-latest
needs: packaging-job
steps:
- name: Check Out vscode-devfile
uses: actions/checkout@v2
- name: Set Up NodeJS
uses: actions/setup-node@v2
with:
node-version: "18"
- name: Install dependencies
run: |
npm install -g typescript "@vscode/vsce" "ovsx"
- name: Download VSIX
uses: actions/download-artifact@v4.2.0
with:
merge-multiple: true
path: .
- name: List downloaded files
run: ls -ll *.vsix
- name: Set EXT_VERSION variable
run: echo "EXT_VERSION=$(cat package.json | jq -r .version)" >> $GITHUB_ENV
- name: Publish to VS Code Marketplace
if: ${{ inputs.publishToMarketPlace == 'true' }}
run: |
vsce publish -p ${{ secrets.VSCODE_MARKETPLACE_TOKEN }} --packagePath vscode-devfile-${{ env.EXT_VERSION }}-${GITHUB_RUN_NUMBER}.vsix
- name: Publish to OpenVSX Registry
if: ${{ inputs.publishToOVSX == 'true' }}
run: |
ovsx publish -p ${{ secrets.OVSX_MARKETPLACE_TOKEN }} --packagePath vscode-devfile-${{ env.EXT_VERSION }}-${GITHUB_RUN_NUMBER}.vsix
3 changes: 3 additions & 0 deletions code/extensions/devfile/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
out
node_modules
*.vsix
11 changes: 11 additions & 0 deletions code/extensions/devfile/.vscodeignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
.vscode/**
.vscode-test/**
src/**
.gitignore
.yarnrc
vsc-extension-quickstart.md
**/tsconfig.json
**/.eslintrc.json
**/*.map
**/*.ts
node_modules
9 changes: 9 additions & 0 deletions code/extensions/devfile/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Change Log

All notable changes to the "devfile.vscode-devfile" extension will be documented in this file.

Check [Keep a Changelog](http://keepachangelog.com/) for recommendations on how to structure this file.

## [Unreleased]

- Initial release
Loading