mirror of
https://github.com/bower/bower.git
synced 2026-04-24 03:00:19 -04:00
Compare commits
16 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
bda400634c | ||
|
|
b01243ac3c | ||
|
|
89902a6919 | ||
|
|
80308a41a6 | ||
|
|
47cc2262e1 | ||
|
|
f7c5154490 | ||
|
|
cba4b2a4cd | ||
|
|
bdabf6a4e6 | ||
|
|
7896224384 | ||
|
|
3209cda975 | ||
|
|
38501a0b93 | ||
|
|
e60d236b25 | ||
|
|
044896e708 | ||
|
|
fc4c260de4 | ||
|
|
d405917b4a | ||
|
|
22bbb3fcaf |
19
CHANGELOG.md
19
CHANGELOG.md
@@ -1,5 +1,22 @@
|
||||
# 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
|
||||
@@ -83,7 +100,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
|
||||
|
||||
|
||||
@@ -6,8 +6,6 @@
|
||||
[](https://ci.appveyor.com/project/bower/bower)
|
||||
[](https://coveralls.io/r/bower/bower?branch=master)
|
||||
[](https://discord.gg/0fFM7QF0KpZRh2cY)
|
||||
[](http://issuestats.com/github/bower/bower)
|
||||
[](http://issuestats.com/github/bower/bower)
|
||||
|
||||
<img align="right" height="300" src="http://bower.io/img/bower-logo.png">
|
||||
|
||||
|
||||
@@ -9,6 +9,9 @@ function info(logger, endpoint, property, config) {
|
||||
return;
|
||||
}
|
||||
|
||||
// handle @ as version divider
|
||||
endpoint = endpoint.replace('@', '#');
|
||||
|
||||
var repository;
|
||||
var decEndpoint;
|
||||
|
||||
|
||||
@@ -16,6 +16,8 @@ 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('@', '#');
|
||||
return endpointParser.decompose(endpoint);
|
||||
});
|
||||
|
||||
|
||||
@@ -213,6 +213,20 @@ 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 = {};
|
||||
@@ -230,6 +244,7 @@ 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];
|
||||
|
||||
@@ -29,9 +29,6 @@ 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://');
|
||||
@@ -49,14 +46,10 @@ mout.object.mixIn(GitHubResolver, GitRemoteResolver);
|
||||
// -----------------
|
||||
|
||||
GitHubResolver.prototype._checkout = function () {
|
||||
// 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 name = this._resolution.tag || this._resolution.branch || this._resolution.commit;
|
||||
var tarballUrl = 'https://github.com/' + this._org + '/' + this._repo + '/archive/' + name + '.tar.gz';
|
||||
|
||||
var file = path.join(this._tempDir, 'archive.tar.gz');
|
||||
var reqHeaders = {};
|
||||
var that = this;
|
||||
@@ -121,7 +114,6 @@ GitHubResolver.prototype._checkout = function () {
|
||||
|
||||
return that._cleanTempDir()
|
||||
.then(GitRemoteResolver.prototype._checkout.bind(that));
|
||||
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
@@ -26,8 +26,18 @@ function GitResolver(decEndpoint, config, logger) {
|
||||
// anyway
|
||||
mkdirp.sync(config.storage.empty);
|
||||
process.env.GIT_TEMPLATE_DIR = config.storage.empty;
|
||||
process.env.GIT_SSL_NO_VERIFY = (!config.strictSsl).toString();
|
||||
process.env.GIT_TERMINAL_PROMPT = config.interactive ? '1' : '0';
|
||||
|
||||
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';
|
||||
}
|
||||
}
|
||||
|
||||
Resolver.call(this, decEndpoint, config, logger);
|
||||
|
||||
@@ -206,7 +216,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.neq(meta.version, version)) {
|
||||
if (typeof meta.version === 'string' && semver.valid(meta.version) && 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
|
||||
|
||||
@@ -109,7 +109,7 @@ function pluginResolverFactory(resolverFactory, bower) {
|
||||
throw createError('Resolver did not provide releases of package.');
|
||||
}
|
||||
|
||||
var releases = this._releases = result;
|
||||
var releases = that._releases = result;
|
||||
|
||||
var versions = releases.filter(function (target) {
|
||||
return semver.clean(target.version);
|
||||
|
||||
@@ -19,7 +19,9 @@ function readJson(file, options) {
|
||||
|
||||
if (options.logger) {
|
||||
var issues = bowerJson.getIssues(json);
|
||||
|
||||
if (issues.warnings.length > 0) {
|
||||
options.logger.warn('invalid-meta', 'for:' + jsonFile);
|
||||
}
|
||||
issues.warnings.forEach(function (warning) {
|
||||
options.logger.warn('invalid-meta', warning);
|
||||
});
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "bower",
|
||||
"version": "1.7.9",
|
||||
"version": "1.8.0",
|
||||
"description": "The browser package manager",
|
||||
"author": "Twitter",
|
||||
"license": "MIT",
|
||||
@@ -17,7 +17,7 @@
|
||||
"dependencies": {
|
||||
"abbrev": "^1.0.5",
|
||||
"archy": "1.0.0",
|
||||
"bower-config": "^1.3.1",
|
||||
"bower-config": "^1.4.0",
|
||||
"bower-endpoint-parser": "^0.2.2",
|
||||
"bower-json": "^0.8.1",
|
||||
"bower-logger": "^0.2.2",
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
"description": "The Bower config reader and writer.",
|
||||
"author": "Twitter",
|
||||
"license": "MIT",
|
||||
"repository": "bower/config",
|
||||
"repository": "https://github.com/bower/bower/tree/master/packages/bower-config",
|
||||
"main": "lib/Config",
|
||||
"homepage": "http://bower.io",
|
||||
"engines": {
|
||||
|
||||
@@ -9,10 +9,7 @@
|
||||
"url": "https://github.com/bower/endpoint-parser/blob/master/LICENSE"
|
||||
}
|
||||
],
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git://github.com/bower/endpoint-parser.git"
|
||||
},
|
||||
"repository": "https://github.com/bower/bower/tree/master/packages/bower-endpoint-parser",
|
||||
"main": "index.js",
|
||||
"engines": {
|
||||
"node": ">=0.8.0"
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
"description": "Read bower.json files with semantics, normalisation, defaults and validation",
|
||||
"author": "Twitter",
|
||||
"license": "MIT",
|
||||
"repository": "bower/json",
|
||||
"repository": "https://github.com/bower/bower/tree/master/packages/bower-json",
|
||||
"main": "lib/json",
|
||||
"engines": {
|
||||
"node": ">=0.10.0"
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
"url": "https://github.com/bower/logger/blob/master/LICENSE"
|
||||
}
|
||||
],
|
||||
"repository": "bower/logger",
|
||||
"repository": "https://github.com/bower/bower/tree/master/packages/bower-logger",
|
||||
"main": "lib/Logger",
|
||||
"engines": {
|
||||
"node": ">=0.10.0"
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
"description": "Provides easy interaction with the Bower registry",
|
||||
"author": "Twitter",
|
||||
"license": "MIT",
|
||||
"repository": "bower/registry-client",
|
||||
"repository": "https://github.com/bower/bower/tree/master/packages/bower-registry-client",
|
||||
"main": "Client",
|
||||
"engines": {
|
||||
"node": ">=0.10.0"
|
||||
|
||||
@@ -49,4 +49,17 @@ describe('bower info', function () {
|
||||
});
|
||||
});
|
||||
});
|
||||
it('should handle @ as a divider', function () {
|
||||
return helpers.run(info, [mainPackage.path + '@0.1.3']).spread(function (results) {
|
||||
expect(results).to.eql(
|
||||
{
|
||||
name: 'package',
|
||||
version: '0.1.3',
|
||||
homepage: 'http://bower.io',
|
||||
description: 'Hello world! Hello!'
|
||||
}
|
||||
);
|
||||
});
|
||||
|
||||
});
|
||||
});
|
||||
|
||||
@@ -726,4 +726,13 @@ describe('bower install', function () {
|
||||
expect(tempDir.read(path.join('bower_components', 'package', 'package.tar'))).to.contain('test');
|
||||
});
|
||||
});
|
||||
it('should handle @ as a divider', function () {
|
||||
return helpers.run(install, [
|
||||
['empty@1.0.1'], {
|
||||
save: true
|
||||
}
|
||||
]).then(function () {
|
||||
expect(tempDir.readJson('bower.json').dependencies).to.eql({empty: '1.0.1'});
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
@@ -99,4 +99,21 @@ describe('bower uninstall', function () {
|
||||
});
|
||||
});
|
||||
|
||||
it('removes a project with url from absolute path', function () {
|
||||
var targetPath = path.resolve(tempDir.path, 'other_directory/underscore');
|
||||
mkdirp.sync(targetPath);
|
||||
fs.writeFileSync(path.join(targetPath, '.bower.json'), '{ "name": "underscore", "_source": "git://github.com/user/repo.git" }');
|
||||
|
||||
return helpers.run(uninstall, [['git://github.com/user/repo.git'], undefined, {
|
||||
cwd: tempDir.path,
|
||||
directory: path.resolve(tempDir.path, 'other_directory'),
|
||||
interactive: true
|
||||
}])
|
||||
.then(function () {
|
||||
expect(function () {
|
||||
fs.statSync(targetPath);
|
||||
}).to.throwException(/no such file or directory/);
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
@@ -50,16 +50,17 @@ describe('GitResolver', function () {
|
||||
expect(process.env).to.not.have.property('GIT_SSL_NO_VERIFY');
|
||||
|
||||
resolver = new GitResolver(decEndpoint, defaultConfig(), logger);
|
||||
expect(process.env).to.have.property('GIT_SSL_NO_VERIFY', 'false');
|
||||
delete process.env.GIT_SSL_NO_VERIFY;
|
||||
expect(process.env).to.not.have.property('GIT_SSL_NO_VERIFY');
|
||||
|
||||
resolver = new GitResolver(decEndpoint, defaultConfig({strictSsl: false}), logger);
|
||||
expect(process.env).to.have.property('GIT_SSL_NO_VERIFY', 'true');
|
||||
delete process.env.GIT_SSL_NO_VERIFY;
|
||||
|
||||
// git only checks the existence of GIT_SSL_NO_VERIFY.
|
||||
// git does NOT check whether is true of false.
|
||||
// Hence not exporting GIT_SSL_NO_VERIFY is effectively equivalent to 'false'
|
||||
resolver = new GitResolver(decEndpoint, defaultConfig({strictSsl: true}), logger);
|
||||
expect(process.env).to.have.property('GIT_SSL_NO_VERIFY', 'false');
|
||||
delete process.env.GIT_SSL_NO_VERIFY;
|
||||
expect(process.env).to.not.have.property('GIT_SSL_NO_VERIFY');
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user