Merge branch 'master' into underline-dotted

This commit is contained in:
Daniel Imms
2023-09-11 08:47:04 -07:00
committed by GitHub
83 changed files with 5445 additions and 4462 deletions
+3 -1
View File
@@ -1,7 +1,7 @@
{
"env": {
"browser": true,
"es6": true,
"es2021": true,
"node": true
},
"parser": "@typescript-eslint/parser",
@@ -13,9 +13,11 @@
"src/headless/tsconfig.json",
"test/api/tsconfig.json",
"test/benchmark/tsconfig.json",
"test/playwright/tsconfig.json",
"addons/xterm-addon-attach/src/tsconfig.json",
"addons/xterm-addon-attach/test/tsconfig.json",
"addons/xterm-addon-canvas/src/tsconfig.json",
"addons/xterm-addon-canvas/test/tsconfig.json",
"addons/xterm-addon-fit/src/tsconfig.json",
"addons/xterm-addon-fit/test/tsconfig.json",
"addons/xterm-addon-image/src/tsconfig.json",
+1 -1
View File
@@ -1,7 +1,7 @@
{
"env": {
"browser": true,
"es6": true,
"es2021": true,
"node": true
},
"parser": "@typescript-eslint/parser",
+92 -40
View File
@@ -90,14 +90,15 @@ jobs:
- uses: actions/download-artifact@v3
with:
name: build-artifacts
- name: Unzip artifacts (Linux, macOS)
if: runner.os != 'Windows'
run: unzip -o compressed-build.zip
- name: Unzip artifacts (Windows)
if: runner.os == 'Windows'
run: 7z x compressed-build.zip -aoa -o${{ github.workspace }}
- name: Print directory structure
run: ls -R
- name: Unzip artifacts
shell: bash
run: |
if [ "$RUNNER_OS" == "Windows" ]; then
pwsh -Command "7z x compressed-build.zip -aoa -o${{ github.workspace }}"
else
unzip -o compressed-build.zip
fi
ls -R
- name: Unit test coverage
run: |
yarn test-unit-coverage --forbid-only
@@ -131,14 +132,15 @@ jobs:
- uses: actions/download-artifact@v3
with:
name: build-artifacts
- name: Unzip artifacts (Linux, macOS)
if: runner.os != 'Windows'
run: unzip -o compressed-build.zip
- name: Unzip artifacts (Windows)
if: runner.os == 'Windows'
run: 7z x compressed-build.zip -aoa -o${{ github.workspace }}
- name: Print directory structure
run: ls -R
- name: Unzip artifacts
shell: bash
run: |
if [ "$RUNNER_OS" == "Windows" ]; then
pwsh -Command "7z x compressed-build.zip -aoa -o${{ github.workspace }}"
else
unzip -o compressed-build.zip
fi
ls -R
- name: Unit tests
run: yarn test-unit --forbid-only
@@ -164,14 +166,15 @@ jobs:
- uses: actions/download-artifact@v3
with:
name: build-artifacts
- name: Unzip artifacts (Linux, macOS)
if: runner.os != 'Windows'
run: unzip -o compressed-build.zip
- name: Unzip artifacts (Windows)
if: runner.os == 'Windows'
run: 7z x compressed-build.zip -aoa -o${{ github.workspace }}
- name: Print directory structure
run: ls -R
- name: Unzip artifacts
shell: bash
run: |
if [ "$RUNNER_OS" == "Windows" ]; then
pwsh -Command "7z x compressed-build.zip -aoa -o${{ github.workspace }}"
else
unzip -o compressed-build.zip
fi
ls -R
- name: Unit tests
run: yarn test-unit --forbid-only
@@ -204,17 +207,65 @@ jobs:
- uses: actions/download-artifact@v3
with:
name: build-artifacts
- name: Unzip artifacts (Linux, macOS)
if: runner.os != 'Windows'
run: unzip -o compressed-build.zip
- name: Unzip artifacts (Windows)
if: runner.os == 'Windows'
run: 7z x compressed-build.zip -aoa -o${{ github.workspace }}
- name: Print directory structure
run: ls -R
- name: Unzip artifacts
shell: bash
run: |
if [ "$RUNNER_OS" == "Windows" ]; then
pwsh -Command "7z x compressed-build.zip -aoa -o${{ github.workspace }}"
else
unzip -o compressed-build.zip
fi
ls -R
- name: Integration tests (${{ matrix.browser }})
run: yarn test-api-${{ matrix.browser }} --headless --forbid-only
test-playwright-parallel:
timeout-minutes: 20
strategy:
matrix:
node-version: [18] # just one as integration tests are about testing in browser
runs-on: [ubuntu] # macos is flaky
browser: [chromium, firefox, webkit]
runs-on: ${{ matrix.runs-on }}-latest
steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}.x
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}.x
cache: 'yarn'
- name: Install dependencies
run: |
yarn --frozen-lockfile
yarn install-addons
- name: Install playwright
run: npx playwright install --with-deps ${{ matrix.browser }}
- name: Wait for build job
uses: NathanFirmo/wait-for-other-job@v1.1.1
with:
token: ${{ secrets.GITHUB_TOKEN }}
job: build
- uses: actions/download-artifact@v3
with:
name: build-artifacts
- name: Unzip artifacts
shell: bash
run: |
if [ "$RUNNER_OS" == "Windows" ]; then
pwsh -Command "7z x compressed-build.zip -aoa -o${{ github.workspace }}"
else
unzip -o compressed-build.zip
fi
ls -R
- name: Build demo
run: yarn build-demo
- name: Integration tests (core) # Tests use 50% workers to reduce flakiness
run: yarn test-playwright-${{ matrix.browser }} --workers=50% --forbid-only --suite=core
- name: Integration tests (xterm-addon-canvas)
run: yarn test-playwright-${{ matrix.browser }} --workers=50% --forbid-only --suite=xterm-addon-canvas
- name: Integration tests (xterm-addon-webgl)
run: yarn test-playwright-${{ matrix.browser }} --workers=50% --forbid-only --suite=xterm-addon-webgl
test-api:
needs: build
timeout-minutes: 20
@@ -240,13 +291,14 @@ jobs:
- uses: actions/download-artifact@v3
with:
name: build-artifacts
- name: Unzip artifacts (Linux, macOS)
if: runner.os != 'Windows'
run: unzip -o compressed-build.zip
- name: Unzip artifacts (Windows)
if: runner.os == 'Windows'
run: 7z x compressed-build.zip -aoa -o${{ github.workspace }}
- name: Print directory structure
run: ls -R
- name: Unzip artifacts
shell: bash
run: |
if [ "$RUNNER_OS" == "Windows" ]; then
pwsh -Command "7z x compressed-build.zip -aoa -o${{ github.workspace }}"
else
unzip -o compressed-build.zip
fi
ls -R
- name: Integration tests (${{ matrix.browser }})
run: yarn test-api-${{ matrix.browser }} --headless --forbid-only
+11 -6
View File
@@ -43,7 +43,14 @@
{
"type": "chrome",
"request": "launch",
"name": "Demo Client",
"name": "Demo Client (Chrome)",
"url": "http://127.0.0.1:3000",
"webRoot": "${workspaceFolder}/"
},
{
"type": "msedge",
"request": "launch",
"name": "Demo Client (Edge)",
"url": "http://127.0.0.1:3000",
"webRoot": "${workspaceFolder}/"
},
@@ -52,11 +59,9 @@
"request": "launch",
"name": "Demo Server",
"runtimeExecutable": "npm",
"runtimeArgs": [
"run",
"start-debug"
],
"port": 9229,
"runtimeArgs": ["start"],
"stopOnEntry": true,
"runtimeVersion": "16",
"serverReadyAction": {
"action": "openExternally",
"pattern": "App listening to (http://.*?:[0-9]+)"
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "xterm-addon-attach",
"version": "0.8.0",
"version": "0.9.0",
"author": {
"name": "The xterm.js authors",
"url": "https://xtermjs.org/"
+1 -1
View File
@@ -1,7 +1,7 @@
{
"compilerOptions": {
"module": "commonjs",
"target": "es2015",
"target": "es2021",
"lib": [
"dom",
"es2015"
@@ -5,7 +5,7 @@
import WebSocket = require('ws');
import { openTerminal, pollFor, launchBrowser } from '../../../out-test/api/TestUtils';
import { Browser, Page } from 'playwright';
import { Browser, Page } from '@playwright/test';
const APP = 'http://127.0.0.1:3001/test';
+1 -1
View File
@@ -1,7 +1,7 @@
{
"compilerOptions": {
"module": "commonjs",
"target": "es2015",
"target": "es2021",
"lib": [
"es2015"
],
+3 -2
View File
@@ -1,6 +1,6 @@
{
"name": "xterm-addon-canvas",
"version": "0.4.0",
"version": "0.5.0",
"author": {
"name": "The xterm.js authors",
"url": "https://xtermjs.org/"
@@ -19,7 +19,8 @@
"build": "../../node_modules/.bin/tsc -p .",
"prepackage": "npm run build",
"package": "../../node_modules/.bin/webpack",
"prepublishOnly": "npm run package"
"prepublishOnly": "npm run package",
"start-server-only": "node ../../demo/start-server-only"
},
"peerDependencies": {
"xterm": "^5.0.0"
+2 -2
View File
@@ -1,10 +1,10 @@
{
"compilerOptions": {
"module": "commonjs",
"target": "es2015",
"target": "es2021",
"lib": [
"dom",
"es6"
"es2021"
],
"rootDir": ".",
"outDir": "../out",
@@ -0,0 +1,31 @@
/**
* Copyright (c) 2019 The xterm.js authors. All rights reserved.
* @license MIT
*/
import test from '@playwright/test';
import { ISharedRendererTestContext, injectSharedRendererTests } from '../../../out-test/playwright/SharedRendererTests';
import { ITestContext, createTestContext, openTerminal } from '../../../out-test/playwright/TestUtils';
let ctx: ITestContext;
const ctxWrapper: ISharedRendererTestContext = {
value: undefined,
skipCanvasExceptions: true
} as any;
test.beforeAll(async ({ browser }) => {
ctx = await createTestContext(browser);
await openTerminal(ctx);
ctxWrapper.value = ctx;
await ctx.page.evaluate(`
window.addon = new window.CanvasAddon(true);
window.term.loadAddon(window.addon);
`);
});
test.afterAll(async () => await ctx.page.close());
test.describe('Canvas Renderer Integration Tests', () => {
// HACK: The tests fail for an unknown reason
test.skip(({ browserName }) => browserName === 'webkit');
injectSharedRendererTests(ctxWrapper);
});
@@ -0,0 +1,35 @@
import { PlaywrightTestConfig } from '@playwright/test';
const config: PlaywrightTestConfig = {
testDir: '.',
timeout: 10000,
projects: [
{
name: 'Chrome Stable',
use: {
browserName: 'chromium',
channel: 'chrome'
}
},
{
name: 'Firefox Stable',
use: {
browserName: 'firefox'
}
},
{
name: 'WebKit',
use: {
browserName: 'webkit'
}
}
],
reporter: 'list',
webServer: {
command: 'npm run start-server-only',
port: 3000,
timeout: 120000,
reuseExistingServer: !process.env.CI
}
};
export default config;
@@ -0,0 +1,41 @@
{
"compilerOptions": {
"module": "commonjs",
"target": "es2015",
"lib": [
"es6",
],
"rootDir": ".",
"outDir": "../out-test",
"sourceMap": true,
"removeComments": true,
"baseUrl": ".",
"paths": {
"common/*": [
"../../../src/common/*"
],
"browser/*": [
"../../../src/browser/*"
]
},
"strict": true,
"types": [
"../../../node_modules/@types/node",
"../../../node_modules/@lunapaint/png-codec",
"../../../out-test/playwright/TestUtils",
"../../../out-test/playwright/SharedRendererTests"
]
},
"include": [
"./**/*",
"../../../typings/xterm.d.ts"
],
"references": [
{
"path": "../../../src/common"
},
{
"path": "../../../src/browser"
}
]
}
+2 -1
View File
@@ -2,6 +2,7 @@
"files": [],
"include": [],
"references": [
{ "path": "./src" }
{ "path": "./src" },
{ "path": "./test" }
]
}
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "xterm-addon-fit",
"version": "0.7.0",
"version": "0.8.0",
"author": {
"name": "The xterm.js authors",
"url": "https://xtermjs.org/"
+1 -1
View File
@@ -1,7 +1,7 @@
{
"compilerOptions": {
"module": "commonjs",
"target": "es2015",
"target": "es2021",
"lib": [
"dom",
"es2015"
+1 -1
View File
@@ -5,7 +5,7 @@
import { assert } from 'chai';
import { openTerminal, launchBrowser } from '../../../out-test/api/TestUtils';
import { Browser, Page } from 'playwright';
import { Browser, Page } from '@playwright/test';
const APP = 'http://127.0.0.1:3001/test';
+1 -1
View File
@@ -1,7 +1,7 @@
{
"compilerOptions": {
"module": "commonjs",
"target": "es2015",
"target": "es2021",
"lib": [
"es2015"
],
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "xterm-addon-image",
"version": "0.5.0",
"version": "0.6.0",
"author": {
"name": "The xterm.js authors",
"url": "https://xtermjs.org/"
@@ -5,7 +5,7 @@
import { assert } from 'chai';
import { openTerminal, launchBrowser, pollFor } from '../../../out-test/api/TestUtils';
import { Browser, Page } from 'playwright';
import { Browser, Page } from '@playwright/test';
import { IImageAddonOptions } from '../src/Types';
import { FINALIZER, introducer, sixelEncode } from 'sixel';
import { readFileSync } from 'fs';

Some files were not shown because too many files have changed in this diff Show More