nodejs-hooker/nodejs-hooker-0.2.3-Updating-gruntfile-to-grunt-0.3.0-format.patch
2020-08-20 19:47:50 +08:00

122 lines
3.0 KiB
Diff

From 96e3b30140ae2f4987af0f461acbc0a20b199f30 Mon Sep 17 00:00:00 2001
From: Ben Alman <cowboy@rj3.net>
Date: Thu, 22 Mar 2012 21:13:32 -0400
Subject: [PATCH] Updating gruntfile to grunt 0.3.0 format.
---
grunt.js | 102 +++++++++++++++++++++++++++++++++++----------------------------
1 file changed, 57 insertions(+), 45 deletions(-)
diff --git a/grunt.js b/grunt.js
index c695148..09bd528 100644
--- a/grunt.js
+++ b/grunt.js
@@ -1,47 +1,59 @@
-/*global config:true, task:true*/
-config.init({
- pkg: '<json:package.json>',
- meta: {
- name: 'JavaScript Hooker',
- banner: '/*! <%= meta.name %> - v<%= pkg.version %> - <%= template.today("m/d/yyyy") %>\n' +
- '* <%= pkg.homepage %>\n' +
- '* Copyright (c) <%= template.today("yyyy") %> <%= pkg.author.name %>;' +
- ' Licensed <%= _.pluck(pkg.licenses, "type").join(", ") %> */'
- },
- concat: {
- 'dist/ba-hooker.js': ['<banner>', '<file_strip_banner:lib/hooker.js>']
- },
- min: {
- 'dist/ba-hooker.min.js': ['<banner>', 'dist/ba-hooker.js']
- },
- test: {
- files: ['test/**/*.js']
- },
- lint: {
- files: ['grunt.js', 'lib/**/*.js', 'test/**/*.js']
- },
- watch: {
- files: '<config:lint.files>',
- tasks: 'lint:files test:files'
- },
- jshint: {
- options: {
- curly: true,
- eqeqeq: true,
- immed: true,
- latedef: true,
- newcap: true,
- noarg: true,
- sub: true,
- undef: true,
- eqnull: true
+module.exports = function(grunt) {
+
+ // Project configuration.
+ grunt.initConfig({
+ pkg: '<json:package.json>',
+ meta: {
+ name: 'JavaScript Hooker',
+ banner: '/*! <%= meta.name %> - v<%= pkg.version %> - <%= grunt.template.today("m/d/yyyy") %>\n' +
+ '* <%= pkg.homepage %>\n' +
+ '* Copyright (c) <%= grunt.template.today("yyyy") %> <%= pkg.author.name %>;' +
+ ' Licensed <%= _.pluck(pkg.licenses, "type").join(", ") %> */'
+ },
+ concat: {
+ dist: {
+ src: ['<banner>', '<file_strip_banner:lib/hooker.js>'],
+ dest: 'dist/ba-hooker.js'
+ }
+ },
+ min: {
+ dist: {
+ src: ['<banner>', 'dist/ba-hooker.js'],
+ dest: 'dist/ba-hooker.min.js'
+ }
+ },
+ test: {
+ files: ['test/**/*.js']
},
- globals: {
- exports: true
- }
- },
- uglify: {}
-});
+ lint: {
+ files: ['grunt.js', 'lib/**/*.js', 'test/**/*.js']
+ },
+ watch: {
+ files: '<config:lint.files>',
+ tasks: 'lint:files test:files'
+ },
+ jshint: {
+ options: {
+ curly: true,
+ eqeqeq: true,
+ immed: true,
+ latedef: true,
+ newcap: true,
+ noarg: true,
+ sub: true,
+ undef: true,
+ boss: true,
+ eqnull: true
+ },
+ globals: {
+ exports: true,
+ module: false
+ }
+ },
+ uglify: {}
+ });
+
+ // Default task.
+ grunt.registerTask('default', 'lint test concat min');
-// Default task.
-task.registerTask('default', 'lint:files test:files concat min');
+};
--
1.8.3.1