Skip to content

Commit

Permalink
The grunt source has moved to @gruntjs!
Browse files Browse the repository at this point in the history
Please update your remotes and links to the new location: https://github.com/gruntjs/grunt
  • Loading branch information
cowboy committed Oct 1, 2012
1 parent d179f8b commit c5a59e9
Show file tree
Hide file tree
Showing 159 changed files with 1,241 additions and 23,337 deletions.
12 changes: 10 additions & 2 deletions .gitignore
@@ -1,2 +1,10 @@
/node_modules/
/foo/
Grunt: a task-based command line build tool for JavaScript projects.
http://gruntjs.com/

The grunt source has moved!

Please update your remotes and links to the new location:
https://github.com/gruntjs/grunt

This file (if it still exists) might live at:
https://github.com/gruntjs/grunt/blob/devel/.gitignore
14 changes: 10 additions & 4 deletions AUTHORS
@@ -1,4 +1,10 @@
"Cowboy" Ben Alman (http://benalman.com/)
Kyle Robinson Young (http://dontkry.com/)
Tyler Kellen (http://goingslowly.com)
Sindre Sorhus (http://sindresorhus.com)
Grunt: a task-based command line build tool for JavaScript projects.
http://gruntjs.com/

The grunt source has moved!

Please update your remotes and links to the new location:
https://github.com/gruntjs/grunt

This file (if it still exists) might live at:
https://github.com/gruntjs/grunt/blob/devel/AUTHORS
61 changes: 7 additions & 54 deletions Gruntfile.js
@@ -1,57 +1,10 @@
/*
* grunt
* http://gruntjs.com/
*
* Copyright (c) 2012 "Cowboy" Ben Alman
* Licensed under the MIT license.
* http://benalman.com/about/license/
*/
Grunt: a task-based command line build tool for JavaScript projects.
http://gruntjs.com/

'use strict';
The grunt source has moved!

module.exports = function(grunt) {
Please update your remotes and links to the new location:
https://github.com/gruntjs/grunt

// Project configuration.
grunt.initConfig({
nodeunit: {
all: ['test/{grunt,tasks,util}/**/*.js']
},
jshint: {
all: [
'Gruntfile.js',
'lib/**/*.js',
'tasks/*.js',
'tasks/*/*.js',
'tasks/lib/**/*.js',
'<%= nodeunit.all %>'
],
options: {
curly: true,
eqeqeq: true,
immed: true,
latedef: true,
newcap: true,
noarg: true,
sub: true,
undef: true,
unused: true,
boss: true,
eqnull: true,
node: true,
es5: true
}
},
watch: {
scripts: {
files: ['<%= jshint.all %>'],
tasks: ['jshint', 'nodeunit']
}
}
});

// Default task.
grunt.registerTask('default', ['jshint', 'nodeunit']);

// Unregister unused tasks.
grunt.unregisterTasks('concat', 'uglify', 'init', 'server', 'qunit');
};
This file (if it still exists) might live at:
https://github.com/gruntjs/grunt/blob/devel/Gruntfile.js
26 changes: 7 additions & 19 deletions LICENSE-MIT
@@ -1,22 +1,10 @@
Copyright (c) 2012 "Cowboy" Ben Alman
Grunt: a task-based command line build tool for JavaScript projects.
http://gruntjs.com/

Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
files (the "Software"), to deal in the Software without
restriction, including without limitation the rights to use,
copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following
conditions:
The grunt source has moved!

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
Please update your remotes and links to the new location:
https://github.com/gruntjs/grunt

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.
This file (if it still exists) might live at:
https://github.com/gruntjs/grunt/blob/devel/LICENSE-MIT
81 changes: 7 additions & 74 deletions README.md
@@ -1,77 +1,10 @@
# grunt
Grunt is a task-based command line build tool for JavaScript projects.
Grunt: a task-based command line build tool for JavaScript projects.
http://gruntjs.com/

_Grunt is currently in beta. While I'm already using it on multiple projects, it might have a minor issue or two. And things might change before its final release, based on your feedback. Please try it out in a project, and [make suggestions][issues] or [report bugs][issues]!_
The grunt source has moved!

## Getting started
Be sure to read the [getting started guide](/cowboy/grunt/blob/master/docs/getting_started.md), which is a complete guide to configuring grunt for your project. In addition, check out the [example Gruntfiles](/cowboy/grunt/blob/master/docs/example_gruntfiles.md) which highlight a number of fairly common configurations.
Please update your remotes and links to the new location:
https://github.com/gruntjs/grunt

## Built-in tasks
As of now, grunt has the following predefined tasks that you can use in your project:

* [concat](/cowboy/grunt/blob/master/docs/task_concat.md) - Concatenate files.
* [init](/cowboy/grunt/blob/master/docs/task_init.md) - Generate project scaffolding from a predefined template.
* [lint](/cowboy/grunt/blob/master/docs/task_lint.md) - Validate files with [JSHint][jshint].
* [min](/cowboy/grunt/blob/master/docs/task_min.md) - Minify files with [UglifyJS][uglify].
* [qunit](/cowboy/grunt/blob/master/docs/task_qunit.md) - Run [QUnit][qunit] unit tests in a headless [PhantomJS][phantom] instance.
* [server](/cowboy/grunt/blob/master/docs/task_server.md) - Start a static web server.
* [test](/cowboy/grunt/blob/master/docs/task_test.md) - Run unit tests with [nodeunit][nodeunit].
* [watch](/cowboy/grunt/blob/master/docs/task_watch.md) - Run predefined tasks whenever watched files change.

_(More documentation forthcoming)_

## Custom tasks
In addition to the built-in tasks, you can create your own tasks. Don't like a built-in task's default behavior? Override it. Check out the [grunt API documentation](/cowboy/grunt/blob/master/docs/api.md) and the [built-in tasks source](/cowboy/grunt/blob/master/tasks) for everything you need to know about creating custom tasks.

## Documentation
Take a look at the [documentation table of contents][docs] for all the things.

## Why does grunt exist?
Doing all this stuff manually is a total pain, and building all this stuff into a gigantic Makefile / Jakefile / Cakefile / Rakefile / ?akefile that's maintained across all my projects was also becoming a total pain. Since I always found myself performing the same tasks over and over again, for every project, it made sense to build a task-based build tool.

Being primarily a JavaScript developer, I decided to use [Node.js][node] and [npm][npm] because the dependencies I most care about ([JSHint][jshint] and [UglifyJS][uglify]) were already npm modules. That being said, while Node.js was designed to support highly-concurrent asynchronous-IO-driven web servers, it was clearly NOT designed to make command-line build tools. But none of that matters, because grunt works. Just install it and see.

## Installing grunt

Grunt is available as an [npm][npm] module. If you install grunt globally via `npm install -g grunt`, it will be available for use in all of your projects. Once grunt has been installed, you can type `grunt --help` at the command line for more information. And if you want to see grunt "grunt" itself, cd into grunt's directory and type `grunt`

_Note: in Windows, you may need to run grunt as `grunt.cmd`. See the [FAQ](/cowboy/grunt/blob/master/docs/faq.md) for more Windows-specific information._

For projects already using grunt, you're done. Otherwise, if you're adding grunt to an existing project or starting from scratch, check out the [getting started guide](/cowboy/grunt/blob/master/docs/getting_started.md), which is a complete guide to configuring grunt for your project.

## Release History
_(Until v1.0.0, this will only be updated when major or breaking changes are made)_

* 2012/06/25 - v0.3.10 - Updating a few dependencies to work with node 0.8.x (0.6.x should still work).
* 2012/04/18 - v0.3.9 - The min task (via the uglify helper) now appends a semicolon to the end of the generated source.
* 2012/04/06 - v0.3.8 - Init template tweaks. Anchor links added to docs, along with grunt-internal docs task to generate them. The watch task now supports multiple targets with separate wildcards and tasks. Locally-installed grunt will override global grunt even when run from global "grunt" script.
* 2012/04/01 - v0.3.7 - Tweaked the behavior of the init template `exports.warnOn` property and added more init template documentation. Fixed duplicate PhantomJS debug output in qunit task. Added useful nodeunit and qunit comments into init template generated test .js files.
* 2012/03/28 - v0.3.6 - Fixed a `--help` screen issue, a few grunt plugin related issues, and attempted to improve the overall grunt plugin docs and API.
* 2012/03/27 - v0.3.5 - Fixed a handful of weird Windows issues. Changed default m/d/yyyy dates to yyyy-mm-dd ISO 8601. Fixed some init task bugs, docs errata, and added a lot more content to the init task docs.
* 2012/03/26 - v0.3.3 - Added a "gruntfile" init template. Create a basic Gruntfile in seconds with `grunt init:gruntfile`. A few other minor fixes.
* 2012/03/25 - v0.3.2 - Init tasks can now specify a file matching wildcard for the initial "files exist" warning. The jQuery init template now has jQuery 1.7.2. Fixed a bug in the `task.expand*` methods.
* 2012/03/25 - v0.3.1 - Added a few methods. Substantially reworked the init task and templates.
* 2012/03/23 - v0.3.0 - Too many changes to list. But in brief: completely reorganized the API, removed all globals, added docs and examples for nearly everything, built a preliminary plugin system (that still needs to be tested). PLEASE RTFM OK? THX U.
* 2012/02/03 - v0.2.14 - Added a server task (which starts a static webserver for your tasks). The qunit task now uses PhantomJS instead of Zombie.js (4768 of 4971 jQuery unit test pass, neat), and supports both file wildcards as well as http:// or https:// urls. (static webserver, anyone?). Grunt should no longer "hang" when done.
* 2012/01/29 - v0.2.5 - Added a "qunit" task as well as an init "jquery" template (as of now, there are also "node" and "commonjs" init templates).
* 2012/01/22 - v0.2.1 - Removed handlebars, templates are universally handled by underscore now. Changed init task template tags from <% %> to {% %}. Banners beginning with /*! will no longer be stripped.
* 2012/01/22 - v0.2.0 - Added "init" task with a sample template, reworked a lot of code. Hopefully it's backwards-compatible.
* 2012/01/11 - v0.1.0 - Initial release.

## License
Copyright (c) 2012 "Cowboy" Ben Alman
Licensed under the MIT license.
<http://benalman.com/about/license/>


[docs]: /cowboy/grunt/blob/master/docs/toc.md
[docs-init]: /cowboy/grunt/blob/master/docs/task_init.md
[issues]: /cowboy/grunt/issues

[node]: http://nodejs.org/
[npm]: http://npmjs.org/
[jshint]: http://www.jshint.com/
[uglify]: https://github.com/mishoo/UglifyJS/
[nodeunit]: https://github.com/caolan/nodeunit
[qunit]: http://docs.jquery.com/QUnit
[phantom]: http://www.phantomjs.org/
This file (if it still exists) might live at:
https://github.com/gruntjs/grunt/blob/devel/README.md
27 changes: 7 additions & 20 deletions bin/grunt
@@ -1,23 +1,10 @@
#!/usr/bin/env node
Grunt: a task-based command line build tool for JavaScript projects.
http://gruntjs.com/

// Nodejs libs.
var fs = require('fs');
var path = require('path');
// In Nodejs 0.8.0, existsSync moved from path -> fs.
var existsSync = fs.existsSync || path.existsSync;
The grunt source has moved!

// Badass internal grunt lib.
var findup = require('../lib/util/findup');
Please update your remotes and links to the new location:
https://github.com/gruntjs/grunt

// Search for Gruntfile.
var gruntfile = findup(process.cwd(), '{G,g}runtfile.{js,coffee}');
// Gruntfile not found, look for pre-0.4.0 grunt.js file. TODO: remove, someday.
if (!gruntfile) { gruntfile = findup(process.cwd(), 'grunt.js'); }

// Where might a locally-installed grunt live?
var dir = path.resolve(gruntfile, '../node_modules/grunt');
// If grunt is installed locally, use it. Otherwise use this grunt.
if (!existsSync(dir)) { dir = '../lib/grunt'; }

// Run grunt.
require(dir).cli();
This file (if it still exists) might live at:
https://github.com/gruntjs/grunt/blob/devel/bin/grunt
157 changes: 7 additions & 150 deletions dev/init.exp
@@ -1,153 +1,10 @@
#!/usr/bin/expect -f
Grunt: a task-based command line build tool for JavaScript projects.
http://gruntjs.com/

# OMG THIS WAS A PAIN TO CREATE
The grunt source has moved!

if {$argc == 0} {
# No template specified, iterate over all templates.
set templates [list jquery commonjs node gruntplugin gruntfile]
} else {
# One or more templates were specified, iterate over those.
set templates [lrange $argv 0 end]
}
Please update your remotes and links to the new location:
https://github.com/gruntjs/grunt

foreach template $templates {

set project "grunt-$template-example"

# Disable git pushing when debugging.
set gitpush 1

# Grunt version
set version [exec grunt --version]

# Stop any already-running logging.
log_file

# Start logging fresh, saving output for later use.
log_file -noappend /tmp/grunt-expect-out

# Spawn bash without all my crazy dotfiles stuff.
set timeout -1
spawn bash --noprofile --norc
match_max 100000

# Make the prompt look nice.
expect "$ "
send "PS1='\n$ '\r"
expect "\r"

# Cleanup any existing session.
expect "$ "
send "cd /tmp\r"
expect "$ "
send "rm -rf /tmp/$project\r"

# Session logging starts here.
expect "$ "
send "mkdir $project && cd $project\r"

# Initialize the current directory.
expect "$ "
send "git init\r"
expect "$ "
send "git remote add origin git@github.com:cowboy/$project.git\r"

# Note that the "--no-color" will be stripped out later.
expect "$ "
send "grunt init:$template --no-color\r"

# Don't start answering prompts until this line is encountered.
expect "Please answer the following:"

# Loop over all prompts.
expect {
"Do you need to make any changes to the above before continuing? (y/N)" {send "\r"}
"Project name (jquery.grunt-jquery-example)" {send "jquery.grunt-example\r"; exp_continue}
"Project title (jQuery Grunt Example)" {send "Grunt jQuery Example Plugin\r"; exp_continue}
"Description" {send "This is example output generated by the \"grunt init:$template\" task."; exp_continue}
") " {send "\r"; exp_continue}
}

# Pre-grunt file structure.
expect "$ "
send "tree\r"

# Let grunt grunt the newly-created file structure.
expect "$ "
send "grunt --no-color\r"

# Post-grunt file structure. Any built files should appear here.
expect "$ "
send "tree\r"

# Commit everything.
expect "$ "
send "git add .\r"
expect "$ "
send "git commit -m 'Committing example \"grunt init:$template\" task output.'\r"

# Session logging stops here.
expect "$ "
send "# EOF\n"

# Add meta-content to the README.
expect "$ "
send "echo -e '# Grunt \"init:$template\" example

This is example output generated by the \"grunt init:$template\" task.

_Note: this repository was generated dynamically using $version. Instead of
reporting issues here, please report any issues with this repository as
\[grunt issues\]\[issues\]. Instead of watching or forking this repository,
watch \[grunt\]\[grunt\] and use the grunt \[init task\]\[init\]._

## Project Creation Transcript
The following is a transcript of the session in which this project and
repository were created. This is not actually a part of the \[grunt\]\[grunt\]
\"init:$template\" template, this session transcript was added afterwards. The
text after the `$` are the commands that were executed, and everything else is
program output. If you want to see the repository exactly as it was created by
grunt, view \[the previous commit\]\[prev\].' > README.md\r"
expect "$ "
send "echo -e '
Want to learn more? Check \[grunt\]\[grunt\] out.

\[grunt\]: http://gruntjs.com/
\[issues\]: https://github.com/cowboy/grunt/issues
\[init\]: https://github.com/cowboy/grunt/blob/master/docs/task_init.md
\[expect\]: https://github.com/cowboy/grunt/blob/master/dev/init.exp
\[prev\]: https://github.com/cowboy/$project/tree/HEAD~1

Note that this entire build process is automated by a rather complex \[expect
script\]\[expect\], which is used to automate grunt in order to facilitate the
creation of this and other \[init task\]\[init\] example repositories.

```' >> README.md\r"
expect "$ "
# Strip out everything before the "mkdir" and after the "EOF". Also remove any "--no-color" bits.
send "cat /tmp/grunt-expect-out | perl -ne's/ --no-color//;if(/^\\\$ mkdir/){\$x=1}elsif(/^\\\$ # EOF/){\$x=0}\$x&&print\$_' >> README.md\r"
expect "$ "
send "echo -e '```

## License
Copyright (c) 2012 \"Cowboy\" Ben Alman
Licensed under the MIT license.' >> README.md\r"

# Commit again.
expect "$ "
send "git add .\r"
expect "$ "
send "git commit -m 'Adding project creation transcript.'\r"

# Push to GitHub.
if {$gitpush} {
expect "$ "
send "git push -uf origin master\r"
}

expect "$ "
send "exit\r"

expect eof

}
This file (if it still exists) might live at:
https://github.com/gruntjs/grunt/blob/devel/dev/init.exp

0 comments on commit c5a59e9

Please sign in to comment.