Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
fe3019765b | ||
|
|
d1cf6854b5 | ||
|
|
2eaa244907 | ||
|
|
e1e5c1c44f | ||
|
|
45ed27d329 |
+30
-43
@@ -18,11 +18,13 @@ const ts = require('gulp-typescript');
|
|||||||
const util = require('gulp-util');
|
const util = require('gulp-util');
|
||||||
const webpack = require('webpack-stream');
|
const webpack = require('webpack-stream');
|
||||||
|
|
||||||
let buildDir = process.env.BUILD_DIR || 'build';
|
const buildDir = process.env.BUILD_DIR || 'build';
|
||||||
let tsProject = ts.createProject('tsconfig.json');
|
const tsProject = ts.createProject('tsconfig.json');
|
||||||
let srcDir = tsProject.config.compilerOptions.rootDir;
|
const srcDir = tsProject.config.compilerOptions.rootDir;
|
||||||
let outDir = tsProject.config.compilerOptions.outDir;
|
let outDir = tsProject.config.compilerOptions.outDir;
|
||||||
|
|
||||||
|
const addons = ['attach', 'fit', 'fullscreen', 'search', 'terminado', 'winptyCompat', 'zmodem'];
|
||||||
|
|
||||||
// Under some environments like TravisCI, this comes out at absolute which can
|
// Under some environments like TravisCI, this comes out at absolute which can
|
||||||
// break the build. This ensures that the outDir is absolute.
|
// break the build. This ensures that the outDir is absolute.
|
||||||
if (path.normalize(outDir).indexOf(__dirname) !== 0) {
|
if (path.normalize(outDir).indexOf(__dirname) !== 0) {
|
||||||
@@ -45,7 +47,6 @@ gulp.task('tsc', function () {
|
|||||||
tsResult.dts.pipe(sourcemaps.write('.', {includeContent: false, sourceRoot: ''})).pipe(gulp.dest(outDir))
|
tsResult.dts.pipe(sourcemaps.write('.', {includeContent: false, sourceRoot: ''})).pipe(gulp.dest(outDir))
|
||||||
);
|
);
|
||||||
|
|
||||||
let addons = ['attach', 'fit', 'fullscreen', 'search', 'terminado', 'winptyCompat', 'zmodem'];
|
|
||||||
let addonStreams = addons.map(function(addon) {
|
let addonStreams = addons.map(function(addon) {
|
||||||
fs.emptyDirSync(`${outDir}/addons/${addon}`);
|
fs.emptyDirSync(`${outDir}/addons/${addon}`);
|
||||||
|
|
||||||
@@ -103,45 +104,29 @@ gulp.task('browserify', ['tsc'], function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
gulp.task('browserify-addons', ['tsc'], function() {
|
gulp.task('browserify-addons', ['tsc'], function() {
|
||||||
let searchOptions = {
|
const bundles = addons.map((addon) => {
|
||||||
basedir: `${buildDir}/addons/search`,
|
const addonOptions = {
|
||||||
debug: true,
|
basedir: `${buildDir}/addons/${addon}`,
|
||||||
entries: [`${outDir}/addons/search/search.js`],
|
debug: true,
|
||||||
cache: {},
|
entries: [`${outDir}/addons/${addon}/${addon}.js`],
|
||||||
packageCache: {}
|
standalone: addon,
|
||||||
};
|
cache: {},
|
||||||
let searchBundle = browserify(searchOptions)
|
packageCache: {}
|
||||||
.external(path.join(outDir, 'Terminal.js'))
|
};
|
||||||
.bundle()
|
|
||||||
.pipe(source('./addons/search/search.js'))
|
|
||||||
.pipe(buffer())
|
|
||||||
.pipe(sourcemaps.init({loadMaps: true, sourceRoot: ''}))
|
|
||||||
.pipe(sourcemaps.write('./'))
|
|
||||||
.pipe(gulp.dest(buildDir));
|
|
||||||
|
|
||||||
let winptyCompatOptions = {
|
const addonBundle = browserify(addonOptions)
|
||||||
basedir: `${buildDir}/addons/winptyCompat`,
|
.external(path.join(outDir, 'Terminal.js'))
|
||||||
debug: true,
|
.bundle()
|
||||||
entries: [`${outDir}/addons/winptyCompat/winptyCompat.js`],
|
.pipe(source(`./addons/${addon}/${addon}.js`))
|
||||||
cache: {},
|
.pipe(buffer())
|
||||||
packageCache: {}
|
.pipe(sourcemaps.init({loadMaps: true, sourceRoot: ''}))
|
||||||
};
|
.pipe(sourcemaps.write('./'))
|
||||||
let winptyCompatBundle = browserify(winptyCompatOptions)
|
.pipe(gulp.dest(buildDir));
|
||||||
.external(path.join(outDir, 'Terminal.js'))
|
|
||||||
.bundle()
|
|
||||||
.pipe(source('./addons/winptyCompat/winptyCompat.js'))
|
|
||||||
.pipe(buffer())
|
|
||||||
.pipe(sourcemaps.init({loadMaps: true, sourceRoot: ''}))
|
|
||||||
.pipe(sourcemaps.write('./'))
|
|
||||||
.pipe(gulp.dest(buildDir));
|
|
||||||
|
|
||||||
// Copy all add-ons from outDir to buildDir
|
return addonBundle;
|
||||||
let copyAddons = gulp.src([
|
});
|
||||||
// Copy JS addons
|
|
||||||
`${outDir}/addons/**/*`
|
|
||||||
]).pipe(gulp.dest(`${buildDir}/addons`));
|
|
||||||
|
|
||||||
return merge(searchBundle, winptyCompatBundle, copyAddons);
|
return merge(...bundles);
|
||||||
});
|
});
|
||||||
|
|
||||||
gulp.task('instrument-test', function () {
|
gulp.task('instrument-test', function () {
|
||||||
@@ -189,9 +174,11 @@ gulp.task('sorcery', ['browserify'], function () {
|
|||||||
});
|
});
|
||||||
|
|
||||||
gulp.task('sorcery-addons', ['browserify-addons'], function () {
|
gulp.task('sorcery-addons', ['browserify-addons'], function () {
|
||||||
var chain = sorcery.loadSync(`${buildDir}/addons/search/search.js`);
|
addons.forEach((addon) => {
|
||||||
chain.apply();
|
const chain = sorcery.loadSync(`${buildDir}/addons/${addon}/${addon}.js`);
|
||||||
chain.writeSync();
|
chain.apply();
|
||||||
|
chain.writeSync();
|
||||||
|
})
|
||||||
});
|
});
|
||||||
|
|
||||||
gulp.task('webpack', ['build'], function() {
|
gulp.task('webpack', ['build'], function() {
|
||||||
|
|||||||
+1
-1
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "xterm",
|
"name": "xterm",
|
||||||
"description": "Full xterm terminal, in your browser",
|
"description": "Full xterm terminal, in your browser",
|
||||||
"version": "3.0.0",
|
"version": "3.0.2",
|
||||||
"ignore": [
|
"ignore": [
|
||||||
"demo",
|
"demo",
|
||||||
"test",
|
"test",
|
||||||
|
|||||||
@@ -53,6 +53,7 @@ export class Renderer extends EventEmitter implements IRenderer {
|
|||||||
};
|
};
|
||||||
this._devicePixelRatio = window.devicePixelRatio;
|
this._devicePixelRatio = window.devicePixelRatio;
|
||||||
this._updateDimensions();
|
this._updateDimensions();
|
||||||
|
this.onOptionsChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
public onWindowResize(devicePixelRatio: number): void {
|
public onWindowResize(devicePixelRatio: number): void {
|
||||||
|
|||||||
Reference in New Issue
Block a user