Skip to content

Commit

Permalink
Merge pull request #429 from GordonSmith/ESBUILD
Browse files Browse the repository at this point in the history
feat:  Switch to esbuild and bump versions
  • Loading branch information
GordonSmith authored Aug 22, 2024
2 parents d88d3e9 + a12cc97 commit e1bb74d
Show file tree
Hide file tree
Showing 48 changed files with 8,555 additions and 11,249 deletions.
29 changes: 6 additions & 23 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@ module.exports = {
root: true,
parser: "@typescript-eslint/parser",
plugins: [
"@typescript-eslint",
"@typescript-eslint"
],
extends: [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"plugin:react-hooks/recommended"
],
env: {
"browser": true,
Expand All @@ -20,7 +21,7 @@ module.exports = {
"debugConfig": "readonly",
"Promise": "readonly"
},
ignorePatterns: ["src/grammar"],
ignorePatterns: ["src/grammar/**/*"],
rules: {
"no-redeclare": "off",
"no-empty": "off",
Expand Down Expand Up @@ -71,27 +72,9 @@ module.exports = {
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/no-empty-interface": "off",
"@typescript-eslint/no-this-alias": "off",
"@typescript-eslint/ban-types": [
"error",
{
"types": {
// add a custom message, AND tell the plugin how to fix it
"String": {
"message": "Use string instead",
"fixWith": "string"
},

"{}": {
"message": "Use object instead",
"fixWith": "object"
},

"object": false
}
}
],
"@typescript-eslint/no-non-null-assertion": "off",
"@typescript-eslint/no-namespace": "off",
"@typescript-eslint/no-var-require": "off"
"@typescript-eslint/no-var-require": "off",
"@typescript-eslint/no-unsafe-declaration-merging": "off",
}
};
};
6 changes: 6 additions & 0 deletions .github/workflows/publish-github.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@ jobs:
runs-on: ubuntu-latest

steps:
- name: Check
if: ${{ github.repository_owner != 'hpcc-systems' }}
run: |
echo "Not hpcc-systems repository"
exit 1
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/pull-build-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: "16.x"
node-version: "20.x"
- run: git submodule update --init --recursive
- run: npm ci
- run: npm run lint
- run: npm run vsce-package;
- run: npm run vsce-package
26 changes: 21 additions & 5 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
},
{
"name": "Launch Web Extension",
"type": "pwa-extensionHost",
"type": "extensionHost",
"debugWebWorkerHost": true,
"request": "launch",
"args": [
Expand All @@ -66,6 +66,15 @@
"${workspaceFolder}/dist/**/*.js"
]
},
{
"name": "Launch esbuild.mjs",
"type": "node",
"request": "launch",
"program": "${workspaceFolder}/esbuild.mjs",
"args": [
"--mode=development"
],
},
{
"name": "Launch Server Adapter",
"type": "node",
Expand All @@ -83,17 +92,24 @@
},
{
"name": "webview-test",
"type": "pwa-msedge",
"type": "msedge",
"request": "launch",
"url": "file:///${workspaceRoot}/webview-test.html",
"runtimeArgs": [
"--disable-web-security"
],
"webRoot": "${workspaceRoot}"
},
{
"name": "http://webview-test",
"type": "msedge",
"request": "launch",
"url": "http://localhost:8000/webview-test.html",
"webRoot": "${workspaceRoot}"
},
{
"name": "index",
"type": "pwa-msedge",
"type": "msedge",
"request": "launch",
"url": "file:///${workspaceRoot}/index.html",
"runtimeArgs": [
Expand All @@ -108,7 +124,7 @@
"skipFiles": [
"<node_internals>/**"
],
"type": "pwa-node"
"type": "node"
},
{
"name": "NLS Merge",
Expand All @@ -117,7 +133,7 @@
"skipFiles": [
"<node_internals>/**"
],
"type": "pwa-node"
"type": "node"
}
]
}
24 changes: 18 additions & 6 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
"tasks": [
{
"type": "npm",
"label": "compile watch",
"script": "compile-es6-watch",
"label": "gen-node-watch",
"script": "gen-node-watch",
"problemMatcher": [
"$tsc-watch"
],
Expand All @@ -16,8 +16,19 @@
},
{
"type": "npm",
"label": "bundle-ext watch",
"script": "bundle-ext-watch",
"label": "gen-webview-watch",
"script": "gen-webview-watch",
"problemMatcher": [
"$tsc-watch"
],
"presentation": {
"group": "group-build"
}
},
{
"type": "npm",
"label": "build-ts-watch",
"script": "build-ts-watch",
"problemMatcher": [],
"presentation": {
"group": "group-build"
Expand All @@ -26,8 +37,9 @@
{
"label": "build",
"dependsOn": [
"compile watch",
"bundle-ext watch"
"gen-node-watch",
"gen-webview-watch",
"build-ts-watch"
],
"group": {
"kind": "build",
Expand Down
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@

All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.

## [2.28.0](https://github.com/hpcc-systems/vscode-ecl/compare/v2.27.0...v2.28.0) (2024-07-17)


### Features

* Switch to esbuild and bump versions ([406507d](https://github.com/hpcc-systems/vscode-ecl/commit/406507dc68bdf0ecd8eaf27c83216fd1887ad36e))

## [2.27.0](https://github.com/hpcc-systems/vscode-ecl/compare/v2.26.3...v2.27.0) (2024-04-23)


Expand Down
6 changes: 3 additions & 3 deletions ecl-sample/notebooks/test.eclnb
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
{
"id": "330c54b6-328d-4c80-9f26-d856383a8a63",
"name": "",
"value": "x = 1;\r\nz = 2;\r\nx + z;",
"value": "x = 1;\r\nz = 2;\r\nx + z * 6;",
"mode": "js",
"shared": true,
"outputs": [
"eCA9IDE7DQp6ID0gMjsNCnggKyB6Ow=="
"eCA9IDE7DQp6ID0gMjsNCnggKyB6ICogNjs="
]
},
{
Expand Down Expand Up @@ -37,7 +37,7 @@
"mode": "ecl",
"shared": true,
"outputs": [
"UGFyZW50RXh0cmFjdGVkID0gW3sibmFtZWlkIjoxLCJuYW1lIjoiR2F2aW4gICAgICAgICAgICAgICAifSx7Im5hbWVpZCI6MiwibmFtZSI6IkxpeiAgICAgICAgICAgICAgICAgIn0seyJuYW1laWQiOjMsIm5hbWUiOiJNciBOb2JvZHkgICAgICAgICAgICJ9LHsibmFtZWlkIjo0LCJuYW1lIjoiQW55d2hlcmUgICAgICAgICAgICAifV07UGFyZW50RGF0YVJlYWR5ID0gW3sibmFtZWlkIjoxLCJuYW1lIjoiR2F2aW4gICAgICAgICAgICAgICAiLCJudW1yb3dzIjowLCJjaGlsZHJlbiI6eyJSb3ciOltdfX0seyJuYW1laWQiOjIsIm5hbWUiOiJMaXogICAgICAgICAgICAgICAgICIsIm51bXJvd3MiOjAsImNoaWxkcmVuIjp7IlJvdyI6W119fSx7Im5hbWVpZCI6MywibmFtZSI6Ik1yIE5vYm9keSAgICAgICAgICAgIiwibnVtcm93cyI6MCwiY2hpbGRyZW4iOnsiUm93IjpbXX19LHsibmFtZWlkIjo0LCJuYW1lIjoiQW55d2hlcmUgICAgICAgICAgICAiLCJudW1yb3dzIjowLCJjaGlsZHJlbiI6eyJSb3ciOltdfX1dO05lc3RlZENoaWxkRGF0YXNldCA9IFt7Im5hbWVpZCI6MSwibmFtZSI6IkdhdmluICAgICAgICAgICAgICAgIiwibnVtcm93cyI6MSwiY2hpbGRyZW4iOnsiUm93IjpbeyJuYW1laWQiOjEsImFkZHIiOiIxMCBNYWx0IExhbmUgICAgICAgICJ9XX19LHsibmFtZWlkIjoyLCJuYW1lIjoiTGl6ICAgICAgICAgICAgICAgICAiLCJudW1yb3dzIjoyLCJjaGlsZHJlbiI6eyJSb3ciOlt7Im5hbWVpZCI6MiwiYWRkciI6IjEwIE1hbHQgTGFuZSAgICAgICAgIn0seyJuYW1laWQiOjIsImFkZHIiOiIzIFRoZSBjb3R0YWdlcyAgICAgICJ9XX19LHsibmFtZWlkIjozLCJuYW1lIjoiTXIgTm9ib2R5ICAgICAgICAgICAiLCJudW1yb3dzIjowLCJjaGlsZHJlbiI6eyJSb3ciOltdfX0seyJuYW1laWQiOjQsIm5hbWUiOiJBbnl3aGVyZSAgICAgICAgICAgICIsIm51bXJvd3MiOjQsImNoaWxkcmVuIjp7IlJvdyI6W3sibmFtZWlkIjo0LCJhZGRyIjoiSGVyZSAgICAgICAgICAgICAgICAifSx7Im5hbWVpZCI6NCwiYWRkciI6IlRoZXJlICAgICAgICAgICAgICAgIn0seyJuYW1laWQiOjQsImFkZHIiOiJOZWFyICAgICAgICAgICAgICAgICJ9LHsibmFtZWlkIjo0LCJhZGRyIjoiRmFyICAgICAgICAgICAgICAgICAifV19fV07Q2hpbGRyZW5FeHRyYWN0ZWQgPSBbeyJuYW1laWQiOjEsImFkZHIiOiIxMCBNYWx0IExhbmUgICAgICAgICJ9LHsibmFtZWlkIjoyLCJhZGRyIjoiMTAgTWFsdCBMYW5lICAgICAgICAifSx7Im5hbWVpZCI6MiwiYWRkciI6IjMgVGhlIGNvdHRhZ2VzICAgICAgIn0seyJuYW1laWQiOjQsImFkZHIiOiJIZXJlICAgICAgICAgICAgICAgICJ9LHsibmFtZWlkIjo0LCJhZGRyIjoiVGhlcmUgICAgICAgICAgICAgICAifSx7Im5hbWVpZCI6NCwiYWRkciI6Ik5lYXIgICAgICAgICAgICAgICAgIn0seyJuYW1laWQiOjQsImFkZHIiOiJGYXIgICAgICAgICAgICAgICAgICJ9XTs="
"UGFyZW50RGF0YVJlYWR5ID0gW3sibmFtZWlkIjoxLCJuYW1lIjoiR2F2aW4gICAgICAgICAgICAgICAiLCJudW1yb3dzIjowLCJjaGlsZHJlbiI6eyJSb3ciOltdfX0seyJuYW1laWQiOjIsIm5hbWUiOiJMaXogICAgICAgICAgICAgICAgICIsIm51bXJvd3MiOjAsImNoaWxkcmVuIjp7IlJvdyI6W119fSx7Im5hbWVpZCI6MywibmFtZSI6Ik1yIE5vYm9keSAgICAgICAgICAgIiwibnVtcm93cyI6MCwiY2hpbGRyZW4iOnsiUm93IjpbXX19LHsibmFtZWlkIjo0LCJuYW1lIjoiQW55d2hlcmUgICAgICAgICAgICAiLCJudW1yb3dzIjowLCJjaGlsZHJlbiI6eyJSb3ciOltdfX1dO05lc3RlZENoaWxkRGF0YXNldCA9IFt7Im5hbWVpZCI6MSwibmFtZSI6IkdhdmluICAgICAgICAgICAgICAgIiwibnVtcm93cyI6MSwiY2hpbGRyZW4iOnsiUm93IjpbeyJuYW1laWQiOjEsImFkZHIiOiIxMCBNYWx0IExhbmUgICAgICAgICJ9XX19LHsibmFtZWlkIjoyLCJuYW1lIjoiTGl6ICAgICAgICAgICAgICAgICAiLCJudW1yb3dzIjoyLCJjaGlsZHJlbiI6eyJSb3ciOlt7Im5hbWVpZCI6MiwiYWRkciI6IjEwIE1hbHQgTGFuZSAgICAgICAgIn0seyJuYW1laWQiOjIsImFkZHIiOiIzIFRoZSBjb3R0YWdlcyAgICAgICJ9XX19LHsibmFtZWlkIjozLCJuYW1lIjoiTXIgTm9ib2R5ICAgICAgICAgICAiLCJudW1yb3dzIjowLCJjaGlsZHJlbiI6eyJSb3ciOltdfX0seyJuYW1laWQiOjQsIm5hbWUiOiJBbnl3aGVyZSAgICAgICAgICAgICIsIm51bXJvd3MiOjQsImNoaWxkcmVuIjp7IlJvdyI6W3sibmFtZWlkIjo0LCJhZGRyIjoiSGVyZSAgICAgICAgICAgICAgICAifSx7Im5hbWVpZCI6NCwiYWRkciI6IlRoZXJlICAgICAgICAgICAgICAgIn0seyJuYW1laWQiOjQsImFkZHIiOiJOZWFyICAgICAgICAgICAgICAgICJ9LHsibmFtZWlkIjo0LCJhZGRyIjoiRmFyICAgICAgICAgICAgICAgICAifV19fV07UGFyZW50RXh0cmFjdGVkID0gW3sibmFtZWlkIjoxLCJuYW1lIjoiR2F2aW4gICAgICAgICAgICAgICAifSx7Im5hbWVpZCI6MiwibmFtZSI6IkxpeiAgICAgICAgICAgICAgICAgIn0seyJuYW1laWQiOjMsIm5hbWUiOiJNciBOb2JvZHkgICAgICAgICAgICJ9LHsibmFtZWlkIjo0LCJuYW1lIjoiQW55d2hlcmUgICAgICAgICAgICAifV07Q2hpbGRyZW5FeHRyYWN0ZWQgPSBbeyJuYW1laWQiOjEsImFkZHIiOiIxMCBNYWx0IExhbmUgICAgICAgICJ9LHsibmFtZWlkIjoyLCJhZGRyIjoiMTAgTWFsdCBMYW5lICAgICAgICAifSx7Im5hbWVpZCI6MiwiYWRkciI6IjMgVGhlIGNvdHRhZ2VzICAgICAgIn0seyJuYW1laWQiOjQsImFkZHIiOiJIZXJlICAgICAgICAgICAgICAgICJ9LHsibmFtZWlkIjo0LCJhZGRyIjoiVGhlcmUgICAgICAgICAgICAgICAifSx7Im5hbWVpZCI6NCwiYWRkciI6Ik5lYXIgICAgICAgICAgICAgICAgIn0seyJuYW1laWQiOjQsImFkZHIiOiJGYXIgICAgICAgICAgICAgICAgICJ9XTs="
]
},
{
Expand Down
53 changes: 53 additions & 0 deletions esbuild.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
import * as esbuild from "esbuild";
import copyStaticFiles from "esbuild-copy-static-files";
import process from "node:process";
import path from "node:path";
import { problemMatcher, removeStrict } from "@hpcc-js/esbuild-plugins";
import tsconfigNode from "./tsconfig.json" with {"type": "json"};
import tsconfigBrowser from "./tsconfig.webview.json" with {"type": "json"};

const outputDirectory = "dist";
const production = process.argv.includes("--production");
const watch = process.argv.includes("--watch");

async function main(tsconfigRaw, entryPoint, platform, format, plugins = []) {
const ctx = await esbuild.context({
tsconfigRaw,
entryPoints: [entryPoint],
outdir: outputDirectory,
bundle: true,
format,
minify: production,
sourcemap: !production ? "linked" : false,
platform,
target: platform === "node" ? "node20" : "es2022",
external: ["vscode", "fs", "path", "os"],
logLevel: production ? "silent" : "info",
plugins: [
...plugins,
problemMatcher(),
]
});
if (watch) {
await ctx.watch();
} else {
await ctx.rebuild();
await ctx.dispose();
}
}

Promise.all([
main(tsconfigNode, "./src/extension.ts", "node", "cjs", [
copyStaticFiles({
src: "./node_modules/@hpcc-js/ddl-shim/schema/v2.json",
dest: path.join(outputDirectory, "v2.json"),
})
]),
main(tsconfigBrowser, "./src/notebook/renderers/wuRenderer.tsx", "browser", "esm"),
main(tsconfigBrowser, "./src/notebook/renderers/ojsRenderer.ts", "browser", "esm"),
main(tsconfigBrowser, "./src/eclwatch.tsx", "browser", "iife", [removeStrict()]),
main(tsconfigBrowser, "./src/web-extension.ts", "browser", "iife")
]).catch((e) => {
console.error(e);
process.exit(1);
});
Loading

0 comments on commit e1bb74d

Please sign in to comment.