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

chore(*): get rid of Bower in favor of Yarn aliases & checked-in packages #16385

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
bower_components/**
build/**
docs/app/assets/js/angular-bootstrap/**
docs/config/templates/**
Expand All @@ -8,3 +7,4 @@ src/angular.bind.js
src/ngParseExt/ucd.js
i18n/closure/**
tmp/**
vendor/**
4 changes: 1 addition & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ performance/temp*.html
*.swp
angular.js.tmproj
node_modules/
bower_components/
angular.xcodeproj
.idea
*.iml
Expand All @@ -19,7 +18,6 @@ angular.xcodeproj
libpeerconnection.log
npm-debug.log
/tmp/
/scripts/bower/bower-*
.vscode
*.log
*.stackdump
*.stackdump
4 changes: 1 addition & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ node_js:

cache:
yarn: true
directories:
- bower_components

branches:
except:
Expand All @@ -32,7 +30,7 @@ before_install:
- export PATH="$HOME/.yarn/bin:$PATH"

before_script:
- du -sh ./node_modules ./bower_components/ || true
- du -sh ./node_modules || true
- "./scripts/travis/before_build.sh"
script:
- "./scripts/travis/build.sh"
Expand Down
8 changes: 4 additions & 4 deletions DEVELOPERS.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
## <a name="setup"> Development Setup

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

### Installing Dependencies

Expand Down Expand Up @@ -63,10 +63,10 @@ cd angular.js
# Add the main AngularJS repository as an upstream remote to your repository:
git remote add upstream "https://github.com/angular/angular.js.git"

# Install node.js dependencies:
# Install JavaScript dependencies:
yarn install

# Build AngularJS (which will install `bower` dependencies automatically):
# Build AngularJS:
yarn grunt package
```

Expand Down Expand Up @@ -483,4 +483,4 @@ You can see an example of a well-defined example [in the `ngRepeat` documentatio
[karma-browserstack]: https://github.com/karma-runner/karma-browserstack-launcher
[karma-saucelabs]: https://github.com/karma-runner/karma-sauce-launcher
[unit-testing]: https://docs.angularjs.org/guide/unit-testing
[yarn-install]: https://yarnpkg.com/en/docs/install
[yarn-install]: https://yarnpkg.com/en/docs/install
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what changed here?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A new line was added to the end of the file.

2 changes: 0 additions & 2 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -426,14 +426,12 @@ module.exports = function(grunt) {
'shell:promises-aplus-tests'
]);
grunt.registerTask('minify', [
'bower',
'clean',
'build',
'minall'
]);
grunt.registerTask('webserver', ['connect:devserver']);
grunt.registerTask('package', [
'bower',
'validate-angular-files',
'clean',
'buildall',
Expand Down
2 changes: 1 addition & 1 deletion TRIAGING.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ You can mention him in the relevant thread like this: `@btford`.

> Thanks for submitting this issue!
> Unfortunately, we don't think this functionality belongs in core.
> 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.
> The good news is that you could easily implement this as a third-party module and publish it to the npm registry.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need this change? It is about other people publishing to bower. Not us using dependencies from bower. Or are you just trying to move everyone away from bower in every possible way?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I guess I should revert this change.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's okay to make this change. bower has no immediate advantages over npm, and is getting less important every week.



## Assigning Work
Expand Down
8 changes: 4 additions & 4 deletions angularFiles.js
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ var angularFiles = {
],

'karma': [
'bower_components/jquery/dist/jquery.js',
'node_modules/jquery/dist/jquery.js',
'test/jquery_remove.js',
'@angularSrc',
'@angularSrcModules',
Expand Down Expand Up @@ -202,7 +202,7 @@ var angularFiles = {
],

'karmaJquery': [
'bower_components/jquery/dist/jquery.js',
'node_modules/jquery/dist/jquery.js',
'test/jquery_alias.js',
'@angularSrc',
'@angularSrcModules',
Expand All @@ -220,8 +220,8 @@ var angularFiles = {
angularFiles['karmaJquery' + jQueryVersion] = []
.concat(angularFiles.karmaJquery)
.map(function(path) {
if (path.startsWith('bower_components/jquery')) {
return path.replace(/^bower_components\/jquery/, 'bower_components/jquery-' + jQueryVersion);
if (path.startsWith('node_modules/jquery')) {
return path.replace(/^node_modules\/jquery/, 'node_modules/jquery-' + jQueryVersion);
}
return path;
});
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/animation-bp/jquery-noop.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
// Override me with ?jquery=/bower_components/jquery/dist/jquery.js
// Override me with ?jquery=/node_modules/jquery/dist/jquery.js
2 changes: 1 addition & 1 deletion benchmarks/largetable-bp/jquery-noop.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
// Override me with ?jquery=/bower_components/jquery/dist/jquery.js
// Override me with ?jquery=/node_modules/jquery/dist/jquery.js
2 changes: 1 addition & 1 deletion benchmarks/orderby-bp/jquery-noop.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
// Override me with ?jquery=/bower_components/jquery/dist/jquery.js
// Override me with ?jquery=/node_modules/jquery/dist/jquery.js
11 changes: 0 additions & 11 deletions bower.json

This file was deleted.

2 changes: 1 addition & 1 deletion docs/config/services/getVersion.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ var path = require('canonical-path');
/**
* dgService getVersion
* @description
* Find the current version of the bower component (or node module)
* Find the current version of the node module
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this function is only used to get node modules (afaict it does), we can simplify the implementation and remove the second and third arguments. I think this happened already when we moved most of the bower stuff to node.

*/
module.exports = function getVersion(readFilesProcessor) {
var basePath = readFilesProcessor.basePath;
Expand Down
2 changes: 1 addition & 1 deletion docs/gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ var rename = require('gulp-rename');

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

@petebacondarwin petebacondarwin Jan 2, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Neither clean nor bower tasks exists in this file. An example of an async task is doc-gen, but actually I think that one returns a promise...


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

Expand Down
12 changes: 0 additions & 12 deletions lib/grunt/plugins.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

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

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

Expand Down Expand Up @@ -63,15 +62,4 @@ module.exports = function(grunt) {
grunt.registerTask('collect-errors', 'Combine stripped error files', function() {
util.collectErrors();
});

grunt.registerTask('bower', 'Install Bower packages.', function() {
var done = this.async();

bower.commands.install()
.on('log', function(result) {
grunt.log.ok('bower: ' + result.id + ' ' + result.data.endpoint.name);
})
.on('error', grunt.fail.warn.bind(grunt.fail))
.on('end', done);
});
};
4 changes: 2 additions & 2 deletions lib/grunt/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -187,8 +187,8 @@ module.exports = {
'java ' +
this.java32flags() + ' ' +
this.memoryRequirement() + ' ' +
'-cp bower_components/closure-compiler/compiler.jar' + classPathSep +
'bower_components/ng-closure-runner/ngcompiler.jar ' +
'-cp vendor/closure-compiler/compiler.jar' + classPathSep +
'vendor/ng-closure-runner/ngcompiler.jar ' +
'org.angularjs.closurerunner.NgClosureRunner ' +
'--compilation_level ' + compilationLevel + ' ' +
'--language_in ECMASCRIPT5_STRICT ' +
Expand Down
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
"angular-benchpress": "0.x.x",
"benchmark": "1.x.x",
"bootstrap": "3.1.1",
"bower": "~1.3.9",
"browserstacktunnel-wrapper": "2.0.0",
"canonical-path": "0.0.2",
"changez": "^2.1.1",
Expand Down Expand Up @@ -60,7 +59,9 @@
"jasmine-core": "2.5.2",
"jasmine-node": "^2.0.0",
"jasmine-reporters": "^2.2.0",
"jquery": "^3.2.1",
"jquery": "3.2.1",
"jquery-2.1": "npm:[email protected]",
"jquery-2.2": "npm:[email protected]",
"karma": "^1.7.0",
"karma-browserstack-launcher": "^1.2.0",
"karma-chrome-launcher": "^2.1.1",
Expand Down
3 changes: 1 addition & 2 deletions scripts/travis/before_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ fi

# unit runs the docs tests too which need a built version of the code
if [[ "$JOB" = unit-* ]]; then
grunt bower
grunt validate-angular-files
grunt build
fi
Expand All @@ -28,4 +27,4 @@ fi
if [ "$JOB" != "ci-checks" ]; then
echo "wait_for_browser_provider"
./scripts/travis/wait_for_browser_provider.sh
fi
fi
2 changes: 1 addition & 1 deletion test/e2e/fixtures/ng-jq-jquery/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<script>
var jQuery_2_1_0 = jQuery.noConflict();
</script>
<script src="../../../../bower_components/jquery/dist/jquery.js"></script>
<script src="../../../../node_modules/jquery/dist/jquery.js"></script>
<script src="angular.js"></script>
<script src="script.js"></script>
</body>
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/fixtures/ng-jq/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<body>
<span>{{jqueryVersion}}</span>

<script src="../../../../bower_components/jquery/dist/jquery.js"></script>
<script src="../../../../node_modules/jquery/dist/jquery.js"></script>
<script type="text/javascript">
// Verify that empty ng-jq is not accessing `window['']`.
// (See https://github.com/angular/angular.js/issues/12741 for more details)
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/tools/fixture.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ function generateFixture(test, query) {
}
}
if (!/^\d+\.\d+.*$/.test(query.jquery)) {
$(jquery).attr('src', '/bower_components/jquery/dist/jquery.js');
$(jquery).attr('src', '/node_modules/jquery/dist/jquery.js');
} else {
$(jquery).attr('src', '//ajax.googleapis.com/ajax/libs/jquery/' + query.jquery + '/jquery.js');
}
Expand Down
Loading