-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Introduce build system based on Gulp #435
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
| const gulp = require('gulp'); | ||
| const merge = require('merge-stream'); | ||
| const source = require('vinyl-source-stream'); | ||
| const sourcemaps = require('gulp-sourcemaps'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, I'll take a look. gulp-sourcemaps was supposed to do this when using loadMaps.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If this could be fixed before this was merged that would be great as I use dev tools pretty heavily for xterm.js dev.
| "test": "mocha --recursive ./lib", | ||
| "build:docs": "jsdoc -c jsdoc.json", | ||
| "build": "./bin/build", | ||
| "build": "gulp build", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unrelated but can we merge npm run dev into npm start? I was confused as to why watching wasn't happening on npm start. I don't think there's any point to not watch on the dev version?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's leave this for another PR to keep this as much in context as possible.
gulpfile.js
Outdated
| .pipe(source('xterm.js')) | ||
| .pipe(buffer()) | ||
| .pipe(sourcemaps.init({ | ||
| loadMaps: true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Might be more readable on one line:
.pipe(sourcemaps.init({ loadMaps: true }))| "fs-extra": "^1.0.0", | ||
| "glob": "^7.0.5", | ||
| "gulp": "^3.9.1", | ||
| "gulp-cli": "^1.2.2", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think you install this in the project, only globally.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When used in an package.json script it works. Npm adds ./node_modules/.bin in PATH when running via npm run ....
ca15d6b to
ccbe4db
Compare
|
Status update based on @Tyriar's comment #435 (comment) on broken source maps. It seems that The most important change I found out is that Other than that it seems that the structure is different as well and a wild guess is that the new source maps have messed up |
4eab7a9 to
0cc5be7
Compare
|
@Tyriar everything should be fine now (except for the tests on Travis, which I have to fix). Can you please give it a try and also run the tests and let me know if |
|
I see the same issue, must be a Linux problem with the paths (it should contain |
|
It's not working because the initial sourcemaps are wrong: Should be: Or (what it is before this PR): |
- Add Gulp and new dependencies to `package.json`
- Add `gulpfile.js` with four tasks:
- `tsc`: For building TypeScript sources
- `bundle`: For bundling JavaScript modules in a monolith
- `sorcery`: For resolving the source map chains back to the original TypeScript files
- `build` (`default`): Runs the whole `tsc` → `bundle` → `sorcery` chain
- Clean up `Dockerfile`, since `cpio` is not needed any more
- Clean up not needed dependencies from `package.json`
- Remove `bin/build`
- Update `bin/release` to use `npm run build` instead of `./bin/build`
0cc5be7 to
081fe3f
Compare
Paths became absolute by default at gulp-sourcemaps/gulp-sourcemaps@fb4027a
|
@Tyriar this should be 👌 for review. The error was caused by gulp-sourcemaps/gulp-sourcemaps@fb4027a. |
Tyriar
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It works 😄

This PR closes #359.
Details
package.jsongulpfile.jswith two tasks:tsc: For building TypeScript sourcesbuild: For building and bundling JavaScript modules in a monolithDockerfile, sincecpiois not needed any morepackage.jsonbin/buildbin/releaseto usenpm run buildinstead of./bin/build