lambdabaa / confidant Goto Github PK
View Code? Open in Web Editor NEWConfigure your project for ninja's parallel and incremental builds with pure js
License: Mozilla Public License 2.0
Configure your project for ninja's parallel and incremental builds with pure js
License: Mozilla Public License 2.0
ie bower_components
and node_modules
So we should use it instead...
./node_modules/.bin/confidant . --exclude test/
/home/gareth/Documents/sf/mobile/node_modules/confidant/build/ninja_stream.js:32
tasks.forEach(function (task) {
^
TypeError: tasks.forEach is not a function
at NinjaStream._transform (/home/gareth/Documents/sf/mobile/node_modules/confidant/build/ninja_stream.js:32:9)
at NinjaStream.Transform._read (_stream_transform.js:167:10)
at NinjaStream.Transform._write (_stream_transform.js:155:12)
at doWrite (_stream_writable.js:292:12)
at writeOrBuffer (_stream_writable.js:278:5)
at NinjaStream.Writable.write (_stream_writable.js:207:11)
at FindStream.ondata (_stream_readable.js:521:20)
at emitOne (events.js:77:13)
at FindStream.emit (events.js:169:7)
at readableAddChunk (_stream_readable.js:146:16)
Agh! Yikes! This is important but hadn't thought about it until just now.
Whoops!
Seeing a lot of
install: invalid option -- 'e'
Try 'install --help' for more information.
ninja: build stopped: subcommand failed.
According to README.md:
Confidant will scan the filesystem rooted at the directory from which it is run for files named configure.js
thus, if we want to launch build system like this
confidant dir DEBUG=1 DEVICE_TYPE=phone
These ENVs such as DEBUG=1, DEVICE_TYPE=phone have to pass into every configure.js, and each configure.js runs on different node -e
will mean inside different process. For being able to communicate ENVs within configure.js, these is my solution:
Pass every necessary environment variables while invoking node -e
in build.ninja. That could increase length of build.ninja because you may see like this:
rule rule-0
command = cd /Users/Ricky/Documents/confidant/test/fixtures/config_filter && node -e VARIABLE1=xxx VARIABLE2=xxx VARIABLE3=xxx "// source code ..."
Debuggability is still a problem if we want to trace into build.ninja file, but I am going to do this if you feel ok :)
confidant is meant to be muy fast. To this end, it would be nice to have a benchmark of a typical web/js and measure the speed of our configuration generation and generated build over time.
Currently we only allow task configurations to specify a single output. We need to be able to specify multiple outputs from a single build task.
You can do anything with confidant that you could in pure js and we should provide examples for how users who want to share and/or compose rules can do so. It's possible that looking into this might influence changes in the configuration file format (or lead us to write a little helper or two).
The tests weren't passing last time I checked, but we can definitely make this happen with a bit of investigation.
This happens currently with the config.js
file in test/fixtures/rjs
.
I like configure.js
.
It should surface the config files it finds and perhaps how long it takes to run.
confidant needs assertions that that the input is correct and should fail (and not write a ninja config) if it's given invalid input.
gareth@albee:~/Documents/gaia$ ./node_modules/.bin/confidant
/home/gareth/Documents/gaia/node_modules/confidant/build/ninja_stream.js:29
tasks.forEach(function (task) {
^
TypeError: undefined is not a function
at NinjaStream._transform (/home/gareth/Documents/gaia/node_modules/confidant/build/ninja_stream.js:29:9)
at NinjaStream.Transform._read (_stream_transform.js:179:10)
at NinjaStream.Transform._write (_stream_transform.js:167:12)
at doWrite (_stream_writable.js:301:12)
at writeOrBuffer (_stream_writable.js:288:5)
at NinjaStream.Writable.write (_stream_writable.js:217:11)
at Filter.ondata (_stream_readable.js:540:20)
at Filter.emit (events.js:107:17)
at readableAddChunk (_stream_readable.js:163:16)
at Filter.Readable.push (_stream_readable.js:126:10)
It's so weird I found confidant cannot work properly in some node versions ex: 0.10.36 & 0.12.7 and it lacks of path.isAbsolute as well as following errors:
/Users/Ricky/Documents/gaia-playground/node_modules/confidant/build/find_stream.js:31
if (path.isAbsolute(dir)) {
^
TypeError: Object [object Object] has no method 'isAbsolute'
...
it get fixed after I switched to 0.12.4 so maybe one of solution is to specify a fixed engine version in package.json:
"engines": {
"node": "0.12.4",
"npm": ">=2"
}
However, I hope 0.12.4 can also work with gaia-marionette or other gaia's NPM modules.
We should escape comments appropriately in NinjaStream
.
We should accept only config.js
files!
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.