mirror of
https://github.com/bower/bower.git
synced 2026-04-24 03:00:19 -04:00
Compare commits
21 Commits
1.8.2
...
update-req
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
adafa3dc03 | ||
|
|
bb17839bc2 | ||
|
|
24a6dc2f70 | ||
|
|
5a6ae540f9 | ||
|
|
4443698fdb | ||
|
|
1e2c27f338 | ||
|
|
1935716660 | ||
|
|
add601795f | ||
|
|
8e34328466 | ||
|
|
c3e9c94833 | ||
|
|
dd19bafa37 | ||
|
|
74af42c176 | ||
|
|
a6308bf8f8 | ||
|
|
e1dc0105d2 | ||
|
|
ce210e4f16 | ||
|
|
e483e9bc2c | ||
|
|
b0c3859699 | ||
|
|
e6d1b2d82e | ||
|
|
d4345bb254 | ||
|
|
975f9bdcdb | ||
|
|
a969a9c557 |
@@ -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"
|
||||
@@ -15,5 +15,4 @@ trim_trailing_whitespace = false
|
||||
insert_final_newline = false
|
||||
|
||||
[{package,bower}.json]
|
||||
indent_style = space
|
||||
indent_size = 2
|
||||
|
||||
41
.travis.yml
41
.travis.yml
@@ -2,24 +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"
|
||||
- "7"
|
||||
- "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
|
||||
@@ -29,8 +36,8 @@ matrix:
|
||||
fast_finish: true
|
||||
allow_failures:
|
||||
- os: osx
|
||||
- env: "NODE_VERSION=0.11"
|
||||
- env: "NODE_VERSION=7"
|
||||
|
||||
script:
|
||||
- nvm use $TEST_NODE_VERSION
|
||||
- node --version && npm --version && git --version && svn --version | head -n 1
|
||||
- grunt travis
|
||||
|
||||
2
LICENSE
2
LICENSE
@@ -1,4 +1,4 @@
|
||||
Copyright (c) 2017 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
|
||||
|
||||
@@ -195,7 +195,6 @@ Become a sponsor and get your logo on our README on Github with a link to your s
|
||||
|
||||
## 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
|
||||
|
||||
|
||||
@@ -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;
|
||||
});
|
||||
}
|
||||
|
||||
// -------------------
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -16,7 +16,7 @@ function lookup(logger, name, config) {
|
||||
.then(function (entry) {
|
||||
return !entry ? null : {
|
||||
name: name,
|
||||
url: entry && entry.url
|
||||
url: entry.url
|
||||
};
|
||||
});
|
||||
}
|
||||
|
||||
@@ -687,7 +687,6 @@ 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;
|
||||
@@ -845,7 +844,6 @@ 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',
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -121,8 +121,6 @@ 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 === '*') {
|
||||
|
||||
@@ -69,6 +69,10 @@
|
||||
{
|
||||
"flag": "--no-color",
|
||||
"description": "Disable colors"
|
||||
},
|
||||
{
|
||||
"flag": "--config.interactive=false",
|
||||
"description": "Disable prompts"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@@ -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');
|
||||
|
||||
@@ -17,11 +17,11 @@
|
||||
"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",
|
||||
"bower-registry-client": "^1.0.0",
|
||||
"bower-registry-client": "^1.0.1",
|
||||
"cardinal": "0.4.4",
|
||||
"chalk": "^1.0.0",
|
||||
"chmodr": "^1.0.2",
|
||||
@@ -49,7 +49,7 @@
|
||||
"p-throttler": "0.1.1",
|
||||
"promptly": "0.2.0",
|
||||
"q": "^1.1.2",
|
||||
"request": "2.67.0",
|
||||
"request": "2.79.0",
|
||||
"request-progress": "0.3.1",
|
||||
"requireg": "^0.1.5",
|
||||
"resolve": "^1.1.7",
|
||||
@@ -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",
|
||||
|
||||
@@ -43,6 +43,9 @@ function doEnvReplaceStr (f) {
|
||||
|
||||
function envReplace(config) {
|
||||
var envReplaced = {};
|
||||
if ( lang.isArray(config) ) {
|
||||
envReplaced = [];
|
||||
}
|
||||
|
||||
object.forOwn(config, function (value, key) {
|
||||
|
||||
@@ -63,6 +66,9 @@ 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);
|
||||
}
|
||||
|
||||
@@ -4,7 +4,12 @@
|
||||
},
|
||||
"storage" : {
|
||||
"packages" : "${_BOWERRC_MY_PACKAGES}",
|
||||
"registry" : "~/.bower-test/registry"
|
||||
"registry" : {
|
||||
"register": "~/.bower-test/registry",
|
||||
"search": [
|
||||
"${_BOWERRC_MY_USER}:${_BOWERRC_MY_PASS}"
|
||||
]
|
||||
}
|
||||
},
|
||||
"tmp" : "${_BOWERRC_MY_TMP}"
|
||||
}
|
||||
|
||||
@@ -224,10 +224,13 @@ 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);
|
||||
});
|
||||
});
|
||||
@@ -238,7 +241,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);
|
||||
assert.equal(untildify('~/.bower-test/registry') , config.storage.registry.register);
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "bower-registry-client",
|
||||
"version": "1.0.0",
|
||||
"version": "1.0.1",
|
||||
"description": "Provides easy interaction with the Bower registry",
|
||||
"author": "Twitter",
|
||||
"license": "MIT",
|
||||
@@ -13,8 +13,8 @@
|
||||
"async": "^0.2.8",
|
||||
"graceful-fs": "^4.0.0",
|
||||
"lru-cache": "^2.3.0",
|
||||
"request": "^2.51.0",
|
||||
"request-replay": "^0.2.0",
|
||||
"request": "^2.74.0",
|
||||
"request-replay": "^1.0.4",
|
||||
"rimraf": "^2.2.0",
|
||||
"mkdirp": "^0.3.5"
|
||||
},
|
||||
|
||||
@@ -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://registry.bower.io, 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);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -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';
|
||||
|
||||
|
||||
@@ -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: {
|
||||
|
||||
Reference in New Issue
Block a user