Compare commits

...

24 Commits

Author SHA1 Message Date
akkaradej
dcd06d80a3 Fix missing host from ssh source 2018-03-28 16:35:57 +02:00
akkaradej
51a00ff433 Add test for shallow cloning when source is a ssh protocol 2018-03-28 16:35:57 +02:00
Adam Stankiewicz
add601795f Update year in licenses one last time, fixes #2476 2018-03-28 15:25:36 +02:00
Adam Stankiewicz
8e34328466 Run tests on all node versions and fix test suite, closes #2495 (#2505) 2018-03-28 15:17:31 +02:00
Michael Kühnel
c3e9c94833 Expose non-interactive option to CLI help (#2404) 2018-03-28 13:20:11 +02:00
Madan
dd19bafa37 docs: highlight "-allow-root" (#2496) 2018-03-28 13:17:55 +02:00
Martin Page
74af42c176 Only replace last @ after (if any) last / with # (#2395) 2018-03-28 13:16:09 +02:00
Guido Bouman
a6308bf8f8 Remove duplicate space setting from .editorconfig. (#2480) 2017-09-26 08:11:42 -05:00
Adam Stankiewicz
e1dc0105d2 Reduce node versions on appveyor 2017-09-26 10:57:16 +02:00
Adam Stankiewicz
ce210e4f16 Install grunt on appveyor 2017-09-26 10:55:11 +02:00
Adam Stankiewicz
e483e9bc2c Reduce tested node versions 2017-09-26 10:48:43 +02:00
Adam Stankiewicz
b0c3859699 Fix a test 2017-09-26 10:37:59 +02:00
Adam Stankiewicz
e6d1b2d82e Try to fix appveyor build 2017-09-26 10:36:09 +02:00
Adam Stankiewicz
d4345bb254 Use Yarn on travis and appveyor 2017-09-14 18:08:22 +02:00
Adam Stankiewicz
975f9bdcdb Lock dependencies 2017-09-14 18:05:08 +02:00
Adam Stankiewicz
a969a9c557 Bump bower-config 2017-09-14 18:04:12 +02:00
Adam Stankiewicz
6500b421ce Migrate bower.herokuapp.com to registry.bower.io 2017-09-13 18:59:52 +02:00
Adam Stankiewicz
0641167b96 Remove opencollective for now to prevent installation issues 2017-09-13 18:55:23 +02:00
yanca018
0d03374dab Update LICENSE (#2475)
Update year to 2017
2017-08-14 12:41:32 +02:00
Xavier Damman
765d8e739d Activating Open Collective (#2450) 2017-05-30 18:15:09 +02:00
Thomas Grainger
0bd318de53 Add yarn and webpack recommendation (#2458) 2017-05-19 20:29:15 +02:00
Juan Olvera
aa6b51edc0 Replace gitter references with discord on documentation (#2453) 2017-04-18 18:12:36 -05:00
Adam Stankiewicz
2c2e5309fd Run tests on node 7 as well 2017-03-22 14:03:31 +01:00
Eugene Kenny
b716bc4e3a Prefer exact versions when dissecting dependencies (#2371) 2016-11-08 09:11:29 +01:00
25 changed files with 3185 additions and 104 deletions

View File

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

View File

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

View File

@@ -2,23 +2,31 @@ sudo: false
language: node_js
# Use node 8 for build
node_js:
- "0.10"
- "0.11"
- "0.12"
- "4.0"
- "4.1"
- "4.2"
- "5"
- "6"
- "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
install:
- node --version
- npm --version
- git --version
- svn --version | head -n 1
- npm install -g grunt-cli
- npm install
- yarn
- nvm install $TEST_NODE_VERSION
- npm install -g grunt
os:
- osx
@@ -28,7 +36,8 @@ 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

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 slack: https://gitter.im/bower
We communicate through a channel on Discord https://discord.gg/0fFM7QF0KpZRh2cY
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)
[Gitter Channel](https://gitter.im/bower/bower)
[Mailing List](http://groups.google.com/group/twitter-bower)
[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),
(twitter-bower@googlegroups.com), or
[#bower](http://webchat.freenode.net/?channels=bower) on Freenode.

View File

@@ -1,4 +1,4 @@
Copyright (c) 2016 Twitter and other contributors
Copyright (c) 2013-present 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

@@ -1,6 +1,9 @@
# Bower - A package manager for the web
> 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)
[![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!
[![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)
@@ -117,8 +120,81 @@ 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) 2016 Twitter and [other contributors](https://github.com/bower/bower/graphs/contributors)
Copyright (c) 2012-present Twitter and [other contributors](https://github.com/bower/bower/graphs/contributors)
Licensed under the MIT License

View File

@@ -10,7 +10,10 @@ function info(logger, endpoint, property, config) {
}
// handle @ as version divider
endpoint = endpoint.replace('@', '#');
var splitParts = endpoint.split('/');
splitParts[splitParts.length - 1] = splitParts[splitParts.length - 1].replace('@', '#');
endpoint = splitParts.join('/');
var repository;
var decEndpoint;
@@ -24,33 +27,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) !== '_';
.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;
});
// Retrieve specific property
if (property) {
pkgMeta = mout.object.get(pkgMeta, property);
}
return pkgMeta;
});
}
// -------------------

View File

@@ -16,8 +16,12 @@ function install(logger, endpoints, options, config) {
// Convert endpoints to decomposed endpoints
endpoints = endpoints || [];
decEndpoints = endpoints.map(function (endpoint) {
// handle @ as version divider
endpoint = endpoint.replace('@', '#');
var splitParts = endpoint.split('/');
splitParts[splitParts.length - 1] = splitParts[splitParts.length - 1].replace('@', '#');
endpoint = splitParts.join('/');
return endpointParser.decompose(endpoint);
});
@@ -30,11 +34,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

@@ -587,6 +587,17 @@ 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;
});

View File

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

View File

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

View File

@@ -18,7 +18,7 @@ sudo, please spend a few minutes learning more about how your system should work
make any necessary repairs.\n\n\
http://www.joyent.com/blog/installing-node-and-npm\n\
https://gist.github.com/isaacs/579814\n\n\
You can however run a command with sudo using --allow-root option';
You can however run a command with sudo using "--allow-root" option';
if (isRoot()) {
var cli = require('./cli');

View File

@@ -17,7 +17,7 @@
"dependencies": {
"abbrev": "^1.0.5",
"archy": "1.0.0",
"bower-config": "^1.4.0",
"bower-config": "^1.4.1",
"bower-endpoint-parser": "^0.2.2",
"bower-json": "^0.8.1",
"bower-logger": "^0.2.2",
@@ -81,7 +81,7 @@
"load-grunt-tasks": "^3.5.0",
"mocha": "^2.5.3",
"multiline": "^1.0.2",
"nock": "^7.7.2",
"nock": "^9.2.3",
"node-uuid": "^1.4.7",
"proxyquire": "^1.7.9",
"spawn-sync": "1.0.15",

View File

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

View File

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

View File

@@ -86,7 +86,7 @@ function expand(config) {
publish: config.registry
};
} else if (typeof config.registry === 'object') {
config.registry.default = config.registry.default || 'https://bower.herokuapp.com';
config.registry.default = config.registry.default || 'https://registry.bower.io';
config.registry = {
default: config.registry.default,

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://bower.herokuapp.com',
'default': 'https://registry.bower.io',
'search': [
'https://bower.herokuapp.com'
'https://registry.bower.io'
],
'register': 'https://bower.herokuapp.com',
'publish': 'https://bower.herokuapp.com'
'register': 'https://registry.bower.io',
'publish': 'https://registry.bower.io'
});
});
@@ -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://bower.herokuapp.com',
'default': 'https://registry.bower.io',
'search': [
'https://foobar',
],
'register': 'https://bower.herokuapp.com',
'publish': 'https://bower.herokuapp.com'
'register': 'https://registry.bower.io',
'publish': 'https://registry.bower.io'
});
});
@@ -70,12 +70,12 @@ describe('NPM Config on package.json', function () {
assert.deepEqual(config, {
'directory': 'bower_components',
'registry': {
'default': 'https://bower.herokuapp.com',
'default': 'https://registry.bower.io',
'search': [
'https://bower.herokuapp.com'
'https://registry.bower.io'
],
'register': 'https://bower.herokuapp.com',
'publish': 'https://bower.herokuapp.com'
'register': 'https://registry.bower.io',
'publish': 'https://registry.bower.io'
},
'shorthandResolver': 'https://github.com/{{owner}}/{{package}}.git',
'tmp': '/foo/bar',

View File

@@ -1,4 +1,4 @@
Copyright (c) 2016 Twitter and other contributors
Copyright (c) 2012-present 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

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

View File

@@ -8,7 +8,7 @@ var Config = require('bower-config');
describe('RegistryClient', function () {
beforeEach(function () {
this.uri = 'https://bower.herokuapp.com';
this.uri = 'https://registry.bower.io';
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://bower.herokuapp.com:443')
nock('https://registry.bower.io: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 = 'bower.herokuapp.com';
this.host = 'registry.bower.io';
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://bower.herokuapp.com:443')
nock('https://registry.bower.io: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://bower.herokuapp.com:443')
nock('https://registry.bower.io:443')
.get('/packages/jquery')
.reply(404);
@@ -283,7 +283,7 @@ describe('RegistryClient', function () {
force: true,
registry: {
search: [
'https://bower.herokuapp.com',
'https://registry.bower.io',
'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://bower.herokuapp.com',
'https://registry.bower.io',
'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://bower.herokuapp.com:443')
nock('https://registry.bower.io: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://bower.herokuapp.com:443')
nock('https://registry.bower.io: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://bower.herokuapp.com:443')
nock('https://registry.bower.io: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://bower.herokuapp.com:443')
nock('https://registry.bower.io: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://bower.herokuapp.com:443')
nock('https://registry.bower.io: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://bower.herokuapp.com:443')
nock('https://registry.bower.io: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://bower.herokuapp.com:443')
nock('https://registry.bower.io:443')
.get('/packages/search/jquery')
.reply(200, []);
@@ -526,7 +526,7 @@ describe('RegistryClient', function () {
force: true,
registry: {
search: [
'https://bower.herokuapp.com',
'https://registry.bower.io',
'http://custom-registry.com'
]
}
@@ -566,7 +566,7 @@ describe('RegistryClient', function () {
describe('calling the search instance method without argument', function () {
beforeEach(function () {
nock('https://bower.herokuapp.com:443')
nock('https://registry.bower.io:443')
.get('/packages/search/')
.reply(404);
});
@@ -585,7 +585,7 @@ describe('RegistryClient', function () {
//
describe('calling the list instance method', function () {
beforeEach(function () {
nock('https://bower.herokuapp.com:443')
nock('https://registry.bower.io: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://bower.herokuapp.com:443')
nock('https://registry.bower.io:443')
.get('/packages')
.reply(200, []);
@@ -628,7 +628,7 @@ describe('RegistryClient', function () {
force: true,
registry: {
search: [
'https://bower.herokuapp.com',
'https://registry.bower.io',
'http://custom-registry.com'
]
}
@@ -669,7 +669,7 @@ describe('RegistryClient', function () {
describe('calling the list instance method', function () {
beforeEach(function () {
nock('https://bower.herokuapp.com:443')
nock('https://registry.bower.io:443')
.get('/packages')
.reply(200, [], {});
});

View File

@@ -124,7 +124,7 @@ describe('bower register', function () {
return helpers.expectEvent(promise.logger, 'confirm')
.spread(function (e) {
expect(e.type).to.be('confirm');
expect(e.message).to.be('Registering a package will make it installable via the registry (https://bower.herokuapp.com), continue?');
expect(e.message).to.be('Registering a package will make it installable via the registry (https://registry.bower.io), continue?');
expect(e.default).to.be(true);
});
});

View File

@@ -34,6 +34,31 @@ describe('Manager', function () {
next();
});
describe('resolve', function () {
it('prefers exact versions over ranges', function () {
manager._resolved = {
ember: [
{
target: '>=1.4',
pkgMeta: { version: '2.7.0' }
},
{
target: '2.7.0',
pkgMeta: { version: '2.7.0' }
}
]
};
return manager.resolve().then(function () {
expect(manager._dissected).to.eql({
ember: {
target: '2.7.0',
pkgMeta: { version: '2.7.0' }
}
});
});
});
});
describe('_areCompatible', function () {
describe('resolved is being fetched', function () {

View File

@@ -356,6 +356,26 @@ describe('GitRemoteResolver', function () {
});
});
it('should evaluate to true when source is a ssh protocol and host is defined to support shallow cloning', function (next) {
var testSource = 'git@foo:bar.git';
var MyGitRemoteResolver = gitRemoteResolverFactory(
createCmdHandlerFn(testSource, multiline(function () {/*
foo: bar
Content-Type: application/x-git-upload-pack-advertisement
1234: 5678
*/}))
);
var resolver = new MyGitRemoteResolver({ source: testSource }, defaultConfig({ shallowCloneHosts: ['foo'] }), logger);
resolver._shallowClone().then(function (shallowCloningSupported) {
expect(shallowCloningSupported).to.be(true);
next();
});
});
it('should cache hosts that support shallow cloning', function (next) {
var testSource = 'https://foo/bar.git';

View File

@@ -108,7 +108,7 @@ describe('download', function () {
nock.get('/package.tar.gz').times(6).delayConnection(1000).replyWithFile(200, source);
},
expectError: function (e) {
expect(e.code).to.be('ETIMEDOUT');
expect(e.code).to.be('ESOCKETTIMEDOUT');
expect(fs.readdirSync(tempDir.path)).to.be.empty();
},
downloadOpts: {

2929
yarn.lock Normal file

File diff suppressed because it is too large Load Diff