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

Chore yarn aliases #16394

Merged
merged 3 commits into from
Jan 8, 2018
Merged
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
6 changes: 3 additions & 3 deletions DEVELOPERS.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,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 @@ -64,10 +64,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
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.


## 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.

11 changes: 5 additions & 6 deletions docs/config/services/getVersion.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,13 @@ 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
*/
module.exports = function getVersion(readFilesProcessor) {
var basePath = readFilesProcessor.basePath;
var sourceFolder = path.resolve(readFilesProcessor.basePath, 'node_modules');
var packageFile = 'package.json';

return function(component, sourceFolder, packageFile) {
sourceFolder = path.resolve(basePath, sourceFolder || 'node_modules');
packageFile = packageFile || 'package.json';
return require(path.join(sourceFolder,component,packageFile)).version;
return function(component) {
return require(path.join(sourceFolder, component, packageFile)).version;
};
};
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.

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.8.0",
"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": "^2.0.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
27 changes: 27 additions & 0 deletions vendor/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Vendor Libraries

Libraries that are not available via yarn / the npm registry, are checked into git in the `vendor`
folder.

Currently this affects the following libraries:

## closure-compiler

Version: `20140814`

The closure-compiler is available on npm, but not the version we are using.

## ng-closure-runner

Version: `0.2.4`

This project has never been published to npm.

# Updating the libraries

If a different version becomes available, it must be manually downloaded and replaced in the
repository.

Should yarn support requiring zip archives in the future (see
[yarn github issue: Zip support](https://github.com/yarnpkg/yarn/issues/1483)),
we can remove the libraries from the repository and add them to the package.json.
Loading