mjs and js

This commit is contained in:
Daniel Imms
2024-07-05 11:48:42 -07:00
parent 40c5fbf0cb
commit 057abba08b
18 changed files with 56 additions and 20 deletions
+1
View File
@@ -6,6 +6,7 @@
"url": "https://xtermjs.org/"
},
"main": "lib/addon-attach.js",
"module": "lib/addon-attach.mjs",
"types": "typings/addon-attach.d.ts",
"repository": "https://github.com/xtermjs/xterm.js/tree/master/addons/addon-attach",
"license": "MIT",
+1
View File
@@ -6,6 +6,7 @@
"url": "https://xtermjs.org/"
},
"main": "lib/addon-canvas.js",
"module": "lib/addon-canvas.mjs",
"types": "typings/addon-canvas.d.ts",
"repository": "https://github.com/xtermjs/xterm.js/tree/master/addons/addon-canvas",
"license": "MIT",
+1
View File
@@ -6,6 +6,7 @@
"url": "https://xtermjs.org/"
},
"main": "lib/addon-clipboard.js",
"module": "lib/addon-clipboard.mjs",
"types": "typings/addon-clipboard.d.ts",
"repository": "https://github.com/xtermjs/xterm.js/tree/master/addons/addon-clipboard",
"license": "MIT",
+1
View File
@@ -6,6 +6,7 @@
"url": "https://xtermjs.org/"
},
"main": "lib/addon-fit.js",
"module": "lib/addon-fit.mjs",
"types": "typings/addon-fit.d.ts",
"repository": "https://github.com/xtermjs/xterm.js/tree/master/addons/addon-fit",
"license": "MIT",
+1
View File
@@ -6,6 +6,7 @@
"url": "https://xtermjs.org/"
},
"main": "lib/addon-image.js",
"module": "lib/addon-image.mjs",
"types": "typings/addon-image.d.ts",
"repository": "https://github.com/xtermjs/xterm.js/tree/master/addons/addon-image",
"license": "MIT",
+1
View File
@@ -7,6 +7,7 @@
"url": "https://xtermjs.org/"
},
"main": "lib/addon-ligatures.js",
"module": "lib/addon-ligatures.mjs",
"types": "typings/addon-ligatures.d.ts",
"repository": "https://github.com/xtermjs/xterm.js/tree/master/addons/addon-ligatures",
"engines": {
+1
View File
@@ -6,6 +6,7 @@
"url": "https://xtermjs.org/"
},
"main": "lib/addon-search.js",
"module": "lib/addon-search.mjs",
"types": "typings/addon-search.d.ts",
"repository": "https://github.com/xtermjs/xterm.js/tree/master/addons/addon-search",
"license": "MIT",
+1
View File
@@ -6,6 +6,7 @@
"url": "https://xtermjs.org/"
},
"main": "lib/addon-serialize.js",
"module": "lib/addon-serialize.mjs",
"types": "typings/addon-serialize.d.ts",
"repository": "https://github.com/xtermjs/xterm.js/tree/master/addons/addon-serialize",
"license": "MIT",
@@ -6,6 +6,7 @@
"url": "https://xtermjs.org/"
},
"main": "lib/addon-unicode-graphemes.js",
"module": "lib/.addon-unicode-graphemes.mjs",
"types": "typings/addon-unicode-graphemes.d.ts",
"repository": "https://github.com/xtermjs/xterm.js/tree/master/addons/addon-unicode-graphemes",
"license": "MIT",
+1
View File
@@ -6,6 +6,7 @@
"url": "https://xtermjs.org/"
},
"main": "lib/addon-unicode11.js",
"module": "lib/addon-unicode11.mjs",
"types": "typings/addon-unicode11.d.ts",
"repository": "https://github.com/xtermjs/xterm.js/tree/master/addons/addon-unicode11",
"license": "MIT",
+1
View File
@@ -6,6 +6,7 @@
"url": "https://xtermjs.org/"
},
"main": "lib/addon-web-links.js",
"module": "lib/addon-web-links.mjs",
"types": "typings/addon-web-links.d.ts",
"repository": "https://github.com/xtermjs/xterm.js/tree/master/addons/addon-web-links",
"license": "MIT",
+1
View File
@@ -6,6 +6,7 @@
"url": "https://xtermjs.org/"
},
"main": "lib/addon-webgl.js",
"module": "lib/addon-webgl.mjs",
"types": "typings/addon-webgl.d.ts",
"repository": "https://github.com/xtermjs/xterm.js/tree/master/addons/addon-webgl",
"license": "MIT",
+18 -13
View File
@@ -56,7 +56,12 @@ const prodOptions = {
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/`
}
},
// footer: {
// js: `return __export__;\n});`
// },
format: 'esm',
// mangleProps: /_.+/,
};
@@ -101,7 +106,7 @@ if (config.addon) {
bundleConfig = {
...bundleConfig,
entryPoints: [`addons/addon-${config.addon}/src/${getAddonEntryPoint(config.addon)}.ts`],
outfile: `addons/addon-${config.addon}/lib/xterm-addon-${config.addon}.js`,
outfile: `addons/addon-${config.addon}/lib/xterm-addon-${config.addon}.mjs`,
};
outConfig = {
...outConfig,
@@ -125,7 +130,7 @@ if (config.addon) {
bundleConfig = {
...bundleConfig,
entryPoints: [`src/browser/public/Terminal.ts`],
outfile: `lib/xterm.js`
outfile: `lib/xterm.mjs`
};
outConfig = {
...outConfig,
@@ -147,18 +152,18 @@ if (config.isDemoClient) {
external: ['util', 'os', 'fs', 'path', 'stream', 'Terminal'],
alias: {
"@xterm/xterm": ".",
"@xterm/addon-attach": "./addons/addon-attach/lib/xterm-addon-attach.js",
"@xterm/addon-canvas": "./addons/addon-canvas/lib/xterm-addon-canvas.js",
"@xterm/addon-clipboard": "./addons/addon-clipboard/lib/xterm-addon-clipboard.js",
"@xterm/addon-fit": "./addons/addon-fit/lib/xterm-addon-fit.js",
"@xterm/addon-attach": "./addons/addon-attach/lib/xterm-addon-attach.mjs",
"@xterm/addon-canvas": "./addons/addon-canvas/lib/xterm-addon-canvas.mjs",
"@xterm/addon-clipboard": "./addons/addon-clipboard/lib/xterm-addon-clipboard.mjs",
"@xterm/addon-fit": "./addons/addon-fit/lib/xterm-addon-fit.mjs",
// "@xterm/addon-image": "./addons/addon-image/lib/xterm-addon-image.js",
// "@xterm/addon-ligatures": "./addons/addon-ligatures/lib/xterm-addon-ligatures.js",
"@xterm/addon-search": "./addons/addon-search/lib/xterm-addon-search.js",
"@xterm/addon-serialize": "./addons/addon-serialize/lib/xterm-addon-serialize.js",
"@xterm/addon-web-links": "./addons/addon-web-links/lib/xterm-addon-web-links.js",
"@xterm/addon-webgl": "./addons/addon-webgl/lib/xterm-addon-webgl.js",
"@xterm/addon-unicode11": "./addons/addon-unicode11/lib/xterm-addon-unicode11.js",
"@xterm/addon-unicode-graphemes": "./addons/addon-unicode-graphemes/lib/xterm-addon-unicode-graphemes.js",
"@xterm/addon-search": "./addons/addon-search/lib/xterm-addon-search.mjs",
"@xterm/addon-serialize": "./addons/addon-serialize/lib/xterm-addon-serialize.mjs",
"@xterm/addon-web-links": "./addons/addon-web-links/lib/xterm-addon-web-links.mjs",
"@xterm/addon-webgl": "./addons/addon-webgl/lib/xterm-addon-webgl.mjs",
"@xterm/addon-unicode11": "./addons/addon-unicode11/lib/xterm-addon-unicode11.mjs",
"@xterm/addon-unicode-graphemes": "./addons/addon-unicode-graphemes/lib/xterm-addon-unicode-graphemes.mjs",
// Needed for out-tsc based image addon
"common/Lifecycle": "./src/common/Lifecycle.ts",
+2
View File
@@ -3,6 +3,7 @@
"description": "Full xterm terminal, in your browser",
"version": "5.5.0",
"main": "lib/xterm.js",
"module": "lib/xterm.mjs",
"style": "css/xterm.css",
"types": "typings/xterm.d.ts",
"repository": "https://github.com/xtermjs/xterm.js",
@@ -67,6 +68,7 @@
"prepackage": "npm run build",
"package": "webpack",
"postpackage":"npm run esbuild-package",
"package-headless": "webpack --config ./webpack.config.headless.js",
"postpackage-headless": "node ./bin/package_headless.js",
"prepublishOnly": "npm run package"
+1 -1
View File
@@ -151,7 +151,7 @@ export class AccessibilityManager extends Disposable {
if (char === '\n') {
this._liveRegionLineCount++;
if (this._liveRegionLineCount === MAX_ROWS_TO_READ + 1) {
this._liveRegion.textContent += Strings.tooMuchOutput;
this._liveRegion.textContent += Strings.tooMuchOutput.get();
}
}
}
+1 -1
View File
@@ -443,7 +443,7 @@ export class CoreBrowserTerminal extends CoreTerminal implements ITerminal {
this.textarea = this._document.createElement('textarea');
this.textarea.classList.add('xterm-helper-textarea');
this.textarea.setAttribute('aria-label', Strings.promptLabel);
this.textarea.setAttribute('aria-label', Strings.promptLabel.get());
if (!Browser.isChromeOS) {
// ChromeVox on ChromeOS does not like this. See
// https://issuetracker.google.com/issues/260170397
+15 -4
View File
@@ -5,8 +5,19 @@
// This file contains strings that get exported in the API so they can be localized
// eslint-disable-next-line prefer-const
export let promptLabel = 'Terminal input';
let promptLabelInternal = 'Terminal input';
const promptLabel = {
get: () => promptLabelInternal,
set: (value: string) => promptLabelInternal = value
};
// eslint-disable-next-line prefer-const
export let tooMuchOutput = 'Too much output to announce, navigate to rows manually to read';
let tooMuchOutputInternal = 'Too much output to announce, navigate to rows manually to read';
const tooMuchOutput = {
get: () => tooMuchOutputInternal,
set: (value: string) => tooMuchOutputInternal = value
};
export {
promptLabel,
tooMuchOutput
};
+7 -1
View File
@@ -247,7 +247,13 @@ export class Terminal extends Disposable implements ITerminalApi {
this._addonManager.loadAddon(this, addon);
}
public static get strings(): ILocalizableStrings {
return Strings;
// A wrapper is required here because esbuild prevents setting an `export let`
return {
get promptLabel(): string { return Strings.promptLabel.get(); },
set promptLabel(value: string) { Strings.promptLabel.set(value); },
get tooMuchOutput(): string { return Strings.tooMuchOutput.get(); },
set tooMuchOutput(value: string) { Strings.tooMuchOutput.set(value); }
};
}
private _verifyIntegers(...values: number[]): void {