mirror of
https://github.com/wavetermdev/xterm.js.git
synced 2026-08-05 13:43:48 -07:00
Add esbuild server build task
This commit is contained in:
@@ -199,8 +199,10 @@ jobs:
|
||||
unzip -o compressed-build.zip
|
||||
fi
|
||||
ls -R
|
||||
- name: Build demo
|
||||
run: npm run esbuild-demo
|
||||
- name: Build demo client
|
||||
run: npm run esbuild-demo-client
|
||||
- name: Build demo server
|
||||
run: npm run esbuild-demo-server
|
||||
- name: Integration tests (core) # Tests use 50% workers to reduce flakiness
|
||||
run: npm run test-integration-${{ matrix.browser }} --workers=50% --forbid-only --suite=core
|
||||
- name: Integration tests (addon-attach)
|
||||
|
||||
Vendored
+15
-3
@@ -23,7 +23,7 @@
|
||||
{
|
||||
"label": "dev (separate terminals)",
|
||||
"detail": "Runs all tasks required to run the demo in separate terminals. This does support problem matching.",
|
||||
"dependsOn": ["demo-server", "tsc", "esbuild", "esbuild-demo"],
|
||||
"dependsOn": ["demo-server", "tsc", "esbuild", "esbuild-demo-client", "esbuild-demo-server"],
|
||||
"group": "build"
|
||||
},
|
||||
|
||||
@@ -64,9 +64,21 @@
|
||||
}
|
||||
},
|
||||
{
|
||||
"label": "esbuild-demo",
|
||||
"label": "esbuild-demo-client",
|
||||
"type": "npm",
|
||||
"script": "esbuild-demo-watch",
|
||||
"script": "esbuild-demo-client-watch",
|
||||
"dependsOn": ["esbuild", "tsc"],
|
||||
"group": "build",
|
||||
"isBackground": true,
|
||||
"problemMatcher": "$esbuild-watch",
|
||||
"presentation": {
|
||||
"group": "xterm-demo"
|
||||
}
|
||||
},
|
||||
{
|
||||
"label": "esbuild-demo-server",
|
||||
"type": "npm",
|
||||
"script": "esbuild-demo-server-watch",
|
||||
"dependsOn": ["esbuild", "tsc"],
|
||||
"group": "build",
|
||||
"isBackground": true,
|
||||
|
||||
+1
-1
@@ -4,7 +4,7 @@ import { spawn } from "child_process";
|
||||
import { readdir } from "fs/promises";
|
||||
import { argv } from "process";
|
||||
|
||||
/** @type {{cp: import("child_process").ChildProcessByStdio, name: string}[]} */
|
||||
/** @type {{cp: import("child_process").ChildProcessByStdio<any, any, any>, name: string}[]} */
|
||||
const jobs = [];
|
||||
|
||||
// Core job
|
||||
|
||||
@@ -2,10 +2,10 @@
|
||||
* WARNING: This demo is a barebones implementation designed for development and evaluation
|
||||
* purposes only. It is definitely NOT production ready and does not aim to be so. Exposing the
|
||||
* demo to the public as is would introduce security risks for the host.
|
||||
**/
|
||||
*/
|
||||
|
||||
import * as express from 'express';
|
||||
import * as expressWs from 'express-ws';
|
||||
import express from 'express';
|
||||
import expressWs from 'express-ws';
|
||||
import * as os from 'os';
|
||||
import * as pty from 'node-pty';
|
||||
import * as path from 'path';
|
||||
@@ -16,7 +16,7 @@ interface IDisposable {
|
||||
}
|
||||
|
||||
/** Whether to use binary transport. */
|
||||
const USE_BINARY = os.platform() !== "win32";
|
||||
const USE_BINARY = os.platform() !== 'win32';
|
||||
|
||||
const demoRoot = path.join(__dirname, '..');
|
||||
|
||||
@@ -169,7 +169,7 @@ function startServer(): void {
|
||||
term.onData(function(data) {
|
||||
try {
|
||||
send(data as string & Buffer);
|
||||
} catch (ex) {
|
||||
} catch {
|
||||
// The WebSocket is not open, ignore
|
||||
}
|
||||
});
|
||||
|
||||
@@ -3,7 +3,8 @@
|
||||
"module": "commonjs",
|
||||
"target": "es2021",
|
||||
"rootDir": ".",
|
||||
"sourceMap": true
|
||||
"sourceMap": true,
|
||||
"esModuleInterop": true
|
||||
},
|
||||
"include": [
|
||||
"server.ts"
|
||||
|
||||
+8
-4
@@ -27,9 +27,11 @@
|
||||
"xterm"
|
||||
],
|
||||
"scripts": {
|
||||
"setup": "npm run build",
|
||||
"presetup": "npm run build",
|
||||
"setup": "npm run esbuild",
|
||||
"postsetup": "npm run esbuild-demo-server",
|
||||
"start": "node demo/start",
|
||||
"dev": "concurrently -k -p [{name}] -n tsc,esbuild,esbuild-demo,server -c blue,yellow,cyan,green \"npm:tsc-watch\" \"npm:esbuild-watch\" \"npm:esbuild-demo-watch\" \"npm:start\"",
|
||||
"dev": "concurrently -k -p [{name}] -n tsc,esbuild,esbuild-demo-client,esbuild-demo-server,server -c blue,yellow,cyan,green,magenta \"npm:tsc-watch\" \"npm:esbuild-watch\" \"npm:esbuild-demo-client-watch\" \"npm:esbuild-demo-server-watch\" \"npm:start\"",
|
||||
"build": "npm run tsc",
|
||||
"watch": "npm run tsc-watch",
|
||||
"tsc": "tsc -b ./tsconfig.all.json",
|
||||
@@ -39,8 +41,10 @@
|
||||
"esbuild-package": "node bin/esbuild_all.mjs --prod",
|
||||
"esbuild-package-watch": "node bin/esbuild_all.mjs --prod --watch",
|
||||
"esbuild-package-headless-only": "node bin/esbuild.mjs --prod --headless",
|
||||
"esbuild-demo": "node bin/esbuild.mjs --demo-client",
|
||||
"esbuild-demo-watch": "node bin/esbuild.mjs --demo-client --watch",
|
||||
"esbuild-demo-client": "node bin/esbuild.mjs --demo-client",
|
||||
"esbuild-demo-client-watch": "node bin/esbuild.mjs --demo-client --watch",
|
||||
"esbuild-demo-server": "node bin/esbuild.mjs --demo-server",
|
||||
"esbuild-demo-server-watch": "node bin/esbuild.mjs --demo-server --watch",
|
||||
"test": "npm run test-unit",
|
||||
"posttest": "npm run lint",
|
||||
"lint": "eslint --max-warnings 0 src/ addons/",
|
||||
|
||||
Reference in New Issue
Block a user