From d0f45fee25d67cc0f703caf52d28dc33b2e583b6 Mon Sep 17 00:00:00 2001 From: Paris Kasidiaris Date: Mon, 5 Feb 2018 14:30:57 +0200 Subject: [PATCH 1/3] Fix #1232: Add `webpack:watch` gulp task --- Procfile | 1 + gulpfile.js | 4 ++++ package.json | 4 ++-- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/Procfile b/Procfile index 063b78f4..64562488 100644 --- a/Procfile +++ b/Procfile @@ -1 +1,2 @@ web: npm start +webpack: npm run webpack:watch diff --git a/gulpfile.js b/gulpfile.js index 7a65d7f2..de64ee91 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -192,6 +192,10 @@ gulp.task('webpack', ['build'], function() { .pipe(gulp.dest('demo/dist/')); }); +gulp.task('webpack:watch', ['webpack'], () => { + gulp.watch('./src/*', ['webpack']); +}); + /** * Submit coverage results to coveralls.io */ diff --git a/package.json b/package.json index 3e14ff3f..c16409dc 100644 --- a/package.json +++ b/package.json @@ -75,7 +75,6 @@ "zmodem.js": "^0.1.5" }, "scripts": { - "prestart": "gulp webpack", "start": "node demo/app", "prestart-zmodem": "npm run build", "start-zmodem": "node build/addons/zmodem/demo/app", @@ -86,7 +85,8 @@ "build": "gulp build", "prepublish": "npm run build", "coveralls": "gulp coveralls", - "webpack": "gulp webpack" + "webpack": "gulp webpack", + "webpack:watch": "gulp webpack:watch" }, "dependencies": {} } From 182426dd0fa79fa212cdad95d05400f33e62ad91 Mon Sep 17 00:00:00 2001 From: Paris Kasidiaris Date: Tue, 6 Feb 2018 10:28:34 +0200 Subject: [PATCH 2/3] =?UTF-8?q?Rename=20gulp=20task:=20`webpack:watch`=20?= =?UTF-8?q?=E2=86=92=20watch`=20and=20also=20monitor=20subdirectories?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Procfile | 2 +- gulpfile.js | 4 ++-- package.json | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Procfile b/Procfile index 64562488..44bf043c 100644 --- a/Procfile +++ b/Procfile @@ -1,2 +1,2 @@ web: npm start -webpack: npm run webpack:watch +webpack: npm run watch diff --git a/gulpfile.js b/gulpfile.js index de64ee91..4353e46d 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -192,8 +192,8 @@ gulp.task('webpack', ['build'], function() { .pipe(gulp.dest('demo/dist/')); }); -gulp.task('webpack:watch', ['webpack'], () => { - gulp.watch('./src/*', ['webpack']); +gulp.task('watch', ['webpack'], () => { + gulp.watch(['./src/*', './src/**/*'], ['webpack']); }); /** diff --git a/package.json b/package.json index c16409dc..1a718fbc 100644 --- a/package.json +++ b/package.json @@ -86,7 +86,7 @@ "prepublish": "npm run build", "coveralls": "gulp coveralls", "webpack": "gulp webpack", - "webpack:watch": "gulp webpack:watch" + "watch": "gulp watch" }, "dependencies": {} } From f02903a6df9e380a9131ae95046a793f1578b954 Mon Sep 17 00:00:00 2001 From: Paris Kasidiaris Date: Tue, 6 Feb 2018 11:16:57 +0200 Subject: [PATCH 3/3] Update README.md and Docker files --- Dockerfile | 2 +- README.md | 47 +++++++++++++++++++++++++++++++++++++++------- demo/index.html | 2 +- docker-compose.yml | 7 +++++++ 4 files changed, 49 insertions(+), 9 deletions(-) diff --git a/Dockerfile b/Dockerfile index 22556f43..1c72e679 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM node:6 +FROM node:8 MAINTAINER Paris Kasidiaris # Set the working directory diff --git a/README.md b/README.md index 740ff0aa..cc1c8950 100644 --- a/README.md +++ b/README.md @@ -131,27 +131,60 @@ Do you use xterm.js in your application as well? Please [open a Pull Request](ht ## Demo -### Linux or macOS +Xterm.js ships with a barebones demo implementation, designed for the development and evaluation of the library only. Exposing the demo to the public as is would introduce security risks for the host. -First, be sure that a C++ compiler such as GCC-C++ or Clang is installed, then run these commands: +Below you can find instructions on how to run the demo on different platforms. + +### SourceLair + +SourceLair will run the demo and builder in parallel automatically. Just make sure to choose the "Node.js" project type, when cloning the xterm.js repo (or just use this shortcut; https://lair.io/xtermjs/xtermjs). + +Then open your project's [Public URL](https://help.sourcelair.com/projects/the-public-url/) to access the demo. + +### Docker + +First, make sure you have Docker Engine 1.13.0 (or newer) and Docker Compose 1.10.0 (or newer). To run the demo and builder in parallel, run the following command in your terminal: + +``` +docker-compose up +``` + +Then open http://0.0.0.0:3000 in a web browser to access the demo. If you prefer a different port than `3000` to access the xterm.js demo, then set the `XTERMJS_PORT` environment variable to the desired port. + +### Foreman (or other Procfile runner) + +First, be sure that a C++ compiler such as GCC-C++ or Clang is installed, then run the following commands in your terminal: ``` npm install -npm start +foreman start # Replace foreman with "honcho", "forego" etc. depending on your runner ``` -Then open http://0.0.0.0:3000 in a web browser. +Then open http://0.0.0.0:3000 in a web browser to access the demo. + +### Linux or macOS + +First, be sure that a C++ compiler such as GCC-C++ or Clang is installed, then run the following commands in your terminal: + +``` +npm install +npm start # Run this in its own terminal +npm run watch # Run this in its own terminal +``` + +Then open http://0.0.0.0:3000 in a web browser to access the demo. ### Windows -First, ensure [node-gyp](https://github.com/nodejs/node-gyp) is installed and configured correctly, then run these commands. +First, ensure [node-gyp](https://github.com/nodejs/node-gyp) is installed and configured correctly, then run the following commands in your terminal: ``` npm install -npm start +npm start # Run this in its own terminal +npm run watch # Run this in its own terminal ``` -Then open http://127.0.0.1:3000 in a web browser. +Then open http://127.0.0.1:3000 in a web browser to access the demo. *Note: Do not use ConEmu, as it seems to break the demo for some reason.* diff --git a/demo/index.html b/demo/index.html index da348f5e..b6d0ff61 100644 --- a/demo/index.html +++ b/demo/index.html @@ -67,7 +67,7 @@ -

Attention: The demo is a barebones implementation and is designed for xterm.js evaluation purposes only. Exposing the demo to the public as is would introduce security risks for the host.

+

Attention: The demo is a barebones implementation and is designed for the development and evaluation of xterm.js only. Exposing the demo to the public as is would introduce security risks for the host.

diff --git a/docker-compose.yml b/docker-compose.yml index 03e88fbc..effd975c 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -7,3 +7,10 @@ services: - ./:/usr/src/app ports: - ${XTERMJS_PORT:3000}:3000 + command: ["npm", "start"] + + watch: + build: . + volumes: + - ./:/usr/src/app + command: ["npm", "run", "watch"]