Coder Social home page Coder Social logo

ready.js's Introduction

OBSOLETE

This project is now obsolete, see why in issue #18.

ready.js - continuous javascript integration

Build Status

What does it do?

  1. Check if your javascript files are valid with jshint.
  2. Compile your javascript files with Uglify JS.
  3. (Later) Watch your javascript files for jshint while you're coding.
  4. Create an aggregated file of all your javascripts.

Installation

npm install ready.js --global

Usage

Usage: readyjs [FILES OR DIRECTORIES] [options]

Options:
  -o, --output    The file or directory in which to write the output                                
  -c, --config    Specify a config.json file                                           
  -i, --ignore    Ignore these files from JSHint but output them in the aggregated file
  -k, --keep      Keep individual minified files                                       
  --no-recursive  Don't recurse in sub-directories                                     
  -h, --help      Display this help                                                    
  -v, --version   Display the current version

Continuous integration

  1. run npm install ready.js --global
  2. run echo 'readyjs path/to/src -o path/to/dest' >> .git/hooks/pre-commit

Configuration file

You can use a configuration file with ready.js. It has to be a JSON with that format :

{
  "output" : "path/to/destination", // The file in which to write the output
  "ignore" : [], // Ignore these files from JSHint but output them in the aggregated file
  "keep" : false, // Keep individual minified files
  "no-recursive" : false // Don't recurse in sub-directories
}

Contribute

You can create issues.

You can also contribute code :

  1. Fork the code on GitHub
  2. Clone your fork in your environment : git clone [email protected]:USERNAME/ready.js.git
  3. Create a branch for your feature : git checkout -b your_branch_name
  4. Write and delete code and commit as often as you can : git commit -am "A descriptive message"
  5. Push the branch to your fork : git push origin your_branch_name
  6. Create a pull request on GitHub (click the Pull request button on your fork page)

API Reference

You can use this function readyjs.compile(sources, [options], callback(err, minified))

ready.compile(['./js', 'lib/cat.js'], {analyse:false}, function(err, minified) {
});

See main file for more information.

options

  • ignore default is [] : A list of files to ignore. (ex : _jquery*.js)
  • analyze default is true : If should analyze files through jshint
  • recursive default is true : If should go through directory recursively

callback(err, minified)

  • err : The errors that happened. If jshint didn't pass, err will contain formatted jshint errors
  • minified : The aggregated minified code for all files

Need more help?

ready.js's People

Contributors

dsimard avatar cmilfont avatar fkei avatar

Stargazers

 avatar skhattab avatar Angus H. avatar Akshay Singnurkar avatar Doua Thao avatar Timm Albers avatar Zoltan Simon avatar Alex Abenoja avatar Eytan Biala avatar jkfdeveloper avatar  avatar Jason Morganson avatar Tom avatar Jordan Reese avatar Thom Heymann avatar Fernando Trasviña avatar Plamen Stoev avatar Yurii Shykanov avatar Nik Khilnani avatar Brad Pillow avatar DANIEL SIMON JR avatar Rajiv Kilaparti avatar Dustin Brown avatar Cameron avatar  avatar Marwan Hilmi avatar sujay avatar Justin Freitag avatar torzborz avatar Daniel Feies avatar Anzor Bashkhaz avatar  avatar  avatar Timothy Dang avatar Shu Uesugi avatar David Cormier avatar Mateusz Kulesza avatar Frederico Silva avatar Mike Lee avatar Martin Halamíček avatar Shimaguchi Tomoya avatar Nicolas Gryman avatar Thomas Nadin avatar Gabriel Baciu avatar Nicolai Fröhlich avatar Samal Gorai avatar Sascha Goebel avatar  avatar Andy Tennison avatar StuPig avatar AS avatar Craig Condon avatar  avatar Evan Moran avatar Buba Sargsian avatar  avatar  avatar Michael Dillon avatar  avatar Marvin Tam avatar Tejesh Mehta avatar Jose Armesto avatar Meshach Jackson avatar Nick Kampe avatar Diego Lagunas avatar sharper-than-blade avatar  avatar Christoph Werner avatar  avatar Heitor Ferreira avatar tom quas avatar Craig Spaeth avatar Sven Hohlfeld avatar Davy Peter Braun avatar Chris Abrams avatar andzdroid avatar Ibon Tolosana avatar Scott Sanders avatar Sascha avatar Vitaly Orlov avatar  avatar Chris Le (TRIODE) avatar Mario Alzugray avatar Tino Ehrich avatar Nielsen Teixeira avatar Clark Fischer avatar Forrest Galloway avatar Rafik Salama avatar Amir Mamedov avatar Artur Dudnik avatar Tim Kleinschmidt avatar Malte Legenhausen avatar Markle avatar Jórgos Skettos avatar Amir H. Hajizamani avatar Ram Viswanadha avatar Marcin avatar Michael F avatar Kilian Ciuffolo avatar Aaron G avatar

Watchers

 avatar  avatar Mariusz Nowak avatar James Cloos avatar Henk Langeveld avatar Edgar de Oliveira Maciel avatar  avatar Roxanne Arcement avatar

ready.js's Issues

Problems when files have the same names

It seems all files are pulled from their folders and copied to the current one before processing.
That means that if files stored in different folders share the same name, they are going to be overwritten and the process will fail.

You could say that we should name all our files differently, but I think it's fairly common for people to have a MVC structure where we would have something like this:

views/product.js
model/product.js

What do you think?

[Kubuntu] Cannot install compiler locally

I've tried to install ready.js using npm, but instead of having binaries in /usr/local, they end up in a local 'node_modules' folder.

