Auto-generates your Gruntfile as you build front-end applications
MIT License
Like "Ya mule!"
We shouldn't have to waste time defining and maintaining Grunt/Gulp/Broccoli configuration files or build scripts. Our tools should do that for us.
The ultimate goal for YA is a zero-configuration tool for all front-end development build process needs.
YA is a tool that explores automatic, build-engine, configuration file generation. It manages Grunt (currently, but could be user-choosen in the future) behind the scenes to auto-generate and maintain your Gruntfile – downloading any dependencies and recompiling changes along the way.
npm install -g ya.js
Simply run ya
in an empty or non-empty directory and it will start working for you.
ya [directory]
(defaults to .
if a directory is not supplied)
ya
a subdirectory. cd
into that directory and run ya
in the interim.That's it. Running the above command will do the following for you:
[directory]
[directory]
[directory]
for new preprocessors (repeating steps 2 to 6)[directory]
for changes and recompile changed files[directory]
*-b-bundle.js
in [directory]
*-r-bundle.js
file in [directory]
[directory]
for any changes to the JS files and will regenerate the bundlesNote: The *
in the bundle name is replaced with the filename of the app's root. For example, if your CommonJS app's main file is index.js
, then YA will generate a Browserified bundle: index-b-bundle.js
.
-b-
in the bundle name stands for Browserify-r-
in the bundle name stands for RequireJS.jshintrc
file in [directory]
, YA will run JSHint on the modification[directory]
.If you need to customize the Gruntfile for more advanced/custom use-cases, modify the gruntfile and
just continue to use grunt
instead of ya
. YA will overwrite the existing Gruntfile on every run.
YA assumes:
mydir/styles.scss
into mydir/styles.css
YA should only process/manage files relevant to your application, not its dependencies (or totally unrelated resources). Hence, the following files and folders are not processed by YA:
*-b-bundle.js
and *-r-bundle.js
(the YA-built bundles)Here are some walkthroughs of using YA
cd
into itnpm install ya.js
to install YAya
in the root of that directory (or specify a particular directory ya app/assets
)package.json
file and mock one up for yougrunt
, grunt-cli
, and any other startup modules (as devDependencies)styles.scss
anywhere within that directory or a subfolder.scss
preprocessor and do the following:grunt-contrib-sass
.scss
filesstyles.scss
into styles.css
(in the same location)grunt watch
cd
into your project's directoryya
(or ya [directory]
for ya
to manage a subfolder).scss
, .coffee
, etc)grunt-contrib-*
package to compile the preprocessorGruntfile.js
into the directory it's managinggrunt watch
to watch for new preprocessors being used and for file changesNote: If you have an existing Gruntfile, YA will overwrite it.
You can set the preprocess
flag when running ya
to avoid the JS processing
and only handle the automatic Grunt configuration for the preprocessors that you use.
ya [directory] --preprocess=1
This is helpful if, for example, you're building a Node.js app that doesn't need browserify capability.
compass create
and will modify the settings to use the sass/
and stylesheets/
directories.Adding support for a new preprocessor involves creating a
new -settings.js
files in ya/settings/
and adding the details about the
grunt plugin that should be used for compiling that preprocessor.
ya [build-engine] [directory]
.ya grunt .
ya gulp .
ya broccoli .
You may need to have grunt
and grunt-cli
installed globally. Known Issue
Beware of errors stemming from your preprocessor files. If you have errors in your SASS files, for example, it will kill YA and you'll need to restart it.