stringparser / gulp-runtime Goto Github PK
View Code? Open in Web Editor NEWan alternate interface to vinyl-fs
License: Other
an alternate interface to vinyl-fs
License: Other
From #14
@DarkPark It would be nice to have the ability to quick gulp reload
That would be a very cool feature, yeah! it could complicate everything really fast though. Because if is something along these lines is cool. I mean you would want to launch gulp
again from the beginning or reload some file?... hum one would need both :D
I'll investigate about this. If there is a simple solution I'll do it after testing what is already done.
While making the documentation I've noticed that the --cwd
flag is missing. Is not that of a big thing at the moment but should be in to be consistent with gulp CLI.
Maybe we could integrate some of this into core at some point - I like this
Provide path completion. Sniff the directory tree and concat them with the existing ones.
stdout
. How to test?stdin
and stdout
?.some tasks without watchers (just to build something and exit immediately) do not terminate
I was on an empty line, type the task name and pressed Enter
the result is:
lint
[15:30:31] Starting 'lint'...
> gulp /home/dp/Projects/web/framework/app/js/develop/debug.js: line 18, col 14, 'isHost' is not defined.
/home/dp/Projects/web/framework/app/js/develop/debug.js: line 34, col 14, 'isHost' is not defined.
/home/dp/Projects/web/framework/app/js/develop/debug.js: line 66, col 14, 'isHost' is not defined.
3 errors
[15:30:32] Finished 'lint' after 436 ms
maybe it's okay in this case not to show > gulp
at all?
or on the fly correct the first line lint
to > gulp lint
The prompt is automatically moved to a new line when there are no matches.
Instead of printing all the completion text and go to a new line, it would be better to preserve the cursor position.
was not able to make it work
maybe you will see the problem
it's a cli app
#!/usr/bin/env node
var gulp = require('gulp');
gulp.task('repl', function () {
var runtime = require('gulp-runtime');
runtime.setPrompt('>');
});
// exec selected task
gulp.start('repl');
and no REPL, error output:
[19:18:48] Starting 'repl'...
[19:18:48] From plugin `gulp-runtime`
[19:18:48] Working directory changed to /usr/bin
[19:18:48] Using gulpfile Error: configFile `stb.js` not found in `/usr/bin`
[19:18:48] Finished 'repl' after 0,120588953
[19:18:48] From plugin `gulp-runtime`
[19:18:48] Task 'default' is not in your gulpfile
[19:18:48] Please check the documentation for proper gulpfile formatting
I've just finished the first version of the docs.
Anything you find incorrect, confusing or incomplete let me know in this issue
🎯
again can't make it work
TypeError: Object #<Object> has no method 'createInterface'
at Object.<anonymous> (/home/dp/Projects/web/framework/node_modules/gulp-runtime/lib/gulp-runtime.js:6:26)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Module.require (module.js:364:17)
at require (module.js:380:17)
at Object.<anonymous> (/home/dp/Projects/web/framework/node_modules/gulp-runtime/index.js:1:80)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
separate single task execution from command line
# gulp less:develop
[12:55:02] Using gulpfile ~/Projects/web/framework/gulpfile.js
[12:55:02] Starting 'less:develop'...
[12:55:02] less: Size Name
[12:55:02] less: 6601 ./build/develop/css/480.map
[12:55:02] less: 2801 ./build/develop/css/480.css
[12:55:02] less: 6601 ./build/develop/css/576.map
[12:55:02] less: 2801 ./build/develop/css/576.css
[12:55:02] less: 6601 ./build/develop/css/1080.map
[12:55:02] less: 2814 ./build/develop/css/1080.css
[12:55:02] less: 6601 ./build/develop/css/720.map
[12:55:02] less: 2807 ./build/develop/css/720.css
[12:55:02] Finished 'less:develop' after 148 ms
but the same with gulp-runtime fails:
# gulp
// some output goes here
// when everything is ready type
less:develop
[12:54:46] less: Size Name
[12:54:46] Starting 'less:develop' ...
[12:54:46] less: 0 ./build/develop/css/480.css ('main.less' wasn't found in input 7:0)
[12:54:46] less: 0 ./build/develop/css/576.css ('main.less' wasn't found in input 7:0)
[12:54:46] less: 0 ./build/develop/css/720.css ('main.less' wasn't found in input 7:0)
[12:54:46] less: 0 ./build/develop/css/1080.css ('main.less' wasn't found in input 7:0)
[12:54:46] Finished 'less:develop' after 9.7 ms
seems to me it may be a problem with path resolving differently it these two modes
I'll be useful to provide a way to recall the history of the last session on the project.
[17:19:27] ReferenceError: argumens is not defined
at Function.Runtime.waiting (/home/dp/Projects/web/framework/node_modules/gulp-runtime/node_modules/runtime/lib/runtime.js:330:29)
at Function.Runtime.startup (/home/dp/Projects/web/framework/node_modules/gulp-runtime/node_modules/runtime/lib/runtime.js:362:10)
at Gulp.<anonymous> (/home/dp/Projects/web/framework/gulpfile.js:31:26)
at module.exports (/home/dp/Projects/web/framework/node_modules/gulp/node_modules/orchestrator/lib/runTask.js:34:7)
at Gulp.Orchestrator._runTask (/home/dp/Projects/web/framework/node_modules/gulp/node_modules/orchestrator/index.js:273:3)
at Gulp.Orchestrator._runStep (/home/dp/Projects/web/framework/node_modules/gulp/node_modules/orchestrator/index.js:214:10)
at /home/dp/Projects/web/framework/node_modules/gulp/node_modules/orchestrator/index.js:279:18
at finish (/home/dp/Projects/web/framework/node_modules/gulp/node_modules/orchestrator/lib/runTask.js:21:8)
at module.exports (/home/dp/Projects/web/framework/node_modules/gulp/node_modules/orchestrator/lib/runTask.js:60:3)
at Gulp.Orchestrator._runTask (/home/dp/Projects/web/framework/node_modules/gulp/node_modules/orchestrator/index.js:273:3)
Although separation between stack
and tasks is done well, logging for the stacks is not correctly reported.
Steps
1.- write a gulpfile.js
like so
var gulp = require('gulp-runtime').create();
gulp.task(':one', function (done) {
setTimeout(done, 120);
});
gulp.task('default', gulp.series('one', 'two'));
2.- run it
On the command line do node gulpfile.js
Expected
Task logging to be Starting default:series(one, two)
Actual
Task logging is Start default:series(:one, :one)
it would be nice to be able to turn off (or change) the > gulp
prompt as it ruins the output of the following lines (in watch mode tasks are dumping logs right in this prompt line)
[11:54:28] [weinre] 2014-07-25T08:54:28.487Z weinre: starting server at http://localhost:8090
> gulp [11:54:39] [static] 10 990 127.0.0.1 404 GET /tests/
[11:54:39] [static] 11 061 127.0.0.1 404 GET /favicon.ico
seems messy and inaccurate
I've noticed that the default prompt is an empty line now and as for me it's totally fine:
[10:55:29] Finished 'default' after 299 ms
jade <<<< runtime command is here
[10:59:41] Starting 'jade:develop', 'jade:release', 'jade:tests' ...
[10:59:41] Finished 'jade:release' after 62 ms, 'jade:develop' after 65 ms, 'jade:tests' after 62 ms
[10:59:41] Starting 'jade' ...
[10:59:41] Finished 'jade' after 16 μs
[10:59:41] index.html was reloaded.
[10:59:41] index.html was reloaded.
[10:59:41] index.html was reloaded.
but then I press TAB key:
--require --gulpfile --log --silent --tasks -T --tasks-simple -v --version img:clean:develop img:clean:release img:develop
img:release jade:develop jade:release jade:tests jade less:develop less:release less lint proxy static webpack:develop
webpack:release webpack:tests webpack weinre develop release tests default
>
prompt somehow has changed to >
it would be nice if it stays empty line all the time
v.0.2.62
[15:48:14] TypeError: Object #<Object> has no method 'callsite'
at Function.proto.require (/home/dp/Projects/web/framework/node_modules/gulp-runtime/node_modules/runtime/lib/runtime.js:178:19)
at Object.<anonymous> (/home/dp/Projects/web/framework/node_modules/gulp-runtime/lib/utils.js:18:26)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Module.require (module.js:364:17)
at require (module.js:380:17)
at Object.<anonymous> (/home/dp/Projects/web/framework/node_modules/gulp-runtime/lib/gulp-runtime.js:6:1)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
very often after npm update
I receive this:
npm ERR! Linux 3.13.0-40-generic
npm ERR! argv "node" "/usr/bin/npm" "update"
npm ERR! node v0.10.33
npm ERR! npm v2.1.8
npm ERR! path /home/dp/Projects/web/stb/node_modules/gulp-runtime/node_modules/runtime/node_modules/whech/node_modules/findup/node_modules
npm ERR! code EEXIST
npm ERR! errno 47
npm ERR! EEXIST, mkdir '/home/dp/Projects/web/stb/node_modules/gulp-runtime/node_modules/runtime/node_modules/whech/node_modules/findup/node_modules'
File exists: /home/dp/Projects/web/stb/node_modules/gulp-runtime/node_modules/runtime/node_modules/whech/node_modules/findup/node_modules
Move it away, and try again.
npm ERR! Please include the following file with any support request:
npm ERR! /home/dp/Projects/web/stb/npm-debug.log
At the moment is possible to run commands defined. It would be also helpful to consume them on demand based on instance's events or common ground like onStartup
event, which is already implemented.
For example, could do
var runtime = require('gulp-runtime');
runtime.onStartup(function(){
this.run(<command1> + <command2> + ...);
})
At the moment is possible to do
runtime.onStartup(function(){
this.setPrompt(' > custom prompt');
this.prompt()
})
v.0.2.5
started gulp and tried to run a specific task
it was executed but with a warning
lint
[15:18:01] Starting 'lint'...
[warning] -> command `lint` not found
> gulp [15:18:01] Finished 'lint' after 435 ms
Discussion below. I will edit this post to keep things clear.
@DarkPark dump useful information on process
exit
.
What would make info to be useful?
How would one measure that?
task
events(new) implementation has started here
The solution for this shouldn't be hacky and have [email protected] on mind.
I would have to investigate how this will change on [email protected] because that's a lot of movement to track.
without gulp-runtime it's possible to end the process in the terminal with Ctrl+C
but with gulp-runtime it's necessary to press it twice
would be nice to either do it with single press or after the first press print something like
"To terminate the session press Ctrl+C again"
var path = require('path'),
gulp = require('gulp-runtime').create({repl: true}),
glr = require('gulp-livereload'),
log = require('./tasks/utils').log;
// enable colors in console
require('tty-colors');
// load tasks
require('./tasks/img');
require('./tasks/jade');
require('./tasks/lint');
require('./tasks/static');
require('./tasks/webpack');
// entry point
gulp.task('default', ['lint', 'img', 'jade', 'webpack', 'static'], function () {
//gulp.watch(['./server/**/*.js'], ['apidoc']);
// serve livereload
glr.listen({quiet: true});
// reload event
gulp.watch(['./build/**/*.{html,js,css}']).on('change', function ( file ) {
// report
log('watch '.bgCyan.black, 'reload ' + ('./' + path.relative(path.join(__dirname, '..'), file.path)).bold);
// reload
glr.changed(file);
});
});
I get:
$ node gulpfile.js
/home/dp/Projects/fortnotes/client/node_modules/gulp-runtime/lib/proto.js:144
throw error;
^
Error: task `default` doesn't give a hint of its completion
Meaning: it doesn't return nor uses a callback
Solution:
- return a stream, promise or observable
- use the callback that is passed as first argument
--
at Runtime.task (~/Projects/fortnotes/client/node_modules/gulp-runtime/lib/proto.js:136:13)
at Object.<anonymous> (/home/dp/Projects/fortnotes/client/gulpfile.js:31:6)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Function.Module.runMain (module.js:497:10)
at startup (node.js:119:16)
at node.js:935:3
but the default
task shouldn't be completed
anyway a hint what I'm doing wrong would be nice :)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.