From f769d03e0c32ee1155ecdcf956b7b8b9ca8e3654 Mon Sep 17 00:00:00 2001 From: Daniel Imms <2193314+Tyriar@users.noreply.github.com> Date: Tue, 10 Aug 2021 12:27:43 -0700 Subject: [PATCH] xterm-core -> xterm-headless --- node-test/README.md | 2 +- node-test/index.js | 2 +- package.json | 1 + src/headless/public/Terminal.ts | 2 +- src/headless/tsconfig.json | 2 +- .../{xterm-core.d.ts => xterm-headless.d.ts} | 2 +- webpack.config.core.js | 41 ------------------- webpack.config.headless.js | 8 ++-- 8 files changed, 10 insertions(+), 50 deletions(-) rename typings/{xterm-core.d.ts => xterm-headless.d.ts} (99%) delete mode 100644 webpack.config.core.js diff --git a/node-test/README.md b/node-test/README.md index 0da50146..cd346848 100644 --- a/node-test/README.md +++ b/node-test/README.md @@ -1,4 +1,4 @@ -Cursory test that 'xterm-core' works: +Cursory test that 'xterm-headless' works: ``` # From root of this repo diff --git a/node-test/index.js b/node-test/index.js index 2fd8da7f..55359c8e 100644 --- a/node-test/index.js +++ b/node-test/index.js @@ -2,7 +2,7 @@ import { createRequire } from 'module'; const require = createRequire(import.meta.url); const Terminal = require('../lib-headless/xterm.js').Terminal; -console.log('Creating xterm-core terminal...'); +console.log('Creating xterm-headless terminal...'); const terminal = new Terminal(); console.log('Writing to terminal...') terminal.write('foo \x1b[1;31mbar\x1b[0m baz', () => { diff --git a/package.json b/package.json index 47fd0a89..beffc66b 100644 --- a/package.json +++ b/package.json @@ -10,6 +10,7 @@ "scripts": { "prepackage": "npm run build", "package": "webpack", + "package-headless": "webpack --config ./webpack.config.headless.js", "compile": "tsc -b ./src/common/public/tsconfig.json", "start": "node demo/start", "start-debug": "node --inspect-brk demo/start", diff --git a/src/headless/public/Terminal.ts b/src/headless/public/Terminal.ts index 44f9753a..f14bdd55 100644 --- a/src/headless/public/Terminal.ts +++ b/src/headless/public/Terminal.ts @@ -7,7 +7,7 @@ import { IEvent } from 'common/EventEmitter'; import { BufferNamespaceApi } from 'common/public/BufferNamespaceApi'; import { ParserApi } from 'common/public/ParserApi'; import { UnicodeApi } from 'common/public/UnicodeApi'; -import { IBufferNamespace as IBufferNamespaceApi, IMarker, IParser, ITerminalAddon, ITerminalOptions, IUnicodeHandling, Terminal as ITerminalApi } from 'xterm-core'; +import { IBufferNamespace as IBufferNamespaceApi, IMarker, IParser, ITerminalAddon, ITerminalOptions, IUnicodeHandling, Terminal as ITerminalApi } from 'xterm-headless'; import { Terminal as TerminalCore } from 'headless/Terminal'; import { AddonManager } from 'common/public/AddonManager'; diff --git a/src/headless/tsconfig.json b/src/headless/tsconfig.json index 6085a07f..b579af97 100644 --- a/src/headless/tsconfig.json +++ b/src/headless/tsconfig.json @@ -18,7 +18,7 @@ "include": [ "./**/*", "../../typings/xterm.d.ts", // common/Types.d.ts imports from 'xterm' - "../../typings/xterm-core.d.ts" + "../../typings/xterm-headless.d.ts" ], "references": [ { "path": "../common" } diff --git a/typings/xterm-core.d.ts b/typings/xterm-headless.d.ts similarity index 99% rename from typings/xterm-core.d.ts rename to typings/xterm-headless.d.ts index eabb51fc..3dd9d69e 100644 --- a/typings/xterm-core.d.ts +++ b/typings/xterm-headless.d.ts @@ -7,7 +7,7 @@ * to be stable and consumed by external programs. */ -declare module 'xterm-core' { +declare module 'xterm-headless' { /** * A string representing log level. */ diff --git a/webpack.config.core.js b/webpack.config.core.js deleted file mode 100644 index 85c37ff1..00000000 --- a/webpack.config.core.js +++ /dev/null @@ -1,41 +0,0 @@ -/** - * Copyright (c) 2019 The xterm.js authors. All rights reserved. - * @license MIT - */ - -const path = require('path'); - -/** - * This webpack config does a production build for xterm-core.js. It works by taking the output from tsc - * (via `yarn watch` or `yarn prebuild`) which are put into `xterm-core/` and webpacks them into a - * production mode commonjs library module in `lib/`. The aliases are used fix up the absolute paths - * output by tsc (because of `baseUrl` and `paths` in `tsconfig.json`. - */ -module.exports = { - entry: './xterm-core/common/public/Terminal.js', - devtool: 'source-map', - module: { - rules: [ - { - test: /\.js$/, - use: ["source-map-loader"], - enforce: "pre", - exclude: /node_modules/ - } - ] - }, - resolve: { - modules: ['./node_modules'], - extensions: [ '.js' ], - alias: { - common: path.resolve('./xterm-core/common') - } - }, - output: { - filename: 'xterm-core.js', - path: path.resolve('./lib'), - libraryTarget: 'commonjs' - }, - mode: 'production', - target: 'node', -}; diff --git a/webpack.config.headless.js b/webpack.config.headless.js index 7ae66676..805b9a3e 100644 --- a/webpack.config.headless.js +++ b/webpack.config.headless.js @@ -6,10 +6,10 @@ const path = require('path'); /** - * This webpack config does a production build for xterm.js. It works by taking the output from tsc - * (via `yarn watch` or `yarn prebuild`) which are put into `out/` and webpacks them into a - * production mode umd library module in `lib/`. The aliases are used fix up the absolute paths - * output by tsc (because of `baseUrl` and `paths` in `tsconfig.json`. + * This webpack config does a production build for xterm.js headless. It works by taking the output + * from tsc (via `yarn watch` or `yarn prebuild`) which are put into `out/` and webpacks them into a + * production mode umd library module in `lib-headless/`. The aliases are used fix up the absolute + * paths output by tsc (because of `baseUrl` and `paths` in `tsconfig.json`. */ module.exports = { entry: './out/headless/public/Terminal.js',