I can then launch the command and it can compile files, however, when trying to install the compiler locally (I don't fancy sending all my files on the Internet), it fails with this:
ERROR : Installing a compiler is available only with a NPM installation. Run npm install ready.

I suspect that the error message meant ' npm install ready.js', but still that's what I did and it still doesn't work.

This project should not be used

It's sad to say but the truth is that you shouldn't use this project anymore.

This project was released about a year before grunt. Grunt really took off so now, it doesn't make sense to use ready.js.

I'm for conventions and I appreciate when a community gets behind a tool. That way, a new language/framework/whatever can have a solid growth.

Conventions ask me to stop developing and pushing ready.js. I learned a lot and I thank you all for using ready.js.

I will update the README file accordingly.

Switch from Google Closure Compiler to Uglify-js

Just a suggestion, but I would love this change for two reasons:

  1. Google's Closure Compiler has made some funky and unnecessary alterations to some of my JavaScript, and has been reported by others as being randomly buggy in certain situations.

  2. Uglify is more performant than Closure Compiler.

Thanks!

Discussion topic: New ready.js approach

Hi @dsimard, before starting to build my own tool, I want to talk with you about a radical change of ready js.
Hope you will understand my goals reading the confing.json below

{
  "targets": [{
      "output_file": "public/js/my-awesome-lib-compiled.js",
      "source": "js/lib/my-awesome-lib.js",
      "syntax_check": {
        "indent": 2,
        "boss": true,
        "browser": true
      },
      "compile": true,
    },{
      "output_file": "public/js/application-min.js",
      "source": [
        "js/lib/mootools-core-1.4.2-full-nocompat.js --check-syntax",
        "js/lib/mootools-more-1.4.0.1.js --check-syntax",
        "public/js/my-awesome-lib-compiled.js",
        "js/application.js --check-syntax --compile",
      ],
      "syntax_check": "default",
      "compile": true,
  }],
  "defaults": {
    "syntax_check": {
      "indent": 2,
      "boss": true,
      "browser": true,
      "curly": true,
      "debug": true,
      "devel": true,
      "eqeqeq": true,
      "es5": true,
      "expr": true,
      "mootools": true,
      "newcap": true,
      "passfail": true,
      "triling": true,
      "undef": true,
      "white": true
    }
  }
}

"order" option not affecting aggregation order

The final aggregation doesn't seem to be respecting the "order" config option for me...

I enter:

{ 
  src : "themes/refresh/js/",
  dest : "themes/refresh/js/minified",
  minifiedExtension : "min",
  order:[
    "jquery.js", 
    "jquery.ui.js",
    "jquery.animate_rotate_scale.js",
    "jquery.carousel.js",
    "jquery.css_transform.js",
    "jquery.equal_columns.js",
    "jquery.js",
    "jquery.simpleSlideshow.js",
    "lettering.js",
    "application.js"
  ],
  runGCompiler : true, // If should run GoogleCompiler
  runJsLint : false, // If should run JsLint
  debug: true,
  aggregateTo : "themes/refresh/js/all.min.js" // Which file to aggregate all javascript files
}

...but mysteriously, equal_columns, simpleSlideshow, and lettering come out first in the resulting file. Any ideas?

Doesn't work on Windows

Just a quick feedback that it doesn't seem to work with Windows binaries of node.js.
An obvious reason is because of the use of things like

#!/usr/bin/env node

but there are other problems like compiling with --nojslint will compile the local folder if trying to use a config file or won't find files if trying to use a source/dest syntax.

Does not work at all

$npm install ready.js

Then in my local folder, I did:

$readyjs resource-widget.js resource-widget.min.js

I'm pretty sure I'm running on the same directory as my files are, but nothing popped up. This is the message that came out:

WARNING : No files to process

What's wrong?

package.json data doesn't parse in npm 0.3.0.

Error message when trying to install:

npm info it worked if it ends with ok
npm info using [email protected]
npm info using [email protected]
npm info fetch http://registry.npmjs.org/ready.js/-/ready.js-1.2.1.tgz
npm ERR! couldn't read package.json in /tmp/npm-1300123490834/1300123490834-0.1645010879728943/contents/package
npm ERR! Error installing [email protected]
npm ERR! Error: Failed to parse json
npm ERR! Unexpected token ILLEGAL
npm ERR! at jsonParseFail (/usr/local/lib/node/.npm/npm/0.3.15/package/lib/utils/read-json.js:89:11)
npm ERR! at /usr/local/lib/node/.npm/npm/0.3.15/package/lib/utils/read-json.js:82:14
npm ERR! at P (/usr/local/lib/node/.npm/npm/0.3.15/package/lib/utils/read-json.js:62:40)
npm ERR! at cb (/usr/local/lib/node/.npm/npm/0.3.15/package/lib/utils/graceful-fs.js:31:9)
npm ERR! at [object Object]. (fs.js:86:5)
npm ERR! at [object Object].emit (events.js:39:17)
npm ERR! at afterRead (fs.js:882:12)
npm ERR! JSON.parse
npm ERR! JSON.parse Failed to parse package.json data.
npm ERR! JSON.parse Note that package.json must be actual JSON, not
npm ERR! JSON.parse just a JavaScript object.
npm ERR! JSON.parse
npm ERR! JSON.parse This changed in npm 0.3.0, and is not a bug in npm.
npm ERR! JSON.parse Tell the package author to fix their package.json file.
npm ERR! JSON.parse
npm ERR! System Darwin 10.6.0
npm ERR! argv { remain: [ 'ready.js' ],
npm ERR! argv cooked: [ 'install', 'ready.js' ],
npm ERR! argv original: [ 'install', 'ready.js' ] }

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.