]> source.dussan.org Git - jquery.git/commitdiff
Use grunt and bower packages as local dependencies. Close gh-1433.
authorTimmy Willison <timmywillisn@gmail.com>
Thu, 14 Nov 2013 15:17:18 +0000 (10:17 -0500)
committerTimmy Willison <timmywillisn@gmail.com>
Thu, 14 Nov 2013 15:18:12 +0000 (10:18 -0500)
12 files changed:
.gitignore
.jshintignore
.travis.yml
Gruntfile.js
README.md
bower.json
build/bower-install.js [deleted file]
build/tasks/build.js
package.json
test/data/testinit.js
test/index.html
test/jquery.js

index ca249a98897fab0f1d974e1b2c1fdee46200614e..35b0b4e5682f21b6f409c70b8d362a8322c98565 100644 (file)
@@ -9,5 +9,5 @@ dist
 dist/.destination.json
 dist/.sizecache.json
 build/.sizecache.json
+bower_modules
 node_modules
-bower_components
\ No newline at end of file
index e520461f77deb7de58d3830664ddde0c31fe36a9..2df0a13dcf8a52a905ac14aaffdbeeaa9ac46b90 100644 (file)
@@ -1,7 +1,7 @@
 src/intro.js
 src/outro.js
-test/qunit/**
 test/data/jquery-1.9.1.js
+bower_modules
 test/data/badcall.js
 test/data/badjson.js
 test/data/json_obj.js
index b16e41db3694a214566f71f8d83dd44aaf77e55b..35048b6bd96a67e49c7a21299fcd79d89a85d8cd 100644 (file)
@@ -1,5 +1,3 @@
 language: node_js
 node_js:
 - '0.10'
-before_install:
-- npm install grunt-cli bower -g
index a4b94187a062eede557b5d863136b0714f6d2942..84aa02c892400201945856d205b0045f603ea3de 100644 (file)
@@ -10,6 +10,7 @@ module.exports = function( grunt ) {
        }
 
        var gzip = require( "gzip-js" ),
+               path = require( "path" ),
                srcHintOptions = readOptionalJSON( "src/.jshintrc" );
 
        // The concatenated file won't pass onevar
@@ -44,6 +45,17 @@ module.exports = function( grunt ) {
                                }
                        }
                },
+               bower: {
+                       install: {
+                               options: {
+                                       targetDir: "bower_modules",
+                                       cleanup: true,
+                                       layout: function( type ) {
+                                               return path.join( type );
+                                       }
+                               }
+                       }
+               },
                jsonlint: {
                        pkg: {
                                src: [ "package.json" ]
index 8bbcef3d1eb46952cb169e7a58dc5c977055a874..475ce6fc6ab395b919e3972345462d2f3a026b5a 100644 (file)
--- a/README.md
+++ b/README.md
@@ -29,39 +29,37 @@ if you swing that way. Easy-peasy.
 How to build your own jQuery
 ----------------------------
 
-First, clone a copy of the main jQuery git repo by running:
+Clone a copy of the main jQuery git repo by running:
 
 ```bash
 git clone git://github.com/jquery/jquery.git
 ```
 
-Install the [grunt-cli](http://gruntjs.com/getting-started#installing-the-cli) and [bower](http://bower.io/) packages if you haven't before. These should be done as global installs:
-
+Enter the jquery directory and run the build script:
 ```bash
-npm install -g grunt-cli bower
+cd jquery && npm run-script build
 ```
+The built version of jQuery will be put in the `dist/` subdirectory, along with the minified copy and associated map file.
 
-Make sure you have `grunt` and `bower` installed by testing:
+If you want create custom build or help with jQuery development, it would be better to install <a href="https://github.com/gruntjs/grunt-cli">grunt command line interface</a> as a global package:
 
-```bash
-grunt -version
-bower -version
 ```
-
-Enter the jquery directory and install the Node and Bower dependencies, this time *without* specifying a global(-g) install:
-
-```bash
-cd jquery && npm install
+npm install -g grunt-cli
+```
+Make sure you have `grunt` installed by testing:
+```
+grunt -v
 ```
 
-Then, to get a complete, minified (w/ Uglify.js), linted (w/ JSHint) version of jQuery, type the following:
-
-```bash
+Now by running `grunt` command, in the jquery directory, you could build full version of jQuery, just like with `npm run-script build` command:
+```
 grunt
 ```
 
-The built version of jQuery will be put in the `dist/` subdirectory, along with the minified copy and associated map file.
-
+There are many other tasks avaliable for jQuery Core:
+```
+grunt -help
+```
 
 ### Modules
 
@@ -135,10 +133,10 @@ Running the Unit Tests
 Make sure you have the necessary dependencies:
 
 ```bash
-bower install
+npm install
 ```
 
-Start `grunt watch` to auto-build jQuery as you work:
+Start `grunt watch` or `npm start` to auto-build jQuery as you work:
 
 ```bash
 cd jquery && grunt watch
index 7efb07d325d1a18c3a68d4e0ce5fc2e3261d9ee5..cf2aeaa2d1cbe6ce637b71836b7b818b35a72863 100644 (file)
     "requirejs": "~2.1.8",
     "qunit": "~1.12.0"
   },
+  "exportsOverride": {
+    "sizzle": {
+      "sizzle": "."
+    },
+
+    "requirejs": {
+      "requirejs": "require.js"
+    },
+    "qunit": {
+      "qunit": "qunit"
+    }
+  },
   "keywords": [
     "jquery",
     "javascript",
diff --git a/build/bower-install.js b/build/bower-install.js
deleted file mode 100644 (file)
index 6114c49..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-var which = require( "which" ),
-       spawn = require( "child_process" ).spawn;
-
-try {
-       which.sync( "bower" );
-} catch( error ) {
-       console.error( "Bower must be installed to build jQuery." );
-       console.error( "Please install Bower by running the following command:" );
-       console.error( "npm install -g bower" );
-       process.exit( 0 );
-}
-
-spawn( "bower", [ "install" ], { stdio: "inherit" } );
index 246d02400db62636b47d6e68b403901cf490bb81..cee296f9608a771ab57650d75b3048fffd6f89d1 100644 (file)
@@ -26,7 +26,7 @@ module.exports = function( grunt ) {
                                endFile: "src/outro.js"
                        },
                        paths: {
-                               sizzle: "../bower_components/sizzle/dist/sizzle"
+                               sizzle: "../bower_modules/sizzle/dist/sizzle"
                        },
                        rawText: {},
                        onBuildWrite: convert
index 9a3a25fdb064ce13faae2cce3351f58e8c6dbf39..4e627811e356e26a1492518ef48271f32ba89cf1 100644 (file)
@@ -31,6 +31,8 @@
   "devDependencies": {
     "archiver": "~0.4.10",
     "grunt": "~0.4.1",
+    "grunt-bower-task": "~0.3.2",
+    "grunt-cli": "~0.1.11",
     "grunt-compare-size": "~0.4.0",
     "grunt-contrib-jshint": "~0.7.0",
     "grunt-contrib-uglify": "~0.2.7",
     "which": "~1.0.5"
   },
   "scripts": {
-    "install": "node build/bower-install",
+    "build": "npm install && grunt",
+
+    "install": "grunt bower",
+
+    "start": "grunt watch",
     "test": "grunt"
   }
 }
index d4b2abc16e25c520c4cccfdcd2f87486eee1c18d..3d4b723af5fc7fae32230bc9bc32fa108e22ff78 100644 (file)
@@ -297,8 +297,10 @@ this.loadTests = function() {
                        if ( dep ) {
                                require( [ dep ], loadDep );
                        } else {
+
+
                                // Subproject tests must be last because they replace our test fixture
-                               testSubproject( "Sizzle", "../bower_components/sizzle/test/", /^unit\/.*\.js$/, function() {
+                               testSubproject( "Sizzle", "../bower_modules/sizzle/test/", /^unit\/.*\.js$/, function() {
                                        // Call load to build module filter select element
                                        QUnit.load();
 
index c7bb6c42a9d6fca849f8b5c1c2a5db12bcd1edc0..deb88790fd750b2ccb3bbb373f17829f1796815a 100644 (file)
@@ -4,7 +4,7 @@
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <meta http-equiv="X-UA-Compatible" content="IE=Edge" />
        <title>jQuery Test Suite</title>
-       <link rel="Stylesheet" media="screen" href="../bower_components/qunit/qunit/qunit.css" />
+       <link rel="Stylesheet" media="screen" href="../bower_modules/qunit/qunit.css" />
        <link rel="Stylesheet" media="screen" href="data/testsuite.css" />
        <!-- Includes -->
 
@@ -14,8 +14,8 @@
        -->
        <script src="data/jquery-1.9.1.js"></script>
 
-       <script src="../bower_components/qunit/qunit/qunit.js"></script>
-       <script src="../bower_components/requirejs/require.js"></script>
+       <script src="../bower_modules/qunit/qunit.js"></script>
+       <script src="../bower_modules/requirejs/require.js"></script>
        <!-- See testinit for the list of tests -->
        <script src="data/testinit.js"></script>
 
index e94f55fe894ddcb3bf06c4fb29360ffc3de3b675..9b7b96a1ed5297ae62982e40e310dde6a2ffeab6 100644 (file)
@@ -32,7 +32,7 @@
                require.config({
                        baseUrl: path,
                        paths: {
-                               sizzle: path + "bower_components/sizzle/dist/sizzle"
+                               sizzle: path + "bower_modules/sizzle/dist/sizzle"
                        }
                });
                src = "src/jquery";