-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Modernize the VS Code extension (#60)
- Upgrade packages to latest versions (this includes some package renames that have happened). - eslint included migrating from the deprecated `.eslintrc` file. - Remove unneeded packages. - Migrate from Webpack to esbuild for maintenance ease (using [Microsoft's example code](https://code.visualstudio.com/api/working-with-extensions/bundling-extension)). - A Webpack upgrade would have had to have been done because it was not building anymore, with `ERR_OSSL_EVP_UNSUPPORTED`. - But Webpack is slow, and onerous, so I made the executive decision to migrate to esbuild. - Stop using a submodule for the resources: if [Microsoft has it on branch](https://github.com/microsoft/vscode-python/tree/main/resources), so can we. - Added a minimal test: it validates that the extension activates. - Move from Azure Pipeline to GitHub Actions, which are ran on PRs, - Runs on Linux/Win/Mac, and does the same as before, except this time with the minimal test. - Stop the logger from stealing focus on launch (fixes #58), - Disabled the Language Server automatic startup, due to various issues (fixes #36) - Could not get it to work, - Spawning it in the way that we're doing is _unusual_, most people just spawn it using `child_process.spawn()`, - Using `child_process.spawn()` works, but for some reason, when launched as a child process, it would not communicate what so ever, - On Linux, it also requires apama_env, which I didn't really want to do, and I think is a future enhancement: it should be able to run entirely independently, - We still support communicating to it via a pre-launched eplbuddy process. - This is technically a regression - however, I'm skeptical anyone even used eplbuddy on Linux, considering that `softwareag.apama.apamahome` is set to a Windows directory by default. I guess I apologize to anyone who is. - Cleanup the README - Added a custom logger: this gives us more traceability into when events happened, which is super useful,
- Loading branch information
Showing
156 changed files
with
4,928 additions
and
4,433 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
name: continuous integration | ||
on: | ||
- pull_request | ||
|
||
jobs: | ||
ci: | ||
strategy: | ||
matrix: | ||
os: [macos-latest, ubuntu-latest, windows-latest] | ||
runs-on: ${{ matrix.os }} | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Use Node.js | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 20.x | ||
cache: 'npm' | ||
- run: npm install | ||
- run: npm run build | ||
- run: xvfb-run -a npm test | ||
if: runner.os == 'Linux' | ||
- run: npm test | ||
if: runner.os != 'Linux' | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,3 +2,4 @@ node_modules | |
*.vsix | ||
out | ||
dist | ||
.vscode-test |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import { defineConfig } from '@vscode/test-cli'; | ||
|
||
export default defineConfig({ | ||
files: 'out/test/**/*.test.js', | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
const esbuild = require('esbuild'); | ||
|
||
const production = process.argv.includes('--production'); | ||
const watch = process.argv.includes('--watch'); | ||
|
||
async function main() { | ||
const ctx = await esbuild.context({ | ||
entryPoints: ['src/extension.ts'], | ||
bundle: true, | ||
format: 'cjs', | ||
minify: production, | ||
sourcemap: !production, | ||
sourcesContent: false, | ||
platform: 'node', | ||
outfile: 'dist/extension.js', | ||
external: ['vscode'], | ||
logLevel: 'silent', | ||
plugins: [ | ||
/* add to the end of plugins array */ | ||
esbuildProblemMatcherPlugin | ||
] | ||
}); | ||
if (watch) { | ||
await ctx.watch(); | ||
} else { | ||
await ctx.rebuild(); | ||
await ctx.dispose(); | ||
} | ||
} | ||
|
||
/** | ||
* @type {import('esbuild').Plugin} | ||
*/ | ||
const esbuildProblemMatcherPlugin = { | ||
name: 'esbuild-problem-matcher', | ||
|
||
setup(build) { | ||
build.onStart(() => { | ||
console.log('[watch] build started'); | ||
}); | ||
build.onEnd(result => { | ||
result.errors.forEach(({ text, location }) => { | ||
console.error(`✘ [ERROR] ${text}`); | ||
console.error(` ${location.file}:${location.line}:${location.column}:`); | ||
}); | ||
console.log('[watch] build finished'); | ||
}); | ||
} | ||
}; | ||
|
||
main().catch(e => { | ||
console.error(e); | ||
process.exit(1); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
import typescriptEslint from "@typescript-eslint/eslint-plugin"; | ||
import globals from "globals"; | ||
import tsParser from "@typescript-eslint/parser"; | ||
import path from "node:path"; | ||
import { fileURLToPath } from "node:url"; | ||
import js from "@eslint/js"; | ||
import { FlatCompat } from "@eslint/eslintrc"; | ||
|
||
const __filename = fileURLToPath(import.meta.url); | ||
const __dirname = path.dirname(__filename); | ||
const compat = new FlatCompat({ | ||
baseDirectory: __dirname, | ||
recommendedConfig: js.configs.recommended, | ||
allConfig: js.configs.all | ||
}); | ||
|
||
export default [ | ||
...compat.extends("eslint:recommended", "plugin:@typescript-eslint/recommended"), | ||
{ | ||
plugins: { | ||
"@typescript-eslint": typescriptEslint, | ||
}, | ||
|
||
files: ["**/*.ts", "**/*.tsx"], | ||
|
||
languageOptions: { | ||
globals: { | ||
...globals.browser, | ||
}, | ||
|
||
parser: tsParser, | ||
ecmaVersion: 11, | ||
sourceType: "module", | ||
}, | ||
|
||
rules: {}, | ||
}, | ||
]; |
Oops, something went wrong.