mirror of
https://github.com/wavetermdev/xterm.js.git
synced 2026-08-05 13:43:48 -07:00
xterm-core -> xterm-headless
This commit is contained in:
+1
-1
@@ -1,4 +1,4 @@
|
||||
Cursory test that 'xterm-core' works:
|
||||
Cursory test that 'xterm-headless' works:
|
||||
|
||||
```
|
||||
# From root of this repo
|
||||
|
||||
+1
-1
@@ -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', () => {
|
||||
|
||||
@@ -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",
|
||||
|
||||
@@ -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';
|
||||
|
||||
|
||||
@@ -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" }
|
||||
|
||||
+1
-1
@@ -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.
|
||||
*/
|
||||
@@ -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',
|
||||
};
|
||||
@@ -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',
|
||||
|
||||
Reference in New Issue
Block a user