Skip to content

Commit 79c0732

Browse files
committed
Build: drop bower; use npm for front-end deps
Fixes #15186 Closes gh-1620 Conflicts: bower.json
1 parent e38a94a commit 79c0732

File tree

6 files changed

+26
-23
lines changed

6 files changed

+26
-23
lines changed

.bowerrc

Lines changed: 0 additions & 3 deletions
This file was deleted.

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,4 @@
99
.sizecache.json
1010

1111
/dist
12-
/bower_components
1312
/node_modules

Gruntfile.js

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -44,19 +44,18 @@ module.exports = function( grunt ) {
4444
}
4545
}
4646
},
47-
bowercopy: {
47+
npmcopy: {
4848
all: {
4949
options: {
50-
clean: true,
5150
destPrefix: "external"
5251
},
5352
files: {
5453
"sizzle/dist": "sizzle/dist",
5554
"sizzle/MIT-LICENSE.txt": "sizzle/MIT-LICENSE.txt",
5655

57-
"qunit/qunit.js": "qunit/qunit/qunit.js",
58-
"qunit/qunit.css": "qunit/qunit/qunit.css",
59-
"qunit/MIT-LICENSE.txt": "qunit/MIT-LICENSE.txt",
56+
"qunit/qunit.js": "qunitjs/qunit/qunit.js",
57+
"qunit/qunit.css": "qunitjs/qunit/qunit.css",
58+
"qunit/MIT-LICENSE.txt": "qunitjs/MIT-LICENSE.txt",
6059

6160
"requirejs/require.js": "requirejs/require.js",
6261

@@ -137,7 +136,6 @@ module.exports = function( grunt ) {
137136
// Integrate jQuery specific tasks
138137
grunt.loadTasks( "build/tasks" );
139138

140-
grunt.registerTask( "bower", "bowercopy" );
141139
grunt.registerTask( "lint", [ "jshint", "jscs" ] );
142140

143141
// Short list as a high frequency watch task

bower.json

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,6 @@
1313
"Gruntfile.js",
1414
"package.json"
1515
],
16-
"devDependencies": {
17-
"sizzle": "1.11.1",
18-
"requirejs": "2.1.10",
19-
"qunit": "1.14.0",
20-
"sinon": "1.8.1"
21-
},
2216
"keywords": [
2317
"jquery",
2418
"javascript",

build/ensure-sizzle.js

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,26 @@
11
var fs = require( "fs" ),
2-
bower = require( "grunt-bowercopy/node_modules/bower" ),
2+
npm = require( "npm" ),
33
sizzleLoc = __dirname + "/../external/sizzle/dist/sizzle.js",
44
rversion = /Engine v(\d+\.\d+\.\d+(?:-\w+)?)/;
55

6+
require( "colors" );
7+
68
/**
7-
* Retrieve the latest tag of Sizzle from bower
9+
* Retrieve the latest tag of Sizzle from npm
810
* @param {Function(string)} callback
911
*/
1012
function getLatestSizzle( callback ) {
11-
bower.commands.info( "sizzle", "version" )
12-
.on( "end", callback );
13+
npm.load(function( err, npm ) {
14+
if ( err ) {
15+
throw err;
16+
}
17+
npm.commands.info( [ "sizzle", "version" ], function( err, info ) {
18+
if ( err ) {
19+
throw err;
20+
}
21+
callback( Object.keys( info )[ 0 ] );
22+
});
23+
});
1324
}
1425

1526
/**

package.json

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,9 @@
3030
],
3131
"dependencies": {},
3232
"devDependencies": {
33-
"colors": "^0.6.2",
33+
"colors": "0.6.2",
3434
"commitplease": "1.9.0",
3535
"grunt": "0.4.2",
36-
"grunt-bowercopy": "1.1.0",
3736
"grunt-cli": "0.1.13",
3837
"grunt-compare-size": "0.4.0",
3938
"grunt-contrib-jshint": "0.8.0",
@@ -42,9 +41,14 @@
4241
"grunt-git-authors": "1.2.0",
4342
"grunt-jscs-checker": "0.4.1",
4443
"grunt-jsonlint": "1.0.4",
44+
"grunt-npmcopy": "0.1.0",
4545
"gzip-js": "0.3.2",
4646
"load-grunt-tasks": "0.3.0",
47-
"requirejs": "2.1.10",
47+
"npm": "1.4.21",
48+
"qunitjs": "1.14.0",
49+
"requirejs": "2.1.14",
50+
"sinon": "1.10.3",
51+
"sizzle": "2.0.0",
4852
"testswarm": "1.1.0"
4953
},
5054
"scripts": {

0 commit comments

Comments
 (0)