Compare commits

..

5 Commits

Author SHA1 Message Date
Adam Stankiewicz
965a53db21 Update lerna version 2016-07-02 12:46:06 +02:00
Adam Stankiewicz
1334ff67ae Configure CI properly for lerna 2016-07-02 12:46:06 +02:00
Adam Stankiewicz
afb27f446a Fix npm test command of bower-config 2016-07-02 12:46:06 +02:00
Adam Stankiewicz
fe011b8462 Add lerna 2016-07-02 12:46:06 +02:00
Adam Stankiewicz
096fc3da0d Move bower project to packages/bower 2016-07-02 12:46:06 +02:00
188 changed files with 283 additions and 3443 deletions

View File

@@ -15,4 +15,5 @@ trim_trailing_whitespace = false
insert_final_newline = false
[{package,bower}.json]
indent_style = space
indent_size = 2

16
.gitignore vendored
View File

@@ -1,14 +1,2 @@
/node_modules
/npm-debug.log
/test/assets/package-*/
/test/assets/temp-*/
/test/reports
/test/tmp/
/bower.json
/component.json
/bower_components
/test/sample
!/test/sample/bower.json
/npm-shrinkwrap.json
npm-debug.log*
lerna-debug.log*

View File

@@ -2,31 +2,22 @@ sudo: false
language: node_js
# Use node 8 for build
node_js:
- "8"
# Then test with specific node version
env:
- TEST_NODE_VERSION="0.10"
- TEST_NODE_VERSION="0.12"
- TEST_NODE_VERSION="4"
- TEST_NODE_VERSION="6"
- TEST_NODE_VERSION="8"
- TEST_NODE_VERSION="9"
before_install:
- node --version
- curl -o- -L https://yarnpkg.com/install.sh | bash -s -- --version 1.5.1
- export PATH=$HOME/.yarn/bin:$PATH
cache:
yarn: true
- "0.10"
- "0.11"
- "0.12"
- "4.0"
- "4.1"
- "4.2"
- "5"
- "6"
install:
- yarn
- nvm install $TEST_NODE_VERSION
- npm install -g grunt
- node --version
- npm --version
- git --version
- svn --version | head -n 1
- npm install
os:
- osx
@@ -36,8 +27,7 @@ matrix:
fast_finish: true
allow_failures:
- os: osx
- env: "NODE_VERSION=0.11"
script:
- nvm use $TEST_NODE_VERSION
- node --version && npm --version && git --version && svn --version | head -n 1
- grunt travis
- npm test

View File

