Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

Commit ff2ce9d

Browse files
mgolNarretz
authored andcommitted
chore(*): get rid of Bower in favor of Yarn aliases & checked-in packages
Bower was used to install multiple versions of jQuery which is now handled using Yarn aliases. The remaining two packages, closure-compiler and ng-closure-compiler were installed from zip files which is not supported by Yarn (see yarnpkg/yarn#1483); the first of them exists on npm as the google-closure-compiler but only versions newer than we used are published and they don't work with ng-closure-compiler so - instead - both were checked in to the repository. Fixes #16268 Fixes #14961 Ref yarnpkg/yarn#1483
1 parent 8da3aef commit ff2ce9d

File tree

27 files changed

+884
-885
lines changed

27 files changed

+884
-885
lines changed

.eslintignore

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
bower_components/**
21
build/**
32
docs/app/assets/js/angular-bootstrap/**
43
docs/config/templates/**
@@ -8,3 +7,4 @@ src/angular.bind.js
87
src/ngParseExt/ucd.js
98
i18n/closure/**
109
tmp/**
10+
vendor/**

.gitignore

+1-3
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ performance/temp*.html
1010
*.swp
1111
angular.js.tmproj
1212
node_modules/
13-
bower_components/
1413
angular.xcodeproj
1514
.idea
1615
*.iml
@@ -19,7 +18,6 @@ angular.xcodeproj
1918
libpeerconnection.log
2019
npm-debug.log
2120
/tmp/
22-
/scripts/bower/bower-*
2321
.vscode
2422
*.log
25-
*.stackdump
23+
*.stackdump

.travis.yml

+1-3
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@ node_js:
55

66
cache:
77
yarn: true
8-
directories:
9-
- bower_components
108

119
branches:
1210
except:
@@ -32,7 +30,7 @@ before_install:
3230
- export PATH="$HOME/.yarn/bin:$PATH"
3331

3432
before_script:
35-
- du -sh ./node_modules ./bower_components/ || true
33+
- du -sh ./node_modules || true
3634
- "./scripts/travis/before_build.sh"
3735
script:
3836
- "./scripts/travis/build.sh"

DEVELOPERS.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
## <a name="setup"> Development Setup
1010

1111
This document describes how to set up your development environment to build and test AngularJS, and
12-
explains the basic mechanics of using `git`, `node`, `yarn`, `grunt`, and `bower`.
12+
explains the basic mechanics of using `git`, `node`, `yarn` and `grunt`.
1313

1414
### Installing Dependencies
1515

@@ -64,10 +64,10 @@ cd angular.js
6464
# Add the main AngularJS repository as an upstream remote to your repository:
6565
git remote add upstream "https://github.com/angular/angular.js.git"
6666

67-
# Install node.js dependencies:
67+
# Install JavaScript dependencies:
6868
yarn install
6969

70-
# Build AngularJS (which will install `bower` dependencies automatically):
70+
# Build AngularJS:
7171
yarn grunt package
7272
```
7373

Gruntfile.js

-2
Original file line numberDiff line numberDiff line change
@@ -426,14 +426,12 @@ module.exports = function(grunt) {
426426
'shell:promises-aplus-tests'
427427
]);
428428
grunt.registerTask('minify', [
429-
'bower',
430429
'clean',
431430
'build',
432431
'minall'
433432
]);
434433
grunt.registerTask('webserver', ['connect:devserver']);
435434
grunt.registerTask('package', [
436-
'bower',
437435
'validate-angular-files',
438436
'clean',
439437
'buildall',

TRIAGING.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ You can mention him in the relevant thread like this: `@btford`.
9595

9696
> Thanks for submitting this issue!
9797
> Unfortunately, we don't think this functionality belongs in core.
98-
> The good news is that you could easily implement this as a third-party module and publish it on Bower and/or to the npm repository.
98+
> The good news is that you could easily implement this as a third-party module and publish it to the npm registry.
9999
100100

101101
## Assigning Work

angularFiles.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ var angularFiles = {
171171
],
172172

173173
'karma': [
174-
'bower_components/jquery/dist/jquery.js',
174+
'node_modules/jquery/dist/jquery.js',
175175
'test/jquery_remove.js',
176176
'@angularSrc',
177177
'@angularSrcModules',
@@ -202,7 +202,7 @@ var angularFiles = {
202202
],
203203

204204
'karmaJquery': [
205-
'bower_components/jquery/dist/jquery.js',
205+
'node_modules/jquery/dist/jquery.js',
206206
'test/jquery_alias.js',
207207
'@angularSrc',
208208
'@angularSrcModules',
@@ -220,8 +220,8 @@ var angularFiles = {
220220
angularFiles['karmaJquery' + jQueryVersion] = []
221221
.concat(angularFiles.karmaJquery)
222222
.map(function(path) {
223-
if (path.startsWith('bower_components/jquery')) {
224-
return path.replace(/^bower_components\/jquery/, 'bower_components/jquery-' + jQueryVersion);
223+
if (path.startsWith('node_modules/jquery')) {
224+
return path.replace(/^node_modules\/jquery/, 'node_modules/jquery-' + jQueryVersion);
225225
}
226226
return path;
227227
});
+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
// Override me with ?jquery=/bower_components/jquery/dist/jquery.js
1+
// Override me with ?jquery=/node_modules/jquery/dist/jquery.js
+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
// Override me with ?jquery=/bower_components/jquery/dist/jquery.js
1+
// Override me with ?jquery=/node_modules/jquery/dist/jquery.js

benchmarks/orderby-bp/jquery-noop.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
// Override me with ?jquery=/bower_components/jquery/dist/jquery.js
1+
// Override me with ?jquery=/node_modules/jquery/dist/jquery.js

bower.json

-11
This file was deleted.

docs/config/services/getVersion.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ var path = require('canonical-path');
44
/**
55
* dgService getVersion
66
* @description
7-
* Find the current version of the bower component (or node module)
7+
* Find the current version of the node module
88
*/
99
module.exports = function getVersion(readFilesProcessor) {
1010
var basePath = readFilesProcessor.basePath;

docs/gulpfile.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ var rename = require('gulp-rename');
1313

1414
// We indicate to gulp that tasks are async by returning the stream.
1515
// Gulp can then wait for the stream to close before starting dependent tasks.
16-
// See clean and bower for async tasks, and see assets and doc-gen for dependent tasks below
16+
// See clean for an async task, and see assets and doc-gen for dependent tasks below.
1717

1818
var outputFolder = '../build/docs';
1919

lib/grunt/plugins.js

-12
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
/* eslint-disable no-invalid-this */
44

5-
var bower = require('bower');
65
var util = require('./utils.js');
76
var npmRun = require('npm-run');
87

@@ -63,15 +62,4 @@ module.exports = function(grunt) {
6362
grunt.registerTask('collect-errors', 'Combine stripped error files', function() {
6463
util.collectErrors();
6564
});
66-
67-
grunt.registerTask('bower', 'Install Bower packages.', function() {
68-
var done = this.async();
69-
70-
bower.commands.install()
71-
.on('log', function(result) {
72-
grunt.log.ok('bower: ' + result.id + ' ' + result.data.endpoint.name);
73-
})
74-
.on('error', grunt.fail.warn.bind(grunt.fail))
75-
.on('end', done);
76-
});
7765
};

lib/grunt/utils.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -187,8 +187,8 @@ module.exports = {
187187
'java ' +
188188
this.java32flags() + ' ' +
189189
this.memoryRequirement() + ' ' +
190-
'-cp bower_components/closure-compiler/compiler.jar' + classPathSep +
191-
'bower_components/ng-closure-runner/ngcompiler.jar ' +
190+
'-cp vendor/closure-compiler/compiler.jar' + classPathSep +
191+
'vendor/ng-closure-runner/ngcompiler.jar ' +
192192
'org.angularjs.closurerunner.NgClosureRunner ' +
193193
'--compilation_level ' + compilationLevel + ' ' +
194194
'--language_in ECMASCRIPT5_STRICT ' +

package.json

+3-2
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
"angular-benchpress": "0.x.x",
2424
"benchmark": "1.x.x",
2525
"bootstrap": "3.1.1",
26-
"bower": "~1.3.9",
2726
"browserstacktunnel-wrapper": "2.0.0",
2827
"canonical-path": "0.0.2",
2928
"changez": "^2.1.1",
@@ -60,7 +59,9 @@
6059
"jasmine-core": "^2.8.0",
6160
"jasmine-node": "^2.0.0",
6261
"jasmine-reporters": "^2.2.0",
63-
"jquery": "^3.2.1",
62+
"jquery": "3.2.1",
63+
"jquery-2.1": "npm:[email protected]",
64+
"jquery-2.2": "npm:[email protected]",
6465
"karma": "^2.0.0",
6566
"karma-browserstack-launcher": "^1.2.0",
6667
"karma-chrome-launcher": "^2.1.1",

scripts/travis/before_build.sh

+1-2
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ fi
1818

1919
# unit runs the docs tests too which need a built version of the code
2020
if [[ "$JOB" = unit-* ]]; then
21-
grunt bower
2221
grunt validate-angular-files
2322
grunt build
2423
fi
@@ -28,4 +27,4 @@ fi
2827
if [ "$JOB" != "ci-checks" ]; then
2928
echo "wait_for_browser_provider"
3029
./scripts/travis/wait_for_browser_provider.sh
31-
fi
30+
fi

test/e2e/fixtures/ng-jq-jquery/index.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<script>
88
var jQuery_2_1_0 = jQuery.noConflict();
99
</script>
10-
<script src="../../../../bower_components/jquery/dist/jquery.js"></script>
10+
<script src="../../../../node_modules/jquery/dist/jquery.js"></script>
1111
<script src="angular.js"></script>
1212
<script src="script.js"></script>
1313
</body>

test/e2e/fixtures/ng-jq/index.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<body>
44
<span>{{jqueryVersion}}</span>
55

6-
<script src="../../../../bower_components/jquery/dist/jquery.js"></script>
6+
<script src="../../../../node_modules/jquery/dist/jquery.js"></script>
77
<script type="text/javascript">
88
// Verify that empty ng-jq is not accessing `window['']`.
99
// (See https://github.com/angular/angular.js/issues/12741 for more details)

test/e2e/tools/fixture.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ function generateFixture(test, query) {
6565
}
6666
}
6767
if (!/^\d+\.\d+.*$/.test(query.jquery)) {
68-
$(jquery).attr('src', '/bower_components/jquery/dist/jquery.js');
68+
$(jquery).attr('src', '/node_modules/jquery/dist/jquery.js');
6969
} else {
7070
$(jquery).attr('src', '//ajax.googleapis.com/ajax/libs/jquery/' + query.jquery + '/jquery.js');
7171
}

0 commit comments

Comments
 (0)