Adopt project references

Recent versions of TypeScript has improved the performance of project
references so they are now viable to switch over to.
This commit is contained in:
Daniel Imms
2019-03-30 14:05:24 -07:00
parent 1451bcb6ae
commit 0b78011fa3
11 changed files with 77 additions and 53 deletions
+2 -2
View File
@@ -2,8 +2,8 @@
<html>
<head>
<title>xterm.js demo</title>
<link rel="stylesheet" href="/build/xterm.css" />
<link rel="stylesheet" href="/build/addons/fullscreen/fullscreen.css" />
<link rel="stylesheet" href="/src/xterm.css" />
<link rel="stylesheet" href="/src/addons/fullscreen/fullscreen.css" />
<link rel="stylesheet" href="style.css" />
<script src="https://cdnjs.cloudflare.com/ajax/libs/es6-promise/4.1.1/es6-promise.auto.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/fetch/1.0.0/fetch.min.js"></script>
+1
View File
@@ -11,6 +11,7 @@ function startServer() {
logs = {};
app.use('/build', express.static(__dirname + '/../build'));
app.use('/src', express.static(__dirname + '/../src'));
app.get('/', function(req, res){
res.sendFile(__dirname + '/index.html');
+5 -5
View File
@@ -16,9 +16,9 @@ const ts = require('gulp-typescript');
const util = require('gulp-util');
const buildDir = process.env.BUILD_DIR || 'build';
const tsProject = ts.createProject('tsconfig.json');
let srcDir = tsProject.config.compilerOptions.rootDir;
let outDir = tsProject.config.compilerOptions.outDir;
const tsProject = ts.createProject('src/tsconfig.json');
let srcDir = './src';
let outDir = './lib';
const addons = fs.readdirSync(`${__dirname}/src/addons`);
@@ -61,7 +61,7 @@ gulp.task('browserify', function() {
};
let bundleStream = browserify(browserifyOptions)
.bundle()
.pipe(source('xterm.js'))
.pipe(source(`xterm.js`))
.pipe(buffer())
.pipe(sourcemaps.init({loadMaps: true, sourceRoot: '..'}))
.pipe(sourcemaps.write('./'))
@@ -136,6 +136,6 @@ gulp.task('sorcery-addons', ['browserify-addons'], function () {
})
});
gulp.task('build', ['sorcery', 'sorcery-addons']);
gulp.task('build', ['css', 'sorcery', 'sorcery-addons']);
gulp.task('test', ['mocha']);
gulp.task('default', ['build']);
+3 -7
View File
@@ -38,7 +38,7 @@
"ts-loader": "^4.5.0",
"tslint": "^5.9.1",
"tslint-consistent-codestyle": "^1.13.0",
"typescript": "3.1",
"typescript": "3.4",
"vinyl-buffer": "^1.0.0",
"vinyl-source-stream": "^1.1.0",
"webpack": "^4.17.1",
@@ -50,20 +50,16 @@
"start-debug": "node --inspect-brk demo/start",
"start-zmodem": "node demo/zmodem/app",
"lint": "tslint 'src/**/*.ts' './demo/**/*.ts'",
"pretest": "npm run layering",
"test": "npm run mocha",
"posttest": "npm run lint",
"test-debug": "node --inspect-brk node_modules/.bin/gulp test",
"test-suite": "gulp mocha-suite --test",
"test-coverage": "nyc -x gulpfile.js -x '**/*test*' npm run mocha",
"mocha": "gulp test",
"tsc": "tsc",
"prebuild": "concurrently --kill-others-on-fail --names \"lib,attach,fit,fullscreen,search,terminado,webLinks,winptyCompat,zmodem,css\" \"tsc\" \"tsc -p ./src/addons/attach\" \"tsc -p ./src/addons/fit\" \"tsc -p ./src/addons/fullscreen\" \"tsc -p ./src/addons/search\" \"tsc -p ./src/addons/terminado\" \"tsc -p ./src/addons/webLinks\" \"tsc -p ./src/addons/winptyCompat\" \"tsc -p ./src/addons/zmodem\" \"gulp css\"",
"prebuild": "tsc -b ./src/tsconfig.all.json",
"build": "gulp build",
"prepublish": "npm run build",
"coveralls": "nyc report --reporter=text-lcov | coveralls",
"watch": "concurrently --kill-others-on-fail --names \"lib,css\" \"tsc -w\" \"gulp watch-css\"",
"watch-addons": "concurrently --kill-others-on-fail --names \"attach,fit,fullscreen,search,terminado,webLinks,winptyCompat,zmodem\" \"tsc -w -p ./src/addons/attach\" \"tsc -w -p ./src/addons/fit\" \"tsc -w -p ./src/addons/fullscreen\" \"tsc -w -p ./src/addons/search\" \"tsc -w -p ./src/addons/terminado\" \"tsc -w -p ./src/addons/webLinks\" \"tsc -w -p ./src/addons/winptyCompat\" \"tsc -w -p ./src/addons/zmodem\"",
"layering": "concurrently --kill-others-on-fail --names \"common,core\" \"tsc -p ./src/common\" \"tsc -p ./src/core\""
"watch": "tsc -b -w ./src/tsconfig.all.json"
}
}
+2 -12
View File
@@ -1,17 +1,7 @@
{
"extends": "../tsconfig-library-base",
"compilerOptions": {
"target": "es5",
"lib": [
"es5"
],
"rootDir": ".",
"noEmit": true,
"strict": true,
"pretty": true,
"types": [
"../../node_modules/@types/mocha",
"../../"
]
"outDir": "../../lib"
},
"include": [
"./**/*"
+6 -14
View File
@@ -1,20 +1,12 @@
{
"extends": "../tsconfig-library-base",
"compilerOptions": {
"target": "es5",
"lib": [
"es5"
],
"rootDir": ".",
"noEmit": true,
"strict": true,
"pretty": true,
"types": [
"../../node_modules/@types/mocha",
"../../"
]
"outDir": "../../lib"
},
"include": [
"./**/*",
"../common/**/*"
"./**/*"
],
"references": [
{ "path": "../common" }
]
}
+15
View File
@@ -0,0 +1,15 @@
{
"compilerOptions": {
"target": "es5",
"lib": [ "es5" ],
"rootDir": ".",
"sourceMap": true,
"removeComments": true,
"pretty": true,
"incremental": true,
"skipLibCheck": true
}
}
+11
View File
@@ -0,0 +1,11 @@
{
"extends": "./tsconfig-base.json",
"compilerOptions": {
"types": [
"../../node_modules/@types/mocha",
"../../"
],
"composite": true,
"strict": true
}
}
+16
View File
@@ -0,0 +1,16 @@
{
"files": [],
"include": [],
"references": [
{ "path": "." },
{ "path": "./addons/attach" },
{ "path": "./addons/fit" },
{ "path": "./addons/fullscreen" },
{ "path": "./addons/search" },
{ "path": "./addons/terminado" },
{ "path": "./addons/webLinks" },
{ "path": "./addons/winptyCompat" },
{ "path": "./addons/zmodem" }
]
}
+12 -9
View File
@@ -1,7 +1,7 @@
{
"extends": "./tsconfig-base",
"compilerOptions": {
"module": "commonjs",
"target": "es5",
"lib": [
"dom",
"es5",
@@ -9,19 +9,22 @@
"scripthost",
"es2015.promise"
],
"rootDir": "src",
"outDir": "lib",
"sourceMap": true,
"removeComments": true,
"preserveWatchOutput": true,
"rootDir": ".",
"outDir": "../lib",
"noUnusedLocals": true,
"noImplicitAny": true
},
"include": [
"src/**/*",
"typings/xterm.d.ts"
"./**/*",
"../typings/xterm.d.ts"
],
"exclude": [
"src/addons/**/*"
"./addons/**/*"
],
"references": [
{ "path": "./common" },
{ "path": "./core" }
]
}
+4 -4
View File
@@ -6633,10 +6633,10 @@ typedarray@^0.0.6, typedarray@~0.0.5:
resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777"
integrity sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=
typescript@3.1:
version "3.1.6"
resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.1.6.tgz#b6543a83cfc8c2befb3f4c8fba6896f5b0c9be68"
integrity sha512-tDMYfVtvpb96msS1lDX9MEdHrW4yOuZ4Kdc4Him9oU796XldPYF/t2+uKoX0BBa0hXXwDlqYQbXY5Rzjzc5hBA==
typescript@3.4:
version "3.4.1"
resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.4.1.tgz#b6691be11a881ffa9a05765a205cb7383f3b63c6"
integrity sha512-3NSMb2VzDQm8oBTLH6Nj55VVtUEpe/rgkIzMir0qVoLyjDZlnMBva0U6vDiV3IH+sl/Yu6oP5QwsAQtHPmDd2Q==
uglify-es@^3.3.4:
version "3.3.9"