Skip to content

Commit e85a73a

Browse files
imlucaskangas
authored andcommitted
INT-600: when in dev, copy result of your changes into app resources
still need to fix livereload so nothing printed to console but at least you can `cmd+r` to reload the view manually.
1 parent ff39f73 commit e85a73a

File tree

4 files changed

+49
-64
lines changed

4 files changed

+49
-64
lines changed

gulpfile.js

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
process.env.DEBUG = '*';
2-
31
/**
42
* # Welcome to Compass's gulpfile!
53
*
@@ -25,7 +23,8 @@ var merge = require('merge-stream');
2523
var shell = require('gulp-shell');
2624
var del = require('del');
2725
var sequence = require('run-sequence');
28-
26+
var watch = require('gulp-watch');
27+
// var livereload = require('gulp-livereload');
2928
var notify = require('./tasks/notify');
3029
var pkg = require('./package.json');
3130

@@ -99,6 +98,27 @@ gulp.task('watch', function() {
9998
gutil.log('package.json changed!');
10099
sequence('copy:package.json', 'npm:install');
101100
});
101+
102+
/**
103+
* @todo (imlucas) fix tiny-lr so it actually works with
104+
* npm@3...
105+
* var livereload = require('gulp-livereload');
106+
* // Fix so tiny-lr actually works with npm@3
107+
* var opts = {
108+
* livereload: path.resolve(
109+
* require.resolve('livereload-js'),
110+
* '../dist/livereload.js')
111+
* };
112+
* .pipe(livereload(opts));
113+
*
114+
* livereload.listen(opts);
115+
*/
116+
117+
// Copy any changes from `build/` into electron's
118+
// `resources/app` so changes are actually reflected.
119+
gulp.src(['build/{*,**/*,!node_modules/*}'])
120+
.pipe(watch('build/{*,**/*,!node_modules/*}'))
121+
.pipe(gulp.dest(path.join(platform.RESOURCES, 'app')));
102122
});
103123

104124
/**
@@ -169,7 +189,7 @@ gulp.task('build:pages', function() {
169189
* ## electron
170190
*/
171191
gulp.task('electron:start', function() {
172-
var child = spawn(path.resolve(platform.ELECTRON), ['build/']);
192+
var child = spawn(path.resolve(platform.ELECTRON), []);
173193
child.stderr.pipe(process.stderr);
174194
child.stdout.pipe(process.stdout);
175195
child.on('exit', function(code) {

package.json

Lines changed: 23 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,6 @@
2929
"jade",
3030
"ampersand-state",
3131
"scout-server",
32-
"tiny-lr",
33-
"watch",
3432
"glob",
3533
"electron-squirrel-startup"
3634
]
@@ -83,55 +81,54 @@
8381
"ampersand-view": "^8.0.0",
8482
"ampersand-view-switcher": "^2.0.0",
8583
"bootstrap": "https://github.com/twbs/bootstrap/archive/v3.3.5.tar.gz",
84+
"browserify": "^10.2.4",
8685
"bugsnag-js": "^2.4.8",
8786
"d3": "^3.5.5",
88-
"domready": "^1.0.8",
89-
"event-stream": "^3.3.1",
90-
"font-awesome": "https://github.com/FortAwesome/Font-Awesome/archive/v4.3.0.tar.gz",
91-
"glob": "^5.0.14",
92-
"jade": "^1.11.0",
93-
"jquery": "^2.1.4",
94-
"local-links": "^1.4.0",
95-
"lodash": "^3.9.3",
96-
"moment": "^2.10.3",
97-
"mongodb-extended-json": "^1.3.1",
98-
"mongodb-language-model": "^0.2.1",
99-
"mongodb-schema": "^3.3.0",
100-
"mousetrap": "^1.5.3",
101-
"numeral": "^1.5.3",
102-
"octicons": "https://github.com/github/octicons/archive/v2.2.0.tar.gz",
103-
"phantomjs-polyfill": "0.0.1",
104-
"pluralize": "^1.1.2",
105-
"qs": "^3.1.0",
106-
"raf": "^3.0.0",
107-
"scout-brain": "http://bin.mongodb.org/js/scout-brain/v0.0.2/scout-brain-0.0.2.tar.gz",
108-
"scout-client": "http://bin.mongodb.org/js/scout-client/v0.0.5/scout-client-0.0.5.tar.gz",
109-
"tiny-lr": "^0.1.6",
110-
"watch": "^0.16.0",
111-
"browserify": "^10.2.4",
11287
"del": "^1.2.0",
88+
"domready": "^1.0.8",
11389
"electron-installer-dmg": "^0.1.0",
11490
"electron-installer-squirrel-windows": "^0.4.0",
11591
"electron-packager": "^5.0.0",
11692
"eslint": "^0.24.1",
11793
"eslint-config-mongodb-js": "^0.1.4",
94+
"event-stream": "^3.3.1",
95+
"font-awesome": "https://github.com/FortAwesome/Font-Awesome/archive/v4.3.0.tar.gz",
96+
"glob": "^5.0.14",
11897
"gulp": "^3.9.0",
11998
"gulp-jade": "^1.0.1",
12099
"gulp-less": "^3.0.3",
121100
"gulp-shell": "^0.4.2",
122101
"gulp-sourcemaps": "^1.5.2",
123102
"gulp-util": "^3.0.6",
103+
"gulp-watch": "^4.3.5",
124104
"gulp-webserver": "^0.9.1",
105+
"jade": "^1.11.0",
125106
"jadeify": "^4.3.0",
107+
"jquery": "^2.1.4",
108+
"local-links": "^1.4.0",
109+
"lodash": "^3.9.3",
126110
"merge-stream": "^0.1.7",
127111
"mocha": "^2.2.5",
112+
"moment": "^2.10.3",
113+
"mongodb-extended-json": "^1.3.1",
128114
"mongodb-js-precommit": "^0.1.2",
115+
"mongodb-language-model": "^0.2.1",
116+
"mongodb-schema": "^3.3.0",
117+
"mousetrap": "^1.5.3",
129118
"nightmare": "^1.8.2",
130119
"node-notifier": "^4.2.3",
120+
"numeral": "^1.5.3",
121+
"octicons": "https://github.com/github/octicons/archive/v2.2.0.tar.gz",
131122
"phantomjs": "^1.9.17",
123+
"phantomjs-polyfill": "0.0.1",
124+
"pluralize": "^1.1.2",
132125
"pre-commit": "^1.0.10",
126+
"qs": "^3.1.0",
127+
"raf": "^3.0.0",
133128
"run-sequence": "^1.1.2",
134129
"run-series": "^1.1.2",
130+
"scout-brain": "http://bin.mongodb.org/js/scout-brain/v0.0.2/scout-brain-0.0.2.tar.gz",
131+
"scout-client": "http://bin.mongodb.org/js/scout-client/v0.0.5/scout-client-0.0.5.tar.gz",
135132
"stream-combiner2": "^1.0.2",
136133
"vinyl-buffer": "^1.0.0",
137134
"vinyl-source-stream": "^1.1.0",

src/electron/livereload.js

Lines changed: 0 additions & 33 deletions
This file was deleted.

tasks/windows-max-path-length-check.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,4 +37,5 @@ module.exports = function(src, dest, done) {
3737
});
3838
};
3939

40-
module.exports(path.join(process.cwd(), 'build/{!*.asar,*,**/*}'), path.resolve(platform.RESOURCES), console.error.bind(console));
40+
module.exports(path.join(process.cwd(), 'build/{!*.asar,*,**/*}'),
41+
path.resolve(platform.RESOURCES), console.error.bind(console));

0 commit comments

Comments
 (0)