@@ -1,22 +1,5 @@
# Changelog
## 1.8.0 - 2016-11-07
- Download tar archives from GitHub when possible (#2263)
- Change default shorthand resolver for github from `git://` to `https://`
- Fix ssl handling by not setting GIT_SSL_NO_VERIFY=false (#2361)
- Allow for removing components with url instead of name (#2368)
- Show in warning message location of malformed bower.json (#2357)
- Improve handling of non-semver versions in git resolver (#2316)
- Fix handling of cached releases pluginResolverFactory (#2356)
- Allow to type the entire version when conflict occured (#2243)
- Allow `owner/reponame` shorthand for registering components (#2248)
- Allow single-char repo names and package names (#2249)
- Make `bower version` no longer honor `version` in bower.json (#2232)
- Add `postinstall` hook (#2252)
- Allow for `@` instead of `#` for `install` and `info` commands (#2322)
- Upgrade all bundled modules
## 1.7.9 - 2016-04-05
- Show warnings for invalid bower.json fields
@@ -100,7 +83,7 @@ https://github.com/npm/npm/issues/11227
- Update bower config
- Loads the .bowerrc file from the cwd specified on the command line
- Allow the use of environment variables in .bowerrc ([#41](https://github.com/bower/config/issues/41))
- Allow for array notation in ENV variables ([#44](https://github.com/bower/config/issues/44))
- Allow for array notation in ENV variables ([#44](https://github.com/bower/config/issues/44))
## 1.6.9 - 2015-12-04

View File

@@ -18,7 +18,7 @@ Bower is a large community project with many different developers contributing a
## Team Meetings
We communicate through a channel on Discord https://discord.gg/0fFM7QF0KpZRh2cY
We communicate through a channel on slack: https://gitter.im/bower
If you'd like to attend the meetings, please fill the [support form](http://goo.gl/forms/P1ndzCNoiG), and you'll get an invite.
@@ -29,9 +29,9 @@ The issue tracker is the preferred channel for [bug reports](#bugs),
requests](#pull-requests), but please respect the following restrictions:
* Please **do not** use the issue tracker for personal support requests. Use
[Stack Overflow](http://stackoverflow.com/questions/tagged/bower),
[Discord Channel](https://discordapp.com/channels/119103197720739842/123728452816732160),
[Mailing List](http://groups.google.com/group/twitter-bower),
[Stack Overflow](http://stackoverflow.com/questions/tagged/bower)
[Gitter Channel](https://gitter.im/bower/bower)
[Mailing List](http://groups.google.com/group/twitter-bower)
(twitter-bower@googlegroups.com), or
[#bower](http://webchat.freenode.net/?channels=bower) on Freenode.

View File

@@ -1,14 +1,13 @@
# Bower - A package manager for the web
[![Backers on Open Collective](https://opencollective.com/bower/backers/badge.svg)](#backers)
[![Sponsors on Open Collective](https://opencollective.com/bower/sponsors/badge.svg)](#sponsors)
> ..psst! While Bower is maintained, we recommend [yarn](https://yarnpkg.com/) and [webpack](https://webpack.js.org/) for new front-end projects!
> Bower needs your help. If you're willing to help, please say hello to team@bower.io or [donate](https://salt.bountysource.com/teams/bower)
[![Unix CI](https://img.shields.io/travis/bower/bower/master.svg?maxAge=2592000)](https://travis-ci.org/bower/bower)
[![Windows CI](https://img.shields.io/appveyor/ci/bower/bower/master.svg)](https://ci.appveyor.com/project/bower/bower)
[![Coverage Status](https://img.shields.io/coveralls/bower/bower.svg)](https://coveralls.io/r/bower/bower?branch=master)
[![Discord chat](https://img.shields.io/badge/discord-join%20chat%20%E2%86%92-brightgreen.svg?style=flat)](https://discord.gg/0fFM7QF0KpZRh2cY)
[![Issue Stats](http://issuestats.com/github/bower/bower/badge/pr?style=flat)](http://issuestats.com/github/bower/bower)
[![Issue Stats](http://issuestats.com/github/bower/bower/badge/issue?style=flat)](http://issuestats.com/github/bower/bower)
<img align="right" height="300" src="http://bower.io/img/bower-logo.png">
@@ -120,81 +119,8 @@ Note that on Windows for tests to pass you need to configure Git before cloning:
git config --global core.autocrlf input
```
## Backers
Support us with a monthly donation and help us continue our activities. [[Become a backer](https://opencollective.com/bower#backer)]
<a href="https://opencollective.com/bower/backer/0/website" target="_blank"><img src="https://opencollective.com/bower/backer/0/avatar.svg"></a>
<a href="https://opencollective.com/bower/backer/1/website" target="_blank"><img src="https://opencollective.com/bower/backer/1/avatar.svg"></a>
<a href="https://opencollective.com/bower/backer/2/website" target="_blank"><img src="https://opencollective.com/bower/backer/2/avatar.svg"></a>
<a href="https://opencollective.com/bower/backer/3/website" target="_blank"><img src="https://opencollective.com/bower/backer/3/avatar.svg"></a>
<a href="https://opencollective.com/bower/backer/4/website" target="_blank"><img src="https://opencollective.com/bower/backer/4/avatar.svg"></a>
<a href="https://opencollective.com/bower/backer/5/website" target="_blank"><img src="https://opencollective.com/bower/backer/5/avatar.svg"></a>
<a href="https://opencollective.com/bower/backer/6/website" target="_blank"><img src="https://opencollective.com/bower/backer/6/avatar.svg"></a>
<a href="https://opencollective.com/bower/backer/7/website" target="_blank"><img src="https://opencollective.com/bower/backer/7/avatar.svg"></a>
<a href="https://opencollective.com/bower/backer/8/website" target="_blank"><img src="https://opencollective.com/bower/backer/8/avatar.svg"></a>
<a href="https://opencollective.com/bower/backer/9/website" target="_blank"><img src="https://opencollective.com/bower/backer/9/avatar.svg"></a>
<a href="https://opencollective.com/bower/backer/10/website" target="_blank"><img src="https://opencollective.com/bower/backer/10/avatar.svg"></a>
<a href="https://opencollective.com/bower/backer/11/website" target="_blank"><img src="https://opencollective.com/bower/backer/11/avatar.svg"></a>
<a href="https://opencollective.com/bower/backer/12/website" target="_blank"><img src="https://opencollective.com/bower/backer/12/avatar.svg"></a>
<a href="https://opencollective.com/bower/backer/13/website" target="_blank"><img src="https://opencollective.com/bower/backer/13/avatar.svg"></a>
<a href="https://opencollective.com/bower/backer/14/website" target="_blank"><img src="https://opencollective.com/bower/backer/14/avatar.svg"></a>
<a href="https://opencollective.com/bower/backer/15/website" target="_blank"><img src="https://opencollective.com/bower/backer/15/avatar.svg"></a>
<a href="https://opencollective.com/bower/backer/16/website" target="_blank"><img src="https://opencollective.com/bower/backer/16/avatar.svg"></a>
<a href="https://opencollective.com/bower/backer/17/website" target="_blank"><img src="https://opencollective.com/bower/backer/17/avatar.svg"></a>
<a href="https://opencollective.com/bower/backer/18/website" target="_blank"><img src="https://opencollective.com/bower/backer/18/avatar.svg"></a>
<a href="https://opencollective.com/bower/backer/19/website" target="_blank"><img src="https://opencollective.com/bower/backer/19/avatar.svg"></a>
<a href="https://opencollective.com/bower/backer/20/website" target="_blank"><img src="https://opencollective.com/bower/backer/20/avatar.svg"></a>
<a href="https://opencollective.com/bower/backer/21/website" target="_blank"><img src="https://opencollective.com/bower/backer/21/avatar.svg"></a>
<a href="https://opencollective.com/bower/backer/22/website" target="_blank"><img src="https://opencollective.com/bower/backer/22/avatar.svg"></a>
<a href="https://opencollective.com/bower/backer/23/website" target="_blank"><img src="https://opencollective.com/bower/backer/23/avatar.svg"></a>
<a href="https://opencollective.com/bower/backer/24/website" target="_blank"><img src="https://opencollective.com/bower/backer/24/avatar.svg"></a>
<a href="https://opencollective.com/bower/backer/25/website" target="_blank"><img src="https://opencollective.com/bower/backer/25/avatar.svg"></a>
<a href="https://opencollective.com/bower/backer/26/website" target="_blank"><img src="https://opencollective.com/bower/backer/26/avatar.svg"></a>
<a href="https://opencollective.com/bower/backer/27/website" target="_blank"><img src="https://opencollective.com/bower/backer/27/avatar.svg"></a>
<a href="https://opencollective.com/bower/backer/28/website" target="_blank"><img src="https://opencollective.com/bower/backer/28/avatar.svg"></a>
<a href="https://opencollective.com/bower/backer/29/website" target="_blank"><img src="https://opencollective.com/bower/backer/29/avatar.svg"></a>
## Sponsors
Become a sponsor and get your logo on our README on Github with a link to your site. [[Become a sponsor](https://opencollective.com/bower#sponsor)]
<a href="https://opencollective.com/bower/sponsor/0/website" target="_blank"><img src="https://opencollective.com/bower/sponsor/0/avatar.svg"></a>
<a href="https://opencollective.com/bower/sponsor/1/website" target="_blank"><img src="https://opencollective.com/bower/sponsor/1/avatar.svg"></a>
<a href="https://opencollective.com/bower/sponsor/2/website" target="_blank"><img src="https://opencollective.com/bower/sponsor/2/avatar.svg"></a>
<a href="https://opencollective.com/bower/sponsor/3/website" target="_blank"><img src="https://opencollective.com/bower/sponsor/3/avatar.svg"></a>
<a href="https://opencollective.com/bower/sponsor/4/website" target="_blank"><img src="https://opencollective.com/bower/sponsor/4/avatar.svg"></a>
<a href="https://opencollective.com/bower/sponsor/5/website" target="_blank"><img src="https://opencollective.com/bower/sponsor/5/avatar.svg"></a>
<a href="https://opencollective.com/bower/sponsor/6/website" target="_blank"><img src="https://opencollective.com/bower/sponsor/6/avatar.svg"></a>
<a href="https://opencollective.com/bower/sponsor/7/website" target="_blank"><img src="https://opencollective.com/bower/sponsor/7/avatar.svg"></a>
<a href="https://opencollective.com/bower/sponsor/8/website" target="_blank"><img src="https://opencollective.com/bower/sponsor/8/avatar.svg"></a>
<a href="https://opencollective.com/bower/sponsor/9/website" target="_blank"><img src="https://opencollective.com/bower/sponsor/9/avatar.svg"></a>
<a href="https://opencollective.com/bower/sponsor/10/website" target="_blank"><img src="https://opencollective.com/bower/sponsor/10/avatar.svg"></a>
<a href="https://opencollective.com/bower/sponsor/11/website" target="_blank"><img src="https://opencollective.com/bower/sponsor/11/avatar.svg"></a>
<a href="https://opencollective.com/bower/sponsor/12/website" target="_blank"><img src="https://opencollective.com/bower/sponsor/12/avatar.svg"></a>
<a href="https://opencollective.com/bower/sponsor/13/website" target="_blank"><img src="https://opencollective.com/bower/sponsor/13/avatar.svg"></a>
<a href="https://opencollective.com/bower/sponsor/14/website" target="_blank"><img src="https://opencollective.com/bower/sponsor/14/avatar.svg"></a>
<a href="https://opencollective.com/bower/sponsor/15/website" target="_blank"><img src="https://opencollective.com/bower/sponsor/15/avatar.svg"></a>
<a href="https://opencollective.com/bower/sponsor/16/website" target="_blank"><img src="https://opencollective.com/bower/sponsor/16/avatar.svg"></a>
<a href="https://opencollective.com/bower/sponsor/17/website" target="_blank"><img src="https://opencollective.com/bower/sponsor/17/avatar.svg"></a>
<a href="https://opencollective.com/bower/sponsor/18/website" target="_blank"><img src="https://opencollective.com/bower/sponsor/18/avatar.svg"></a>
<a href="https://opencollective.com/bower/sponsor/19/website" target="_blank"><img src="https://opencollective.com/bower/sponsor/19/avatar.svg"></a>
<a href="https://opencollective.com/bower/sponsor/20/website" target="_blank"><img src="https://opencollective.com/bower/sponsor/20/avatar.svg"></a>
<a href="https://opencollective.com/bower/sponsor/21/website" target="_blank"><img src="https://opencollective.com/bower/sponsor/21/avatar.svg"></a>
<a href="https://opencollective.com/bower/sponsor/22/website" target="_blank"><img src="https://opencollective.com/bower/sponsor/22/avatar.svg"></a>
<a href="https://opencollective.com/bower/sponsor/23/website" target="_blank"><img src="https://opencollective.com/bower/sponsor/23/avatar.svg"></a>
<a href="https://opencollective.com/bower/sponsor/24/website" target="_blank"><img src="https://opencollective.com/bower/sponsor/24/avatar.svg"></a>
<a href="https://opencollective.com/bower/sponsor/25/website" target="_blank"><img src="https://opencollective.com/bower/sponsor/25/avatar.svg"></a>
<a href="https://opencollective.com/bower/sponsor/26/website" target="_blank"><img src="https://opencollective.com/bower/sponsor/26/avatar.svg"></a>
<a href="https://opencollective.com/bower/sponsor/27/website" target="_blank"><img src="https://opencollective.com/bower/sponsor/27/avatar.svg"></a>
<a href="https://opencollective.com/bower/sponsor/28/website" target="_blank"><img src="https://opencollective.com/bower/sponsor/28/avatar.svg"></a>
<a href="https://opencollective.com/bower/sponsor/29/website" target="_blank"><img src="https://opencollective.com/bower/sponsor/29/avatar.svg"></a>
## License
Copyright (c) 2012-present Twitter and [other contributors](https://github.com/bower/bower/graphs/contributors)
Copyright (c) 2016 Twitter and [other contributors](https://github.com/bower/bower/graphs/contributors)
Licensed under the MIT License

View File

@@ -12,10 +12,11 @@ environment:
matrix:
- nodejs_version: "0.10"
- nodejs_version: "0.12"
- nodejs_version: "4"
- nodejs_version: "4.0"
- nodejs_version: "4.1"
- nodejs_version: "4.2"
- nodejs_version: "5"
- nodejs_version: "6"
- nodejs_version: "8"
- nodejs_version: "9"
# Finish on first failed build
matrix:
@@ -23,16 +24,14 @@ matrix:
# Install node, display versions, install dependencies
install:
- ps: Install-Product node 8
- ps: Install-Product node $env:nodejs_version
- node --version && npm --version
- git --version && svn --version
- npm install -g yarn grunt
- yarn
- ps: Install-Product node $env:nodejs_version
- npm install
# Post-install test scripts.
test_script:
- cmd: npm run ci
- cmd: npm test
# Make clone much faster
shallow_clone: true
@@ -43,4 +42,4 @@ deploy: off
# Cache node modules, and refresh if package.json changes
cache:
- "%LOCALAPPDATA%\\Yarn"
- node_modules -> package.json

10
lerna.json Normal file
View File

@@ -0,0 +1,10 @@
{
"lerna": "2.0.0-beta.23",
"version": "independent",
"publishConfig": {
"ignore": [
"ignored-file",
"*.md"
]
}
}

View File

@@ -1,100 +1,10 @@
{
"name": "bower",
"version": "1.8.0",
"description": "The browser package manager",
"author": "Twitter",
"license": "MIT",
"repository": "bower/bower",
"main": "lib",
"bin": "bin/bower",
"homepage": "http://bower.io",
"engines": {
"node": ">=0.10.0"
},
"keywords": [
"bower"
],
"dependencies": {
"abbrev": "^1.0.5",
"archy": "1.0.0",
"bower-config": "^1.4.1",
"bower-endpoint-parser": "^0.2.2",
"bower-json": "^0.8.1",
"bower-logger": "^0.2.2",
"bower-registry-client": "^1.0.0",
"cardinal": "0.4.4",
"chalk": "^1.0.0",
"chmodr": "^1.0.2",
"configstore": "^2.0.0",
"decompress-zip": "^0.2.1",
"destroy": "^1.0.3",
"findup-sync": "^0.3.0",
"fs-write-stream-atomic": "1.0.8",
"fstream": "^1.0.3",
"fstream-ignore": "^1.0.2",
"github": "^0.2.3",
"glob": "^4.3.2",
"graceful-fs": "^4.1.3",
"handlebars": "^4.0.5",
"inquirer": "0.10.0",
"is-root": "^1.0.0",
"junk": "^1.0.0",
"lockfile": "^1.0.0",
"lru-cache": "^2.5.0",
"md5-hex": "^1.0.2",
"mkdirp": "0.5.0",
"mout": "^0.11.0",
"nopt": "^3.0.1",
"opn": "^4.0.0",
"p-throttler": "0.1.1",
"promptly": "0.2.0",
"q": "^1.1.2",
"request": "2.67.0",
"request-progress": "0.3.1",
"requireg": "^0.1.5",
"resolve": "^1.1.7",
"retry": "0.6.1",
"rimraf": "^2.2.8",
"semver": "^2.3.0",
"semver-utils": "^1.1.1",
"shell-quote": "^1.4.2",
"stringify-object": "^1.0.0",
"tar-fs": "^1.4.1",
"tmp": "0.0.28",
"update-notifier": "^0.6.0",
"user-home": "^1.1.0",
"which": "^1.0.8"
},
"private": true,
"devDependencies": {
"arr-diff": "^2.0.0",
"chai": "^3.5.0",
"coveralls": "^2.11.9",
"expect.js": "^0.3.1",
"grunt": "^1.0.1",
"grunt-cli": "^1.1.0",
"grunt-contrib-watch": "^1.0.0",
"grunt-eslint": "^18.1.0",
"grunt-exec": "^0.4.7",
"grunt-simple-mocha": "^0.4.1",
"in-publish": "^2.0.0",
"istanbul": "^0.4.3",
"load-grunt-tasks": "^3.5.0",
"mocha": "^2.5.3",
"multiline": "^1.0.2",
"nock": "^9.2.3",
"node-uuid": "^1.4.7",
"proxyquire": "^1.7.9",
"spawn-sync": "1.0.15",
"wrench": "^1.5.8"
"lerna": "2.0.0-beta.23"
},
"scripts": {
"test": "grunt test",
"ci": "grunt travis",
"coveralls": "coveralls",
"prepublish": "in-publish && echo 'You need to use \"grunt publish\" to publish bower' && false || not-in-publish"
},
"files": [
"bin",
"lib"
]
"postinstall": "lerna bootstrap",
"test": "lerna run test"
}
}

View File

@@ -3,20 +3,6 @@ module.exports = function (grunt) {
require('load-grunt-tasks')(grunt);
grunt.initConfig({
jshint: {
options: {
jshintrc: '.jshintrc'
},
files: [
'Gruntfile.js',
'bin/*',
'lib/**/*.js',
'test/**/*.js',
'!test/assets/**/*',
'!test/reports/**/*',
'!test/tmp/**/*'
]
},
simplemocha: {
options: {
reporter: 'spec',
@@ -41,13 +27,21 @@ module.exports = function (grunt) {
}
},
watch: {
files: ['<%= jshint.files %>'],
tasks: ['jshint', 'simplemocha:short']
files: [
'Gruntfile.js',
'bin/*',
'lib/**/*.js',
'test/**/*.js',
'!test/assets/**/*',
'!test/reports/**/*',
'!test/tmp/**/*'
],
tasks: ['simplemocha:short']
}
});
grunt.registerTask('test', ['jshint', 'simplemocha:full']);
grunt.registerTask('test', ['simplemocha:full']);
grunt.registerTask('cover', 'exec:cover');
grunt.registerTask('travis', ['jshint', 'exec:cover', 'exec:coveralls']);
grunt.registerTask('travis', ['exec:cover', 'exec:coveralls']);
grunt.registerTask('default', 'test');
};

View File

@@ -10,7 +10,7 @@
"registry": {
"search": [
"http://localhost:8000",
"https://registry.bower.io"
"https://bower.herokuapp.com"
]
}
}

View File

@@ -21,7 +21,7 @@ var userAgent = !proxy && !httpsProxy
var defaults = {
'directory': 'bower_components',
'registry': 'https://registry.bower.io',
'registry': 'https://bower.herokuapp.com',
'shorthand-resolver': 'https://github.com/{{owner}}/{{package}}.git',
'tmp': paths.tmp,
'proxy': proxy,

View File

@@ -43,9 +43,6 @@ function doEnvReplaceStr (f) {
function envReplace(config) {
var envReplaced = {};
if ( lang.isArray(config) ) {
envReplaced = [];
}
object.forOwn(config, function (value, key) {
@@ -66,9 +63,6 @@ function envReplace(config) {
if ( lang.isPlainObject(value) ) {
envReplaced[key] = envReplace(value);
}
else if ( lang.isArray(value) ) {
envReplaced[key] = envReplace(value);
}
else if ( lang.isString(value) ) {
envReplaced[key] = doEnvReplaceStr(value);
}
@@ -92,7 +86,7 @@ function expand(config) {
publish: config.registry
};
} else if (typeof config.registry === 'object') {
config.registry.default = config.registry.default || 'https://registry.bower.io';
config.registry.default = config.registry.default || 'https://bower.herokuapp.com';
config.registry = {
default: config.registry.default,

View File

@@ -4,7 +4,7 @@
"description": "The Bower config reader and writer.",
"author": "Twitter",
"license": "MIT",
"repository": "https://github.com/bower/bower/tree/master/packages/bower-config",
"repository": "bower/config",
"main": "lib/Config",
"homepage": "http://bower.io",
"engines": {

View File

@@ -4,12 +4,7 @@
},
"storage" : {
"packages" : "${_BOWERRC_MY_PACKAGES}",
"registry" : {
"register": "~/.bower-test/registry",
"search": [
"${_BOWERRC_MY_USER}:${_BOWERRC_MY_PASS}"
]
}
"registry" : "~/.bower-test/registry"
},
"tmp" : "${_BOWERRC_MY_TMP}"
}

View File

@@ -12,12 +12,12 @@ describe('NPM Config on package.json', function () {
var config = require('../lib/Config').read(null, {});
assert.deepEqual(config.registry, {
'default': 'https://registry.bower.io',
'default': 'https://bower.herokuapp.com',
'search': [
'https://registry.bower.io'
'https://bower.herokuapp.com'
],
'register': 'https://registry.bower.io',
'publish': 'https://registry.bower.io'
'register': 'https://bower.herokuapp.com',
'publish': 'https://bower.herokuapp.com'
});
});
@@ -38,12 +38,12 @@ describe('NPM Config on package.json', function () {
var config = require('../lib/Config').read(null, { registry: { search: 'https://foobar' } });
assert.deepEqual(config.registry, {
'default': 'https://registry.bower.io',
'default': 'https://bower.herokuapp.com',
'search': [
'https://foobar',
],
'register': 'https://registry.bower.io',
'publish': 'https://registry.bower.io'
'register': 'https://bower.herokuapp.com',
'publish': 'https://bower.herokuapp.com'
});
});
@@ -70,12 +70,12 @@ describe('NPM Config on package.json', function () {
assert.deepEqual(config, {
'directory': 'bower_components',
'registry': {
'default': 'https://registry.bower.io',
'default': 'https://bower.herokuapp.com',
'search': [
'https://registry.bower.io'
'https://bower.herokuapp.com'
],
'register': 'https://registry.bower.io',
'publish': 'https://registry.bower.io'
'register': 'https://bower.herokuapp.com',
'publish': 'https://bower.herokuapp.com'
},
'shorthandResolver': 'https://github.com/{{owner}}/{{package}}.git',
'tmp': '/foo/bar',
@@ -224,13 +224,10 @@ describe('Allow ${ENV} variables in .bowerrc', function() {
it('sets values from process.env', function() {
process.env._BOWERRC_MY_PACKAGES = 'a';
process.env._BOWERRC_MY_TMP = '/tmp/b';
process.env._BOWERRC_MY_USER = 'username';
process.env._BOWERRC_MY_PASS = 'password';
var config = require('../lib/Config').read('test/assets/env-variables-values');
assert.equal('a', config.storage.packages);
assert.equal('/tmp/b', config.tmp);
assert.equal('username:password', config.storage.registry.search[0]);
assert.equal('${_myshellvar}', config.scripts.postinstall);
});
});
@@ -241,7 +238,7 @@ describe('untildify paths in .bowerrc', function() {
var config = require('../lib/Config').read('test/assets/env-variables-values');
var untildify = require('untildify');
assert.equal(untildify('~/.bower-test/registry') , config.storage.registry.register);
assert.equal(untildify('~/.bower-test/registry') , config.storage.registry);
});
});

View File

@@ -9,7 +9,10 @@
"url": "https://github.com/bower/endpoint-parser/blob/master/LICENSE"
}
],
"repository": "https://github.com/bower/bower/tree/master/packages/bower-endpoint-parser",
"repository": {
"type": "git",
"url": "git://github.com/bower/endpoint-parser.git"
},
"main": "index.js",
"engines": {
"node": ">=0.8.0"

View File

@@ -1,4 +1,4 @@
Copyright (c) 2012-present Twitter and other contributors
Copyright (c) 2016 Twitter and other contributors
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in

View File

@@ -4,7 +4,7 @@
"description": "Read bower.json files with semantics, normalisation, defaults and validation",
"author": "Twitter",
"license": "MIT",
"repository": "https://github.com/bower/bower/tree/master/packages/bower-json",
"repository": "bower/json",
"main": "lib/json",
"engines": {
"node": ">=0.10.0"

View File

@@ -447,7 +447,7 @@ describe('.normalize', function () {
describe('packages from bower registry', function () {
var packageList,
packageListUrl = 'http://registry.bower.io/packages';
packageListUrl = 'http://bower.herokuapp.com/packages';
this.timeout(60000);

View File

@@ -9,7 +9,7 @@
"url": "https://github.com/bower/logger/blob/master/LICENSE"
}
],
"repository": "https://github.com/bower/bower/tree/master/packages/bower-logger",
"repository": "bower/logger",
"main": "lib/Logger",
"engines": {
"node": ">=0.10.0"

View File

@@ -4,7 +4,7 @@
"description": "Provides easy interaction with the Bower registry",
"author": "Twitter",
"license": "MIT",
"repository": "https://github.com/bower/bower/tree/master/packages/bower-registry-client",
"repository": "bower/registry-client",
"main": "Client",
"engines": {
"node": ">=0.10.0"

View File

@@ -8,7 +8,7 @@ var Config = require('bower-config');
describe('RegistryClient', function () {
beforeEach(function () {
this.uri = 'https://registry.bower.io';
this.uri = 'https://bower.herokuapp.com';
this.timeoutVal = 5000;
this.registry = new RegistryClient(Config.read(process.cwd(), {
strictSsl: false,
@@ -104,7 +104,7 @@ describe('RegistryClient', function () {
describe('cache', function () {
beforeEach(function () {
nock('https://registry.bower.io:443')
nock('https://bower.herokuapp.com:443')
.get('/packages/search/jquery')
.replyWithFile(200, __dirname + '/fixtures/search.json');
@@ -114,7 +114,7 @@ describe('RegistryClient', function () {
}));
this.cacheDir = this.client._config.cache;
this.host = 'registry.bower.io';
this.host = 'bower.herokuapp.com';
this.method = 'search';
this.pkg = 'jquery';
@@ -164,7 +164,7 @@ describe('RegistryClient', function () {
//
describe('calling the lookup instance method with argument', function () {
beforeEach(function () {
nock('https://registry.bower.io:443')
nock('https://bower.herokuapp.com:443')
.get('/packages/jquery')
.reply(200, {
name: 'jquery',
@@ -260,7 +260,7 @@ describe('RegistryClient', function () {
describe('calling the lookup instance method with three registries', function () {
beforeEach(function () {
nock('https://registry.bower.io:443')
nock('https://bower.herokuapp.com:443')
.get('/packages/jquery')
.reply(404);
@@ -283,7 +283,7 @@ describe('RegistryClient', function () {
force: true,
registry: {
search: [
'https://registry.bower.io',
'https://bower.herokuapp.com',
'http://custom-registry.com',
'http://custom-registry2.com'
]
@@ -311,7 +311,7 @@ describe('RegistryClient', function () {
it('should respect order', function (next) {
this.registry._config.registry.search = [
'https://registry.bower.io',
'https://bower.herokuapp.com',
'http://custom-registry2.com',
'http://custom-registry.com'
];
@@ -330,7 +330,7 @@ describe('RegistryClient', function () {
//
describe('calling the register instance method with argument', function () {
beforeEach(function () {
nock('https://registry.bower.io:443')
nock('https://bower.herokuapp.com:443')
.post('/packages', 'name=test-ba&url=git%3A%2F%2Fgithub.com%2Ftest-ba%2Ftest-ba.git')
.reply(201);
@@ -368,7 +368,7 @@ describe('RegistryClient', function () {
describe('calling the register instance method without arguments', function () {
beforeEach(function () {
nock('https://registry.bower.io:443')
nock('https://bower.herokuapp.com:443')
.post('/packages', 'name=&url=')
.reply(400);
});
@@ -392,7 +392,7 @@ describe('RegistryClient', function () {
this.accessToken = '12345678';
this.registry._config.accessToken = this.accessToken;
nock('https://registry.bower.io:443')
nock('https://bower.herokuapp.com:443')
.delete('/packages/' + this.pkg + '?access_token=' + this.accessToken)
.reply(204);
});
@@ -420,7 +420,7 @@ describe('RegistryClient', function () {
this.pkg = 'testfoo';
this.registry._config.accessToken = '';
nock('https://registry.bower.io:443')
nock('https://bower.herokuapp.com:443')
.delete('/packages/' + this.pkg)
.reply(403);
});
@@ -440,7 +440,7 @@ describe('RegistryClient', function () {
this.accessToken = '12345678';
this.registry._config.accessToken = this.accessToken;
nock('https://registry.bower.io:443')
nock('https://bower.herokuapp.com:443')
.delete('/packages/' + this.notpkg + '?access_token=' + this.accessToken)
.reply(404);
});
@@ -459,7 +459,7 @@ describe('RegistryClient', function () {
//
describe('calling the search instance method with argument', function () {
beforeEach(function () {
nock('https://registry.bower.io:443')
nock('https://bower.herokuapp.com:443')
.get('/packages/search/jquery')
.replyWithFile(200, __dirname + '/fixtures/search.json');
@@ -505,7 +505,7 @@ describe('RegistryClient', function () {
describe('calling the search instance method with two registries', function () {
beforeEach(function () {
nock('https://registry.bower.io:443')
nock('https://bower.herokuapp.com:443')
.get('/packages/search/jquery')
.reply(200, []);
@@ -526,7 +526,7 @@ describe('RegistryClient', function () {
force: true,
registry: {
search: [
'https://registry.bower.io',
'https://bower.herokuapp.com',
'http://custom-registry.com'
]
}
@@ -566,7 +566,7 @@ describe('RegistryClient', function () {
describe('calling the search instance method without argument', function () {
beforeEach(function () {
nock('https://registry.bower.io:443')
nock('https://bower.herokuapp.com:443')
.get('/packages/search/')
.reply(404);
});
@@ -585,7 +585,7 @@ describe('RegistryClient', function () {
//
describe('calling the list instance method', function () {
beforeEach(function () {
nock('https://registry.bower.io:443')
nock('https://bower.herokuapp.com:443')
.get('/packages')
.reply(200, [], {});
@@ -610,7 +610,7 @@ describe('RegistryClient', function () {
describe('calling the list instance method with two registries', function () {
beforeEach(function () {
nock('https://registry.bower.io:443')
nock('https://bower.herokuapp.com:443')
.get('/packages')
.reply(200, []);
@@ -628,7 +628,7 @@ describe('RegistryClient', function () {
force: true,
registry: {
search: [
'https://registry.bower.io',
'https://bower.herokuapp.com',
'http://custom-registry.com'
]
}
@@ -669,7 +669,7 @@ describe('RegistryClient', function () {
describe('calling the list instance method', function () {
beforeEach(function () {
nock('https://registry.bower.io:443')
nock('https://bower.herokuapp.com:443')
.get('/packages')
.reply(200, [], {});
});

14
packages/bower/.gitignore vendored Normal file
View File

@@ -0,0 +1,14 @@
/node_modules
/npm-debug.log
/test/assets/package-*/
/test/assets/temp-*/
/test/reports
/test/tmp/
/bower.json
/component.json
/bower_components
/test/sample
!/test/sample/bower.json
/npm-shrinkwrap.json

View File

@@ -1,4 +1,4 @@
Copyright (c) 2013-present Twitter and other contributors
Copyright (c) 2016 Twitter and other contributors
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in

View File

@@ -9,12 +9,6 @@ function info(logger, endpoint, property, config) {
return;
}
// handle @ as version divider
var splitParts = endpoint.split('/');
splitParts[splitParts.length - 1] = splitParts[splitParts.length - 1].replace('@', '#');
endpoint = splitParts.join('/');
var repository;
var decEndpoint;
@@ -27,33 +21,33 @@ function info(logger, endpoint, property, config) {
getPkgMeta(repository, decEndpoint, property),
decEndpoint.target === '*' && !property ? repository.versions(decEndpoint.source) : null
])
.spread(function (pkgMeta, versions) {
if (versions) {
return {
name: decEndpoint.source,
versions: versions,
latest: pkgMeta
};
}
.spread(function (pkgMeta, versions) {
if (versions) {
return {
name: decEndpoint.source,
versions: versions,
latest: pkgMeta
};
}
return pkgMeta;
});
return pkgMeta;
});
}
function getPkgMeta(repository, decEndpoint, property) {
return repository.fetch(decEndpoint)
.spread(function (canonicalDir, pkgMeta) {
pkgMeta = mout.object.filter(pkgMeta, function (value, key) {
return key.charAt(0) !== '_';
});
// Retrieve specific property
if (property) {
pkgMeta = mout.object.get(pkgMeta, property);
}
return pkgMeta;
.spread(function (canonicalDir, pkgMeta) {
pkgMeta = mout.object.filter(pkgMeta, function (value, key) {
return key.charAt(0) !== '_';
});
// Retrieve specific property
if (property) {
pkgMeta = mout.object.get(pkgMeta, property);
}
return pkgMeta;
});
}
// -------------------

View File

@@ -16,12 +16,6 @@ function install(logger, endpoints, options, config) {
// Convert endpoints to decomposed endpoints
endpoints = endpoints || [];
decEndpoints = endpoints.map(function (endpoint) {
// handle @ as version divider
var splitParts = endpoint.split('/');
splitParts[splitParts.length - 1] = splitParts[splitParts.length - 1].replace('@', '#');
endpoint = splitParts.join('/');
return endpointParser.decompose(endpoint);
});
@@ -34,11 +28,11 @@ install.readOptions = function (argv) {
var cli = require('../util/cli');
var options = cli.readOptions({
'force-latest': {type: Boolean, shorthand: 'F'},
'production': {type: Boolean, shorthand: 'p'},
'save': {type: Boolean, shorthand: 'S'},
'save-dev': {type: Boolean, shorthand: 'D'},
'save-exact': {type: Boolean, shorthand: 'E'}
'force-latest': { type: Boolean, shorthand: 'F'},
'production': { type: Boolean, shorthand: 'p' },
'save': { type: Boolean, shorthand: 'S' },
'save-dev': { type: Boolean, shorthand: 'D' },
'save-exact': { type: Boolean, shorthand: 'E' }
}, argv);
var packages = options.argv.remain.slice(1);

View File

@@ -16,7 +16,7 @@ function lookup(logger, name, config) {
.then(function (entry) {
return !entry ? null : {
name: name,
url: entry.url
url: entry && entry.url
};
});
}

View File

@@ -587,17 +587,6 @@ Manager.prototype._dissect = function () {
}
}
// If they are equal and one of them is an exact target,
// give higher priority
if (!result) {
if (first.target === first.pkgMeta.version) {
return -1;
}
if (second.target === second.pkgMeta.version) {
return 1;
}
}
return result;
});
@@ -687,6 +676,7 @@ Manager.prototype._electSuitable = function (name, semvers, nonSemvers) {
var unresolvable;
var dataPicks;
var save;
var choices;
var picks = [];
var versionRegex = /(?:[\d\w]\.){2}[\d\w](?:.)*/;
var picksReleases;
@@ -825,9 +815,7 @@ Manager.prototype._electSuitable = function (name, semvers, nonSemvers) {
});
// Save resolution
if (this._config.argv.cooked.includes('--save')) {
this._storeResolution(picks[suitable]);
}
this._storeResolution(picks[suitable]);
return Q.resolve(picks[suitable]);
}
@@ -846,6 +834,7 @@ Manager.prototype._electSuitable = function (name, semvers, nonSemvers) {
picks: dataPicks
});
choices = picks.map(function (pick, index) { return index + 1; });
picksReleases = picks.map(function (pick) { return pick.pkgMeta._release; });
return Q.nfcall(this._logger.prompt.bind(this._logger), {
type: 'input',

View File

@@ -213,20 +213,6 @@ Project.prototype.update = function (names, options) {
});
};
function resolveUrlNames(names, flattened)
{
for (var i = 0; i < names.length; i++)
if (! flattened[names[i]])
{
var url = names[i].trim().replace(/\/$/, '');
var packName;
for (packName in flattened)
if (! ( !flattened[packName].source))
if (url == flattened[packName].source.trim().replace(/\/$/, ''))
names[i] = packName;
}
}
Project.prototype.uninstall = function (names, options) {
var that = this;
var packages = {};
@@ -244,7 +230,6 @@ Project.prototype.uninstall = function (names, options) {
// Fill in the packages to be uninstalled
.spread(function (json, tree, flattened) {
var promise = Q.resolve();
resolveUrlNames(names, flattened);
names.forEach(function (name) {
var decEndpoint = flattened[name];

View File

@@ -176,12 +176,6 @@ function getConstructor(decEndpoint, options, registryClient) {
// Check if is a shorthand and expand it
addResolver(function () {
// Check if the shorthandResolver is falsy
if (!config.shorthandResolver) {
return;
}
// Skip ssh and/or URL with auth
if (/[:@]/.test(source)) {
return;

View File

@@ -29,6 +29,9 @@ function GitHubResolver(decEndpoint, config, logger) {
this._source += '.git';
}
// Check if it's public
this._public = mout.string.startsWith(this._source, 'git://');
// Use https:// rather than git:// if on a proxy
if (this._config.proxy || this._config.httpsProxy) {
this._source = this._source.replace('git://', 'https://');
@@ -46,10 +49,14 @@ mout.object.mixIn(GitHubResolver, GitRemoteResolver);
// -----------------
GitHubResolver.prototype._checkout = function () {
var msg;
var name = this._resolution.tag || this._resolution.branch || this._resolution.commit;
var tarballUrl = 'https://github.com/' + this._org + '/' + this._repo + '/archive/' + name + '.tar.gz';
// Only fully works with public repositories and tags
// Could work with https/ssh protocol but not with 100% certainty
if (!this._public || !this._resolution.tag) {
return GitRemoteResolver.prototype._checkout.call(this);
}
var msg;
var tarballUrl = 'https://github.com/' + this._org + '/' + this._repo + '/archive/' + this._resolution.tag + '.tar.gz';
var file = path.join(this._tempDir, 'archive.tar.gz');
var reqHeaders = {};
var that = this;
@@ -114,6 +121,7 @@ GitHubResolver.prototype._checkout = function () {
return that._cleanTempDir()
.then(GitRemoteResolver.prototype._checkout.bind(that));
});
};

View File

@@ -19,14 +19,14 @@ function GitRemoteResolver(decEndpoint, config, logger) {
this._name = this._name.slice(0, -4);
}
// Get the remote of this source
// Get the host of this source
if (!/:\/\//.test(this._source)) {
this._remote = url.parse('ssh://' + this._source);
this._host = url.parse('ssh://' + this._source).host;
} else {
this._remote = url.parse(this._source);
this._host = url.parse(this._source).host;
}
this._host = this._remote.host;
this._remote = url.parse(this._source);
// Verify whether the server supports shallow cloning
this._shallowClone = this._supportsShallowCloning;

View File

@@ -26,18 +26,8 @@ function GitResolver(decEndpoint, config, logger) {
// anyway
mkdirp.sync(config.storage.empty);
process.env.GIT_TEMPLATE_DIR = config.storage.empty;
if (!config.strictSsl) {
process.env.GIT_SSL_NO_VERIFY = 'true';
}
if (!config.interactive) {
process.env.GIT_TERMINAL_PROMPT = '0';
if (!process.env.SSH_ASKPASS) {
process.env.SSH_ASKPASS = 'echo';
}
}
process.env.GIT_SSL_NO_VERIFY = (!config.strictSsl).toString();
process.env.GIT_TERMINAL_PROMPT = config.interactive ? '1' : '0';
Resolver.call(this, decEndpoint, config, logger);
@@ -121,6 +111,8 @@ GitResolver.prototype._findResolution = function (target) {
version,
index;
versionsArr = versions.map(function (obj) { return obj.version; });
// If there are no tags and target is *,
// fallback to the latest commit on master
if (!versions.length && target === '*') {
@@ -214,7 +206,7 @@ GitResolver.prototype._savePkgMeta = function (meta) {
version = semver.clean(this._resolution.tag);
// Warn if the package meta version is different than the resolved one
if (typeof meta.version === 'string' && semver.valid(meta.version) && semver.neq(meta.version, version)) {
if (typeof meta.version === 'string' && semver.neq(meta.version, version)) {
this._logger.warn('mismatch', 'Version declared in the json (' + meta.version + ') is different than the resolved one (' + version + ')', {
resolution: this._resolution,
pkgMeta: meta

View File

@@ -109,7 +109,7 @@ function pluginResolverFactory(resolverFactory, bower) {
throw createError('Resolver did not provide releases of package.');
}
var releases = that._releases = result;
var releases = this._releases = result;
var versions = releases.filter(function (target) {
return semver.clean(target.version);

View File

@@ -69,10 +69,6 @@
{
"flag": "--no-color",
"description": "Disable colors"
},
{
"flag": "--config.interactive=false",
"description": "Disable prompts"
}
]
}

Some files were not shown because too many files have changed in this diff Show More