Skip to content

Commit

Permalink
feat: Bump versions
Browse files Browse the repository at this point in the history
Signed-off-by: Gordon Smith <GordonJSmith@gmail.com>
  • Loading branch information
GordonSmith committed Sep 12, 2024
1 parent b5122ab commit 495c7f9
Show file tree
Hide file tree
Showing 15 changed files with 7,506 additions and 9,327 deletions.
26 changes: 5 additions & 21 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,6 +21,7 @@ module.exports = {
"debugConfig": "readonly",
"Promise": "readonly"
},
ignorePatterns: ["src/grammar/**/*"],
rules: {
"no-redeclare": "off",
"no-empty": "off",
Expand Down Expand Up @@ -72,27 +74,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",
}
};
22 changes: 12 additions & 10 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,17 +16,19 @@
},
{
"type": "npm",
"label": "bundle-ext watch",
"script": "bundle-ext-watch",
"problemMatcher": [],
"label": "gen-webview-watch",
"script": "gen-webview-watch",
"problemMatcher": [
"$tsc-watch"
],
"presentation": {
"group": "group-build"
}
},
{
"type": "npm",
"label": "bundle-web watch",
"script": "bundle-web-watch",
"label": "build-ts-watch",
"script": "build-ts-watch",
"problemMatcher": [],
"presentation": {
"group": "group-build"
Expand All @@ -35,9 +37,9 @@
{
"label": "build",
"dependsOn": [
"compile watch",
"bundle-ext watch",
"bundle-web watch",
"gen-node-watch",
"gen-webview-watch",
"build-ts-watch"
],
"group": {
"kind": "build",
Expand Down
46 changes: 46 additions & 0 deletions esbuild.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
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, nodeTpl } 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 watch = process.argv.includes("--watch");
const production = !watch && process.argv.includes("--production");

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"),
main(tsconfigBrowser, "./src/notebook/renderers/ojsRenderer.ts", "browser", "esm"),
main(tsconfigBrowser, "./src/webview.ts", "browser", "iife")
]).catch((e) => {
console.error(e);
process.exit(1);
});
Loading

0 comments on commit 495c7f9

Please sign in to comment.