Compare commits

...

2110 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
Adam Stankiewicz
8b6c8eeaa9 Run tests also on 4.0 and 4.1 2016-06-12 14:22:36 +02:00
Adam Stankiewicz
58ddb59104 Revert "Rename .travis.yml to travis.yml"
This reverts commit 9317bb6e33.
2016-06-12 14:19:04 +02:00
Adam Stankiewicz
f26fe38c30 Fix CI badges 2016-06-12 14:18:29 +02:00
Adam Stankiewicz
9317bb6e33 Rename .travis.yml to travis.yml 2016-06-12 14:04:50 +02:00
Adam Stankiewicz
2693bae8ed Improve appveyor.yml 2016-06-12 14:04:28 +02:00
Adam Stankiewicz
8368539a93 Change appveyor badge to new project
[skip ci]
2016-06-12 01:40:45 +02:00
Adam Stankiewicz
8947400487 Disable deploy in appveyor.yml 2016-06-12 01:19:50 +02:00
Adam Stankiewicz
44eeb60529 Improve appveyor.yml 2016-06-12 01:18:32 +02:00
Adam Stankiewicz
2309cd80c6 Add missing return in promise 2016-06-11 02:49:22 +02:00
Adam Stankiewicz
684ab0c0a6 Simplify travis configuration 2016-06-10 20:48:44 +02:00
Adam Stankiewicz
1f6b32a48e Test node 6 also on appveyor 2016-06-10 17:41:11 +02:00
Adam Stankiewicz
e4f0295ef1 Test node 4, 5, and 6 2016-06-10 17:37:53 +02:00
Adam Stankiewicz
85e39cf190 Try to fix svn tests 2016-06-10 17:24:42 +02:00
Adam Stankiewicz
16c134f0f9 Update devDependencies 2016-06-10 17:14:47 +02:00
Adam Stankiewicz
bcbff32716 Pass through eslint 2016-06-10 16:40:46 +02:00
Adam Stankiewicz
809117ea73 Merge bower-endpoint-parser repository 2016-06-10 14:24:55 +02:00
Adam Stankiewicz
af448ba484 Merge bower-registry-client repository 2016-06-10 13:44:43 +02:00
Adam Stankiewicz
89069784bb Merge bower-logger repository 2016-06-10 13:32:03 +02:00
Adam Stankiewicz
57cc6f7a40 Merge bower-json repository 2016-06-10 13:22:15 +02:00
Adam Stankiewicz
cea728c7bc Merge bower-config repository 2016-06-10 13:18:55 +02:00
Adam Stankiewicz
f6be8e5e28 Improve issue template a little 2016-06-09 20:34:14 +02:00
Ben
c6f7ec36de Add issue template (#2305) 2016-06-09 20:29:26 +02:00
Ben
3235b3c0d3 Fix typo in README 2016-06-02 13:36:10 +02:00
Adam Stankiewicz
6ca5d434a4 [docs] Change info at the top of readme 2016-06-02 12:38:49 +02:00
Evan Bowling
eb27ae8fdc Added integration tests for installing nested components (#1513) (#2297) 2016-05-30 11:16:53 +02:00
Ben
353a399f75 Fix test & build for shorthand resolver 2016-05-10 10:46:07 +02:00
Ben
c718541a4e Merge pull request #2282 from evanjbowling/master
Correct typo in command descriptions, followup for #2280
2016-05-08 20:08:40 +02:00
Evan Bowling
1f4372299a Correct typo in command descriptions, followup for #2280 2016-05-08 11:39:45 -05:00
Adam Stankiewicz
e640d0ec5c Improve search / lookup command descriptions, closes #2280 2016-05-06 11:57:26 +02:00
Ben
2e5acfe076 Remove analytics from example config 2016-05-04 19:55:27 +02:00
Ben
19f3c53c70 Merge pull request #54 from evanjbowling/master
Update README.md to be more descriptive
2016-05-04 08:52:38 +02:00
Evan Bowling
26902aec27 Update README.md to be more descriptive 2016-05-03 22:18:05 -05:00
Ben
08feaf2b0a Merge pull request #2271 from rajzshkr/bower-register-info
info message added for bower register
Closing #2075
2016-04-28 12:46:17 +02:00
Ben
db1ed1c08f Fix build errors #2
Related to the change from git:// to https://
2016-04-28 12:32:13 +02:00
Ben
3c2562ca0e Fix failing tests 2016-04-28 12:23:54 +02:00
Raja Sekar
b1f1b8fae3 info message added for bower register 2016-04-28 15:16:10 +05:30
Ben
f1c874b202 Merge pull request #2270 from rajzshkr/bower-cache
fix for 2264
2016-04-28 07:27:15 +02:00
Raja Sekar
4757e7353f fix for 2264 2016-04-28 10:20:19 +05:30
Adam Stankiewicz
249ac47b9c 1.4.0 2016-04-22 00:35:39 +02:00
Adam Stankiewicz
dc59913098 Change default shorthandResolver from git:// to https:// 2016-04-22 00:35:23 +02:00
Oskar Cieślik
343e6ac8bc Implement postuninstall hooks with tests (#2252) 2016-04-14 15:02:07 +02:00
Adam Stankiewicz
e729829174 Make bower version behavior consistent with spec (#2232) 2016-04-12 19:18:36 +02:00
Oskar Cieślik
40e3ee091b Support single-char repo names and package names (#2249) 2016-04-12 19:15:24 +02:00
Oskar Cieślik
8ee2d78779 Add support for registering package with github's orgname/reponame (#2248) 2016-04-12 18:57:44 +02:00
Oskar Cieślik
7c54812ecf Allow to type the entire version when conflict occured (#2243) 2016-04-10 13:24:29 +02:00
Adam Stankiewicz
3251051d20 Fix tests given the new registry 2016-04-10 13:15:57 +02:00
Adam Stankiewicz
81052830f2 Merge pull request #52 from bamsy/topic-unreachable-code
Remove unreachable code from parse function
2016-04-09 18:18:53 +02:00
Justin Barnes
7b2fd5dcd1 Remove unreachable code from parse function 2016-04-09 09:14:04 -05:00
Adam Stankiewicz
bbc9b35cb1 Update grunt to 1.0.1 2016-04-06 13:45:43 +02:00
Adam Stankiewicz
3aebb34f1d Fix typo in changelog 2016-04-05 13:48:21 +02:00
Adam Stankiewicz
8065e5c64a 1.7.9 2016-04-05 13:44:58 +02:00
Adam Stankiewicz
b8e6f36a91 Add changelog entries for 1.7.9 2016-04-05 13:36:52 +02:00
Adam Stankiewicz
12d41aeb8c Warn instead of erroring for invalida package names, #2233 2016-04-05 13:34:06 +02:00
Adam Stankiewicz
8c624bbda6 0.8.1 2016-04-04 21:45:44 +02:00
Adam Stankiewicz
7ee1686cf4 Add changelog for 0.8.1 2016-04-04 21:45:39 +02:00
Adam Stankiewicz
8e181c1792 Make name validation far less strict 2016-04-04 21:37:50 +02:00
Adam Stankiewicz
9569a8074d Add missing changelog entry, #2233 2016-04-04 20:42:55 +02:00
Adam Stankiewicz
e8e4c8fdbc Fix typo in changelog 2016-04-04 19:20:57 +02:00
Adam Stankiewicz
9e5cd572f8 1.7.8 2016-04-04 19:00:08 +02:00
Adam Stankiewicz
69cd360551 Update changelog 2016-04-04 18:59:44 +02:00
Adam Stankiewicz
4793fc0d1c Bump year in license 2016-04-04 18:38:28 +02:00
Adam Stankiewicz
aaaa9cd530 Don't ask for git credentials in non-interactive session
This is done by setting GIT_TERMINAL_PROMPT variable

- fixes #956
- fixes #1009
2016-04-04 18:17:04 +02:00
Adam Stankiewicz
c2e0dc9d23 Prevent swallowing exceptions with programmatic api, fixes #2187 2016-04-04 17:33:19 +02:00
Adam Stankiewicz
fc4446247c Update graceful-fs to 4.x 2016-04-04 14:26:26 +02:00
Adam Stankiewicz
f4e0b3dfba Update bower-json to 0.8.0 and update tests 2016-04-04 14:18:23 +02:00
Adam Stankiewicz
4d7cdb0556 0.8.0 2016-04-04 14:11:41 +02:00
Adam Stankiewicz
037bbff17e Update changelog 2016-04-04 14:11:37 +02:00
Adam Stankiewicz
f05cd5fb94 Update bower-json to 0.7.1 2016-04-04 13:49:22 +02:00
Adam Stankiewicz
358a73b98e 0.7.1 2016-04-04 13:47:56 +02:00
Adam Stankiewicz
32cbb5a0e8 Update graceful-fs 2016-04-04 13:47:10 +02:00
bamsy
8679ad77ae Fix grammar in contributing file.
- remove trailing whitespace

- "anyway" -> "any way"
2016-04-03 13:18:06 +02:00
Kyle Pollock
1b1d8bdad6 Remove jscs inline error suppression comments.
- jscs is removed from the project.
2016-04-02 14:26:04 +02:00
Kyle Pollock
aecdf3f365 Merge pull request #2229 from bamsy/master
Fix typos/grammar in first paragraph of contributing file.
2016-04-01 20:30:51 -05:00
Justin Barnes
1cf87041cc Fix typos/grammar in first paragraph of contributing file. 2016-04-01 19:36:04 -05:00
Adam Stankiewicz
5116fec1ab Update decompress-zip to 0.2.1 2016-04-01 17:51:46 +02:00
Adam Stankiewicz
8f2668a24d Bump config-store to 2.0.0 2016-04-01 17:36:06 +02:00
Adam Stankiewicz
e7516e4bcb Bump bower-config to 1.3.1 2016-04-01 17:32:50 +02:00
Adam Stankiewicz
3853d1297e Add changelog entry 2016-04-01 17:28:23 +02:00
Adam Stankiewicz
1e398f999b Update dependencies 2016-04-01 17:27:18 +02:00
Adam Stankiewicz
3a0ea968f4 Update graceful-fs dependency 2016-04-01 17:24:12 +02:00
Adam Stankiewicz
7de2e5d601 Remove moduleType from from "bower init" result, fixes #1229 2016-04-01 16:19:51 +02:00
Adam Stankiewicz
b1c45bb586 Resolve pluggable resolvers using cwd and fallback to global module 2016-04-01 14:57:36 +02:00
Adam Stankiewicz
f4cb047e9d Allow to install custom resolver globally, fixes #1919 2016-04-01 03:22:42 +02:00
Adam Stankiewicz
f494ae7ddd [refactor] Fix tests for previous commit 2016-04-01 01:39:09 +02:00
Adam Stankiewicz
44e71267c1 [refactor] Put bower-registry-client instantiation in one place 2016-03-31 22:10:10 +02:00
Adam Stankiewicz
52aa684949 [refactor] Move abbreviations to utils 2016-03-31 19:29:55 +02:00
Adam Stankiewicz
46655b7c4e Final .eslintrc configuration 2016-03-31 19:27:12 +02:00
Adam Stankiewicz
16cde3118a Revert "Merge pull request #2197 from albertinadx/albertinad/fix-scripts-hooks"
This reverts commit 0a81308e98, reversing
changes made to f2884656c0.
2016-03-31 01:36:05 +02:00
Adam Stankiewicz
7c2dfc1146 Fix peerDependency of grunt-exec 2016-03-31 00:55:47 +02:00
Adam Stankiewicz
53eeca97d3 Use eslint instead jscs 2016-03-31 00:27:17 +02:00
Adam Stankiewicz
9201a379d6 Update to grunt 1.0 2016-03-30 22:30:57 +02:00
Adam Stankiewicz
2052ba3eed Remove jshint 2016-03-30 22:12:24 +02:00
Adam Stankiewicz
b32bd8b877 Merge pull request #2225 from echavezNS/master
Reuse the files selected in jshint for jscs
2016-03-28 12:19:38 +02:00
echavezNS
233f685c61 Reuse the files selected in jshint for jscs 2016-03-28 00:39:05 -07:00
Kun Yan
5fe8df2e0a Merge pull request #2224 from kunyan/bugfix/test-case
Fix message unit test error
2016-03-28 14:35:35 +08:00
Kun Yan
a3ae3b66b7 Fix message unit test error 2016-03-28 14:11:02 +08:00
Ben
2000d2f5db Merge pull request #2212 from echavezNS/master
Extend conflict message to be more expressive how to choose an option
2016-03-27 08:01:03 +02:00
echavezNS
84d8d8c57f Typo 2016-03-26 12:39:35 -07:00
echavezNS
f9ea3846e2 Extend conflict message 2016-03-26 01:25:10 -07:00
Yan Kun
8b6c20239e Merge pull request #2208 from kunyan/bugfix/grunt-file-json-error
Fix Gruntfile error
2016-03-20 22:43:33 -05:00
Kun Yan
73171766e7 Fix Gruntfile error 2016-03-21 11:16:51 +08:00
Adam Stankiewicz
88b3655829 Merge pull request #2204 from echavezNS/master
Add jsonPackage for refactoring purposes
2016-03-17 10:00:59 +01:00
Jorge Chavez
3241e8ed62 Add jsonPackage for refactoring purposes 2016-03-16 18:12:43 -07:00
Albertina Durante
0a81308e98 Merge pull request #2197 from albertinadx/albertinad/fix-scripts-hooks
Fix hooks to support shell operators
2016-03-05 21:54:22 -03:00
Albertina Durante
8d76b87d65 Supporting shell operators in hooks scripts.
- Removing module "shell-quote"
- Adding tests for hooks scripts with shell operators
- This fixes issue #1594
2016-03-05 21:50:05 -03:00
Adam Stankiewicz
f2884656c0 Merge pull request #2196 from prometheansacrifice/handlebars-vulnerability
Handlebars vulnerability
2016-03-06 01:17:19 +01:00
Manas
6fff6fa707 Upgrades handlebars to 4.0.5 to address #2195
Adds test for template util methods
Upgrades handlebars
Fixes RangeError due to `length` attribute in rpad helper
2016-03-06 01:37:20 +05:30
Ben
1357f63a1b Merge pull request #2191 from nirajkaushal/master
Update: Copyright Year from 2015 to 2016
2016-02-29 09:23:52 +01:00
Niraj Kaushal
529d702959 Update Copyright Year from 2015 to 2016
This commit will change copyright year from 2015 to current year(2016)
2016-02-29 11:13:06 +05:30
Ben
0155a70457 Merge pull request #2186 from yash14123/master
Changelog is still in 2015
2016-02-24 11:37:21 +01:00
yash14123
a6ca2ae9bb Changelog is still in 2015 2016-02-24 05:34:44 +05:30
Adam Stankiewicz
78e443db0a Merge pull request #2177 from oliamb/eslintrc-indent
[eslint] fix indentation to 4 spaces
2016-02-17 15:59:54 +01:00
Sivakumar Kailasam
5f24eab32d Merge pull request #2175 from sivakumar-kailasam/bowerrc-placeholder-replacement-fix
Replace all occurrences of % character in hook commands.
2016-02-17 13:27:12 +05:30
Olivier Amblet
f4620b28ab [eslint] fix indentation to 4 spaces
Changed the indentation from 2 to 4 spaces in .eslintrc files.
All the code is using this convention and .jscsrc already define 4 as
the right value.
2016-02-16 23:22:46 +01:00
Sivakumar Kailasam
9f4c2384ea Replace all occurrences of % character in hook commands.
Fixes #2174 % character replaced once in .bowerrc scripts
2016-02-15 20:34:01 +05:30
Adam Stankiewicz
e85a5f778f Update opn package to 4.0.0, fixes #2169 2016-02-13 21:41:35 +01:00
Adam Stankiewicz
5283a132bc Add name check that reflects reality 2016-02-10 04:33:26 +01:00
Adam Stankiewicz
db1453f7c0 Add findSync and readSync to the README 2016-02-10 02:55:24 +01:00
Adam Stankiewicz
878a228a7d Fix linting error 2016-02-10 02:44:53 +01:00
Adam Stankiewicz
b33041c3ec [test] Remove unnecessary check 2016-02-10 02:42:33 +01:00
Stefan Grönke
c8a6ff38a0 test validation against all registred packages 2016-02-10 02:38:55 +01:00
Adam Stankiewicz
573b84f7f4 Update bower-json to 0.7.0 2016-02-10 02:34:30 +01:00
Adam Stankiewicz
ef67955c21 Bump to 0.7.0 2016-02-10 02:22:34 +01:00
Adam Stankiewicz
36a14b9b37 Add getIssues function and make validate less restrictive 2016-02-10 01:54:31 +01:00
Adam Stankiewicz
96d986f436 Merge pull request #2161 from blcook223/feature/save-bowerrc-config
add support for save and save-exact in .bowerrc
2016-01-29 12:27:44 +01:00
blcook223
394dd7c8d2 add support for save and save-exact in .bowerrc
The install command now supports designating "save" and "save-exact"
values in .bowerrc. If the `--save` flag is not used, but the config
file sets "save" to true, the command will behave as if the `--save`
option was specified. The same is true of `--save-exact` if
"save-exact" is set to true in `.bowerrc`.

The uninstall command will also behave as if the `--save` flag had
been specified if "save" is set to true in `.bowerrc`.
2016-01-28 21:10:17 -06:00
Adam Stankiewicz
6c67d07cc8 Add missing lib/bin/bower.js file 2016-01-27 15:37:13 +01:00
Adam Stankiewicz
cd7bbab310 Bump to 1.7.7 2016-01-27 15:05:27 +01:00
Adam Stankiewicz
4b4a854ed8 Restore directory structure for published bower
It's because people are depending on internals of bower, like
"bower/lib/renderers/StandardRenderer"

Instead we move templates and bin to lib directory and leave
paths intact. Additionally we alias bin/bower to lib/bin/bower.
2016-01-27 14:47:18 +01:00
Adam Stankiewicz
8194bcb4c6 Revert bin/bower location and bump to 1.7.6 2016-01-27 12:06:48 +01:00
Adam Stankiewicz
e5d478a1cc Bump to 1.7.5 and update changelog 2016-01-26 22:35:22 +01:00
Adam Stankiewicz
bbaaee67a1 Update publishing script to bundle all modules 2016-01-25 22:57:07 +01:00
Adam Stankiewicz
ad27112b58 Do not assume package.json location 2016-01-25 19:40:54 +01:00
Adam Stankiewicz
38c3cee1a7 Perform test on fake .git directory 2016-01-25 19:40:54 +01:00
Adam Stankiewicz
b485c5d3cb Remove bundledDependencies from package.json
bundledDependencies will be filled only just before publish
2016-01-25 19:40:54 +01:00
Adam Stankiewicz
d63047b4ee Merge pull request #2137 from pwielgolaski/#2129
when strictSsl is false set GIT_SSL_NO_VERIFY=true for git command
2016-01-24 18:14:38 +01:00
Piotr Wielgolaski
f0a54d0018 set GIT_SSL_NO_VERIFY for opposite value than strictSsl 2016-01-23 20:29:28 +01:00
Piotr Wielgolaski
1d73764788 when strictSsl is false set GIT_SSL_NO_VERIFY=true for git command
Solves #2129
2016-01-23 14:26:48 +01:00
Adam Stankiewicz
9d2681b0c4 Ignore test files in published package 2016-01-21 13:43:17 +01:00
Adam Stankiewicz
f3330e8612 Update changelog and bump to 1.7.3 2016-01-20 18:23:27 +01:00
Adam Stankiewicz
11996c04b7 Update to fs-write-stream@1.0.8 2016-01-20 14:18:44 +01:00
Adam Stankiewicz
35e73a619a Tolerate failure in covealls reporting 2016-01-20 14:06:48 +01:00
Adam Stankiewicz
fe615fd517 Merge pull request #2150 from bower/feature/analytics
Remove analytics from Bower, fixes #1102
2016-01-20 13:35:55 +01:00
Adam Stankiewicz
3e3b64218d Remove analytics from Bower, fixes #1102
They caused more issues than useful they were.

Instead, we'll focus on fetching statistics from
NPM registry to watch Bower's popularity, and
GitHub stars over time to watch packages' popularity.
2016-01-20 12:30:54 +01:00
Adam Stankiewicz
afe76e57f8 Remove HOOKS.md as they are now properly documented, thanks @dvidsilva! 2016-01-18 22:05:17 +01:00
Adam Stankiewicz
6ee3ef7aa8 Merge pull request #2071 from prometheansacrifice/adding-tests-plugin-resolver
Adds tests for pluginResolverFactory.js
2016-01-18 12:34:50 +01:00
Manas
64db869bd4 Adds tests for pluginResolverFactory.js 2016-01-18 01:22:07 +05:30
Adam Stankiewicz
a4ea05800d Add prepublish script for easy and reliable bower releasing 2016-01-17 00:13:07 +01:00
Adam Stankiewicz
8cf897cd19 Merge pull request #2145 from bower/sjs/use-caret-on-install-save
Use caret on install save
2016-01-12 21:19:55 +00:00
Sam Saccone
d06af7a3d7 Default to ^ operator on --save
This fix brings us inline with how npm installs work and also brings us
more inline with how semver is supposed to be used.

Fixes #2144
2016-01-10 18:28:42 -08:00
Jaime Olmo
d4fd71986e Merge pull request #2140 from jamesxv7/master
Changes to license file and package.json
2016-01-07 20:55:31 -04:00
Jaime Olmo
3154444556 Update CHANGELOG.md
Updated as per 1.7.2 release
2016-01-07 01:59:49 -04:00
Jaime Olmo
24f8b913b9 Update LICENSE
Update license year to 2016.
2016-01-07 01:50:58 -04:00
Jaime Olmo
fe6b6863ea Update package.json
Version updated as per [1.7.2](https://github.com/bower/bower/releases/tag/v1.7.2) release.
2016-01-07 01:49:41 -04:00
Adam Stankiewicz
671c23ad50 Merge pull request #2130 from gronke/enhancement/absolute-paths-1914
support absolute path in .bowerrc directory option
2016-01-05 12:28:09 +01:00
Stefan Grönke
5384fa54b1 refactor, address feedback and add more unit tests 2016-01-05 05:23:19 +01:00
Adam Stankiewicz
4bfa8227d9 Merge pull request #2133 from azbshiri/display-logged-in-username
Display the logged in user's name
2016-01-05 00:32:16 +01:00
Alireza Bashiri
55d78f7928 Display the logged in user's name 2016-01-05 02:24:08 +03:30
Stefan Grönke
2110148830 support absolute path in .bowerrc 'directory' option
fixes #1914
2016-01-04 01:46:53 +01:00
Alireza Bashiri
afc4bfbd42 Revert "Display login message when user login via normal and 2 factor auth mode."
This reverts commit ed881e3f29.
2016-01-04 00:58:03 +03:30
Alireza Bashiri
9c42a008aa Merge pull request #2102 from reavowed/fix-extract-name-clashes
Fix name clashes in package extraction
2016-01-01 12:29:55 +03:30
Alireza Bashiri
67884744c3 Merge pull request #2127 from azbshiri/display-info-message-bower-login
Display login message when user login via bower login
2016-01-01 00:19:01 +03:30
Raja Sekar
ed881e3f29 Display login message when user login via normal and 2 factor auth mode.
Displaying info message when user login via bower login

Login message added for 2 factor authentication also

Fix unreachable code

Fix code quality issues
2015-12-31 23:31:16 +03:30
Vlad Filippov
e6e60d5d5e Merge pull request #2125 from bower/fix-write-stream-regression
Lock fs-write-steam-atomic to 1.0.5
2015-12-30 20:52:29 -05:00
Sam Saccone
d8f166a933 Lock fs-write-steam-atomic to 1.0.5
context: https://github.com/bower/bower/issues/2118#issuecomment-168097858

Fixes #2118
2015-12-30 16:22:54 -08:00
Adam Stankiewicz
bb626d1605 Merge pull request #2122 from kevdez/master
Added the --force docs to the --help command
2015-12-29 10:46:45 +01:00
Kevin H
daa5b8ddf9 Added the --force documentation to the --help command 2015-12-28 21:27:13 -08:00
Adam Stankiewicz
db087dfe13 Log-level is actually loglevel, closes #2112 2015-12-21 06:14:22 +01:00
Adam Stankiewicz
848e401efd Link back to invitation form 2015-12-21 05:18:45 +01:00
Adam Stankiewicz
c17c725057 Merge pull request #48 from mithun/no-env-in-hooks
Ignore hook scripts for environment variable expansion
2015-12-18 10:00:05 +01:00
Mithun Ayachit
2b31f6c07a Ignore hook scripts for environment variable expansion 2015-12-17 20:38:48 -06:00
Iain Monro
3cf597fccf Fix jshint errors
Add missing semicolons to test file.
2015-12-15 15:32:13 +00:00
Vlad Filippov
e2adbc37f1 Merge pull request #2103 from Rogerkael/master
Typo fix resolverFactory.js
2015-12-14 17:21:14 -05:00
Roger Rodriguez Texido
6c3b7dbf58 Fixed typo. 2015-12-14 17:12:30 -05:00
Rob Simpson
d3ab3c1fa7 remove freenode as support option 2015-12-14 12:57:24 -05:00
Iain Monro
b1ba9be7f6 Fix name clashes in package extraction
Prevent extraction failing if a package archive contains a file with
the same name as the archive, or a single directory with a subdirectory
with the same name.
2015-12-14 16:58:02 +00:00
Adam Stankiewicz
1e5122c023 Merge pull request #2092 from Utsav2/gzip
Decompress gzip files
2015-12-13 11:16:33 +01:00
Utsav Shah
4255d7d4a8 Add tests for decoding gzipped files 2015-12-12 18:08:19 -06:00
Utsav Shah
cdf45239f4 Decompress gzip files
Update request lib
2015-12-12 18:08:19 -06:00
Adam Stankiewicz
8b2fad32f6 Revert "Change entry in changelog"
This reverts commit d1ae0b1982.
2015-12-11 21:53:31 +01:00
Adam Stankiewicz
d1ae0b1982 Change entry in changelog 2015-12-11 21:53:00 +01:00
Adam Stankiewicz
87cf578ba8 Update changelog 2015-12-11 21:51:30 +01:00
Adam Stankiewicz
3ead440c7c Update changelog 2015-12-11 21:50:50 +01:00
Adam Stankiewicz
e168c894a2 Bump to 1.7.1 2015-12-11 21:43:21 +01:00
Adam Stankiewicz
75e3661371 Update changelog 2015-12-11 21:42:34 +01:00
Adam Stankiewicz
baf8f7bf6b Fix missing parenthesis 2015-12-11 21:37:08 +01:00
Adam Stankiewicz
88758cd98c Revert "Add bower update --save functionality"
This reverts commit d2ba80e6e9.
2015-12-11 21:33:45 +01:00
Adam Stankiewicz
3bd2d62e67 Revert "Add failing tests for single package updates, optimize older tests"
This reverts commit 6616d09f47.
2015-12-11 21:32:47 +01:00
Adam Stankiewicz
d3eef5772a Revert "Only update packages requested by the user"
This reverts commit e3f402fc66.
2015-12-11 21:25:15 +01:00
Adam Stankiewicz
7c714901d4 Fix test for StandardRenderer 2015-12-11 20:33:54 +01:00
Adam Stankiewicz
7792b6d35d Use coveralls as npm script (fix certain versions of node) 2015-12-11 20:24:40 +01:00
Adam Stankiewicz
2db983dba3 Better formatting of help 2015-12-11 20:16:54 +01:00
Adam Stankiewicz
b9718bb309 Fix search command on no arguments, fixes #2066 2015-12-11 20:15:04 +01:00
Adam Stankiewicz
26f609e614 Ignore for now failing windows build on node 5 2015-12-10 21:25:01 +01:00
Adam Stankiewicz
4c2b56096b Merge pull request #2096 from contolini/readme-clean-up
Readme updates
2015-12-10 17:56:08 +01:00
Chris Contolini
5af929f0be Clean up readme 2015-12-09 20:08:44 -05:00
Adam Stankiewicz
6a18cde782 Merge pull request #33 from bower/paulohp-patch-1
added coveralls badge.
2015-12-09 13:03:21 +01:00
Adam Stankiewicz
32c5538fc5 Merge pull request #46 from bower/paulohp-patch-1
added coveralls badge
2015-12-09 13:03:03 +01:00
Paulo Pires
57478d86c7 added 2015-12-09 03:53:47 -08:00
Paulo Pires
42107e6fea added coveralls badge 2015-12-09 03:52:47 -08:00
Adam Stankiewicz
686e883d87 Merge pull request #2094 from accommodavid/tar-test
Add test for tar archives
2015-12-09 11:34:57 +01:00
Adam Stankiewicz
f2767648e7 Merge pull request #2093 from contolini/hide-prereleases
Hide prerelease versions from `bower info`
2015-12-09 11:33:54 +01:00
Accommodavid
9e4bdd270d Add test for tar archives
Adds a test that checks if dependencies that point to tar archives (not
tar.gz) are handled and extracted correctly. Also removes a test from
`test/commands/install.js` that was duplicated.

Re-add postinstall test
2015-12-09 09:05:13 +01:00
Chris Contolini
7cb88ab49f Add renderer tests for prereleases 2015-12-08 17:59:21 -05:00
Chris Contolini
a532c55dca Hide prereleases when showing package info 2015-12-08 17:59:21 -05:00
Adam Stankiewicz
c559432c19 Properly call coveralls script 2015-12-08 20:05:04 +01:00
Adam Stankiewicz
9aae3b8d7e Merge pull request #45 from paulohp/grunt-travis
added grunt travis script to .travis.yml
2015-12-08 19:54:52 +01:00
Adam Stankiewicz
322c49edf4 Get rid of STRICT_REQUIRE flag for coverage testing 2015-12-08 19:52:10 +01:00
Adam Stankiewicz
34ec39507c Merge pull request #32 from paulohp/sync-functions
added synchronous functions to read and find
2015-12-08 19:20:40 +01:00
Adam Stankiewicz
fe9b27a647 Try to fix appveyor build with npm-env 2015-12-08 19:15:06 +01:00
Paulo Pires
304bb36bbc Added coveralls support
added missing packages

added test coverage files to gitignore

remove unecessary files

added missing coveralls package
2015-12-08 09:48:42 -08:00
Paulo Pires
376a2de600 added synchronous functions to read and find
added .readSync function

Added coverage
2015-12-08 05:33:38 -08:00
Adam Stankiewicz
1605374a25 Properly run code coverage on appveyor 2015-12-08 14:32:05 +01:00
Adam Stankiewicz
ac244a1400 Run coverage on appveyor as well 2015-12-08 14:21:05 +01:00
Adam Stankiewicz
9e58bbca31 Merge pull request #31 from paulohp/coveralls
Added coverage report. 📄
2015-12-08 13:54:36 +01:00
Paulo Pires
027a0694f7 Added coverage 2015-12-08 04:16:44 -08:00
Adam Stankiewicz
d50e50f3b5 Add discord chat link, closes #2088 2015-12-08 11:14:33 +01:00
Adam Stankiewicz
3030469c59 Update update-notifier to 0.6.0 2015-12-08 11:00:51 +01:00
Adam Stankiewicz
977e0ddc52 Update changelog 2015-12-07 20:34:47 +01:00
Adam Stankiewicz
de3e1089da Better formatting of help message 2015-12-07 20:32:33 +01:00
Adam Stankiewicz
7897ad7dba Move bug reports to the top 2015-12-07 16:35:19 +01:00
Adam Stankiewicz
accdab3ece Link bug reports to wiki 2015-12-07 16:34:26 +01:00
David DeSandro
612aaa88eb add help menu for update --save, update --save-dev
Ref #2035
2015-12-07 08:42:17 -05:00
Adam Stankiewicz
338ac99080 Bump to 1.7.0 2015-12-07 13:34:01 +01:00
Adam Stankiewicz
9605bbea5f Bump bower-config to 1.3.0 2015-12-07 13:08:58 +01:00
Adam Stankiewicz
7bc97a1241 Add changelog entry for array notation in env 2015-12-07 11:45:36 +01:00
Adam Stankiewicz
bd2c253f99 Bump to 1.3.0 2015-12-07 11:43:12 +01:00
Adam Stankiewicz
f1efce7d1f Merge pull request #44 from bower/feature/env
Allow for arrays in env fields (includes a test)
2015-12-07 11:39:17 +01:00
Adam Stankiewicz
844cc5a527 Add test for accept array from process env feature 2015-12-07 11:31:09 +01:00
Peng Wang
0e27b6f813 restore spacing and code formating 2015-12-07 11:31:09 +01:00
Adam Stankiewicz
3791aee9d6 Merge pull request #2085 from pertrai1/feature/eslintrc
adding eslintrc for new ruleset option
2015-12-06 15:48:52 +01:00
Rob Simpson
20a223a959 adding eslintrc for new ruleset option 2015-12-06 06:10:13 -05:00
Adam Stankiewicz
9219f54718 Merge pull request #43 from prometheansacrifice/adding-changelog
Adding CHANGELOG.md
2015-12-06 11:27:30 +01:00
Adam Stankiewicz
ea5bd51327 Merge pull request #2083 from prometheansacrifice/updating-changelog
Adds changelog for release 1.7.0
2015-12-06 11:26:26 +01:00
Manas
5a2272cab1 Adds CHANGELOG.md 2015-12-06 01:19:11 +05:30
Manas
b94c20b8da Release 1.7.0 2015-12-05 22:28:18 +05:30
Adam Stankiewicz
b81ba140e3 Bump to 1.6.9 and release 2015-12-04 22:28:09 +01:00
Adam Stankiewicz
4ffdb500b9 Update to npm version of fs-write-stream-atomic 2015-12-04 22:28:09 +01:00
Adam Stankiewicz
609607b096 Merge pull request #42 from mithun/allow-env-vars
Allow the use of environment variables in .bowerrc
2015-12-03 12:30:43 +01:00
Mithun Ayachit
e9657668a9 Allow the use of environment variables in .bowerrc
Similar to npmrc

Expand '~/' to user's home directory
2015-12-03 05:20:23 -06:00
Adam Stankiewicz
1696cde273 Merge pull request #2074 from eppeters/bower-search-prompt-before-listing-all
Prompt before listing all repos when running `bower search` without a query param
2015-12-03 00:21:57 +01:00
Adam Stankiewicz
94ffc35b25 Merge pull request #2070 from contolini/dont-update-all
Only update the packages requested by the user
2015-12-02 23:14:58 +01:00
Edward Peters
5a1e5eb9c7 Make 'bower search' show the help display when a user does not enter a
search term. Keep current behavior when running with config.json
enabled, or in non-interactive mode.

Rewrite bower search tests to cover the different cases of using the
command without a query parameter (interactive w/o config.json,
interactive w/ config.json, and non-interactive)
2015-12-02 17:07:27 -05:00
Chris Contolini
8c1f30b1c8 Format test files to comply with new jscs rules 2015-12-02 14:10:33 -05:00
Chris Contolini
e3f402fc66 Only update packages requested by the user 2015-12-02 14:10:28 -05:00
Chris Contolini
6616d09f47 Add failing tests for single package updates, optimize older tests 2015-12-02 14:10:28 -05:00
Adam Stankiewicz
25ad2ef946 Merge pull request #2076 from prometheansacrifice/instructions-for-squashing-commits
Adds instructions for squashing commits
2015-12-02 13:51:13 +01:00
Manas
ba4a1a9d45 Adds instructions for squashing commits 2015-12-02 13:30:45 +05:30
Adam Stankiewicz
3a37202dc5 Rollback to original fs-write-stream-atomic 2015-12-01 15:58:18 +01:00
Adam Stankiewicz
12258324d3 More code style rules to enforce 2015-11-30 11:06:57 +01:00
Adam Stankiewicz
2adb0b0807 Merge pull request #2063 from AnthonyBobsin/style-guide
Implements jscs to enforce a newly created style guide for the repo.
2015-11-30 10:54:40 +01:00
AnthonyBobsin
19fc84007d Implements jscs to enforce a newly created style guide for the repo. Uses jscs to fix some minor style guide warnings. 2015-11-29 16:22:58 -05:00
Adam Stankiewicz
8fcbd3671d Merge pull request #2062 from contolini/update-save
Add `bower update --save` functionality
2015-11-28 19:29:40 +01:00
Chris Contolini
0eadbef02d Merge branch 'master' into update-save 2015-11-28 08:42:43 -08:00
Adam Stankiewicz
107ad1d3fc Merge pull request #2060 from Utsav2/remove-at
Remove @ in temporary directories
2015-11-28 13:14:30 +01:00
Chris Contolini
d2ba80e6e9 Add bower update --save functionality 2015-11-28 05:40:24 -05:00
Adam Stankiewicz
f18b38cde5 Merge pull request #40 from ryantemple/master
Updated so cwd is set from command line and correct directory tree used
2015-11-28 10:57:22 +01:00
Ryan Temple
e6f1805df0 Added tests 2015-11-27 19:31:24 +00:00
Ryan Temple
4da1b62542 Updated so cwd is set from command line and correct directory tree used 2015-11-27 19:30:08 +00:00
Utsav Shah
852a586d5c Replace temp directory name with md5 hash
Fixes issues with characters like @ interfering with directory name
lookups
2015-11-27 13:17:36 -06:00
Utsav Shah
e8a2d92785 Remove @ in temporary directories 2015-11-27 11:36:14 -06:00
Adam Stankiewicz
50ed13e4ee Release 1.6.8 2015-11-27 15:53:52 +01:00
Adam Stankiewicz
cb9b737b9d Merge pull request #2058 from bower/enotdir-coverage
Add directory test for install command
2015-11-27 15:19:10 +01:00
Adam Stankiewicz
700b46162c Remove minor bumps of node from Travis 2015-11-27 14:47:11 +01:00
Accommodavid
0e1153f610 Add ENOTDIR test for install command 2015-11-27 14:43:22 +01:00
Adam Stankiewicz
8669ed2aac Bump bower-config to 1.2.3 2015-11-27 14:08:50 +01:00
Adam Stankiewicz
6d12ef291b Properly restore env variables if they are undefined 2015-11-27 13:53:36 +01:00
Adam Stankiewicz
ca0a36abcf Make downloader work on all platforms, fixes #2050 2015-11-27 13:45:19 +01:00
Adam Stankiewicz
4c6fdc905f Revert "Fix tests on Windows (cleanup of downloaded files)"
This reverts commit bb7c02b07b.
2015-11-27 00:33:15 +01:00
Adam Stankiewicz
cdbc4a123c Merge pull request #2040 from bower/fix-shallow-host
Fix shallow clone host
2015-11-26 18:25:49 +01:00
Adam Stankiewicz
bb7c02b07b Fix tests on Windows (cleanup of downloaded files) 2015-11-26 18:06:26 +01:00
Adam Stankiewicz
4f42aeabd7 Fix tests for abbreviations on Windows 2015-11-26 16:20:59 +01:00
Adam Stankiewicz
b77517ef64 Remove iojs from versions tested on travis (node 4.0 should be enough) 2015-11-26 14:35:52 +01:00
Adam Stankiewicz
b9c3f750eb Remove npm-shrinkwrap.json (bundledDependencies are enough..) 2015-11-26 14:25:14 +01:00
Adam Stankiewicz
aaecbfab17 evert "Merge pull request #2027 from watilde/patch/supports-tilde"
This reverts commit 2ff53fc448, reversing
changes made to 89286e628b.
2015-11-26 14:23:19 +01:00
Adam Stankiewicz
c4539aa603 Update npm-shrinkwrap.json 2015-11-26 14:01:10 +01:00
Adam Stankiewicz
7f801319bf Merge branch 'release-1.6.6' 2015-11-26 12:37:35 +01:00
Adam Stankiewicz
1a990f4563 Release 1.6.7 2015-11-26 12:31:53 +01:00
Trevor Heins
944a328f30 Merge pull request #2051 from kunyan/improve/2049
Add badge links to readme #2048 #2049
2015-11-26 00:00:46 -05:00
Kun Yan
e11b60d812 Add badge links to readme #2048 #2049
Signed-off-by: Kun Yan <kyan@redhat.com>
2015-11-26 10:38:35 +08:00
Adam Stankiewicz
c91e99b782 Merge pull request #2045 from zzarcon/chore/move_abbreviations_from_index
Move abbreviations to a different file
2015-11-26 00:01:43 +01:00
Hector Leon Zarco Garcia
da8ec1e4ab Move abbreviations to a different file 2015-11-25 23:58:30 +01:00
Adam Stankiewicz
c8d5199815 Merge pull request #33 from adriaanthomas/handle-default-ca
Load custom CA file for "default"
2015-11-25 18:32:44 +01:00
Vlad Filippov
e7868f0fb1 Changelog updates
[skip ci]
2015-11-25 10:54:11 -05:00
Adam Stankiewicz
eca46dbd85 Merge pull request #2042 from paulohp/update-node-version-appveyor
Added major versions (5 and 4) to appveyor
2015-11-25 16:47:13 +01:00
Vlad Filippov
67bd5d026f Bump to 1.6.6 2015-11-25 10:45:42 -05:00
Paulo Pires
51de67cc73 added major versions 5 and 4 to appveyor 2015-11-25 09:33:03 -02:00
Vlad Filippov
3d4f9cd919 Fix shallow clone host 2015-11-24 14:21:27 -05:00
Adam Stankiewicz
cd8d397e63 Merge pull request #38 from bower/revert-36-master
Revert "updated to respect the bowerrc in the cwd passed in as command line argument"
2015-11-24 16:53:09 +01:00
Riyadh Al Nur
5a9c099188 Revert "updated to respect the bowerrc in the cwd passed in as command line argument" 2015-11-24 21:25:11 +06:00
Adam Stankiewicz
2137089a70 Merge pull request #37 from riyadhalnur/update-node-versions-travis
Added newer Node versions to Travis
2015-11-24 13:11:17 +01:00
Riyadh Al Nur
fbd02852a3 Added newer Node versions to Travis
ADDED/UPDATED:
- Updated Travis file to not test against `iojs` anymore
- Added versions 4 and 5 of Node to test against on Travis
2015-11-24 13:11:54 +06:00
Riyadh Al Nur
f2584ade24 Merge pull request #36 from ryantemple/master
updated to respect the bowerrc in the cwd passed in as command line argument
2015-11-24 13:06:05 +06:00
Rob Simpson
2f72cd4b7d Adding contributing link to CONTRIBUTING.md
We now have a section in the wiki for contributors so I added a link to this until all of it can be merged together.
2015-11-24 00:10:47 -05:00
Ryan Temple
50bfd14968 updated to respect the bowerrc in the cwd passed in as command line argument 2015-11-23 22:45:45 +00:00
Adam Stankiewicz
2ff53fc448 Merge pull request #2027 from watilde/patch/supports-tilde
Supports ~/ paths to cwd field in .bowerrc
2015-11-21 16:32:52 +01:00
Daijiro Wachi
42cd2e584f Update npm-shrinkwrap.json to add untildify 2015-11-19 23:46:22 +01:00
Daijiro Wachi
49de3cca62 Add a test case to support ~/ paths to cwd field 2015-11-19 23:31:22 +01:00
Daijiro Wachi
718db0309f Supports ~/ paths to cwd field in .bowerrc
+ Add untildify module
+ Update config.js to convert tilde path to home path

Fixes #1784
2015-11-19 21:36:28 +01:00
Adam Stankiewicz
d867095f50 Merge pull request #34 from kevcenteno/bowerrc-dir-error
Show error if .bowerrc is a directory
2015-11-19 18:17:24 +01:00
kevcenteno
e51bf20e72 Show error if .bowerrc is a directory 2015-11-19 10:35:22 -05:00
Adam Stankiewicz
89286e628b Update to fixed version of fs-write-stream-atomic 2015-11-18 15:06:46 +01:00
Adam Stankiewicz
c8042b4781 Fix tests on node 0.10 by updating nock 2015-11-18 14:50:00 +01:00
Adriaan Thomas
15f8a30cd4 Also load custom CA file for "default" 2015-11-17 13:31:40 +01:00
Adam Stankiewicz
9fdd96c92b Update fs-write-stream-atomic to fork with timing fix
It turned out that removing files synchronously on windows can cause
issues. This commit makes Appveyor build for Windows little better.
2015-11-17 12:13:26 +01:00
Adam Stankiewicz
ce15df27ca Properly destroy read stream for downloads 2015-11-17 12:13:26 +01:00
Rob Simpson
468657bfe2 bug report link fix on readme 2015-11-16 21:27:54 -05:00
Rob Simpson
814180d129 update bug report link to point to wiki 2015-11-16 21:25:48 -05:00
Rob Simpson
93be2fef6d Update README.md 2015-11-16 16:08:04 -05:00
Rob Simpson
3ab71f27ff Update README.md 2015-11-16 16:06:11 -05:00
Adam Stankiewicz
38fa1b6858 Downgrade spawn-sync to 1.0.13 (windows build) 2015-11-15 13:18:33 +01:00
Adam Stankiewicz
c6ed215260 Re-order scripts for appveyor build 2015-11-15 13:15:05 +01:00
Adam Stankiewicz
74eba8d2e8 Move spawn-sync back to devDependencies... 2015-11-15 13:14:28 +01:00
Adam Stankiewicz
5a72dae2c8 Build on both node 0.10 and 0.12 on appveyor 2015-11-15 13:10:10 +01:00
Adam Stankiewicz
6194821643 Skip installing npm and svn for appveyor 2015-11-15 13:06:16 +01:00
Adam Stankiewicz
37aab9c72e Downgrade spawn-sync for appveyor 2015-11-15 13:01:24 +01:00
Adam Stankiewicz
0a0dc8cef9 Update spawn-sync to fix appveyor tests 2015-11-15 12:51:41 +01:00
Adam Stankiewicz
c6d89b79b4 Remove npm-shrinkwrap from devDependencies (issues with npm@3.x) 2015-11-15 12:02:39 +01:00
Adam Stankiewicz
8a435dff27 Update to newest npm in appveyor builds 2015-11-15 11:51:45 +01:00
Michael Robinson
459925eba7 Merge pull request #1972 from pwielgolaski/#1958
fix passing options to request
2015-11-15 22:22:12 +13:00
Adam Stankiewicz
6614a43658 Bump to 1.6.5 2015-11-14 15:56:13 +01:00
Adam Stankiewicz
88fd65ae34 Merge pull request #1988 from faceleg/travis-node-versions
Run travis tests in all versions of node
2015-11-14 15:52:47 +01:00
Adam Stankiewicz
83da088024 Update CONTRIBUTING.md 2015-11-14 15:39:41 +01:00
Piotr Wielgolaski
51a986d0d4 add test for download.js and fix download behavior to not leave temporary files in case of error 2015-11-07 18:26:48 +01:00
Michael Robinson
0aefe8fc0e Be more specific with node version 5 2015-11-05 10:47:39 +13:00
Michael Robinson
2845984169 Use environment vars for node versions because OS X 2015-11-05 10:47:24 +13:00
Michael Robinson
2a91dc5fb1 Updated travis tests to run in supported node versions 2015-11-05 10:43:02 +13:00
Michael Robinson
5eca9274ee Added language to travis.yml 2015-11-05 10:40:44 +13:00
Michael Robinson
d57d81ca85 Run travis tests in all versions of node 2015-11-05 10:38:15 +13:00
Adam Stankiewicz
a5dcf9cc24 Merge pull request #1973 from gronke/remove-insecure-suggestion-from-readme
remove hint to use --allow-root flag from readme
2015-10-26 10:30:59 +01:00
Stefan Grönke
484c8985ed remove hint to use --allow-root flag from readme 2015-10-26 01:14:09 +01:00
Piotr Wielgolaski
931b0a8905 fix passing options to request
options from download need to be pass to request library that make HTTP
request

Also when there is http error stream need to be closed otherwise there
is issue reported that unlink operation is not permitted on Windows
2015-10-24 16:52:22 +02:00
Adam Stankiewicz
bfd1e93325 Install stable version on npm on appveyor 2015-10-24 12:01:59 +02:00
Adam Stankiewicz
bf23751549 Bump to 1.6.4 2015-10-24 11:51:50 +02:00
Adam Stankiewicz
b79034fbb9 Merge pull request #1956 from bower/strip-trailing-slash
strip trailing slash in urlResolver
2015-10-24 11:09:32 +02:00
Adam Stankiewicz
eaa05ac6c1 Merge pull request #1960 from bower/add-user-agent
add User-Agent to downloadd
2015-10-24 11:08:31 +02:00
Adam Stankiewicz
8f0a3d727e Merge pull request #1969 from chrisjons/svn_improvements
use --non-interactive when running svn client
2015-10-24 10:41:21 +02:00
Adam Stankiewicz
b6a524e6b4 Merge pull request #1970 from twalpole/ignore2
fix issue #1962 - ignoredDependenices multiple install run
2015-10-24 10:39:20 +02:00
Thomas Walpole
43d00deb88 fix issue #1962 - ignoredDependenices multiple install run 2015-10-23 11:52:40 -07:00
Christian Jönsson
4836a0cae9 use --non-interactive when running svn client
If there is a problem in connecting to the Subversion server,
e.g. credential or certificate related, the CLI client will pause to
ask the user for input on the console. This is not handled by bower
Subversion Resolver, causing the install process to hang forever
with no message printed to the bower user.

Running the Subversion CLI client with the option --non-interactive
will instead cause the client to exit upon such an error.This is
detected by the bower resolver and the message printed to the user,
making it much easier to investigate and solve the underlying problem.
2015-10-23 13:05:16 +02:00
Adam Stankiewicz
302c4ade51 Leave link only to Support Declaration 2015-10-22 12:19:42 +02:00
Adam Stankiewicz
75d80e014a Mention about Support Declaration and BountySource 2015-10-22 12:15:50 +02:00
Patrick Kettner
0f790f4293 add User-Agent to downloadd 2015-10-20 13:51:50 -07:00
Patrick Kettner
452217e9fa strip trailing slash in urlResolver 2015-10-17 21:48:10 -05:00
Adam Stankiewicz
f66c0cfe5c Update npm to 2.0.0 on travis 2015-10-16 12:05:36 +02:00
Adam Stankiewicz
30898c13d3 Update changelog 2015-10-16 12:01:25 +02:00
Adam Stankiewicz
2330d59ffa Bump to 1.6.3 2015-10-16 11:49:04 +02:00
Adam Stankiewicz
1316be57dc Update bower-config to 1.2.2 2015-10-16 11:46:51 +02:00
Adam Stankiewicz
b7c19695e7 Bump to 1.2.2 2015-10-16 11:38:06 +02:00
Adam Stankiewicz
b85cf2683c Fix registry configuration expanding, closes bower/bower#1950 2015-10-16 11:37:41 +02:00
Adam Stankiewicz
ff0f2a8f83 Use stat instead of lstat for checking if something is directory, fixes #1951 2015-10-16 11:17:03 +02:00
Adam Stankiewicz
7e5184d342 Merge pull request #1954 from scottaddie/master
Replace README file msysgit references with Git for Windows
2015-10-16 11:05:35 +02:00
Scott Addie
8fa1fd55e9 Replace README file msysgit references with Git for Windows 2015-10-15 22:18:30 -05:00
Adam Stankiewicz
52463dea09 Bump and update npm-shrinkwrap.json for bower 1.6.2 2015-10-15 16:15:51 +02:00
Adam Stankiewicz
8cf09f5444 Revert "Bump to 1.6.1 and update npm-shrinkwrap.json"
This reverts commit 20a6190ed8.
2015-10-15 16:12:42 +02:00
Adam Stankiewicz
20a6190ed8 Bump to 1.6.1 and update npm-shrinkwrap.json 2015-10-15 15:56:23 +02:00
Adam Stankiewicz
402a9f3017 Add node-uuid back to npm-shrinkwrap 2015-10-15 14:10:25 +02:00
Adam Stankiewicz
af09872fba Set default bower.config again 2015-10-15 13:50:36 +02:00
Adam Stankiewicz
2311d7dc44 Update npm-shrinkwrap.json with npm-shrinkwrap tool 2015-10-15 13:29:56 +02:00
Adam Stankiewicz
b261bf8a76 Update npm-shrinkwrap.json for bower 1.6.0 2015-10-15 13:13:21 +02:00
Adam Stankiewicz
140c6d963f Update changelog and bump 2015-10-15 13:03:30 +02:00
Adam Stankiewicz
0c5e457359 Merge pull request #1948 from bower/feature/bundle
Shrinkwrap all dependencies and add them to bundledDependencies
2015-10-15 13:01:13 +02:00
Adam Stankiewicz
bfa4295606 Try to use container-based infrastructure on Travis 2015-10-15 12:53:18 +02:00
Adam Stankiewicz
8ac68ede5d Shrinkwrap all dependencies and add them to bundledDependencies 2015-10-15 12:45:38 +02:00
Adam Stankiewicz
a019f887e9 Update chmodr to fix chmod behavior on windows 2015-10-15 11:14:49 +02:00
Adam Stankiewicz
eba2c69308 Update bower-config to fix proxy behavior on windows 2015-10-15 11:14:35 +02:00
Adam Stankiewicz
8df5970300 Bump to 1.2.1 2015-10-14 21:30:26 +02:00
Adam Stankiewicz
db265d471f fix: Setting HTTP_PROXY on Windows (case insensitivity) 2015-10-14 21:30:09 +02:00
Adam Stankiewicz
0bb1536c99 Better manage file handles, properly close streams 2015-10-14 19:31:53 +02:00
Adam Stankiewicz
64eb7d598a Use lstat instead of stat for rimraf util 2015-10-14 17:24:54 +02:00
Adam Stankiewicz
df8e5a16be Fix readdir call on Windows
Sometimes it return ENOENT instead of ENODIR for normal files.

This broke code paths in few places. Also, see:
https://github.com/isaacs/chmodr/pull/8
2015-10-14 16:09:38 +02:00
Adam Stankiewicz
3ce2dd3989 Replace all fs with graceful-fs 2015-10-14 14:31:13 +02:00
Adam Stankiewicz
99105fbb57 Try chmod 777 + rimraf as fallback on rimraf in all places 2015-10-14 12:50:41 +02:00
Adam Stankiewicz
96f1e98859 test: Fix url for js-event-emitter 2015-10-13 17:56:42 +02:00
Adam Stankiewicz
d614b057c9 fix: Set environment variable as string, not number 2015-10-13 17:27:27 +02:00
Adam Stankiewicz
aafe02f3e9 Update bower-registry-client and bower-config 2015-09-28 19:42:35 +02:00
Adam Stankiewicz
0441e16bdb Bump to 1.2.0 2015-09-28 19:37:58 +02:00
Adam Stankiewicz
30a489535e Prevent defaulting cwd to process.cwd() 2015-09-28 19:37:44 +02:00
Adam Stankiewicz
ac88ece259 Bump to 1.0.0 2015-09-28 19:15:26 +02:00
Adam Stankiewicz
9b45c76744 Change ~ ranges to ^ 2015-09-28 19:14:58 +02:00
Adam Stankiewicz
059a5f83b7 Require using explicitly bower-config 2015-09-28 19:14:58 +02:00
Adam Stankiewicz
cf5cd61995 Pass proxy configuration via env variables instead of directly, closes #22 2015-09-28 19:14:58 +02:00
Adam Stankiewicz
a499cc5103 Update bower.json dependency 2015-09-28 19:14:58 +02:00
Adam Stankiewicz
123779bbd1 Remove client-side check for register command, closes bower/registry#23 2015-09-28 18:01:46 +02:00
Adam Stankiewicz
5365c7b428 Disable client-side check for registering git:// endpoints 2015-09-28 17:46:58 +02:00
Adam Stankiewicz
da961a9c42 Pass proxy configuration to request.js via env variables 2015-09-28 17:34:06 +02:00
de Winter, Anton
8ff0e0e2d1 Components that are not installed by bower should be left alone
Rework of commit by @wibblymat for PR #1363
Make compatible with existing tests
Uses fs.readdirSync() (once!) instead of async method.
Added new test
2015-09-28 17:18:36 +02:00
Adam Stankiewicz
ffde6bd228 Remove version generation from "bower init" command, closes #1343 2015-09-28 17:07:29 +02:00
Adam Stankiewicz
bebb4fb33b Fix one more upper case spelling 2015-09-27 19:46:43 +02:00
Adam Stankiewicz
2c243ea5b7 tests: Fix camel casing 2015-09-27 19:42:16 +02:00
JD Isaacks
498fe84b99 Use values from package.json as defaults if exists 2015-09-27 19:39:46 +02:00
Adam Stankiewicz
9b8b66ed83 Merge pull request #1838 from yasinkocak/patch-1
Added keywords tag
2015-09-27 18:22:51 +02:00
Adam Stankiewicz
9cc3dd4c92 Pass certificate for GitHubResolver and UrlResolver, closes #1869 2015-09-27 18:18:11 +02:00
Adam Stankiewicz
bf23d81c9e Update bower-config and fix tests for ignoreDependenies 2015-09-27 18:18:11 +02:00
Adam Stankiewicz
f53100d8d3 Bump version to 1.1.2 2015-09-27 17:08:55 +02:00
Adam Stankiewicz
acbe60cdf1 Perform only camelcase normalization before merging configs 2015-09-27 17:08:42 +02:00
Adam Stankiewicz
4c7f37e0f8 Bump to 1.1.1 2015-09-27 16:41:44 +02:00
Adam Stankiewicz
3ba696937c Merge extra config after normalisation 2015-09-27 16:41:32 +02:00
Adam Stankiewicz
1647994471 Bump to 1.1.0 2015-09-27 16:35:01 +02:00
Adam Stankiewicz
674e09dc56 Allow for overwriting options 2015-09-27 16:34:51 +02:00
Adam Stankiewicz
4c129d470f Bump to 1.0.1 2015-09-27 15:03:33 +02:00
Adam Stankiewicz
c630f01baa Update dependencies 2015-09-27 15:02:48 +02:00
Adam Stankiewicz
6018fc13b2 Bump version to 1.0.0 2015-09-27 14:45:53 +02:00
Adam Stankiewicz
c4fc6cd0e2 Typo in readme 2015-09-27 14:41:54 +02:00
Adam Stankiewicz
eed8735238 Fix formatting in the readme 2015-09-27 14:41:17 +02:00
Adam Stankiewicz
8c0155e8bd Normalize config right away in load method 2015-09-27 14:33:22 +02:00
Adam Stankiewicz
b2d4412e59 Remove unused methods and better document .restore method 2015-09-27 14:14:35 +02:00
John Andersen
4e3e45a88b Support for setting and restoring proxy related env variables 2015-09-27 14:05:17 +02:00
Adam Stankiewicz
af9b386d8a Suport backward-compatible ca certificate embedding 2015-09-27 13:34:17 +02:00
Adriaan Thomas
201b8a3bc6 Load CA file contents instead of keeping the path, so the request library can use it. 2015-09-27 13:34:17 +02:00
Adam Stankiewicz
6e1a994c26 Merge pull request #1922 from pwang2/feature/allow-resolver-passed-via-cli
allow --config.resolvers={required package}
2015-09-27 12:31:37 +02:00
Thomas Walpole
2ccc05cb98 get ignoredDependencies from .bowerrc instead of bower.json 2015-09-27 12:27:39 +02:00
Thomas Walpole
e7d22ffb11 install and update tests for ignoredDependencies 2015-09-27 12:27:39 +02:00
SignalDancer
4805c3615b Allow Ignore For Child Dependencies
Fix for bug #927. Ignore package if name matches specified in bower.json.
Permit fetch if package is explicitly declared in dependencies or devDependencies.
Designed for users who need tighter control of versions due to corporate liscence restrictions or other reasons.

Code Review Comments
2015-09-27 12:27:38 +02:00
Adam Stankiewicz
44a5260050 test: Clear analytics config for test environment 2015-09-27 12:22:40 +02:00
Adam Stankiewicz
d72d01823d Bump inquirer to 0.10, closes #1883 2015-09-27 12:03:25 +02:00
Adam Stankiewicz
1e166189ba Merge pull request #1917 from lukemelia/improve-version-failure-message
Include package name in error info when a version is not found.
2015-09-24 14:17:13 +02:00
Adam Stankiewicz
66310523d1 Bump to 1.5.3 2015-09-24 13:58:05 +02:00
Adam Stankiewicz
87a041a212 Fix --save-exact feature for github endpoints, fixes #1925 2015-09-24 13:34:49 +02:00
Adam Stankiewicz
9c52ec2751 Revert "Auto-sort bower.json dependencies alphabetically, fixes #1373"
This reverts commit 9dd79a8061.
2015-09-24 11:06:55 +02:00
Adam Stankiewicz
9010269236 Merge pull request #1923 from mex/feature/insight-prompt
Bumps Insight to reduce prompt friction
2015-09-18 12:11:36 +02:00
Michael Storgaard
aac254d275 Bumped Insight to reduce prompt friction
- Insight now checks for `process.env.CI` before prompting
 - Insight now times out after 30 seconds of no response to prompt
2015-09-18 11:18:08 +02:00
Peng Wang
889b54f309 allow --config.resolvers={required package} 2015-09-17 16:25:05 -05:00
Luke Melia
5d13ffda09 Include package name in error info when a version is not found.
Prior to this commit, when specifying a package version that cannot
be resolved, but other versions are available, the error message
did not state which what package failed, allowing for confusion.

For example, you might see:

```
bower ENORESTARGET  No tag found that was able to satisfy 1.0.2

Additional error details:
Available versions: 1.0.1, 1.0.0
```

After this change, in the above situation the svn and git resolvers
will produce the following:

```
bower ENORESTARGET  No tag found that was able to satisfy 1.0.2

Additional error details:
Available versions in somelib: 1.0.1, 1.0.0
```
2015-09-12 21:10:01 -04:00
Adam Stankiewicz
31b6d5971c Merge pull request #1819 from bak/init_private
Allow boolean values in bower.json file created by `bower init`
2015-09-11 22:55:52 +02:00
Ben Cullen-Kerney
304b6393d4 Allow whitelisted values in bower.json file created by bower init
A change in the behavior of `mout.lang.isEmpty()` in Mout v0.10.0
introduced a bug in `bower init`, preventing it from including Boolean
values in "bower.json".

This commit explicitly whitelists the types that are used in the
bower.json spec - Object, Array, String, Boolean - as well as Number for
future compatibility.
2015-09-11 12:40:20 -07:00
Sindre Sorhus
490f63a838 modularize the MD5 util function 2015-09-03 11:00:38 +07:00
Adam Stankiewicz
64d990ba10 Add changelog for 1.5.2 2015-08-25 22:37:23 +02:00
Adam Stankiewicz
cb019c405b Bump version to 1.5.2 2015-08-25 22:31:13 +02:00
Adam Stankiewicz
26f80d25be Put smart host detection behind a configuration, fixes #1764 2015-08-25 22:26:26 +02:00
Adam Stankiewicz
fe9a1bb5fc Revert "upgrade to newer semver, fixes #1817,#1845,#1851"
This reverts commit 8744449016.
2015-08-25 17:12:51 +02:00
Adam Stankiewicz
79679f9b08 Revert "Make bower commands work from subdirectories"
This reverts commit 7acafc26d6.
2015-08-25 17:11:48 +02:00
Adam Stankiewicz
5ef5403d69 Update changelog 2015-08-25 11:20:57 +02:00
Adam Stankiewicz
23afb3a129 Bump version to 1.5.1 2015-08-23 16:37:07 +02:00
Adam Stankiewicz
fac08cf835 [test] Recover process.cwd() after running one test 2015-08-23 16:32:45 +02:00
Adam Stankiewicz
dd67cc7de0 If cwd provided explicitly, force using it, fixes #1866 2015-08-23 16:24:36 +02:00
Adam Stankiewicz
8531534241 Merge pull request #1885 from bower/rwjblue-patch-1
Remove `it.only`.
2015-08-23 15:30:38 +02:00
Robert Jackson
0993621bb8 Remove it.only. 2015-08-23 09:26:48 -04:00
Adam Stankiewicz
45fe5c37cc Bump version to 1.5.0 2015-08-23 14:34:30 +02:00
Adam Stankiewicz
35b60d8d89 Merge pull request #1865 from bower/sheerun-patch-1
No longer prefer installing bower as global
2015-08-23 14:30:16 +02:00
Adam Stankiewicz
63b4d37207 Merge pull request #1866 from bower/feature/cwd
Make bower commands work from subdirectories
2015-08-23 14:30:05 +02:00
Adam Stankiewicz
793268ed54 Merge pull request #1871 from bower/1.5.0-preview
Pluggable resolvers
2015-08-23 14:28:25 +02:00
Adam Stankiewicz
a4a05a5413 Make custom resolvers implementation pass through linter 2015-08-23 14:20:09 +02:00
Adam Stankiewicz
821979bab1 Rename options to bower and add "version" to resolvers options 2015-08-23 14:16:23 +02:00
Adam Stankiewicz
69be742619 Improve API for pluggable resolvers 2015-08-23 13:44:00 +02:00
Sindre Sorhus
298982b522 Merge pull request #1879 from bower/sheerun-patch-2
Remove core team section from README
2015-08-18 01:10:43 +07:00
Adam Stankiewicz
9f2b3d1cd4 Merge pull request #1872 from insanehong/add-shorthand-version
Add shorthand for version of options in help.json
2015-08-13 23:14:37 +02:00
Adam Stankiewicz
800119fc92 Remove core team section from README
Instead, use link to contributors page on GitHub
2015-08-13 23:11:44 +02:00
insanehong
725fc26880 Add shorthand for version of options in help.json
"-v" shorthand aleady supported of cli opeion for output version
2015-08-04 13:58:23 +09:00
Adam Stankiewicz
ed27e87540 Fix the tests 2015-08-04 06:40:03 +02:00
Adam Stankiewicz
4fc2b5cf76 Add tests and improve resolver interface 2015-08-04 06:21:06 +02:00
Adam Stankiewicz
749d46930d Mention about issue with node path on Ubuntu 2015-07-29 00:02:12 +02:00
Adam Stankiewicz
7acafc26d6 Make bower commands work from subdirectories 2015-07-28 23:22:44 +02:00
Adam Stankiewicz
2817936b87 No longer prefer installing bower as global
Installing bower locally if perfectly good. It allows to use different version of bower locally.

The next step is to create bower-cli package that can run local bower installation.
2015-07-28 22:22:56 +02:00
Adam Stankiewicz
022c5a8401 Merge pull request #1864 from jodytate/patch-1
change to use a standard three dot ellipsis
2015-07-28 18:16:43 +02:00
jody tate
50fd944a62 change to use a standard three dot ellipsis 2015-07-28 08:19:05 -07:00
Adam Stankiewicz
9c9cd8164b Merge pull request #1852 from ZephyrHealth/fix/update-semver
upgrade to newer semver, fixes #1817,#1845,#1851
2015-07-28 17:00:18 +02:00
Peter Chanthamynavong
8744449016 upgrade to newer semver, fixes #1817,#1845,#1851
Upgrading to latest version of semver to fix (#1817, #1845, #1851).

Possible breaking changes in regards to the way semvers handles pre-releases.

If a version has a prerelease tags (for example, 1.2.3-alpha.3) then it will only be allowed to satisfy comparator sets if at least one comparator with the same [major, minor, patch] tuple also has a prerelease tag.

For example, the range >1.2.3-alpha.0 would be allowed to match the version 1.2.3-alpha.7, but it would not be satisfied by * or 1.2.3. See [semvers](https://github.com/npm/node-semver#prerelease-tags) additional details.
2015-07-23 07:52:14 -05:00
David DeSandro
a23f66d889 Merge pull request #27 from cvrebert/patch-1
0.6.0
2015-07-22 15:31:40 -04:00
Chris Rebert
a1596bb63c 0.6.0 2015-07-13 19:17:20 -07:00
Adam Stankiewicz
ada6fc18d9 Implement initial version of pluggable resolvers 2015-07-09 18:30:26 +03:00
David DeSandro
19af145166 Merge pull request #25 from cvrebert/normalize
Remove non-spec-compliant comma-separated string interpretation of main
2015-07-01 14:14:15 -04:00
David DeSandro
4ed81be0c6 Merge pull request #26 from cvrebert/validate-main
Validate that `main` conforms to the bower.json spec
2015-07-01 08:55:23 -04:00
Chris Rebert
1c62adcdb6 Validate that main conforms to the bower.json spec 2015-06-30 23:16:00 -07:00
Chris Rebert
95f46930a5 Remove non-spec-compliant comma-separated string interpretation of main
See https://github.com/bower/bower.json-spec/#main
2015-06-30 23:04:13 -07:00
Web Artisan
50b0186c06 Added keywords tag
Added keywords tag
2015-06-30 11:40:05 +02:00
Adam Stankiewicz
2c9d847a1d Merge pull request #1836 from blueyed/doc-remove-completion-section
doc: remove section about completion
2015-06-29 23:01:18 +03:00
Daniel Hahler
816cdda6bb doc: remove section about completion
The completion command appears to have been lost during the rewrite
(#1066).  So to avoid confusion it should not be mentioned in the
README.
2015-06-29 12:34:14 +02:00
Adam Stankiewicz
76dd504589 Merge pull request #27 from pdehaan/patch-1
Update license attribute
2015-05-21 12:31:51 +02:00
Peter deHaan
938c69c816 Update license attribute
specifying the type and URL is deprecated:

https://docs.npmjs.com/files/package.json#license
http://npm1k.org/
2015-05-20 16:57:57 -07:00
Sindre Sorhus
d5fc402a89 0.5.0 2015-05-19 22:07:12 +02:00
Sindre Sorhus
065a7a1f1b bump deps 2015-05-19 22:06:59 +02:00
Sindre Sorhus
833f97198e minor package.json tweak 2015-05-19 20:55:20 +02:00
Adam Stankiewicz
293d5cc02b Merge pull request #1802 from pgilad/patch-1
update license attribute
2015-05-19 16:04:24 +02:00
Gilad Peleg
dbb302f22a update license attribute
specifying the type and URL is deprecated:

https://docs.npmjs.com/files/package.json#license
http://npm1k.org/
2015-05-19 13:05:23 +03:00
Sindre Sorhus
ccadffea73 Update package.json 2015-04-28 12:54:04 +07:00
Sindre Sorhus
b3390ce201 use package.json files object to reduce the package size
https://docs.npmjs.com/files/package.json#files
2015-04-28 12:50:37 +07:00
Sindre Sorhus
6039f6c691 minor package.json tweak 2015-04-28 12:50:10 +07:00
Sindre Sorhus
c65cdc8699 use package.json files object to reduce the package size
https://docs.npmjs.com/files/package.json#files
2015-04-28 12:42:26 +07:00
Sindre Sorhus
7603886e04 minor package.json tweak 2015-04-28 12:41:43 +07:00
Sindre Sorhus
406a96e4d1 use package.json files object to reduce the package size
https://docs.npmjs.com/files/package.json#files
2015-04-28 12:40:35 +07:00
Sindre Sorhus
87d21e7968 use package.json files object to reduce the package size
https://docs.npmjs.com/files/package.json#files
2015-04-28 12:34:44 +07:00
insanehong
9dd79a8061 Auto-sort bower.json dependencies alphabetically, fixes #1373 2015-04-14 00:06:13 +02:00
Adam Stankiewicz
a1287416d4 Update changelog for 1.4.1 2015-04-01 00:38:21 -07:00
Adam Stankiewicz
00dc877f0a 1.4.1 2015-04-01 00:35:54 -07:00
Adam Stankiewicz
335081053d Bump bower-config and bower-registry-client versions, fixes #1763 2015-04-01 00:35:00 -07:00
Adam Stankiewicz
7d74d7d8f6 0.3.0 2015-04-01 00:24:38 -07:00
Adam Stankiewicz
e98d8139bc Bump bower-config version (bower/config#25) 2015-04-01 00:24:22 -07:00
Adam Stankiewicz
4af22cfbc0 [test] Replace sync-exec with spawn-sync
sync-exec has performance issue on Windows
2015-03-31 23:39:13 -07:00
Adam Stankiewicz
8a47aab01d Bump to 0.6.1 2015-03-31 22:27:07 -07:00
Adam Stankiewicz
395b208a0c Merge all .bowerrc upwards directory tree, fixes #25 2015-03-31 22:26:39 -07:00
Adam Stankiewicz
ab4f8a0e39 [test] Make synchronous exec work on Windows 2015-03-31 22:00:02 -07:00
Adam Stankiewicz
7e110603b5 [test] Make git helper in tests synchronous 2015-03-31 19:08:37 -07:00
Adam Stankiewicz
94455192ad Use -y flag for Chocolatey as AppVeyor suggests 2015-03-31 18:42:21 -07:00
Adam Stankiewicz
c4ca24a537 Add changelog for 1.4.0 2015-03-31 08:52:55 -07:00
Adam Stankiewicz
ea1f5d1ff0 Bump to 1.4.0 2015-03-30 15:46:30 -07:00
Adam Stankiewicz
77b7355433 Bump npm-config, fixes #1689, fixes #1711 2015-03-30 01:23:20 -07:00
Adam Stankiewicz
f6178c2f75 Bump to 0.6.0 2015-03-30 01:19:35 -07:00
Adam Stankiewicz
f1e04e5629 Merge branch 'kodypeterson-fixes-bower/bower/1689'
Conflicts:
	test/test.js
2015-03-30 01:15:56 -07:00
Adam Stankiewicz
cc913a728a Merge pull request #23 from zanona/npm-config
Allow NPM config variables. Resolve bower/bower#1711
2015-03-30 01:14:02 -07:00
Adam Stankiewicz
e727566741 Revert SvnResolver changes (windows paths in URLs) 2015-03-30 00:49:06 -07:00
Adam Stankiewicz
0f68da4eb8 Add support for two-factor authentication for login 2015-03-30 00:19:05 -07:00
Adam Stankiewicz
1a7abfd3b7 Add tests for login command 2015-03-29 23:31:20 -07:00
Adam Stankiewicz
905c2775d2 Add tests for unregister command 2015-03-29 17:56:04 -07:00
Mat Scales
126da9ee12 Unregister and login commands 2015-03-29 17:56:04 -07:00
Adam Stankiewicz
1080cb71c4 Merge pull request #1759 from nwinkler/Request-dep
Request dep
2015-03-29 14:36:24 -07:00
Nils Winkler
39a295901a Set request version to 2.53.0
This fixes the failing unit tests
2015-03-29 16:38:07 +02:00
Nils Winkler
7e55b0b099 Merge pull request #1 from bower/master
Update
2015-03-29 16:36:27 +02:00
Kody Peterson
f8c179b153 Cleanup 2015-03-27 11:05:41 -04:00
Adam Stankiewicz
b4aa90b402 Merge pull request #1755 from dancrumb/feature/1754
Fixes #1754: The version command in the programmatic API now returns the new version
2015-03-26 18:59:23 -07:00
Kody Peterson
bea46fb879 Children should be source 2015-03-26 14:32:35 -04:00
Kody Peterson
379de05a61 Correct the logic 2015-03-26 14:25:42 -04:00
Dan Rumney
a1ecf8a413 Fixes #1754: The version command in the programmatic API now returns the new version
When users of the programmatic API update the version, they may do so without having to inspect the new contents of the bower.json file to find out the new version.
This is useful in scripts where the tag needs to be pushed programatically; the user can push the new tag explicitly.
2015-03-26 10:03:52 -05:00
Adam Stankiewicz
4d59d266c1 Merge pull request #1628 from nwinkler/detect-smart-git
Automatically detecting smart Git hosts
2015-03-25 19:56:57 -07:00
Kody Peterson
c2f222760a Fixes https://github.com/bower/bower/issues/1689 and actually adds tests and testing ability 2015-03-25 13:42:44 -04:00
Nils Winkler
7e0a2ea4cb Added check for empty remote or no protocol set. 2015-03-24 20:36:15 +01:00
Nils Winkler
912808b672 Added support for caching hosts that support shallow cloning. 2015-03-24 20:22:15 +01:00
Nils Winkler
a352d51711 Using a function reference instead of calling directly from constructor 2015-03-24 17:14:28 +01:00
Nils Winkler
4ad5ed64d7 Automatically detecting _smart Git hosts_.
Added logic to automatically detect smart Git hosts that allow shallow
cloning. This is done by sending an `ls-remote` request to the server
and then evaluating the returned HTTP header fields. For this, Curl
verbose logging is enabled for the `ls-remote` request, since Curl
verbose logging sends the returned HTTP headers to `stderr`.

If the `stderr` output contains the desired header

  Content-Type: application/x-git-upload-pack-advertisement

then the server supports shallow cloning.

This approach uses Git and Curl for the heavy lifting. Instead of
implementing the request to the server using a simple HTTP client, Git
is used, since it takes care of authentication using stored credentials.

The used approach should also work for BitBucket, which only sends the
Content-Type header when a specific user agent is used. Using Git to
make the request enables this behavior.

The function to detect the smart Git host
(`GitRemoteResolver.prototype._supportsShallowCloning`) returns a
promise that is resolved when the server's request is evaluated. The
promise handling required an addition to `GitHubResolver.js` - to always
resolve the promise to `true`, since GitHub supports shallow cloning.

Added test cases to verify the new functionality.
2015-03-24 17:13:18 +01:00
Sam Saccone
3838a3b4fb Merge pull request #1740 from kytwb/master
Fix broken link to npm completion doc
2015-03-13 09:57:33 -04:00
Amine Mouafik
7d748ae15e Fix broken link to npm completion doc 2015-03-13 11:41:36 +07:00
Marcus Zanona
9aef3b7f1d Allow NPM config variables. Resolve bower/bower#1711 2015-03-12 17:42:32 +00:00
Adam Stankiewicz
9dab389b50 Merge pull request #1722 from kant/patch-1
Update year of copyright
2015-03-06 21:05:03 -08:00
Darío Hereñú
260b4adb8c Update year of copyright 2015-03-06 14:30:00 -03:00
Adam Stankiewicz
c93bbbd302 Bump to 0.2.4 2015-03-04 22:38:12 -08:00
Adam Stankiewicz
009e5ce0c8 Better error messages for unregistering 2015-03-04 22:25:46 -08:00
Adam Stankiewicz
61bb4f53c0 Increase timeout for test 2015-03-04 22:25:46 -08:00
Adam Stankiewicz
182d92f9bd test: Fix SvnResolver tests on all platforms 2015-02-28 23:56:17 -08:00
Adam Stankiewicz
61a68a9e38 test: Replace dejavu repo with pure (dejavu moved) 2015-02-28 19:52:40 -08:00
Sindre Sorhus
b6e33d70c8 Update README.md 2015-03-01 02:58:15 +08:00
Sindre Sorhus
7a26bf1a10 bump chalk
https://github.com/sindresorhus/chalk/releases/tag/v1.0.0
2015-02-23 15:07:56 +07:00
Sindre Sorhus
b6dd5e445e minor tweaks 2015-02-08 21:12:31 +07:00
Sindre Sorhus
6f4b77a440 Update .travis.yml 2015-02-08 20:47:09 +07:00
Sindre Sorhus
463584ea10 Update .travis.yml 2015-02-08 20:46:55 +07:00
Sindre Sorhus
fd8d603831 Update .travis.yml 2015-02-08 20:45:29 +07:00
Sindre Sorhus
a1ec83b002 0.2.3 2015-01-22 17:43:09 +08:00
Sindre Sorhus
041d3f2843 minor tweaks 2015-01-22 17:23:36 +08:00
Sindre Sorhus
0b22127906 Merge pull request #19 from tchajed/duplicate-package-error
Change duplicate package status code to 403
2015-01-22 16:46:52 +08:00
Sindre Sorhus
0b0b507827 Merge pull request #20 from masakura/fix-node11-proxy-failed
Fix error bower command behind proxy.
2015-01-22 16:45:12 +08:00
Sindre Sorhus
df1a87eb4e Merge pull request #1672 from therewasaguy/master
Update License Year to 2015
2015-01-21 16:37:52 +08:00
Tomo Masakura
16de289942 Fix error bower command behind proxy. 2015-01-21 13:57:28 +09:00
Jason Sigal
e203b1aa9a Update License Year to 2015
Happy new year!
2015-01-20 17:31:41 -05:00
patrick kettner
02dc97e413 Merge pull request #18 from tmcw/error-message
Adds an error message to errors. Fixes #16
2015-01-13 10:43:04 -08:00
Adam Stankiewicz
f458114c5b Enable OSX Travis build 2015-01-12 17:51:40 +01:00
Paul Irish
8db09d2fed Close #1655 PR: extend mocha timeout to 30s for travis.. 2015-01-12 16:02:05 +08:00
Sindre Sorhus
0ce7053598 bump dev deps 2015-01-12 10:09:33 +08:00
Sindre Sorhus
6a96815c44 bump insight 2015-01-12 10:04:25 +08:00
Sindre Sorhus
d7b0db41f4 bump update-notifier 2015-01-12 08:27:39 +08:00
Adam Stankiewicz
9c9f3e7055 Merge pull request #1654 from bower/alexanderGugel-save-exact
Add --save-exact flag
2015-01-11 17:32:53 +01:00
Alexander Gugel
2f6d680b6c Add --save-exact flag 2015-01-11 17:12:19 +01:00
Adam Stankiewicz
639f7939a3 Add info about Windows git configuration for testing 2015-01-11 03:33:23 +01:00
Adam Stankiewicz
95ce9cbf0c Remove node@0.11 from Windows builds 2015-01-11 03:28:12 +01:00
Adam Stankiewicz
1e0ef941c7 Add link to AppVeyor badge 2015-01-11 03:24:18 +01:00
Adam Stankiewicz
7e5bd64885 Fix AppVeyor badge 2015-01-11 03:15:33 +01:00
Adam Stankiewicz
de023bc6ea Update badges 2015-01-11 03:13:01 +01:00
Adam Stankiewicz
c7df6f50ca Add AppVeyor config for Windows CI 2015-01-11 03:08:43 +01:00
Adam Stankiewicz
df71d251f0 Disable SVN testing for unsuppoted hosts (e.g. AppVeyor) 2015-01-11 03:08:41 +01:00
Adam Stankiewicz
0b9acc18cc Test reading commands arguments 2015-01-10 12:56:15 +01:00
Adam Stankiewicz
58a7de3136 Prevent loading cli module in headless mode 2015-01-10 05:53:21 +01:00
Adam Stankiewicz
5bb77b1e03 [refactor] Prepare command argv readers for testing 2015-01-10 05:49:42 +01:00
Adam Stankiewicz
e351322ce4 More tests for lookup command and little refactor 2015-01-10 04:47:43 +01:00
Adam Stankiewicz
6b53ccc8bd Add tests for init command and fix it
In non-interactive mode error has been thrown in wrong way.
2015-01-09 03:18:53 +01:00
Adam Stankiewicz
33842b6f92 Remove dummy completion command 2015-01-09 02:29:18 +01:00
Adam Stankiewicz
5e747b2cfd Add tests for search and lookup commands 2015-01-09 02:22:05 +01:00
Adam Stankiewicz
3f8de0efb9 Add tests for cache clean command 2015-01-09 01:47:45 +01:00
Adam Stankiewicz
63da3e4595 Add tests for cache list command 2015-01-08 09:44:06 +01:00
Adam Stankiewicz
a04b69dc6a Test and fix link command 2015-01-08 05:09:32 +01:00
Adam Stankiewicz
3be4764d54 Add tests for prune command 2015-01-07 03:32:55 +01:00
Adam Stankiewicz
2d4fec01b1 Refactor some tests to promise style 2015-01-07 02:04:34 +01:00
Adam Stankiewicz
85c50eb542 Inject credentials to ENV for Travis 2015-01-06 20:56:27 +01:00
Adam Stankiewicz
ee62d00c96 Add tests for "version" command 2015-01-06 20:49:17 +01:00
Adam Stankiewicz
52a32f0887 Add tests for JsonRenderer 2015-01-06 17:59:45 +01:00
Adam Stankiewicz
dd30be90ad Fix StandardRenderer tests so they work on Travis 2015-01-06 16:03:58 +01:00
Adam Stankiewicz
4cb027eb73 Add tests for StandardRenderer 2015-01-06 15:56:10 +01:00
Adam Stankiewicz
8e0b8f2faf [test] Force monochrome color for test cases 2015-01-06 03:12:32 +01:00
Adam Stankiewicz
39491b78b1 Test register prompt as on dumb terminal (fixes travis) 2015-01-06 02:24:39 +01:00
Adam Stankiewicz
7c82da8389 Add tests for register command 2015-01-06 02:13:30 +01:00
Adam Stankiewicz
d5c13603a0 Merge pull request #1644 from pkollitsch/typo
Fix for #1639, missing line break in CLI input
2015-01-05 22:45:15 +01:00
Patrick Kollitsch
aad253bfad Fix for #1639, missing line break in CLI input 2015-01-05 12:52:31 +07:00
Adam Stankiewicz
dac055e2ef Add timeout in hope to catch stdout on travis 2015-01-05 06:51:09 +01:00
Adam Stankiewicz
85df5b9983 Add test for bower binary nad standard renderer 2015-01-05 06:47:01 +01:00
Adam Stankiewicz
537cd42097 Add tests for info command 2015-01-05 06:07:01 +01:00
Adam Stankiewicz
9d06fce5f9 Add few more tests for home command 2015-01-05 05:31:12 +01:00
Adam Stankiewicz
c029e1005f Add tests for "bower home" command 2015-01-05 05:19:54 +01:00
Adam Stankiewicz
b245a3d611 Remove unnecessary asserts from list test 2015-01-05 04:00:51 +01:00
Adam Stankiewicz
11d89c4268 fix: Tests helper regression 2015-01-05 03:48:59 +01:00
Adam Stankiewicz
6be84ab93e Add test case for #1584 2015-01-05 03:40:34 +01:00
Adam Stankiewicz
2f2c4d6740 Add tests for help command and fix it 2015-01-05 03:31:28 +01:00
Adam Stankiewicz
703eae72eb Bump to 0.2.2 2015-01-05 01:50:06 +01:00
Adam Stankiewicz
6a629e963c fix: Duplicate package has now 403 error code
According to change in bower/registry#74ae4d34b68df239b8db876a4f871b100ef3c540
2015-01-05 01:47:00 +01:00
Sindre Sorhus
06f4d0c117 package.json - use caret version specifier 2015-01-05 00:01:29 +07:00
Sindre Sorhus
b5e557ffb0 bump decompress-zip 2015-01-05 00:00:05 +07:00
Sindre Sorhus
8bd6c4a335 Merge pull request #1640 from laurelnaiad/update-deps
update package.json dependencies
2015-01-04 23:58:41 +07:00
Sindre Sorhus
29eaff9edc Merge pull request #1614 from joneshf/answer-colon
Remove erroneous colon.
2015-01-04 23:56:01 +07:00
Sindre Sorhus
08afaf7fa5 Merge pull request #1584 from vlajos/typofixes20141102
typo fixes
2015-01-04 23:54:32 +07:00
Daphne Maddox
45bab9fe71 update package.json dependencies
Update dependencies in package.json to (mostly) latest available
versions.

Updating these dependencies removes warnings when bower is installed
as a devDependency in other packages and keep the code fresh.

Methodology:

- `npm install`
- `npm test` (all tests pass)
- `npm-check-updates -u`
- `npm test` (find errors, suspect semver, back off to `~2.3.0` in
package.json)
- `rm -rf node_modules` (and .gitignored files)
- `npm install`
- `npm test` (all pass, deem updated version compatible)
- revert to package.json from `master`
- `npm install` (install the old dependencies)
- switch back to updated package.json
- `npm install` (upgrade dependencies in place)
- `npm test` (all tests still pass, deem upgrades safe)

As to the `semver` dependency, it seems that updating to 4.x requires
handling breaking changes, which is TODO.

Closes #1622
2015-01-03 11:24:21 -08:00
Sindre Sorhus
514eb8f0e3 better homedir detection 2014-12-22 22:56:27 +07:00
Ricardo Polo
a7baa58c22 Close #1620 PR: Showing --no-color in help. Fixes #78 2014-12-10 21:09:27 +07:00
Adam Stankiewicz
e548d8b1a5 Merge pull request #1618 from fracmak/bower_list_tests
Added unit tests of bower.commands.list()
2014-12-05 11:58:49 +01:00
Merrifield, Jay
92ff0fe624 Added unit tests of bower.commands.list() 2014-12-04 23:29:03 -05:00
joneshf
a464f5a88e Remove erroneous colon. 2014-11-29 12:22:58 -08:00
Veres Lajos
962a565d30 typo fixes 2014-11-02 22:40:58 +00:00
Tej Chajed
f242e60c1a Change duplicate package status code to 403
Registry no longer sends 406 so clients would previously just see
"Unknown error: 403 if they tried to register a duplicate package.
2014-11-01 09:08:58 -04:00
Sindre Sorhus
7db50391f2 Merge pull request #1576 from darabos/patch-1
Add extra newline at the end of help-cache.std
2014-10-27 23:07:41 +07:00
Daniel Darabos
8b0d55a729 Add extra newline at the end of help-cache.std
Without this newline, the template is rendered without a newline at the end. So when you run `grunt help cache`, the output does not have a newline at the end and the shell prompt will be printed at the end of the last line.
2014-10-27 14:00:13 +01:00
Sindre Sorhus
de6f341f41 bump to latest chalk 2014-10-16 11:52:46 +02:00
Adam Stankiewicz
c9fb530dbf Merge pull request #1557 from ISNIT0/master
Added return character
2014-10-06 14:38:33 +02:00
ISNIT0
836bcd09ec Added return character
https://github.com/bower/bower/issues/1554
2014-10-06 12:58:04 +01:00
Sindre Sorhus
52a6836872 Merge pull request #1548 from bower/fix/readable
[fix] Ensure extracted files are readable, update tar-fs
2014-09-28 23:40:29 +02:00
Adam Stankiewicz
c00cadb37a [fix] Ensure extracted files are readable, update tar-fs 2014-09-28 18:21:24 +02:00
Adam Stankiewicz
b26c072f0d Bump version to 1.3.12 and update changelog 2014-09-28 17:37:40 +02:00
Adam Stankiewicz
c99482f59d [doc] Explain why env in test/helpers.js is needed 2014-09-28 15:58:59 +02:00
Adam Stankiewicz
4aa0f567c3 Merge pull request #1529 from bower/analytics_fix
fix broken analytics tracking introduced in #1507 & changed default
2014-09-27 09:57:29 +02:00
Ray Shan
4656021902 fix broken analytics tracking introduced in #1507 2014-09-26 22:33:43 +02:00
Adam Stankiewicz
3df6144b77 Downgrade mout to 0.9.0, closes #1525 2014-09-23 20:12:19 +02:00
Ray Shan
6d335abe21 Merge pull request #21 from bower/fix/appdata
Use local appdata for cache, fixes bower/bower#1536
2014-09-23 09:58:17 -07:00
Adam Stankiewicz
179b8a28b4 Use local appdata for cache, fixes bower/bower#1536 2014-09-23 16:43:22 +02:00
Adam Stankiewicz
c620004168 Update tar-fs version, fixes #1537 2014-09-23 16:26:26 +02:00
Sindre Sorhus
893ff3e9d7 Merge pull request #1535 from zhiyelee/linebreak
add linebreak
2014-09-22 11:59:24 +02:00
zhiyelee
eec9a3cb8f add linebreak 2014-09-22 11:23:31 +08:00
Sindre Sorhus
d3c8042102 Merge pull request #1532 from BiAiB/fix-zero-major-dependencies
Fix 0.x dependencies to prevent breaking API updates
2014-09-19 14:14:05 +02:00
Rodolphe Gohard
e590b44c77 Fix 0.x dependencies to prevent breaking API updates
Semver states
> Major version zero (0.y.z) is for initial development.
> Anything may change at any time. The public API should
> not be considered stable.
We already had a case where a tmp package update (0.0.24)
broke bower install. This can happen again with  0.x
dependencies that can introduce breaking API changes
anytime.
2014-09-19 12:04:41 +02:00
Adam Stankiewicz
e97bf479fb Merge pull request #1527 from LaurentGoderre/v1.3.11
Bump and update changelog
2014-09-18 02:26:50 +02:00
Laurent Goderre
fe2f71c9b8 Bump and update changelog 2014-09-17 11:12:17 -04:00
Adam Stankiewicz
ee6c483dd4 Merge pull request #1519 from LaurentGoderre/fix-1518
Fix update command not installing missing packages
2014-09-16 22:39:49 +02:00
Laurent Goderre
e83ab86f1f Added update test cases 2014-09-16 16:23:38 -04:00
Laurent Goderre
ef237fc521 Added the missing install command to the update task
Fixes #1518
2014-09-16 16:23:25 -04:00
Adam Stankiewicz
fd4d68038b Bump and update changelog 2014-09-13 16:39:35 +02:00
Adam Stankiewicz
8e458c21e9 [test] Make sure install ends before running next test 2014-09-13 16:12:06 +02:00
Adam Stankiewicz
4ab36cb3bc [test] Use new temp location per process 2014-09-13 16:04:02 +02:00
Adam Stankiewicz
2d149f3a09 Merge pull request #1507 from bower/fix/skip-prompt
Fix/skip prompt
2014-09-13 01:25:20 +02:00
Adam Stankiewicz
dfd2c7a3d2 Add tests to analytics and fix them 2014-09-12 21:28:44 +02:00
John Schulz
6637762aec "analytics" value in \.bowerrc\ removes need to prompt user 2014-09-12 00:26:41 +02:00
Laurent Goderre
615eba3b40 Update p-throttle to allow displaying the output of hooks
Fixes #1484
2014-09-12 00:04:19 +02:00
Adam Stankiewicz
dc183125fc [test] Show coverage status for master branch 2014-09-08 03:12:36 +02:00
Adam Stankiewicz
c3b69d1201 [test] Provide git credentials for tests on CI 2014-09-08 03:10:02 +02:00
Adam Stankiewicz
3e1a50ab9a [test] Add tests for git repository install 2014-09-08 03:02:57 +02:00
Adam Stankiewicz
7565c71eb2 Warn about unnecessary resolution, #1061 2014-09-08 01:13:55 +02:00
Adam Stankiewicz
d743352bc0 Disable removing unnecessary resolutions, #1061 2014-09-08 01:02:31 +02:00
Sindre Sorhus
75ca72e3a8 Merge pull request #1508 from bower/fix/head-pipe
Prevent error when piping bower output to head, fixes #1396
2014-09-08 00:56:48 +02:00
Adam Stankiewicz
59d26c6825 Prevent error when piping bower output to head, fixes #1396 2014-09-07 23:46:20 +02:00
Adam Stankiewicz
5eed363e10 Merge pull request #1393 from Lukeas14/disable-shallow-clone-except-github
Disable shallow clones for all repos except those from github.com
2014-09-07 23:29:24 +02:00
Sindre Sorhus
49b2fdbde9 Merge pull request #1504 from bower/fix/hook-order
Run posthook after saving bower.json, fixes #1471
2014-09-07 20:06:28 +02:00
Burak Yigit Kaya
623f6e9542 Use tar-fs instead of tar for faster TAR extraction 2014-09-07 19:29:37 +02:00
Adam Stankiewicz
32356f23d3 Run posthook after saving bower.json, fixes #1471 2014-09-07 19:14:30 +02:00
Sindre Sorhus
321ddabfd5 Merge pull request #1502 from bower/fix/bowerrc-cwd
Read .bowerrc from specified cwd, fixes #1301
2014-09-06 18:15:55 +02:00
Sindre Sorhus
bf93a6a1ab make bower list --paths a bit prettier 2014-09-06 17:58:47 +02:00
Sindre Sorhus
91aa5dc6dd bump dependencies 2014-09-06 17:20:32 +02:00
Sindre Sorhus
56ed46b99a Merge pull request #1503 from bower/fix/windows-local-caching
Disable caching for windows absolute path, fixes #1416
2014-09-06 17:08:47 +02:00
Adam Stankiewicz
daaf21a4fe Merge pull request #1495 from mitogh/link-issues
Update the references to the issues and pulls in the CHANGELOG.md file
2014-09-06 14:40:55 +02:00
Adam Stankiewicz
06a8f2afab Read .bowerrc from specified cwd, fixes #1301 2014-09-06 02:38:40 +02:00
Adam Stankiewicz
cc04530c4a Merge pull request #1495 from mitogh/link-issues
Update the references to the issues and pulls in the CHANGELOG.md file
2014-09-04 23:14:21 +02:00
Crisoforo Gaspar Hernandez
0b6f62977a Update the references to the issues and pulls in the CHANGELOG.md file 2014-09-04 14:18:00 -05:00
Ben Schwarz
2a2996c22b Merge pull request #1483 from benschwarz/concurrency-reduction
Back concurrency down to 5 (from 50!)
2014-08-28 22:02:07 +10:00
Ben Schwarz
254aba0995 Back concurrency down to 5 (from 50!) 2014-08-28 20:28:22 +10:00
Ben Schwarz
23a81b3121 Merge pull request #1478 from fsmanuel/expose-version
expose bower version
2014-08-20 08:01:56 -07:00
Manuel Wiedenmann
c4659f816f expose bower version 2014-08-20 14:26:42 +02:00
Tom MacWright
fc13328e2a Adds an error message to errors. Fixes #16
This could be better if it could distinguish between server errors
and actually unknown errors (known unknowns), but that would require
the server to provide JSON errors.
2014-08-19 12:30:04 -04:00
Ben Schwarz
d1427e7d2e Merge pull request #1473 from bower/docs_update
Further simplify readme.md
2014-08-16 09:47:17 +10:00
Ray Shan
5584d1062e Further simplify readme.md 2014-08-15 16:26:23 -07:00
Ray Shan
b3f28fac64 Update README.md 2014-08-12 11:08:42 -07:00
Ray Shan
f65af7a308 Update README.md 2014-08-12 11:06:53 -07:00
Ray Shan
559f50a3e3 Merge pull request #3 from ncthis/patch-1
Fixing minor syntax errors
2014-08-12 11:05:27 -07:00
Sindre Sorhus
18b809314c Update README.md 2014-08-12 11:06:11 +02:00
Sindre Sorhus
aa1f819c0d Merge pull request #20 from rayshan/patch-1
Update README.md w/ npm instructions
2014-08-12 11:04:43 +02:00
Ray Shan
5a8cecf499 Update README.md 2014-08-11 17:56:54 -07:00
Adam Stankiewicz
79f362abee Merge pull request #21 from bower/docs_npm
Update README.md
2014-08-12 00:08:17 +02:00
Ray Shan
42db74b522 Update README.md 2014-08-11 15:03:34 -07:00
Sindre Sorhus
8cb41fe5fb Merge pull request #1464 from thorn0/patch-1
Mention updates in the main help
2014-08-11 18:35:42 +02:00
thorn0
cd893fec15 Mention updates in the main help
See #955. The same was done for `bower list -h`, but not for `bower help` AKA just `bower`.
2014-08-11 17:07:07 +03:00
Adam Stankiewicz
3309e9f53f Merge pull request #19 from stephanebachelier/patch-1
fix typo in README
2014-08-08 17:02:10 +02:00
Stéphane Bachelier
ae3a017143 fix typo in README 2014-08-08 16:59:47 +02:00
Sindre Sorhus
2a01f178da Update changelog 2014-08-06 21:41:46 +02:00
Sindre Sorhus
a069d1e07d 1.3.9 2014-08-06 21:39:31 +02:00
Sindre Sorhus
76fa7f5200 Merge pull request #1434 from pornel/master
Fix "TypeError: Arguments to path.join must be strings" in GitHubResolver
2014-08-06 21:35:41 +02:00
Kornel Lesiński
7a0a86d51c When tmp.js returns cleanup callback along with the tmp dir path, nfcall changes return type to an array 2014-08-06 14:28:04 +01:00
Sindre Sorhus
8e283e43db Merge pull request #1442 from luckysw/master
Added .zip MIME type (e.g. the default served by Windows/IIS)
2014-07-30 08:38:23 -07:00
MadLux
794744d5a3 Added .zip MIME type (e.g. the default served by Windows/IIS) 2014-07-30 11:41:21 +02:00
Sindre Sorhus
5c3e69b045 Merge pull request #1436 from rayshan/bump_insight
analytics - bump insight, supports OS/node/CLI version tracking
2014-07-28 04:16:02 -07:00
Ray Shan
9cbd595cfd analytics - bump insight to 0.4.1, supports OS/node/CLI tool version tracking 2014-07-27 21:42:15 -07:00
Adam Stankiewicz
a5074eca7d [doc] Encourage to always use --save option 2014-07-15 14:11:29 +02:00
Sindre Sorhus
9386b117c1 Merge pull request #1415 from bower/simple-readme
Remove content that can be now be found on bower.io
2014-07-15 01:58:10 +02:00
Sindre Sorhus
7738248230 lock down 0.0.x versions
as `~` causes unexpected and non-semver behaviour on them.

https://github.com/isaacs/node-semver
2014-07-15 01:50:32 +02:00
David DeSandro
85f1f808d3 Remove content that can be now be found on bower.io
+ bower.json
+ custom install directory
+ bower search
+ using bower cache
+ .bowerrc
+ continuous integration server
+ interactive configuration
+ Defining a package
+ maintaining deps
+ consuming a package
+ programmatic api
+ assistance & contribution list

Ref #1371
2014-07-14 17:45:24 -04:00
Ben Schwarz
6dbafa22bb Merge pull request #1412 from chibicode/master
Fix typo on help-uninstall.json
2014-07-13 19:17:16 +10:00
Shu Uesugi
cadcd37681 Fix typo on help-uninstall.json 2014-07-13 16:36:41 +09:00
Paul Irish
a45ea6e1d8 Update changelog 2014-07-11 17:02:35 -07:00
Paul Irish
187f24de81 Bump to 1.3.8 2014-07-11 17:02:35 -07:00
Paul Irish
8df1f48226 Merge pull request #1407 from vladikoff/tmp-dep-fix
Fixes node-tmp update issue
2014-07-11 13:44:04 -07:00
vladikoff
7dbf332a94 Fixes node-tmp update issue 2014-07-11 13:40:58 -07:00
Sindre Sorhus
c09ddf6de1 Merge pull request #1395 from steveyken/master
Fixed typo
2014-07-09 23:48:49 +02:00
Sindre Sorhus
9b5fa99d6a bump update-notifier and simplify 2014-07-09 16:15:47 +02:00
Steve Kenworthy
b9abf32007 Fixed typo 2014-07-09 10:50:43 +08:00
Lucas, Justin
09ecb80625 Disable shallow clones for all repos except github.com 2014-07-08 11:39:14 -07:00
Sindre Sorhus
c4e9a0e340 bump deps 2014-07-05 00:26:46 +02:00
Adam Stankiewicz
b6cf4e1826 Update changelog 2014-07-04 13:02:12 +01:00
Adam Stankiewicz
ecb1619399 Bump to 1.3.7 2014-07-04 12:58:03 +01:00
Vladimir Alaev
83f4b7b699 Fix callstack error when processing installed packages with circular dependencies 2014-07-04 12:53:50 +01:00
insanehong
9b81ddf4d5 It should shows an error when bower install failed, fixes #922
- reason no bower.json in current directory
2014-07-03 15:10:38 +01:00
insanehong
4af17f0e40 Fixed bower list --paths` fails with TypeError, fixes #1383 2014-07-03 15:00:53 +01:00
Adam Stankiewicz
2fbc036e69 Update the changelog 2014-07-02 14:04:01 +01:00
Adam Stankiewicz
d236a12b8f Bump version to 1.3.6 2014-07-02 12:28:48 +01:00
Adam Stankiewicz
232be333ad Add tests for removeIgnores utility 2014-07-02 11:37:56 +01:00
Tim Monks
192e5af797 Add integration tests for bower commands 2014-07-02 11:16:12 +01:00
Tim Monks
deb39b8f34 Publish to coveralls.io from travis 2014-07-02 11:16:10 +01:00
Adam Stankiewicz
197b41d97a Merge pull request #1366 from sheerun/fix/local
[#1356] Disable caching for local resources
2014-07-02 10:31:30 +01:00
Adam Stankiewicz
7b11a57c6f Merge pull request #1365 from sheerun/fix/force
[#931] Make --force always re-run installation
2014-07-02 10:26:50 +01:00
Adam Stankiewicz
eac7945fae Merge pull request #1372 from incompl/master
Add --version to --help
2014-06-27 23:03:35 +01:00
Greg
1177d2263f Add --version to --help 2014-06-27 11:08:09 -04:00
Ben Schwarz
b9478a1f65 Merge pull request #1367 from abutcher/bower-install-save-readme
Add bower install --save/--save-dev blurb to README.md. Closes #1321
2014-06-25 08:03:45 +10:00
Andrew Butcher
025cf91679 README.md --save rewording suggested by @benschwarz for #1321 2014-06-24 09:33:45 -04:00
Adam Stankiewicz
442aa72ccc [fixes 5c839724] Prevent command like "bower info" from crashing on render 2014-06-24 11:39:44 +02:00
Adam Stankiewicz
1c09f9c82d Bump bower-config and endpoint-parser versions 2014-06-24 11:16:07 +02:00
Andrew Butcher
c6d2f633ea Add bower install --save/--save-dev blurb to README.md. Closes #1321 2014-06-24 00:37:57 -04:00
Adam Stankiewicz
17bd60e3e9 [#1356] Disable caching for local resources 2014-06-22 22:05:13 +02:00
Adam Stankiewicz
1d24e82276 [#931] Make --force always re-run installation 2014-06-21 00:33:51 +02:00
Adam Stankiewicz
43d7a11ba8 Bump version to 0.2.2 2014-06-20 23:01:20 +02:00
Adam Stankiewicz
02e12e17d6 Prepend # to ambiguous branch name, fixes bower/bower#1308 2014-06-20 23:00:14 +02:00
Adam Stankiewicz
e42d3d5620 [#1329] Check if pkgMeta is undefined 2014-06-20 21:57:41 +02:00
Thomas Scholtes
5c83972401 Use promise interface for commands
This commit changes the interface of the command functions exported by the
files in `lib/commands`. The functions now return a promise and accept a logger
as the first argument. This has several advantages

* The promise style is consistent with the rest of the code.
* It removes a lot of duplicate code.
* The command factory does not need to proxy the logger object.
2014-06-20 21:14:26 +02:00
Martin Hansen
b8df18481f Ignore does now not apply to any file in main #547 2014-06-20 19:48:00 +02:00
Andrew Eisenberg
1690dd4728 Warn users when installing package with missing properties.
Fix for issue #694. Test case included.
2014-06-20 19:00:19 +02:00
Sindre Sorhus
a86087ed7c Update README.md 2014-06-13 23:32:05 +02:00
Ray Shan
745060f0b5 Close GH-1348: Updated Analytics section of readme.md with link to stats.bower.io. 2014-06-13 23:30:12 +02:00
Sindre Sorhus
0a0a490a38 bump deps 2014-06-10 22:18:26 +02:00
Adam Stankiewicz
4f838685d6 Bump to 0.5.2 2014-06-09 03:28:08 +02:00
Adam Stankiewicz
6339ba09f0 "Merge pull request #18 from mdasberg/master\n\nFix for Overriding .bowerrc with a relative tmp path that breaks downloading of bower modules with ignores" 2014-06-09 03:26:33 +02:00
Adam Stankiewicz
f816a5b0da Bump tmp version to 0.0.23, #988 2014-06-09 03:09:22 +02:00
Adam Stankiewicz
2f02e49716 Always ignore bower.json as said in spec 2014-06-08 18:46:39 +02:00
Mat Scales
a98a0b1ac2 Release 1.3.5 2014-06-06 11:31:37 +01:00
Adam Stankiewicz
034326c984 Add some tests and documentation for #1310 2014-06-05 23:52:48 +02:00
Sergey Tatarintsev
a965b05400 Search compatible versions in fetching packages
Previous version of code reported endpoints that does not have pckMeta
(not downloaded) yet and does not have exactly equal targets as
incompatible. This caused some package to be downloaded multiple times
and caused conflict errors (#1147).

This patch adds proper code for searching compatible version in
currently fetching packages basing on targets.

It also simplifies check for case when we have resolvedVersion and
candidate's target is range.
2014-06-05 19:41:37 +02:00
Sindre Sorhus
23c2e82c97 Merge pull request #18 from shinnn/master
Update dependencies and .jshintrc
2014-06-03 11:22:57 +02:00
Mat Scales
6c2de4a359 1.3.4 2014-06-02 15:22:18 +01:00
Mat Scales
e9588279c8 Updated changelog for v1.3.4 2014-06-02 15:21:04 +01:00
Shinnosuke Watanabe
7138d3518e Fix CI setting to pass the test against Node v0.8 2014-06-02 17:22:49 +09:00
Shinnosuke Watanabe
f852325906 Update graceful-fs and mocha 2014-06-02 14:43:08 +09:00
Shinnosuke Watanabe
3c9082ece3 Update .jshintrc for JSHint v2.5.x 2014-06-02 14:42:43 +09:00
Mat Scales
efe3a78499 Merge pull request #1278 from jfsiii/patch-1
Mirror `npm version` format for git tags
2014-05-27 19:37:53 +01:00
Adam Stankiewicz
98c77ffe18 Bump to 0.2.1 2014-05-21 14:20:25 +02:00
Adam Stankiewicz
31969a4939 Merge pull request #1306 from wibblymat/dependency-loop
Resolve a situation in which the install process gets into an infinite loop
2014-05-21 13:50:03 +02:00
Mischa Dasberg
b95d5f9f23 moved tmp resolve from load to normalize method 2014-05-21 11:02:19 +02:00
Nadeesha Cabral
adf59d78d7 Fixing minor syntax errors 2014-05-21 12:22:13 +05:30
Adam Stankiewicz
904ae3eab7 Merge pull request #9 from geigerzaehler/update-config-version
Use the same version of bower-config as bower
2014-05-21 02:17:33 +02:00
Adam Stankiewicz
44d2309700 Bump version 2014-05-21 00:17:40 +02:00
Adam Stankiewicz
5dd6a3883a Add info about unimplemented features, closes #11 2014-05-20 23:47:47 +02:00
Adam Stankiewicz
7a00c5ac71 Merge pull request #1307 from thomasmulvaney/patch-1
Fixed typo in README.md
2014-05-20 16:33:19 +02:00
Mat Scales
23fbbb5191 Resolve a situation in which the install process gets into an infinite loop 2014-05-20 14:46:41 +01:00
thomasmulvaney
a58b1ccfa5 Update README.md
Fixed sentence which had 'set manually' accidentally repeated.
2014-05-20 15:26:40 +02:00
Mischa Dasberg
5f0a3fe1c1 See: https://github.com/bower/bower/issues/1299 and https://github.com/bower/config/issues/17 2014-05-13 14:25:45 +02:00
Ben Schwarz
37b0a5c04c Merge pull request #1291 from danfinnie/patch-1
Fix Markdown typo in CONTRIBUTING.md
2014-05-12 13:12:38 +10:00
Daniel Finnie
3fb4f60192 Fix Markdown typo in CONTRIBUTING.md 2014-05-11 23:06:46 -04:00
Ben Schwarz
635fa84731 Merge pull request #1284 from niksy/improve-cli-color-output
Improve CLI output for conflicts
2014-05-08 08:14:13 +10:00
Ivan Nikolić
410bf4f0cd Improve CLI output for conflicts
Replace white color with green.
2014-05-07 19:27:44 +02:00
John Schulz
eebe115b78 Mirror npm version format for git tags
See https://github.com/bower/bower/pull/961#issuecomment-33981712 and  https://github.com/bower/bower/pull/961#issuecomment-35591108 for more context.
2014-05-04 15:11:47 -07:00
Sindre Sorhus
70eb9f0678 Merge pull request #1277 from benschwarz/analytics-statement-and-disable
Description of Analytics usage & how to disable
2014-05-04 06:03:26 +02:00
Ben Schwarz
b9de179fe8 Add notes about what analytics are used for, who has access and how to disable 2014-05-04 13:17:10 +10:00
Adam Stankiewicz
ac29e24c1b Allow for short commit SHA, closes #990 2014-04-25 02:09:10 +02:00
Adam Stankiewicz
d83572803d Bump, update changelog, update contributors 2014-04-24 22:35:22 +02:00
Adam Stankiewicz
87faa4f108 Do not cache moving targets like branches, fixes #1242 2014-04-24 20:31:36 +02:00
Sindre Sorhus
ea3a0d64c1 make jshint :) 2014-04-22 16:01:24 +02:00
Sindre Sorhus
8288d2f38b readme improvements 2014-04-22 15:28:29 +02:00
Sindre Sorhus
ff817dad0d various tweaks 2014-04-22 15:16:58 +02:00
Sindre Sorhus
ba554d5f45 use opn instead of open
`open` is buggy on Linux

https://github.com/sindresorhus/opn
2014-04-22 15:07:33 +02:00
Sindre Sorhus
90922a0ce0 bump deps 2014-04-22 15:04:42 +02:00
Sindre Sorhus
a91cb546f9 let npm sort dependencies 2014-04-22 14:57:38 +02:00
Adam Stankiewicz
3cb21d128f Forward all events from wrapped command, fixes #1232 2014-04-18 14:41:27 +02:00
Paul Irish
1b8d5d0648 Merge pull request #1234 from ahmadnassri/svn-export
using 'svn export' for efficiency. Closes #1224
2014-04-14 12:47:02 -07:00
Adam Stankiewicz
03f035cdf0 Merge pull request #1239 from bower/docs/usage
Discourage using bower components statically, closes #1210
2014-04-13 01:55:07 +02:00
Adam Stankiewicz
ac95654409 Discourage using bower components statically, closes #1210 2014-04-13 01:53:12 +02:00
Adam Stankiewicz
ba33bb6aa4 Cache clean and cache list work again, fixes #1232 2014-04-13 01:45:56 +02:00
Sindre Sorhus
2898c0507e Merge pull request #1237 from bower/fix/bower-list
Fix considering extended directory using .bowerrc
2014-04-12 23:41:32 +02:00
Sindre Sorhus
d59edd6cca Merge pull request #1238 from bower/feature/performance
Improve noninteractive loading performance 2x, fixes #1221
2014-04-12 23:33:49 +02:00
Sindre Sorhus
bc3079332c Merge pull request #7 from sheerun/patch-1
perf: Use the same mout version as bower
2014-04-12 23:22:47 +02:00
Sindre Sorhus
3c0395b19f Merge pull request #16 from sheerun/fix/mout
perf: Use only relevant parts of mout
2014-04-12 23:21:41 +02:00
Sindre Sorhus
9e7b591c78 Merge pull request #8 from sheerun/fix/mout
Use only relevant parts of mout
2014-04-12 23:21:18 +02:00
Adam Stankiewicz
b6107a1198 Use only relevant parts of mout 2014-04-12 22:23:12 +02:00
Adam Stankiewicz
2d94018f12 perf: Use only relevant parts of mout 2014-04-12 22:17:56 +02:00
Adam Stankiewicz
42f0268829 perf: Use the same mout version as bower 2014-04-12 22:10:37 +02:00
Adam Stankiewicz
74d568b1e7 Improve noninteractive loading performance 2x, fixes #1221 2014-04-12 21:11:17 +02:00
toshipon
0316fedd4c Fix considering extended directory using .bowerrc 2014-04-12 14:40:45 +02:00
Sindre Sorhus
5247d93d7b Merge pull request #1193 from chiester/wip-1191-improveUninstallWarning
clarify uninstall warning message
2014-04-11 21:45:37 +02:00
Chris Hiester
bda5312917 clarified uniinstall warning message
improved uninstall message

edits to uninstall message

revisions per conversation with core team

fixed lint errors

reverted mode changes

reverted test.js mode change
2014-04-11 12:35:28 -04:00
Ahmad Nassri
e8c071304c using 'svn export' for efficiency. Closes #1224 2014-04-11 09:00:41 -04:00
Sindre Sorhus
4e155caae9 Merge pull request #1124 from jmmk/quiet_output
Suppress end output if quiet option is specified
2014-04-11 12:11:45 +02:00
Sindre Sorhus
aedb7e44ba Merge pull request #1231 from bower/fix/dependencies
Update dependencies in package.json to newest patches
2014-04-11 12:02:25 +02:00
Sindre Sorhus
c58109c1b4 Merge pull request #1232 from bower/feature/lazy-loading
Loading commands on demand increases performance
2014-04-11 11:50:20 +02:00
Thomas Scholtes
2167c7b6d4 Loading commands on demand increases performance 2014-04-11 06:07:42 +02:00
Adam Stankiewicz
22eef989f6 Update dependencies in package.json to newest patches 2014-04-11 05:42:53 +02:00
Adam Stankiewicz
edf387363d doc: Point to new official msysgit website 2014-04-11 01:44:07 +02:00
Adam Stankiewicz
14ffb7443f Merge pull request #1230 from brettz9/readme
Refer to spec; add description in sample; fix map order
2014-04-10 02:26:29 +02:00
Brett Zamir
c21ba1e64c Refer to spec; add description in sample; fix map order 2014-04-10 08:02:18 +08:00
Sindre Sorhus
46b8069c6d Merge pull request #1227 from Aleanar/master
Update private Subversion repository example in README.md
2014-04-09 16:39:40 +02:00
Alexandre MOTTET
2fb697f452 Update private Subversion repository example in README.md 2014-04-09 13:44:22 +00:00
Ben Schwarz
73f3293314 Merge pull request #1212 from bower/release-1-3-2
Prepped 1.3.2 release
2014-04-07 11:40:45 +10:00
Ben Schwarz
53fc25550b Added yui moduletype 2014-04-07 11:35:16 +10:00
Eric Ferraiuolo
961d1775e5 Squashed commit of the following:
commit d5ab6721b6d0014b25ec7e5da2078627f0e794dd
Author: Eric Ferraiuolo <eferraiuolo@gmail.com>
Date:   Thu Feb 20 19:07:04 2014 -0500

    Add YUI modules as a `moduleType` choice

Closes gh-1129.
2014-04-06 18:13:37 -07:00
Ben Schwarz
bdaa359d11 Update changelog with #1211, remove #1077 2014-04-07 11:01:25 +10:00
Ben Schwarz
a90cc018dd Merge pull request #1216 from benschwarz/master
Revert 1077, merge 1211
2014-04-07 10:53:39 +10:00
Sindre Sorhus
e06f784d35 Merge pull request #1215 from t3chnoboy/master
Use SVG version of travis build status badge
2014-04-06 21:01:09 +02:00
Dmitry Mazuro
5ce1b6a4c1 Use SVG version of travis build status badge 2014-04-06 19:47:06 +03:00
Sindre Sorhus
86d579a7ae Merge pull request #1213 from rayshan/patch-1
Tweak insight tracking for `search` command
2014-04-06 14:15:29 +02:00
Ray Shan
d031ab5ceb Tweak insight tracking for search command
- Tracking should be consistent with `info` command; tracking should register upon user calling the command, not when the command is completed
- Vocabulary should be consistent with other tracking - if only tracking upon calling the command, should use the present tense of the verb without -"ed"

This is an improvement for tracking and reporting consistency, please see https://github.com/bower/bower/issues/1164#issuecomment-39385297
2014-04-05 23:00:38 -07:00
Ben Schwarz
dcf7230494 Merge remote-tracking branch 'sheerun/fix/concurrency' 2014-04-06 14:59:37 +10:00
Ben Schwarz
20aca45b39 Revert "Merge pull request #1077 from neoziro/fix-concurrent-renaming"
This reverts commit cd541c7a20, reversing
changes made to 3074711828.
2014-04-06 14:57:40 +10:00
shinnn
4812c380c4 Add a validation for description length
closes #17
2014-04-05 13:06:09 +02:00
Ben Schwarz
98ea43eca9 Prepped 1.3.2 release 2014-04-05 16:03:25 +11:00
Ben Schwarz
cd541c7a20 Merge pull request #1077 from neoziro/fix-concurrent-renaming
Fix bug with concurrent renaming
2014-04-05 15:41:39 +11:00
Adam Stankiewicz
5a5cf31aba Make bower concurrent friendly, fixes #933 2014-04-04 19:09:18 +02:00
Mat Scales
3074711828 Merge pull request #891 from bower/link-install-deps
Install linked package dependencies, closes #673.
2014-04-02 13:59:14 +01:00
Mat Scales
aa97c928e9 Merge pull request #1203 from wibblymat/node0.11
Add node 0.11 to Travis, but allow it to fail.
2014-04-02 13:54:52 +01:00
Mat Scales
5b4d6f2fee Add node 0.11 to Travis, but allow it to fail. 2014-04-02 12:55:00 +01:00
Sven Lito
0e833c155a Merge pull request #10 from wibblymat/unregister
Add 'unregister' feature
2014-04-01 17:32:33 +02:00
Mat Scales
9ebb1b17d1 Added tests and fixed code-style 2014-04-01 15:57:08 +01:00
Mat Scales
3397cf053c Removed a debug line 2014-04-01 15:29:35 +01:00
Mat Scales
6e73b5934e Add 'unregister' feature 2014-04-01 13:26:35 +01:00
André Cruz
7120ad5014 Merge branch 'master' of github.com:bower/bower into link-install-deps 2014-03-25 11:51:40 +00:00
André Cruz
6286cfac28 Merge branch 'master' into link-install-deps 2014-03-25 11:49:05 +00:00
Sindre Sorhus
1af09da2aa Merge pull request #1188 from chiester/wip-1187-conflictResolvedMessage
Improved conflict resolution message
2014-03-25 09:58:28 +01:00
Chris Hiester
bea533acf8 Improved conflict resolution message
removed test-generated npm-debug.log

fixed semver formatting in message
2014-03-24 13:48:25 -04:00
Mat Scales
5316c2479e Merge pull request #1168 from c960657/prune-production
Add --production switch to "prune" command
2014-03-19 16:37:29 +00:00
Andrey 'lolmaus' Mikhaylov
9895f8c71e readme - links to the range syntax of version numbers
closes #1172
2014-03-14 17:50:11 +01:00
Christian Schmidt
9749a398c0 Add --production switch to "prune" command 2014-03-12 18:38:17 +01:00
Ben Schwarz
2883a278ee Formatting tweaks to the CI section 2014-03-12 10:58:41 +11:00
Ben Schwarz
6bbb9ec956 Merge pull request #1165 from nschonni/ci-readme-update
Add additional CI examples
2014-03-12 10:54:47 +11:00
Mat Scales
630556f7fe Release 1.3.1 2014-03-11 23:39:39 +00:00
Nick Schonning
32a79c4fa1 Add additional CI examples 2014-03-11 19:33:26 -04:00
Paul Irish
eabfee6890 Merge pull request #1163 from nschonni/no-analytics-on-ci
Don't turn on analytics on CI unless explicitly set
2014-03-11 16:27:12 -07:00
Nick Schonning
6b9b283149 Add CI server configuration notes 2014-03-11 19:02:43 -04:00
Paul Irish
a19ad6663c insight in changelog 2014-03-11 13:52:35 -07:00
Nick Schonning
dfae97a8d7 Don't turn on analytics on CI unless explicit 2014-03-11 16:51:41 -04:00
Mat Scales
93d03434eb Merge pull request #1152 from ahmadnassri/svnResolver-test-fix
svnResolver updates
2014-03-11 16:06:54 +00:00
Mat Scales
76fcd341f6 Release 1.3.0 2014-03-10 21:27:56 +00:00
Ahmad Nassri
cea53ddd1f Remove Node 0.8 compatibility. Closes #1154 2014-03-06 16:33:48 +01:00
Ahmad Nassri
cfc061c960 Merge branch 'svn-resolver-fixes' of github.com:jevakallio/bower into svnResolver-test-fix 2014-03-05 14:10:08 -05:00
Ahmad Nassri
09bc1784e4 Fixing svnResolver tests
- duplicate 0.0.1 tag in json config
- `svn list` return directory separator at the end of branch/tag names
2014-03-05 13:51:43 -05:00
Sindre Sorhus
b723cf92e7 Merge pull request #1151 from eventualbuddha/fix-regex-typo
Fix a typo in the regex trying to understand the command.
2014-03-05 12:04:12 +01:00
Brian Donovan
3d7b9f60da Fix a typo in the regex trying to understand the command.
This is almost certainly not trying to replace 's' characters in a command and is, instead, meant to check for nested properties on bower.commands that were not found in bower.abbreviations for some reason. The kicker is that bower.abbreviations already contains the full command names in addition to the shortened ones, so this code path ("Direct lookup") probably never actually results in finding anything and can probably safely be removed.
2014-03-04 15:38:46 -08:00
jevakallio
b049bdb33f Fix problem with dashes and underscores in branch/tag names 2014-02-27 17:31:01 +02:00
Thomas Scholtes
a5c49d89d5 Use tilde to match bower-config version 2014-02-27 00:26:34 +01:00
Thomas Scholtes
1f9a92e6ad Use the same version of bower-config as bower
Make loading this package from bower faster. Used `>=` to specify version so it
doesn't break that fast when bower starts using a version `>=0.6.0`.
2014-02-26 15:38:10 +01:00
Sindre Sorhus
6280611aea Merge pull request #13 from geigerzaehler/master
Use same mout version as bower
2014-02-25 21:51:08 +01:00
Thomas Scholtes
20c0e6e12b Use same mout version as bower
We don't need to load mout twice, which takes a lot of time.
2014-02-25 19:53:50 +01:00
Sindre Sorhus
9aa6c2bd9f Merge pull request #1137 from cvrebert/master
spelling fixes in changelog
2014-02-25 02:09:22 +01:00
Chris Rebert
4450cce0e9 spelling fixes in changelog 2014-02-24 14:35:36 -08:00
Paul Irish
523cd421b3 changelog update for permalink. 2014-02-24 14:05:01 -08:00
Paul Irish
88dbbe7bc3 changelog. master --> canary. 2014-02-24 14:03:51 -08:00
Michael McLellan
cc63a633b5 Suppress end output if quiet option is specified 2014-02-18 17:13:04 -05:00
Renan Gonçalves
72578e49dd update changelog #1122 2014-02-17 22:31:39 +01:00
Nicolas Gallagher
83f1edb9da Move @necolas out of core team 2014-02-13 15:49:25 -08:00
Greg Bergé
8016bd4e1f Use new Q() shortcut. 2014-02-13 16:30:39 +01:00
Mat Scales
cb8b25da53 Merge pull request #1104 from SevInf/fix/circular
Allow circular dependencies to be installed
2014-02-11 10:44:58 +00:00
Mat Scales
c517b98bae Merge pull request #1055 from ahmadnassri/master
Subversion Support
2014-02-10 13:22:39 +00:00
Mat Scales
d66876a9c9 Merge pull request #718 from cgross/install-hooks
scripts/hooks functionality added
2014-02-10 13:22:07 +00:00
Sergey Tatarintsev
ad31df09fb Allow circular dependencies to be installed 2014-02-08 12:28:14 +02:00
Chris Gross
1831e507fe scripts/hooks functionality added 2014-02-06 15:40:38 -05:00
Sindre Sorhus
b12a58632d upgrade chalk 2014-02-06 19:25:03 +01:00
Sindre Sorhus
8442373be9 use is-root instead of sudo-block
since sudo-block isn't really used anyways
2014-02-06 19:13:55 +01:00
Sindre Sorhus
0f7a9e5a74 bump deps 2014-02-06 19:05:56 +01:00
André Cruz
74bce91db8 Merge pull request #1100 from chiester/wip-1099-clarifyConflictMessage
Clarify package conflict message displayed in console
2014-02-06 01:46:47 +00:00
Chris Hiester
469b74ffb3 Clarify package conflict message displayed in console 2014-02-05 20:23:46 -05:00
Sindre Sorhus
5dd0775737 Merge pull request #1098 from chiester/wip-1097-fixMisspelledMessage
Fix misspelled message showing in console
2014-02-06 00:09:00 +01:00
Chris Hiester
33ed5402f4 Fix misspelled message showing in console
Change "dependants" to "dependencies"
2014-02-05 16:40:44 -05:00
Sindre Sorhus
aa655dadc4 readme - new bower search url 2014-02-05 17:07:19 +01:00
Sindre Sorhus
0828025450 Merge pull request #1091 from lfender6445/bower_link_error_message_typos
fix error message
2014-02-04 11:30:57 -08:00
Sindre Sorhus
d9db3b695c Merge pull request #1087 from gdi2290/grunt-tasks
add load-grunt-tasks
2014-02-04 11:27:42 -08:00
Luke Fender
c3e6199ecf fix error message 2014-02-04 14:15:54 -05:00
gdi2290
926b9e0bfd add load-grunt-tasks 2014-02-04 08:51:39 -08:00
André Cruz
05ba2ee2f2 Merge pull request #1062 from patrickkettner/dumb-http-fallback
add fallback support to dumb http servers
2014-02-04 01:25:58 -08:00
Paul Irish
cd865e0a0a update copyright year
closes #1089
2014-02-03 22:13:38 -08:00
Patrick Kettner
08af876e01 add fallback support to dumb http servers 2014-02-03 22:32:07 -05:00
Mat Scales
a33fb05946 Merge pull request #1076 from neoziro/fix-cache-directory-reading
Fix reading versions from cache directory.
2014-02-03 13:32:31 -08:00
André Cruz
de52fa564b Merge pull request #1085 from ahutchings/master
Cache output of GitFsResolver.refs and GitRemoteResolver.refs, fixes #1083
2014-02-03 13:27:17 -08:00
Sindre Sorhus
8e13d406d4 Merge pull request #1086 from gdi2290/patch-1
update copyright year
2014-02-03 03:58:06 -08:00
PatrickJS
504f738cff update copyright year 2014-02-03 02:09:46 -08:00
Andrew Hutchings
fde7965bc9 Cache output of GitFsResolver.refs and GitRemoteResolver.refs, fixes #1083 2014-02-01 21:43:50 -05:00
reiz
d3ccc73796 Adding validation for package name
Closes #15
2014-01-31 14:54:40 +01:00
Ahmad Nassri
a1154bf383 Merge remote-tracking branch 'upstream/master'
Conflicts:
	README.md
2014-01-30 16:56:29 -05:00
Sindre Sorhus
c9cf6d157b readme - remove sourcegraph badge. not needed 2014-01-29 12:39:34 +01:00
Mat Scales
ef2f637d01 Merge pull request #1074 from wibblymat/save-by-default
Added a .bowerrc option to make bower install assume --save (#1040)
2014-01-28 04:07:37 -08:00
Greg Bergé
d130c73e77 Fix removing directory. 2014-01-28 12:23:21 +01:00
Greg Bergé
3ecc389e66 Fix concurrent renaming.
We stock the renaming promise in cache to ensure that there is not concurrent renaming.
2014-01-27 23:56:22 +01:00
Greg Bergé
3dbddfba41 Fix reading versions from cache directory.
When we write into directory we use encodeURIComponent, but when we read, we did nothing. Now we use decodeURIComponent to read the correct version and match the correct cache directory.
2014-01-27 22:55:07 +01:00
Mat Scales
e6cb497d1a Added a .bowerrc option to make bower install assume --save (#1040) 2014-01-27 21:00:57 +00:00
Mat Scales
703ac13185 Merge pull request #1073 from earnubs/patch-1
Update Team Meeting time to correct UTC
2014-01-27 12:59:32 -08:00
Stephen
a3e1c86953 Update Team Meeting time to correct UTC 2014-01-27 20:32:04 +00:00
Mat Scales
3d64222655 Merge pull request #1029 from sheerun/semver
Ignore prerelease versions if possible, fixes #1017
2014-01-20 13:52:41 -08:00
Paul Irish
5eb29fa99c Update CONTRIBUTING.md 2014-01-20 13:44:06 -08:00
Paul Irish
84a24b76c7 bower team 2014-01-20 13:34:05 -08:00
Mat Scales
89c2a64008 Merge pull request #961 from sebastianseilund/version-command
Added bower version command, like npm version
2014-01-20 12:23:07 -08:00
Sebastian Seilund
c1f992b11f Added bower version command 2014-01-20 11:29:14 -08:00
Ahmad Nassri
ea60442fd6 fixing failed travis test 2014-01-19 13:22:09 -05:00
Ahmad Nassri
d78c5fd7c2 Merge remote-tracking branch 'upstream/master' 2014-01-19 13:11:52 -05:00
Ahmad Nassri
3b98e4962a final working version, with unit tests update README with examples 2014-01-19 13:09:49 -05:00
Sindre Sorhus
f739a1141d Merge pull request #934 from wibblymat/module-type-init
Add the 'moduleType' property to bower init
2014-01-18 05:37:02 -08:00
Ahmad Nassri
c498e9437e merging SvnResolver with SvnRemoteResolver 2014-01-17 13:59:10 -05:00
Ahmad Nassri
9f9a7c6b38 updating README with Subversion info 2014-01-16 23:57:54 -05:00
Ahmad Nassri
e3d2949c46 Merge pull request #1 from kennethklee/feature/svnTests
Feature/svn tests
2014-01-16 20:47:27 -08:00
Kenneth Lee
53f563ec08 added svn+file for local file system checkouts 2014-01-16 20:07:04 +00:00
Kenneth Lee
d27c36c70c fixed the gitResolver tags and associated test 2014-01-16 19:52:02 +00:00
Kenneth Lee
820834111b fixed svn+xxxxx protocol 2014-01-16 19:35:52 +00:00
Kenneth Lee
0c7b09c237 created svn tests in resolver factory 2014-01-16 19:18:27 +00:00
Ahmad Nassri
6eb8bb6241 fully functional
now to prove it with some proper tests
2014-01-15 22:37:47 -05:00
Ahmad Nassri
ce0b18045b jshint fixes 2014-01-15 20:15:27 -05:00
Ahmad Nassri
10d2d566a3 WIP working off trunk and maybe tags, not fully tested, not fully ready for PR 2014-01-15 17:46:43 -05:00
Sindre Sorhus
9c404185e8 Merge pull request #1045 from wibblymat/debug-mode
Enable Q long stack traces when in verbose mode
2014-01-14 14:08:44 -08:00
Mat Scales
3044c16ce1 Enable Q long stack traces when in verbose mode 2014-01-14 13:10:23 +00:00
Joshua Clanton
729ef0190e Note that commit hashes are valid versions
Closes #870
2014-01-08 18:43:45 +01:00
Sindre Sorhus
3aab16f6db Merge pull request #1016 from kud/feat.update-readme
Update docs about private repo. refs #897
2014-01-08 09:41:42 -08:00
André Cruz
0682882ac1 Merge pull request #1031 from yaph/patch-1
Changed to uppercase S as shorthand for save
2014-01-03 05:13:54 -08:00
Mat Scales
da46cd78a3 Merge pull request #1024 from bower/prune_promise_fix
Forgot to return promise, fixes #1023
2014-01-03 03:33:08 -08:00
Ramiro Gómez
f3cca3483d Changed to uppercase S as shorthand for save
Before the help showed lowercase s '-s' as the option to save installed packages, which doesn't work.
2014-01-02 19:12:52 +01:00
Adam Stankiewicz
40dbb0ffaf Ignore prerelease versions if possible, fixes #1017 2013-12-31 15:43:36 +01:00
Sven Lito
53d3ac570e Merge pull request #7 from clientlab/master
fix a bug
2013-12-26 07:32:13 -08:00
周培公
237022baae add a test.
add a test 'calling the lookup instance method with two registries, and
the first missing', and adjust the test sequence.
2013-12-26 08:08:29 +08:00
André Cruz
b11ef97b7d Forgot to return promise, fixes #1023 2013-12-25 23:33:40 +00:00
周培公
bccfd7bbbb fix a bug. 2013-12-24 15:03:03 +08:00
Sindre Sorhus
634ed4a341 Add note about setting custom install dir
Closes #845
2013-12-22 02:36:52 +01:00
Erwann Mest
52aa87c145 Update docs about private repo. refs #897 2013-12-16 22:16:17 +01:00
Sven Lito
597853cd6c bump version 2013-12-11 10:43:50 +00:00
Sven Lito
1bd6568f94 Merge pull request #6 from xiaojue/master
add headers for request to fix userAgent not work.
2013-12-11 02:39:42 -08:00
xiaojue
4b2235aef2 add userAgent test 2013-12-11 18:32:13 +08:00
xiaojue
faf1c26669 add headers for request to fix userAgent not work. 2013-12-11 15:17:08 +08:00
Sindre Sorhus
3aea5fb704 Merge pull request #999 from frozzare/patch-1
Updated readme with correct jQuery example script tag
2013-12-07 08:23:33 -08:00
Fredrik Forsmo
ea559592b5 Updated readme with correct jQuery example script tag
The example script tag has `jquery/index.js` but jQuery have `jquery.js` as main file, so the readme should have the correct main file in the example.
2013-12-07 11:17:12 +01:00
Mat Scales
c385c08e2f Close GH-2: Add checkbox prompt. 2013-12-06 22:11:00 +00:00
Sindre Sorhus
a74b925173 Merge pull request #996 from kuatsure/list/help
Mentions updates in `bower list -h` command
2013-12-05 13:40:46 -08:00
Pascal Hartig
e84f71cd37 Basic usage tracking with insight
The user is prompted with a question whether he would like to provide usage data
    on the first start, when run in interactive mode. The current implementation
    tracks calls to `install`, `info`, `search` and `uninstall` when run with at
    least one parameter.

    Fixes #260

Closes gh-796.
2013-12-05 22:37:32 +01:00
Jarrett Drouillard
bc6428536c Mentions updates in bower list -h command 2013-12-05 15:47:07 -05:00
Mat Scales
1c47a0e1a0 Release 1.2.8: Update the changelog and bump the version 2013-12-02 13:42:25 +00:00
Mat Scales
4d3e2f4fd3 Merge pull request #983 from wibblymat/issue-981
A queueing system for the cmd module to limit the number of open handles (closes #981)
2013-12-02 05:11:04 -08:00
Mat Scales
a3430f7ce6 Be less specific with the dependency version 2013-12-02 12:39:41 +00:00
Mat Scales
247b7ee1ab Let's use a library instead of rolling our own solution 2013-11-28 13:09:26 +00:00
Mat Scales
58eafce947 Slightly reworked the code for readability 2013-11-27 10:06:51 +00:00
Mat Scales
ed25cf9d23 A queueing system for the cmd module to limit the number of open handles. 2013-11-26 22:26:58 +00:00
Mat Scales
8992c74d32 Merge pull request #980 from wibblymat/infinite-dependency-recursion
Fixed an infinite recursion bug
2013-11-26 08:43:53 -08:00
Sindre Sorhus
01f56c515b readme - trying out SourceGraph hit counter - 90' is back!
This is what we got since GitHub won't share stats with us :/
2013-11-26 09:15:29 +01:00
André Cruz
864d3a3b2f Fixed a bug caused by recently throw added in semver
The newest semver module version throws when calling `toComparators` with an invalid semver range (`invalid comparator`).
2013-11-25 17:56:31 +00:00
Mat Scales
d68d2a4b18 Fixed an infinite recursion bug 2013-11-22 13:40:04 +00:00
André Cruz
d24da615b3 Merge pull request #976 from hidinginabunker/allowroot_env_conf
Added config fallback for allow-root check
2013-11-20 17:57:37 -08:00
Gabriel Herrera
84c693ad22 Added config fallback for allow-root check 2013-11-19 16:43:15 -05:00
Sindre Sorhus
747cbc1442 Add Bower logo to readme 2013-11-07 13:46:54 +01:00
Mat Scales
722cc54338 Merge pull request #944 from gergelyke/master
bower's cache added to readme
2013-11-05 09:10:59 -08:00
Gergely Nemeth
21abf0d215 typo fix in --offline 2013-10-29 09:34:09 +01:00
Gergely Nemeth
83cb1b05d9 typo fix in --offline 2013-10-29 09:33:30 +01:00
Gergely Nemeth
83d4c04646 typo fix in --offline 2013-10-29 09:30:51 +01:00
Gergely Nemeth
0a7f601dec -offline added 2013-10-29 09:29:51 +01:00
Sindre Sorhus
1d079c0879 remove unicode space symbol thingy 2013-10-25 18:31:59 +02:00
Sindre Sorhus
3df4b5b28f readme - add link to blog post explaining why checking in dependencies is recommended
Lots of people ask about this and doesn't bother to Google it...
2013-10-23 13:39:15 +02:00
Mat Scales
14dc86e9ea Add the 'moduleType' property to bower init 2013-10-21 15:14:08 +01:00
André Cruz
b64d8bfab3 Merge pull request #912 from beardtwizzle/master
Allow for existence of query-string parameters in URL
2013-10-17 19:44:24 -07:00
André Cruz
b41c8ad364 Merge pull request #926 from bower/improve-list-message-for-missing-packages
Improve `list` message for missing packages
2013-10-17 19:39:38 -07:00
Nicolas Gallagher
03c6709254 Improve list message for missing packages
'missing' -> 'not installed'
2013-10-16 13:03:25 -07:00
Paul Irish
7a6fb46841 Merge pull request #905 from eddiemonge/patch-1
Docs: Move registering package
2013-10-14 17:56:18 -07:00
Paul Irish
5b43407388 Merge pull request #906 from eddiemonge/patch-2
Docs: Proposal: Move warnings sections
2013-10-14 17:55:24 -07:00
Paul Irish
0e05301588 Merge pull request #908 from eddiemonge/patch-4
Docs: Code isnt code when it isnt code
2013-10-14 17:52:51 -07:00
Jonathan Mahoney
7a501164a9 Test for b632984 (Allow for existence of query-string parameters in URL) 2013-10-14 09:02:18 +01:00
Jonathan Mahoney
b632984874 Allow for existence of query-string parameters in URL 2013-10-09 13:00:50 +01:00
Eddie Monge Jr.
94407079bf Code isnt code when it isnt code
Moved code that should be titles to titles instead of in the code
2013-10-07 14:58:32 -07:00
Eddie Monge
57ab7ee6f2 Proposal: Move warnings sections
Installation instructions should be prominent with
warnings following as they are mostly edge cases.
2013-10-07 14:46:08 -07:00
Eddie Monge Jr.
62cf372d81 Move registering package
Seems like it should be with defining a package instead of usage
2013-10-07 14:35:24 -07:00
Mat Scales
d3991ee672 Close GH-900: Merge all the decompress-zip work and add small improvements. Fixes #873, Fixes #896 2013-10-07 00:29:29 +01:00
André Cruz
b4603069bf Merge pull request #901 from bower/absolute-path-slash
Fix absolute paths ending with / not going through the FsResolver, fixes #898
2013-10-04 05:01:38 -07:00
André Cruz
60c522a696 Fix absolute paths ending with / not going through the FsResolver, fixes #898. 2013-10-04 12:38:08 +01:00
André Cruz
99b0c8974b Merge branch 'master' of github.com:bower/bower into link-install-deps 2013-10-04 12:10:49 +01:00
André Cruz
6ae2c8497f Merge branches 'master' and 'master' of github.com:bower/bower 2013-10-04 12:09:36 +01:00
André Cruz
01b7509e61 Little fix when synching up dependencies. 2013-10-04 11:25:06 +01:00
André Cruz
194a09f21d Some fixes. 2013-09-30 18:25:54 +01:00
André Cruz
3207365e3a Typo. 2013-09-30 02:44:44 +01:00
André Cruz
b87b8ea931 Install linked package dependencies, closes #673.
Also add a "unlink" alias to "uninstall".
2013-09-30 02:33:06 +01:00
André Cruz
58d21ddc15 Add NOTE. 2013-09-29 23:09:00 +01:00
André Cruz
80c1fee406 Bump version. 2013-09-29 23:04:39 +01:00
André Cruz
a595c1ceaf Update change log. 2013-09-29 23:04:11 +01:00
André Cruz
cc9c440614 Give priority to mime type header, except for octet-stream. 2013-09-29 22:50:06 +01:00
Sven Lito
37425713ba Merge pull request #889 from bower/sync-up-dissected
Sync up dependencies and dependants after dissection, fixes #879.
2013-09-28 08:34:10 -07:00
Sven Lito
8e76d67bdf Merge pull request #888 from bower/fix-872
Fix bower not looking tags when target looks like a semver, fixes #872.
2013-09-28 08:33:16 -07:00
André Cruz
ab7e7ac12a Bump version. 2013-09-28 15:11:01 +01:00
André Cruz
99cb553cbd Sync up dependencies and dependants after dissection, fixes #879. 2013-09-28 14:34:33 +01:00
André Cruz
dcc396234c Fix bower not looking tags when target looks like a semver, fixes #872. 2013-09-28 12:08:46 +01:00
Sven Lito
3788e8d7b3 Merge pull request #5 from bower/md5
Append a truncated hash to prevent case issues in case insensitive fs.
2013-09-28 02:15:53 -07:00
Sven Lito
715de1b18c Merge pull request #887 from bower/init-ignore-dir
Add configured directory in bowerrc to the ignores in bower init.
2013-09-28 02:14:16 -07:00
André Cruz
7c2384cb94 Improve last commit. 2013-09-28 01:51:22 +01:00
André Cruz
5b1dd15749 Replace dir separators with dashes before storing into the resolve cache. 2013-09-28 01:34:49 +01:00
André Cruz
041290e1c7 Append a truncated hash to prevent case issues in case insensitive fs. 2013-09-28 00:54:33 +01:00
André Cruz
1f8417041d Add configured directory in bowerrc to the ignores in bower init. 2013-09-28 00:31:37 +01:00
André Cruz
7ecd70a90b Fix bower update not correctly catching up branch commits. 2013-09-10 18:07:26 +01:00
André Cruz
6d85ae8e8e Upgrade mout. 2013-09-09 00:52:36 +01:00
André Cruz
f405877a16 Oops. 2013-09-09 00:29:43 +01:00
André Cruz
d22c6f9d66 Only convert & warn if necessary. 2013-09-09 00:28:35 +01:00
André Cruz
c87f0495c0 Typo. 2013-09-07 17:05:39 +01:00
André Cruz
15fbf44948 Close GH-862: Store resolution when --force-latest is specified, fixes #861. 2013-09-07 15:52:23 +01:00
André Cruz
10963bd808 Merge pull request #850 from bower/promise-swallow
Do not swallow sync errors from commands event handlers, fixes #849.
2013-09-06 09:32:48 -07:00
André Cruz
0866c93573 Do not swallow sync errors from commands event handlers, fixes #849. 2013-09-04 09:58:50 +01:00
André Cruz
48e475c9f6 Add missing entry in change log. 2013-09-04 02:50:30 +01:00
André Cruz
2c5ab19374 Bump version. 2013-09-04 02:43:08 +01:00
André Cruz
9d50c31d2c Update change log. 2013-09-04 02:42:42 +01:00
André Cruz
b8b03c88e4 Close GH-844: Ensure that the whole file was downloaded.. Fixes #792, Fixes #824, Fixes #830 2013-09-01 22:25:20 +01:00
André Cruz
a65f57e0f5 Merge pull request #835 from bower/private-registry
Do not translate urls for custom registry servers, fixes #832
2013-08-29 12:10:14 -07:00
André Cruz
491027b048 Do not translate urls for custom registry servers. 2013-08-29 19:56:29 +01:00
André Cruz
5e1971a951 Merge branch 'master' of github.com:bower/bower 2013-08-29 19:55:43 +01:00
André Cruz
1099e786df Bump version. 2013-08-29 19:51:13 +01:00
André Cruz
be95169c1b Add DEFAULT_REGISTRY, #6. 2013-08-29 19:50:46 +01:00
André Cruz
f64f672b20 Reuse code. 2013-08-29 09:14:16 +01:00
André Cruz
7c0a5d60ef Typo. 2013-08-28 22:50:03 +01:00
André Cruz
1f7bd9fd47 Update to latest version of request-progress, to report downloaded size even without content-length. 2013-08-28 22:38:16 +01:00
André Cruz
2a7c3eb2e6 Bump version. 2013-08-28 22:04:14 +01:00
André Cruz
32aeba2bb8 Merge branch 'master' of github.com:bower/bower 2013-08-28 22:03:29 +01:00
André Cruz
20e376c214 Update change log. 2013-08-28 22:02:28 +01:00
André Cruz
a0c1552726 Merge pull request #829 from bower/no-home
Warn if home is not set, fixes #828
2013-08-28 13:51:08 -07:00
André Cruz
46783e32d5 Warn if home is not set. 2013-08-28 21:45:39 +01:00
André Cruz
2eafac3ff6 Bump deps. 2013-08-28 21:32:48 +01:00
André Cruz
9bd85b7023 Remove unneeded comment. 2013-08-28 21:28:50 +01:00
André Cruz
eb9dcce30b Close GH-819: Fix resolutions not working properly when resolving to branches, closes #818.. Fixes #818 2013-08-28 21:22:18 +01:00
André Cruz
a899cb48b3 Bump version. 2013-08-28 08:21:13 +01:00
André Cruz
ed8ac01f07 Do not crash if home is not set. 2013-08-28 08:20:55 +01:00
André Cruz
742ef58d89 Merge pull request #825 from stephenplusplus/master
(words) Fix post-register wording.
2013-08-27 15:19:03 -07:00
Stephen Sawchuk
c98bef5fc7 (words) Fix post-register wording. 2013-08-27 16:33:56 -04:00
André Cruz
23044b3758 Fix throttling issue that causes progress to fire after end. 2013-08-26 14:09:17 +01:00
André Cruz
107ce78b12 Doc typo. 2013-08-23 23:23:03 +01:00
André Cruz
5f81b8f0c1 Bump version. 2013-08-23 23:12:32 +01:00
André Cruz
83d75e704b Update change log. 2013-08-23 23:12:16 +01:00
André Cruz
a860e3eaf7 Merge pull request #816 from bower/ignore-nested
Fix ignore of nested folders, fixes #814.
2013-08-23 15:09:11 -07:00
André Cruz
3d84bcc7ad Fix ignore of nested folders, fixes #814. 2013-08-23 13:57:15 +01:00
André Cruz
c31504220d Small typo. 2013-08-22 19:19:11 +01:00
André Cruz
f8501cf7f4 Improve changelog. 2013-08-22 19:14:38 +01:00
André Cruz
81ef5a1dd2 Bump version. 2013-08-22 19:07:34 +01:00
André Cruz
29ec793386 Update changelog. 2013-08-22 19:07:13 +01:00
André Cruz
187457df13 Fix interactive not being set correctly on node 0.8.x, fixes #802. 2013-08-22 18:52:42 +01:00
André Cruz
2eea214a42 Fix linked dependencies in windows, fixes #813. 2013-08-22 18:45:34 +01:00
André Cruz
639c2290b7 Do not list versions if a property was requested, #684. 2013-08-22 18:27:41 +01:00
André Cruz
3044dcd3af Merge branch 'master' of github.com:bower/bower 2013-08-22 13:07:22 +01:00
André Cruz
3d64b16227 Fix extraneous being incorrectly set for saved dev dependencies in some cases. 2013-08-22 13:07:03 +01:00
André Cruz
7bd22a5103 Fix update notice when using --json. 2013-08-21 19:30:47 +01:00
André Cruz
12cde3ddce Doc typo. 2013-08-21 18:48:21 +01:00
André Cruz
860d70551f Bump version. 2013-08-21 18:46:05 +01:00
André Cruz
6db6fcc414 Small tweaks to last PR. 2013-08-21 18:45:46 +01:00
André Cruz
25c229de73 Merge pull request #9 from alexwhitman/nested-env-vars
Allow nested environment variables using '__'
2013-08-21 10:26:31 -07:00
Alex Whitman
d954a54017 Handle nesting in environment variables
Nested configuration variables can now be specified by environment
variable. Levels are split by '__' (double underscore). Single
underscores are converted to '-'.

`bower_foo__bar-baz` -> `foo.bar-baz`
2013-08-21 11:41:46 +01:00
André Cruz
dcdd8cb3db Typo. 2013-08-20 23:39:43 +01:00
André Cruz
e93c5f8265 Forgot date. 2013-08-20 23:34:41 +01:00
André Cruz
77be4520dc Bump version. 2013-08-20 23:32:58 +01:00
André Cruz
cf76bcb2aa Update changelog. 2013-08-20 23:31:33 +01:00
André Cruz
b272a61eac Merge branch 'master' of github.com:bower/bower 2013-08-20 22:58:06 +01:00
André Cruz
4ed5f278f8 Ignore remote tags. 2013-08-20 22:57:42 +01:00
André Cruz
6a16850960 Merge pull request #805 from tschaub/shallow-failure
Try without shallow clone if fatal error
2013-08-20 13:50:35 -07:00
André Cruz
78bbf1f04f Bump version. 2013-08-20 21:48:55 +01:00
André Cruz
52938202bd Fix target not being added if source does not look like a source. 2013-08-20 21:48:26 +01:00
Tim Schaub
0eac8bb96e Try without shallow clone if fatal error
$ git --version
    git version 1.7.12.4

    $ git clone https://code.google.com/p/closure-library -b master --progress . --depth 1
    Cloning into '.'...
    fatal: expected shallow/unshallow, got Error: internal server error
2013-08-20 12:43:01 -04:00
André Cruz
46ae1e759c Improve non-interactive shell error message. 2013-08-20 09:26:01 +01:00
André Cruz
e0c1308c2a Update deps. 2013-08-20 01:04:26 +01:00
André Cruz
0f29818030 Bump version. 2013-08-20 01:03:01 +01:00
André Cruz
dd39a25dd0 Update deps. 2013-08-20 01:02:39 +01:00
André Cruz
430dc04b09 Add another missing default value for confirm prompt. 2013-08-20 00:53:10 +01:00
André Cruz
39209f3bda Standardise prompting behaviour between standard/json renderers. 2013-08-20 00:51:01 +01:00
André Cruz
0eaa43c05d Missing default answer for the "Looks good?" question. 2013-08-20 00:50:21 +01:00
André Cruz
6ed4be9135 Merge branch 'master' of github.com:bower/logger 2013-08-20 00:42:32 +01:00
André Cruz
02b6a21276 Bump version. 2013-08-20 00:42:17 +01:00
André Cruz
794ca573b8 Trim answers automatically. 2013-08-20 00:41:15 +01:00
André Cruz
5eadd36107 Merge branch 'master' of github.com:bower/bower 2013-08-19 19:38:42 +01:00
André Cruz
c6a370309d Project install now accepts decomposed endpoints instead of endpoints. 2013-08-19 19:38:30 +01:00
André Cruz
13e2514830 Simplify. 2013-08-19 19:26:44 +01:00
André Cruz
0b8be97fb5 Typo. 2013-08-19 19:24:11 +01:00
André Cruz
c327dcb255 Bump version. 2013-08-19 19:22:44 +01:00
André Cruz
1b505cc0e6 Fix maxSatisfying throwing on invalid versions, fixes #800 2013-08-19 19:20:29 +01:00
André Cruz
032f771996 Simplify. 2013-08-19 09:01:45 +01:00
André Cruz
35d83d2306 Merge branch 'master' of github.com:bower/bower 2013-08-19 09:01:30 +01:00
André Cruz
dd23feb5ea Simplify. 2013-08-19 09:01:20 +01:00
André Cruz
e21d7bd000 Another typo. 2013-08-19 08:53:08 +01:00
André Cruz
d18cfa7b59 Typo. 2013-08-19 08:52:30 +01:00
André Cruz
eca956cf80 Bump version. 2013-08-19 08:39:17 +01:00
André Cruz
587cc5acdd Typo in changelog. 2013-08-19 01:55:17 +01:00
André Cruz
b5e9a4c191 Update change log. 2013-08-19 01:53:22 +01:00
Andre Cruz
3ced03ca7f Unnecessary var. 2013-08-19 01:18:37 +01:00
Andre Cruz
9fa08fee99 Close GH-797: Decoupled prompting from the inner architecture.. Fixes #645 2013-08-19 01:16:19 +01:00
Andre Cruz
3dfd7a9ab1 Bump version. 2013-08-19 00:57:39 +01:00
Andre Cruz
1713e5e2eb Minor improvement in argv.config parsing. 2013-08-19 00:57:30 +01:00
Andre Cruz
1d7342573b Bump version. 2013-08-19 00:43:41 +01:00
Andre Cruz
64fc295ecc Add prompt(). 2013-08-19 00:43:17 +01:00
Andre Cruz
12baabcc89 Improve error logs on the json renderer. 2013-08-18 19:45:55 +01:00
Andre Cruz
13839e9384 Normalize paths on windows only if --paths. 2013-08-18 18:37:20 +01:00
Andre Cruz
6b6dc8311a Bump version. 2013-08-18 17:29:00 +01:00
Andre Cruz
b1d8c3c1e3 Interactive is now set to auto (null). 2013-08-18 17:28:35 +01:00
Andre Cruz
d42a564de8 Small tweaks to util/semver. 2013-08-18 13:16:35 +01:00
Andre Cruz
71d083a552 Use graceful-fs. 2013-08-18 13:15:12 +01:00
Andre Cruz
cf802c368d Unnecessary check. 2013-08-18 13:14:49 +01:00
Andre Cruz
71037cb482 Bump version. 2013-08-18 13:08:43 +01:00
Andre Cruz
1f4e5cadd2 Generate a fake user instead of using 'unknown'. 2013-08-18 13:08:15 +01:00
Andre Cruz
72e6e61970 Close GH-795: Ignore file symlinks when reading project, fixes #791 and #783.. Fixes #791, Fixes #783 2013-08-17 22:39:59 +01:00
André Cruz
4402b80ec9 Close GH-794: Fallback to standard git clone if download/untar fails . 2013-08-17 22:37:03 +01:00
Andre Cruz
3f0dbef7ea Minor change to util/readJson (consistency). 2013-08-17 14:01:01 +01:00
Andre Cruz
1ee8abf098 Fix tests in windows. 2013-08-17 13:49:04 +01:00
Andre Cruz
55eb1e2290 Only check for difference sources if _originalSource is set. 2013-08-17 13:17:49 +01:00
André Cruz
906990d9b5 Close GH-789: Install dependencies that have different sources, fixes #788.. Fixes #788 2013-08-17 11:50:39 +01:00
Trask Stalnaker
518f3d2a8f Close GH-773: Order tags by semver build metadata. Fixes #0, Fixes #0, Fixes #0, Fixes #0, Fixes #0, Fixes #0, Fixes #0, Fixes #0 2013-08-17 11:39:51 +01:00
Andre Cruz
6ba6ea0084 Prevent deferred from being resolved because of a failed request. 2013-08-17 11:09:58 +01:00
André Cruz
01c499d73f Update bower-config 0.4.0 that suffixes the tmp dir with "user/bower". 2013-08-16 09:44:58 +01:00
André Cruz
0de9cc82f6 Bump version. 2013-08-16 09:43:39 +01:00
André Cruz
7dba46df9b Temp folder is now suffixed with the user and "bower". 2013-08-16 09:30:40 +01:00
André Cruz
7621a71359 Merge pull request #756 from bower/meaningful-proxy-error
Add additional message for proxy users about https//.insteadOf git://, fixes #250.
2013-08-16 01:19:05 -07:00
André Cruz
17f72f0ae2 Merge branch 'master' of github.com:bower/bower into meaningful-proxy-error 2013-08-16 09:13:59 +01:00
André Cruz
47094ef046 Merge pull request #790 from mokkabonna/main-string-split
, is a valid character in a path, just wrap in array if string
2013-08-16 01:11:37 -07:00
Martin Hansen
6e28e79b29 , is a valid character in a path, just wrap in array if string 2013-08-16 09:33:27 +02:00
André Cruz
463b258409 Forgot to decorate flattened tree with additional keys. 2013-08-15 22:43:55 +01:00
André Cruz
49d4c96ddf Fix list command when there is a missing dependency. 2013-08-15 22:42:41 +01:00
André Cruz
197d3e9d36 Merge pull request #786 from bower/git-semver-branch
Match against a branch even if it's a semver version/range that does not exist, fixes #771.
2013-08-15 01:08:42 -07:00
André Cruz
adcc368238 Close GH-784: Several main files are outputted as an array with --paths, fixes #781.. Fixes #781 2013-08-15 09:05:44 +01:00
André Cruz
eff97c4d28 Match against a branch even if it's a semver version/range that does not exist, fixes #771. 2013-08-15 01:14:54 +01:00
André Cruz
d2aeed7a0c Enable relative by default when used with --paths, fixes #785. 2013-08-15 00:55:33 +01:00
André Cruz
9cb09feb65 Bump version. 2013-08-14 09:10:24 +01:00
André Cruz
fb084fa4cd Cast buffer to string. 2013-08-14 09:10:08 +01:00
André Cruz
846b8fb57e Bump version 2013-08-14 08:36:54 +01:00
Salehen Shovon Rahman
cb649830a0 Close GH-7: Empty .bowerrc files should not throw an error.. 2013-08-14 08:35:00 +01:00
Sindre Sorhus
bf4266c2e3 Merge pull request #770 from matthewmichihara/patch-1
Remove bash language identifier from README
2013-08-13 00:35:54 -07:00
Matthew Michihara
814a0f9016 Remove bash language identifier from README
It's messing up the generated project page `http://bower.io/`.
2013-08-12 22:12:35 -07:00
André Cruz
098753520f Use the latest tag as the version by default for the init command.
Also fix some bugs.
2013-08-12 21:25:34 +01:00
André Cruz
43ae12f63b Merge pull request #754 from bower/link-meaningful-error
Try to create a junction when a regular symlink fails, fixes #472
2013-08-12 06:34:52 -07:00
André Cruz
46937bbb87 Remove check. 2013-08-12 08:44:29 +01:00
André Cruz
5bf0c768f7 Merge branch 'master' of github.com:bower/bower 2013-08-12 00:33:21 +01:00
André Cruz
f124fd4c23 Parse array items correctly in bower init. 2013-08-12 00:33:01 +01:00
André Cruz
ff49d24743 Add @MrDHat to the contributors. 2013-08-12 00:14:52 +01:00
André Cruz
99ca255aad Tweaks to PR #763.
#693.
2013-08-12 00:11:03 +01:00
André Cruz
d1a63b6fe0 Merge pull request #763 from MrDHat/improve-init
Improve init. Fixes #693
2013-08-11 15:53:17 -07:00
MrDHat
3530a33fe7 Improve init. Fixes #693 2013-08-12 04:18:46 +05:30
André Cruz
d08efcfe3c Fix wrong tests. 2013-08-11 20:57:35 +01:00
André Cruz
337c0f2d0a Refactor GitHub url matching to a static function on the GitHubResolver. 2013-08-11 20:53:28 +01:00
André Cruz
1acf4a53d3 Minor cache clean fix related to last PR. 2013-08-11 20:52:42 +01:00
André Cruz
a2b0fb7d82 Create the empty dir if not yet created. 2013-08-11 19:09:23 +01:00
André Cruz
088c488e2d CS. 2013-08-11 18:44:53 +01:00
André Cruz
64ef934a3c Increase timeouts slightly of two tests. 2013-08-11 18:43:29 +01:00
André Cruz
39b690e96a Add missing tests. 2013-08-11 18:32:26 +01:00
André Cruz
08fc86698d Use an empty folder for git templates, fixes #761.
This is to prevent user template/hooks from being run.
2013-08-11 18:30:33 +01:00
André Cruz
89510f40d3 Bump version. 2013-08-11 18:24:25 +01:00
André Cruz
9f2207eb1f Change git folder to empty (was not being used anyway). 2013-08-11 18:24:13 +01:00
André Cruz
7bacf8c425 Close GH-762: Support semver targets in cache clean command, fixes #688.. Fixes #688 2013-08-11 18:12:18 +01:00
André Cruz
896672c4f4 Print empty strings in bower info. 2013-08-11 18:08:22 +01:00
André Cruz
a6552d7d54 Merge branch 'master' of github.com:bower/bower 2013-08-11 15:18:10 +01:00
André Cruz
cacef7b316 Better var name. 2013-08-11 15:18:00 +01:00
André Cruz
7a8642db94 Merge pull request #755 from bower/win-paths-normalize
Normalise windows paths, closes #279.
2013-08-11 06:49:37 -07:00
André Cruz
2b8e0fdf06 Upgrade to bower-json@0.4.0 that ignores component(1) files, closes #556. 2013-08-11 14:48:57 +01:00
André Cruz
dfb18b305d Bump version. 2013-08-11 14:46:33 +01:00
André Cruz
1606395546 Close GH-12: Ignore component(1) files.. 2013-08-11 14:45:55 +01:00
André Cruz
abe4264a13 Close GH-760: Info command now shows the latest version package meta always, fixes #759. 2013-08-11 14:44:58 +01:00
André Cruz
60d9bfb2b8 Try junctions on windows before erroring out. 2013-08-11 10:05:40 +01:00
André Cruz
9141b3020f Add additional message for proxy users about https//.insteadOf git://, fixes #250. 2013-08-10 23:46:26 +01:00
André Cruz
367c3c3e95 Fix host not correctly being set. 2013-08-10 23:36:48 +01:00
André Cruz
41a3903ac9 Fix typo. 2013-08-10 23:31:39 +01:00
André Cruz
146d6ac538 Normalise windows paths, closes #279. 2013-08-10 21:59:24 +01:00
André Cruz
fce93e16ae Close GH-726: Add relative option to the list command, closes #714.. 2013-08-10 21:43:04 +01:00
André Cruz
fb12fc03bf Add meaningful error when executing bower link on windows when user is not elevated.
#472
2013-08-10 21:37:13 +01:00
André Cruz
9c49b097c8 Bump version. 2013-08-10 16:07:53 +01:00
André Cruz
524e83fca4 Update change log. 2013-08-10 16:07:44 +01:00
André Cruz
f5999e84a2 Add missing test. 2013-08-10 15:45:24 +01:00
André Cruz
ee2640bc43 Close GH-747: Do not use --depth=1 if the server does not support it, fixes #744. 2013-08-10 15:43:54 +01:00
Sindre Sorhus
2b93aa000c Simplify 9c4b30b65c 2013-08-08 21:01:30 +02:00
André Cruz
9c4b30b65c Fix chalk usage on the info command. 2013-08-08 14:17:49 +01:00
André Cruz
160dc5c470 Bump version. 2013-08-08 14:07:10 +01:00
André Cruz
bbe2896de2 Update change log. 2013-08-08 14:05:44 +01:00
André Cruz
673f641283 Merge pull request #741 from bower/replace-colors
Replace `colors` with `chalk`
2013-08-07 17:12:25 -07:00
André Cruz
36d8d308f2 Merge pull request #742 from wilkinson/master
Fixed a grammar error
2013-08-07 17:10:21 -07:00
Sean Wilkinson
3482dd2a6b Fixed a grammar error 2013-08-07 18:44:59 -05:00
Keith Gibbs
9cee8b7b78 Close GH-732: Use https:// protocol instead of git:// when a proxy is set. 2013-08-08 00:36:32 +01:00
Sindre Sorhus
4ae1b5e04d Replace colors with chalk
colors.js has serious deficiencies like extending String.prototype which can cause all kinds of problems. Two modules using colors.js can conflict with each others, and it infects imported child modules. It's also better to explicit.

[chalk](https://github.com/sindresorhus/chalk)
2013-08-07 22:06:47 +02:00
Keith Gibbs
a34c8dc502 Close GH-724: Fix for GitHubResolver to use https instead of http for tarball archives. 2013-08-07 14:02:50 +01:00
André Cruz
b42c1ddbbc Merge pull request #736 from bower/symlink-no-follow
Do not follow symlinks, closes #730.
2013-08-07 01:12:02 -07:00
Keith Gibbs
9cc4860050 Close GH-739: Improve GitHub detection in resolverFactory.js. 2013-08-07 08:57:44 +01:00
André Cruz
58921f7422 Improve resolver factory tests and add some failing test cases. 2013-08-07 08:56:40 +01:00
André Cruz
8dbd79d49b Bump version. 2013-08-07 08:29:40 +01:00
André Cruz
e2c67fa25a Use a known user agent by default when a proxy. 2013-08-07 08:28:50 +01:00
André Cruz
f332de8ba9 Do not follow symlinks, closes #730. 2013-08-07 01:50:49 +01:00
André Cruz
8dce9a6f66 Merge pull request #735 from ifo/install-save-shorthand-fix
Fix install save shorthand
2013-08-06 16:41:35 -07:00
Steve McCarthy
1c616115b9 Fix install save shorthand 2013-08-06 19:34:36 -04:00
André Cruz
a97375552f Fix detection of org/repo on ssh URLs.
This was affecting the home command.
2013-08-07 00:08:04 +01:00
André Cruz
1cf99d757a Merge pull request #728 from dbashford/allow-cache-clean-with-no-args
allowing cache.clean to be called with no args
2013-08-06 05:27:39 -07:00
david.bashford
e84e94a8d1 allowing cache.clean to be called with no args 2013-08-06 08:12:32 -04:00
André Cruz
cf85177c7f DRY. 2013-08-06 09:12:13 +01:00
André Cruz
2b334774ce Improve extract message on non-wide terminals 2013-08-06 01:22:54 +01:00
André Cruz
bc4a0f448b Bump version. 2013-08-06 00:02:54 +01:00
André Cruz
14ef86456f Typo. 2013-08-06 00:02:31 +01:00
André Cruz
b083422321 Bump reps. 2013-08-05 23:43:22 +01:00
André Cruz
12efc85baf Bump version. 2013-08-05 23:40:52 +01:00
André Cruz
68124dfdbe Bum version. 2013-08-05 23:39:15 +01:00
André Cruz
ee4158e90b Append the username when using the temporary folder. 2013-08-05 23:38:19 +01:00
André Cruz
0b3b7efccf Minor improvement. 2013-08-05 23:36:11 +01:00
André Cruz
b282d02a77 Fix jshint error. 2013-08-05 22:59:01 +01:00
André Cruz
e07c813320 Merge pull request #722 from wibblymat/reject-on-spawn-error
Reject the promise for a command if an error event is fired
2013-08-05 14:53:44 -07:00
André Cruz
b76a00b6fe Merge pull request #721 from wibblymat/preserve-env
Keep original environment variables intact in asset creation script
2013-08-05 14:53:31 -07:00
Sindre Sorhus
77e077d658 Merge pull request #723 from wibblymat/jshint-fixes
Fixed JSHint errors so that it can be turned on in Travis
2013-08-05 13:05:44 -07:00
Mat Scales
1cec48c065 Fixed JSHint errors so that it can be turned on in Travis 2013-08-05 22:03:12 +02:00
Mat Scales
30fa7f5a7f Keep original environment variables intact in asset creation script 2013-08-05 20:57:05 +02:00
Mat Scales
83edff6b26 Reject the promise for a command if an error event is fired 2013-08-05 20:53:26 +02:00
david.bashford
fd58a5fe06 Close GH-717: add flag to log for force latest. Fixes #715 2013-08-05 14:25:26 +01:00
André Cruz
6064269936 Bump version. 2013-08-05 14:22:51 +01:00
André Cruz
d0929896cf Update README. 2013-08-05 14:22:41 +01:00
André Cruz
990e87de1f Tweaks to the last PR. 2013-08-05 14:16:53 +01:00
Nick Heiner
8da47dcd00 Close GH-10: Find .bower.json if it exists. 2013-08-05 14:10:57 +01:00
André Cruz
15957bc9ac Close GH-716: Add initial packages script that allows creating of packages usable for tests. 2013-08-04 20:41:42 +01:00
André Cruz
59f87bdffe Merge branch 'master' of github.com:bower/bower 2013-08-04 01:30:12 +01:00
André Cruz
ee31e93f98 Fix link in README. 2013-08-04 01:23:27 +01:00
André Cruz
d3f3d17536 Minor typo in the changelog. 2013-08-03 17:37:29 +01:00
André Cruz
88c1045180 Bump version. 2013-08-03 17:30:19 +01:00
André Cruz
2c06feb6a1 Close GH-712: Changelog. 2013-08-03 17:29:13 +01:00
André Cruz
5b4fb961af Merge pull request #709 from bower/several-improv
Several improvements and fixes
2013-08-03 08:10:28 -07:00
André Cruz
3995ec0ff7 Remove tests temp dirs. 2013-08-03 15:02:38 +01:00
André Cruz
d2144905db Improve no-json warning. 2013-08-03 14:38:21 +01:00
André Cruz
b29c9c28fa Typo. 2013-08-03 14:24:24 +01:00
André Cruz
aa2e68d1ad Update reps. 2013-08-03 13:00:23 +01:00
André Cruz
85b2ec93c8 Small note. 2013-08-03 12:50:48 +01:00
André Cruz
c63d88d987 Bump version. 2013-08-03 12:44:18 +01:00
André Cruz
c21bde192b Fix failing test. 2013-08-03 12:44:07 +01:00
André Cruz
39f1f8aff5 Improve retry error messages.
Also fixed "undefined" being printed as the url.
2013-08-03 12:38:21 +01:00
André Cruz
3f8fcbf4e3 Always save endpoints specified with --save and --save-dev.
Even if the installed ones were different (user choose a different one on conflict).
2013-08-03 10:05:59 +01:00
André Cruz
24cabf19af Close GH-705: Refactor download to util and added retry logic in it.. Fixes #704, Fixes #699, Fixes #700 2013-08-02 23:09:31 +01:00
André Cruz
ae04f71e55 Uninstall now deletes uninstalled packages dependencies if they are non-shared, fixes #609. 2013-08-02 22:09:12 +01:00
André Cruz
c56f0db891 Prune now recursively prunes until no more extraneous are found, fixes #708.
This is necessary because a pruned package may contain packages that become also extraneous.
Related with #609.
2013-08-02 22:08:59 +01:00
André Cruz
ebf2765f2f Adapt list command to the new tree. 2013-08-02 22:08:41 +01:00
André Cruz
8dac95d86d Do not declared linked packages as dependencies in the init command. 2013-08-02 22:08:33 +01:00
André Cruz
6125c0423f Make installed dependencies without --save and --save-dev being recognised as root dependencies.
They continue to be labeled as extraneous but will be part of the tree.
This fixes #602 and cuts the way to implement #603.
This also fixes an issue with --save and --save-dev possibly saving more than it should.
2013-08-02 22:08:23 +01:00
André Cruz
f3d1638131 Fix bug where child dependency relationship would not be set correctly. 2013-08-02 22:08:14 +01:00
André Cruz
8b699c58ae Bump rc version. 2013-08-02 21:12:54 +01:00
André Cruz
743a97c784 Merge branch 'master' of github.com:bower/config 2013-08-02 21:10:39 +01:00
André Cruz
ea7ae5698a Do not set undefined values in array. 2013-08-02 21:10:31 +01:00
André Cruz
3ed9b3ec39 Fix default values being mutated. 2013-08-02 21:10:10 +01:00
André Cruz
e8f3e3b88a Set timeout default value to 30sec. 2013-08-02 21:09:54 +01:00
André Cruz
82d16fbfde Change timeout to 30sec. 2013-08-02 08:25:35 +01:00
André Cruz
73c2e885e9 Fix PR #690. 2013-08-01 23:30:40 +01:00
Nick Heiner
2e615e7570 Close GH-690: Adding syntax highlighting to bower info. Fixes #571 2013-08-01 23:15:11 +01:00
Sindre Sorhus
d0f90546f3 Merge pull request #703 from ReactiveRaven/patch-1
fixing syntax error in help-info.json
2013-08-01 10:56:05 -07:00
David Godfrey
22091cf272 fixing syntax error in help-info.json 2013-08-01 17:12:17 +01:00
André Cruz
f2f3fa4c9c Merge branch 'master' of github.com:bower/bower 2013-07-31 21:55:06 +01:00
André Cruz
0ab2ce9cf6 Add ls as an alias to the list command. 2013-07-31 21:54:52 +01:00
André Cruz
1b1424fe2f Merge pull request #687 from bower/cache-clean
Fix cache clean not working correctly when a package + non-server was specified.
2013-07-31 12:50:41 -07:00
André Cruz
ee31c44ff1 Merge pull request #692 from bower/noop-completion
Implement noop completion, fixes #691.
2013-07-31 12:47:58 -07:00
André Cruz
e64af6b11b Merge pull request #695 from MrDHat/private-field
Added private field support Fixes #162
2013-07-31 12:47:23 -07:00
MrDHat
d6045931a5 Added private field support Fixes #162 2013-07-31 20:54:47 +05:30
André Cruz
9f99d5d42a Fix save not working on uninstall. 2013-07-30 22:57:55 +01:00
André Cruz
327703871b Implement noop completion, fixes #691. 2013-07-30 21:48:14 +01:00
André Cruz
b456f71b64 Fix cache clean not working correctly when a package + non-server was specified. 2013-07-30 09:07:51 +01:00
André Cruz
9576b8a8e9 Use endpoint parser for consistency. 2013-07-30 09:04:17 +01:00
André Cruz
e0037c7eaf Merge pull request #686 from bower/info-fix-684
Fix info not showing up bower.json when a property was requested without a version, closes #684.
2013-07-30 00:58:15 -07:00
André Cruz
59c5caa395 Do not create a json file when saving to it is required, warn instead. 2013-07-30 08:49:33 +01:00
André Cruz
e4a35594ba Add component.json to ignore. 2013-07-30 08:37:56 +01:00
André Cruz
5f44d1f2cf Bump version. 2013-07-30 08:36:30 +01:00
André Cruz
489c6f6730 Update change log. 2013-07-30 08:36:06 +01:00
André Cruz
c66afdf434 Merge branch 'master' of github.com:bower/bower 2013-07-30 08:30:36 +01:00
André Cruz
d62f5142cc Fix json file not being set when reading json, closes #686. 2013-07-30 08:30:17 +01:00
André Cruz
5d4007918c Fix info not showing up bower.json when a property was requested without a version, closes #684. 2013-07-30 08:20:00 +01:00
André Cruz
5b49b5c535 Update CHANGELOG.md 2013-07-30 00:20:39 +01:00
André Cruz
7bd19e39a7 Bump version. 2013-07-30 00:18:05 +01:00
André Cruz
5037aed3ae Update change log. 2013-07-30 00:17:48 +01:00
André Cruz
c00bacb790 Merge branches 'master' and 'master' of github.com:bower/bower 2013-07-30 00:16:02 +01:00
André Cruz
5672019203 Urgent fix for a badly resolved conflict. 2013-07-30 00:15:33 +01:00
André Cruz
7cb5da9971 Some typos. 2013-07-30 00:03:00 +01:00
André Cruz
62672bc4c8 Bump to 1.0.1. 2013-07-29 23:58:31 +01:00
André Cruz
705d62be18 Close GH-681: Update changelog.. 2013-07-29 23:47:25 +01:00
André Cruz
d237522e8c Close GH-679: Prevent renaming of bower.json/component.json to index.json, fixes #674.. 2013-07-29 23:41:55 +01:00
André Cruz
44308fa026 Bump deps version. 2013-07-29 23:16:16 +01:00
André Cruz
766dcd0dd5 Bump version. 2013-07-29 23:14:27 +01:00
André Cruz
87302d6d86 Merge pull request #3 from bower/trim
Add trim to everything.
2013-07-29 15:11:07 -07:00
Nick Heiner
aae19206a0 Close GH-647: Adding registry url to register confirmation message. Fixes #639 2013-07-29 23:06:31 +01:00
André Cruz
212c4c3a71 Close GH-667: Filter symlinks when copying/extracting. Fixes #665 2013-07-29 22:00:37 +01:00
André Cruz
e1a443177e Close GH-675: Upgrade to the new bower-json api.. Fixes #668 2013-07-29 21:57:35 +01:00
André Cruz
1210ea821a Close GH-669: Interpret as local files only if the path is absolute or relative, closes #666. 2013-07-29 21:44:04 +01:00
André Cruz
9721381383 Merge pull request #676 from Siyfion/patch-1
Made it clearer that it was the `json` property that was deprectated not...
2013-07-29 11:47:14 -07:00
Simon Mansfield
5ea9a1d715 Made it clearer that it was the json property that was deprectated not the entire file 2013-07-29 16:31:11 +01:00
André Cruz
83f00d720e Unnecessary if. 2013-07-29 09:25:12 +01:00
André Cruz
ee76fe584e Add linked reps as resolved to prevent them for being overwritten in common usages, #593. 2013-07-29 09:05:53 +01:00
André Cruz
063453b744 Do not add linked packages as targets, #659. 2013-07-29 00:43:20 +01:00
André Cruz
05b94d1d15 Add more tests and fix stuff. 2013-07-28 18:54:04 +01:00
André Cruz
ed0c93aec3 Add trim to everything. 2013-07-28 18:21:24 +01:00
André Cruz
3a0cb8b35c Tweaks to PR #672. 2013-07-28 17:17:42 +01:00
Hemanth.HM
f0ed7f22db Close GH-672: Fix for #670. 2013-07-28 17:14:24 +01:00
André Cruz
ac91f07d22 Set debug logs to grey. 2013-07-28 16:43:34 +01:00
André Cruz
d5a7a691a2 Restore incompatible dependencies. 2013-07-28 14:00:07 +01:00
André Cruz
229b23b350 Walk tree no longer walks through linked deps, #659. 2013-07-28 13:58:54 +01:00
André Cruz
18ee9518ec Appropriate target for linked packages, #659. 2013-07-28 13:56:17 +01:00
André Cruz
43e0328722 Do not install linked deps, #659. 2013-07-28 13:55:41 +01:00
Max Waterman
12cf93ddd8 Close GH-659: fix issue#658 list not working with linked packages. 2013-07-28 10:55:43 +01:00
André Cruz
03b4467173 Update deps. 2013-07-28 03:20:46 +01:00
André Cruz
45a5ac28f2 Oops. 2013-07-28 03:18:45 +01:00
André Cruz
635eec013c CS. 2013-07-28 03:14:44 +01:00
André Cruz
679b9217e0 Update reps. 2013-07-28 03:08:56 +01:00
André Cruz
39f3571383 Minor tweaks to last PR. 2013-07-28 03:05:16 +01:00
André Cruz
f027cc6a3e Bump version. 2013-07-28 03:03:56 +01:00
André Cruz
634ce6829a Use bower-config to normalise the config object. 2013-07-28 03:03:39 +01:00
André Cruz
64b5f9af78 Bump to 0.2.0 rc1. 2013-07-28 02:58:08 +01:00
André Cruz
9269fcb8a7 Add normalisation, fixes #5.
Refactor a lot of code.
2013-07-28 02:57:24 +01:00
MrDHat
571b34c990 Close GH-671: Disable use of sudo. Fixes #498. 2013-07-28 02:36:24 +01:00
André Cruz
f0d29cb755 Bump to 0.1.0. 2013-07-27 22:30:51 +01:00
André Cruz
897e0f1ba6 Bump to 0.1.0. 2013-07-27 22:28:56 +01:00
André Cruz
4cfa94d304 Bump to 0.2.0. 2013-07-27 22:26:17 +01:00
André Cruz
5e2abb8a33 Add .file property to errors throw in read(). 2013-07-27 22:21:21 +01:00
Sven Lito
0dc5052e36 Close GH-9: adds grunt. 2013-07-27 20:44:16 +01:00
Sven Lito
774ad1e2ff remove inline jshint rule
this setting is covered by local node:true setting
2013-07-27 20:43:33 +01:00
Sven Lito
52e91cc309 Merge pull request #8 from bower/better-api
Changes to the api.
2013-07-27 12:09:12 -07:00
André Cruz
38fb72ece9 Use fstream stack for more meaningful stack traces. 2013-07-27 19:23:23 +01:00
André Cruz
fcbefa218b Fix bug when trying bower on the root folder. 2013-07-27 16:05:53 +01:00
André Cruz
c06b9d696e Close GH-664: Fix for some windows users. Fixes #626 2013-07-27 15:21:14 +01:00
André Cruz
d3e6274939 Remove unused var. 2013-07-27 11:25:38 +01:00
Sven Lito
ec904eb8a4 adds list tests [#4] 2013-07-26 16:02:42 +01:00
André Cruz
68c5e996d6 Add non bc note for map and sources. 2013-07-26 08:21:53 +01:00
André Cruz
95a09c5463 Fix README typos as suggested. 2013-07-25 23:31:33 +01:00
André Cruz
125fb598d5 Adjust README to the api changes. 2013-07-25 22:19:09 +01:00
André Cruz
f8c13f939c Changes to the api.
- Read now accepts directories and finds the bower json to read inside
- Add normalise and validate methods
- Add options to the parse and read methods to enable/disable normalisation and validation.
2013-07-25 22:06:42 +01:00
André Cruz
e55e08339a Fix list command not processing main with multiple files, closes #660. 2013-07-25 22:00:17 +01:00
Blain Smith
ec86260eb5 Test .tar.gz archives with/without extension and with/witout proper mime-type 2013-07-24 09:12:27 +01:00
André Cruz
adee5cec2b Improve can extract function. 2013-07-24 09:12:20 +01:00
André Cruz
c846b24ebb Bump rc. 2013-07-24 09:00:53 +01:00
Sven Lito
85324d9109 Merge pull request #3 from bower/lookup-bug
Fix lookup and list bug for multiple registries.
2013-07-24 00:10:36 -07:00
André Cruz
10b410d46f Fix multiple registries in the list method. 2013-07-23 23:20:56 +01:00
André Cruz
c87fe7c265 Fix lookup bug for multiple registries.
Improve and fix tests.
2013-07-23 22:56:17 +01:00
André Cruz
ce0984573b Fix tests. 2013-07-23 22:55:00 +01:00
André Cruz
b38c3a5035 Add missing dep. 2013-07-23 22:51:24 +01:00
André Cruz
15dca65bd1 Set timeout to 60sec. 2013-07-23 22:50:40 +01:00
André Cruz
e1aa43147d Minor tweaks. 2013-07-23 22:49:58 +01:00
André Cruz
057b18e4be Bump to 0.1.0 2013-07-23 21:01:51 +01:00
André Cruz
d4f2ced6a3 Add paths tests, simply with regexp. 2013-07-23 21:01:30 +01:00
André Cruz
0b6c92fcd2 Merge pull request #2 from redking/master
Endpoints with backslashes should be recognized as sources
2013-07-23 12:57:27 -07:00
Sven Lito
4491e71ee2 Merge pull request #2 from neoziro/fix-registry-search
Fix search in multiple registries
2013-07-23 09:07:23 -07:00
Greg Bergé
d09f78801c fix search in multiple registries 2013-07-23 18:00:21 +02:00
Cormac Flynn
f26ea32897 Endpoints with backslashes should be recognized as sources 2013-07-23 15:41:22 +02:00
André Cruz
6b7f6aee22 Merge pull request #649 from kud/master
Add notes for zsh users.
2013-07-23 06:06:33 -07:00
Erwann Mest
514fd0730c Add notes for zsh users. 2013-07-23 14:55:43 +02:00
André Cruz
854596fb04 Fix programmatic usage example. 2013-07-23 08:58:08 +01:00
André Cruz
cf6b8f752b Everyone should to a bower cache clean. 2013-07-23 02:34:08 +01:00
André Cruz
702f36be0d Move wiki doc to the top. 2013-07-23 02:20:42 +01:00
André Cruz
c738bc1e96 Do not show success message if register was aborted. 2013-07-23 01:02:04 +01:00
André Cruz
6c1c13ed11 Remove unused arg. 2013-07-23 00:52:51 +01:00
André Cruz
d1b39cce2b Typo & remove bolds. 2013-07-23 00:21:18 +01:00
André Cruz
5e67622374 Minor changelog improvements. 2013-07-23 00:19:54 +01:00
André Cruz
90e95bbd76 Bump to 1.0.0! 2013-07-23 00:12:10 +01:00
André Cruz
6deaacadea Update travis link. 2013-07-23 00:11:50 +01:00
André Cruz
2ae4003f7d Update change log. 2013-07-23 00:06:39 +01:00
André Cruz
dd951d5350 Use pid for temporary folders, fixes #638. 2013-07-22 23:47:38 +01:00
André Cruz
c86d0230ba Simplify. 2013-07-22 23:41:43 +01:00
Mat Scales
79345691b8 Close GH-642: Init command.. 2013-07-22 23:40:09 +01:00
André Cruz
2763cf37f7 Made saveJson public. 2013-07-22 22:52:38 +01:00
André Cruz
66cfe050e0 Remove annoying warn of extraneous packages. 2013-07-22 22:52:06 +01:00
André Cruz
e6b1595cde Signal HTTP protocol errors with EHTTP. 2013-07-22 14:00:55 +01:00
André Cruz
3b376a3d3d Move homepage guess logic to the appropriate resolver. 2013-07-22 13:57:39 +01:00
André Cruz
5ed04d97dd Add new lines to update notice. 2013-07-22 13:55:44 +01:00
André Cruz
1e724af838 Get response status errors when using request. 2013-07-22 08:39:03 +01:00
André Cruz
aec00821e5 Forgot <options>. 2013-07-21 23:38:13 +01:00
André Cruz
bf1542c35b Typo in contributor profile. 2013-07-21 23:34:54 +01:00
André Cruz
5a6d27cc19 Bump rc. 2013-07-21 23:18:57 +01:00
Sindre Sorhus
2d83abbb85 Close GH-635: Infer package name if inside a package for the home cmd. 2013-07-21 23:14:19 +01:00
André Cruz
a9afa42f52 Fix no-json warn on empty projects. 2013-07-21 19:42:16 +01:00
André Cruz
a37f1c5dcb CS. 2013-07-21 16:36:27 +01:00
André Cruz
ecac2bd084 Use some of the getters in the list and register commands. 2013-07-21 16:35:29 +01:00
André Cruz
01aec3760c Add test for the package repository getters. 2013-07-21 16:35:12 +01:00
André Cruz
33cac4832f Package repository already clears the registry client cache. 2013-07-21 16:33:54 +01:00
André Cruz
41b246903f Add some getter for inner parts of the architecture. 2013-07-21 16:33:25 +01:00
André Cruz
4148e0c7a9 Typo. 2013-07-21 15:00:27 +01:00
André Cruz
729bdd9c68 Home as wide command. 2013-07-21 14:51:22 +01:00
André Cruz
1f2d8d6340 Add optional param to getJson. 2013-07-21 14:41:09 +01:00
André Cruz
de3cf327d4 Typo in home usage. 2013-07-21 14:25:42 +01:00
André Cruz
fa3da880ea Improve home and info help usage. 2013-07-21 12:35:28 +01:00
André Cruz
5dea57ddd5 Add prune and home commands to the help, some other help tweaks. 2013-07-21 12:29:47 +01:00
André Cruz
caa59cbb62 Change home help slightly. 2013-07-21 12:17:04 +01:00
André Cruz
51e32f72de Rename open command to home, #630. 2013-07-21 12:06:58 +01:00
André Cruz
32089aefce Merge branch 'master' of github.com:bower/bower 2013-07-21 12:04:37 +01:00
André Cruz
048bc53bd0 Add open command, closes #630. 2013-07-21 12:04:18 +01:00
André Cruz
69e1d04638 Fix typo. 2013-07-21 10:35:58 +01:00
André Cruz
de4c7a04c3 Update README.md 2013-07-21 10:31:58 +01:00
André Cruz
2c79181c05 Add force-latest also for the update command. 2013-07-20 23:27:00 +01:00
André Cruz
5b37ec0de5 Bump rc. 2013-07-20 23:19:34 +01:00
André Cruz
86dbea7ddb Update reps. 2013-07-20 23:18:09 +01:00
André Cruz
c49e7e181b Update reps. 2013-07-20 23:13:18 +01:00
André Cruz
b0dbbc51df Use debug instead of info. 2013-07-20 23:13:05 +01:00
André Cruz
91779a67fb Pass logger to the registry client, get rid of unnecessary emitter in commands. 2013-07-20 22:08:30 +01:00
André Cruz
1fe6cde934 Fix progress options. 2013-07-20 22:07:54 +01:00
André Cruz
3b8d00095e Fix accessing options. 2013-07-20 22:07:23 +01:00
André Cruz
4221ddbb35 Bump rc. 2013-07-20 22:06:34 +01:00
André Cruz
eeb0c22d90 Integrate logger. 2013-07-20 22:05:36 +01:00
André Cruz
eb801e66ae Remove replay from register. 2013-07-20 22:05:07 +01:00
André Cruz
3fdf639bb4 Typo. 2013-07-20 21:30:44 +01:00
André Cruz
4061ef65e4 Add retry information as debug messages. 2013-07-20 20:45:25 +01:00
André Cruz
0cf8af00b3 Separate logger into its own module. 2013-07-20 20:37:05 +01:00
André Cruz
4d0d4ca6ea README typos. 2013-07-20 20:22:30 +01:00
André Cruz
56cdae67c3 Document log levels 2013-07-20 20:21:00 +01:00
André Cruz
b50017cad4 Initial commit. 2013-07-20 20:18:39 +01:00
André Cruz
62c616f197 Use http agent and introduce replay of http errors on network failure. 2013-07-20 19:52:38 +01:00
André Cruz
fcfeda9f39 Fix code responsible for reusing already resolved endpoints. 2013-07-20 19:52:03 +01:00
André Cruz
c85c38cde3 Bump rc version. 2013-07-20 19:49:41 +01:00
André Cruz
f606eda18d Add replay to requests. 2013-07-20 19:49:13 +01:00
André Cruz
08c9e2dde3 CS. 2013-07-20 19:48:42 +01:00
André Cruz
dd965e03c5 Bump rc version. 2013-07-19 13:49:21 +01:00
André Cruz
3e3f5faacc Fix dependants not being correctly set in some edge cases. 2013-07-19 13:45:49 +01:00
André Cruz
7e41cd0d32 Increase mocha timeout slightly. 2013-07-18 19:43:21 +01:00
André Cruz
882bf7b020 Bump rc version. 2013-07-18 19:31:52 +01:00
André Cruz
da4e70bc60 Merge branch 'master' of github.com:bower/endpoint-parser 2013-07-18 19:31:02 +01:00
André Cruz
f75f720c8a Merge branch 'master' of github.com:bower/registry-client 2013-07-18 19:30:44 +01:00
André Cruz
8d3aff5ff1 Update editorconfig. 2013-07-18 19:30:27 +01:00
André Cruz
4e8c9078f7 Update editorconfig. 2013-07-18 19:30:13 +01:00
André Cruz
41e4efcf1f Merge branch 'master' of github.com:bower/config 2013-07-18 19:29:38 +01:00
André Cruz
f55e6138a5 Remove git config. 2013-07-18 19:29:30 +01:00
André Cruz
147e24d835 Update editorconfig. 2013-07-18 19:29:22 +01:00
André Cruz
4a94858ed1 Update editorconfig. 2013-07-18 19:29:11 +01:00
André Cruz
e1d77e12b9 Remote TODO. 2013-07-18 19:28:52 +01:00
André Cruz
8e51d1eaf3 Add force-latest option, closes #629. 2013-07-18 18:34:04 +01:00
André Cruz
738835088b Merge branch 'master' of github.com:bower/bower 2013-07-18 18:32:58 +01:00
André Cruz
823b287eda Convert GitHub urls when registering, closes #627. 2013-07-18 18:32:45 +01:00
André Cruz
a2c195e844 Update editor config. 2013-07-18 18:30:09 +01:00
André Cruz
5a5503ab34 Add git requirement, closes #628. 2013-07-18 11:59:12 +01:00
André Cruz
6e037a4d46 Improve test for #474. 2013-07-18 08:40:04 +01:00
André Cruz
14597f74f4 Bump to rc. 2013-07-18 08:21:54 +01:00
André Cruz
fabf2479ec CS. 2013-07-18 08:21:28 +01:00
André Cruz
12c90bae04 Another README typo. 2013-07-18 08:13:10 +01:00
André Cruz
37904db9cd Merge branch 'master' of github.com:bower/bower 2013-07-18 01:10:43 +01:00
André Cruz
499d9da75f Add test for PR #474. 2013-07-18 01:10:29 +01:00
Nicolas Gallagher
198d612b87 Minor README adjustments
Includes fixing the `npm install` command now that the rewrite is part
of `master`.
2013-07-17 11:39:02 -07:00
André Cruz
e7667ba34b Fix install of multiple endpoints not working right. 2013-07-17 19:08:41 +01:00
André Cruz
861ef7313b Merge pull request #625 from bower/task/merge-rewrite-into-master
Merge rewrite into master.

![lol](http://media.tumblr.com/8b05d06a91d3c28947a10233dafd3873/tumblr_inline_mpl4f8zuy61qz4rgp.gif)
2013-07-17 10:41:42 -07:00
Nicolas Gallagher
0291ffb951 Reintroduce the CHANGELOG 2013-07-16 15:09:59 -07:00
Nicolas Gallagher
93a7f9f3b8 Merge branch 'rewrite' into task/merge-rewrite-into-master 2013-07-16 15:05:23 -07:00
Nicolas Gallagher
62337e34a3 CLEAN SLATE: reset working tree 2013-07-16 15:04:41 -07:00
André Cruz
a24b70de75 Merge pull request #607 from mente/branch-q
remove useless -q option for commit validation to lower git requirements
2013-07-16 14:56:51 -07:00
André Cruz
6f7f10b2f7 Update README.md 2013-07-16 20:03:16 +01:00
André Cruz
bd7579fa65 Use timeout from the config. 2013-07-16 19:53:50 +01:00
André Cruz
430a2ea2f6 Bump rc. 2013-07-16 19:52:46 +01:00
André Cruz
87569617ae Add spec link. 2013-07-16 19:52:32 +01:00
André Cruz
b17beaccf1 Add timeout config. 2013-07-16 19:52:24 +01:00
Sven Lito
cddba64151 call next instead of done 2013-07-16 16:10:07 +01:00
André Cruz
ed3a18529a CS. 2013-07-16 14:14:26 +01:00
André Cruz
06bffb9cee Add new line when saving json. 2013-07-16 13:39:43 +01:00
André Cruz
a6e4ff83f0 Bump alpha version. 2013-07-16 09:30:06 +01:00
André Cruz
a73025d20b Fix wrong tests. 2013-07-16 09:28:45 +01:00
André Cruz
0085ebb756 Add tests for isTargetable. 2013-07-16 09:27:28 +01:00
André Cruz
5d5f23cddc Oops. 2013-07-16 09:26:48 +01:00
André Cruz
761c947e25 Add isTargetable to prevent UrlResolver and FsResolver from being converted to semver when installing, #619. 2013-07-16 09:21:02 +01:00
André Cruz
ec33766803 Switch endpoint parser to its own module. 2013-07-16 09:17:50 +01:00
André Cruz
6daf891c5c Fix manager bug in some edge cases. 2013-07-16 09:16:25 +01:00
André Cruz
9b04553fc8 Improve logger implementation. 2013-07-16 09:15:32 +01:00
André Cruz
a006bfeb24 Fix git@ endpoints not being interpreted as sources. 2013-07-16 07:09:20 +01:00
André Cruz
71e1a8666d Add tests and made some changes. 2013-07-15 22:29:23 +01:00
André Cruz
820c7e660a Fix accessing undefined in some edge cases. 2013-07-15 19:50:08 +01:00
André Cruz
e94cb6a4b6 Use the filename first, fallback to mime type afterwards, fixes #619. 2013-07-15 19:50:02 +01:00
André Cruz
16e7872a82 Typo. 2013-07-15 00:42:47 +01:00
André Cruz
aa4ebb07f8 Fix title. 2013-07-15 00:36:56 +01:00
André Cruz
4366d6a8c7 Fix test script, wtf! 2013-07-15 00:35:59 +01:00
André Cruz
aa76d49234 Improve README. 2013-07-15 00:34:38 +01:00
André Cruz
d9df06644e Initial commit. 2013-07-15 00:30:44 +01:00
André Cruz
554ee01263 Force camelCase. 2013-07-15 00:30:27 +01:00
André Cruz
b3055067d8 Force camelCase. 2013-07-15 00:30:18 +01:00
André Cruz
7f997d4b59 Force camelCase. 2013-07-15 00:30:08 +01:00
André Cruz
07717b2d08 Doc typo. 2013-07-14 21:48:35 +01:00
André Cruz
7d2162b2d2 Fix order of events/interceptors. 2013-07-14 21:46:17 +01:00
André Cruz
d15fa0cfb3 Upgrade deps. 2013-07-14 17:22:07 +01:00
André Cruz
d2d959f455 Upgrade deps. 2013-07-14 17:21:45 +01:00
André Cruz
a9e497f878 Upgrade deps. 2013-07-14 17:21:29 +01:00
André Cruz
e423e9ffba Upgrade deps. 2013-07-14 17:21:17 +01:00
André Cruz
3b8b52d222 Do not restore extraneous devDependencies, minor fix to restore tree. 2013-07-14 16:13:25 +01:00
André Cruz
b9514692fe GitHub resolver should move contents when extracting. 2013-07-14 15:37:00 +01:00
André Cruz
73592f76ba Bump alpha version. 2013-07-14 15:23:29 +01:00
André Cruz
47f0f1fab8 Add one more test to github resolver to increase coverage. 2013-07-14 14:38:17 +01:00
André Cruz
bb3a5620d3 Add tests for github resolver. 2013-07-14 14:22:38 +01:00
André Cruz
268a1475f0 Add new test for the resolver factory related with failing when a package is not found in the registry. 2013-07-14 13:38:59 +01:00
André Cruz
a46dad9fde Complete logger tests. 2013-07-14 13:31:09 +01:00
André Cruz
3f7bf15cdb Add progress tests to be done later. 2013-07-14 12:00:07 +01:00
André Cruz
ed9f883301 Keep structure of the downloaded archive. 2013-07-14 11:59:51 +01:00
André Cruz
2386d46609 Decrease the progress delay to 8sec. 2013-07-14 11:47:11 +01:00
André Cruz
0da1dbdc14 Implement progress when downloading from URLs. 2013-07-14 11:32:14 +01:00
André Cruz
dba635aac5 Throttle progress when cloning. 2013-07-14 11:31:51 +01:00
André Cruz
e1ca49c082 Update README. 2013-07-14 08:51:33 +01:00
André Cruz
a47d5f4f12 Implemented missing test. 2013-07-14 08:50:27 +01:00
André Cruz
e809133c25 Complete some pending tests. 2013-07-13 23:47:50 +01:00
André Cruz
4e39979852 Add constructor test for the package repository. 2013-07-13 23:28:02 +01:00
André Cruz
ff99fae928 Bump rc version. 2013-07-13 23:07:19 +01:00
André Cruz
2e0353c725 Complete resolve cache tests. 2013-07-13 23:03:40 +01:00
André Cruz
3c9983ca12 Merge branch 'master' of github.com:bower/registry-client 2013-07-13 22:35:48 +01:00
André Cruz
d3412e7de6 Stupid typos, I was drunk when I did that. 2013-07-13 22:35:23 +01:00
André Cruz
908fa55674 Fix wrong test, add a few more. 2013-07-13 22:23:43 +01:00
André Cruz
4a26332133 Implemented a few more tests for the package repository. 2013-07-13 22:17:43 +01:00
André Cruz
6c17c5a3a2 Also call registry client methods related to eliminate, clear and reset. 2013-07-13 22:17:20 +01:00
André Cruz
1e6f54f055 Add missing proxyquire dep. 2013-07-13 21:46:39 +01:00
André Cruz
59da873adf Initial take on the package repository tests. 2013-07-13 21:42:38 +01:00
André Cruz
fb4b1827db Minor tests tweak. 2013-07-13 21:42:24 +01:00
André Cruz
2e2263ed58 CS. 2013-07-13 21:42:00 +01:00
André Cruz
ac18199295 Add minor test in the resolver factory tests. 2013-07-13 21:41:44 +01:00
André Cruz
4a954853f2 Fix minor order issue in resolve cache list. 2013-07-13 14:06:32 +01:00
André Cruz
1973f1a1de Bump alpha version. 2013-07-13 13:04:58 +01:00
André Cruz
d36a448aff Test constructor and improve test coverage. 2013-07-13 12:54:30 +01:00
André Cruz
29aa481d2d Implement list tests for the resolve cache.
Tweak existent tests.
2013-07-13 12:10:35 +01:00
André Cruz
5c276c34ea Delete lurking files. 2013-07-13 12:09:31 +01:00
André Cruz
1d2b654021 Fix resolve cache not creating the directory after clearing it. 2013-07-13 10:36:52 +01:00
André Cruz
bdfb0bb14f Add reset tests for the resolve cache. 2013-07-13 10:12:37 +01:00
André Cruz
6eeb03f159 Fix node 0.8 failure. 2013-07-13 10:05:22 +01:00
André Cruz
f806416b84 Add clear tests to the resolve cache.
Improved existent tests.
2013-07-13 10:00:24 +01:00
André Cruz
7e64e60625 Add eliminate tests to the resolve cache. 2013-07-13 09:40:42 +01:00
André Cruz
a44d4bccc2 Refactor some code, minor fixes. 2013-07-13 09:40:11 +01:00
André Cruz
b8c3e95068 Add retrieve tests for the resolve cache. 2013-07-12 18:27:42 +01:00
André Cruz
85e55f3be2 Add versions tests for the resolver cache. 2013-07-12 17:39:24 +01:00
André Cruz
eaee9e0e49 Implemented missing test. 2013-07-12 16:45:15 +01:00
André Cruz
e232c42fc5 Rename Logger.js to logger.js 2013-07-12 16:29:08 +01:00
André Cruz
c7c043c898 Add initial resolve cache tests. 2013-07-12 16:23:26 +01:00
André Cruz
57b718ff32 CS. 2013-07-12 16:23:04 +01:00
André Cruz
f2775c18a1 Fix tests due tag change. 2013-07-12 16:22:53 +01:00
André Cruz
d1001aea1a Use bower-json throughout the code. 2013-07-12 16:22:10 +01:00
André Cruz
39e33f3538 Force camelCase. 2013-07-12 15:34:19 +01:00
André Cruz
a786fa534a Refactor md5 to its own function. 2013-07-12 15:34:05 +01:00
André Cruz
2a0831ab5a Simplify some compatible detection logic. 2013-07-12 15:33:43 +01:00
André Cruz
c6b61b0838 Fix incompatible being set on non-semver versions. 2013-07-12 15:21:51 +01:00
André Cruz
e73e480939 Made areCompatible protected. 2013-07-11 20:39:15 +01:00
André Cruz
e5d53b4964 Typo. 2013-07-11 20:03:51 +01:00
André Cruz
1521fde0bd Update consuming package section. 2013-07-11 19:44:44 +01:00
André Cruz
eee0e81e6b Update README to be compatible with the current state of the rewrite. 2013-07-11 19:27:34 +01:00
Sven Lito
c7be3d73b9 Close GH-611: Istanbul code coverage. 2013-07-11 19:15:49 +01:00
André Cruz
8574d50eaa Do not read json from rc. 2013-07-11 19:06:57 +01:00
Sven Lito
2841942899 more cache related tests 2013-07-11 10:33:47 +01:00
André Cruz
eb33c9ec81 Bump alpha version. 2013-07-11 07:57:46 +01:00
André Cruz
56679d2a8e Fix passing configuration into commands on programmatic usage, fixes #608. 2013-07-11 07:56:53 +01:00
André Cruz
415e79b523 Bump rc version. 2013-07-10 20:39:30 +01:00
André Cruz
9a6fdaa42b Do not remove invalid files, throw instead. 2013-07-10 20:39:02 +01:00
André Cruz
ff54168a10 Update ignore. 2013-07-10 20:21:33 +01:00
André Cruz
b2acd5fa75 Bump alpha version. 2013-07-10 20:11:53 +01:00
André Cruz
33d0f1fd94 Fix bug introduced when name is coerced to the registry name. 2013-07-10 20:11:19 +01:00
André Cruz
bb4f09316a Oops, typos related with fix for #605. 2013-07-10 20:09:57 +01:00
Alex Vasilenko
b5976dc2ff remove useless -q option for commit validation to lower git requirements 2013-07-10 22:00:07 +03:00
André Cruz
47824ec1ac Typp. 2013-07-10 19:55:08 +01:00
André Cruz
9223b089b1 Merge branch 'rewrite' of github.com:bower/bower into rewrite 2013-07-10 19:53:22 +01:00
André Cruz
6da9a1285c CS. 2013-07-10 19:52:29 +01:00
André Cruz
3b90e24ff8 Copy/remove when rename fails do because of EXDEV, fixes #605. 2013-07-10 19:51:54 +01:00
Sindre Sorhus
93da60c03b Merge pull request #606 from eddiemonge/patch-2
Default install directory
2013-07-10 11:31:01 -07:00
Eddie Monge Jr.
a3e501a355 Default install directory
The default directory is now bower_components
2013-07-10 11:19:29 -07:00
Sven Lito
0cdbe998cb [tests] adds cache test 2013-07-10 17:14:24 +01:00
Sven Lito
35b0c49da5 clarify cache docs 2013-07-10 15:46:52 +01:00
Sven Lito
d43c9f006b fix module references 2013-07-10 15:01:18 +01:00
Sven Lito
01a6ae61d2 replace chai with expect.js 2013-07-10 14:53:48 +01:00
Sven Lito
a25d9e7aa7 Update README.md 2013-07-10 14:41:00 +01:00
Sven Lito
440020726f [tests] basic logger tests 2013-07-10 14:37:10 +01:00
Sven Lito
36ad643a5f [tests] fix typo 2013-07-10 14:36:55 +01:00
Sven Lito
2b6800f01b [help] fix typo 2013-07-10 09:13:56 +01:00
Marco Oliveira
b7cb3ee89f Update README.md 2013-07-10 09:05:25 +01:00
André Cruz
c9490b9ef8 Update README. 2013-07-10 08:58:13 +01:00
André Cruz
87210a3c15 Merge pull request #531 from wibblymat/issue-506
Fixes #506. Work correctly with local git repositories.
2013-07-10 00:31:55 -07:00
André Cruz
a314d33dea Improve resolver factory tests. 2013-07-10 07:41:01 +01:00
André Cruz
4c305b7532 Bump alpha version. 2013-07-10 07:22:58 +01:00
André Cruz
19cd6a1bdf Only use GitHub resolver for public endpoints, fixes #603. 2013-07-10 07:21:56 +01:00
André Cruz
dbd276dd9c Remote empty line. 2013-07-10 00:01:01 +01:00
André Cruz
28913e3a72 Remove private. 2013-07-09 23:59:32 +01:00
André Cruz
d0465eccf1 CS. 2013-07-09 23:57:15 +01:00
André Cruz
3aedec3e2d Add init command (not yet implemented). 2013-07-09 23:56:45 +01:00
André Cruz
f931d60ac1 Do not add new lines to .std files. 2013-07-09 23:51:21 +01:00
André Cruz
4b4b233377 Bump rc version. 2013-07-09 23:38:15 +01:00
André Cruz
ccc9907034 Change from bower_new to bower. 2013-07-09 23:36:15 +01:00
André Cruz
7c8146128e bower_new to bower. 2013-07-09 21:04:09 +01:00
André Cruz
6c506ba556 Remove NOTES. 2013-07-09 21:02:58 +01:00
André Cruz
5a7baa0a3b Import README and CONTRIBUTING. 2013-07-09 21:02:41 +01:00
André Cruz
26520abe2b Merge branch 'master' of github.com:bower/json 2013-07-09 21:02:08 +01:00
André Cruz
1397c3248d Bump rc version. 2013-07-09 21:01:53 +01:00
André Cruz
c40dc39b88 Merge branch 'master' of github.com:bower/registry-client 2013-07-09 21:01:33 +01:00
André Cruz
a2753bb27d Bump rc version. 2013-07-09 21:01:19 +01:00
André Cruz
1c5529691b Bump rc version. 2013-07-09 21:00:58 +01:00
André Cruz
8e5bdc6b2b BC change. 2013-07-09 21:00:39 +01:00
André Cruz
c5342e4a15 Update package.json. 2013-07-09 21:00:13 +01:00
André Cruz
47a1cce5fa Fix GitHub resolver not trimming .git in the repo name. 2013-07-09 20:42:52 +01:00
André Cruz
ef60fcb9ec Check archive size before extracting, caught invalid archives. 2013-07-09 20:41:54 +01:00
André Cruz
b45a1bd913 Fix usage of trim. 2013-07-09 20:41:23 +01:00
André Cruz
9a8a0932d0 Merge pull request #595 from bower/semver-fix
Change semver usage after module upgrade, fixes #583.
2013-07-09 05:17:38 -07:00
André Cruz
ccd06ee534 Remove diagram. 2013-07-09 13:15:18 +01:00
André Cruz
5f5e33027a Update NOTES.md. 2013-07-09 13:15:05 +01:00
André Cruz
3fbdfa1583 Merge branch 'rewrite' of github.com:bower/bower into rewrite 2013-07-09 13:14:36 +01:00
André Cruz
624bc1de56 Improve install command help and fix some typos. 2013-07-09 13:14:25 +01:00
André Cruz
597100d108 Remove unnecessary stuff. 2013-07-09 13:13:43 +01:00
André Cruz
418f97dbba Minor tweaks to the resolver factory. 2013-07-09 13:13:22 +01:00
André Cruz
6a38671e3c Add name validation to the register command. 2013-07-09 13:13:03 +01:00
André Cruz
4f8542c133 Merge pull request #600 from davidmaxwaterman/readme-fixes
Fix trivial typos in README.md.
2013-07-09 00:31:29 -07:00
Max Waterman
0f2d49b2d6 Fix trivial typos in README.md. 2013-07-09 07:50:04 +01:00
André Cruz
39324d6b55 Merge pull request #6 from btford/master
Fix typos.
2013-07-08 11:18:57 -07:00
Brian Ford
b1ad187d1b Fix typos. 2013-07-08 11:12:40 -07:00
Sven Lito
606f15fec5 [tests] basic offline check 2013-07-08 14:23:55 +01:00
André Cruz
34a2f1ad65 Add insightful message after registering. 2013-07-07 17:43:16 +01:00
André Cruz
ce20fb535d Oops, typo. 2013-07-07 17:26:48 +01:00
André Cruz
bfe8323753 Add small note. 2013-07-07 11:33:43 +01:00
André Cruz
f2b86ad3ed Add specialised GitHub resolver, closes #597. 2013-07-07 10:22:58 +01:00
André Cruz
42b498654b N/A if there's no error stack. 2013-07-07 10:17:58 +01:00
André Cruz
888a4e1c0e Better sentence. 2013-07-07 03:01:04 +01:00
André Cruz
09a0eb26d1 Improve sentence. 2013-07-07 03:00:18 +01:00
André Cruz
bf9e8048ff Sort deps. 2013-07-07 02:51:55 +01:00
André Cruz
1c6d2864b6 Sort deps. 2013-07-07 02:51:32 +01:00
André Cruz
21ebc226e4 Sort deps. 2013-07-07 02:51:04 +01:00
André Cruz
8e3fef9096 Sort deps. 2013-07-07 02:50:47 +01:00
André Cruz
829dccc1b6 Bump rc version. 2013-07-07 02:38:53 +01:00
André Cruz
a65caa62b3 Add name validation. 2013-07-07 02:38:43 +01:00
André Cruz
ddb6f9c5b4 Merge branch 'master' of github.com:bower/config 2013-07-07 02:26:18 +01:00
André Cruz
e152ab6cf2 Use our own rc implementation. 2013-07-07 02:26:06 +01:00
André Cruz
4085af023a Typo. 2013-07-07 02:25:13 +01:00
André Cruz
686e401368 Add del. 2013-07-07 02:24:54 +01:00
André Cruz
8ec079945a Enable interactive even with --json. 2013-07-06 22:46:57 +01:00
André Cruz
4d8dbefc85 Use the new bower-config module. 2013-07-06 22:46:28 +01:00
André Cruz
746c05081d Add editor config. 2013-07-06 22:45:46 +01:00
André Cruz
2fdfa64b13 Typo. 2013-07-06 22:42:16 +01:00
André Cruz
f406cfcebb Change from toJson to toObject. 2013-07-06 22:40:37 +01:00
André Cruz
80f35725e6 Require relatively. 2013-07-06 22:31:05 +01:00
André Cruz
6741d99681 Fix rc version and update mocha. 2013-07-06 21:56:53 +01:00
André Cruz
ad4ec14778 Add editor config. 2013-07-06 21:55:53 +01:00
André Cruz
2bf16ad88b Fix rc name and update mocha. 2013-07-06 21:55:43 +01:00
André Cruz
6c56581c15 Typo. 2013-07-06 21:55:16 +01:00
André Cruz
ce89d9fbe0 Initial commit. 2013-07-06 21:53:04 +01:00
André Cruz
9517191e35 Improve clear of runtime cache. 2013-07-06 14:56:13 +01:00
André Cruz
e298f74310 Improve sentence. 2013-07-06 14:55:43 +01:00
André Cruz
c550c1373e Merge branch 'master' of github.com:bower/registry-client 2013-07-06 14:39:33 +01:00
André Cruz
6a1bb88c3b Update README. 2013-07-06 14:39:24 +01:00
André Cruz
a585e96fdf Improve clear runtime cache. 2013-07-06 14:39:13 +01:00
Sven Lito
e78ef493a1 [tests] don't test for private methods 2013-07-06 14:28:25 +01:00
André Cruz
c139378694 Add comment. 2013-07-06 14:09:11 +01:00
André Cruz
e51827bfcd Add ability to clear runtime cache for long-lived programs to call. 2013-07-06 13:56:54 +01:00
André Cruz
d0eb3e760f Bump rc version. 2013-07-06 13:55:59 +01:00
André Cruz
9cfa3e5002 Changes to the reset & clear runtime cache.
Minor tweak to the grunt file.
2013-07-06 13:48:53 +01:00
André Cruz
bb76621b7f Add origin to progress messages for compact terminals. 2013-07-06 12:59:56 +01:00
André Cruz
c6746f6f77 Minor fix to a previous commit. 2013-07-06 12:59:34 +01:00
André Cruz
714d453aa0 Change semver usage after module upgrade, fixes #583. 2013-07-06 12:09:54 +01:00
André Cruz
915c8d7afa Detect old versions of git that do not support --b tag when cloning. 2013-07-06 11:59:00 +01:00
André Cruz
1bf51a047e Fix bug when cleaning the cache of specific packages. 2013-07-06 11:28:08 +01:00
André Cruz
a7b2fe14b9 Fix some minor issues with * endpoints and prevent some semver errors due to module upgrade. 2013-07-06 10:29:50 +01:00
Sven Lito
82278037ec [tests] adds comments and clearCache tests 2013-07-05 13:08:42 +01:00
Sven Lito
0b592f86d0 [tests] tidy up nock call 2013-07-05 12:50:25 +01:00
Sven Lito
ee4e003c2d [tests] fix method call 2013-07-05 12:50:08 +01:00
Sven Lito
b2904bc6fb [tests] mock search endpoint 2013-07-05 12:36:36 +01:00
Sven Lito
67b94cf52e sets nock as npm dependency 2013-07-05 11:53:08 +01:00
Sven Lito
c308d2c9dd adds nock fixture 2013-07-05 11:51:28 +01:00
Sven Lito
e36370b080 removes fixtures 2013-07-05 11:51:15 +01:00
Sven Lito
d0f005a6f1 adjust fixtures path 2013-07-05 10:54:51 +01:00
Sven Lito
a461fa9137 move fixture 2013-07-05 10:54:39 +01:00
Sven Lito
22e969fb59 fix npm module name
meh..
2013-07-05 10:52:25 +01:00
Sven Lito
34527c8395 [tests] fix breaking test 2013-07-05 10:49:53 +01:00
Sven Lito
012f4d68bc [wip] update tests 2013-07-05 10:46:48 +01:00
André Cruz
da8d0f3265 Typos. 2013-07-05 08:23:28 +01:00
André Cruz
9b57d18143 Small improv. 2013-07-05 08:19:05 +01:00
André Cruz
9f0ac51e06 Use a more tolerant regexp when splitting lines. 2013-07-05 08:18:38 +01:00
André Cruz
74b9e51cf7 CS. 2013-07-05 01:52:13 +01:00
André Cruz
ec4d8d7f9c Oops, fix prune help usage. 2013-07-05 01:51:14 +01:00
André Cruz
011a19772d Fix really weird bug that caused local packages to be installed. 2013-07-05 01:46:52 +01:00
André Cruz
d8cef76592 Added prune command, closes #463. 2013-07-05 01:20:28 +01:00
André Cruz
856b0f4469 Merge pull request #587 from wibblymat/issue-583
Make bower do the same with '*' using semver 2 as it used to
2013-07-04 16:51:08 -07:00
André Cruz
ca76d41f9a Report progress for remote git resolvers that take too long to clone. 2013-07-04 23:58:35 +01:00
André Cruz
f7ba6e1121 Minor improvement to the elect suitable. 2013-07-04 23:27:10 +01:00
André Cruz
df19dbc0de Minor bug. 2013-07-04 23:16:39 +01:00
André Cruz
3b3e64e752 Implement removal of invalid links in the cache clean command. 2013-07-04 23:09:24 +01:00
Sven Lito
724283433a adds lookup method tests 2013-07-04 15:55:10 +01:00
Sven Lito
aea19b93b1 rename client -> registry
because that's what it is right?
2013-07-04 15:11:44 +01:00
Sven Lito
73020a711d tweaking docs 2013-07-04 15:00:15 +01:00
Sven Lito
7e62e671e3 updates testrunner 2013-07-04 14:51:29 +01:00
Sven Lito
2e845ac0ab adds createError tests 2013-07-04 14:51:17 +01:00
Sven Lito
2df41e52ed adds Cache tests 2013-07-04 14:51:09 +01:00
Sven Lito
bf8e93f581 adds search tests 2013-07-04 14:51:03 +01:00
Sven Lito
f5eec3283c adds register tests 2013-07-04 14:50:54 +01:00
Sven Lito
223161c7d6 adds list tests 2013-07-04 14:50:47 +01:00
Sven Lito
b8ba6e4827 adds index tests 2013-07-04 14:50:39 +01:00
Sven Lito
15c8259ac2 adds lookup tests 2013-07-04 14:50:32 +01:00
Sven Lito
720492932f update Client.js tests 2013-07-04 10:40:36 +01:00
Sven Lito
a08a0fb084 add tests to jshint 2013-07-04 10:40:21 +01:00
Sven Lito
827fbaac1f update jshint settings 2013-07-04 10:40:03 +01:00
Mat Scales
0de3175775 Make bower do the same with '*' using semver 2 as it used to (Closes #583) 2013-07-03 23:41:13 +01:00
André Cruz
008b807803 Fix json endpoints parsing in some edge cases. 2013-07-03 16:26:03 +01:00
André Cruz
08b53410b4 Add console.trace back again to complement errors. 2013-07-03 16:25:32 +01:00
André Cruz
ce06b2cb18 Fix accessing prop if undefined. 2013-07-03 16:25:04 +01:00
André Cruz
d4d5a04487 Fix bug with the cache clean command. 2013-07-03 16:22:43 +01:00
André Cruz
297224bd31 Merge branch 'master' of github.com:bower/registry-client 2013-07-03 16:20:38 +01:00
André Cruz
9dc835c60c Bump rc version. 2013-07-03 16:18:50 +01:00
André Cruz
67a96bc2f3 Typo ignoring ENOENT errors. 2013-07-03 16:18:22 +01:00
André Cruz
92d98c8d59 Show latest versions always. 2013-07-03 14:41:20 +01:00
André Cruz
7becb19da4 Implement check of newer versions in the list command.
Also:
- Fix some errors not being emitted when a command failed.
- Update semver module; no need to check .valid against null.
2013-07-03 14:37:28 +01:00
André Cruz
deee654426 Forgot to inherit static methods. 2013-07-03 14:31:41 +01:00
André Cruz
552fd52bd5 Fix parallel usage of .versions in the git resolver. 2013-07-03 14:31:15 +01:00
André Cruz
f58fb3e556 Doc typo. 2013-07-03 14:29:57 +01:00
Sven Lito
ff5bf16111 fix file reference 2013-07-02 23:33:52 +01:00
Sven Lito
8d22059462 adds grunt travis setup 2013-07-02 23:26:07 +01:00
Sven Lito
91d144f5f7 Merge branch 'master' of https://github.com/bower/registry-client 2013-07-02 22:51:50 +01:00
Sven Lito
c894b1d335 adds grunt and test runner setup 2013-07-02 22:51:43 +01:00
Sven Lito
d30a7bf6a1 adds .editorconfig 2013-07-02 22:50:26 +01:00
André Cruz
7f18cbf7d5 Typo. 2013-07-02 20:25:36 +01:00
André Cruz
e7741b3d1f Add bower_components to ignore. 2013-07-02 20:24:08 +01:00
André Cruz
9d26cd787a Bump version. 2013-07-02 20:18:12 +01:00
André Cruz
561bc42259 Show stack trace if errors comes from node. 2013-07-02 13:29:10 +01:00
André Cruz
649d5f56c9 Minor doc typo. 2013-07-02 09:41:17 +01:00
André Cruz
3e4ca5ceb9 Fix json to decomposed endpoint transformation. 2013-07-01 23:49:18 +01:00
André Cruz
81b53112c1 Implement command abbreviations. 2013-07-01 20:41:20 +01:00
André Cruz
fe1a635c14 Switch to graceful-fs. 2013-07-01 20:31:28 +01:00
André Cruz
521e6033a2 Improve conflict sentence. 2013-07-01 20:30:03 +01:00
André Cruz
36b033c2f7 Switch to graceful-fs. 2013-07-01 20:28:37 +01:00
André Cruz
dc9bce915b Switch to graceful-fs. 2013-07-01 20:28:11 +01:00
André Cruz
37a0e733ad Minor doc typo. 2013-06-29 01:16:58 +01:00
André Cruz
b3005eeec7 Merge branch 'rewrite' of github.com:bower/bower into rewrite 2013-06-28 23:52:49 +01:00
André Cruz
b21bfda7f6 Expose link command functions. 2013-06-28 23:52:40 +01:00
André Cruz
a2f9662a99 Wrong doc placement. 2013-06-28 23:50:03 +01:00
André Cruz
274254b12e Move to wiki. 2013-06-28 23:25:27 +01:00
André Cruz
087e17511c Oops. 2013-06-28 23:19:34 +01:00
André Cruz
139e868cce Improve sentence. 2013-06-28 23:14:36 +01:00
André Cruz
b6ec84e94d CS. 2013-06-28 23:12:10 +01:00
André Cruz
2b09392261 Update notes and add state of the rewrite. 2013-06-28 23:06:40 +01:00
André Cruz
2132384736 Add small note. 2013-06-28 23:05:43 +01:00
André Cruz
8798f467e1 Fix incompatibles filtering. 2013-06-28 23:04:50 +01:00
André Cruz
c9a7cfafd0 Bump rc version! 2013-06-28 21:59:56 +01:00
André Cruz
9d9585ecba Ignore ENOENT erros when deleting from the cache. 2013-06-28 21:59:24 +01:00
André Cruz
3204bcb7a0 Oops, typo. 2013-06-28 07:37:21 +01:00
André Cruz
645a5206ec Fix error caused by the recent semver upgrade. 2013-06-28 00:10:05 +01:00
André Cruz
28baf4de5e Use err.stack, integrates better with Q. 2013-06-27 23:42:57 +01:00
André Cruz
04ddcd9489 Remove useless log. 2013-06-27 23:42:18 +01:00
André Cruz
a82f392cac Fix uninstall always giving conflict, even if the only dependant is the root package. 2013-06-27 23:41:50 +01:00
André Cruz
15d308864c Fixed --save and --save-dev on named endpoints. 2013-06-25 23:08:47 +01:00
André Cruz
9af3a0d725 Read only dependencies of deep dependencies (not dev dependencies). 2013-06-25 22:43:50 +01:00
André Cruz
d2494fb97d Allow latest targets, map to '*'- 2013-06-25 22:25:48 +01:00
André Cruz
c32ef61d3a Fix dev dependencies not being fetched. 2013-06-25 22:25:22 +01:00
André Cruz
6020d06038 Move root flag to a more appropriate place. 2013-06-25 21:19:46 +01:00
André Cruz
b2b1b1cb47 Do not throw err if components folder do not exist. 2013-06-25 21:08:41 +01:00
André Cruz
023a605cad Fix paths shorthand in the list command usage. 2013-06-25 21:07:57 +01:00
André Cruz
a61e31f646 Use String.prototype.trim instead of mout's one. 2013-06-25 00:26:06 +01:00
André Cruz
0361436a66 Fix extraneous packages not containing the linked flag even if they are linked. 2013-06-25 00:22:25 +01:00
André Cruz
c800670f39 Add link command help, tweak some other usage helps. 2013-06-25 00:17:56 +01:00
André Cruz
7fa42cbdd3 Fix extra keys being set even if they are undefined. 2013-06-25 00:16:06 +01:00
André Cruz
f3f39e283e Fix link command not using local name if specified. 2013-06-24 23:42:12 +01:00
André Cruz
c9e1159c42 Merge branch 'rewrite' of github.com:bower/bower into rewrite 2013-06-24 23:20:28 +01:00
André Cruz
f9f8f7aebd Implement link command.
Also:
- CS fixes
- Remove options argument from commands that do not have them
- Use console.trace instead of err.stack (more reliable)
2013-06-24 23:19:59 +01:00
André Cruz
ee3941b86a Do not prompt to confirm registration if --force is used. 2013-06-24 23:17:47 +01:00
André Cruz
f9499e4b2f Tweak info usage. 2013-06-24 23:17:09 +01:00
André Cruz
0ebd7e6a58 Small typo in README. 2013-06-24 14:51:54 +01:00
André Cruz
a100abc3b6 Bump rc version. 2013-06-24 14:48:36 +01:00
André Cruz
94f6945d5a Complete README, change cleanRuntimeCache to clearRuntimeCache. 2013-06-24 14:48:20 +01:00
Sindre Sorhus
870d57bfa5 Use single-quotes in bower info 2013-06-23 22:03:04 +02:00
André Cruz
a02f26f0eb Add register command, CS fixes. 2013-06-23 17:48:45 +01:00
André Cruz
442d771a7a Bump rc version. 2013-06-23 17:44:29 +01:00
André Cruz
242e11eefc Add register. 2013-06-23 17:43:52 +01:00
André Cruz
97edd21784 Add lookup command, minor tweaks to the info command. 2013-06-23 14:58:54 +01:00
André Cruz
2309656169 Fix tests. 2013-06-23 14:21:38 +01:00
André Cruz
22ea322fc5 Update semver to 2.0.x to deal with pre-releases and builds, fixes #188. 2013-06-23 13:56:06 +01:00
André Cruz
17f793a4bb Update semver to deal with pre-releases and builds. 2013-06-23 13:53:00 +01:00
André Cruz
2f16e17ed5 Use LRU cache for the git resolvers runtime cache. 2013-06-23 12:17:53 +01:00
André Cruz
27ae79f50d Oops. 2013-06-23 01:51:33 +01:00
André Cruz
eb18c0a505 Use stringily object when printing package meta in the info command. 2013-06-23 01:49:48 +01:00
André Cruz
103d1adc46 CS. 2013-06-23 01:28:26 +01:00
André Cruz
db661f124f Fix tests. 2013-06-23 01:20:47 +01:00
André Cruz
4c3802878a Another huge commit.
- Add info command
- Fix list --paths
- Fix search with no name
- Fix conflict detection when uninstalling
- Mix tweaks and fixes
2013-06-23 01:14:08 +01:00
André Cruz
23e560b638 Forgot to update to canonical dir in some comments/docs. 2013-06-22 17:15:06 +01:00
André Cruz
b82a2ee735 Huge commit.
- Add search command
- Cache clean now clears the registry cache
- Fix error when accessing an unknown deep command in the cli
- Change from 'roaming' to 'path' in the config
- Change from 'canonicalPackage' to 'canonicalDir'
- Fix dev dependencies of nested packages being fetched
- Ignore invalid installed packages
- Various cache fixes and improvements
- Fix .bower.json being deleted if a package specified ignorables
- Use fstream instead of ncp to solve the EMFILE errors
2013-06-22 17:06:02 +01:00
André Cruz
7fbbae8cd4 Bump (rc3). 2013-06-22 17:05:13 +01:00
André Cruz
83b6820458 Huge commit.
- Add search command
- Cache clean now clears the registry cache
- Fix error when accessing an unknown deep command in the cli
- Change from 'roaming' to 'path' in the config
- Change from 'canonicalPackage' to 'canonicalDir'
- Fix dev dependencies of nested packages being fetched
- Ignore invalid installed packages
- Various cache fixes and improvements
- Fix .bower.json being deleted if a package specified ignorables
- Use fstream instead of ncp to solve the EMFILE errors
2013-06-22 17:04:50 +01:00
André Cruz
b80d96d9c7 Fix tests. 2013-06-22 14:15:35 +01:00
André Cruz
d8e69360b9 Add search command, other fixes/changes.
- Use LRU to prevent huge memory usage when using the module in long-living programs
- Lookup no longer throws when a package is not found (null is returned instead).
- Cache mechanism improvements.
- Misc fixes.
2013-06-22 14:11:11 +01:00
André Cruz
83ae9b66a3 Add license note, misc tweaks. 2013-06-22 14:07:51 +01:00
André Cruz
3a7b4fd404 Unnecessary line. 2013-06-15 23:44:03 +01:00
André Cruz
578557f3d7 Minor tweaks. 2013-06-15 23:12:17 +01:00
André Cruz
92b7668067 Add list command, some other fixes and improvements.
- Fix cache clean command
- Lots of improvements and fixes of the Manager
- Only save json if the contents changed
- Add nom like tree to installed/updated packages
- Fix help usages.
2013-06-15 21:43:01 +01:00
André Cruz
95f9170736 Tweak cache list and clean output. 2013-06-14 11:25:19 +01:00
André Cruz
52be2230cb Improve doc blocks and minor bug fixing. 2013-06-12 23:52:29 +01:00
Sindre Sorhus
8d2cecfd5c Merge pull request #544 from bkad/patch-1
Typo in bower completion script.
2013-06-12 14:51:57 -07:00
André Cruz
4738150c55 Fix typos in README. 2013-06-12 22:40:31 +01:00
André Cruz
88b4847ba9 Remove --save-resolutions in favor of prefixing choices with !.
Also improve the manager resolution process by avoiding to fetch incompatible packages always.
Now lazy fetches them when necessary.
2013-06-12 22:34:53 +01:00
Kevin Le
667fae9442 Typo in bower completion script. 2013-06-12 14:55:35 -06:00
André Cruz
f532eb708e Small fix. 2013-06-11 19:16:43 +01:00
André Cruz
94a24b3f57 Protect against empty origins. 2013-06-11 19:16:26 +01:00
André Cruz
62fadc8200 Fix reusing of compatible dependencies. 2013-06-11 16:23:15 +01:00
André Cruz
1370625568 CS. 2013-06-11 16:21:15 +01:00
André Cruz
8eed440840 Fix error logging. 2013-06-11 16:20:53 +01:00
André Cruz
1aed2b9a43 Minor fix to sorting versions. 2013-06-11 09:02:12 +01:00
André Cruz
6ec31cc7f9 Fix cache list not displaying the correct version. 2013-06-11 08:56:31 +01:00
André Cruz
6d3b3e6de2 Add cache clean and list commands.
This was an huge commit.
- Allow nested commands
- Switch resolve cache in memory object cache to LRU
- Store non-semver packages in the cache
- Tweak help messages
- Various fixes and tweaks
2013-06-11 00:39:18 +01:00
André Cruz
10fd2b5b5a Tweak messages. 2013-06-07 18:13:56 +01:00
André Cruz
d020acca22 Fix detection of unsuitable resolutions. 2013-06-07 13:37:04 +01:00
André Cruz
e704733743 Read, use and update persistent resolutions.
Add --save-resolutions to deal with this.
Also:
  - Adjust logging when using compact
  - Minor code adjustments.
2013-06-07 13:05:07 +01:00
André Cruz
79522194f1 Inform the user when a conflict was resolved with a configured resolution. 2013-06-06 01:05:55 +01:00
André Cruz
aadc9e64d8 Update doc and add TODO. 2013-06-06 00:27:03 +01:00
André Cruz
2eea258b9b Save and use resolutions to resolve conflicts. 2013-06-06 00:12:07 +01:00
André Cruz
796e019f12 Safe default. 2013-06-06 00:10:45 +01:00
André Cruz
036bd999fd Disable config.interactive also when terminal is not a tty or --json was specified. 2013-06-05 18:51:59 +01:00
André Cruz
1fdb5373c9 Fix adjustment made to targets and improve walk tree. 2013-06-05 18:35:38 +01:00
André Cruz
0ebe5ff55a Several fixes.
- Throw an error when trying to update a package that is not installed
- Do not add duplicate packages to the resolved list
- Make conflict resolution serial instead of parallel
- Fix some dumb mistakes
2013-06-05 08:55:32 +01:00
André Cruz
ef610ab7de Sort of picks must be done by the Manager, otherwise indexes are messed up.
Little code simplification on the Project.
2013-06-05 01:13:15 +01:00
André Cruz
68454492e9 Add conflict resolve, presenting choices to the user.
This commit also contains:
- Simplified Manager and Project
- Add warning when an extraneous package is found.
- Fix a lot of bugs in the overall resolve process
- Made templates rendering synchronous
-
2013-06-05 00:50:23 +01:00
André Cruz
4593b652c4 Fix log of errors not rendering the error message/data in the JSON renderer. 2013-06-05 00:29:27 +01:00
Mat Scales
2670915583 Fixes #506. Work correctly with local git repositories. 2013-06-04 17:38:27 +01:00
Sindre Sorhus
fb41535c69 Merge pull request #527 from wibblymat/issue-488
Add tests to default ignore list (#488)
2013-06-03 15:52:32 -07:00
Mat Scales
b0890844e4 Add tests to default ignore list (#488) 2013-06-03 23:42:10 +01:00
André Cruz
8239226208 Update notes. 2013-06-03 17:07:46 +01:00
André Cruz
49be1638ba Minor tweaks. 2013-06-03 16:54:09 +01:00
André Cruz
e188047cfb Fix fail fast mechanism. 2013-06-03 16:49:40 +01:00
André Cruz
afd01cc40c Change from promise progress events to hierarchical logger.
This is an huge commit, contains other small tweaks/fixes.
2013-06-03 16:31:19 +01:00
André Cruz
ee0b620d33 Update tmp to ~0.0.20, fixing uncaught exceptions never being reported. 2013-06-03 12:36:54 +02:00
André Cruz
2d0c0d2aad Reduce nesting and fix analyse not restoring dependants properly in some cases. 2013-06-02 12:04:32 +01:00
André Cruz
e811236973 Print only the stack trace when verbose or the error has no code (usually something strange). 2013-06-02 11:49:01 +01:00
André Cruz
12078f07c6 Add a fail fast mechanism instead of rejecting the whole process on error.
This prevent clobbering registry and cache, since when the promise is rejected usually process.exit(1) is called.
2013-06-02 11:47:59 +01:00
André Cruz
c9ef3fa1d7 Allow simultaneous --save and --save-dev flag. 2013-06-01 02:14:21 +01:00
André Cruz
0a724e5a73 Simplify code. 2013-06-01 02:11:18 +01:00
André Cruz
2c9e4aacf2 Not every notification was being extended properly.
Standardise variables.
2013-06-01 02:10:58 +01:00
André Cruz
41486d44ee Tweaks. 2013-05-31 19:11:21 +01:00
André Cruz
7fb326245e Print update notice. 2013-05-31 18:17:32 +01:00
André Cruz
542645d876 Align for better readability. 2013-05-31 17:56:24 +01:00
André Cruz
9a5cf69251 Oops. 2013-05-31 17:50:52 +01:00
André Cruz
b322633e8b Order options alphabetically. 2013-05-31 17:50:10 +01:00
André Cruz
487cd384a5 Change options json structure, tweak templates. 2013-05-31 17:36:04 +01:00
André Cruz
0b0055e0e2 Add missing shorthands. 2013-05-31 16:21:24 +01:00
André Cruz
57a9b313c4 Finish the help command and help usages for the implemented commands.
Introduce templating based on handlebars.
Minor tweaks.
2013-05-31 16:18:00 +01:00
André Cruz
81e8b0eb18 Restore also extraneous so they are accounted in the uninstall command. 2013-05-30 22:38:25 +01:00
André Cruz
26da7d5e81 CS. 2013-05-30 22:32:21 +01:00
André Cruz
76b85ed554 Update rc package. 2013-05-30 22:31:52 +01:00
André Cruz
d954568f7b Merge branch 'master' of github.com:bower/bower 2013-05-30 22:26:20 +01:00
André Cruz
92a2723815 Update rc dependency version, closes #515. 2013-05-30 22:26:08 +01:00
André Cruz
4064fedf55 Fix install not resolving with the installed object. 2013-05-30 22:17:38 +01:00
André Cruz
a27ad2e353 Better doc. 2013-05-30 22:05:33 +01:00
André Cruz
13aa3914ac Wrong comment. 2013-05-30 21:59:31 +01:00
André Cruz
20ba998383 Implement the uninstall command.
Made also some tweaks to the render stuff.
2013-05-30 21:57:05 +01:00
Mat Scales
612e718b91 Merge pull request #517 from mathiasbynens/patch-1
Add newline at EOF to template for no search results
2013-05-30 06:31:38 -07:00
Mathias Bynens
cfc4fc354b Add newline at EOF to “no search results” template
This avoids the following issue: http://i.imgur.com/jVJumua.png

Closes #517.
2013-05-30 14:59:51 +02:00
André Cruz
61208817df Add types for all options. 2013-05-29 17:32:03 +01:00
Nick Heiner
bb58b5cbed Close GH-237: Adding flexibility with endpoints. Fixes #232 2013-05-29 17:22:23 +01:00
Feross Aboukhadijeh
eed8025ae2 Close GH-507: Add --quiet and --silent command line options. Fixes #343 2013-05-29 17:20:05 +01:00
André Cruz
a57d2c0e14 Merge pull request #503 from wibblymat/issue-362
Throw an error if we try to use git but it isn't installed (#362)
2013-05-29 08:36:23 -07:00
Nicolas Gallagher
90afa5b3e1 Merge pull request #441 from wibblymat/issue-275
Allow a commit hash instead of a semver version (#275)
2013-05-29 07:34:50 -07:00
Mat Scales
a7c0cd405d Make the code a little clearer 2013-05-29 15:07:53 +01:00
Mat Scales
bed22468ba Merge pull request #512 from dvberkel/master
Update link to Bower Server
2013-05-29 06:49:57 -07:00
Daan van Berkel
93d4c3c47c update reference to Bower Server
The link to Bower Server is stale.
2013-05-29 15:38:07 +02:00
Mat Scales
0c190651cb Merge pull request #435 from stephenplusplus/master
components/ -> bower_components/
2013-05-29 03:56:25 -07:00
André Cruz
3cf56ff7d5 Change registryName to registry. 2013-05-29 11:44:36 +01:00
André Cruz
f3f16c96e8 Merge pull request #509 from passy/readme-tar
Update readme to reflect supported archive types
2013-05-29 02:51:01 -07:00
André Cruz
70a4ab863d Add update command and also finish install. 2013-05-29 10:38:39 +01:00
André Cruz
d62ccfd234 Change name separator of the endpoint (can't use pipe duh). 2013-05-29 10:36:57 +01:00
Pascal Hartig
370793a005 readme: correct tar.gz to tar 2013-05-29 11:17:55 +02:00
Stephen Sawchuk
292c0356f1 components/ -> bower_components/ 2013-05-28 14:59:59 -04:00
André Cruz
4d6bcf27e9 Small tweaks. 2013-05-28 11:24:09 +01:00
André Cruz
130e417451 Fix render of errors. 2013-05-28 11:23:48 +01:00
André Cruz
e6f2d9de86 Typo due to search & replace. 2013-05-28 11:23:28 +01:00
André Cruz
415a1bffac README typo. 2013-05-28 00:04:23 +01:00
André Cruz
798895d78d Set log level to infinity when --verbose is used. 2013-05-27 23:29:39 +01:00
André Cruz
e24529d8d1 Merge pull request #478 from wibblymat/issue-437
Don't use connection keep alive for HTTP requests (Fixes #437)
2013-05-27 15:24:55 -07:00
André Cruz
454436905c Huge commit.
- Changed way renderers work
- Move worker to a separate module
- Improve loglevel
- Minor tweaks
- Fix tests
2013-05-27 22:59:13 +01:00
Nicolas Gallagher
26feee1ed5 chore: improve package registration docs
Make it a bit clearer that people should be using Git tags and
remembering to push their tags to the remote endpoint.
2013-05-27 11:39:22 -06:00
André Cruz
005b3356f2 Several things changed.
- Make force and offline part of config, clearing all the options mess in the architecture
- Fix some bugs with the renderer
- Parse cli options
2013-05-26 13:47:13 +01:00
André Cruz
4ac052c10b Oops. 2013-05-26 13:17:54 +01:00
André Cruz
f1717f8319 Move force and offline options to the constructor. 2013-05-26 13:12:54 +01:00
André Cruz
cb000549bd Small tweaks. 2013-05-26 12:46:45 +01:00
André Cruz
c8d4d39068 Add info level to default log levels. 2013-05-24 23:48:36 +01:00
André Cruz
8539298008 Forgot to tweak some more notifications. 2013-05-24 23:44:01 +01:00
André Cruz
f7395b7d7c Add special "all" log level. 2013-05-24 23:43:33 +01:00
André Cruz
86758dcb70 Merge branch 'rewrite' of github.com:bower/bower into rewrite 2013-05-24 23:21:21 +01:00
André Cruz
f7c3b7c664 Indexed resolvers. 2013-05-24 23:20:54 +01:00
Mat Scales
616d1a2c88 Make the grunt jshint task use the .jshintrc 2013-05-24 23:17:52 +01:00
André Cruz
9f2b02d98e I'm dumb. 2013-05-24 23:10:39 +01:00
André Cruz
fc193b2d24 Oops. 2013-05-24 23:09:23 +01:00
André Cruz
01d8d0dbec Minor CS fixes. 2013-05-24 23:03:19 +01:00
André Cruz
2712aa2ae2 Merge branch 'master' of github.com:bower/json 2013-05-24 22:55:03 +01:00
André Cruz
7dcefa6bee Add repository to package.json and fix URL's, also bump rc version. 2013-05-24 22:54:41 +01:00
André Cruz
70e3528809 Add repository to package.json and bump rc version. 2013-05-24 22:53:52 +01:00
André Cruz
c7780a2708 Try next registry endpoint on 404. 2013-05-24 22:53:17 +01:00
André Cruz
784d458e62 Add repository to package.json. 2013-05-24 22:50:44 +01:00
Mat Scales
0e1e7875a8 Throw an error if we try to use git but it isn't installed (#362) 2013-05-24 17:51:14 +01:00
Mat Scales
03c6614aed Added which as a dev dependency accidentally 2013-05-24 17:31:59 +01:00
Mat Scales
26f33b9581 Check that git is installed when instantiating a git resolver 2013-05-24 17:29:16 +01:00
Mat Scales
0ba66d4d47 Make travis work with grunt 2013-05-24 15:57:45 +01:00
Mat Scales
5bc0b24913 Set up Grunt, because Grunt is magic 2013-05-24 15:43:54 +01:00
Mat Scales
da87fd7747 Make warnings go out on stderr 2013-05-24 15:38:13 +01:00
Mat Scales
49b1608af8 Put the dependencies in alphabetical order for better readability 2013-05-24 15:36:08 +01:00
Mat Scales
8bc6d7af8c Added the update notifier 2013-05-24 15:35:03 +01:00
André Cruz
479690f011 Remove trailing commas. 2013-05-24 12:33:08 +01:00
André Cruz
2510f21c81 Sum up when exceeds the size of the label. 2013-05-24 12:26:32 +01:00
André Cruz
d6e55dffb0 Auto align cli output in wide mode. 2013-05-24 11:57:56 +01:00
André Cruz
7df0e22664 Add new line at the end of the json renderer. 2013-05-24 11:46:34 +01:00
André Cruz
8939fe0b83 Make tag lower case in case of error. 2013-05-24 11:46:12 +01:00
André Cruz
c4cbfd352e Move stdout/stderr logic to the renderers to allow for greater flexibility. 2013-05-24 11:14:14 +01:00
André Cruz
aea39080d6 Oops. 2013-05-24 11:13:25 +01:00
Mat Scales
658a4dbb2e Don't use connection keep alive for HTTP requests (Fixes #437) 2013-05-24 09:55:27 +01:00
Mat Scales
607e16025d Don't fail silently when no version specified in the JSON (#439) - Make having a blank version be an error. 2013-05-23 17:13:23 -07:00
André Cruz
ecacdfaf49 Avoid having to deal with circular references when outputting json. 2013-05-24 00:58:43 +01:00
André Cruz
d8719ede12 More CS. 2013-05-24 00:23:05 +01:00
André Cruz
11834a4186 Fix tests. 2013-05-24 00:20:15 +01:00
André Cruz
81381fac75 Fix error render, CS. 2013-05-24 00:19:43 +01:00
André Cruz
9fa91aab36 More tweaks related to notifications, add notifications to remaining resolvers. 2013-05-24 00:03:44 +01:00
André Cruz
2897b66a1c Remove old code. 2013-05-24 00:03:00 +01:00
André Cruz
ef77ac11ef Flip label and tag position on large terminals. 2013-05-23 23:43:40 +01:00
André Cruz
382c857a4b Tweaks to notifications. 2013-05-23 23:43:11 +01:00
André Cruz
c4bfbd3f94 CS fix based on suggestions. 2013-05-23 23:42:24 +01:00
André Cruz
f4c1a125e7 Add default log levels. 2013-05-23 21:41:51 +01:00
André Cruz
010e47634b Fix mute (silent) renderer. 2013-05-23 20:16:04 +01:00
André Cruz
086fda5f24 CS. 2013-05-23 20:06:51 +01:00
André Cruz
27b39c29b8 Fix tests. 2013-05-23 20:02:18 +01:00
André Cruz
680ac9825a Small typo. 2013-05-23 19:58:50 +01:00
André Cruz
cfb3d14028 Initial take on the commands + renderers + cli. 2013-05-23 19:55:59 +01:00
André Cruz
9f6bf62efc Some other tweaks to the API. 2013-05-22 22:58:04 +01:00
André Cruz
60ecceafec Change dependants to an object. 2013-05-22 15:09:29 +01:00
André Cruz
7b0b53a96d Some real minor tweaks. 2013-05-22 15:03:15 +01:00
André Cruz
87d0e1d886 Revised and improved code for the upper resolve layer. 2013-05-22 14:36:19 +01:00
André Cruz
e84bc3754f Fix sort of versions. 2013-05-21 00:53:30 +01:00
André Cruz
26bab84d04 Fix parse usage in README. 2013-05-19 14:27:36 +02:00
André Cruz
efea6136e7 Merge pull request #2 from badunk/find-readme
Quick fix for bowerJson.find() example
2013-05-19 05:26:42 -07:00
Duncan Wong
c56026c18a quick fix for bowerJson.find() example 2013-05-18 19:26:49 -06:00
Addy Osmani
375b76d46a Merge pull request #477 from wibblymat/json-change-note
Note the change from component.json to bower.json in the README
2013-05-18 11:40:59 -07:00
André Cruz
1d9504d0f0 Bump rc. 2013-05-17 13:14:53 +01:00
André Cruz
780b1f8acc Fix various bugs. 2013-05-17 13:13:47 +01:00
André Cruz
b369fa2c7b Add test for registry endpoints. 2013-05-17 13:12:46 +01:00
André Cruz
7c96eb0819 Small performance improvement by accepting an optional package meta to avoid re-reading it.
Fix tests if previous run left dummy directories.
2013-05-17 11:47:51 +01:00
André Cruz
febc3b7936 README typos. 2013-05-14 22:27:27 +01:00
André Cruz
1e511dd655 Disable keep alive, fixing issues with redirects taking too long. 2013-05-14 21:55:50 +01:00
Mat Scales
71eafe436a The list of contributors is alphabetical 2013-05-13 22:06:17 +01:00
André Cruz
66a5312908 Add @davidmaxwaterman to the list of contributors. 2013-05-13 17:46:03 +02:00
gcochard
14f4cdbbe5 Close GH-479: Oops, open PR again. Fixes #454 2013-05-13 16:38:03 +01:00
André Cruz
e479e84bde Fix minor issues when using the force flag. 2013-05-13 16:07:46 +01:00
André Cruz
19e3a2ecc4 Setup rudimentary CLI usage for the demo. 2013-05-13 15:09:16 +01:00
André Cruz
d2290d509f Copy now uses ncp to copy if there is no ignore filter, which is must faster. 2013-05-13 15:07:41 +01:00
Mat Scales
434d4298df Async breaks my head. Fixed the ENOENT problem. 2013-05-13 13:27:58 +01:00
André Cruz
9b6c5741de Move cache did creation to appropriate class, small pert improvement.. 2013-05-13 11:10:10 +01:00
André Cruz
e09a3b8cbf Huge commit, implement rough working version of the whole resolve process. 2013-05-13 11:09:04 +01:00
Mat Scales
c3b9d3be8c Add a note about the change from component.json to bower.json in the README 2013-05-13 09:58:32 +01:00
André Cruz
0742e18edd Oops. 2013-05-11 14:00:11 +01:00
André Cruz
cb59c2489b Change main file. 2013-05-11 13:56:48 +01:00
André Cruz
3158b544d5 Minor lang change. 2013-05-11 13:42:23 +01:00
André Cruz
e80270d1fa Add correct maxAge for the cache entries. 2013-05-11 13:40:59 +01:00
André Cruz
99b37f24bb Slightly different strategy, implement lookup cache. 2013-05-11 13:33:40 +01:00
André Cruz
fdbdcc4130 More doc typos. 2013-05-10 20:01:35 +01:00
André Cruz
08104966b2 Improve doc. 2013-05-10 19:54:30 +01:00
André Cruz
1c99133177 Change package to bower-registry-client.
Some changes to the codebase.
2013-05-10 19:46:52 +01:00
André Cruz
28780dc67e Wrong async usage of doUntil. 2013-05-09 21:15:49 +01:00
André Cruz
423ce54d8a Add empty tests and add cache TODO. 2013-05-09 13:18:59 +01:00
André Cruz
73bab73db6 Initial implementation of lookup. 2013-05-09 13:11:57 +01:00
André Cruz
3e90471fa2 Setup project. 2013-05-07 17:38:53 +01:00
André Cruz
7f2db8a9a7 Setup project. 2013-05-07 17:30:29 +01:00
André Cruz
d5fc147ffd Merge pull request #1 from dylang/human-friendly-error-message
Made the error message more understandable.
2013-05-07 09:29:32 -07:00
André Cruz
77ffd7bbf9 Merge branch 'master' of github.com:bower/bower-json 2013-05-07 17:26:32 +01:00
André Cruz
42775d3477 Improve gitignore. 2013-05-07 17:26:22 +01:00
André Cruz
6932b8c378 Better license format. 2013-05-07 17:26:10 +01:00
André Cruz
fb9ac01533 Update package.json 2013-05-07 12:11:19 +02:00
Dylan Greene
cff641ef80 add quotes around the path and fix the test 2013-05-06 22:16:52 -04:00
André Cruz
373abf1b24 Update README.md 2013-05-06 23:11:51 +02:00
Dylan Greene
f668596667 Made the error message more understandable. 2013-05-06 17:02:57 -04:00
André Cruz
adf14f79e0 Fix bug when parsing content-type headers with charset. 2013-05-06 13:05:29 +01:00
André Cruz
cd31799c4c Minor fixes. 2013-05-05 03:14:07 +01:00
André Cruz
93e0e815d7 Fix indentation. 2013-05-05 03:03:56 +01:00
André Cruz
05275c8938 Improve README. 2013-05-05 04:02:15 +02:00
André Cruz
19475db7dd Typos. 2013-05-05 04:00:55 +02:00
André Cruz
63c005a3de Remove node 0.10.x from the failures. 2013-05-05 03:23:20 +02:00
André Cruz
4e984f5532 Merge pull request #453 from bower/junk
Replace util/osJunk with junk module
2013-05-04 18:17:25 -07:00
André Cruz
5cb79a4c1a Unify named endpoints with endpoints. 2013-05-05 01:20:37 +01:00
Sindre Sorhus
083cb9cc9a Replace util/osJunk with junk module 2013-05-05 01:53:42 +02:00
André Cruz
f25903905c Resolve paths using config.cwd in the resolver factory. 2013-05-04 17:03:42 +01:00
André Cruz
16216147bc Keep var at the top. 2013-05-04 16:59:48 +01:00
André Cruz
8069e5568b Changes to new code style. 2013-05-04 16:56:31 +01:00
André Cruz
0682df3801 Merge branch 'rewrite' of github.com:bower/bower into rewrite
Also improve codebase.

Conflicts:
	lib/resolve/resolverFactory.js
	lib/util/copy.js
	test/resolve/resolverFactory.js
2013-05-04 16:54:22 +01:00
André Cruz
b0800c7e38 Merge pull request #450 from bower/rewrite-code-style
Rewrite: minor, non-functional changes to code style
2013-05-04 08:32:51 -07:00
André Cruz
e5c4391900 Fix some bugs. 2013-05-04 16:32:31 +01:00
André Cruz
e33e7446ee Add more tests/improve existent ones. 2013-05-04 16:32:00 +01:00
André Cruz
f8c3e6adf3 Add decomposed endpoint to the architecture. 2013-05-04 16:31:00 +01:00
Nicolas Gallagher
de0eca7890 Code style consistency
Some very minor changes to improve code style consistency.
2013-05-03 09:01:19 -07:00
Nicolas Gallagher
20ca17fcac Remove git ignores that aren't project specific 2013-05-03 08:42:29 -07:00
Nicolas Gallagher
6cbd1963bf Minor format change to LICENSE 2013-05-03 08:42:29 -07:00
André Cruz
2d292000a8 Oops. 2013-05-03 10:11:26 +01:00
André Cruz
6e75f94505 Apply removal of ignored files, add tests.
Minor improvements.
2013-05-03 10:07:27 +01:00
André Cruz
e748bcb291 Package repository initial implementation. 2013-05-03 00:09:02 +01:00
André Cruz
409a8c2a77 Add more tests to the resolver factory. 2013-05-02 23:45:49 +01:00
André Cruz
4cc09e49ac Tweak resolverFactory and other stuff, improve related tests. 2013-05-02 22:42:48 +01:00
André Cruz
665b5363e3 Update some links to the new bower org. 2013-05-02 14:37:26 +01:00
André Cruz
5a05f40428 Reuse promises of same source. 2013-05-02 11:38:17 +01:00
André Cruz
007b3644be Finish UrlResolver tests, fix some bugs. 2013-05-02 11:14:23 +01:00
André Cruz
93eba6ef68 Improve content disposition regexp. 2013-05-01 15:35:05 +01:00
André Cruz
0c7e593370 Fix bug in the hasNew of the GitResolver. 2013-05-01 15:34:15 +01:00
André Cruz
6b7df8fd50 Fix issues with the UrlResolver and add more tests. 2013-05-01 14:43:55 +01:00
Sindre Sorhus
783869b45c readme - fix code style on examples 2013-05-01 15:20:56 +02:00
André Cruz
4919b9cb48 Finish GitResolver tests, fix associated issues. 2013-05-01 14:05:11 +01:00
André Cruz
3f81e0ab82 Working towards finishing the UrlResolver. 2013-05-01 11:59:33 +01:00
André Cruz
96f2e150a1 Oops. 2013-05-01 11:58:47 +01:00
André Cruz
a38af3a31c Do not take OS junk files into account when counting files. 2013-05-01 11:57:06 +01:00
André Cruz
f29023f11d Some changes to the resolver API, add more tests. 2013-05-01 09:50:04 +01:00
André Cruz
3a93600195 Implement renaming to index in the FsResolver, fix minor issues. 2013-04-30 19:22:47 +01:00
André Cruz
974373dc40 Throw an error if already resolving. 2013-04-30 19:19:59 +01:00
Mat Scales
62de48e4ea Change the clean up to use rimraf.sync because the async was throwing errors 2013-04-30 12:03:01 +01:00
Mat Scales
1031af3dbc Allow a commit hash instead of a semver version (#275) 2013-04-30 11:23:28 +01:00
André Cruz
36aacba237 Finish FsResolver. 2013-04-29 17:26:53 +01:00
André Cruz
2530c577dc Fix some bugs when extracting archives, add some tests. 2013-04-29 17:09:54 +01:00
André Cruz
54b7920697 Small change. 2013-04-29 16:21:33 +01:00
André Cruz
9ead37845e Fix some issues with the extraction step. 2013-04-29 16:06:48 +01:00
André Cruz
bff9141a4f Oops. 2013-04-29 15:25:25 +01:00
André Cruz
f11b2f6782 Walk towards finishing FsResolver. 2013-04-29 15:21:33 +01:00
André Cruz
b5054a7a7f Add static function to clear the internal resolvers cache, fix some issues. 2013-04-28 12:53:44 +01:00
André Cruz
bf61ed6310 Delete version from package meta if resolution is not a semver version. 2013-04-28 10:56:11 +01:00
André Cruz
e52756bf9f Switch to promise progress events, ability to target specific tags. 2013-04-28 10:48:05 +01:00
André Cruz
b0350d9412 Add link to issue. 2013-04-27 14:06:19 +02:00
André Cruz
824fcf1736 Bump version. 2013-04-27 13:00:46 +01:00
André Cruz
77d4895cf0 Merge branch 'master' of github.com:bower/bower 2013-04-27 12:55:10 +01:00
André Cruz
0440e6916b Do not try other cacheName if in the middle of the resolve process. 2013-04-27 12:54:55 +01:00
André Cruz
4c63a4046a Fix typos. 2013-04-27 13:05:31 +02:00
André Cruz
624886bf5a Doc weird code. 2013-04-27 11:50:06 +01:00
André Cruz
545f90ba12 Bump version. 2013-04-27 11:36:58 +01:00
André Cruz
f97698858a Update change log. 2013-04-27 11:36:38 +01:00
André Cruz
424f99cea4 Fix cacheName not being correctly set sometimes, closes #429.
This was causing issues in the list command and install/update --save flag.
2013-04-27 11:26:59 +01:00
André Cruz
b13feea790 Fix update command not updating only desired packages.
Now throws an error if passing an unknown package.
2013-04-27 11:23:18 +01:00
André Cruz
883b79f05d Show package name in the root label in the list command. 2013-04-27 10:37:54 +01:00
Nicolas Gallagher
6dad4de8e3 Update examples of default paths in docs
Change 'components' to 'bower_components' in the README documentation.
2013-04-26 13:26:19 -07:00
Nicolas Gallagher
daeff92065 Update travis and issue URLs in README 2013-04-26 13:25:20 -07:00
Nicolas Gallagher
56b3799a7a Update remote's path in CONTRIBUTING.md 2013-04-26 13:22:38 -07:00
Nicolas Gallagher
3244c57417 Update issue URLs in CHANGELOG 2013-04-26 13:21:10 -07:00
Nicolas Gallagher
f1fcaccbaf Update URLs in package.json
Change URLs to those that correspond to the new repository location.
2013-04-26 13:18:31 -07:00
Nicolas Gallagher
4ef26f99fa Alphabetical order of Node deps
Got a lot of deps, easier to scan in alphabetical order
2013-04-26 13:12:36 -07:00
Nicolas Gallagher
909dca8f9a License format 2013-04-26 13:09:28 -07:00
André Cruz
421dbc28bd Small changes. 2013-04-25 18:59:42 +01:00
André Cruz
561a5b2b2e Remove events. 2013-04-25 13:47:15 +01:00
André Cruz
2bfdd033eb Fix test asserting copy of permissions. 2013-04-25 10:37:30 +01:00
Andre Cruz
938ae7dc8e Doing too much. 2013-04-24 19:14:05 +01:00
Andre Cruz
3f7bd98174 Add some more tests and fix some issues. 2013-04-24 19:00:50 +01:00
marcooliveira
dc67e8bbde [wip] resolver factory tests 2013-04-24 04:01:55 +01:00
marcooliveira
d0cef987fe Merge branch 'rewrite' of github.com:twitter/bower into rewrite 2013-04-24 03:05:24 +01:00
marcooliveira
af4131bb4d [wip] initial version of the resolver factory 2013-04-24 03:04:26 +01:00
André Cruz
d6e0638cd9 Oops. 2013-04-24 01:11:30 +01:00
André Cruz
030b6f9720 Remove util/fetchBranch. 2013-04-24 01:00:51 +01:00
André Cruz
d9634030d4 Doc typos. 2013-04-24 00:54:44 +01:00
André Cruz
79f5502b8e Add tests for the GitFsResolver constructor. 2013-04-24 00:26:28 +01:00
André Cruz
179781dfee Remove logs. 2013-04-24 00:18:59 +01:00
André Cruz
413fd61900 Move all the update logic to the downloader. 2013-04-24 00:17:15 +01:00
André Cruz
9f605cae29 Update also master branch of the fake package before running the tests. 2013-04-24 00:10:00 +01:00
André Cruz
c557279607 Update tests to reflect last change on the test-package. 2013-04-23 23:59:18 +01:00
André Cruz
aa315d7c97 Merge branch 'master' of github.com:bower/bower-json 2013-04-23 23:58:48 +01:00
André Cruz
080b25e30c Update .gitignore. 2013-04-23 23:58:35 +01:00
André Cruz
75920e0a09 Fetch our fake package just one time. 2013-04-23 23:41:40 +01:00
André Cruz
f46ec05a3a Add some tests to the GitFsResolver. 2013-04-23 23:38:13 +01:00
André Cruz
a87969d85f Add tests for the GitRemoveResolver. 2013-04-23 23:19:08 +01:00
André Cruz
3231ac15c9 Guess name from the source in the GitResolver. 2013-04-23 23:18:31 +01:00
André Cruz
627c75b6b9 Trim refs to prevent empty lines to be in the array. 2013-04-23 23:18:07 +01:00
André Cruz
823a845752 Fix previous commit. 2013-04-23 20:44:18 +01:00
André Cruz
f28ac0c037 Add more tests, most of them related with the GitResolver. 2013-04-23 20:33:21 +01:00
André Cruz
727e02b816 Improve tests on build/rc tags. 2013-04-23 09:22:43 +01:00
André Cruz
a7c8c08183 Update README.md 2013-04-23 10:12:47 +02:00
André Cruz
b872f90365 Add some more tests to be completed later. 2013-04-23 00:57:08 +01:00
marcooliveira
8c3446fb1f Fix some typos that were causing issues in node 0.10.x 2013-04-22 20:12:44 +01:00
Andre Cruz
504222b564 Add initial tests for the GitResolver. 2013-04-22 18:35:52 +01:00
Andre Cruz
108fcd5691 Fix issues in windows. 2013-04-22 18:34:01 +01:00
André Cruz
e78dc4892f Add test for the warn event when using the deprecated component.json. 2013-04-22 01:41:56 +01:00
André Cruz
5cce1af3d7 Add travis image. 2013-04-22 01:34:57 +01:00
André Cruz
92156e0520 Fix case-sensitive require. 2013-04-22 01:23:45 +01:00
André Cruz
9c13e48b62 Lock tmp to 0.0.17 due to a bug. 2013-04-22 01:13:56 +01:00
André Cruz
bfc840d1a7 Complete some more tests related with the base resolver. 2013-04-22 00:59:40 +01:00
André Cruz
8bc7349635 Add some more tests. 2013-04-21 15:21:39 +01:00
André Cruz
ddbfc5c57a Add initial tests for the Resolver, fix some bugs. 2013-04-21 14:55:06 +01:00
André Cruz
b1e97266e3 Update resolver implementation according to the API, integrate bower-json package. 2013-04-20 14:09:01 +01:00
André Cruz
bb8c456a04 Small changes to the Resolver API. 2013-04-20 14:08:03 +01:00
André Cruz
c5c9387226 Small pert improv. 2013-04-20 14:01:57 +01:00
André Cruz
ee6ff7daaa Move worker tests. 2013-04-20 13:16:43 +01:00
André Cruz
29c93d2b0d Use 'end' instead of 'exit' to guarantee that streams are flushed. 2013-04-20 13:15:37 +01:00
André Cruz
bb98627d2b Made parse async for consistency, tweak error codes. 2013-04-20 12:17:00 +01:00
André Cruz
3060866586 Add test for invalid json. 2013-04-20 11:37:15 +01:00
André Cruz
eacf121f78 Update README. 2013-04-20 11:23:24 +01:00
André Cruz
c39535fdd0 Merge branch 'master' of github.com:bower/bower-json 2013-04-20 11:21:31 +01:00
André Cruz
c3311df2a8 Initial implementation and tests. 2013-04-20 11:20:41 +01:00
André Cruz
99af52ac2f Fix bugs in the Worker, add tests. 2013-04-20 01:39:39 +01:00
André Cruz
5a17314b2c Oops. 2013-04-19 22:00:24 +02:00
André Cruz
05d974578d Signal optional type. 2013-04-19 19:11:45 +01:00
André Cruz
0d585a4d98 Typo. 2013-04-19 19:07:48 +01:00
André Cruz
b968b4a9a4 Change UnitOfWork to Worker. 2013-04-19 19:05:33 +01:00
André Cruz
07281f050c Change to just bower-json. 2013-04-19 13:58:18 +01:00
André Cruz
9c3757fb0c Doc improv. 2013-04-19 12:33:07 +01:00
André Cruz
f5d5e59040 Typo. 2013-04-19 12:31:04 +01:00
André Cruz
70880c066f Add LICENSE and README. 2013-04-19 12:29:20 +01:00
André Cruz
5508c70f3a Setup module. 2013-04-19 11:19:47 +01:00
André Cruz
f100982b04 Merge branch 'rewrite' of github.com:twitter/bower into rewrite 2013-04-19 10:04:12 +01:00
marcooliveira
c8db2a85c6 [wip] improve package meta description 2013-04-19 02:03:54 +01:00
marcooliveira
3b086d130f add resolver factory 2013-04-19 01:59:53 +01:00
marcooliveira
cb8394fb07 [wip] Finish Resolver doc and start PackageRepository 2013-04-19 01:59:28 +01:00
marcooliveira
a401f19ca1 Merge branch 'rewrite' of github.com:twitter/bower into rewrite 2013-04-19 01:06:28 +01:00
marcooliveira
444fd41d58 [wip] improve doc 2013-04-19 01:06:20 +01:00
André Cruz
e3ccc6d558 Unnecessary line. 2013-04-19 01:05:11 +01:00
André Cruz
8ed20e35ca Improve english. 2013-04-19 00:53:03 +01:00
André Cruz
bd16b485be Updated UoW doc and implementation according to the final architecture. 2013-04-19 00:47:54 +01:00
marcooliveira
9783de7464 [wip] improve doc 2013-04-18 21:54:33 +01:00
André Cruz
9139fa7ec4 Update README.md 2013-04-16 22:10:43 +02:00
André Cruz
ba45539375 Change to notes.md. 2013-04-16 00:41:31 +01:00
Andre Cruz
bb99abdebd Merge branch 'rewrite' of github.com:twitter/bower into rewrite 2013-04-16 00:08:42 +01:00
marcooliveira
89878dddf6 Improve readme (@marcooliveira & @satazor) 2013-04-15 22:11:18 +01:00
marcooliveira
075ac9e280 Update strategy diagram. 2013-04-15 19:55:16 +01:00
Marco Oliveira
d43f65366b Merge branch 'rewrite' of github.com:twitter/bower into rewrite 2013-04-15 19:33:06 +01:00
Marco Oliveira
052ab2d9bc fix typo 2013-04-15 19:30:27 +01:00
Andre Cruz
74f7c93a6d Remove fetch origin in the GitFsResolver. 2013-04-15 14:20:40 +01:00
André Cruz
36c3cac484 Fallback to latest commit on master if the repo has no tags and target is *. 2013-04-15 00:59:53 +01:00
André Cruz
2fc014af03 More succinct again. 2013-04-14 18:30:11 +01:00
André Cruz
8abd010d08 Fix bug when targeting branches. 2013-04-14 18:15:09 +01:00
André Cruz
c117ef3000 More succinct. 2013-04-14 18:11:47 +01:00
André Cruz
543407920d Doc abstract function. 2013-04-14 18:07:13 +01:00
André Cruz
3dbdb541ed Some more refactoring. 2013-04-14 18:01:33 +01:00
André Cruz
8f24858af8 Var typos. 2013-04-14 17:50:00 +01:00
André Cruz
f2667bfcae Bug fixes on the git fs resolver. 2013-04-14 17:46:18 +01:00
André Cruz
4bbafe13e6 Oops. 2013-04-14 17:29:22 +01:00
André Cruz
f33bac5b59 Add missing hasNew. 2013-04-14 17:25:36 +01:00
André Cruz
85d2a33620 Minor tweaks. 2013-04-14 17:18:59 +01:00
André Cruz
643f4fddf9 Var typos. 2013-04-14 17:09:35 +01:00
André Cruz
8ec8118d39 Refactor. 2013-04-14 17:01:59 +01:00
André Cruz
dcabf2738a Minor changes. 2013-04-14 16:14:51 +01:00
André Cruz
a4fbe65259 Implemented GitFsResolver, minor refactor to the GitRemoteResolver. 2013-04-14 15:27:08 +01:00
André Cruz
83d76a0781 Doc typos. 2013-04-14 03:44:48 +01:00
André Cruz
59fbc308b0 Update codebase to the almost finalised architecture.
The GitRemoteResolver is almost done.
2013-04-14 03:40:25 +01:00
Marco Oliveira
7266410840 several improvements to readme:
The following improvements resulted of planning between @marcooliveira / @satazor:

- improve term dictionary
- improve list of bower modules
- improve overview of resolution process
2013-04-14 03:37:51 +01:00
Marco Oliveira
e4312ed5cc add resolve diagram 2013-04-14 03:29:18 +01:00
André Cruz
1642a7714f Little update to the TODO. 2013-04-13 20:11:56 +01:00
marcooliveira
c62be68bda add architecture diagram 2013-04-12 05:29:09 +01:00
marcooliveira
a1befc78e0 slight rework to the strategy and clarification 2013-04-12 05:00:51 +01:00
André Cruz
fdb8e0e2e5 Remove read of local rc to get the json name, small tweaks. 2013-04-11 01:27:08 +01:00
André Cruz
7b803d855f Merge branch 'rewrite' of github.com:twitter/bower into rewrite 2013-04-10 20:46:10 +01:00
André Cruz
3116fde51c Better names. 2013-04-10 20:45:47 +01:00
Marco Oliveira
714c542da9 Update README.md 2013-04-10 20:33:27 +02:00
André Cruz
1c7e272ac3 Update TODO with some notes. 2013-04-09 20:17:49 +01:00
André Cruz
31f66c7142 Add initial bin file implementation. 2013-04-06 16:28:44 +01:00
André Cruz
5e1d49cc7e Forgot to add some packages to the package.json, add notes on the rc package. 2013-04-06 16:28:14 +01:00
André Cruz
495a72d167 Indent issue. 2013-04-06 13:03:47 +01:00
André Cruz
e0eabb8d71 Use the name when creating the empty json. 2013-04-06 12:58:24 +01:00
André Cruz
4c2c804d0d Typo. 2013-04-06 12:51:54 +01:00
André Cruz
733c375afe More small tweaks to the config. 2013-04-06 12:50:29 +01:00
André Cruz
5dce6e416e Add node 0.10.x to travis ignore, small changes. 2013-04-06 12:41:06 +01:00
André Cruz
201bf29429 Config improv. 2013-04-06 12:30:27 +01:00
André Cruz
408417bbda Use the new bower.json, refactor readJson func. 2013-04-06 12:09:56 +01:00
André Cruz
3d8c8a36dd Setup project meta files. 2013-04-06 00:43:51 +01:00
André Cruz
ca1b9d35dd Add travis.yml. 2013-04-06 00:29:31 +01:00
André Cruz
2841bfe819 Initial commit 2013-04-06 00:21:28 +01:00
André Cruz
1694b10690 Created new branch rewrite 2013-04-06 00:18:20 +01:00
479 changed files with 31406 additions and 8394 deletions

19
.editorconfig Normal file
View File

@@ -0,0 +1,19 @@
root = true
[*]
indent_style = space
indent_size = 4
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
[*.md]
trim_trailing_whitespace = false
[**.std]
insert_final_newline = false
[{package,bower}.json]
indent_style = space
indent_size = 2

52
.eslintrc Normal file
View File

@@ -0,0 +1,52 @@
{
"env": {
"node": true,
"mocha": true
},
"rules": {
"no-bitwise": 0,
"curly": 0,
"eqeqeq": 0,
"guard-for-in": 0,
"no-use-before-define": 0,
"no-caller": 2,
"no-new": 2,
"no-plusplus": 0,
"no-undef": 2,
"no-unused-vars": 0,
"strict": 0,
"semi": 0,
"comma-spacing": 2,
"quote-props": [2, "consistent", { "keywords": true }],
"quotes": [2, "single", "avoid-escape"],
"indent": [2, 4],
"no-cond-assign": [ 2, "except-parens" ],
"no-debugger": 2,
"no-dupe-args": 2,
"no-dupe-keys": 2,
"no-duplicate-case": 2,
"no-unreachable": 2,
"valid-typeof": 2,
"no-fallthrough": 2,
"no-ex-assign": 2,
"no-eq-null": 0,
"no-eval": 0,
"no-unused-expressions": 0,
"block-scoped-var": 0,
"no-iterator": 0,
"no-loop-func": 2,
"no-script-url": 0,
"no-shadow": 0,
"no-new-func": 2,
"no-new-wrappers": 2,
"no-invalid-this": 0,
"space-before-blocks": [2, "always"],
"space-before-function-paren": [2, {"anonymous": "always", "named": "never"}],
"space-infix-ops": 2,
"keyword-spacing": 2,
"new-parens": 2,
"no-multiple-empty-lines": [2, { max: 2}],
"eol-last": 2,
"no-trailing-spaces": 2
}
}

44
.github/ISSUE_TEMPLATE.md vendored Normal file
View File

@@ -0,0 +1,44 @@
<!--
If you are reporting a new issue, make sure that we do not have any duplicates.
You can ensure this by searching the issue list for this repository.
You are welcome to open issues to discuss important general topics concerning Bower.
However for support questions, please consider using http://stackoverflow.com or
asking for help in our Discord channel: https://discordapp.com/invite/0fFM7QF0KpZaDeN9
# BUG REPORT
Use the commands below to provide key information to reproduce:
You do NOT have to include this information if this is a FEATURE REQUEST OR DISCUSSION
For more information about reporting bugs, see:
https://github.com/bower/bower/wiki/Report-a-Bug
-->
**Output of `bower -v && npm -v && node -v`:**
```
(paste your output here)
```
**Additional environment details (proxy, private registry, etc.):**
**Steps to reproduce the issue:**
1.
2.
3.
**Describe the results you received:**
**Describe the results you expected:**
**Additional information:**

5
.gitignore vendored
View File

@@ -1,3 +1,2 @@
node_modules
components
.DS_Store
npm-debug.log*
lerna-debug.log*

View File

@@ -1,4 +1,33 @@
sudo: false
language: node_js
node_js:
- "0.10"
- "0.8"
- "0.11"
- "0.12"
- "4.0"
- "4.1"
- "4.2"
- "5"
- "6"
install:
- node --version
- npm --version
- git --version
- svn --version | head -n 1
- npm install
os:
- osx
- linux
matrix:
fast_finish: true
allow_failures:
- os: osx
- env: "NODE_VERSION=0.11"
script:
- npm test

View File

@@ -1,20 +1,542 @@
# Changelog
## 1.7.9 - 2016-04-05
- Show warnings for invalid bower.json fields
- Update bower-json
- Less strict validation on package name (allow spaces, slashes, and "@")
## 1.7.8 - 2016-04-04
- Don't ask for git credentials in non-interactive session, fixes #956 #1009
- Prevent swallowing exceptions with programmatic api, fixes #2187
- Update graceful-fs to 4.x in all dependences, fixes nodejs/node#5213
- Resolve pluggable resolvers using cwd and fallback to global modules, fixes #1919
- Upgrade handlebars to 4.0.5, closes #2195
- Replace all % chatacters in defined scripts, instead of only first one, fixes #2174
- Update opn package to fix issues with "bower open" command on Windows
- Update bower-config
- Do not interpolate environment variables in script hooks, fixes bower/config#47
- Update bower-json
- Validate package name more strictly and allow only latin letters, dots, dashes and underscores
- Add support for "save" and "save-exact" in .bowerrc, #2161
## 1.7.7 - 2016-01-27
Revert locations of all files while still packaging `node_modules`.
It's because people are depending on internals of bower, like
`bower/lib/renderers/StandardRenderer`. We want to preserve this
implicit contract, but we discourage it. The only official way
to use bower programmatically is through `require('bower')`.
## 1.7.6 - 2016-01-27
- Revert location of "bin/bower" as developers are using it directly ([#2157](https://github.com/bower/bower/issues/2157))
Note: Correctly, you should use an alias created in `npm bin --global`.
## 1.7.5 - 2016-01-26
- Remove analytics from Bower, fixes ([#2150](https://github.com/bower/bower/pull/2150))
- Default to ^ operator on `bower install --save` ([#2145](https://github.com/bower/bower/pull/2145))
- Support absolute path in .bowerrc directory option ([#2130](https://github.com/bower/bower/pull/2130))
- Display user's name upon `bower login` command ([#2133](https://github.com/bower/bower/pull/2133))
- Decompress gzip files ([#2092](https://github.com/bower/bower/pull/2092))
- Prevent name clashes in package extraction ([#2102](https://github.com/bower/bower/pull/2102))
- When strictSsl is false, set GIT_SSL_NO_VERIFY=true ([#2129](https://github.com/bower/bower/issues/2129))
- Distribute bower with npm@3 for better Windows support ([#2146](https://github.com/bower/bower/issues/2146))
- Update request to 2.67.0 and fs-write-stream-atomic to 1.0.8
- Documentation improvements
## 1.7.4 - 2016-01-21
Unpublished because of issue with npm distribution:
https://github.com/npm/npm/issues/11227
## 1.7.3 - 2016-01-20
Unpublished because of issue with npm distribution:
https://github.com/npm/npm/issues/11227
## 1.7.2 - 2015-12-31
- Lock "fs-write-stream-atomic" to 1.0.5
## 1.7.1 - 2015-12-11
- Rollback "Add `bower update --save` functionality", it causes issues and needs more testing
- Fix backward-compatibility of `bower search --json` ([#2066](https://github.com/bower/bower/issues/2066))
- Ignore prerelease versions from `bower info` output
- Update update-notifier to 0.6.0
- Better formatting of help messages (https://github.com/bower/bower/commit/de3e1089da80f47ea3667c5ab80d301cddfd8c3e)
- Add help menu for update `--save` and `update --save-dev` (https://github.com/bower/bower/commit/612aaa88eb4d4b268b2d8665c338ac086af3a5b0)
## 1.7.0 - 2015-12-07
- Add `bower update --save` functionality ([#2035](https://github.com/bower/bower/issues/2035))
- `bower search` shows help message when no package name is specified ([#2066](https://github.com/bower/bower/issues/2066))
- Update only those packages that are explicitly requested by the user. Related Issues
- [#256](https://github.com/bower/bower/issues/256)
- [#924](https://github.com/bower/bower/issues/924)
- [#1770](https://github.com/bower/bower/issues/1770)
- Allow for @ in username for SVN on windows ([#1650](https://github.com/bower/bower/issues/1650))
- 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))
## 1.6.9 - 2015-12-04
- Change git version of fs-write-stream-atomic back to npm version ([#2079](https://github.com/bower/bower/issues/2079))
## 1.6.8 - 2015-11-27
- Use fs-write-stream-atomic for downloads
- Improved downloader that properly cleans after itself
- Fix shallow host detection ([#2040](https://github.com/bower/bower/pull/2040))
- Upgrade to ([bower-config#1.2.3](https://github.com/bower/config/releases/tag/1.2.3))
- Properly restore env variables if they are undefined at the beginning
- Properly handle `default` setting for config.ca
- Display proper error if .bowerrc is a directory instead of file
## 1.6.7 - 2015-11-26
- Bundless all the dependencies again
## 1.6.6 - 2015-11-25
- Fixes regression with the published npm version
## 1.6.5 - 2015-10-24
- Updates to tests and documentation
- Fixes passing options when requesting downloads
## 1.6.4 - 2015-10-24
- Fix ignoring dependencies on multiple install run ([#1970](https://github.com/bower/bower/pull/1970))
- Use --non-interactive when running svn client ([#1969](https://github.com/bower/bower/pull/1969))
- Fix downloading of URLs ending with slash ([#1956](https://github.com/bower/bower/pull/1956))
- Add user-agent field for downloads by Bower ([#1960](https://github.com/bower/bower/pull/1960))
## 1.6.3 - 2015-10-16
Fixes regression issues introduced with 1.6.2, specifically:
- Allow for bower_components to be a symlink
- Allow setting custom registry in .bowerrc
## 1.6.2 - 2015-10-15
Fix dependency issues of 1.6.1. First published release of 1.6.x.
## 1.6.1 - 2015-10-15
Fix dependency issues of 1.6.0. Reverted release.
## 1.6.0 - 2015-10-15
- Shrinkwrap all dependencies and add them to bundledDependencies ([#1948](https://github.com/bower/bower/pull/1948))
- Allow for ignoring of child dependencies ([#1394](https://github.com/bower/bower/pull/1394))
- Allow passing `--config.resolvers` through CLI ([#1922](https://github.com/bower/bower/pull/1922))
- Use defaults values from package.json if it exists (bower init) ([#1731](https://github.com/bower/bower/issues/1731))
- Properly use cerificates set in .bowerrc ([#1869](https://github.com/bower/bower/pull/1869))
- Include package name when version conflict occurs ([#1917](https://github.com/bower/bower/pull/1917))
- Add timeout for permission check ([yeoman/insight#35](https://github.com/yeoman/insight/pull/35))
- Close file-handles when possible. Prevents all sorts of permission issues on Windows ([0bb1536](https://github.com/bower/bower/commit/0bb1536c9972e13f3be06bea9a8619632966c664))
- Prevent ENOENT error on Windows when in VM environment ([isaacs/chmodr#8](https://github.com/isaacs/chmodr/pull/8))
Reverted release.
## 1.5.4 - 2015-11-24
- [fix] Lock lru-cache dependency to 2.7.0
## 1.5.3 - 2015-09-24
- Revert auto sorting of bower dependencies, fixes ([#1897](https://github.com/bower/bower/issues/1897))
- Fix --save-exact feature for github endpoints, fixes ([#1925](https://github.com/bower/bower/issues/1925))
- Fix `bower init` to support private flag again ([#1819](https://github.com/bower/bower/pull/1819))
- Bump insight dependency to support prompt timeout ([#1102](https://github.com/bower/bower/issues/1102))
## 1.5.2 - 2015-08-25
- Revert update semver version from 2.x to 5.x, fixes ([#1896](https://github.com/bower/bower/issues/1896))
- Make bower commands work from subdirectories, fixes ([#1893](https://github.com/bower/bower/issues/1893))
- Put auto shallow cloning for git behind a flag, fixes ([#1764](https://github.com/bower/bower/issues/1764))
## 1.5.1 - 2015-08-24
- If cwd provided explicitly, force using it, fixes #1866
## 1.5.0 - 2015-08-24
- Pluggable Resolvers! http://bower.io/docs/pluggable-resolvers/
- Update semver version from 2.x to 5.x ([#1852](https://github.com/bower/bower/issues/1852))
- Auto-sort dependencies alphabetically ([#1381](https://github.com/bower/bower/issues/1381))
- Make bower commands work from subdirectories ([#1866](https://github.com/bower/bower/issues/1866))
- No longer prefer installing bower as global module ([#1865](https://github.com/bower/bower/issues/1865))
## 1.4.2 - 2015-11-24
- [fix] Lock lru-cache dependency to 2.7.0
## 1.4.1 - 2015-04-01
- [fix] Reading .bowerrc upwards directory tree ([#1763](https://github.com/bower/bower/issues/1763))
- [fix] Update bower-registry-client so it uses the same bower-config as bower
## 1.4.0 - 2015-03-30
- Add login and unregister commands ([#1719](https://github.com/bower/bower/issues/1719))
- Automatically detecting smart Git hosts ([#1628](https://github.com/bower/bower/issues/1628))
- [bower/config#23] Allow npm config variables ([#1711](https://github.com/bower/bower/issues/1711))
- [bower/config#24] Merge .bowerrc files upwards directory tree ([#1689](https://github.com/bower/bower/issues/1689))
- Better homedir detection (514eb8f)
- Add --save-exact flag ([#1654](https://github.com/bower/bower/issues/1654))
- Ensure extracted files are readable (tar-fs) ([#1548](https://github.com/bower/bower/issues/1548))
- The version command in the programmatic API now returns the new version ([#1755](https://github.com/bower/bower/issues/1755))
- Some minor fixes: #1639, #1620, #1576, #1557, 962a565, a464f5a
- Improved Windows support (AppVeyor CI, tests actually passing on Windows)
- OSX testing enabled on TravisCI
It also includes improved test coverage (~60% -> ~85%) and many refactors.
## 1.3.12 - 2014-09-28
- [stability] Fix versions for unstable dependencies ([#1532](https://github.com/bower/bower/pull/1532))
- [fix] Update tar-fs to support old tar format ([#1537](https://github.com/bower/bower/issues/1537))
- [fix] Make analytics work again ([#1529](https://github.com/bower/bower/pull/1529))
- [fix] Always disable analytics for non-interactive mode ([#1529](https://github.com/bower/bower/pull/1529))
- [fix] Bower init can create private packages again ([#1522](https://github.com/bower/bower/issues/1522))
- [fix] Show again missing newline for bower search output ([#1538](https://github.com/bower/bower/issues/1538))
## 1.3.11 - 2014-09-17
- [fix] Restore install missing dependencies on update ([1519](https://github.com/bower/bower/pull/1519))
## 1.3.10 - 2014-09-13
- [fix] Back down concurrency from 50 to 5 ([#1483](https://github.com/bower/bower/pull/1483))
- [fix] Read .bowerrc from specified cwd ([#1301](https://github.com/bower/bower/pull/1301))
- [fix] Disable shallow clones except those from GitHub ([#1393](https://github.com/bower/bower/pull/1393))
- [fix] Expose bower version ([#1478](https://github.com/bower/bower/pull/1478))
- [fix] Bump dependencies, including "request" ([#1467](https://github.com/bower/bower/pull/1467))
- [fix] Prevent an error when piping bower output to head ([#1508](https://github.com/bower/bower/pull/1508))
- [fix] Disable removing unnecessary resolutions ([#1061](https://github.com/bower/bower/pull/1061))
- [fix] Display the output of hooks again ([#1484](https://github.com/bower/bower/issues/1484))
- [fix] analytics: true in .bowerrc prevents user prompt ([#1470](https://github.com/bower/bower/pull/1470))
- [perf] Use `tar-fs` instead of `tar` for faster TAR extraction ([#1490](https://github.com/bower/bower/pull/1490))
## 1.3.9 - 2014-08-06
- [fix] Handle `tmp` sometimes returning an array ([#1434](https://github.com/bower/bower/pull/1434))
## 1.3.8 - 2014-7-11
- [fix] Lock down `tmp` package dep ([#1403](https://github.com/bower/bower/pull/1403), [#1407](https://github.com/bower/bower/pull/1407))
## 1.3.7 - 2014-07-04
- [fix] callstack error when processing installed packages with circular dependencies ([#1349](https://github.com/bower/bower/issues/1349))
- [fix] Prevent bower list --paths` failing with TypeError ([#1383](https://github.com/bower/bower/issues/1383))
- "bower install" fails if there's no bower.json in current directory ([#922](https://github.com/bower/bower/issues/922))
## 1.3.6 - 2014-07-02
- [fix] Make --force always re-run installation ([#931](https://github.com/bower/bower/issues/931))
- [fix] Disable caching for local resources ([#1356](https://github.com/bower/bower/issues/1356))
- [fix] Emit errors instead throwing them when using bower.commands API ([#1297](https://github.com/bower/bower/issues/1297))
- [fix] Main files and bower.json are never ignored ([#547](https://github.com/bower/bower/issues/547))
- [fix] Check if pkgMeta is undefined during uninstall command ([#1329](https://github.com/bower/bower/issues/1329))
- [fix] Make custom tmp dir and ignores play well with each other ([#1299](https://github.com/bower/bower/issues/1299))
- Warn users when installing package with missing properties ([#694](https://github.com/bower/bower/issues/694))
## 1.3.5 - 2014-06-06
- Search compatible versions in fetching packages ([#1147](https://github.com/bower/bower/issues/1147))
## 1.3.4 - 2014-06-02
- Resolve a situation in which the install process gets into an infinite loop ([#1169](https://github.com/bower/bower/issues/1169))
- Improved CLI output for conflicts ([#1284](https://github.com/bower/bower/issues/1284))
- Changed `bower version` to mirror the tag format of `npm version` ([#1278](https://github.com/bower/bower/issues/1278))
- Allow short commit SHAs to be used ([#990](https://github.com/bower/bower/issues/990))
## 1.3.3 - 2014-04-24
- Do not cache moving targets like branches ([#1242](https://github.com/bower/bower/issues/1242))
- Suppress output if --quiet option is specified ([#1124](https://github.com/bower/bower/pull/1124))
- Use "svn export" for efficiency ([#1224](https://github.com/bower/bower/pull/1224))
- Prevent loading insights and analytics on CI ([#1221](https://github.com/bower/bower/issues/1221))
- Make "bower list" respect custom components directory ([#1237](https://github.com/bower/bower/issues/1237))
- Improve non-interactive loading performance 2x ([#1238](https://github.com/bower/bower/issues/1238))
- Load commands only on demand, improving performance ([#1232](https://github.com/bower/bower/pull/1232))
## 1.3.2 - 2014-04-05
- Added yui moduleType [PR #1129](https://github.com/bower/bower/pull/1129)
- Fixes for concurrency issues [PR #1211](https://github.com/bower/bower/pull/1211)
- `link` now installs package dependencies [PR #891](https://github.com/bower/bower/pull/891)
- Improved conflict installation message [Commit](https://github.com/bower/bower/commit/bea533acf87903d4b411bfbaa7df93f852ef46a3)
- Add --production switch to "prune" command [PR #1168](https://github.com/bower/bower/pull/1168)
## 1.3.1 - 2014-03-10
- No longer ask for permission to gather analytics when running on in a CI environment.
## 1.3.0 - 2014-03-10
- **Removed support for node 0.8.** It may still work but we will no longer fix bugs for older versions of node.
- Add **Bower Insight** for opt-in analytics integration to help improve tool and gain insight on community trends
- Old overview of [Insight](https://github.com/yeoman/yeoman/wiki/Insight), [Issue #260](https://github.com/bower/bower/issues/260)
- Reporting to GA. Public Dashboard is in progress.
- [Turn off interactive mode](https://github.com/bower/bower/issues/1162) if you run Bower in a CI environment
- Add `moduleType` property to bower init ([#934](https://github.com/bower/bower/pull/934))
- Fix prune command to log only after cleanup is completed ([#1023](https://github.com/bower/bower/issues/1023))
- Fix git resolver to ignore pre-release versions ([#1017](https://github.com/bower/bower/issues/1017))
- Fix shorthand flag for `save` option on `uninstall` command ([#1031](https://github.com/bower/bower/pull/1031))
- Add `bower version` command ([#961](https://github.com/bower/bower/pull/961))
- Add .bowerrc option to use `--save` by default when using `bower install` command ([#1074](https://github.com/bower/bower/pull/1074))
- Fix git resolver caching ([#1083](https://github.com/bower/bower/issues/1083))
- Fix reading versions from cache directory ([#1076](https://github.com/bower/bower/pull/1076))
- Add svn support ([#1055](https://github.com/bower/bower/pull/1055))
- Allow circular dependencies to be installed ([#1104](https://github.com/bower/bower/pull/1104))
- Add scripts/hooks support ([#718](https://github.com/bower/bower/pull/718))
_NOTE_: It's advisable that users use `--config.interactive=false` on automated scripts.
## 1.2.8 - 2013-12-02
- Fix absolute paths ending with / not going through the FsResolver, ([#898](https://github.com/bower/bower/issues/898))
- Allow query string parameters in package URLs
- Swapped 'unzip' module for 'decompress-zip', and some other small unzipping fixes([#873](https://github.com/bower/bower/issues/873), [#896](https://github.com/bower/bower/issues/896))
- Allow the root-check to be overridden when calling bower programmatically.
- Fixed some bugs relating to packages with a very large dependency tree
- Fix a bug caused by a recent change to semver
## 1.2.7 - 2013-09-29
- Do not swallow sync errors when using the programmatic API ([#849](https://github.com/bower/bower/issues/849))
- Fix resolutions not being saved if `--force-latest` is specified ([#861](https://github.com/bower/bower/issues/861))
- Fix `bower register` warning about URL conversion, even if no conversion occurred
- Fix `bower update` not correctly catching up branch commits
- Add configured directory in `.bowerrc` to the ignores in `bower init` ([#854](https://github.com/bower/bower/issues/854))
- Fix some case sensitive issues with data stored in registry cache (e.g.: jquery/jQuery, [#859](https://github.com/bower/bower/issues/859))
- Fix bower not checking out a tag if it looks like a semver (e.g.: 1.0, [#872](https://github.com/bower/bower/issues/872))
- Fix install & update commands printing the wrong versions in some cases ([#879](https://github.com/bower/bower/issues/879))
- Give priority to mime type headers when deciding if a package need to be extracted, except if it is `octet-stream`
_NOTE_: It's advisable that users run `bower cache clean`.
## 1.2.6 - 2013-09-04
- Bower now reports download progress even for servers that do not respond with `content-length` header.
- Do not translate endpoints when registering a package to a private registry server ([#832](https://github.com/bower/bower/issues/832))
- Detect corrupted downloads by comparing downloaded bytes with `content-length` header if possible; this fixes Bower silently failing on unstable networks ([#824](https://github.com/bower/bower/issues/824) and [#792](https://github.com/bower/bower/issues/792))
- Fix quotes in fields causing Bower to crash in the `init` command ([#841](https://github.com/bower/bower/issues/841))
## 1.2.5 - 2013-08-28
- Fix persistent conflict resolutions not working correctly for branches ([#818](https://github.com/bower/bower/issues/818))
- Fix Bower failing to run if HOME is not set ([#826](https://github.com/bower/bower/issues/826))
- Bower now prints a warning if HOME is not set ([#827](https://github.com/bower/bower/issues/827))
- Fix progress message being fired after completion of long running `git clone` commands
- Other minor improvements
## 1.2.4 - 2013-08-23
- Fix ignored nested folders not being correctly handled in some cases ([#814](https://github.com/bower/bower/issues/814))
## 1.2.3 - 2013-08-22
- Fix read of environment variables that map to config properties with dashes and also support nested ones ([#8@bower-config](https://github.com/bower/config/issues/8))
- Fix `bower info <package> <property>` printing the available versions (it shouldn't!)
- Fix interactive shell not being correctly detected in node `0.8.x` ([#802](https://github.com/bower/bower/issues/802))
- Fix `extraneous` flag in the `list` command being incorrectly set for saved dev dependencies in some cases
- Fix linked dependencies not being read in `bower list` on Windows ([#813](https://github.com/bower/bower/issues/813))
- Fix update notice not working with `--json`
## 1.2.2 - 2013-08-20
- Standardize prompt behaviour with and without `--json`
- Improve detection of `git` servers that do not support shallow clones ([#805](https://github.com/bower/bower/issues/805))
- Ignore remote tags (tags ending with ^{})
- Fix bower not saving the correct endpoint in some edge cases ([#806](https://github.com/bower/bower/issues/806))
## 1.2.1 - 2013-08-19
- Fix bower throwing on non-semver targets ([#800](https://github.com/bower/bower/issues/800))
## 1.2.0 - 2013-08-19
- __Bower no longer installs a pre-release version by default, that is, if no version/range is specified__ ([#782](https://github.com/bower/bower/issues/782))
- __`bower info <package>` will now show the latest `<package>` information along with the available versions__ ([#759](https://github.com/bower/bower/issues/759))
- __`bower link` no longer requires an elevated user on Windows in most cases__ ([#472](https://github.com/bower/bower/issues/472))
- __Init command now prompts for the whole `bower.json` spec properties, filling in default values for `author` and `homepage` based on `git` settings__ ([#693](https://github.com/bower/bower/issues/693))
- Changes to endpoint sources in `bower.json` are now catched up by `bower install` and `bower update` ([#788](https://github.com/bower/bower/issues/788))
- Allow semver ranges in `bower cache clean`, e.g. `bower cache clean jquery#<2.0.0` ([#688](https://github.com/bower/bower/issues/688))
- Normalize `bower list --paths` on Windows ([#279](https://github.com/bower/bower/issues/279))
- Multiple mains are now correctly outputted as an array in `bower list --paths` ([#784](https://github.com/bower/bower/issues/784))
- Add `--relative` option to `bower list --json` so that Bower outputs relative paths instead of absolute ([#714](https://github.com/bower/bower/issues/714))
- `bower list --paths` now outputs relative paths by default; can be turned off with `--no-relative` ([#785](https://github.com/bower/bower/issues/785))
- Bower no longer fails if `symlinks` to files are present in the `bower_components` folder ([#783](https://github.com/bower/bower/issues/783) and [#791](https://github.com/bower/bower/issues/791))
- Disable git templates/hooks when running `git` ([#761](https://github.com/bower/bower/issues/761))
- Add instructions to setup git workaround for proxies when execution of `git` fails ([#250](https://github.com/bower/bower/issues/250))
- Ignore `component.json` if it looks like a component(1) file ([#556](https://github.com/bower/bower/issues/556))
- Fix multi-user usage on bower when it creates temporary directories to hold some files
- Fix prompting causing an invalid JSON output when running commands with `--json`
- When running Bower commands programmatically, prompting is now disabled by default (see the updated programmatic [usage](https://github.com/bower/bower#programmatic-api) for more info)
- Other minor improvements and fixes
Fix for `#788` requires installed components to be re-installed.
## 1.1.2 - 2013-08-10
- Detect and fallback if the git server does not support `--depth=1` when cloning ([#747](https://github.com/bower/bower/issues/747))
## 1.1.1 - 2013-08-08
- Fix silent fail when spawning child processes in some edge cases ([#722](https://github.com/bower/bower/issues/722))
- Fix `home` command not guessing the correct URL for `GitHub` ssh endpoints (requires `bower cache-clean`)
- Fix bower not correctly filtering packages with symlinks in some cases ([#730](https://github.com/bower/bower/issues/730))
- Fix multi-user usage on bower when it falls back to create a `/tmp/bower` folder ([#743](https://github.com/bower/bower/issues/743))
- Bower now sends a fake user agent when behind a proxy by default, so that corporate proxies do not block requests ([#698](https://github.com/bower/bower/issues/698))
- Bower now translates GitHub public `git://` URLs to `git@` when behind a proxy ([#731](https://github.com/bower/bower/issues/731))
- Minor improvements to the CLI output on small terminals
- Minor programmatic usage improvements
- Minor help usage fixes
## 1.1.0 - 2013-08-03
- __Fix `--save` and `--save-dev` not working correctly for the uninstall command in some situations__
- __Attempting to register a package that declares `"private": true` in `bower.json` will result in an error ([#162](https://github.com/bower/bower/issues/162))__
- __Fix retry strategy on download error that was causing some strange I/O errors__ ([#699](https://github.com/bower/bower/issues/699) and [#704](https://github.com/bower/bower/issues/704))
- __`bower prune` now clears pruned packages dependencies if they are also extraneous__ ([#708](https://github.com/bower/bower/issues/708))
- __`bower uninstall` now uninstalls uninstalled packages dependencies if they are not shared ([#609](https://github.com/bower/bower/issues/609))__
- Fix `bower list` display the `incompatible` label even if they are compatible ([#710](https://github.com/bower/bower/issues/710))
- Fix `bower cache clean` not working correctly when `package#non-semver` is specified
- Implement no operation `completion` command to prevent weird output when hitting tab ([#691](https://github.com/bower/bower/issues/691))
- Fix `bower info --help` ([#703](https://github.com/bower/bower/issues/703))
- Add colorized output for `bower info <package>#<version>` ([#571](https://github.com/bower/bower/issues/571))
- Added `bower ls` as an alias to `bower list`
- Fix regression: do not create a json file when saving is required, warn instead
- Ignore linked packages when reading dependencies in `bower init` ([#709](https://github.com/bower/bower/issues/709))
- `bower list` is now able to (partially) reconstruct the dependency tree, even for dependencies not declared in `bower.json` ([#622](https://github.com/bower/bower/issues/622))
## 1.0.3 - 2013-07-30
- Fix some changes not being saved to bower.json ([#685](https://github.com/bower/bower/issues/685))
- Fix `bower info <package> <property>` not showing information related to property of the latest version of that package ([#684](https://github.com/bower/bower/issues/684))
## 1.0.2 - 2013-07-30
- Fix severe bug originated from a wrong merge that caused conflict messages to not show up correctly
## 1.0.1 - 2013-07-29
- Fix `bower register` going ahead even if the answer was `no` ([#644](https://github.com/bower/bower/issues/644))
- Fix local endpoints with backslashes on Windows ([#2@endpoint-parser](https://github.com/bower/endpoint-parser/pull/2))
- Fix usage of multiple registries in the registry-client ([#3@registry-client](https://github.com/bower/registry-client/pull/3) and [#2@registry-client](https://github.com/bower/registry-client/pull/2))
- File extensions now have more priority than mime types when deciding if extraction is necessary ([#657](https://github.com/bower/bower/pull/657))
- Fix `Bower` not working when calling `.bat`/`.cmd` commands on Windows; it affected people using `Git portable` ([#626](https://github.com/bower/bower/issues/626))
- Fix `bower list --paths` not resolving all files to absolute paths when the `main` property contained multiple files ([660](https://github.com/bower/bower/issues/660))
- Fix `Bower` renaming `bower.json` and `component.json` files to `index.json` when it was the only file in the folder ([#674](https://github.com/bower/bower/issues/674))
- Ignore symlinks when copying/extracting since they are not portable, specially across different hard-drives ([#665](https://github.com/bower/bower/issues/665))
- Local file/dir endpoints are now exclusively referenced by an absolute path or relative path starting with `.` ([#666](https://github.com/bower/bower/issues/666))
- Linked packages `bower.json` files are now parsed, making `bower list` account linked packages dependencies ([#659](https://github.com/bower/bower/issues/659))
- Bower now fails to run with sudo unless `--allow-root` is passed ([#498](https://github.com/bower/bower/issues/498))
- Add additional system information such as node version, bower version, OS version when an error occurs ([#670](https://github.com/bower/bower/issues/670))
- `bower install` no longer overwrites `linked` packages unless it needs to ([#593](https://github.com/bower/bower/issues/593)).
- All endpoint parts are now trimmed so that the Manager can better detect similar endpoints ([#3@endpoint-parser](https://github.com/bower/endpoint-parser/pull/3))
- `bower register` now shows the server that will be used ([#647](https://github.com/bower/endpoint-parser/pull/647))
## 1.0.0 - 2013-07-23
Total rewrite of bower.
The list bellow highlights the most important stuff.
For a complete list of changes that this rewrite and release brings please read: https://github.com/bower/bower/wiki/Rewrite-state
- Clear architecture and separation of concerns
- Much much faster
- `--json` output for all commands
- `--offline` usage for all commands, except `register`
- Proper `install` and `update` commands, similar to `npm` in behaviour
- Named endpoints when installing, e.g. `bower install backbone-amd=backbone#~1.0.0`
- New interactive conflict resolution strategy
- Prevent human errors when using `register`
- New `home` command, similar to `npm`
- New `cache list` command
- New `prune` command
- Many many general bug fixes
Non-backwards compatible changes:
- The value of the `json` property from .bowerrc is no longer used
- `--map` and `--sources` from the list command were removed, use `--json` instead
- Programmatic usage changed, specially the commands interface
Users upgrading from `bower-canary` and `bower@~0.x.x` should do a `bower cache clean`.
Additionally you may remove the `~/.bower` folder manually since it's no longer used.
On Windows the folder is located in `AppData/bower`.
## 0.10.0 - 2013-07-02
- __Allow specific commits to be targeted__ ([#275](https://github.com/bower/bower/issues/275))
- __Change bower default folder from `components` to `bower_components`__ ([#434](https://github.com/bower/bower/issues/434))
- __Support semver pre-releases and builds__ ([#188](https://github.com/bower/bower/issues/188))
- Use `Content-Type` and `Content-Disposition` to guess file types, such as zip files ([#454](https://github.com/bower/bower/pull/454))
- Fix bower failing silently when using an invalid version value in the bower.json file ([#439](https://github.com/bower/bower/issues/439))
- Fix bower slowness when downloading after redirects ([#437](https://github.com/bower/bower/issues/437))
- Detect and error out with a friendly message when `git` is not installed ([#362](https://github.com/bower/bower/issues/362))
- Add `--quiet` and `--silent` CLI options ([#343](https://github.com/bower/bower/issues/343))
- Minor programmatic usage improvements
_NOTE_: The `components` folder will still be used if already created, making it easier for users to upgrade.
## 0.9.2 - 2013-04-28
- Better fix for [#429](https://github.com/bower/bower/issues/429)
## 0.9.1 - 2013-04-27
- Update `package.json`, docs and other stuff to point to the new `Bower` organisation on GitHub
- Fix root label of `bower list` being an absolute path; now uses the package name
- Fix `bower update <pkg>` updating all packages; now throws when updating an unknown package
- Fix `list` command when package use different names than the `guessed` one ([#429](https://github.com/bower/bower/issues/429))
## 0.9.0 - 2013-04-25
- __Change from `component.json` to `bower.json`__ ([#39](https://github.com/twitter/bower/issues/39))
- __Change from `component.json` to `bower.json`__ ([#39](https://github.com/bower/bower/issues/39))
- __Compatibility with `node 0.10.x`, including fix hangs/errors when extracting `zip` files__
- Fix `--save` and `--save-dev` not working with URLs that get redirected ([#417](https://github.com/twitter/bower/issues/417))
- Fix `init` command targeting `~commit` instead of `*`. ([#385](https://github.com/twitter/bower/issues/385))
- Remove temporary directories before exiting ([#345](https://github.com/twitter/bower/issues/345))
- Integrate `update-notifier` ([#202](https://github.com/twitter/bower/issues/202))
- Use `json` name when a package name was inferred ([#192](https://github.com/twitter/bower/issues/192))
- Fix `bin/bower` not exiting with an exit code greater than zero when an error occurs ([#187](https://github.com/twitter/bower/issues/187))
- Fix `--save` and `--save-dev` not working with URLs that get redirected ([#417](https://github.com/bower/bower/issues/417))
- Fix `init` command targeting `~commit` instead of `*`. ([#385](https://github.com/bower/bower/issues/385))
- Remove temporary directories before exiting ([#345](https://github.com/bower/bower/issues/345))
- Integrate `update-notifier` ([#202](https://github.com/bower/bower/issues/202))
- Use `json` name when a package name was inferred ([#192](https://github.com/bower/bower/issues/192))
- Fix `bin/bower` not exiting with an exit code greater than zero when an error occurs ([#187](https://github.com/bower/bower/issues/187))
- Fix `--save` and `--save-dev` saving resolved shorthands instead of the actual shorthands
- Fix bower using user defined git templates ([#324](https://github.com/twitter/bower/issues/324))
- Add command abbreviations ([#262](https://github.com/twitter/bower/issues/262))
- Fix bower using user defined git templates ([#324](https://github.com/bower/bower/issues/324))
- Add command abbreviations ([#262](https://github.com/bower/bower/issues/262))
- Improve help messages and fix abuse of colors in output
- Wait for every package to resolve before printing error messages ([#290](https://github.com/twitter/bower/issues/290))
- Add `shorthand_resolver` to allow shorthands to be resolved to repositories other than GitHub ([#278](https://github.com/twitter/bower/issues/278))
- Wait for every package to resolve before printing error messages ([#290](https://github.com/bower/bower/issues/290))
- Add `shorthand_resolver` to allow shorthands to be resolved to repositories other than GitHub ([#278](https://github.com/bower/bower/issues/278))
## 0.8.6 - 2013-04-03
- Emergency fix for `node 0.8.x` users to make `zip` extraction work again
@@ -25,57 +547,57 @@
## 0.8.4 - 2013-03-01
- Fix some more duplicate async callbacks being called twice
- Preserve new lines when saving `component.json` ([#285](https://github.com/twitter/bower/issues/285))
- Preserve new lines when saving `component.json` ([#285](https://github.com/bower/bower/issues/285))
## 0.8.3 - 2013-02-27
- Fix error when using the `update` command ([#282](https://github.com/twitter/bower/issues/282))
- Fix error when using the `update` command ([#282](https://github.com/bower/bower/issues/282))
## 0.8.2 - 2013-02-26
- Fix some errors in windows while removing directories, had to downgrade `rimraf` ([#274](https://github.com/twitter/bower/issues/274))
- Prevent duplicate package names in error summaries ([#277](https://github.com/twitter/bower/issues/277))
- Fix some errors in windows while removing directories, had to downgrade `rimraf` ([#274](https://github.com/bower/bower/issues/274))
- Prevent duplicate package names in error summaries ([#277](https://github.com/bower/bower/issues/277))
## 0.8.1 - 2013-02-25
- Fix some async callbacks being fired twice ([#274](https://github.com/twitter/bower/issues/274))
- Fix some async callbacks being fired twice ([#274](https://github.com/bower/bower/issues/274))
## 0.8.0 - 2013-02-24
- __Add init command similar to `npm init`__ ([#219](https://github.com/twitter/bower/issues/219))
- __Add devDependencies__ support ([#251](https://github.com/twitter/bower/issues/251))
- __Add `--save-dev` flag to install/uninstall commands__ ([#258](https://github.com/twitter/bower/issues/258))
- `cache-clean` command now clears links pointing to nonexistent folders ([#182](https://github.com/twitter/bower/issues/182))
- Fix issue when downloading assets behind a proxy using `https` ([#230](https://github.com/twitter/bower/issues/230))
- Fix --save saving unresolved components ([#240](https://github.com/twitter/bower/issues/240))
- Fix issue when extracting some zip files ([#225](https://github.com/twitter/bower/issues/225))
- __Add init command similar to `npm init`__ ([#219](https://github.com/bower/bower/issues/219))
- __Add devDependencies__ support ([#251](https://github.com/bower/bower/issues/251))
- __Add `--save-dev` flag to install/uninstall commands__ ([#258](https://github.com/bower/bower/issues/258))
- `cache-clean` command now clears links pointing to nonexistent folders ([#182](https://github.com/bower/bower/issues/182))
- Fix issue when downloading assets behind a proxy using `https` ([#230](https://github.com/bower/bower/issues/230))
- Fix --save saving unresolved components ([#240](https://github.com/bower/bower/issues/240))
- Fix issue when extracting some zip files ([#225](https://github.com/bower/bower/issues/225))
- Fix automatic conflict resolver not selecting the correct version
- Add `--sources` option to the `list` command ([#235](https://github.com/twitter/bower/issues/235))
- Automatically clear cache when git commands fail with code 128 ([#216](https://github.com/twitter/bower/issues/216))
- Fix `bower` not working correctly behind a proxy in some commands ([#208](https://github.com/twitter/bower/issues/208))
- Add `--sources` option to the `list` command ([#235](https://github.com/bower/bower/issues/235))
- Automatically clear cache when git commands fail with code 128 ([#216](https://github.com/bower/bower/issues/216))
- Fix `bower` not working correctly behind a proxy in some commands ([#208](https://github.com/bower/bower/issues/208))
## 0.7.1 - 2013-02-20
- Remove postinstall script from `bower` installation
## 0.7.0 - 2013-02-01
- __Ability to resolve conflicts__ ([#214](https://github.com/twitter/bower/issues/214))
- __Ability to resolve conflicts__ ([#214](https://github.com/bower/bower/issues/214))
- __Ability to search and publish to different endpoints by specifying them in the `.bowerrc` file__
- __Experimental autocompletion__
- __Ability to exclude (ignore) files__
- Fix minor issues in the cache clean command
- Better error message for invalid semver tags ([#185](https://github.com/twitter/bower/issues/185))
- Better error message for invalid semver tags ([#185](https://github.com/bower/bower/issues/185))
- Only show discover message in the list command only if there are packages
- Fix mismatch issue due to reading cached component.json files ([#214](https://github.com/twitter/bower/issues/214))
- Better error messages when reading invalid .bowerrc files ([#220](https://github.com/twitter/bower/issues/220))
- Fix update command when used in packages pointing to assets ([#197](https://github.com/twitter/bower/issues/197))
- Bower now obeys packages's `.bowerrc` if they define a different `json` ([#205](https://github.com/twitter/bower/issues/205))
- Fix mismatch issue due to reading cached component.json files ([#214](https://github.com/bower/bower/issues/214))
- Better error messages when reading invalid .bowerrc files ([#220](https://github.com/bower/bower/issues/220))
- Fix update command when used in packages pointing to assets ([#197](https://github.com/bower/bower/issues/197))
- Bower now obeys packages's `.bowerrc` if they define a different `json` ([#205](https://github.com/bower/bower/issues/205))
## 0.6.8 - 2012-12-14
- Improve list command
- Does not fetch versions if not necessary (for --map and --paths options)
- Add --offline option to prevent versions from being fetched
- Fix uninstall command not firing the `end` event
- Fix error when executing an unknown command ([#179](https://github.com/twitter/bower/issues/179))
- Fix error when executing an unknown command ([#179](https://github.com/bower/bower/issues/179))
- Fix help for the ls command (alias of list)
## 0.6.7 - 2012-12-10
- Fix uninstall removing all unsaved dependencies ([#178](https://github.com/twitter/bower/issues/178))
- Fix uninstall removing all unsaved dependencies ([#178](https://github.com/bower/bower/issues/178))
- Fix uninstall --force flag in some cases
- Add --silent option to the register option, to avoid questioning
- Fix possible issues with options in some commands
@@ -90,18 +612,18 @@
- Fix bower not fetching latest commits correctly in some cases
## 0.6.4 - 2012-11-29
- Fix permission on downloaded files ([#160](https://github.com/twitter/bower/issues/160))
- Fix permission on downloaded files ([#160](https://github.com/bower/bower/issues/160))
## 0.6.3 - 2012-11-24
- Fix version not being correctly set for local packages ([#155](https://github.com/twitter/bower/issues/155))
- Fix version not being correctly set for local packages ([#155](https://github.com/bower/bower/issues/155))
## 0.6.2 - 2012-11-23
- Fix uninstall --save when there is no component.json
## 0.6.1 - 2012-11-22
- Fix uninstall when the project component.json has no deps saved ([#153](https://github.com/twitter/bower/issues/153))
- Fix uncaught errors when using file writter (they are now caught and reported)
- Fix temporary directories not being deleted when an exception occurs ([#153](https://github.com/twitter/bower/issues/140))
- Fix uninstall when the project component.json has no deps saved ([#153](https://github.com/bower/bower/issues/153))
- Fix uncaught errors when using file writer (they are now caught and reported)
- Fix temporary directories not being deleted when an exception occurs ([#153](https://github.com/bower/bower/issues/140))
## 0.6.0 - 2012-11-21
- __Add link command__ (similar to npm)
@@ -116,13 +638,13 @@
## 0.5.0 - 2012-11-19
- __Remove package.json support__
- __Support for local path repositories__ ([#132](https://github.com/twitter/bower/issues/132))
- __Support for local path repositories__ ([#132](https://github.com/bower/bower/issues/132))
- `install --save` now saves the correct tag (e.g: ~0.0.1) instead of 'latest'
- `install --save` now saves packages pointing directly to assets correctly
- Bower automatically creates a component.json when install with `--save` is used
- Fix issues with list command ([#142](https://github.com/twitter/bower/issues/142))
- Fix local paths not being saved when installing with --save ([#114](https://github.com/twitter/bower/issues/114))
- `uninstall` now uninstalls nested dependencies if they are not shared ([#83](https://github.com/twitter/bower/issues/83))
- Fix issues with list command ([#142](https://github.com/bower/bower/issues/142))
- Fix local paths not being saved when installing with --save ([#114](https://github.com/bower/bower/issues/114))
- `uninstall` now uninstalls nested dependencies if they are not shared ([#83](https://github.com/bower/bower/issues/83))
- `uninstall` now warns when a dependency conflict occurs and aborts.
It will only proceed if the `--force` flag is passed
- Bower now detects mismatches between the version specified in the component.json and the tag, informing the user

View File

@@ -1,13 +1,26 @@
# Contributing to Bower
Please take a moment to review this document in order to make the contribution
process easy and effective for everyone involved.
Bower is a large community project with many different developers contributing at all levels to the project. We're **actively** looking for more contributors right now. If you're interested in becoming a Bower maintainer or supporting in any way, please fill the following form: http://goo.gl/forms/P1ndzCNoiG. There is more information about [contributing](https://github.com/bower/bower/wiki/Contributor-Guidelines) in the Wiki.
Following these guidelines helps to communicate that you respect the time of
the developers managing and developing this open source project. In return,
they should reciprocate that respect in addressing your issue, assessing
changes, and helping you finalize your pull requests.
<a name="bugs"></a>
## 🐛 [Bug reports](https://github.com/bower/bower/wiki/Report-a-Bug)
## Casual Involvement
* Improve the bower.io site ([tickets](https://github.com/bower/bower.github.io/issues))
* Comment on issues and drive to resolution
## High-impact Involvement
* Maintaining the bower client.
* Read [Architecture doc](https://github.com/bower/bower/wiki/Rewrite-architecture)
* Triage, close, fix and resolve [issues](https://github.com/bower/bower/issues)
## Team Meetings
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.
## Using the issue tracker
@@ -16,7 +29,8 @@ 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), our
[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.
@@ -24,49 +38,6 @@ requests](#pull-requests), but please respect the following restrictions:
* Please **do not** derail or troll issues. Keep the discussion on topic and
respect the opinions of others.
<a name="bugs"></a>
## Bug reports
A bug is a _demonstrable problem_ that is caused by the code in the repository.
Good bug reports are extremely helpful - thank you!
Guidelines for bug reports:
1. **Use the GitHub issue search** &mdash; check if the issue has already been
reported.
2. **Check if the issue has been fixed** &mdash; try to reproduce it using the
latest `master` or development branch in the repository.
3. **Isolate the problem** &mdash; ideally create a [reduced test
case](http://css-tricks.com/6263-reduced-test-cases/).
A good bug report shouldn't leave others needing to chase you up for more
information. Please try to be as detailed as possible in your report. What is
your environment? What steps will reproduce the issue? What OS experiences the
problem? What would you expect to be the outcome? All these details will help
people to fix any potential bugs.
Example:
> Short and descriptive example bug report title
>
> A summary of the issue and the browser/OS environment in which it occurs. If
> suitable, include the steps required to reproduce the bug.
>
> 1. This is the first step
> 2. This is the second step
> 3. Further steps, etc.
>
> `<url>` - a link to the reduced test case
>
> Any other information you want to share that is relevant to the issue being
> reported. This might include the lines of code that you have identified as
> causing the bug, and potential solutions (and your opinions on their
> merits).
<a name="features"></a>
## Feature requests
@@ -103,7 +74,7 @@ included in the project:
# Navigate to the newly cloned directory
cd bower
# Assign the original repo to a remote called "upstream"
git remote add upstream https://github.com/twitter/bower
git remote add upstream https://github.com/bower/bower
```
2. If you cloned a while ago, get the latest changes from upstream:
@@ -150,6 +121,8 @@ included in the project:
force push to your remote feature branch. You may also be asked to squash
commits.
10. If you are asked to squash your commits, then please use `git rebase -i master`. It will ask you to pick your commits - pick the major commits and squash the rest.
**IMPORTANT**: By submitting a patch, you agree to license your work under the
same license as that used by the project.

View File

@@ -1,7 +0,0 @@
Copyright (c) 2012 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 the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

View File

@@ -1,7 +0,0 @@
test: node_modules
./node_modules/.bin/mocha -R spec -t 10000
node_modules: package.json
npm install
.PHONY: test

363
README.md
View File

@@ -1,355 +1,126 @@
# BOWER [![Build Status](https://secure.travis-ci.org/twitter/bower.png?branch=master)](http://travis-ci.org/twitter/bower)
# Bower - A package manager for the web
Bower is a package manager for the web. It offers a generic, unopinionated
solution to the problem of **front-end package management**, while exposing the
package dependency model via an API that can be consumed by a more opinionated
build stack. There are no system wide dependencies, no dependencies are shared
between different apps, and the dependency tree is flat.
> 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)
Bower runs over Git, and is package-agnostic. A packaged component can be made
up of any type of asset, and use any type of transport (e.g., AMD, CommonJS,
etc.).
[![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)
[View all packages available through Bower's registry](http://sindresorhus.com/bower-components/).
<img align="right" height="300" src="http://bower.io/img/bower-logo.png">
---
## Installing Bower
Bower offers a generic, unopinionated solution to the problem of **front-end package management**, while exposing the package dependency model via an API that can be consumed by a more opinionated build stack. There are no system wide dependencies, no dependencies are shared between different apps, and the dependency tree is flat.
Bower depends on [Node](http://nodejs.org/) and [npm](http://npmjs.org/). It's
installed globally using npm:
Bower runs over Git, and is package-agnostic. A packaged component can be made up of any type of asset, and use any type of transport (e.g., AMD, CommonJS, etc.).
**View complete docs on [bower.io](http://bower.io)**
[View all packages available through Bower's registry](http://bower.io/search/).
## Install
```sh
$ npm install -g bower
```
npm install -g bower
```
Bower depends on [Node.js](http://nodejs.org/) and [npm](http://npmjs.org/). Also make sure that [git](http://git-scm.com/) is installed as some bower
packages require it to be fetched and installed.
## Usage
Much more information is available via `bower help` once it's installed. This
is just enough to get you started.
See complete command line reference at [bower.io/docs/api/](http://bower.io/docs/api/)
### Installing packages and dependencies
Bower offers several ways to install packages:
```sh
# install dependencies listed in bower.json
$ bower install
```bash
# Using the dependencies listed in the current directory's bower.json
bower install
# Using a local or remote package
bower install <package>
# Using a specific Git-tagged version from a remote package
bower install <package>#<version>
# install a package and add it to bower.json
$ bower install <package> --save
# install specific version of a package and add it to bower.json
$ bower install <package>#<version> --save
```
Where `<package>` can be any one of the following:
* A name that maps to a package registered with Bower, e.g, `jquery`. ‡
* A remote Git endpoint, e.g., `git://github.com/someone/some-package.git`. Can be
public or private. ‡
* A local Git endpoint, i.e., a folder that's a Git repository. ‡
* A shorthand endpoint, e.g., `someone/some-package` (defaults to GitHub). ‡
* A URL to a file, including `zip` and `tar.gz` files. It's contents will be
extracted.
‡ These types of `<package>` make Git tags available. You can specify a
[semver](http://semver.org/) tag to fetch a specific release, and lock the
package to that version.
All package contents are installed in the `components` directory by default.
You should **never** directly modify the contents of this directory.
Using `bower list` will show all the packages that are installed locally.
**N.B.** If you aren't authoring a package that is intended to be consumed by
others (e.g., you're building a web app), you should always check installed
packages into source control.
### Finding packages
To search for packages registered with Bower:
```
bower search [<name>]
```
Using just `bower search` will list all packages in the registry.
### Using packages
The easiest approach is to use Bower statically, just reference the package's
installed components manually using a `script` tag:
We discourage using bower components statically for performance and security reasons (if component has an `upload.php` file that is not ignored, that can be easily exploited to do malicious stuff).
```html
<script src="components/jquery/index.js"></script>
```
For more complex projects, you'll probably want to concatenate your scripts or
use a module loader. Bower is just a package manager, but there are plenty of
other tools -- such as [Sprockets](https://github.com/sstephenson/sprockets)
and [RequireJS](http://requirejs.org/) -- that will help you do this.
### Registering packages
To register a new package, there **must** be a valid manifest JSON in the
current working directory, your package **must** be available at a Git endpoint
(e.g., GitHub), and it should use [semver](http://semver.org/) Git tags. Then
run:
```
bower register <my-package-name> <git-endpoint>
```
The Bower registry does not have authentication or user management. It's on a
first come, first served basis. Think of it like a URL shortener. Now anyone
can run `bower install <my-package-name>`, and get your library installed.
There is no direct way to unregister a package yet. For now, you can [request a
package be unregistered](https://github.com/twitter/bower/issues/120).
The best approach is to process components installed by bower with build tool (like [Grunt](http://gruntjs.com/) or [gulp](http://gulpjs.com/)), and serve them concatenated or using a module loader (like [RequireJS](http://requirejs.org/)).
### Uninstalling packages
To uninstall a locally installed package:
```
bower uninstall <package-name>
```sh
$ bower uninstall <package-name>
```
### prezto and oh-my-zsh users
## Configuration
On `prezto` or `oh-my-zsh`, do not forget to `alias bower='noglob bower'` or `bower install jquery\#1.9.1`
Bower can be configured using JSON in a `.bowerrc` file.
### Never run Bower with sudo
Global configuration is handled by creating a `.bowerrc` in your home directory
(i.e., `~/.bowerrc`). Local configuration is handled by creating a `.bowerrc`
in your project's directory, allowing you to version a project-specific Bower
configuration with the rest of your code base.
Bower is a user command; there is no need to execute it with superuser permissions.
Bower will combine the local and global configurations (with local settings
taking precedence).
The `.bowerrc` defines several options:
* `directory`: Set the default directory to install packaged components into.
* `endpoint`: Set a custom registry endpoint.
* `json`: Set the default JSON file for Bower to use when resolving dependencies.
* `searchpath`: An array of additional URLs pointing to read-only Bower registries.
* `shorthand_resolver`: Define a custom template for shorthand package names.
```json
{
"directory": "bower_components",
"endpoint": "https://bower.mycompany.com",
"json": "bower.json",
"searchpath": [
"https://bower.herokuapp.com"
],
"shorthand_resolver": "git://example.com/{{{ organization }}}/{{{ package }}}.git"
}
```
The `searchpath` array is useful if your organization wishes to maintain a
private registry of packages while also taking advantage of public Bower
registries. If a package is not found at your private endpoint, Bower will
consult the registries specified in the `searchpath` array.
The `shorthand_resolver` key provides support for defining a custom template
which Bower uses when constructing a URL for a given shorthand. For example, if
a shorthand of `twitter/flight` or `twitter/flight#v1.0.0` is specified in the
package manifest, the following data can be referenced from within the
`.bowerrc` as part of the `shorthand_resolver` template:
* `endpoint`: `twitter/flight`
* `organization`: `twitter`
* `package`: `flight`
**N.B.** To run your own Bower Endpoint for custom packages that are behind a
firewall, you can use a simple implementation of the [Bower
Server](https://github.com/twitter/bower-server).
## Defining a package
You must create a JSON file -- `bower.json` by default -- in your project's
root, and specify all of its dependencies. This is similar to Node's
`package.json`, or Ruby's `Gemfile`, and is useful for locking down a project's
dependencies.
You can interactively create a `bower.json` with the following command:
```
bower init
```
The `bower.json` defines several options:
* `name` (required): The name of your package.
* `version`: A semantic version number (see [semver](http://semver.org/)).
* `main` [string|array]: The primary endpoints of your package.
* `ignore` [array]: An array of paths not needed in production that you want
Bower to ignore when installing your package.
* `dependencies` [hash]: Packages your package depends upon in production.
* `devDependencies` [hash]: Development dependencies.
```json
{
"name": "my-project",
"version": "1.0.0",
"main": "path/to/main.css",
"ignore": [
".jshintrc",
"**/*.txt"
],
"dependencies": {
"<name>": "<version>",
"<name>": "<folder>",
"<name>": "<package>"
},
"devDependencies": {
"<test-framework-name>": "<version>"
}
}
```
## Consuming a package
Bower also makes available a source mapping. This can be used by build tools to
easily consume Bower packages.
If you pass the `--map` option to Bower's `list` command, it will generate JSON
with dependency objects. Alternatively, you can pass the `--paths` option to
the `list` command to get a simple path-to-name mapping:
```json
{
"backbone": "components/backbone/index.js",
"jquery": "components/jquery/index.js",
"underscore": "components/underscore/index.js"
}
```
## Programmatic API
Bower provides a powerful, programmatic API. All commands can be accessed
through the `bower.commands` object.
```js
var bower = require('bower');
bower.commands
.install(paths, options)
.on('end', function (data) {
data && console.log(data);
});
bower.commands
.search('jquery', {})
.on('packages', function(packages) {
// `packages` is a list of packages returned by searching for 'jquery'
});
```
Commands emit four types of events: `data`, `end`, `result`, and `error`.
`error` will only be emitted if something goes wrong. Not all commands emit all
events; for a detailed look, check out the code in `lib/commands`.
`data` is typically a colorized string, ready to show to an end user. `search`
and `lookup` emit `packages` and `package`, respectively. Those events contain
a JSON representation of the result of the command.
For a better of idea how this works, you may want to check out [our bin
file](https://github.com/twitter/bower/blob/master/bin/bower).
For the install command, there is an additional `package` event that is emitted
for each installed/uninstalled package.
## Completion (experimental)
Bower now has an experimental `completion` command that is based on, and works
similarly to the [npm completion](https://npmjs.org/doc/completion.html). It is
not available for Windows users.
This command will output a Bash / ZSH script to put into your `~/.bashrc`,
`~/.bash_profile`, or `~/.zshrc` file.
```
bower completion >> ~/.bash_profile
```
## A note for Windows users
### Windows users
To use Bower on Windows, you must install
[msysgit](http://code.google.com/p/msysgit/) correctly. Be sure to check the
option shown below:
[Git for Windows](http://git-for-windows.github.io/) correctly. Be sure to check the
options shown below:
![msysgit](http://f.cl.ly/items/2V2O3i1p3R2F1r2v0a12/mysgit.png)
<img src="https://cloud.githubusercontent.com/assets/10702007/10532690/d2e8991a-7386-11e5-9a57-613c7f92e84e.png" width="534" height="418" alt="Git for Windows" />
<img src="https://cloud.githubusercontent.com/assets/10702007/10532694/dbe8857a-7386-11e5-9bd0-367e97644403.png" width="534" height="418" alt="Git for Windows" />
Note that if you use TortoiseGit and if Bower keeps asking for your SSH
password, you should add the following environment variable: `GIT_SSH -
C:\Program Files\TortoiseGit\bin\TortoisePlink.exe`. Adjust the `TortoisePlink`
path if needed.
### Ubuntu users
## Contact
To use Bower on Ubuntu, you might need to link `nodejs` executable to `node`:
Have a question?
```
sudo ln -s /usr/bin/nodejs /usr/bin/node
```
## Configuration
Bower can be configured using JSON in a `.bowerrc` file. Read over available options at [bower.io/docs/config](http://bower.io/docs/config).
## Support
* [Discord chat](https://discord.gg/0fFM7QF0KpZRh2cY)
* [StackOverflow](http://stackoverflow.com/questions/tagged/bower)
* [Mailinglist](http://groups.google.com/group/twitter-bower) - twitter-bower@googlegroups.com
* [\#bower](http://webchat.freenode.net/?channels=bower) on Freenode
## Contributing
## Contributing to this project
We welcome [contributions](https://github.com/bower/bower/graphs/contributors) of all kinds from anyone. Please take a moment to review the [guidelines for contributing](CONTRIBUTING.md).
Anyone and everyone is welcome to contribute. Please take a moment to
review the [guidelines for contributing](CONTRIBUTING.md).
* [Bug reports](CONTRIBUTING.md#bugs)
* [Bug reports](https://github.com/bower/bower/wiki/Report-a-Bug)
* [Feature requests](CONTRIBUTING.md#features)
* [Pull requests](CONTRIBUTING.md#pull-requests)
## Authors
* [@fat](https://github.com/fat)
* [@maccman](https://github.com/maccman)
* [@satazor](https://github.com/satazor)
Thanks for assistance and contributions:
* [@addyosmani](https://github.com/addyosmani)
* [@angus-c](https://github.com/angus-c)
* [@borismus](https://github.com/borismus)
* [@carsonmcdonald](https://github/@carsonmcdonald)
* [@chriseppstein](https://github.com/chriseppstein)
* [@danwrong](https://github.com/danwrong)
* [@desandro](https://github.com/desandro)
* [@hemanth](https://github.com/hemanth)
* [@isaacs](https://github.com/isaacs)
* [@josh](https://github.com/josh)
* [@jrburke](https://github.com/jrburke)
* [@marcelombc](https://github.com/marcelombc)
* [@mklabs](https://github.com/mklabs)
* [@paulirish](https://github.com/paulirish)
* [@richo](https://github.com/richo)
* [@rvagg](https://github.com/rvagg)
* [@sindresorhus](https://github.com/sindresorhus)
* [@SlexAxton](https://github.com/SlexAxton)
* [@sstephenson](https://github.com/sstephenson)
* [@tomdale](https://github.com/tomdale)
* [@uzquiano](https://github.com/uzquiano)
* [@visionmedia](https://github.com/visionmedia)
* [@wagenet](https://github.com/wagenet)
* [@wibblymat](https://github.com/wibblymat)
* [@wycats](https://github.com/wycats)
Note that on Windows for tests to pass you need to configure Git before cloning:
```
git config --global core.autocrlf input
```
## License
Copyright 2012 Twitter, Inc.
Copyright (c) 2016 Twitter and [other contributors](https://github.com/bower/bower/graphs/contributors)
Licensed under the MIT License

45
appveyor.yml Normal file
View File

@@ -0,0 +1,45 @@
# http://www.appveyor.com/docs/appveyor-yml
# Set build version format here instead of in the admin panel.
version: "{build}"
# Fix line endings in Windows. (runs before repo cloning)
init:
- git config --global core.autocrlf input
# Test against these versions of Node.js.
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: "6"
# Finish on first failed build
matrix:
fast_finish: true
# Install node, display versions, install dependencies
install:
- ps: Install-Product node $env:nodejs_version
- node --version && npm --version
- git --version && svn --version
- npm install
# Post-install test scripts.
test_script:
- cmd: npm test
# Make clone much faster
shallow_clone: true
# Disable Visual Studio build and deploy
build: off
deploy: off
# Cache node modules, and refresh if package.json changes
cache:
- node_modules -> package.json

View File

@@ -1,66 +0,0 @@
#!/usr/bin/env node
var semver = require('semver');
var nopt = require('nopt');
var path = require('path');
var pkg = require(path.join(__dirname, '..', 'package.json'));
var updateNotifier = require('update-notifier');
var template = require('../lib/util/template');
var bower = require('../lib');
var command;
var options;
var shorthand;
var input = process.argv;
var nodeVer = process.version;
var reqVer = pkg.engines.node;
var errors = [];
var notifier = updateNotifier({ packageName: pkg.name, packageVersion: pkg.version });
if (notifier.update) {
process.stderr.write(template('update-notice', notifier.update, true));
}
process.title = 'bower';
if (reqVer && !semver.satisfies(nodeVer, reqVer)) {
throw new Error('Required: node ' + reqVer);
}
shorthand = { 'v': ['--version'] };
options = { version: Boolean };
options = nopt(options, shorthand, process.argv);
bower.version = pkg.version;
if (options.version) return console.log(bower.version);
command = options.argv.remain && options.argv.remain.shift();
command = bower.abbreviations[command];
if (command) bower.command = command;
// Temporarory fix for #22 #320 #187
var errStatusHandler = function () {
process.removeListener('exit', errStatusHandler);
process.exit(errors.length ? 1 : 0);
};
process.on('exit', errStatusHandler);
bower.commands[bower.command || 'help'].line(input)
.on('data', function (data) {
if (data) process.stdout.write(data);
})
.on('end', function (data) {
if (data) process.stdout.write(data);
})
.on('warn', function (warning) {
process.stderr.write(template('warn', { message: warning }, true));
})
.on('error', function (err) {
if (options.verbose) throw err;
process.stdout.write(template('error', { message: err.message }, true));
errors.push(err);
});

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,164 +0,0 @@
// ==========================================
// BOWER: CacheClean API
// ==========================================
// Copyright 2012 Twitter, Inc
// Licensed under The MIT License
// http://opensource.org/licenses/MIT
// ==========================================
var Emitter = require('events').EventEmitter;
var async = require('async');
var nopt = require('nopt');
var rimraf = require('rimraf');
var path = require('path');
var glob = require('glob');
var fs = require('fs');
var _ = require('lodash');
var help = require('./help');
var config = require('../core/config');
var template = require('../util/template');
var fileExists = require('../util/file-exists');
var optionTypes = { help: Boolean };
var shorthand = { 'h': ['--help'] };
var processCachedPackage = function (emitter, pkg, next) {
removeCachedPackage(pkg, function (err, exists) {
if (err) {
emitter.emit('error', err);
return next();
}
if (exists) {
template('action', { name: 'cache cleared', shizzle: pkg })
.on('data', emitter.emit.bind(emitter, 'data'));
}
next();
});
};
var removeCachedPackage = function (pkg, next) {
var folder = path.join(config.cache, pkg);
fileExists(folder, function (exists) {
if (!exists) return next(null, false);
rimraf(folder, function (err) {
if (err) return next(err);
next(null, true);
});
});
};
var processLinkedPackage = function (emitter, pkg, next) {
checkAndRemoveLinkToPackage(pkg, function (err, removed) {
if (err) {
emitter.emit('error', err);
return next();
}
if (removed) {
template('action', { name: 'link cleared', shizzle: pkg })
.on('data', emitter.emit.bind(emitter, 'data'));
}
next();
});
};
var checkAndRemoveLinkToPackage = function (pkg, next) {
var folder = path.join(config.links, pkg);
fs.readlink(folder, function (err, linkString) {
if (err && err.code === 'ENOENT') return next();
fileExists(linkString, function (exists) {
if (!exists) {
return rimraf(folder, function (err) {
if (err) return next(err);
next(null, true);
});
}
next(null, false);
});
});
};
module.exports = function (pkgs) {
var emitter = new Emitter;
async.parallel({
cache: function (next) {
if (!pkgs || !pkgs.length) {
glob('./*', { cwd: config.cache }, function (err, dirs) {
if (err) {
emitter.emit('error', err);
return next();
}
var pkgs = dirs.map(function (dir) { return dir.replace(/^\.\//, ''); });
async.forEach(pkgs, processCachedPackage.bind(this, emitter), next);
});
} else {
pkgs = _.uniq(pkgs);
async.forEach(pkgs, processCachedPackage.bind(this, emitter), next);
}
},
links: function (next) {
if (!pkgs || !pkgs.length) {
glob('./*', { cwd: config.links }, function (err, dirs) {
if (err) {
emitter.emit('error', err);
return next();
}
var pkgs = dirs.map(function (dir) { return dir.replace(/^\.\//, ''); });
async.forEach(pkgs, processLinkedPackage.bind(this, emitter), next);
});
} else {
pkgs = _.uniq(pkgs);
async.forEach(pkgs, processLinkedPackage.bind(this, emitter), next);
}
},
completion: function (next) {
// Do not run completion cache if packages where passed
if (pkgs && pkgs.length) return next();
rimraf(config.completion, function (err) {
if (err) {
emitter.emit('error', err);
return next();
}
template('action', { name: 'completion cleared', shizzle: 'completion cache' })
.on('data', emitter.emit.bind(emitter, 'data'));
next();
});
}
}, emitter.emit.bind(emitter, 'end'));
return emitter;
};
module.exports.line = function (argv) {
var options = nopt(optionTypes, shorthand, argv);
var pkgs = options.argv.remain.slice(1);
if (options.help) return help('cache-clean');
return module.exports(pkgs);
};
module.exports.completion = function (opts, cb) {
glob('./*', { cwd: config.cache }, function (err, dirs) {
if (err) return cb(err);
dirs = dirs.map(function (dir) {
return dir.replace(/^\.\//, '');
});
cb(null, dirs);
});
};
module.exports.completion.options = shorthand;

View File

@@ -1,112 +0,0 @@
// ==========================================
// BOWER: Completion API
// ==========================================
// Copyright 2012 Twitter, Inc
// Licensed under The MIT License
// http://opensource.org/licenses/MIT
// ==========================================
var Emitter = require('events').EventEmitter;
var path = require('path');
var nopt = require('nopt');
var mkdirp = require('mkdirp');
var template = require('../util/template');
var complete = require('../util/completion');
var config = require('../core/config');
var help = require('./help');
var optionTypes = { help: Boolean };
var shorthand = { 'h': ['--help'] };
module.exports = function (argv, env) {
env = env || process.env;
var emitter = new Emitter;
var commands = require('../commands');
// top level flags
var flags = ['--no-color', '--help', '--version'];
var done = function done() {
process.nextTick(function () {
emitter.emit('end');
});
return emitter;
};
// if the COMP_* isn't in the env, then just dump the script.
if (!env.COMP_CWORD) {
template('completion').on('data', emitter.emit.bind(emitter, 'end'));
return emitter;
}
// parse environment and arguments, returns a hash of completion config.
var opts = complete(argv, env);
// if only one word, complete the list of command or top level flags
if (opts.w === 1) {
if (opts.word.charAt(0) === '-') complete.log(flags, opts);
else complete.log(Object.keys(commands), opts);
return done();
}
// try to find the bower command. first thing after all the configs.
var parsed = opts.conf = nopt({}, {}, opts.partialWords, 0);
var cmd = parsed.argv.remain[0];
// unable to find a command, complete the lisf of commands
if (!cmd) {
complete.log(Object.keys(commands), opts);
return done();
}
// if words[0] is a bower command, then complete on it.
cmd = commands[cmd];
if (cmd && cmd.completion) {
// prior to that, ensure the completion cache directory is created first
mkdirp(path.join(config.completion), function (err) {
if (err) return emitter.emit('error', err);
var options = cmd.completion.options;
if (options && opts.word.charAt(0) === '-') {
complete.log(Object.keys(options).map(function (option) {
return opts.word.charAt(1) === '-' ? options[option][0] : '-' + option;
}), opts);
return done();
}
cmd.completion(opts, function (err, data) {
if (err) return emitter.emit('error', err);
// completing options, then append top level flags
if (opts.word.charAt(0) === '-') data = data.concat(flags);
complete.log(data, opts);
done();
});
});
return emitter;
}
// otherwise, do nothing
return emitter;
};
module.exports.line = function (argv) {
var emitter = new Emitter;
var options = nopt(optionTypes, shorthand, argv);
if (options.help) return help('completion');
module.exports(options.argv.remain.slice(2), process.env)
.on('data', emitter.emit.bind(emitter, 'data'))
.on('error', emitter.emit.bind(emitter, 'error'))
.on('end', emitter.emit.bind(emitter, 'end'));
return emitter;
};

View File

@@ -1,52 +0,0 @@
// ==========================================
// BOWER: Help API
// ==========================================
// Copyright 2012 Twitter, Inc
// Licensed under The MIT License
// http://opensource.org/licenses/MIT
// ==========================================
var events = require('events');
var nopt = require('nopt');
var _ = require('lodash');
var template = require('../util/template');
var config = require('../core/config');
module.exports = function (name) {
var context = {};
var emitter = new events.EventEmitter;
var commands = require('../commands');
// Aliases
// At the moment we just have the ls, but we might have more
switch (name) {
case 'ls':
name = 'list';
break;
}
var validCommand = !!(name && commands[name]);
var templateName = validCommand ? 'help-' + name : 'help';
if (!validCommand) context = {
commands: Object.keys(commands).sort().join(', ')
}
_.extend(context, config);
template(templateName, context)
.on('data', emitter.emit.bind(emitter, 'end'));
return emitter;
};
module.exports.line = function (argv) {
var options = nopt({}, {}, argv);
var paths = options.argv.remain.slice(1);
return module.exports(paths[0]);
};
module.exports.completion = function (opts, cb) {
return cb(null, Object.keys(require('../commands')));
};

View File

@@ -1,24 +0,0 @@
// ==========================================
// BOWER: Public Commands List
// ==========================================
// Copyright 2012 Twitter, Inc
// Licensed under The MIT License
// http://opensource.org/licenses/MIT
// ==========================================
module.exports = {
'help': require('./help'),
'install': require('./install'),
'list': require('./list'),
'ls': require('./list'),
'uninstall': require('./uninstall'),
'update': require('./update'),
'link': require('./link'),
'lookup': require('./lookup'),
'info': require('./info'),
'init': require('./init'),
'register': require('./register'),
'search': require('./search'),
'cache-clean': require('./cache-clean'),
'completion': require('./completion')
};

View File

@@ -1,50 +0,0 @@
// ==========================================
// BOWER: Lookup API
// ==========================================
// Copyright 2012 Twitter, Inc
// Licensed under The MIT License
// http://opensource.org/licenses/MIT
// ==========================================
var Emitter = require('events').EventEmitter;
var nopt = require('nopt');
var template = require('../util/template');
var source = require('../core/source');
var install = require('./install');
var help = require('./help');
var optionTypes = { help: Boolean };
var shorthand = { 'h': ['--help'] };
module.exports = function (name) {
var emitter = new Emitter;
if (name) {
source.info(name, function (err, result) {
if (err) return emitter.emit('error', err);
emitter.emit('end', result);
});
}
return emitter;
};
module.exports.line = function (argv) {
var emitter = new Emitter;
var options = nopt(optionTypes, shorthand, argv);
var names = options.argv.remain.slice(1);
if (options.help || !names.length) return help('info');
module.exports(names[0])
.on('error', emitter.emit.bind(emitter, 'error'))
.on('end', function (data) {
template('info', data).on('data', emitter.emit.bind(emitter, 'end'));
});
return emitter;
};
module.exports.completion = install.completion;
module.exports.completion.options = shorthand;

View File

@@ -1,150 +0,0 @@
// ==========================================
// BOWER: Init API
// ==========================================
// Copyright 2013 Twitter, Inc
// Licensed under The MIT License
// http://opensource.org/licenses/MIT
// ==========================================
var path = require('path');
var fs = require('fs');
var util = require('util');
var nopt = require('nopt');
var promptly = require('promptly');
var _ = require('lodash');
var help = require('./help');
var Manager = require('../core/manager');
var config = require('../core/config');
var optionTypes = { help: Boolean };
var shorthand = { 'h': ['--help'] };
var commonIgnore = ['**/.*', 'node_modules', 'components'];
var Init = function () {
Manager.call(this);
};
util.inherits(Init, Manager);
Init.prototype.getDependenciesJSON = function () {
var dependencies = Object.keys(this.dependencies);
var remaining = dependencies.length;
var json = {};
dependencies.forEach(function (name) {
var pkg = this.dependencies[name][0];
pkg.on('loadJSON', function () {
// TODO: use fetch endpoint here
json[pkg.name] = pkg.commit ? '*' : '~' + pkg.version;
remaining -= 1;
if (remaining === 0) {
this.manager.emit('loadDependencies', json);
}
}).loadJSON();
}, this);
if (remaining === 0) {
this.emit('loadDependencies', json);
}
return this;
};
Init.prototype.getMain = function (name) {
name = path.basename(name, '.js');
if (fs.existsSync(path.join(process.cwd(), 'index.js'))) {
return 'index.js';
} else if (fs.existsSync(path.join(process.cwd(), name + '.js'))) {
return name + '.js';
} else {
return null;
}
};
Init.prototype.showPrompt = function (question, cb) {
var prompt = question.prompt + ': [' + (question.yesno ? 'y' : question.value) + ']';
if (question.yesno) {
promptly.confirm(prompt, {'default': 'y'}, cb);
} else {
promptly.prompt(prompt, {'default': question.value}, cb);
}
this.emit('prompt', prompt);
};
Init.prototype.prompts = function (dependencies) {
var main = this.json.main || this.getMain(this.json.name) || '';
var questions = _.compact([
{key: 'name', prompt: 'name', value: this.json.name, yesno: false},
{key: 'version', prompt: 'version', value: this.json.version, yesno: false},
{key: 'main', prompt: 'main file', value: main, yesno: false},
_.size(dependencies) ? {key: 'dependencies', prompt: 'add current components as dependencies? (y/n)', value: dependencies, yesno: true} : null,
{key: 'ignore', prompt: 'add commonly ignored files to ignore list? (y/n)', value: commonIgnore, yesno: true}
]);
var index = 0;
var question = questions[index];
var cb = function (err, value) {
if (question.yesno) {
if (value) {
this.json[question.key] = question.value;
}
} else if (value) {
this.json[question.key] = value;
}
index += 1;
if (index < questions.length) {
question = questions[index];
this.showPrompt(question, cb);
} else {
this.emit('prompts');
}
}.bind(this);
this.showPrompt(question, cb);
};
Init.prototype.save = function (data) {
fs.writeFileSync(path.join(this.cwd, config.json), JSON.stringify(data, null, 2));
};
module.exports = function () {
var init = new Init();
init
.on('resolveLocal', init.loadJSON.bind(init))
.on('loadJSON', init.getDependenciesJSON.bind(init))
.on('loadDependencies', init.prompts.bind(init))
.on('prompts', function () {
init.save(init.json);
init.emit('end');
})
.resolveLocal();
return init;
};
module.exports.Init = Init; // Purely for testing
module.exports.line = function (argv) {
var options = nopt(optionTypes, shorthand, argv);
if (options.help) return help('init');
return module.exports();
};
module.exports.completion = function (opts, cb) {
var word = opts.word;
// completing options?
if (word.charAt(0) === '-') {
return cb(null, Object.keys(optionTypes).map(function (option) {
return '--' + option;
}));
}
};

View File

@@ -1,82 +0,0 @@
// ==========================================
// BOWER: Install API
// ==========================================
// Copyright 2012 Twitter, Inc
// Licensed under The MIT License
// http://opensource.org/licenses/MIT
// ==========================================
var Emitter = require('events').EventEmitter;
var nopt = require('nopt');
var fs = require('fs');
var path = require('path');
var Manager = require('../core/manager');
var config = require('../core/config');
var source = require('../core/source');
var save = require('../util/save');
var help = require('./help');
var optionTypes = { help: Boolean, save: Boolean, 'save-dev': Boolean, force: Boolean, 'force-latest': Boolean, production: Boolean };
var shorthand = { 'h': ['--help'], 'S': ['--save'], 'D': ['--save-dev'], 'f': ['--force'], 'F': ['--force-latest'], 'p': ['--production'] };
module.exports = function (paths, options) {
options = options || {};
var emitter = new Emitter;
var manager = new Manager(paths, {
force: options.force,
forceLatest: options['force-latest'],
production: options.production
});
manager
.on('data', emitter.emit.bind(emitter, 'data'))
.on('warn', emitter.emit.bind(emitter, 'warn'))
.on('error', emitter.emit.bind(emitter, 'error'))
.on('resolve', function (resolved) {
// Handle save/save-dev
if (resolved && (options.save || options['save-dev'])) {
save(manager, paths, !options.save, emitter.emit.bind(emitter, 'end'));
} else {
emitter.emit('end');
}
})
.resolve();
return emitter;
};
module.exports.line = function (argv) {
var options = nopt(optionTypes, shorthand, argv);
var paths = options.argv.remain.slice(1);
if (options.help) return help('install');
return module.exports(paths, options);
};
module.exports.completion = function (opts, cb) {
var cache = path.join(config.completion, 'install.json');
var done = function done(err, results) {
if (err) return cb(err);
var names = results.map(function (pkg) {
return pkg.name;
});
return cb(null, names);
};
fs.readFile(cache, function (err, body) {
if (!err) return done(null, JSON.parse(body));
// expected error, do the first request and cache the results
source.all(function (err, results) {
if (err) return cb(err);
fs.writeFile(cache, JSON.stringify(results, null, 2), function (err) {
done(err, results);
});
});
});
};
module.exports.completion.options = shorthand;

View File

@@ -1,121 +0,0 @@
// ==========================================
// BOWER: Link API
// ==========================================
// Copyright 2012 Twitter, Inc
// Licensed under The MIT License
// http://opensource.org/licenses/MIT
// ==========================================
var Emitter = require('events').EventEmitter;
var nopt = require('nopt');
var fs = require('fs');
var path = require('path');
var mkdirp = require('mkdirp');
var rimraf = require('rimraf');
var Manager = require('../core/manager');
var help = require('./help');
var template = require('../util/template');
var config = require('../core/config');
var isRepo = require('../util/is-repo');
var optionTypes = { help: Boolean };
var shorthand = { 'h': ['--help'] };
function linkSelf(emitter) {
var manager = new Manager;
manager
.on('error', emitter.emit.bind('error'))
.once('loadJSON', function () {
var destPath = path.join(config.links, manager.name);
var srcPath = process.cwd();
deleteLink(destPath, function (err) {
if (err) return emitter.emit('error', err);
createLink(srcPath, destPath, function (err) {
if (err) return emitter.emit('error', err);
template('link', { src: srcPath, dest: destPath })
.on('data', emitter.emit.bind(emitter, 'end'));
});
});
}).loadJSON();
}
function linkTo(name, emitter) {
var destPath = path.join(process.cwd(), config.directory, name);
var srcPath = path.join(config.links, name);
deleteLink(destPath, function (err) {
if (err) return emitter.emit('error', err);
createLink(srcPath, destPath, function (err) {
if (err) return emitter.emit('error', err);
template('link', { src: srcPath, dest: destPath })
.on('data', emitter.emit.bind(emitter, 'end'));
});
});
}
function deleteLink(dest, callback) {
// Delete symlink if already present
// Beware that if the target is a git repo, we can't proceed
isRepo(dest, function (is) {
if (is) return callback(new Error(dest + ' is a local repository, please remove it manually'));
fs.lstat(dest, function (err) {
if (!err || err.code !== 'ENOENT') rimraf(dest, callback);
else callback();
});
});
}
function createLink(src, dest, callback) {
var destDir = path.dirname(dest);
// Create directory
mkdirp(destDir, function (err) {
if (err) return callback(err);
fs.lstat(src, function (err) {
if (err && err.code === 'ENOENT') {
return callback(new Error('Attempting to link an unknown package: ' + path.basename(src)));
}
// Create symlink
fs.symlink(src, dest, 'dir', function (err) {
callback(err);
});
});
});
}
module.exports = function (name) {
var emitter = new Emitter;
if (!name) linkSelf(emitter);
else linkTo(name, emitter);
return emitter;
};
module.exports.line = function (argv) {
var options = nopt(optionTypes, shorthand, argv);
var name = options.argv.remain[1];
if (options.help) return help('link');
return module.exports(name);
};
module.exports.completion = function (opts, cb) {
fs.readdir(config.links, function (err, dirs) {
// ignore ENOENT, ~/.bower/links not created yet
if (err && err.code === 'ENOENT') return cb(null, []);
cb(err, dirs);
});
};
module.exports.completion.options = shorthand;

View File

@@ -1,234 +0,0 @@
// ==========================================
// BOWER: List API
// ==========================================
// Copyright 2012 Twitter, Inc
// Licensed under The MIT License
// http://opensource.org/licenses/MIT
// ==========================================
var Emitter = require('events').EventEmitter;
var archy = require('archy');
var nopt = require('nopt');
var path = require('path');
var _ = require('lodash');
var template = require('../util/template');
var Manager = require('../core/manager');
var Package = require('../core/package');
var config = require('../core/config');
var help = require('./help');
var shorthand = { 'h': ['--help'], 'o': ['--offline'] };
var optionTypes = { help: Boolean, paths: Boolean, map: Boolean, offline: Boolean, sources: Boolean };
var getTree = function (packages, subPackages, result) {
result = result || {};
_.each(subPackages || packages, function (pkg) {
result[pkg.name] = {};
Object.keys(pkg.json.dependencies || {}).forEach(function (name) {
result[pkg.name][name] = {};
});
var subPackages = {};
Object.keys(pkg.json.dependencies || {}).forEach(function (name) {
subPackages[name] = packages[name] || new Package(name, null);
});
getTree(packages, subPackages, result[pkg.name]);
});
return result;
};
var generatePath = function (name, main) {
if (typeof main === 'string') {
return path.join(config.directory, name, main);
} else if (_.isArray(main)) {
main = main.map(function (main) { return generatePath(name, main); });
return main.length === 1 ? main[0] : main;
}
};
var mainTypes = ['main', 'scripts', 'styles', 'templates', 'images'];
var buildSource = function (pkg, shallow) {
var result = {};
if (pkg) {
mainTypes.forEach(function (type) {
if (pkg.json[type]) result[type] = generatePath(pkg.name, pkg.json[type]);
});
}
if (shallow) {
result.main = getMain(result) || generatePath(pkg.name, '');
}
return result;
};
var getMain = function (source) {
for (var i = 0, len = mainTypes.length; i < len; i += 1) {
var type = mainTypes[i];
if (source[type]) {
return source[type];
}
}
};
var shallowTree = function (packages, tree) {
var result = {};
Object.keys(tree).forEach(function (packageName) {
result[packageName] = buildSource(packages[packageName], true).main;
});
return result;
};
var deepTree = function (packages, tree) {
var result = {};
Object.keys(tree).forEach(function (packageName) {
result[packageName] = {};
result[packageName].source = buildSource(packages[packageName]);
if (Object.keys(tree[packageName]).length) {
result[packageName].dependencies = deepTree(packages, tree[packageName]);
}
});
return result;
};
var getNodes = function (packages, tree) {
return Object.keys(tree).map(function (key) {
var version = packages[key] ? packages[key].version || '' : null;
var upgrade;
if (version && packages[key].tags.indexOf(version)) {
upgrade = packages[key].tags[0];
}
if (Object.keys(tree[key]).length) {
return {
label: template('tree-branch', { 'package': key, version: version, upgrade: upgrade }, true),
nodes: getNodes(packages, tree[key])
};
} else {
return template('tree-branch', { 'package': key, version: version, upgrade: upgrade }, true);
}
});
};
var getDependencySrcs = function (list) {
var srcs = [];
var dependency, main;
for (var name in list) {
dependency = list[name];
main = dependency.source && getMain(dependency.source);
if (dependency.dependencies) {
var depSrcs = getDependencySrcs(dependency.dependencies);
srcs.push.apply(srcs, depSrcs);
}
// add main sources to srcs
if (main) {
if (Array.isArray(main)) {
srcs.push.apply(srcs, main);
} else {
srcs.push(main);
}
}
}
return srcs;
};
var organizeSources = function (tree) {
// flat source filepaths
var srcs = getDependencySrcs(tree);
// remove duplicates, organize by file extension
var sources = {};
srcs.forEach(function (src) {
var ext = path.extname(src);
sources[ext] = sources[ext] || [];
if (sources[ext].indexOf(src) === -1) {
sources[ext].push(src);
}
});
return sources;
};
module.exports = function (options) {
var manager = new Manager;
var emitter = new Emitter;
options = options || {};
if (options.sources) {
options.map = true;
}
var emitOut = function (obj) {
// make JSON pretty if started from command line
var output = options.argv ? JSON.stringify(obj, null, 2) : obj;
emitter.emit('data', output);
};
manager
.on('data', emitter.emit.bind(emitter, 'data'))
.on('error', emitter.emit.bind(emitter, 'error'))
.on('list', function (packages) {
var tree = getTree(packages);
if (!options.paths && !options.map) {
emitter.emit('data', archy({
label: process.cwd(),
nodes: getNodes(packages, tree)
}));
return;
}
tree = options.paths ? shallowTree(packages, tree) : deepTree(packages, tree);
if (options.sources) {
// with map, organize it and emit
var sources = organizeSources(tree);
emitOut(sources);
} else {
emitOut(tree);
}
})
.list(options);
return emitter;
};
module.exports.line = function (argv) {
var options = nopt(optionTypes, shorthand, argv);
if (options.help) return help('list');
return module.exports(options);
};
module.exports.completion = function (opts, cb) {
if (!/^-/.test(opts.word)) return cb(null, []);
var results = Object.keys(optionTypes).map(function (option) {
return '--' + option;
});
cb(null, results);
};
module.exports.completion.options = shorthand;

View File

@@ -1,64 +0,0 @@
// ==========================================
// BOWER: Lookup API
// ==========================================
// Copyright 2012 Twitter, Inc
// Licensed under The MIT License
// http://opensource.org/licenses/MIT
// ==========================================
var Emitter = require('events').EventEmitter;
var nopt = require('nopt');
var template = require('../util/template');
var source = require('../core/source');
var install = require('./install');
var help = require('./help');
var optionTypes = { help: Boolean };
var shorthand = { 'h': ['--help'] };
module.exports = function (name) {
var emitter = new Emitter;
source.lookup(name, function (err, url) {
if (err) {
source.search(name, function (err, packages) {
if (packages.length) {
template('suggestions', { packages: packages, name: name })
.on('data', function (data) {
emitter.emit('data', data);
emitter.emit('end');
});
} else {
template('warning-missing', {name: name})
.on('data', function (data) {
emitter.emit('data', data);
emitter.emit('end');
});
}
});
} else {
var result = { name: name, url: url };
emitter.emit('package', result);
template('lookup', result)
.on('data', function (data) {
emitter.emit('data', data);
emitter.emit('end');
});
}
});
return emitter;
};
module.exports.line = function (argv) {
var options = nopt(optionTypes, shorthand, argv);
var names = options.argv.remain.slice(1);
if (options.help || !names.length) return help('lookup');
return module.exports(names[0]);
};
module.exports.completion = install.completion;
module.exports.completion.options = shorthand;

View File

@@ -1,66 +0,0 @@
// ==========================================
// BOWER: Lookup API
// ==========================================
// Copyright 2012 Twitter, Inc
// Licensed under The MIT License
// http://opensource.org/licenses/MIT
// ==========================================
var Emitter = require('events').EventEmitter;
var nopt = require('nopt');
var readline = require('readline');
var template = require('../util/template');
var source = require('../core/source');
var help = require('./help');
var optionTypes = { help: Boolean };
var shorthand = { 'h': ['--help'], '-s': ['--silent'] };
var register = function (name, url, emitter) {
source.register(name, url, function (err) {
if (err) return emitter.emit('error', err);
template('register', {name: name, url: url})
.on('data', emitter.emit.bind(emitter, 'data'));
});
};
module.exports = function (name, url, options) {
var emitter = new Emitter;
if (options.silent) register(name, url, emitter);
else {
var rl = readline.createInterface({ input: process.stdin, output: process.stdout });
console.log('Registering a package will make it visible and installable via the registry.');
rl.question('Proceed (y/n)? ', function (res) {
rl.close();
res = res.toLowerCase();
if (res === 'y' || res === 'yes') register(name, url, emitter);
});
}
return emitter;
};
module.exports.line = function (argv) {
var options = nopt(optionTypes, shorthand, argv);
var args = options.argv.remain.slice(1);
if (options.help || args.length !== 2) return help('register');
return module.exports(args[0], args[1], options);
};
module.exports.completion = function (opts, cb) {
var word = opts.word;
// completing options?
if (word.charAt(0) === '-') {
return cb(null, Object.keys(optionTypes).map(function (option) {
return '--' + option;
}));
}
};

View File

@@ -1,61 +0,0 @@
// ==========================================
// BOWER: Lookup API
// ==========================================
// Copyright 2012 Twitter, Inc
// Licensed under The MIT License
// http://opensource.org/licenses/MIT
// ==========================================
var Emitter = require('events').EventEmitter;
var nopt = require('nopt');
var template = require('../util/template');
var source = require('../core/source');
var install = require('./install');
var help = require('./help');
var optionTypes = { help: Boolean };
var shorthand = { 'h': ['--help'] };
module.exports = function (name) {
var emitter = new Emitter;
var callback = function (err, results) {
if (err) return emitter.emit('error', err);
emitter.emit('packages', results);
if (results.length) {
template('search', {results: results})
.on('data', function (data) {
emitter.emit('data', data);
emitter.emit('end');
});
} else {
template('search-empty', {results: results})
.on('data', function (data) {
emitter.emit('data', data);
emitter.emit('end');
});
}
};
if (name) {
source.search(name, callback);
} else {
source.all(callback);
}
return emitter;
};
module.exports.line = function (argv) {
var options = nopt(optionTypes, shorthand, argv);
var names = options.argv.remain.slice(1);
if (options.help) return help('search');
return module.exports(names[0]);
};
module.exports.completion = install.completion;
module.exports.completion.options = shorthand;

View File

@@ -1,206 +0,0 @@
// ==========================================
// BOWER: Uninstall API
// ==========================================
// Copyright 2012 Twitter, Inc
// Licensed under The MIT License
// http://opensource.org/licenses/MIT
// ==========================================
var Emitter = require('events').EventEmitter;
var async = require('async');
var nopt = require('nopt');
var fs = require('fs');
var path = require('path');
var _ = require('lodash');
var template = require('../util/template');
var Manager = require('../core/manager');
var config = require('../core/config');
var help = require('./help');
var optionTypes = { help: Boolean, force: Boolean, save: Boolean };
var shorthand = { 'h': ['--help'], 'S': ['--save'], 'D': ['--save-dev'], 'f': ['--force'] };
module.exports = function (names, options) {
var packages, uninstallables, packagesCount = {};
var emitter = new Emitter;
var manager = new Manager;
var jsonDeps;
var newLine;
options = options || {};
manager.on('data', emitter.emit.bind(emitter, 'data'));
manager.on('error', emitter.emit.bind(emitter, 'error'));
var resolveLocal = function () {
jsonDeps = manager.json.dependencies || {};
packages = _.flatten(_.values(manager.dependencies));
uninstallables = packages.filter(function (pkg) {
return _.include(names, pkg.name);
});
async.forEach(packages, function (pkg, next) {
pkg.once('loadJSON', next).loadJSON();
}, function () {
if (showWarnings(options.force) && !options.force) return;
expandUninstallabes(options.force);
uninstall();
});
};
var showWarnings = function (force) {
var foundConflicts = false;
packages.forEach(function (pkg) {
if (!pkg.json.dependencies) return;
if (containsPkg(uninstallables, pkg)) return;
var conflicts = _.intersection(
Object.keys(pkg.json.dependencies),
_.pluck(uninstallables, 'name')
);
if (conflicts.length) {
foundConflicts = true;
if (!force) {
conflicts.forEach(function (conflictName) {
emitter.emit('data', template('warning-uninstall', { packageName: pkg.name, conflictName: conflictName }, true));
});
}
}
});
if (foundConflicts && !force) {
emitter.emit('data', template('warn', { message: 'To proceed, run uninstall with the --force flag'}, true));
}
return foundConflicts;
};
var expandUninstallabes = function (force) {
var x,
pkg,
forcedUninstallables = {};
// Direct JSON deps have a count of 1
for (var key in jsonDeps) {
packagesCount[key] = 1;
}
// Count all packages
count(packages, packagesCount);
if (force) {
uninstallables.forEach(function (pkg) {
forcedUninstallables[pkg.name] = true;
});
}
// Expand the uninstallables deps and nested deps
// Also update the count accordingly
for (x = uninstallables.length - 1; x >= 0; x -= 1) {
parseUninstallableDeps(uninstallables[x]);
}
// Foreach uninstallable, check if it is really to be removed by reading the final count
// If the final count is greater than 0, then it is a shared dep
// In that case, we remove it from the uninstallables unless it's forced to be uninstalled
for (x = uninstallables.length - 1; x >= 0; x -= 1) {
pkg = uninstallables[x];
if (packagesCount[pkg.name] > 0 && !forcedUninstallables[pkg.name]) uninstallables.splice(x, 1);
}
};
var count = function (packages, counts, nested) {
packages.forEach(function (pkg) {
counts[pkg.name] = (counts[pkg.name] || 0);
if (nested) counts[pkg.name] += 1;
if (pkg.json.dependencies) {
for (var key in pkg.json.dependencies) {
count(manager.dependencies[key], counts, true);
}
}
});
};
var parseUninstallableDeps = function (pkg) {
if (!containsPkg(uninstallables, pkg)) uninstallables.push(pkg);
packagesCount[pkg.name] -= 1;
if (pkg.json.dependencies) {
for (var key in pkg.json.dependencies) {
parseUninstallableDeps(manager.dependencies[key][0]);
}
}
};
var containsPkg = function (packages, pkg) {
for (var x = packages.length - 1; x >= 0; x -= 1) {
if (packages[x].name === pkg.name) return true;
}
return false;
};
var uninstall = function () {
async.forEach(uninstallables, function (pkg, next) {
pkg.on('uninstall', function () {
emitter.emit('package', pkg);
next();
}).uninstall();
}, function () {
// Finally save
if (options.save || options['save-dev']) save(!options.save);
emitter.emit('end');
});
};
var save = function (dev) {
var key = dev ? 'devDependencies' : 'dependencies';
var contents;
if (manager.json[key]) {
names.forEach(function (name) {
delete manager.json[key][name];
});
contents = JSON.stringify(manager.json, null, 2) + (newLine ? '\n' : '');
fs.writeFileSync(path.join(manager.cwd, config.json), contents);
}
};
manager.on('loadJSON', function (hasNewLine) {
newLine = hasNewLine;
manager.on('resolveLocal', resolveLocal).resolveLocal();
}).loadJSON();
return emitter;
};
module.exports.line = function (argv) {
var options = nopt(optionTypes, shorthand, argv);
var names = options.argv.remain.slice(1);
if (options.help || !names.length) return help('uninstall');
return module.exports(names, options);
};
module.exports.completion = function (opts, cb) {
var word = opts.word;
// completing options?
if (opts.words[0] === 'uninstall' && word.charAt(0) === '-') {
return cb(null, Object.keys(optionTypes).map(function (option) {
return '--' + option;
}));
}
fs.readdir(config.directory, function (err, dirs) {
// ignore ENOENT, ./components not created yet
if (err && err.code === 'ENOENT') return cb(null, []);
cb(err, dirs);
});
};
module.exports.completion.options = shorthand;

View File

@@ -1,97 +0,0 @@
// ==========================================
// BOWER: Update API
// ==========================================
// Copyright 2012 Twitter, Inc
// Licensed under The MIT License
// http://opensource.org/licenses/MIT
// ==========================================
var Emitter = require('events').EventEmitter;
var async = require('async');
var nopt = require('nopt');
var _ = require('lodash');
var Manager = require('../core/manager');
var help = require('./help');
var uninstall = require('./uninstall');
var save = require('../util/save');
var optionTypes = { help: Boolean, save: Boolean, force: Boolean, 'force-latest': Boolean };
var shorthand = { 'h': ['--help'], 'S': ['--save'], 'f': ['--force'], 'F': ['--force-latest'] };
module.exports = function (names, options) {
options = options || {};
var emitter = new Emitter;
var manager = new Manager([], {
force: options.force,
forceLatest: options['force-latest']
});
manager.on('data', emitter.emit.bind(emitter, 'data'));
manager.on('warn', emitter.emit.bind(emitter, 'warn'));
manager.on('error', emitter.emit.bind(emitter, 'error'));
var installURLS = function (err, arr) {
var mappings = {},
endpoints = [];
arr = _.compact(arr);
_.each(arr, function (info) {
endpoints.push(info.endpoint);
mappings[info.endpoint] = info.name;
});
options.endpointNames = mappings;
// By default the manager will guess the name of the package from the url
// But this leads to problems when the package name does not match the one in the url
// So the manager now has an option (endpointNames) to deal with this
manager = new Manager(endpoints, options);
manager
.on('data', emitter.emit.bind(emitter, 'data'))
.on('warn', emitter.emit.bind(emitter, 'warn'))
.on('error', emitter.emit.bind(emitter, 'error'))
.on('resolve', function (resolved) {
// Handle save
if (resolved && options.save) save(manager, null, false, emitter.emit.bind(emitter, 'end'));
else emitter.emit('end');
})
.resolve();
};
manager.once('resolveLocal', function () {
names = names.length ? _.uniq(names) : null;
async.map(_.values(manager.dependencies), function (pkgs, next) {
var pkg = pkgs[0];
pkg.once('loadJSON', function () {
var endpointInfo = pkg.readEndpoint();
if (!endpointInfo) return next();
// Add tag only if the endpoint is a repository
var endpoint = endpointInfo.endpoint;
var json = pkg.json;
if (!json.commit && (endpointInfo.type === 'git' || endpointInfo.type === 'local-repo')) {
endpoint += '#' + ((!names || names.indexOf(pkg.name) > -1) ? '~' : '') + pkg.version;
}
next(null, { name: pkg.name, endpoint: endpoint });
}).loadJSON();
}, installURLS);
}).resolveLocal();
return emitter;
};
module.exports.line = function (argv) {
var options = nopt(optionTypes, shorthand, argv);
if (options.help) return help('update');
var paths = options.argv.remain.slice(1);
return module.exports(paths, options);
};
module.exports.completion = uninstall.completion;
module.exports.completion.options = shorthand;

View File

@@ -1,75 +0,0 @@
var path = require('path');
var fs = require('fs');
var _ = require('lodash');
var tmp = require('tmp');
var mkdirp = require('mkdirp');
var zlib = require('zlib');
var fileExists = require('../util/file-exists').sync;
// This forces the default chunk size to something small in an attempt
// to avoid issue #314
zlib.Z_DEFAULT_CHUNK = 1024*8;
var temp = process.env.TMPDIR
|| process.env.TMP
|| process.env.TEMP
|| process.platform === 'win32' ? 'c:\\windows\\temp' : '/tmp';
var home = (process.platform === 'win32'
? process.env.USERPROFILE
: process.env.HOME) || temp;
var roaming = process.platform === 'win32'
? path.resolve(process.env.APPDATA || home || temp)
: path.resolve(home || temp);
var folder = process.platform === 'win32'
? 'bower'
: '.bower';
var proxy = process.env.HTTPS_PROXY
|| process.env.https_proxy
|| process.env.HTTP_PROXY
|| process.env.http_proxy;
// Bower Config
var config;
try {
config = require('rc') ('bower', {
cache : path.join(roaming, folder, 'cache'),
links : path.join(roaming, folder, 'links'),
completion : path.join(roaming, folder, 'completion'),
git_template : path.join(roaming, folder, 'git_template'),
json : 'bower.json',
endpoint : 'https://bower.herokuapp.com',
directory : 'components',
proxy : proxy,
shorthand_resolver : 'git://github.com/{{{ endpoint }}}.git'
});
} catch (e) {
throw new Error('Unable to parse global .bowerrc file: ' + e.message);
}
// If there is a local .bowerrc file, merge it
var localFile = path.join(process.cwd(), '.bowerrc');
if (fileExists(localFile)) {
try {
_.extend(config, JSON.parse(fs.readFileSync(localFile)));
} catch (e) {
throw new Error('Unable to parse local .bowerrc file: ' + e.message);
}
}
// Make sure that we have our git template directory
try {
mkdirp.sync(config.git_template);
} catch (e) {
throw new Error('Unable to create git_template directory: ' + e.message);
}
// Configure tmp package to use graceful degradation
// If an uncaught exception occurs, the temporary directories will be deleted nevertheless
tmp.setGracefulCleanup();
module.exports = config;

View File

@@ -1,378 +0,0 @@
// ==========================================
// BOWER: Manager Object Definition
// ==========================================
// Copyright 2012 Twitter, Inc
// Licensed under The MIT License
// http://opensource.org/licenses/MIT
// ==========================================
// Events:
// - install: fired when everything is installed
// - package: fired for each installed packaged
// - resolve: fired when deps resolved (with a true/false indicating success or error)
// - error: fired on all errors
// - data: fired when trying to output data
// - warn: fired when a discouraged but not fatal situation arises
// - end: fired when finished installing
// ==========================================
var events = require('events');
var semver = require('semver');
var async = require('async');
var path = require('path');
var glob = require('glob');
var fs = require('fs');
var _ = require('lodash');
var Package = require('./package');
var UnitWork = require('./unit_work');
var config = require('./config');
var fallback = require('../util/fallback');
var template = require('../util/template');
var prune = require('../util/prune');
// read local dependencies (with versions)
// read json dependencies (resolving along the way into temp dir)
// merge local dependencies with json dependencies
// prune and move dependencies into local directory
var Manager = function (endpoints, opts) {
this.dependencies = {};
this.cwd = process.cwd();
this.endpoints = endpoints || [];
this.unitWork = new UnitWork;
this.opts = opts || {};
this.errors = [];
};
Manager.prototype = Object.create(events.EventEmitter.prototype);
Manager.prototype.constructor = Manager;
Manager.prototype.loadJSON = function () {
fallback(this.cwd, [config.json, 'component.json'], function (file) {
if (file !== null) {
if (file !== config.json) {
this.emit('warn', 'Using deprecated "component.json". Please use "bower.json" instead');
}
return this.readJSON(path.join(this.cwd, file));
}
this.createJSON();
return this.emit('loadJSON');
}.bind(this));
return this;
};
Manager.prototype.resolve = function () {
var resolved = function () {
// If there is errors, report them
if (this.errors.length) return this.reportErrors();
// If there is an error while pruning (conflict) then abort installation
if (!this.prune()) return this.emit('resolve', false);
// Otherwise all is fine, so we install
this.once('install', this.emit.bind(this, 'resolve', true)).install();
}.bind(this);
// Resolve locally first
this.once('resolveLocal', function () {
if (this.endpoints.length) {
// TODO: When resolving specific endpoints we need to restore all the local
// packages and their hierarchy (all from the local folder)
// If something goes wrong, simply do resolveFromJSON before
// calling resolved() (slower)
// This will solve issue #200
this.once('resolveEndpoints', resolved).resolveEndpoints();
} else {
this.once('resolveFromJson', resolved).resolveFromJson();
}
}).resolveLocal();
return this;
};
Manager.prototype.resolveLocal = function () {
glob('./' + config.directory + '/*', function (err, dirs) {
if (err) return this.emit('error', err);
dirs.forEach(function (dir) {
var name = path.basename(dir);
var pkg = new Package(name, dir, this);
this.dependencies[name] = [];
this.dependencies[name].push(pkg);
this.gatherPackageErrors(pkg);
}.bind(this));
this.emit('resolveLocal');
}.bind(this));
return this;
};
Manager.prototype.resolveEndpoints = function () {
var endpointNames = this.opts.endpointNames || {};
async.forEach(this.endpoints, function (endpoint, next) {
var name = endpointNames[endpoint];
var pkg = new Package(name, endpoint, this);
var errorNext;
pkg.root = true;
this.dependencies[name] = this.dependencies[name] || [];
this.dependencies[name].push(pkg);
this.gatherPackageErrors(pkg);
pkg.once('error', errorNext = next.bind(next, null));
pkg.once('resolve', function () {
pkg.removeListener('error', errorNext);
next();
}).resolve();
}.bind(this), this.emit.bind(this, 'resolveEndpoints'));
return this;
};
Manager.prototype.resolveFromJson = function () {
this.once('loadJSON', function () {
var dependencies = this.json.dependencies || {};
// add devDependencies
if (!this.opts.production && this.json.devDependencies) {
dependencies = _.extend({}, dependencies, this.json.devDependencies);
}
async.forEach(Object.keys(dependencies), function (name, next) {
var endpoint = dependencies[name];
var pkg = new Package(name, endpoint, this);
var errorNext;
pkg.root = true;
this.gatherPackageErrors(pkg);
pkg.once('error', errorNext = next.bind(next, null));
pkg.once('resolve', function () {
pkg.removeListener('error', errorNext);
this.dependencies[pkg.name] = this.dependencies[pkg.name] || [];
this.dependencies[pkg.name].push(pkg);
next();
}.bind(this)).resolve();
}.bind(this), this.emit.bind(this, 'resolveFromJson'));
}.bind(this)).loadJSON();
return this;
};
// Private
Manager.prototype.createJSON = function () {
// If the json does not exist, assume one
this.json = {
name: path.basename(this.cwd),
version: '0.0.0'
},
this.name = this.json.name;
this.version = this.json.version;
};
Manager.prototype.readJSON = function (filename) {
fs.readFile(filename, 'utf8', function (err, json) {
if (err) return this.emit('error', err);
try {
this.json = JSON.parse(json);
} catch (e) {
return this.emit('error', new Error('There was an error while reading the ' + config.json + ': ' + e.message));
}
this.name = this.json.name;
this.version = this.json.version;
this.emit('loadJSON', json.slice(-1) === '\n');
}.bind(this));
};
Manager.prototype.getDeepDependencies = function () {
var result = {};
for (var name in this.dependencies) {
this.dependencies[name].forEach(function (pkg) {
result[pkg.name] = result[pkg.name] || [];
result[pkg.name].push(pkg);
pkg.getDeepDependencies().forEach(function (pkg) {
result[pkg.name] = result[pkg.name] || [];
result[pkg.name].push(pkg);
});
});
}
return result;
};
Manager.prototype.prune = function () {
var result = prune(this.getDeepDependencies(), this.opts.forceLatest);
var name;
// If there is conflicted deps, print them and fail
if (result.conflicted) {
for (name in result.conflicted) {
this.reportConflicts(name, result.conflicted[name]);
}
return false;
}
this.dependencies = {};
// If there is conflicted deps but they where forcebly resolved
// Print a warning about them
if (result.forceblyResolved) {
for (name in result.forceblyResolved) {
this.reportForceblyResolved(name, result.forceblyResolved[name]);
this.dependencies[name] = result.forceblyResolved[name];
this.dependencies[name][0].root = true;
}
}
_.extend(this.dependencies, result.resolved);
return true;
};
Manager.prototype.gatherPackageErrors = function (pkg) {
pkg.on('error', function (err, origin) {
pkg = origin || pkg;
// If the error message starts with the package name, strip it
if (!err.message.indexOf(pkg.name + ' ')) {
err.message = err.message.substr(pkg.name.length + 1);
}
this.errors.push({ pkg: pkg, error: err });
}.bind(this));
};
Manager.prototype.install = function () {
async.forEach(Object.keys(this.dependencies), function (name, next) {
var pkg = this.dependencies[name][0];
pkg.once('install', function () {
this.emit('package', pkg);
next();
}.bind(this)).install();
pkg.once('error', next);
}.bind(this), function () {
if (this.errors.length) this.reportErrors();
return this.emit('install');
}.bind(this));
};
Manager.prototype.muteDependencies = function () {
for (var name in this.dependencies) {
this.dependencies[name].forEach(function (pkg) {
pkg.removeAllListeners();
pkg.on('error', function () {});
});
}
};
Manager.prototype.reportErrors = function () {
this.muteDependencies();
template('error-summary', { errors: this.errors }).on('data', function (data) {
this.emit('data', data);
this.emit('resolve', false);
}.bind(this));
};
Manager.prototype.reportConflicts = function (name, packages) {
var versions = [];
var requirements = [];
packages = packages.filter(function (pkg) { return !!pkg.version; });
packages.forEach(function (pkg) {
requirements.push({ pkg: pkg, tag: pkg.originalTag || '~' + pkg.version });
versions.push((pkg.originalTag || '~' + pkg.version).white);
});
this.emit('error', new Error('No resolvable version for ' + name));
this.emit('data', template('conflict', {
name: name,
requirements: requirements,
json: config.json,
versions: versions.slice(0, -1).join(', ') + ' or ' + versions[versions.length - 1]
}, true));
};
Manager.prototype.reportForceblyResolved = function (name, packages) {
var requirements = [];
packages = packages.filter(function (pkg) { return !!pkg.version; });
packages.forEach(function (pkg) {
requirements.push({ pkg: pkg, tag: pkg.originalTag || '~' + pkg.version });
});
this.emit('data', template('resolved-conflict', {
name: name,
requirements: requirements,
json: config.json,
resolvedTo: packages[0].version,
forceLatest: this.opts.forceLatest
}, true));
};
// ----- list ----- //
// Used in list command
// TODO: not sure if this belongs here.. maybe move it to the list command?
Manager.prototype.list = function (options) {
options = options || {};
// If the user passed the paths or map options, we don't need to fetch versions
this._isCheckingVersions = !options.offline && !options.paths && !options.map && options.argv;
this.once('resolveLocal', this.getDependencyList.bind(this))
.resolveLocal();
};
Manager.prototype.getDependencyList = function () {
var packages = {};
var values;
var checkVersions = this._isCheckingVersions;
Object.keys(this.dependencies).forEach(function (key) {
packages[key] = this.dependencies[key][0];
}.bind(this));
values = _.values(packages);
// Do not proceed if no values
if (!values.length) {
return packages;
}
if (checkVersions) {
template('action', { name: 'discover', shizzle: 'Please wait while newer package versions are being discovered' })
.on('data', this.emit.bind(this, 'data'));
}
// Load JSON and get version for each package
async.forEach(values, function (pkg, next) {
pkg.once('loadJSON', function () {
// Only check versions if not offline and it's a repo
var fetchVersions = checkVersions &&
pkg.json.repository &&
(pkg.json.repository.type === 'git' || pkg.json.repository.type === 'local-repo');
if (fetchVersions) {
pkg.once('versions', function (versions) {
pkg.tags = versions.map(function (ver) {
return semver.valid(ver) ? semver.clean(ver) : ver;
});
next();
}).versions();
} else {
pkg.tags = [];
next();
}
}).loadJSON();
}.bind(this), this.emit.bind(this, 'list', packages));
};
module.exports = Manager;

View File

@@ -1,873 +0,0 @@
// ==========================================
// BOWER: Package Object Definition
// ==========================================
// Copyright 2012 Twitter, Inc
// Licensed under The MIT License
// http://opensource.org/licenses/MIT
// ==========================================
// Events:
// - install: fired when package installed
// - resolve: fired when deps resolved
// - error: fired on all errors
// - data: fired when trying to output data
// ==========================================
var fstream = require('fstream');
var mkdirp = require('mkdirp');
var events = require('events');
var rimraf = require('rimraf');
var semver = require('semver');
var async = require('async');
var https = require('https');
var http = require('http');
var path = require('path');
var glob = require('glob');
var url = require('url');
var tmp = require('tmp');
var fs = require('fs');
var crypto = require('crypto');
var unzip = require('unzip');
var tar = require('tar');
var _ = require('lodash');
var hogan = require('hogan.js');
var config = require('./config');
var source = require('./source');
var template = require('../util/template');
var readJSON = require('../util/read-json');
var fileExists = require('../util/file-exists');
var fallback = require('../util/fallback');
var isRepo = require('../util/is-repo');
var git = require('../util/git-cmd');
var UnitWork = require('./unit_work');
var Package = function (name, endpoint, manager) {
this.dependencies = {};
this.json = {};
this.name = name;
this.manager = manager;
this.unitWork = manager ? manager.unitWork : new UnitWork;
this.opts = manager ? manager.opts : {};
this.explicitName = true;
if (endpoint) {
var split;
if (/^(.*\.git)$/.exec(endpoint)) {
this.gitUrl = RegExp.$1.replace(/^git\+/, '');
this.tag = false;
} else if (/^(.*\.git)#(.*)$/.exec(endpoint)) {
this.tag = RegExp.$2;
this.gitUrl = RegExp.$1.replace(/^git\+/, '');
} else if (/^(?:(git):|git\+(https?):)\/\/([^#]+)#?(.*)$/.exec(endpoint)) {
this.gitUrl = (RegExp.$1 || RegExp.$2) + '://' + RegExp.$3;
this.tag = RegExp.$4;
} else if (semver.validRange(endpoint)) {
this.tag = endpoint;
this.explicitName = false;
} else if (/^[\.\/~]\.?[^.]*\.(js|css)/.test(endpoint) && fs.statSync(endpoint).isFile()) {
this.path = path.resolve(endpoint);
this.assetType = path.extname(endpoint);
} else if (/^https?:\/\//.exec(endpoint)) {
this.assetUrl = endpoint;
this.assetType = path.extname(endpoint);
} else if (fileExists.sync((split = endpoint.split('#', 2))[0]) && fs.statSync(split[0]).isDirectory()) {
this.path = path.resolve(split[0]);
this.tag = split[1];
} else if (/^[\.\/~]/.test(endpoint)) {
this.path = path.resolve(endpoint);
} else if (endpoint.split('/').length === 2) {
this.gitUrl = this.resolveShorthand(config.shorthand_resolver, (split = endpoint.split('#', 2))[0]);
this.tag = split[1];
this.shorthand = endpoint;
} else {
split = endpoint.split('#', 2);
this.tag = split[1];
}
// Guess names
if (!this.name) {
if (this.gitUrl) this.name = path.basename(endpoint).replace(/(\.git)?(#.*)?$/, '');
else if (this.path) this.name = path.basename(this.path, this.assetType);
else if (this.assetUrl) this.name = this.name = path.basename(this.assetUrl, this.assetType);
else if (split) this.name = split[0];
this.explicitName = false;
}
this.cacheName = this.name;
// Store a reference to the original tag & original path
// This is because the tag & paths can get rewritten later
if (this.tag) this.originalTag = this.tag;
if (this.path) this.originalPath = endpoint;
if (this.assetUrl) this.originalAssetUrl = this.assetUrl;
// The id is an unique id that describes this package
this.id = crypto.createHash('md5').update(this.name + '%' + this.tag + '%' + this.gitUrl + '%' + this.path + '%' + this.assetUrl).digest('hex');
// Generate a resource id
if (this.gitUrl) this.generateResourceId();
}
if (this.manager) {
this.on('data', this.manager.emit.bind(this.manager, 'data'));
this.on('warn', this.manager.emit.bind(this.manager, 'warn'));
this.on('error', function (err, origin) {
// Unlock the unit of work automatically on error (only if the error is from this package)
if (!origin && this.unitWork.isLocked(this.cacheName)) this.unitWork.unlock(this.cacheName, this);
// Propagate the error event to the parent package/manager
this.manager.emit('error', err, origin || this);
}.bind(this));
}
// Cache a self bound function
this.waitUnlock = this.waitUnlock.bind(this);
this.setMaxListeners(30); // Increase the number of listeners because a package can have more than the default 10 dependencies
};
Package.prototype = Object.create(events.EventEmitter.prototype);
Package.prototype.constructor = Package;
Package.prototype.resolve = function () {
// Ensure that nobody is resolving the same dep at the same time
// If there is, we wait for the unlock event
if (this.unitWork.isLocked(this.cacheName)) return this.unitWork.on('unlock', this.waitUnlock);
var data = this.unitWork.retrieve(this.cacheName);
if (data) {
// Check if this exact package is the last resolved one
// If so, we copy the resolved result and we don't need to do anything else
if (data.id === this.id) {
this.unserialize(data);
this.emit('resolve');
return this;
}
}
// If not, we lock and resolve it
this.unitWork.lock(this.cacheName, this);
if (this.assetUrl) {
this.download();
} else if (this.gitUrl) {
this.clone();
} else if (this.path) {
this.copy();
} else {
this.once('lookup', this.clone).lookup();
}
return this;
};
Package.prototype.lookup = function () {
source.lookup(this.name, function (err, url) {
if (err) return this.emit('error', err);
this.lookedUp = true;
this.gitUrl = url;
this.generateResourceId();
this.emit('lookup');
}.bind(this));
};
Package.prototype.install = function () {
// Only print the installing action if this package has been resolved
if (this.unitWork.retrieve(this.cacheName)) {
template('action', { name: 'installing', shizzle: this.name + (this.version ? '#' + this.version : '') })
.on('data', this.emit.bind(this, 'data'));
}
var localPath = this.localPath;
if (path.resolve(this.path) === localPath) {
this.emit('install');
return this;
}
// Remove stuff from the local path (if any)
// Rename path to the local path
// Beware that if the local path exists and is a git repository, the process is aborted
isRepo(localPath, function (is) {
if (is) {
var err = new Error('Local path is a local repository');
err.details = 'To avoid losing work, please remove ' + localPath + ' manually.';
return this.emit('error', err, this);
}
mkdirp(path.dirname(localPath), function (err) {
if (err) return this.emit('error', err);
rimraf(localPath, function (err) {
if (err) return this.emit('error', err);
return fs.rename(this.path, localPath, function (err) {
if (!err) return this.cleanUpLocal();
var writter = fstream.Writer({
type: 'Directory',
path: localPath
});
writter
.on('error', this.emit.bind(this, 'error'))
.on('end', rimraf.bind(this, this.path, this.cleanUpLocal.bind(this)));
fstream.Reader(this.path)
.on('error', this.emit.bind(this, 'error'))
.pipe(writter);
}.bind(this));
}.bind(this));
}.bind(this));
}.bind(this));
return this;
};
Package.prototype.cleanUpLocal = function () {
this.once('readLocalConfig', function () {
this.json.name = this.name;
this.json.version = this.commit ? '0.0.0' : this.version || '0.0.0';
// Detect commit and save it in the json for later use
if (this.commit) this.json.commit = this.commit;
else delete this.json.commit;
if (this.gitUrl) this.json.repository = { type: 'git', url: this.gitUrl };
else if (this.gitPath) this.json.repository = { type: 'local-repo', path: this.originalPath };
else if (this.originalPath) this.json.repository = { type: 'local', path: this.originalPath };
else if (this.assetUrl) this.json = this.generateAssetJSON();
var jsonStr = JSON.stringify(this.json, null, 2);
// Save json file
async.parallel({
'local': function (next) {
fs.writeFile(path.join(this.localPath, this.localConfig.json), jsonStr, next);
}.bind(this),
'git-path': function (next) {
if (!this.gitPath) return next();
fileExists(this.gitPath, function (exists) {
if (!exists) return next();
fs.writeFile(path.join(this.gitPath, this.localConfig.json), jsonStr, next);
}.bind(this));
}.bind(this)
}, function (err) {
if (err) return this.emit('error', err);
this.removeLocalPaths();
}.bind(this));
}.bind(this)).readLocalConfig();
};
// finish clean up local by removing .git/ and any ignored files
Package.prototype.removeLocalPaths = function () {
var removePatterns = ['.git'];
if (this.json.ignore) {
removePatterns.push.apply(removePatterns, this.json.ignore);
}
var removePaths = [];
// 3: done
var pathsRemoved = function (err) {
if (err) return this.emit('error', err);
this.emit('install');
}.bind(this);
// 2: trigger after paths have been globbed
var rimrafPaths = function (err) {
if (err) return this.emit('error', err);
async.forEach(removePaths, function (removePath, next) {
// rimraf all the paths
rimraf(path.join(this.localPath, removePath), next);
}.bind(this), pathsRemoved);
}.bind(this);
// 1: get paths
var globOpts = { dot: true, cwd: this.localPath };
async.forEach(removePatterns, function (removePattern, next) {
// glob path for file path pattern matching
glob(removePattern, globOpts, function (err, globPaths) {
if (err) return next(err);
removePaths.push.apply(removePaths, globPaths);
next();
}.bind(this));
}.bind(this), rimrafPaths);
};
Package.prototype.generateAssetJSON = function () {
return {
name: this.name,
main: this.assetType !== '.zip' && this.assetType !== '.tar' ? 'index' + this.assetType : '',
version: '0.0.0',
repository: { type: 'asset', url: this.originalAssetUrl }
};
};
Package.prototype.uninstall = function () {
template('action', { name: 'uninstalling', shizzle: this.path })
.on('data', this.emit.bind(this, 'data'));
rimraf(this.path, function (err) {
if (err) return this.emit('error', err);
this.emit('uninstall');
}.bind(this));
};
// Private
Package.prototype.findJSON = function () {
fallback(this.path, [config.json, 'bower.json', 'component.json'], function (name) {
if (name) {
if (name === 'component.json') {
this.emit('warn', 'Package ' + this.name + ' is still using the deprecated "component.json" file');
}
this.localConfig.json = name;
}
this.emit('readLocalConfig');
}.bind(this));
};
Package.prototype.readLocalConfig = function () {
if (this.localConfig) return this.emit('readLocalConfig');
fs.readFile(path.join(this.path, '.bowerrc'), function (err, file) {
// If the local .bowerrc file do not exists then we check if the
// json specific in the config exists (if not, we fallback to bower.json)
if (err) {
this.localConfig = { json: config.json };
this.findJSON();
} else {
// If the local .bowerrc file exists, we read it and check if a custom json file
// is defined. If not, we check if the global config json file exists (if not, we fallback to bower.json)
try {
this.localConfig = JSON.parse(file);
} catch (e) {
return this.emit('error', new Error('Unable to parse local .bowerrc file: ' + e.message));
}
if (!this.localConfig.json) {
this.localConfig.json = config.json;
return this.findJSON();
}
this.emit('readLocalConfig');
}
}.bind(this));
};
Package.prototype.loadJSON = function () {
if (!this.path || this.assetUrl) return this.emit('loadJSON');
this.once('readLocalConfig', function () {
var jsonFile = path.join(this.path, this.localConfig.json);
fileExists(jsonFile, function (exists) {
// If the json does not exists, we attempt to get the version
if (!exists) {
return this.once('describeTag', function (tag) {
tag = semver.clean(tag);
if (!tag) this.version = this.tag;
else {
this.version = tag;
if (!this.tag) this.tag = this.version;
}
this.emit('loadJSON');
}.bind(this)).describeTag();
}
readJSON(jsonFile, function (err, json) {
if (err) {
err.details = 'An error was caught when reading the ' + this.localConfig.json + ': ' + err.message;
return this.emit('error', err);
}
this.json = json;
this.version = this.commit || json.commit || json.version;
this.commit = this.commit || json.commit;
// Only overwrite the name if not already set
// This is because some packages have different names declared in the registry and the json
if (!this.name || !this.explicitName) {
this.name = json.name;
}
// Read the endpoint from the json to ensure it is set correctly
this.readEndpoint();
// Detect if the tag mismatches the json.version
// This is very often to happen because developers tag their new releases but forget to update the json accordingly
var cleanedTag;
if (this.tag && (cleanedTag = semver.clean(this.tag)) && cleanedTag !== this.version) {
// Only print the warning once
if (!this.unitWork.retrieve('mismatch#' + this.cacheName + '_' + cleanedTag)) {
template('warning-mismatch', { name: this.cacheName, json: this.localConfig.json, tag: cleanedTag, version: this.version || 'N/A' })
.on('data', this.emit.bind(this, 'data'));
this.unitWork.store('mismatch#' + this.cacheName + '_' + cleanedTag, true);
}
// Assume the tag
this.version = cleanedTag;
}
this.emit('loadJSON');
}.bind(this), this);
}.bind(this));
}.bind(this)).readLocalConfig();
};
Package.prototype.download = function () {
template('action', { name: 'downloading', shizzle: this.assetUrl })
.on('data', this.emit.bind(this, 'data'));
var src;
if (config.proxy) {
src = url.parse(config.proxy);
src.path = this.assetUrl;
} else {
src = url.parse(this.assetUrl);
}
tmp.dir({
prefix: 'bower-' + this.name + '-',
mode: parseInt('0777', 8) & (~process.umask()),
unsafeCleanup: true
}, function (err, tmpPath) {
if (err) return this.emit('error', err);
var req = src.protocol === 'https:' ? https : http;
req.get(src, function (res) {
// If assetUrl results in a redirect we update the assetUrl to the redirect to url
if (res.statusCode >= 300 && res.statusCode < 400 && res.headers.location) {
template('action', { name: 'redirect detected', shizzle: res.headers.location})
.on('data', this.emit.bind(this, 'data'));
this.assetUrl = res.headers.location;
return this.download();
}
// Detect not OK status codes
if (res.statusCode < 200 || res.statusCode >= 300) {
return this.emit('error', new Error(res.statusCode + ' status code for ' + this.assetUrl));
}
var file = fs.createWriteStream(path.join((this.path = tmpPath), 'index' + this.assetType));
res.on('data', function (data) {
file.write(data);
});
res.on('end', function () {
file.end();
var next = function () {
this.once('loadJSON', this.saveUnit).loadJSON();
}.bind(this);
if (this.assetType === '.zip' || this.assetType === '.tar') this.once('extract', next).extract();
else next();
}.bind(this));
}.bind(this)).on('error', this.emit.bind(this, 'error'));
}.bind(this));
};
Package.prototype.extract = function () {
var file = path.join(this.path, 'index' + this.assetType);
template('action', { name: 'extracting', shizzle: file }).on('data', this.emit.bind(this, 'data'));
fs.createReadStream(file).pipe(this.assetType === '.zip' ? unzip.Extract({ path: this.path }) : tar.Extract({ path: this.path }))
.on('error', this.emit.bind(this, 'error'))
.on('close', function () {
// Delete zip
fs.unlink(file, function (err) {
if (err) return this.emit('error', err);
// If we extracted only a folder, move all the files within it to the original path
fs.readdir(this.path, function (err, files) {
if (err) return this.emit('error', err);
if (files.length !== 1) return this.emit('extract');
var dir = path.join(this.path, files[0]);
fs.stat(dir, function (err, stat) {
if (err) return this.emit('error', err);
if (!stat.isDirectory()) return this.emit('extract');
fs.readdir(dir, function (err, files) {
if (err) return this.emit('error', err);
async.forEachSeries(files, function (file, next) {
fs.rename(path.join(dir, file), path.join(this.path, file), next);
}.bind(this), function (err) {
if (err) return this.emit('error');
fs.rmdir(dir, function (err) {
if (err) return this.emit('error');
this.emit('extract');
}.bind(this));
}.bind(this));
}.bind(this));
}.bind(this));
}.bind(this));
}.bind(this));
}.bind(this));
};
Package.prototype.copy = function () {
template('action', { name: 'copying', shizzle: this.path }).on('data', this.emit.bind(this, 'data'));
tmp.dir({
prefix: 'bower-' + this.name + '-',
unsafeCleanup: true
}, function (err, tmpPath) {
if (err) return this.emit('error', err);
fs.stat(this.path, function (err, stats) {
if (err) return this.emit('error', err);
// Copy file permission for directory
fs.chmod(tmpPath, stats.mode, function (err) {
if (err) return this.emit('error', err);
if (this.assetType) {
return fs.readFile(this.path, function (err, data) {
fs.writeFile(path.join((this.path = tmpPath), 'index' + this.assetType), data, function () {
this.once('loadJSON', this.saveUnit).loadJSON();
}.bind(this));
}.bind(this));
}
this.once('loadJSON', function () {
if (this.gitUrl) return this.saveUnit();
// Check if the copied directory is a git repository and is a local endpoint
// If so, treat it like a repository.
fileExists(path.join(this.path, '.git'), function (exists) {
if (!exists) return this.saveUnit();
this.gitPath = this.path;
this.once('loadJSON', this.saveUnit.bind(this)).checkout();
}.bind(this));
}.bind(this));
var writter = fstream.Writer({
type: 'Directory',
path: tmpPath
})
.on('error', this.emit.bind(this, 'error'))
.on('end', this.loadJSON.bind(this));
fstream.Reader(this.path)
.on('error', this.emit.bind(this, 'error'))
.pipe(writter);
this.path = tmpPath;
}.bind(this));
}.bind(this));
}.bind(this));
};
Package.prototype.getDeepDependencies = function (result) {
result = result || [];
for (var name in this.dependencies) {
result.push(this.dependencies[name]);
this.dependencies[name].getDeepDependencies(result);
}
return result;
};
Package.prototype.saveUnit = function () {
this.unitWork.store(this.cacheName, this.serialize(), this);
this.unitWork.unlock(this.cacheName, this);
this.addDependencies();
};
Package.prototype.addDependencies = function () {
var dependencies = this.json.dependencies || {};
var callbacks = Object.keys(dependencies).map(function (name) {
return function (callback) {
var endpoint = dependencies[name];
var pkg = new Package(name, endpoint, this);
pkg.once('resolve', function () {
this.dependencies[pkg.name] = pkg;
callback();
}.bind(this)).resolve();
}.bind(this);
}.bind(this));
async.parallel(callbacks, function (err) {
if (err) return this.emit('error', err);
this.emit('resolve');
}.bind(this));
};
Package.prototype.exists = function (callback) {
fileExists(this.localPath, callback);
};
Package.prototype.clone = function () {
template('action', { name: 'cloning', shizzle: this.gitUrl }).on('data', this.emit.bind(this, 'data'));
this.path = this.gitPath;
this.once('cache', function () {
this.once('loadJSON', this.copy.bind(this)).checkout();
}.bind(this)).cache();
};
Package.prototype.cache = function () {
// If the force options is true, we need to erase from the cache
// Be aware that a similar package might already flushed it
// To prevent that we check the unit of work storage
if (this.opts.force && !this.unitWork.retrieve('flushed#' + this.cacheName + '_' + this.resourceId)) {
rimraf(this.path, function (err) {
if (err) return this.emit('error', err);
this.unitWork.store('flushed#' + this.cacheName + '_' + this.resourceId, true);
this.cache();
}.bind(this));
return this;
}
mkdirp(config.cache, function (err) {
if (err) return this.emit('error', err);
fileExists(this.path, function (exists) {
if (exists) {
template('action', { name: 'cached', shizzle: this.gitUrl }).on('data', this.emit.bind(this, 'data'));
return this.emit('cache');
}
template('action', { name: 'caching', shizzle: this.gitUrl }).on('data', this.emit.bind(this, 'data'));
var url = this.gitUrl;
if (config.proxy) {
url = url.replace(/^git:/, 'https:');
}
mkdirp(this.path, function (err) {
if (err) return this.emit('error', err);
var cp = git(['clone', url, this.path], null, this);
cp.on('close', function (code) {
if (code) return;
this.emit('cache');
}.bind(this));
}.bind(this));
}.bind(this));
}.bind(this));
};
Package.prototype.checkout = function () {
template('action', { name: 'fetching', shizzle: this.name })
.on('data', this.emit.bind(this, 'data'));
this.once('versions', function (versions) {
if (!versions.length) {
this.emit('checkout');
this.loadJSON();
}
// If tag is specified, try to satisfy it
if (this.tag) {
if (!semver.validRange(this.tag)) {
return this.emit('error', new Error('Tag ' + this.tag + ' is not a valid semver range/version'));
}
versions = versions.filter(function (version) {
return semver.satisfies(version, this.tag);
}.bind(this));
if (!versions.length) {
var error = new Error('Could not find tag satisfying: ' + this.name + '#' + this.tag);
error.details = 'The tag ' + this.tag + ' could not be found within the repository';
return this.emit('error', error);
}
}
// Use latest version
this.tag = versions[0];
if (!semver.valid(this.tag)) this.commit = this.tag; // If the version is not valid, then its a commit
if (this.tag) {
template('action', {
name: 'checking out',
shizzle: this.name + '#' + this.tag
}).on('data', this.emit.bind(this, 'data'));
// Checkout the tag
git([ 'checkout', this.tag, '-f'], { cwd: this.path }, this).on('close', function (code) {
if (code) return;
// Ensure that checkout the tag as it is, removing all untracked files
git(['clean', '-f', '-d'], { cwd: this.path }, this).on('close', function (code) {
if (code) return;
this.emit('checkout');
this.loadJSON();
}.bind(this));
}.bind(this));
}
}).versions();
};
Package.prototype.describeTag = function () {
var cp = git(['describe', '--always', '--tag'], { cwd: this.gitPath || this.path, ignoreCodes: [128] }, this);
var tag = '';
cp.stdout.setEncoding('utf8');
cp.stdout.on('data', function (data) {
tag += data;
});
cp.on('close', function (code) {
if (code === 128) tag = 'unspecified'; // Not a git repo
this.emit('describeTag', tag.replace(/\n$/, ''));
}.bind(this));
};
Package.prototype.versions = function () {
this.once('fetch', function () {
var cp = git(['tag'], { cwd: this.gitPath }, this);
var versions = '';
cp.stdout.setEncoding('utf8');
cp.stdout.on('data', function (data) {
versions += data;
});
cp.on('close', function (code) {
if (code) return;
versions = versions.split('\n');
versions = versions.filter(function (ver) {
return semver.valid(ver);
});
versions = versions.sort(function (a, b) {
return semver.gt(a, b) ? -1 : 1;
});
if (versions.length) return this.emit('versions', versions);
// If there is no versions tagged in the repo
// then we grab the hash of the last commit
versions = '';
cp = git(['log', '-n', 1, '--format=%H'], { cwd: this.gitPath }, this);
cp.stdout.setEncoding('utf8');
cp.stdout.on('data', function (data) {
versions += data;
});
cp.on('close', function (code) {
if (code) return;
versions = _.compact(versions.split('\n'));
this.emit('versions', versions);
}.bind(this));
}.bind(this));
}.bind(this)).fetch();
};
Package.prototype.fetch = function () {
fileExists(this.gitPath, function (exists) {
if (!exists) return this.emit('error', new Error('Unable to fetch package ' + this.name + ' (if the cache was deleted, run install again)'));
var cp = git(['fetch', '--prune'], { cwd: this.gitPath }, this);
cp.on('close', function (code) {
if (code) return;
cp = git(['reset', '--hard', this.gitUrl ? 'origin/HEAD' : 'HEAD'], { cwd: this.gitPath }, this);
cp.on('close', function (code) {
if (code) return;
this.emit('fetch');
}.bind(this));
}.bind(this));
}.bind(this));
};
Package.prototype.readEndpoint = function (replace) {
if (!this.json.repository) return;
if (this.json.repository.type === 'git') {
if (replace || !this.gitUrl) {
this.gitUrl = this.json.repository.url;
this.generateResourceId();
}
return { type: 'git', endpoint: this.gitUrl };
}
if (this.json.repository.type === 'local-repo') {
if (replace || !this.gitPath) {
this.gitPath = path.resolve(this.json.repository.path);
}
return { type: 'local', endpoint: this.path };
}
if (this.json.repository.type === 'local') {
if (replace || !this.originalPath) {
this.originalPath = this.path = path.resolve(this.json.repository.path);
}
return { type: 'local', endpoint: this.originalPath };
}
if (this.json.repository.type === 'asset') {
if (replace || !this.assetUrl) {
this.originalAssetUrl = this.assetUrl = this.json.repository.url;
this.assetType = path.extname(this.assetUrl);
}
return { type: 'asset', endpoint: this.originalAssetUrl };
}
};
Package.prototype.waitUnlock = function (name) {
if (this.name === name) {
this.unitWork.removeListener('unlock', this.waitUnlock);
this.resolve();
}
};
Package.prototype.serialize = function () {
return {
id: this.id,
resourceId: this.resourceId,
path: this.path,
originalPath: this.originalPath,
tag: this.tag,
originalTag: this.originalTag,
commit: this.commit,
assetUrl: this.assetUrl,
originalAssetUrl: this.originalAssetUrl,
assetType: this.assetType,
lookedUp: this.lookedUp,
json: this.json,
gitUrl: this.gitUrl,
gitPath: this.gitPath,
dependencies: this.dependencies,
localConfig: this.localConfig
};
};
Package.prototype.unserialize = function (obj) {
for (var key in obj) {
this[key] = obj[key];
}
this.version = this.tag;
};
Package.prototype.generateResourceId = function () {
this.resourceId = crypto.createHash('md5').update(this.gitUrl).digest('hex');
this.gitPath = path.join(config.cache, this.cacheName, this.resourceId);
};
Package.prototype.resolveShorthand = function (shorthand, path) {
shorthand = hogan.compile(shorthand);
var parts = path.split('/');
return shorthand.render({
organization: parts[0],
package: parts[1],
endpoint: path
});
};
Object.defineProperty(Package.prototype, 'localPath', {
get: function () {
return path.join(process.cwd(), config.directory, this.name);
}
});
module.exports = Package;

View File

@@ -1,146 +0,0 @@
// ==========================================
// BOWER: Source Api
// ==========================================
// Copyright 2012 Twitter, Inc
// Licensed under The MIT License
// http://opensource.org/licenses/MIT
// ==========================================
var request = require('request');
var config = require('./config');
var endpoint = config.endpoint + '/packages';
if (config.proxy) {
request = request.defaults({ proxy: config.proxy, timeout: 5000 });
}
// allow for searchpath endpoints to be used for search and lookup
var endpoints = [];
endpoints.push(endpoint);
if (config.searchpath) {
for (var i = 0; i < config.searchpath.length; i += 1) {
endpoints.push(config.searchpath[i] + '/packages');
}
}
exports.lookup = function (name, callback) {
// walk all endpoints to find the first matching component
var f = function (i) {
var endpoint = endpoints[i];
request.get(endpoint + '/' + encodeURIComponent(name), function (err, response, body) {
if (err || (response.statusCode !== 200 && response.statusCode !== 404)) {
return callback(err || new Error(name + ' failed to look up for endpoint: ' + endpoint));
}
if (response && response.statusCode !== 404) {
callback(err, body && JSON.parse(body).url);
} else {
if (i + 1 < endpoints.length) f(i + 1);
else return callback(new Error(name + ' not found'));
}
});
};
f(0);
};
exports.register = function (name, url, callback) {
var body = {name: name, url: url};
request.post({url: endpoint, form: body}, function (err, response) {
if (err) return callback(err);
if (response.statusCode === 406) {
return callback(new Error('Duplicate package'));
}
if (response.statusCode === 400) {
return callback(new Error('Incorrect format'));
}
if (response.statusCode !== 201) {
return callback(new Error('Unknown error: ' + response.statusCode));
}
callback();
});
};
exports.search = function (name, callback) {
// walk all endpoints to produced federated search results
var f = function (i, map, results) {
var endpoint = endpoints[i];
request.get(endpoint + '/search/' + encodeURIComponent(name), function (err, response, body) {
if (err || (response.statusCode !== 200 && response.statusCode !== 404)) {
return callback(err || new Error(name + ' failed to look up for endpoint: ' + endpoint));
}
if (response && response.statusCode !== 404) {
var array = body && JSON.parse(body);
for (var x = 0; x < array.length; x += 1) {
var pkgName = array[x].name;
if (!map[pkgName]) {
map[pkgName] = pkgName;
results.push({ name: pkgName, url: array[x].url, endpoint: array[x].endpoint });
}
}
}
if (i + 1 < endpoints.length) f(i + 1, map, results);
else return callback(null, results);
});
};
f(0, {}, []);
};
exports.info = function (name, callback) {
exports.lookup(name, function (err, url) {
if (err) return callback(err);
var Package = require('./package');
var pkg = new Package(name, url);
pkg.once('error', function (err) {
pkg.removeAllListeners();
callback(err);
});
pkg.once('resolve', function () {
pkg.once('versions', function (versions) {
pkg.removeAllListeners();
callback(null, { pkg: pkg, versions: versions });
}).versions();
}).resolve();
});
};
exports.all = function (callback) {
// walk all endpoints to produced federated search results
var f = function (i, map, results) {
var endpoint = endpoints[i];
request.get(endpoint, function (err, response, body) {
if (err || (response.statusCode !== 200 && response.statusCode !== 404)) {
return callback(err || new Error('Failed to look up endpoint: ' + endpoint));
}
if (response && response.statusCode !== 404) {
var array = body && JSON.parse(body);
for (var x = 0; x < array.length; x += 1) {
var pkgName = array[x].name;
if (!map[pkgName]) {
map[pkgName] = pkgName;
results.push({ name: pkgName, url: array[x].url, endpoint: array[x].endpoint });
}
}
}
if (i + 1 < endpoints.length) f(i + 1, map, results);
else return callback(null, results);
});
};
f(0, {}, []);
};

View File

@@ -1,64 +0,0 @@
// ==========================================
// BOWER: Package Object Definition
// ==========================================
// Copyright 2012 Twitter, Inc
// Licensed under The MIT License
// http://opensource.org/licenses/MIT
// ==========================================
// Events:
// - lock: fired when a lock write over a key is acquired
// - unlock: fired when an unlock write over a key is acquired
// ==========================================
var events = require('events');
var UnitWork = function () {
this.locks = [];
this.data = [];
this.setMaxListeners(100); // Increase the number of listeners because this is a central storage
};
UnitWork.prototype = Object.create(events.EventEmitter.prototype);
UnitWork.prototype.constructor = UnitWork;
UnitWork.prototype.lock = function (key, owner) {
if (this.locks[key]) throw new Error('A write lock for "' + key + '" was already acquired.');
if (!owner) throw new Error('A lock requires an owner.');
this.locks[key] = owner;
return this.emit('lock', key);
};
UnitWork.prototype.unlock = function (key, owner) {
if (!owner) throw new Error('A write lock requires an owner.');
if (this.locks[key]) {
if (this.locks[key] !== owner) throw new Error('Lock owner for "' + key + '" mismatch.');
delete this.locks[key];
this.emit('unlock', key);
}
return this;
};
UnitWork.prototype.isLocked = function (key) {
return !!this.locks[key];
};
UnitWork.prototype.store = function (key, data, owner) {
if (this.locks[key] && owner !== this.locks[key]) throw new Error('A write lock for "' + key + '" is acquired therefore only its owner can write to it.');
this.data[key] = data;
return this;
};
UnitWork.prototype.retrieve = function (key) {
return this.data[key];
};
UnitWork.prototype.keys = function () {
return Object.keys(this.data);
};
module.exports = UnitWork;

View File

@@ -1,20 +0,0 @@
// ==========================================
// BOWER: Public API Definition
// ==========================================
// Copyright 2012 Twitter, Inc
// Licensed under The MIT License
// http://opensource.org/licenses/MIT
// ==========================================
var abbrev = require('abbrev');
var commands = require('./commands');
var abbreviations = abbrev(Object.keys(commands));
abbreviations.i = 'install';
abbreviations.rm = 'uninstall';
module.exports = {
commands: commands,
abbreviations: abbreviations,
config: require('./core/config')
};

View File

@@ -1,65 +0,0 @@
// ==========================================
// BOWER: completion
// ==========================================
// Copyright 2012 Twitter, Inc
// Licensed under The MIT License
// http://opensource.org/licenses/MIT
// ==========================================
// This module exposes a simple helper to parse the environment variables in
// case of a tab completion command. It parses the provided `argv` (nopt's
// remain arguments after `--`) and `env` (should be process.env)
//
// It is inspired and based off Isaac's work on npm.
module.exports = function (argv, env) {
var opts = {};
// w is the words number, based on the cursor position
opts.w = +env.COMP_CWORD;
// words is the escaped sequence of words following `bower`
opts.words = argv.map(function (word) {
return word.charAt(0) === '"' ?
word.replace(/^"|"$/g, '') :
word.replace(/\\ /g, ' ');
});
// word is a shortcut to the last word in the line
opts.word = opts.words[opts.w - 1];
// line is the sequence of tab completed words.
opts.line = env.COMP_LINE;
// point is the cursor position in the line
opts.point = +env.COMP_POINT;
// length is the whole line's length.
opts.length = opts.line.length;
// partialLine is the line ignoring the sequence of characters after
// cursor position, ie. tabbing at: bower install j|qu
// gives back a partialLine: bower install j
opts.partialLine = opts.line.slice(0, opts.point);
// partialWords is only returning the words based on cursor position,
// ie tabbing at: bower install ze|pto backbone
// gives back a partialWords array: ['install', 'zepto']
opts.partialWords = opts.words.slice(0, opts.w);
return opts;
};
module.exports.log = function (arr, opts) {
arr = Array.isArray(arr) ? arr : [arr];
arr.filter(module.exports.abbrev(opts)).forEach(function (word) {
console.log(word);
});
};
module.exports.abbrev = function abbrev(opts) {
var word = opts.word.replace(/\./g, '\\.');
return function (it) {
return new RegExp('^' + word).test(it);
};
};

View File

@@ -1,32 +0,0 @@
// ==========================================
// BOWER: fallback
// ==========================================
// Copyright 2012 Twitter, Inc
// Licensed under The MIT License
// http://opensource.org/licenses/MIT
// ==========================================
// A function that takes a list of files and returns the first one that exists
// If none exists, return null
var fileExists = require('./file-exists');
var path = require('path');
var fallback = function (baseDir, files, callback) {
if (!Array.isArray(files) || files.length === 0) {
return callback(null);
}
var file = files.shift();
fileExists(path.join(baseDir, file), function (exists) {
if (!exists) {
return fallback(baseDir, files, callback);
} else {
return callback(file);
}
});
};
module.exports = fallback;

View File

@@ -1,26 +0,0 @@
// ==========================================
// BOWER: file-exists
// ==========================================
// Copyright 2012 Twitter, Inc
// Licensed under The MIT License
// http://opensource.org/licenses/MIT
// ==========================================
var fs = require('fs');
// This module exposes a version of fs.exists and fs.existsSync with a correct behaviour
// See: https://github.com/joyent/node/pull/2603
module.exports = function (path, callback) {
fs.stat(path, function (error) {
callback(!error || error.code !== 'ENOENT');
});
};
module.exports.sync = function (path) {
try {
return !!fs.statSync(path);
} catch (e) {
return e.code !== 'ENOENT';
}
};

View File

@@ -1,29 +0,0 @@
// ==========================================
// BOWER: git-cmd
// ==========================================
// Copyright 2012 Twitter, Inc
// Licensed under The MIT License
// http://opensource.org/licenses/MIT
// ==========================================
// Extension of the spawn command, that only executes git commands
// If a git command fails with code 128 in the cache, that directory
// will be deleted to prevent more issues
var path = require('path');
var spawn = require('./spawn');
var rimraf = require('rimraf');
var config = require('../core/config');
module.exports = function (args, options, emitter) {
process.env.GIT_TEMPLATE_DIR = config.git_template;
var cp = spawn('git', args, options, emitter);
var cwd = options ? options.cwd || process.cwd() : process.cwd();
var isTmp = path.normalize(cwd).indexOf(config.cache) === 0;
cp.on('exit', function (code) {
if (code === 128 && isTmp) rimraf.sync(cwd);
});
return cp;
};

View File

@@ -1,27 +0,0 @@
// ==========================================
// BOWER: Hogan.js renderWithColors extension
// ==========================================
// Copyright 2012 Twitter, Inc
// Licensed under The MIT License
// http://opensource.org/licenses/MIT
// ==========================================
var colors = require('colors');
var hogan = require('hogan.js');
var _ = require('lodash');
var nopt = require('nopt');
module.exports = hogan.Template.prototype.renderWithColors = function (context, partials, indent) {
if (nopt(process.argv).color === false) {
colors.mode = 'none';
}
context = _.extend({
yellow : function (s) { return s.yellow; },
green : function (s) { return s.green; },
cyan : function (s) { return s.cyan; },
red : function (s) { return s.red; },
white : function (s) { return s.white; }
}, context);
return this.ri([context], partials || {}, indent);
};

View File

@@ -1,23 +0,0 @@
// ==========================================
// BOWER: is-repo
// ==========================================
// Copyright 2012 Twitter, Inc
// Licensed under The MIT License
// http://opensource.org/licenses/MIT
// ==========================================
var fs = require('fs');
var path = require('path');
var fileExists = require('./file-exists');
// This module checks if a path is a local repository
// If the repository is a link, it will be falsy
module.exports = function (dir, callback) {
fileExists(path.join(dir, '.git'), function (exists) {
if (!exists) return callback(false);
fs.lstat(dir, function (err, stat) {
if (err) return callback(false);
callback(!stat.isSymbolicLink());
});
});
};

View File

@@ -1,103 +0,0 @@
// ==========================================
// BOWER: prune
// ==========================================
// Copyright 2012 Twitter, Inc
// Licensed under The MIT License
// http://opensource.org/licenses/MIT
// ==========================================
var semver = require('semver');
var sort = require('stable');
var versionRequirements = function (dependencyMap) {
var result = {};
for (var name in dependencyMap) {
dependencyMap[name].forEach(function (pkg) {
result[name] = result[name] || [];
if (pkg.originalTag && result[name].indexOf(pkg.originalTag) === -1) {
result[name].push(pkg.originalTag);
}
});
}
return result;
};
var validVersions = function (versions, dependency) {
if (!versions || !versions.length) return true;
// If a non resolved dependency is passed, we simply ignore it
if (!dependency.version) return false;
if (!semver.valid(dependency.version)) {
throw new Error('Invalid semver version ' + dependency.version + ' specified in ' + dependency.name);
}
return versions.every(function (version) {
return semver.satisfies(dependency.version, version);
});
};
module.exports = function (dependencyMap, forceLatest) {
// generate version requirements
// compare dependency map with version requirements
// check for conflicts
// select best version
// return an object with the resolved deps, conflict deps and forcebly resolved ones
var resolved = {};
var conflicted = null;
var forceblyResolved = null;
var versionMap = versionRequirements(dependencyMap);
var sortFunc = function (a, b) {
if (semver.gt(a.version, b.version)) return -1;
if (semver.lt(a.version, b.version)) return 1;
// If the comparison determines that both packages are equal, do not give priority to local ones
if (a.path === a.localPath && b.path !== b.localPath) return 1;
return 0;
};
// Note that bellow we use a stable sort algorithm
// This is because if two packages are equal, the initial order should be respected
for (var name in dependencyMap) {
var matches = dependencyMap[name].filter(validVersions.bind(this, versionMap[name]));
if (!matches.length) {
// No resolvable dependency
// We resolve to the latest package if the forceLatest is true
// Otherwise, check if any of those are root packages
// If so, we assume that as the resolver (with a warning)
// Otherwise there's a conflict
if (forceLatest) {
forceblyResolved = forceblyResolved || {};
forceblyResolved[name] = sort(dependencyMap[name], sortFunc);
continue;
}
matches = dependencyMap[name].filter(function (pkg) { return !!pkg.root; });
if (matches.length) {
forceblyResolved = forceblyResolved || {};
forceblyResolved[name] = dependencyMap[name].sort(function (a, b) {
if (a.root && b.root) return sortFunc(a, b);
if (a.root) return -1;
if (b.root) return 1;
return sortFunc(a, b);
});
} else {
conflicted = conflicted || {};
conflicted[name] = dependencyMap[name];
}
} else {
resolved[name] = [ sort(matches, sortFunc)[0] ];
}
}
return {
resolved: resolved,
conflicted: conflicted,
forceblyResolved: forceblyResolved
};
};

View File

@@ -1,25 +0,0 @@
// ==========================================
// BOWER: read-json.js - with logging fun
// ==========================================
// Copyright 2012 Twitter, Inc
// Licensed under The MIT License
// http://opensource.org/licenses/MIT
// ==========================================
var readJSON = require('read-package-json');
var template = require('./template');
var read = module.exports = function (path, cb, obj) {
readJSON.log = {
info: function () {},
verbose: function () {},
warn: function (what, name, shizzle) {
if (read.showWarnings) {
template('warn', { name: name.replace(/@/, '#'), shizzle: shizzle })
.on('data', obj.emit.bind(obj, 'data'));
}
}
};
readJSON.cache.reset();
readJSON(path, cb);
};

View File

@@ -1,98 +0,0 @@
// ==========================================
// BOWER: save
// ==========================================
// Copyright 2012 Twitter, Inc
// Licensed under The MIT License
// http://opensource.org/licenses/MIT
// ==========================================
var path = require('path');
var fs = require('fs');
var semver = require('semver');
var _ = require('lodash');
var config = require('../core/config');
function save(manager, paths, dev, cb) {
// If there is specific paths to save, redirect to the appropriate function
if (paths && paths.length) return savePkgs.apply(savePkgs, arguments);
manager.on('loadJSON', function (newLine) {
manager.json.dependencies = manager.json.dependencies || {};
manager.json.devDependencies = manager.json.devDependencies || {};
// Only include the root packages
for (var name in manager.dependencies) {
var curr = manager.dependencies[name][0];
if (curr.root) {
addDependency(manager.json, curr, !!manager.json.devDependencies[name]);
}
}
// Cleanup dependencies from the json if empty
if (!Object.keys(manager.json.dependencies).length) {
delete manager.json.dependencies;
}
// Cleanup dependencies if empty
if (!Object.keys(manager.json.devDependencies).length) {
delete manager.json.devDependencies;
}
// Finally save the modified json
var contents = JSON.stringify(manager.json, null, 2) + (newLine ? '\n' : '');
fs.writeFile(path.join(manager.cwd, config.json), contents, cb);
}).loadJSON();
}
function savePkgs(manager, paths, dev, cb) {
manager.on('loadJSON', function (newLine) {
// Find the package names that match the paths
var names = _.compact(paths.map(function (endpoint) {
endpoint = endpoint.split('#')[0];
return _.find(Object.keys(manager.dependencies), function (key) {
var dep = manager.dependencies[key][0];
if (dep.name === endpoint) return true;
if (dep.shorthand === endpoint) return true;
var fetchedEndpoint = dep.readEndpoint();
return fetchedEndpoint && fetchedEndpoint.endpoint === endpoint;
});
}));
var key = dev ? 'devDependencies' : 'dependencies';
manager.json[key] = manager.json[key] || {};
// Save each of them
// Only include the root packages
names.forEach(function (name) {
addDependency(manager.json, manager.dependencies[name][0], dev);
});
// Finally save the modified json
var contents = JSON.stringify(manager.json, null, 2) + (newLine ? '\n' : '');
fs.writeFile(path.join(manager.cwd, config.json), contents, cb);
}).loadJSON();
}
function addDependency(json, pkg, dev) {
var path;
var tag;
var key = dev ? 'devDependencies' : 'dependencies';
if (pkg.lookedUp) {
tag = pkg.originalTag || '~' + pkg.version;
} else {
path = (pkg.shorthand || pkg.gitUrl || pkg.originalAssetUrl || pkg.originalPath || '');
tag = pkg.originalTag || '~' + pkg.version;
}
// If the tag is not valid (e.g.: a commit), null it
if (!semver.valid(tag) && !semver.validRange(tag)) tag = null;
json[key][pkg.name] = path ? path + (tag ? '#' + tag : '') : tag || 'latest';
}
module.exports = save;

View File

@@ -1,36 +0,0 @@
// ==========================================
// BOWER: spawn
// ==========================================
// Copyright 2012 Twitter, Inc
// Licensed under The MIT License
// http://opensource.org/licenses/MIT
// ==========================================
var spawn = require('child_process').spawn;
// This module is similar to child-process spawn
// but automatically handles errors
// When an error occurs, it emits the error event containing the details of the error
// It also removes all the listeners of the command
module.exports = function (command, args, options, emitter) {
var cp = spawn(command, args, options);
var stderr = '';
cp.stderr.on('data', function (data) {
stderr += data;
});
cp.on('exit', function (code) {
if (code && (!options || !options.ignoreCodes || options.ignoreCodes.indexOf(code) === -1)) {
cp.removeAllListeners();
var err = new Error('status code of ' + command + ': ' + code);
err.details = stderr;
err.command = command;
err.code = code;
emitter.emit('error', err);
}
});
return cp;
};

View File

@@ -1,41 +0,0 @@
// ==========================================
// BOWER: Hogan Renderer w/ template cache
// ==========================================
// Copyright 2012 Twitter, Inc
// Licensed under The MIT License
// http://opensource.org/licenses/MIT
// ==========================================
var events = require('events');
var hogan = require('hogan.js');
var path = require('path');
var fs = require('fs');
require('../util/hogan-colors');
var templates = {};
module.exports = function (name, context, sync) {
var emitter = new events.EventEmitter;
var templateName = name + '.mustache';
var templatePath = path.join(__dirname, '../../templates/', templateName);
if (sync) {
if (!templates[templatePath]) templates[templatePath] = fs.readFileSync(templatePath, 'utf-8');
return hogan.compile(templates[templatePath]).renderWithColors(context);
} else if (templates[templatePath]) {
process.nextTick(function () {
emitter.emit('data', hogan.compile(templates[templatePath]).renderWithColors(context));
});
} else {
fs.readFile(templatePath, 'utf-8', function (err, file) {
if (err) return emitter.emit('error', err);
templates[templatePath] = file;
emitter.emit('data', hogan.compile(file).renderWithColors(context));
});
}
return emitter;
};

View File

@@ -1,51 +1,10 @@
{
"name": "bower",
"description": "The browser package manager.",
"version": "0.9.0",
"author": "Twitter",
"licenses": [
{
"type": "MIT",
"url": "https://github.com/twitter/bower/blob/master/LICENSE"
}
],
"main": "lib",
"homepage": "http://twitter.github.com/bower",
"engines": {
"node": ">=0.8.0"
},
"dependencies": {
"tmp": "~0.0.17",
"glob": "~3.1.14",
"nopt": "~2.0.0",
"archy": "~0.0.2",
"async": "~0.2.5",
"colors": "~0.6.0-1",
"rimraf": "~2.0.3",
"mkdirp": "~0.3.4",
"semver": "~1.1.0",
"request": "~2.11.4",
"fstream": "~0.1.19",
"hogan.js": "~2.0.0",
"lodash": "~1.0.1",
"read-package-json": "~0.1.8",
"stable": "~0.1.2",
"rc": "~0.0.6",
"unzip": "0.1.7",
"tar": "~0.1.13",
"promptly": "~0.1.0",
"abbrev": "~1.0.4",
"update-notifier": "~0.1.3"
"private": true,
"devDependencies": {
"lerna": "2.0.0-beta.23"
},
"scripts": {
"test": "mocha --reporter spec --timeout 40000"
},
"devDependencies": {
"mocha": "~1.8.1",
"nock": "~0.17.3"
},
"bin": {
"bower": "bin/bower"
},
"preferGlobal": true
"postinstall": "lerna bootstrap",
"test": "lerna run test"
}
}

View File

@@ -0,0 +1,12 @@
root = true
[*]
indent_style = space
indent_size = 4
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
[*.md]
trim_trailing_whitespace = false

7
packages/bower-config/.gitignore vendored Normal file
View File

@@ -0,0 +1,7 @@
node_modules
npm-debug.log
test/assets/github-test-package
test/assets/github-test-package-copy
test/assets/temp
test/reports

View File

@@ -9,7 +9,7 @@
"beforeEach"
],
"indent": 2,
"indent": 4,
"node": true,
"devel": true,
@@ -23,7 +23,7 @@
"noarg": true,
"noempty": false,
"nonew": true,
"plusplus": true,
"plusplus": false,
"regexp": false,
"undef": true,
"unused": true,
@@ -32,7 +32,7 @@
"trailing": true,
"asi": false,
"boss": false,
"boss": true,
"debug": false,
"eqnull": true,
"es5": false,
@@ -57,6 +57,5 @@
"validthis": false,
"nomen": false,
"onevar": false,
"white": true
}

View File

@@ -0,0 +1,9 @@
sudo: false
language: node_js
node_js:
- '5'
- '4'
- '0.12'
- '0.10'
script:
- grunt travis

View File

@@ -0,0 +1,103 @@
# Changelog
## 1.4.0
- Change default shorthand resolver from git:// to https://
## 1.3.1
- Ignore hook scripts for environment variable expansion
## 1.3.0 - 2015-12-07
- Allow the use of environment variables in .bowerrc. Fixes [#41](https://github.com/bower/config/issues/41)
- Loads the .bowerrc file from the cwd specified on the command line. Fixes [bower/bower#1993](https://github.com/bower/bower/issues/1993)
- Allwow for array notation in ENV variables [#44](https://github.com/bower/config/issues/44)
## 1.2.3 - 2015-11-27
- Restores env variables if they are undefined at the beginning
- Handles default setting for config.ca. Together with [bower/bower PR #1972](https://github.com/bower/bower/pull/1972), fixes downloading with `strict-ssl` using custom CA
- Displays an error message if .bowerrc is a directory instead of file. Fixes [bower/bower#2022](https://github.com/bower/bower/issues/2022)
## 1.2.2 - 2015-10-16
- Fixes registry configurartion expanding [bower/bower#1950](https://github.com/bower/bower/issues/1950)
## 1.2.1 - 2015-10-15
- Fixes case insenstivity HTTP_PROXY setting issue on Windows
## 1.2.0 - 2015-09-28
- Prevent defaulting cwd to process.cwd()
## 1.1.2 - 2015-09-27
- Performs only camel case normalisation before merging
## 1.1.1 - 2015-09-27
- Fix: Merge extra options after camel-case normalisation, instead of before it
## 1.1.0 - 2015-09-27
- Allow for overwriting options with .load(overwrites) / .read(cwd, overwrites)
## 1.0.1 - 2015-09-27
- Update dependencies and relax "mout" version range
- Most significant changes:
- graceful-fs updated from 2.x version to 4.x
- osenv updated to from 0.0.x to 0.1.x, [tmp location changed](https://github.com/npm/osenv/commit/d6eddbc026538b09026b1dbd60fbc081a8c67e03)
## 1.0.0 - 2015-09-27
- Support for no-proxy configuration variable
- Overwrite HTTP_PROXY, HTTPS_PROXY, and NO_PROXY env variables in load method
- Normalise paths to certificates with contents of them, [#28](https://github.com/bower/config/pull/28)
## 0.6.1 - 2015-04-1
- Fixes merging .bowerrc files upward directory tree. [#25](https://github.com/bower/config/issues/25)
## 0.6.0 - 2015-03-30
- Merge .bowerrc files upward directory tree (fixes [bower/bower#1689](https://github.com/bower/bower/issues/1689)) [#24](https://github.com/bower/config/pull/24)
- Allow NPM config variables (resolves [bower/bower#1711](https://github.com/bower/bower/issues/1711)) [#23](https://github.com/bower/config/pull/23)
## 0.5.2 - 2014-06-09
- Fixes downloading of bower modules with ignores when .bowerrc is overridden with a relative tmp path. [#17](https://github.com/bower/config/issues/17) [bower/bower#1299](https://github.com/bower/bower/issues/1299)
## 0.5.1 - 2014-05-21
- [perf] Uses the same mout version as bower
- [perf] Uses only relevant parts of mout. Related [bower/bower#1134](https://github.com/bower/bower/pull/1134)
## 0.5.0 - 2013-08-30
- Adds a DEFAULT_REGISTRY key to the Config class that exposes the bower registry UR. [#6](https://github.com/bower/config/issues/6)
## 0.4.5 - 2013-08-28
- Fixes crashing when home is not set
## 0.4.4 - 2013-08-21
- Supports nested environment variables [#8](https://github.com/bower/config/issues/8)
## 0.4.3 - 2013-08-19
- Improvement in argv.config parsing
## 0.4.2 - 2013-08-18
- Sets interative to auto
## 0.4.1 - 2013-08-18
- Generates a fake user instead of using 'unknown'
## 0.4.0 - 2013-08-16
- Suffixes temp folder with the user and 'bower'
## 0.3.5 - 2013-08-14
- Casts buffer to string
## 0.3.4 - 2013-08-11
- Empty .bowerrc files no longer throw an error.
## 0.3.3 - 2013-08-11
- Changes git folder to empty (was not being used anyway)
## 0.3.2 - 2013-08-07
- Uses a known user agent by default when a proxy.
## 0.3.1 - 2013-08-06
- Fixes Typo
## 0.3.0 - 2013-08-06
- Appends the username when using the temporary folder.

View File

@@ -0,0 +1,47 @@
'use strict';
module.exports = function (grunt) {
require('load-grunt-tasks')(grunt);
grunt.initConfig({
simplemocha: {
options: {
reporter: 'spec',
timeout: '10000'
},
full: {
src: ['test/test.js']
},
short: {
options: {
reporter: 'dot'
},
src: ['test/test.js']
}
},
exec: {
cover: {
command: 'STRICT_REQUIRE=1 node node_modules/istanbul/lib/cli.js cover --dir ./test/reports node_modules/mocha/bin/_mocha -- --timeout 30000 -R dot test/test.js'
},
coveralls: {
command: 'node node_modules/.bin/coveralls < test/reports/lcov.info'
}
},
watch: {
files: [
'Gruntfile.js',
'bin/*',
'lib/**/*.js',
'test/**/*.js',
'!test/assets/**/*',
'!test/reports/**/*',
'!test/tmp/**/*'
],
tasks: ['simplemocha:short']
}
});
grunt.registerTask('test', ['simplemocha:full']);
grunt.registerTask('cover', 'exec:cover');
grunt.registerTask('travis', ['exec:cover', 'exec:coveralls']);
grunt.registerTask('default', 'test');
};

View File

@@ -0,0 +1,19 @@
Copyright (c) 2012 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
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
of the Software, and to permit persons to whom the Software is furnished to do
so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

View File

@@ -0,0 +1,76 @@
# bower-config [![Build Status](https://secure.travis-ci.org/bower/config.png?branch=master)](http://travis-ci.org/bower/config)[![Coverage Status](https://coveralls.io/repos/bower/config/badge.svg?branch=master&service=github)](https://coveralls.io/github/bower/config?branch=master)
> The Bower config (`.bowerrc`) reader and writer.
[Bower](http://bower.io/) can be configured using JSON in a `.bowerrc` file. For example:
{
"directory": "app/components/",
"timeout": 120000,
"registry": {
"search": [
"http://localhost:8000",
"https://bower.herokuapp.com"
]
}
}
View the complete [.bowerrc specification](http://bower.io/docs/config/#bowerrc-specification) on the website for more details. Both the `bower.json` and `.bowerrc` specifications are maintained at [github.com/bower/spec](https://github.com/bower/spec).
## Install
```sh
$ npm install --save bower-config
```
## Usage
#### .load(overwrites)
Loads the bower configuration from the configuration files.
Configuration is overwritten (after camelcase normalisation) with `overwrites` argument.
This method overwrites following environment variables:
- `HTTP_PROXY` with `proxy` configuration variable
- `HTTPS_PROXY` with `https-proxy` configuration variable
- `NO_PROXY` with `no-proxy` configuration variable
It also clears `http_proxy`, `https_proxy`, and `no_proxy` environment variables.
To restore those variables you can use `restore` method.
#### restore()
Restores environment variables overwritten by `.load` method.
#### .toObject()
Returns a deep copy of the underlying configuration object.
The returned configuration is normalised.
The object keys will be camelCase.
#### #create(cwd)
Obtains a instance where `cwd` is the current working directory (defaults to `process.cwd`);
```js
var config = require('bower-config').create();
// You can also specify a working directory
var config2 = require('bower-config').create('./some/path');
```
#### #read(cwd, overrides)
Alias for:
```js
var configObject = (new Config(cwd)).load(overrides).toJson();
```
## License
Released under the [MIT License](http://www.opensource.org/licenses/mit-license.php).

View File

@@ -0,0 +1,109 @@
var lang = require('mout/lang');
var object = require('mout/object');
var rc = require('./util/rc');
var expand = require('./util/expand');
var EnvProxy = require('./util/proxy');
var path = require('path');
var fs = require('fs');
function Config(cwd) {
this._cwd = cwd;
this._proxy = new EnvProxy();
this._config = {};
}
Config.prototype.load = function (overwrites) {
this._config = rc('bower', this._cwd);
this._config = object.merge(
expand(this._config || {}),
expand(overwrites || {})
);
this._config = normalise(this._config);
this._proxy.set(this._config);
return this;
};
Config.prototype.restore = function () {
this._proxy.restore();
};
function readCertFile(path) {
path = path || '';
var sep = '-----END CERTIFICATE-----';
var certificates;
if (path.indexOf(sep) === -1) {
certificates = fs.readFileSync(path, { encoding: 'utf8' });
} else {
certificates = path;
}
return certificates.
split(sep).
filter(function(s) { return !s.match(/^\s*$/); }).
map(function(s) { return s + sep; });
}
function loadCAs(caConfig) {
// If a ca file path has been specified, expand that here to the file's
// contents. As a user can specify these individually, we must load them
// one by one.
for (var p in caConfig) {
if (caConfig.hasOwnProperty(p)) {
var prop = caConfig[p];
if (Array.isArray(prop)) {
caConfig[p] = prop.map(function(s) {
return readCertFile(s);
});
} else if (prop) {
caConfig[p] = readCertFile(prop);
}
}
}
}
Config.prototype.toObject = function () {
return lang.deepClone(this._config);
};
Config.create = function (cwd) {
return new Config(cwd);
};
Config.read = function (cwd, overrides) {
var config = Config.create(cwd);
return config.load(overrides).toObject();
};
function normalise(config) {
config = expand(config);
// Some backwards compatible things..
if (config.shorthandResolver) {
config.shorthandResolver = config.shorthandResolver
.replace(/\{\{\{/g, '{{')
.replace(/\}\}\}/g, '}}');
}
// Ensure that every registry endpoint does not end with /
config.registry.search = config.registry.search.map(function (url) {
return url.replace(/\/+$/, '');
});
config.registry.register = config.registry.register.replace(/\/+$/, '');
config.registry.publish = config.registry.publish.replace(/\/+$/, '');
config.tmp = path.resolve(config.tmp);
loadCAs(config.ca);
return config;
}
Config.DEFAULT_REGISTRY = require('./util/defaults').registry;
module.exports = Config;

View File

@@ -0,0 +1,45 @@
var path = require('path');
var paths = require('./paths');
// Guess proxy defined in the env
var proxy = process.env.HTTP_PROXY
|| process.env.http_proxy
|| null;
var httpsProxy = process.env.HTTPS_PROXY
|| process.env.https_proxy
|| proxy;
var noProxy = process.env.NO_PROXY
|| process.env.no_proxy;
// Use a well known user agent (in this case, curl) when using a proxy,
// to avoid potential filtering on many corporate proxies with blank or unknown agents
var userAgent = !proxy && !httpsProxy
? 'node/' + process.version + ' ' + process.platform + ' ' + process.arch
: 'curl/7.21.4 (universal-apple-darwin11.0) libcurl/7.21.4 OpenSSL/0.9.8r zlib/1.2.5';
var defaults = {
'directory': 'bower_components',
'registry': 'https://bower.herokuapp.com',
'shorthand-resolver': 'https://github.com/{{owner}}/{{package}}.git',
'tmp': paths.tmp,
'proxy': proxy,
'https-proxy': httpsProxy,
'no-proxy': noProxy,
'timeout': 30000,
'ca': { search: [] },
'strict-ssl': true,
'user-agent': userAgent,
'color': true,
'interactive': null,
'storage': {
packages: path.join(paths.cache, 'packages'),
links: path.join(paths.data, 'links'),
completion: path.join(paths.data, 'completion'),
registry: path.join(paths.cache, 'registry'),
empty: path.join(paths.data, 'empty') // Empty dir, used in GIT_TEMPLATE_DIR among others
}
};
module.exports = defaults;

View File

@@ -0,0 +1,126 @@
var object = require('mout/object');
var lang = require('mout/lang');
var string = require('mout/string');
function camelCase(config) {
var camelCased = {};
// Camel case
object.forOwn(config, function (value, key) {
// Ignore null values
if (value == null) {
return;
}
key = string.camelCase(key.replace(/_/g, '-'));
camelCased[key] = lang.isPlainObject(value) ? camelCase(value) : value;
});
return camelCased;
}
// Function to replace ${VAR} - style variables
// with values set in the environment
// This function expects to be passed a string
function doEnvReplaceStr (f) {
// Un-tildify
var untildify = require('untildify');
f = untildify(f);
// replace any ${ENV} values with the appropriate environ.
var envExpr = /(\\*)\$\{([^}]+)\}/g;
return f.replace(envExpr, function (orig, esc, name) {
esc = esc.length && esc.length % 2;
if (esc) return orig;
if (undefined === process.env[name]) {
throw new Error('Environment variable used in .bowerrc is not defined: ' + orig);
}
return process.env[name];
});
}
function envReplace(config) {
var envReplaced = {};
object.forOwn(config, function (value, key) {
// Ignore null values
if (value == null) {
return;
}
// Ignore 'scripts'
// These hooks run within the shell
// environment variable expansion is not required
if ( key === 'scripts' && lang.isPlainObject(value) ){
envReplaced[key] = value;
return;
}
// Perform variable replacements based on var type
if ( lang.isPlainObject(value) ) {
envReplaced[key] = envReplace(value);
}
else if ( lang.isString(value) ) {
envReplaced[key] = doEnvReplaceStr(value);
}
else {
envReplaced[key] = value;
}
});
return envReplaced;
}
function expand(config) {
config = camelCase(config);
config = envReplace(config);
if (typeof config.registry === 'string') {
config.registry = {
default: config.registry,
search: [config.registry],
register: config.registry,
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,
search: config.registry.search || config.registry.default,
register: config.registry.register || config.registry.default,
publish: config.registry.publish || config.registry.default
};
if (config.registry.search && !Array.isArray(config.registry.search)) {
config.registry.search = [config.registry.search];
}
}
// CA
if (typeof config.ca === 'string') {
config.ca = {
default: config.ca,
search: [config.ca],
register: config.ca,
publish: config.ca
};
} else if (typeof config.ca === 'object') {
if (config.ca.search && !Array.isArray(config.ca.search)) {
config.ca.search = [config.ca.search];
}
if (config.ca.default) {
config.ca.search = config.ca.search || config.ca.default;
config.ca.register = config.ca.register || config.ca.default;
config.ca.publish = config.ca.publish || config.ca.default;
}
}
return config;
}
module.exports = expand;

View File

@@ -0,0 +1,44 @@
var os = require('os');
var path = require('path');
var osenv = require('osenv');
var crypto = require('crypto');
function generateFakeUser() {
var uid = process.pid + '-' + Date.now() + '-' + Math.floor(Math.random() * 1000000);
return crypto.createHash('md5').update(uid).digest('hex');
}
// Assume XDG defaults
// See: http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html
var paths = {
config: process.env.XDG_CONFIG_HOME,
data: process.env.XDG_DATA_HOME,
cache: process.env.XDG_CACHE_HOME
};
// Guess some needed properties based on the user OS
var user = (osenv.user() || generateFakeUser()).replace(/\\/g, '-');
var tmp = path.join(os.tmpdir ? os.tmpdir() : os.tmpDir(), user);
var home = osenv.home();
var base;
// Fallbacks for windows
if (process.platform === 'win32') {
base = path.resolve(process.env.LOCALAPPDATA || home || tmp);
base = path.join(base, 'bower');
paths.config = paths.config || path.join(base, 'config');
paths.data = paths.data || path.join(base, 'data');
paths.cache = paths.cache || path.join(base, 'cache');
// Fallbacks for other operating systems
} else {
base = path.resolve(home || tmp);
paths.config = paths.config || path.join(base, '.config/bower');
paths.data = paths.data || path.join(base, '.local/share/bower');
paths.cache = paths.cache || path.join(base, '.cache/bower');
}
paths.tmp = path.resolve(path.join(tmp, 'bower'));
module.exports = paths;

View File

@@ -0,0 +1,79 @@
// EnvProxy uses the proxy vaiables passed to it in set and sets the
// process.env uppercase proxy variables to them with the ability
// to restore the original values later
var EnvProxy = function() {
this.restoreFrom = {};
};
EnvProxy.prototype.set = function (config) {
this.config = config;
// Override environment defaults if proxy config options are set
// This will make requests.js follow the proxies in config
if (Object.prototype.hasOwnProperty.call(config, 'noProxy')) {
this.restoreFrom.NO_PROXY = process.env.NO_PROXY;
this.restoreFrom.no_proxy = process.env.no_proxy;
delete process.env.no_proxy;
process.env.NO_PROXY = config.noProxy;
}
if (Object.prototype.hasOwnProperty.call(config, 'proxy')) {
this.restoreFrom.HTTP_PROXY = process.env.HTTP_PROXY;
this.restoreFrom.http_proxy = process.env.http_proxy;
delete process.env.http_proxy;
process.env.HTTP_PROXY = config.proxy;
}
if (Object.prototype.hasOwnProperty.call(config, 'httpsProxy')) {
this.restoreFrom.HTTPS_PROXY = process.env.HTTPS_PROXY;
this.restoreFrom.https_proxy = process.env.https_proxy;
delete process.env.https_proxy;
process.env.HTTPS_PROXY = config.httpsProxy;
}
};
EnvProxy.prototype.restore = function () {
if (Object.prototype.hasOwnProperty.call(this.config, 'noProxy')) {
if (this.restoreFrom.NO_PROXY !== undefined) {
process.env.NO_PROXY = this.restoreFrom.NO_PROXY;
} else {
delete process.env.NO_PROXY;
}
if (this.restoreFrom.no_proxy !== undefined) {
process.env.no_proxy = this.restoreFrom.no_proxy;
} else {
delete process.env.no_proxy;
}
}
if (Object.prototype.hasOwnProperty.call(this.config, 'proxy')) {
if (this.restoreFrom.HTTP_PROXY !== undefined) {
process.env.HTTP_PROXY = this.restoreFrom.HTTP_PROXY;
} else {
delete process.env.HTTP_PROXY;
}
if (this.restoreFrom.http_proxy !== undefined) {
process.env.http_proxy = this.restoreFrom.http_proxy;
} else {
delete process.env.http_proxy;
}
}
if (Object.prototype.hasOwnProperty.call(this.config, 'httpsProxy')) {
if (this.restoreFrom.HTTPS_PROXY !== undefined) {
process.env.HTTPS_PROXY = this.restoreFrom.HTTPS_PROXY;
} else {
delete process.env.HTTPS_PROXY;
}
if (this.restoreFrom.https_proxy !== undefined) {
process.env.https_proxy = this.restoreFrom.https_proxy;
} else {
delete process.env.https_proxy;
}
}
};
module.exports = EnvProxy;

View File

@@ -0,0 +1,158 @@
var path = require('path');
var fs = require('graceful-fs');
var optimist = require('optimist');
var osenv = require('osenv');
var object = require('mout/object');
var string = require('mout/string');
var paths = require('./paths');
var defaults = require('./defaults');
var win = process.platform === 'win32';
var home = osenv.home();
function rc(name, cwd, argv) {
var argvConfig;
argv = argv || optimist.argv;
// Parse --config.foo=false
argvConfig = object.map(argv.config || {}, function (value) {
return value === 'false' ? false : value;
});
// If we have specified a cwd then use this as the base for getting config.
cwd = argvConfig.cwd ? argvConfig.cwd : cwd;
if (cwd) {
return object.deepMixIn.apply(null, [
{},
defaults,
{ cwd: cwd },
win ? {} : json(path.join('/etc', name + 'rc')),
!home ? {} : json(path.join(home, '.' + name + 'rc')),
json(path.join(paths.config, name + 'rc')),
json(find('.' + name + 'rc', cwd)),
env('npm_package_config_' + name + '_'),
env(name + '_'),
argvConfig
]);
} else {
return object.deepMixIn.apply(null, [
{},
defaults,
win ? {} : json(path.join('/etc', name + 'rc')),
!home ? {} : json(path.join(home, '.' + name + 'rc')),
json(path.join(paths.config, name + 'rc')),
env('npm_package_config_' + name + '_'),
env(name + '_'),
argvConfig
]);
}
}
function parse(content, file) {
var error;
if (!content.trim().length) {
return {};
}
try {
return JSON.parse(content);
} catch (e) {
if (file) {
error = new Error('Unable to parse ' + file + ': ' + e.message);
} else {
error = new Error('Unable to parse rc config: ' + e.message);
}
error.details = content;
error.code = 'EMALFORMED';
throw error;
}
}
function json(file) {
var content = {};
if (!Array.isArray(file)) {
try {
content = fs.readFileSync(file).toString();
} catch (err) {
return null;
}
return parse(content, file);
} else {
// This is multiple json files
file.forEach(function(filename) {
if (fs.statSync(filename).isDirectory()) {
var error;
error = new Error(filename + ' should not be a directory');
error.code = 'EFILEISDIR';
throw error;
}
var json = fs.readFileSync(filename).toString();
json = parse(json, filename);
content = object.merge(content, json);
});
return content;
}
}
function env(prefix) {
var obj = {};
var prefixLength = prefix.length;
prefix = prefix.toLowerCase();
object.forOwn(process.env, function (value, key) {
key = key.toLowerCase();
if (string.startsWith(key, prefix)) {
var parsedKey = key
.substr(prefixLength)
.replace(/__/g, '.') // __ is used for nesting
.replace(/_/g, '-'); // _ is used as a - separator
//use a convention patern to accept array from process.env
//e.g. export bower_registry__search='["http://abc.com","http://def.com"]'
var match = /\[([^\]]*)\]/g.exec(value);
var targetValue;
if (!match || match.length === 0) {
targetValue = value;
} else {
targetValue = match[1].split(',')
.map(function(m) {
return m.trim();
});
}
object.set(obj, parsedKey, targetValue);
}
});
return obj;
}
function find(filename, dir) {
var files = [];
var walk = function (filename, dir) {
var file = path.join(dir, filename);
var parent = path.dirname(dir);
if (fs.existsSync(file)) {
files.push(file);
}
if (parent !== dir) {
walk(filename, parent);
}
};
walk(filename, dir);
files.reverse();
return files;
}
module.exports = rc;

View File

@@ -0,0 +1,45 @@
{
"name": "bower-config",
"version": "1.4.0",
"description": "The Bower config reader and writer.",
"author": "Twitter",
"license": "MIT",
"repository": "bower/config",
"main": "lib/Config",
"homepage": "http://bower.io",
"engines": {
"node": ">=0.8.0"
},
"dependencies": {
"graceful-fs": "^4.1.3",
"mout": "^1.0.0",
"optimist": "^0.6.1",
"osenv": "^0.1.3",
"untildify": "^2.1.0"
},
"devDependencies": {
"coveralls": "^2.11.4",
"expect.js": "^0.3.1",
"glob": "^4.5.3",
"grunt": "^0.4.5",
"grunt-cli": "^0.1.13",
"grunt-contrib-jshint": "^0.10.0",
"grunt-contrib-watch": "^0.6.1",
"grunt-coveralls": "^1.0.0",
"grunt-exec": "^0.4.6",
"grunt-simple-mocha": "^0.4.0",
"istanbul": "^0.4.1",
"load-grunt-tasks": "^2.0.0",
"mkdirp": "^0.5.0",
"mocha": "~1.12.0",
"node-uuid": "^1.4.3",
"q": "^1.2.0",
"rimraf": "^2.3.2"
},
"scripts": {
"test": "grunt test"
},
"files": [
"lib"
]
}

View File

@@ -0,0 +1,3 @@
{
"ca": "Equifax Secure CA\n=================\n-----BEGIN CERTIFICATE-----\nMIIDIDCCAomgAwIBAgIENd70zzANBgkqhkiG9w0BAQUFADBOMQswCQYDVQQGEwJVUzEQMA4GA1UE\nChMHRXF1aWZheDEtMCsGA1UECxMkRXF1aWZheCBTZWN1cmUgQ2VydGlmaWNhdGUgQXV0aG9yaXR5\nMB4XDTk4MDgyMjE2NDE1MVoXDTE4MDgyMjE2NDE1MVowTjELMAkGA1UEBhMCVVMxEDAOBgNVBAoT\nB0VxdWlmYXgxLTArBgNVBAsTJEVxdWlmYXggU2VjdXJlIENlcnRpZmljYXRlIEF1dGhvcml0eTCB\nnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAwV2xWGcIYu6gmi0fCG2RFGiYCh7+2gRvE4RiIcPR\nfM6fBeC4AfBONOziipUEZKzxa1NfBbPLZ4C/QgKO/t0BCezhABRP/PvwDN1Dulsr4R+AcJkVV5MW\n8Q+XarfCaCMczE1ZMKxRHjuvK9buY0V7xdlfUNLjUA86iOe/FP3gx7kCAwEAAaOCAQkwggEFMHAG\nA1UdHwRpMGcwZaBjoGGkXzBdMQswCQYDVQQGEwJVUzEQMA4GA1UEChMHRXF1aWZheDEtMCsGA1UE\nCxMkRXF1aWZheCBTZWN1cmUgQ2VydGlmaWNhdGUgQXV0aG9yaXR5MQ0wCwYDVQQDEwRDUkwxMBoG\nA1UdEAQTMBGBDzIwMTgwODIyMTY0MTUxWjALBgNVHQ8EBAMCAQYwHwYDVR0jBBgwFoAUSOZo+SvS\nspXXR9gjIBBPM5iQn9QwHQYDVR0OBBYEFEjmaPkr0rKV10fYIyAQTzOYkJ/UMAwGA1UdEwQFMAMB\nAf8wGgYJKoZIhvZ9B0EABA0wCxsFVjMuMGMDAgbAMA0GCSqGSIb3DQEBBQUAA4GBAFjOKer89961\nzgK5F7WF0bnj4JXMJTENAKaSbn+2kmOeUJXRmm/kEd5jhW6Y7qj/WsjTVbJmcVfewCHrPSqnI0kB\nBIZCe/zuf6IWUrVnZ9NA2zsmWLIodz2uFHdh1voqZiegDfqnc1zqcPGUIWVEX/r87yloqaKHee95\n70+sB3c4\n-----END CERTIFICATE-----\n\nGlobalSign Root CA\n==================\n-----BEGIN CERTIFICATE-----\nMIIDdTCCAl2gAwIBAgILBAAAAAABFUtaw5QwDQYJKoZIhvcNAQEFBQAwVzELMAkGA1UEBhMCQkUx\nGTAXBgNVBAoTEEdsb2JhbFNpZ24gbnYtc2ExEDAOBgNVBAsTB1Jvb3QgQ0ExGzAZBgNVBAMTEkds\nb2JhbFNpZ24gUm9vdCBDQTAeFw05ODA5MDExMjAwMDBaFw0yODAxMjgxMjAwMDBaMFcxCzAJBgNV\nBAYTAkJFMRkwFwYDVQQKExBHbG9iYWxTaWduIG52LXNhMRAwDgYDVQQLEwdSb290IENBMRswGQYD\nVQQDExJHbG9iYWxTaWduIFJvb3QgQ0EwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDa\nDuaZjc6j40+Kfvvxi4Mla+pIH/EqsLmVEQS98GPR4mdmzxzdzxtIK+6NiY6arymAZavpxy0Sy6sc\nTHAHoT0KMM0VjU/43dSMUBUc71DuxC73/OlS8pF94G3VNTCOXkNz8kHp1Wrjsok6Vjk4bwY8iGlb\nKk3Fp1S4bInMm/k8yuX9ifUSPJJ4ltbcdG6TRGHRjcdGsnUOhugZitVtbNV4FpWi6cgKOOvyJBNP\nc1STE4U6G7weNLWLBYy5d4ux2x8gkasJU26Qzns3dLlwR5EiUWMWea6xrkEmCMgZK9FGqkjWZCrX\ngzT/LCrBbBlDSgeF59N89iFo7+ryUp9/k5DPAgMBAAGjQjBAMA4GA1UdDwEB/wQEAwIBBjAPBgNV\nHRMBAf8EBTADAQH/MB0GA1UdDgQWBBRge2YaRQ2XyolQL30EzTSo//z9SzANBgkqhkiG9w0BAQUF\nAAOCAQEA1nPnfE920I2/7LqivjTFKDK1fPxsnCwrvQmeU79rXqoRSLblCKOzyj1hTdNGCbM+w6Dj\nY1Ub8rrvrTnhQ7k4o+YviiY776BQVvnGCv04zcQLcFGUl5gE38NflNUVyRRBnMRddWQVDf9VMOyG\nj/8N7yy5Y0b2qvzfvGn9LhJIZJrglfCm7ymPAbEVtQwdpf5pLGkkeB6zpxxxYu7KyJesF12KwvhH\nhm4qxFYxldBniYUr+WymXUadDKqC5JlR3XC321Y9YeRq4VzW9v493kHMB65jUr9TU/Qr6cf9tveC\nX4XSQRjbgbMEHMUfpIBvFSDJ3gyICh3WZlXi/EjJKSZp4A==\n-----END CERTIFICATE-----"
}

View File

@@ -0,0 +1,3 @@
{
"ca": "test/assets/custom-ca/ca-bundle.crt"
}

View File

@@ -0,0 +1,40 @@
Equifax Secure CA
=================
-----BEGIN CERTIFICATE-----
MIIDIDCCAomgAwIBAgIENd70zzANBgkqhkiG9w0BAQUFADBOMQswCQYDVQQGEwJVUzEQMA4GA1UE
ChMHRXF1aWZheDEtMCsGA1UECxMkRXF1aWZheCBTZWN1cmUgQ2VydGlmaWNhdGUgQXV0aG9yaXR5
MB4XDTk4MDgyMjE2NDE1MVoXDTE4MDgyMjE2NDE1MVowTjELMAkGA1UEBhMCVVMxEDAOBgNVBAoT
B0VxdWlmYXgxLTArBgNVBAsTJEVxdWlmYXggU2VjdXJlIENlcnRpZmljYXRlIEF1dGhvcml0eTCB
nzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAwV2xWGcIYu6gmi0fCG2RFGiYCh7+2gRvE4RiIcPR
fM6fBeC4AfBONOziipUEZKzxa1NfBbPLZ4C/QgKO/t0BCezhABRP/PvwDN1Dulsr4R+AcJkVV5MW
8Q+XarfCaCMczE1ZMKxRHjuvK9buY0V7xdlfUNLjUA86iOe/FP3gx7kCAwEAAaOCAQkwggEFMHAG
A1UdHwRpMGcwZaBjoGGkXzBdMQswCQYDVQQGEwJVUzEQMA4GA1UEChMHRXF1aWZheDEtMCsGA1UE
CxMkRXF1aWZheCBTZWN1cmUgQ2VydGlmaWNhdGUgQXV0aG9yaXR5MQ0wCwYDVQQDEwRDUkwxMBoG
A1UdEAQTMBGBDzIwMTgwODIyMTY0MTUxWjALBgNVHQ8EBAMCAQYwHwYDVR0jBBgwFoAUSOZo+SvS
spXXR9gjIBBPM5iQn9QwHQYDVR0OBBYEFEjmaPkr0rKV10fYIyAQTzOYkJ/UMAwGA1UdEwQFMAMB
Af8wGgYJKoZIhvZ9B0EABA0wCxsFVjMuMGMDAgbAMA0GCSqGSIb3DQEBBQUAA4GBAFjOKer89961
zgK5F7WF0bnj4JXMJTENAKaSbn+2kmOeUJXRmm/kEd5jhW6Y7qj/WsjTVbJmcVfewCHrPSqnI0kB
BIZCe/zuf6IWUrVnZ9NA2zsmWLIodz2uFHdh1voqZiegDfqnc1zqcPGUIWVEX/r87yloqaKHee95
70+sB3c4
-----END CERTIFICATE-----
GlobalSign Root CA
==================
-----BEGIN CERTIFICATE-----
MIIDdTCCAl2gAwIBAgILBAAAAAABFUtaw5QwDQYJKoZIhvcNAQEFBQAwVzELMAkGA1UEBhMCQkUx
GTAXBgNVBAoTEEdsb2JhbFNpZ24gbnYtc2ExEDAOBgNVBAsTB1Jvb3QgQ0ExGzAZBgNVBAMTEkds
b2JhbFNpZ24gUm9vdCBDQTAeFw05ODA5MDExMjAwMDBaFw0yODAxMjgxMjAwMDBaMFcxCzAJBgNV
BAYTAkJFMRkwFwYDVQQKExBHbG9iYWxTaWduIG52LXNhMRAwDgYDVQQLEwdSb290IENBMRswGQYD
VQQDExJHbG9iYWxTaWduIFJvb3QgQ0EwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDa
DuaZjc6j40+Kfvvxi4Mla+pIH/EqsLmVEQS98GPR4mdmzxzdzxtIK+6NiY6arymAZavpxy0Sy6sc
THAHoT0KMM0VjU/43dSMUBUc71DuxC73/OlS8pF94G3VNTCOXkNz8kHp1Wrjsok6Vjk4bwY8iGlb
Kk3Fp1S4bInMm/k8yuX9ifUSPJJ4ltbcdG6TRGHRjcdGsnUOhugZitVtbNV4FpWi6cgKOOvyJBNP
c1STE4U6G7weNLWLBYy5d4ux2x8gkasJU26Qzns3dLlwR5EiUWMWea6xrkEmCMgZK9FGqkjWZCrX
gzT/LCrBbBlDSgeF59N89iFo7+ryUp9/k5DPAgMBAAGjQjBAMA4GA1UdDwEB/wQEAwIBBjAPBgNV
HRMBAf8EBTADAQH/MB0GA1UdDgQWBBRge2YaRQ2XyolQL30EzTSo//z9SzANBgkqhkiG9w0BAQUF
AAOCAQEA1nPnfE920I2/7LqivjTFKDK1fPxsnCwrvQmeU79rXqoRSLblCKOzyj1hTdNGCbM+w6Dj
Y1Ub8rrvrTnhQ7k4o+YviiY776BQVvnGCv04zcQLcFGUl5gE38NflNUVyRRBnMRddWQVDf9VMOyG
j/8N7yy5Y0b2qvzfvGn9LhJIZJrglfCm7ymPAbEVtQwdpf5pLGkkeB6zpxxxYu7KyJesF12KwvhH
hm4qxFYxldBniYUr+WymXUadDKqC5JlR3XC321Y9YeRq4VzW9v493kHMB65jUr9TU/Qr6cf9tveC
X4XSQRjbgbMEHMUfpIBvFSDJ3gyICh3WZlXi/EjJKSZp4A==
-----END CERTIFICATE-----

View File

@@ -0,0 +1,10 @@
{
"scripts" : {
"postinstall" : "${_myshellvar}"
},
"storage" : {
"packages" : "${_BOWERRC_MY_PACKAGES}",
"registry" : "~/.bower-test/registry"
},
"tmp" : "${_BOWERRC_MY_TMP}"
}

View File

@@ -0,0 +1,5 @@
{
"proxy": "http://HTTP_PROXY",
"https-proxy": "http://HTTPS_PROXY",
"no-proxy": "google.com"
}

View File

@@ -0,0 +1,126 @@
var Q = require('q');
var mkdirp = require('mkdirp');
var rimraf = require('rimraf');
var uuid = require('node-uuid');
var object = require('mout/object');
var fs = require('fs');
var glob = require('glob');
var os = require('os');
var path = require('path');
// For better promise errors
Q.longStackSupport = true;
var tmpLocation = path.join(
os.tmpdir ? os.tmpdir() : os.tmpDir(),
'bower-config-tests',
uuid.v4().slice(0, 8)
);
after(function () {
rimraf.sync(tmpLocation);
});
exports.TempDir = (function() {
function TempDir (defaults) {
this.path = path.join(tmpLocation, uuid.v4());
this.defaults = defaults;
}
TempDir.prototype.create = function (files, defaults) {
var that = this;
defaults = defaults || this.defaults || {};
files = object.merge(files || {}, defaults);
this.meta = function(tag) {
if (tag) {
return files[tag]['bower.json'];
} else {
return files['bower.json'];
}
};
if (files) {
object.forOwn(files, function (contents, filepath) {
if (typeof contents === 'object') {
contents = JSON.stringify(contents, null, ' ') + '\n';
}
var fullPath = path.join(that.path, filepath);
mkdirp.sync(path.dirname(fullPath));
fs.writeFileSync(fullPath, contents);
});
}
return this;
};
TempDir.prototype.prepare = function (files) {
rimraf.sync(this.path);
mkdirp.sync(this.path);
this.create(files);
return this;
};
// TODO: Rewrite to synchronous form
TempDir.prototype.prepareGit = function (revisions) {
var that = this;
revisions = object.merge(revisions || {}, this.defaults);
rimraf.sync(that.path);
mkdirp.sync(that.path);
var promise = new Q();
object.forOwn(revisions, function (files, tag) {
promise = promise.then(function () {
return that.git('init');
}).then(function () {
that.glob('./!(.git)').map(function (removePath) {
var fullPath = path.join(that.path, removePath);
rimraf.sync(fullPath);
});
that.create(files, {});
}).then(function () {
return that.git('add', '-A');
}).then(function () {
return that.git('commit', '-m"commit"');
}).then(function () {
return that.git('tag', tag);
});
});
return promise;
};
TempDir.prototype.glob = function (pattern) {
return glob.sync(pattern, {
cwd: this.path,
dot: true
});
};
TempDir.prototype.getPath = function (name) {
return path.join(this.path, name);
};
TempDir.prototype.read = function (name) {
return fs.readFileSync(this.getPath(name), 'utf8');
};
TempDir.prototype.readJson = function (name) {
return JSON.parse(this.read(name));
};
TempDir.prototype.exists = function (name) {
return fs.existsSync(path.join(this.path, name));
};
return TempDir;
})();

View File

@@ -0,0 +1,245 @@
var assert = require('assert');
var path = require('path');
describe('NPM Config on package.json', function () {
beforeEach(function () {
delete process.env.npm_package_config_bower_directory;
delete process.env.npm_package_config_bower_colors;
delete process.env.npm_package_config_bower_resolvers;
});
it('defaults registry entries to default registry', function () {
var config = require('../lib/Config').read(null, {});
assert.deepEqual(config.registry, {
'default': 'https://bower.herokuapp.com',
'search': [
'https://bower.herokuapp.com'
],
'register': 'https://bower.herokuapp.com',
'publish': 'https://bower.herokuapp.com'
});
});
it('can change default registry', function () {
var config = require('../lib/Config').read(null, { registry: 'https://foobar' });
assert.deepEqual(config.registry, {
'default': 'https://foobar',
'search': [
'https://foobar',
],
'register': 'https://foobar',
'publish': 'https://foobar'
});
});
it('can override single entries in registry configuration', function () {
var config = require('../lib/Config').read(null, { registry: { search: 'https://foobar' } });
assert.deepEqual(config.registry, {
'default': 'https://bower.herokuapp.com',
'search': [
'https://foobar',
],
'register': 'https://bower.herokuapp.com',
'publish': 'https://bower.herokuapp.com'
});
});
it('can override single entries in registry configuration and defaults', function () {
var config = require('../lib/Config').read(null, { registry: { default: 'https://fizfuz', search: 'https://foobar' } });
assert.deepEqual(config.registry, {
'default': 'https://fizfuz',
'search': [
'https://foobar',
],
'register': 'https://fizfuz',
'publish': 'https://fizfuz'
});
});
it('allows for not providing cwd', function () {
var config = require('../lib/Config').read();
config.tmp = '/foo/bar';
config.userAgent = 'firefox';
delete config.storage;
assert.deepEqual(config, {
'directory': 'bower_components',
'registry': {
'default': 'https://bower.herokuapp.com',
'search': [
'https://bower.herokuapp.com'
],
'register': 'https://bower.herokuapp.com',
'publish': 'https://bower.herokuapp.com'
},
'shorthandResolver': 'https://github.com/{{owner}}/{{package}}.git',
'tmp': '/foo/bar',
'timeout': 30000,
'ca': {
'search': []
},
'strictSsl': true,
'userAgent': 'firefox',
'color': true
});
});
function assertCAContents(caData, name) {
var r = /-----BEGIN CERTIFICATE-----[a-zA-Z0-9+\/=\n\r]+-----END CERTIFICATE-----/;
assert(caData, name + ' should be set');
assert(Array.isArray(caData), name + ' should be an array');
assert.equal(2, caData.length);
caData.forEach(function(c, i) {
assert(c.match(r),
name + '[' + i + '] should contain a certificate. Given: ' + JSON.stringify(c));
});
}
describe('Setting process.env.npm_package_config', function () {
process.env.npm_package_config_bower_directory = 'npm-path';
process.env.npm_package_config_bower_colors = 'false';
process.env.npm_package_config_bower_resolvers = '[foo,bar,baz]';
var config = require('../lib/Config').read();
it('should return "npm-path" for "bower_directory"', function () {
assert.equal('npm-path', config.directory);
});
it('should return "false" for "bower_colors"', function () {
assert.equal('false', config.colors);
});
it('should expand array "false" for "bower_resolvers"', function () {
assert.deepEqual(['foo', 'bar', 'baz'], config.resolvers);
});
});
describe('Specifying custom CA', function() {
it('should read the CA file', function() {
var config = require('../lib/Config')
.read(path.resolve('test/assets/custom-ca'));
['register', 'publish', 'default'].forEach(function (p) {
assertCAContents(config.ca[p], 'config.ca.' + p);
});
assert(Array.isArray(config.ca.search),
'ca property search should be an array');
config.ca.search.forEach(function(c, i) {
assertCAContents(c, 'config.ca.search[' + i + ']');
});
});
it('should backward-support certificate inside .bowerrc', function() {
var config = require('../lib/Config')
.read(path.resolve('test/assets/custom-ca-embed'));
['register', 'publish', 'default'].forEach(function (p) {
assertCAContents(config.ca[p], 'config.ca.' + p);
});
assert(Array.isArray(config.ca.search),
'ca property search should be an array');
config.ca.search.forEach(function(c, i) {
assertCAContents(c, 'config.ca.search[' + i + ']');
});
});
});
describe('setting ENV variables', function () {
beforeEach(function () {
delete process.env.no_proxy;
delete process.env.http_proxy;
delete process.env.https_proxy;
delete process.env.NO_PROXY;
delete process.env.HTTP_PROXY;
delete process.env.HTTPS_PROXY;
});
it('sets env variables', function () {
require('../lib/Config').read('test/assets/env-variables');
assert.equal(process.env.HTTP_PROXY, 'http://HTTP_PROXY');
assert.equal(process.env.HTTPS_PROXY, 'http://HTTPS_PROXY');
assert.equal(process.env.NO_PROXY, 'google.com');
assert.equal(process.env.http_proxy, undefined);
assert.equal(process.env.https_proxy, undefined);
assert.equal(process.env.no_proxy, undefined);
});
it('restores env variables', function () {
process.env.HTTP_PROXY = 'a';
process.env.HTTPS_PROXY = 'b';
process.env.NO_PROXY = 'c';
process.env.http_proxy = 'd';
process.env.https_proxy = 'e';
process.env.no_proxy = 'f';
var config = require('../lib/Config').create('test/assets/env-variables').load();
config.restore();
assert.equal(process.env.HTTP_PROXY, 'a');
assert.equal(process.env.HTTPS_PROXY, 'b');
assert.equal(process.env.NO_PROXY, 'c');
assert.equal(process.env.http_proxy, 'd');
assert.equal(process.env.https_proxy, 'e');
assert.equal(process.env.no_proxy, 'f');
});
it('restores env variables if they are undefined', function () {
var config = require('../lib/Config').create('test/assets/env-variables').load();
config.restore();
assert.equal(process.env.HTTP_PROXY, undefined);
assert.equal(process.env.HTTPS_PROXY, undefined);
assert.equal(process.env.NO_PROXY, undefined);
assert.equal(process.env.http_proxy, undefined);
assert.equal(process.env.https_proxy, undefined);
assert.equal(process.env.no_proxy, undefined);
});
it('allows for overriding options', function () {
require('../lib/Config').read('test/assets/env-variables', {
httpsProxy: 'http://other-proxy.local'
});
assert.equal(process.env.HTTP_PROXY, 'http://HTTP_PROXY');
assert.equal(process.env.HTTPS_PROXY, 'http://other-proxy.local');
});
});
});
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';
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('${_myshellvar}', config.scripts.postinstall);
});
});
describe('untildify paths in .bowerrc', function() {
it('resolve ~/ 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);
});
});
require('./util/index');

View File

@@ -0,0 +1,3 @@
describe('util', function () {
require('./rc');
});

View File

@@ -0,0 +1,84 @@
var expect = require('expect.js');
var helpers = require('../helpers');
describe('rc', function() {
var tempDir = new helpers.TempDir();
var tempDirBowerrc = new helpers.TempDir();
var rc = require('../../lib/util/rc');
tempDir.prepare({
'.bowerrc': {
key: 'value'
},
'child/.bowerrc': {
key2: 'value2'
},
'child2/.bowerrc': {
key: 'valueShouldBeOverwriteParent'
},
'child3/bower.json': {
name: 'without-bowerrc'
},
'other_dir/.bowerrc': {
key: 'othervalue'
}
});
tempDirBowerrc.prepare({
'.bowerrc/foo': {
key: 'bar'
}
});
it('correctly reads .bowerrc files', function() {
var config = rc('bower', tempDir.path);
expect(config.key).to.eql('value');
expect(config.key2).to.eql(undefined);
});
it('correctly reads .bowerrc files from child', function() {
var config = rc('bower', tempDir.path + '/child/');
expect(config.key).to.eql('value');
expect(config.key2).to.eql('value2');
});
it('correctly reads .bowerrc files from child2', function() {
var config = rc('bower', tempDir.path + '/child2/');
expect(config.key).to.eql('valueShouldBeOverwriteParent');
expect(config.key2).to.eql(undefined);
});
it('correctly reads .bowerrc files from child3', function() {
var config = rc('bower', tempDir.path + '/child3/');
expect(config.key).to.eql('value');
expect(config.key2).to.eql(undefined);
});
it('loads the .bowerrc file from the cwd specified on the command line', function(){
var argv = {
'config': {
'cwd': tempDir.path + '/other_dir/'
}
};
var config = rc('bower', tempDir.path, argv);
expect(config.key).to.eql('othervalue');
});
it('throws an easy to understand error if .bowerrc is a dir', function() {
// Gotta wrap this to catch the error
var config = function () {
rc('bower', tempDirBowerrc.path);
};
expect(config).to.throwError(/should not be a directory/);
});
});

View File

@@ -0,0 +1,12 @@
root = true
[*]
indent_style = space
indent_size = 4
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
[*.md]
trim_trailing_whitespace = false

View File

@@ -0,0 +1,2 @@
/node_modules
/npm-debug.*

View File

@@ -0,0 +1,61 @@
{
"predef": [
"console",
"describe",
"it",
"after",
"afterEach",
"before",
"beforeEach"
],
"indent": 4,
"node": true,
"devel": true,
"bitwise": false,
"curly": false,
"eqeqeq": true,
"forin": false,
"immed": true,
"latedef": false,
"newcap": true,
"noarg": true,
"noempty": false,
"nonew": true,
"plusplus": false,
"regexp": false,
"undef": true,
"unused": true,
"quotmark": "single",
"strict": false,
"trailing": true,
"camelcase": true,
"asi": false,
"boss": true,
"debug": false,
"eqnull": true,
"esnext": false,
"evil": false,
"expr": true,
"funcscope": false,
"globalstrict": false,
"iterator": false,
"lastsemic": false,
"laxbreak": true,
"laxcomma": false,
"loopfunc": true,
"multistr": false,
"onecase": true,
"regexdash": false,
"scripturl": false,
"smarttabs": false,
"shadow": false,
"sub": false,
"supernew": true,
"validthis": false,
"nomen": false,
"white": true
}

View File

@@ -0,0 +1,4 @@
language: node_js
node_js:
- "0.10"
- "0.8"

View File

@@ -0,0 +1,19 @@
Copyright (c) 2012 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
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
of the Software, and to permit persons to whom the Software is furnished to do
so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

View File

@@ -0,0 +1,102 @@
# endpoint-parser [![Build Status](https://secure.travis-ci.org/bower/endpoint-parser.png?branch=master)](http://travis-ci.org/bower/endpoint-parser)
Little module that helps with endpoints parsing.
## API
### .decompose(endpoint)
Decomposes a endpoint into `name`, `source` and `target`.
```js
var endpointParser = require('bower-endpoint-parser');
endpointParser.decompose('jquery#~2.0.0');
// { name: '', source: 'jquery', target: '~2.0.0' }
endpointParser.decompose('backbone=backbone-amd#~1.0.0');
// { name: 'backbone', source: 'backbone-amd', target: '~1.0.0' }
endpointParser.decompose('http://twitter.github.io/bootstrap/assets/bootstrap.zip');
// { name: '', source: 'http://twitter.github.io/bootstrap/assets/bootstrap', target: '*' }
endpointParser.decompose('bootstrap=http://twitter.github.io/bootstrap/assets/bootstrap.zip');
// { name: 'bootstrap', source: 'http://twitter.github.io/bootstrap/assets/bootstrap', target: '*' }
```
### .compose(decEndpoint)
Inverse of `decompose()`.
Takes a decomposed endpoint and composes it back into a string.
```js
var endpointParser = require('bower-endpoint-parser');
endpointParser.compose({ name: '', source: 'jquery', target: '~2.0.0' });
// jquery#~2.0.0
endpointParser.compose({ name: 'backbone', source: 'backbone-amd', target: '~1.0.0' });
// backbone=backbone-amd#~1.0.0
endpointParser.compose({ name: '', source: 'http://twitter.github.io/bootstrap/assets/bootstrap', target: '*' });
// http://twitter.github.io/bootstrap/assets/bootstrap.zip
endpointParser.compose({ name: 'bootstrap', source: 'http://twitter.github.io/bootstrap/assets/bootstrap', target: '*' });
// bootstrap=http://twitter.github.io/bootstrap/assets/bootstrap.zip
```
### .json2decomposed(key, value)
Similar to `decompose()` but specially designed to be used when parsing `bower.json` dependencies.
For instance, in a `bower.json` like this:
```js
{
"name": "foo",
"version": "0.1.0",
"dependencies": {
"jquery": "~1.9.1",
"backbone": "backbone-amd#~1.0.0",
"bootstrap": "http://twitter.github.io/bootstrap/assets/bootstrap"
}
}
```
You would call `json2decomposed` like so:
```js
endpointParser.json2decomposed('jquery', '~1.9.1');
// { name: 'jquery', source: 'jquery', target: '~1.9.1' }
endpointParser.json2decomposed('backbone', 'backbone-amd#~1.0.0');
// { name: 'backbone', source: 'backbone-amd', target: '~1.0.0' }
endpointParser.json2decomposed('bootstrap', 'http://twitter.github.io/bootstrap/assets/bootstrap');
// { name: 'bootstrap', source: 'http://twitter.github.io/bootstrap/assets/bootstrap', target: '*' }
```
### .decomposed2json(decEndpoint)
Inverse of `json2decomposed()`.
Takes a decomposed endpoint and composes it to be saved to `bower.json`.
```js
var endpointParser = require('bower-endpoint-parser');
endpointParser.decomposed2json({ name: 'jquery', source: 'jquery', target: '~2.0.0' });
// { jquery: '~2.0.0' }
endpointParser.decomposed2json({ name: 'backbone', source: 'backbone-amd', target: '~1.0.0' });
// { backbone: 'backbone-amd#~2.0.0' }
endpointParser.decomposed2json({ name: 'bootstrap', source: 'http://twitter.github.io/bootstrap/assets/bootstrap', target: '*' });
// { bootstrap: 'http://twitter.github.io/bootstrap/assets/bootstrap' }
```
This function throws an exception if the `name` from the decomposed endpoint is empty.
## License
Released under the [MIT License](http://www.opensource.org/licenses/mit-license.php).

View File

@@ -0,0 +1,128 @@
function decompose(endpoint) {
// Note that we allow spaces in targets and sources but they are trimmed
var regExp = /^(?:([\w\-]|(?:[\w\.\-]+[\w\-])?)=)?([^\|#]+)(?:#(.*))?$/;
var matches = endpoint.match(regExp);
var target;
var error;
if (!matches) {
error = new Error('Invalid endpoint: ' + endpoint);
error.code = 'EINVEND';
throw error;
}
target = trim(matches[3]);
return {
name: trim(matches[1]),
source: trim(matches[2]),
target: isWildcard(target) ? '*' : target
};
}
function compose(decEndpoint) {
var name = trim(decEndpoint.name);
var source = trim(decEndpoint.source);
var target = trim(decEndpoint.target);
var composed = '';
if (name) {
composed += name + '=';
}
composed += source;
if (!isWildcard(target)) {
composed += '#' + target;
}
return composed;
}
function json2decomposed(key, value) {
var endpoint;
var split;
var error;
key = trim(key);
value = trim(value);
if (!key) {
error = new Error('The key must be specified');
error.code = 'EINVEND';
throw error;
}
endpoint = key + '=';
split = value.split('#').map(trim);
// If # was found, the source was specified
if (split.length > 1) {
endpoint += (split[0] || key) + '#' + split[1];
// Check if value looks like a source
} else if (isSource(value)) {
endpoint += value + '#*';
// Otherwise use the key as the source
} else {
endpoint += key + '#' + split[0];
}
return decompose(endpoint);
}
function decomposed2json(decEndpoint) {
var error;
var name = trim(decEndpoint.name);
var source = trim(decEndpoint.source);
var target = trim(decEndpoint.target);
var value = '';
var ret = {};
if (!name) {
error = new Error('Decomposed endpoint must have a name');
error.code = 'EINVEND';
throw error;
}
// Add source only if different than the name
if (source !== name) {
value += source;
}
// If value is empty, we append the target always
if (!value) {
if (isWildcard(target)) {
value += '*';
} else {
if (target.indexOf('/') !== -1) {
value += '#' + target;
} else {
value += target;
}
}
// Otherwise append only if not a wildcard or source does not look like a source
} else if (!isWildcard(target) || !isSource(source)) {
value += '#' + (target || '*');
}
ret[name] = value;
return ret;
}
function trim(str) {
return str ? str.trim() : '';
}
function isWildcard(target) {
return !target || target === '*' || target === 'latest';
}
function isSource(value) {
return (/[\/\\@]/).test(value);
}
module.exports.decompose = decompose;
module.exports.compose = compose;
module.exports.json2decomposed = json2decomposed;
module.exports.decomposed2json = decomposed2json;

View File

@@ -0,0 +1,28 @@
{
"name": "bower-endpoint-parser",
"version": "0.2.2",
"description": "Little module that helps with endpoints parsing.",
"author": "Twitter",
"licenses": [
{
"type": "MIT",
"url": "https://github.com/bower/endpoint-parser/blob/master/LICENSE"
}
],
"repository": {
"type": "git",
"url": "git://github.com/bower/endpoint-parser.git"
},
"main": "index.js",
"engines": {
"node": ">=0.8.0"
},
"devDependencies": {
"expect.js": "~0.2.0",
"mocha": "~1.12.0",
"mout": "~0.9.0"
},
"scripts": {
"test": "mocha -R spec"
}
}

View File

@@ -0,0 +1,263 @@
var expect = require('expect.js');
var lang = require('mout/lang');
var object = require('mout/object');
var endpointParser = require('../');
describe('endpoint-parser', function () {
describe('.decompose', function () {
it('should decompose endpoints correctly', function () {
var suite = {
'jquery#~2.0.0': { name: '', source: 'jquery', target: '~2.0.0' },
'jquery#*': { name: '', source: 'jquery', target: '*' },
'jquery#latest': { name: '', source: 'jquery', target: '*' },
'jquery#3dc50c62fe2d2d01afc58e7ad42236a35acff4d8': { name: '', source: 'jquery', target: '3dc50c62fe2d2d01afc58e7ad42236a35acff4d8' },
'jquery#master': { name: '', source: 'jquery', target: 'master' },
'backbone=backbone-amd#~1.0.0': { name: 'backbone', source: 'backbone-amd', target: '~1.0.0' },
'backbone=backbone-amd#latest': { name: 'backbone', source: 'backbone-amd', target: '*' },
'backbone=backbone-amd#*': { name: 'backbone', source: 'backbone-amd', target: '*' },
'http://twitter.github.io/bootstrap/assets/bootstrap.zip': { name: '', source: 'http://twitter.github.io/bootstrap/assets/bootstrap.zip', target: '*' },
'bootstrap=http://twitter.github.io/bootstrap/assets/bootstrap.zip': { name: 'bootstrap', source: 'http://twitter.github.io/bootstrap/assets/bootstrap.zip', target: '*' },
'bootstrap=http://twitter.github.io/bootstrap/assets/bootstrap.zip#latest': { name: 'bootstrap', source: 'http://twitter.github.io/bootstrap/assets/bootstrap.zip', target: '*' }
};
object.forOwn(suite, function (decEndpoint, endpoint) {
expect(endpointParser.decompose(endpoint)).to.eql(decEndpoint);
});
});
it('should trim sources and targets', function () {
var decEndpoint = endpointParser.decompose('foo= source # ~1.0.2 ');
expect(decEndpoint.source).to.equal('source');
expect(decEndpoint.target).to.equal('~1.0.2');
decEndpoint = endpointParser.decompose('foo= source # latest');
expect(decEndpoint.source).to.equal('source');
expect(decEndpoint.target).to.equal('*');
decEndpoint = endpointParser.decompose('foo= source # *');
expect(decEndpoint.source).to.equal('source');
expect(decEndpoint.target).to.equal('*');
});
});
describe('.compose', function () {
it('should compose endpoints correctly', function () {
var suite = {
'jquery#~2.0.0': { name: '', source: 'jquery', target: '~2.0.0' },
'jquery': [{ name: '', source: 'jquery', target: '*' }, { name: '', source: 'jquery', target: 'latest' }, { name: '', source: 'jquery', target: '' }],
'jquery#3dc50c62fe2d2d01afc58e7ad42236a35acff4d8': { name: '', source: 'jquery', target: '3dc50c62fe2d2d01afc58e7ad42236a35acff4d8' },
'jquery#master': { name: '', source: 'jquery', target: 'master' },
'backbone=backbone-amd#~1.0.0': { name: 'backbone', source: 'backbone-amd', target: '~1.0.0' },
'backbone=backbone-amd': [{ name: 'backbone', source: 'backbone-amd', target: '*' }, { name: 'backbone', source: 'backbone-amd', target: '*' }, { name: 'backbone', source: 'backbone-amd', target: '' }],
'http://twitter.github.io/bootstrap/assets/bootstrap.zip': { name: '', source: 'http://twitter.github.io/bootstrap/assets/bootstrap.zip', target: '*' },
'bootstrap=http://twitter.github.io/bootstrap/assets/bootstrap.zip': { name: 'bootstrap', source: 'http://twitter.github.io/bootstrap/assets/bootstrap.zip', target: '*' }
};
object.forOwn(suite, function (decEndpoints, endpoint) {
decEndpoints = lang.toArray(decEndpoints);
decEndpoints.forEach(function (decEndpoint) {
expect(endpointParser.compose(decEndpoint)).to.equal(endpoint);
});
});
});
it('should trim values', function () {
expect(endpointParser.compose({
name: ' foo ',
source: ' bar ',
target: ' ~1.0.2 '
})).to.equal('foo=bar#~1.0.2');
expect(endpointParser.compose({
name: ' foo ',
source: ' foo ',
target: ' ~1.0.2 '
})).to.equal('foo=foo#~1.0.2');
expect(endpointParser.compose({
name: ' foo ',
source: ' foo ',
target: ' * '
})).to.equal('foo=foo');
expect(endpointParser.compose({
name: ' foo ',
source: ' foo ',
target: ' * '
})).to.equal('foo=foo');
expect(endpointParser.compose({
name: ' ',
source: ' foo ',
target: ''
})).to.equal('foo');
});
});
describe('.json2decomposed', function () {
var expected = [
{ name: 'jquery', source: 'jquery', target: '~1.9.1' },
{ name: 'foo', source: 'foo', target: '*' },
{ name: 'bar', source: 'bar', target: '*' },
{ name: 'baz', source: 'baz', target: '~0.2.0' },
{ name: 'backbone', source: 'backbone-amd', target: '~1.0.0' },
{ name: 'backbone2', source: 'backbone=backbone-amd', target: '~1.0.0' },
{ name: 'bootstrap', source: 'http://twitter.github.io/bootstrap/assets/bootstrap', target: '*' },
{ name: 'bootstrap2', source: 'http://twitter.github.io/bootstrap/assets/bootstrap', target: '*' },
{ name: 'ssh', source: 'git@example.com', target: '*' },
{ name: 'git', source: 'git://example.com', target: '*' },
{ name: 'path', source: '/foo', target: '*' },
{ name: 'winpath', source: 'c:\\foo', target: '*' }
];
it('should decompose json endpoints correctly', function () {
var dependencies = {
jquery: '~1.9.1',
foo: 'latest',
bar: '*',
baz: '#~0.2.0',
backbone: 'backbone-amd#~1.0.0',
backbone2: 'backbone=backbone-amd#~1.0.0',
bootstrap: 'http://twitter.github.io/bootstrap/assets/bootstrap',
bootstrap2: 'http://twitter.github.io/bootstrap/assets/bootstrap#*',
ssh: 'git@example.com',
git: 'git://example.com',
path: '/foo',
winpath: 'c:\\foo'
};
var x = 0;
object.forOwn(dependencies, function (value, key) {
expect(endpointParser.json2decomposed(key, value)).to.eql(expected[x]);
x += 1;
});
});
it('should trim values', function () {
var dependencies = {
' jquery ': ' ~1.9.1 ',
' foo ': ' latest ',
' bar ': ' * ',
' baz ': '# ~0.2.0 ',
' backbone ': ' backbone-amd#~1.0.0 ',
' backbone2 ': ' backbone=backbone-amd # ~1.0.0 ',
' bootstrap ': ' http://twitter.github.io/bootstrap/assets/bootstrap',
' bootstrap2 ': ' http://twitter.github.io/bootstrap/assets/bootstrap # *',
' ssh ': ' git@example.com ',
' git ': ' git://example.com ',
' path ': ' /foo ',
' winpath ': ' c:\\foo '
};
var x = 0;
object.forOwn(dependencies, function (value, key) {
expect(endpointParser.json2decomposed(key, value)).to.eql(expected[x]);
x += 1;
});
});
it('should error out if key is not specified', function () {
try {
endpointParser.json2decomposed(null);
throw new Error('Should have failed');
} catch (e) {
expect(e.code).to.equal('EINVEND');
expect(e.message).to.contain('key must be specified');
}
try {
endpointParser.json2decomposed('');
throw new Error('Should have failed');
} catch (e) {
expect(e.code).to.equal('EINVEND');
expect(e.message).to.contain('key must be specified');
}
});
});
describe('.decomposed2json', function () {
var expected = [
{ jquery: '~1.9.1' },
{ foo: '*' },
{ bar: '*' },
{ baz: '*' },
{ jqueryx: 'jquery#~1.9.1' },
{ jqueryy: 'jquery-x#*' },
{ jqueryy: 'jquery-x#*' },
{ backbone: 'backbone-amd#~1.0.0' },
{ backbone : 'backbone=backbone-amd#~1.0.0' },
{ bootstrap: 'http://twitter.github.io/bootstrap/assets/bootstrap' },
{ bootstrap: 'http://twitter.github.io/bootstrap/assets/bootstrap' },
{ ssh: 'git@example.com' },
{ git: 'git://example.com' },
{ ckeditor: '#full/4.3.3' }
];
it('should compose endpoints to json correctly', function () {
var decEndpoints = [
{ name: 'jquery', source: 'jquery', target: '~1.9.1' },
{ name: 'foo', source: 'foo', target: 'latest' },
{ name: 'bar', source: 'bar', target: '*' },
{ name: 'baz', source: 'baz', target: '' },
{ name: 'jqueryx', source: 'jquery', target: '~1.9.1' },
{ name: 'jqueryy', source: 'jquery-x', target: '' },
{ name: 'jqueryy', source: 'jquery-x', target: '*' },
{ name: 'backbone', source: 'backbone-amd', target: '~1.0.0' },
{ name: 'backbone', source: 'backbone=backbone-amd', target: '~1.0.0' },
{ name: 'bootstrap', source: 'http://twitter.github.io/bootstrap/assets/bootstrap', target: '' },
{ name: 'bootstrap', source: 'http://twitter.github.io/bootstrap/assets/bootstrap', target: '*' },
{ name: 'ssh', source: 'git@example.com', target: '*' },
{ name: 'git', source: 'git://example.com', target: '*' },
{ name: 'ckeditor', source: 'ckeditor', target: 'full/4.3.3' }
];
var x = 0;
decEndpoints.forEach(function (decEndpoint) {
expect(endpointParser.decomposed2json(decEndpoint)).to.eql(expected[x]);
x += 1;
});
});
it('should trim values', function () {
var decEndpoints = [
{ name: ' jquery ', source: ' jquery ', target: ' ~1.9.1 ' },
{ name: 'foo', source: ' foo', target: ' latest ' },
{ name: 'bar', source: 'bar ', target: ' * ' },
{ name: 'baz ', source: 'baz', target: ' ' },
{ name: ' jqueryx ', source: ' jquery ', target: ' ~1.9.1 ' },
{ name: ' jqueryy ', source: ' jquery-x ', target: ' ' },
{ name: ' jqueryy ', source: ' jquery-x ', target: ' * ' },
{ name: ' backbone ', source: ' backbone-amd ', target: ' ~1.0.0 ' },
{ name: ' backbone ', source: ' backbone=backbone-amd ', target: ' ~1.0.0 ' },
{ name: ' bootstrap ', source: ' http://twitter.github.io/bootstrap/assets/bootstrap ', target: ' ' },
{ name: ' bootstrap ', source: ' http://twitter.github.io/bootstrap/assets/bootstrap ', target: ' * ' },
{ name: ' ssh ', source: ' git@example.com ', target: ' * ' },
{ name: ' git ', source: ' git://example.com ', target: ' * ' }
];
var x = 0;
decEndpoints.forEach(function (decEndpoint) {
expect(endpointParser.decomposed2json(decEndpoint)).to.eql(expected[x]);
x += 1;
});
});
it('should throw an error if name is empty', function () {
try {
endpointParser.decomposed2json({ name: '', source: 'jquery', target: '*' });
throw new Error('Should have failed');
} catch (e) {
expect(e.code).to.equal('EINVEND');
expect(e.message).to.contain('must have a name');
}
try {
endpointParser.decomposed2json({ name: ' ', source: 'jquery', target: '*' });
throw new Error('Should have failed');
} catch (e) {
expect(e.code).to.equal('EINVEND');
expect(e.message).to.contain('must have a name');
}
});
});
});

View File

@@ -0,0 +1,12 @@
root = true
[*]
indent_style = space
indent_size = 4
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
[*.md]
trim_trailing_whitespace = false

4
packages/bower-json/.gitignore vendored Normal file
View File

@@ -0,0 +1,4 @@
/node_modules
/npm-debug.*
/test/reports

View File

@@ -0,0 +1,48 @@
{
"indent": 4,
"node": true,
"devel": true,
"mocha": true,
"bitwise": false,
"curly": false,
"eqeqeq": true,
"forin": false,
"immed": true,
"latedef": false,
"newcap": true,
"noarg": true,
"noempty": false,
"nonew": true,
"plusplus": false,
"regexp": false,
"undef": true,
"unused": true,
"quotmark": "single",
"strict": false,
"camelcase": true,
"asi": false,
"boss": true,
"debug": false,
"eqnull": true,
"es5": false,
"esnext": false,
"evil": false,
"expr": false,
"funcscope": false,
"globalstrict": false,
"iterator": false,
"lastsemic": false,
"laxbreak": true,
"laxcomma": false,
"loopfunc": true,
"multistr": false,
"onecase": true,
"regexdash": false,
"scripturl": false,
"shadow": false,
"sub": false,
"supernew": true,
"validthis": false
}

View File

@@ -0,0 +1,10 @@
sudo: false
language: node_js
node_js:
- '5'
- '4'
- '0.12'
- '0.10'
script:
- grunt travis

View File

@@ -0,0 +1,17 @@
# 0.8.1
- Revert strict name validations and allow @, spaces and slashes
# 0.8.0
- Update graceful-fs to 4.x
- Add name validations that reflect what's happening in registry
# 0.7.1
- Unpublished
# 0.7.0
- Add getIssues function to retrieve all errors and warnings
- Add readSync and findSync functions for synchronous read

View File

@@ -0,0 +1,60 @@
'use strict';
module.exports = function (grunt) {
require('load-grunt-tasks')(grunt);
// Project configuration.
grunt.initConfig({
jshint: {
files: [
'Gruntfile.js',
'lib/**/*.js',
'test/**/*.js',
'!test/reports/**/*'
],
options: {
jshintrc: '.jshintrc'
}
},
simplemocha: {
options: {
reporter: 'spec'
},
full: { src: ['test/test.js'] },
short: {
options: {
reporter: 'dot'
},
src: ['test/test.js']
},
build: {
options: {
reporter: 'tap'
},
src: ['test/test.js']
}
},
exec: {
cover: {
command: 'STRICT_REQUIRE=1 node node_modules/istanbul/lib/cli.js cover --dir ./test/reports node_modules/mocha/bin/_mocha -- --timeout 30000 -R dot test/test.js'
},
coveralls: {
command: 'node node_modules/.bin/coveralls < test/reports/lcov.info'
}
},
watch: {
files: ['<%= jshint.files %>'],
tasks: ['jshint', 'simplemocha:short']
}
});
// Default task.
grunt.registerTask('test', ['simplemocha:full']);
grunt.registerTask('default', ['jshint', 'test']);
grunt.registerTask('travis', ['jshint', 'exec:cover', 'exec:coveralls']);
};

View File

@@ -0,0 +1,19 @@
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
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
of the Software, and to permit persons to whom the Software is furnished to do
so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

View File

@@ -0,0 +1,159 @@
# bower-json [![Build Status](https://secure.travis-ci.org/bower/json.png?branch=master)](http://travis-ci.org/bower/json) [![Coverage Status](https://coveralls.io/repos/bower/json/badge.svg?branch=master&service=github)](https://coveralls.io/github/bower/json?branch=master)
Read `bower.json` files with semantics, normalisation, defaults and validation.
Install via [npm](https://www.npmjs.org/package/bower-json): `npm install --save bower-json`
## Usage
#### .read(file, options, callback)
#### .readSync(file, options)
Reads `file` and applies normalisation, defaults and validation according to the `bower.json` spec.
If the passed `file` does not exist, the callback is called with `error.code` equal to `ENOENT`.
If the passed `file` contents are not valid JSON, the callback is called with `error.code` equal to `EMALFORMED`.
If the `json` does not comply with the `bower.json` spec, the callback is called with `error.code` equal to `EINVALID`.
If `file` is a directory, `find()` will be used to search for the json file.
The `options` argument is optional and can be omitted. These options will be passed to `parse` method.
```js
var bowerJson = require('bower-json');
// Can also be used by simply calling bowerJson()
bowerJson.read('/path/to/bower.json', function (err, json) {
if (err) {
console.error('There was an error reading the file');
console.error(err.message);
return;
}
console.log('JSON: ', json);
});
```
#### .parse(json, options)
Parses an object. Useful when you want to apply normalisation and validation directly to an object.
If the `json` does not comply with the `bower.json` spec, an error is thrown with `error.code` equal to `EINVALID`.
The `options` arguments is optional and can be omitted. Available options:
- validate: Apply validation, defaults to `true`
- normalize: Apply normalisation, defaults to `false`
- clone: clone, use and return the passed in `json` object instead of using it directly, defaults to `false`
```js
var bowerJson = require('bower-json');
var json = {
name: 'my-package',
version: '0.0.1'
};
try {
bowerJson.parse(json);
} catch (err) {
console.error('There was an error parsing the object');
console.error(err.message);
}
```
#### .getIssues(json) - DEPRECATED
Validates the passed `json` object.
Returns an object with errors and warnings of this bower.json contents.
```js
var bowerJson = require('bower-json');
var json = {
name: 'myPackage',
version: '0.0.1',
main: {}
};
var issues = bowerJson.getIssues(json);
expect(issues).toEqual({
errors: ['The "main" field has to be either an Array or a String'],
warnings: ['The "name" must be lowercase']
});
#### .validate(json)
Validates the passed `json` object.
Throws an error with `error.code` equal to `EINVALID` if it does not comply with the spec.
```js
var bowerJson = require('bower-json');
var json = {
name: 'myPackage',
version: '0.0.1'
};
try {
bowerJson.validate(json);
} catch (err) {
console.error('There was an error validating the object');
console.error(err.message);
}
```
#### .normalize(json)
```js
var bowerJson = require('bower-json');
var json = {
name: 'my-package',
version: '0.0.1',
main: 'foo.js,bar.js'
};
bowerJson.normalize(json);
json.main // ['foo.js', 'bar.js']
```
#### .find(folder, callback)
#### .findSync(folder)
Finds the `json` filename inside a folder.
Checks if a `bower.json` exists, falling back to `component.json` (deprecated) and `.bower.json`.
If no file was found, the callback is called with a `error.code` of `ENOENT`.
```js
var bowerJson = require('bower-json');
bowerJson.find('/path/to/folder', function (err, filename) {
if (err) {
console.error('There is no json file in the folder');
return;
}
console.log('Filename: ', filename);
// Now that we got the filename, we can read its contents
bowerJson.read(filename, function (err, json) {
if (err) {
console.error('There was an error reading the file');
console.error(err.message);
return;
}
console.log('JSON: ', json);
});
});
```
## License
Released under the [MIT License](http://www.opensource.org/licenses/mit-license.php).

View File

@@ -0,0 +1,297 @@
var fs = require('graceful-fs');
var path = require('path');
var deepExtend = require('deep-extend');
var isAsset = require('./util/isAsset');
var isComponent = require('./util/isComponent');
var createError = require('./util/createError');
var possibleJsons = ['bower.json', 'component.json', '.bower.json'];
function read(file, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
// Check if file is a directory
fs.stat(file, function (err, stat) {
if (err) {
return callback(err);
}
// It's a directory, so we find the json inside it
if (stat.isDirectory()) {
return find(file, function (err, file) {
if (err) {
return callback(err);
}
read(file, options, callback);
});
}
// Otherwise read it
fs.readFile(file, function (err, contents) {
var json;
if (err) {
return callback(err);
}
try {
json = JSON.parse(contents.toString());
} catch (err) {
err.file = path.resolve(file);
err.code = 'EMALFORMED';
return callback(err);
}
// Parse it
try {
json = parse(json, options);
} catch (err) {
err.file = path.resolve(file);
return callback(err);
}
callback(null, json, file);
});
});
}
function readSync(file, options) {
var stat;
var filename;
var contents;
var json;
if (!options) {
options = {};
}
try {
stat = fs.statSync(file);
} catch (err) {
return err;
}
if (stat.isDirectory()) {
filename = findSync(file);
return readSync(filename);
}
contents = fs.readFileSync(file);
try {
json = JSON.parse(contents.toString());
} catch (err) {
err.file = path.resolve(file);
err.code = 'EMALFORMED';
return err;
}
try {
json = parse(json, options);
} catch (err) {
err.file = path.resolve(file);
return err;
}
return json;
}
function parse(json, options) {
options = deepExtend({
normalize: false,
validate: true,
clone: false
}, options || {});
// Clone
if (options.clone) {
json = deepExtend({}, json);
}
// Validate
if (options.validate) {
validate(json);
}
// Normalize
if (options.normalize) {
normalize(json);
}
return json;
}
// This function implements:
//
// https://github.com/bower/bower.json-spec
function getIssues(json) {
// For things that shouldn't happen
var errors = [];
// For things that happen but they shoudn't
var warnings = [];
if (!json.name) {
errors.push('No "name" property set');
} else {
if (!/^[a-zA-Z0-9_@][a-zA-Z0-9_@\.\- \/]*$/.test(json.name)) {
errors.push('Name must be lowercase, can contain digits, dots, dashes, "@" or spaces');
}
if (json.name.length > 50) {
warnings.push('The "name" is too long, the limit is 50 characters');
}
if (!/^[a-z0-9_][a-z0-9_\.\-]*$/.test(json.name)) {
warnings.push('The "name" is recommended to be lowercase, can contain digits, dots, dashes');
}
if (/^[\.-]/.test(json.name)) {
warnings.push('The "name" cannot start with dot or dash');
}
if (/[\.-]$/.test(json.name)) {
warnings.push('The "name" cannot end with dot or dash');
}
}
if (json.description && json.description.length > 140) {
warnings.push('The "description" is too long, the limit is 140 characters');
}
if (json.main !== undefined) {
var main = json.main;
if (typeof main === 'string') {
main = [main];
}
if (!(main instanceof Array)) {
errors.push('The "main" field has to be either an Array or a String');
} else {
var ext2files = {};
main.forEach(function (filename) {
if (typeof filename !== 'string') {
errors.push('The "main" Array has to contain only Strings');
}
if (/[*]/.test(filename)) {
warnings.push('The "main" field cannot contain globs (example: "*.js")');
}
if (/[.]min[.][^/]+$/.test(filename)) {
warnings.push('The "main" field cannot contain minified files');
}
if (isAsset(filename)) {
warnings.push('The "main" field cannot contain font, image, audio, or video files');
}
var ext = path.extname(filename);
if (ext.length >= 2) {
var files = ext2files[ext];
if (!files) {
files = ext2files[ext] = [];
}
files.push(filename);
}
});
Object.keys(ext2files).forEach(function (ext) {
var files = ext2files[ext];
if (files.length > 1) {
warnings.push('The "main" field has to contain only 1 file per filetype; found multiple ' + ext + ' files: ' + JSON.stringify(files));
}
});
}
}
return {
errors: errors,
warnings: warnings
};
}
// For backward compatibility, it throws first error
function validate(json) {
var issues = getIssues(json);
if (issues.errors && issues.errors.length > 0) {
throw createError(issues.errors[0], 'EINVALID');
}
}
function normalize(json) {
if (typeof json.main === 'string') {
json.main = [json.main];
}
return json;
}
function find(folder, files, callback) {
var err;
var file;
if (typeof files === 'function') {
callback = files;
files = possibleJsons;
}
if (!files.length) {
err = createError('None of ' + possibleJsons.join(', ') + ' were found in ' + folder, 'ENOENT');
return callback(err);
}
file = path.resolve(path.join(folder, files[0]));
fs.exists(file, function (exists) {
if (!exists) {
return find(folder, files.slice(1), callback);
}
if (files[0] !== 'component.json') {
return callback(null, file);
}
// If the file is component.json, check it it's a component(1) file
// If it is, we ignore it and keep searching
isComponent(file, function (is) {
if (is) {
return find(folder, files.slice(1), callback);
}
callback(null, file);
});
});
}
function findSync(folder, files) {
var file;
var exists;
if (files === undefined) {
files = possibleJsons;
}
if (!files.length) {
return createError('None of ' + possibleJsons.join(', ') + ' were found in ' + folder, 'ENOENT');
}
file = path.resolve(path.join(folder, files[0]));
try{
exists = fs.statSync(file);
}
catch (err) {
exists = false;
}
if (exists && exists.isFile()) {
return file;
} else {
return findSync(folder, files.slice(1));
}
}
module.exports = read;
module.exports.read = read;
module.exports.readSync = readSync;
module.exports.parse = parse;
module.exports.getIssues = getIssues;
module.exports.validate = validate;
module.exports.normalize = normalize;
module.exports.find = find;
module.exports.findSync = findSync;

View File

@@ -0,0 +1,8 @@
function createError(msg, code) {
var err = new Error(msg);
err.code = code;
return err;
}
module.exports = createError;

View File

@@ -0,0 +1,12 @@
var extName = require('ext-name');
function isAsset(filename) {
var info = extName(filename);
return info && info.mime && (
/^((image)|(audio)|(video)|(font))\//.test(info.mime) ||
/application\/((x[-]font[-])|(font[-]woff(\d?))|(vnd[.]ms[-]fontobject))/.test(info.mime)
);
}
module.exports = isAsset;

View File

@@ -0,0 +1,41 @@
var fs = require('graceful-fs');
var intersect = require('intersect');
// Function to check if a file is a component(1) file
function isComponent(file, callback) {
fs.readFile(file, function (err, contents) {
var json;
var keys;
var common;
// If an error occurs while reading the file, we ignore it
if (err) {
return callback(false);
}
try {
json = JSON.parse(contents.toString());
} catch (err) {
return callback(false);
}
// Attempt to find specific things from the component(1) spec
// Note that we don't parse the dependencies property because at any point
// we can allow / to specify directories
// Bellow only some clearly not ambiguous properties are checked
keys = Object.keys(json);
common = intersect(keys, [
'repo',
'development',
'local',
'remotes',
'paths',
'demo'
]);
// If none were found, than it's a valid component.json bower file
callback(common.length ? true : false);
});
}
module.exports = isComponent;

View File

@@ -0,0 +1,40 @@
{
"name": "bower-json",
"version": "0.8.1",
"description": "Read bower.json files with semantics, normalisation, defaults and validation",
"author": "Twitter",
"license": "MIT",
"repository": "bower/json",
"main": "lib/json",
"engines": {
"node": ">=0.10.0"
},
"dependencies": {
"deep-extend": "^0.4.0",
"ext-name": "^3.0.0",
"graceful-fs": "^4.1.3",
"intersect": "^1.0.1"
},
"devDependencies": {
"coveralls": "^2.11.2",
"expect.js": "^0.3.1",
"grunt": "^0.4.4",
"grunt-cli": "^0.1.13",
"grunt-contrib-jshint": "^0.11.2",
"grunt-contrib-watch": "^0.6.1",
"grunt-coveralls": "^1.0.0",
"grunt-exec": "^0.4.6",
"grunt-simple-mocha": "^0.4.0",
"istanbul": "^0.3.5",
"load-grunt-tasks": "^3.3.0",
"mocha": "*",
"request": "^2.64.0",
"underscore.string": "^3.0.3"
},
"scripts": {
"test": "grunt test"
},
"files": [
"lib"
]
}

View File

@@ -0,0 +1 @@
{}

View File

@@ -0,0 +1,5 @@
{
"name": "some-pkg",
"version": "0.0.0",
"main": "foo.js"
}

View File

@@ -0,0 +1,14 @@
{
"name": "route",
"repo": "apily/route",
"version": "0.0.1",
"description": "Route component",
"keywords": ["router", "route"],
"scripts": ["index.js"],
"dependencies": {},
"development": {
"component/assert": "*",
"visionmedia/mocha": "*"
},
"license": "MIT"
}

View File

@@ -0,0 +1,4 @@
{
"name": "some-pkg",
"version": "0.0.0"
}

View File

@@ -0,0 +1,5 @@
{
"name": "some-installed-pkg",
"version": "0.0.1",
"main": "bar.js"
}

View File

@@ -0,0 +1,497 @@
var path = require('path');
var expect = require('expect.js');
var _s = require('underscore.string');
var bowerJson = require('../lib/json');
var request = require('request');
describe('.find', function () {
it('should find the bower.json file', function (done) {
bowerJson.find(__dirname + '/pkg-bower-json', function (err, file) {
if (err) {
return done(err);
}
expect(file).to.equal(path.resolve(__dirname + '/pkg-bower-json/bower.json'));
done();
});
});
it('should fallback to the component.json file', function (done) {
bowerJson.find(__dirname + '/pkg-component-json', function (err, file) {
if (err) {
return done(err);
}
expect(file).to.equal(path.resolve(__dirname + '/pkg-component-json/component.json'));
done();
});
});
it('should not fallback to the component.json file if it\'s a component(1) file', function (done) {
bowerJson.find(__dirname + '/pkg-component(1)-json', function (err) {
expect(err).to.be.an(Error);
expect(err.code).to.equal('ENOENT');
expect(err.message).to.equal('None of bower.json, component.json, .bower.json were found in ' + __dirname + '/pkg-component(1)-json');
done();
});
});
it('should fallback to the .bower.json file', function (done) {
bowerJson.find(__dirname + '/pkg-dot-bower-json', function (err, file) {
if (err) {
return done(err);
}
expect(file).to.equal(path.resolve(__dirname + '/pkg-dot-bower-json/.bower.json'));
done();
});
});
it('should error if no component.json / bower.json / .bower.json is found', function (done) {
bowerJson.find(__dirname, function (err) {
expect(err).to.be.an(Error);
expect(err.code).to.equal('ENOENT');
expect(err.message).to.equal('None of bower.json, component.json, .bower.json were found in ' + __dirname);
done();
});
});
});
describe('.findSync', function () {
it('should find the bower.json file', function (done) {
var file = bowerJson.findSync(__dirname + '/pkg-bower-json');
expect(file).to.equal(path.resolve(__dirname + '/pkg-bower-json/bower.json'));
done();
});
it('should fallback to the component.json file', function (done) {
var file = bowerJson.findSync(__dirname + '/pkg-component-json');
expect(file).to.equal(path.resolve(__dirname + '/pkg-component-json/component.json'));
done();
});
it('should fallback to the .bower.json file', function (done) {
var file = bowerJson.findSync(__dirname + '/pkg-dot-bower-json');
expect(file).to.equal(path.resolve(__dirname + '/pkg-dot-bower-json/.bower.json'));
done();
});
it('should error if no component.json / bower.json / .bower.json is found', function (done) {
var err = bowerJson.findSync(__dirname);
expect(err).to.be.an(Error);
expect(err.code).to.equal('ENOENT');
expect(err.message).to.equal('None of bower.json, component.json, .bower.json were found in ' + __dirname);
done();
});
});
describe('.read', function () {
it('should give error if file does not exists', function (done) {
bowerJson.read(__dirname + '/willneverexist', function (err) {
expect(err).to.be.an(Error);
expect(err.code).to.equal('ENOENT');
done();
});
});
it('should give error if when reading an invalid json', function (done) {
bowerJson.read(__dirname + '/pkg-bower-json-malformed/bower.json', function (err) {
expect(err).to.be.an(Error);
expect(err.code).to.equal('EMALFORMED');
expect(err.file).to.equal(path.resolve(__dirname + '/pkg-bower-json-malformed/bower.json'));
done();
});
});
it('should read the file and give an object', function (done) {
bowerJson.read(__dirname + '/pkg-bower-json/bower.json', function (err, json) {
if (err) {
return done(err);
}
expect(json).to.be.an('object');
expect(json.name).to.equal('some-pkg');
expect(json.version).to.equal('0.0.0');
done();
});
});
it('should give the json file that was read', function (done) {
bowerJson.read(__dirname + '/pkg-bower-json', function (err, json, file) {
if (err) {
return done(err);
}
expect(file).to.equal(__dirname + '/pkg-bower-json/bower.json');
done();
});
});
it('should find for a json file if a directory is given', function (done) {
bowerJson.read(__dirname + '/pkg-component-json', function (err, json, file) {
if (err) {
return done(err);
}
expect(json).to.be.an('object');
expect(json.name).to.equal('some-pkg');
expect(json.version).to.equal('0.0.0');
expect(file).to.equal(path.resolve(__dirname + '/pkg-component-json/component.json'));
done();
});
});
it('should validate the returned object unless validate is false', function (done) {
bowerJson.read(__dirname + '/pkg-bower-json-invalid/bower.json', function (err) {
expect(err).to.be.an(Error);
expect(err.message).to.contain('name');
expect(err.file).to.equal(path.resolve(__dirname + '/pkg-bower-json-invalid/bower.json'));
bowerJson.read(__dirname + '/pkg-bower-json-invalid/bower.json', { validate: false }, function (err) {
done(err);
});
});
});
it('should normalize the returned object if normalize is true', function (done) {
bowerJson.read(__dirname + '/pkg-bower-json/bower.json', function (err, json) {
if (err) {
return done(err);
}
expect(json.main).to.equal('foo.js');
bowerJson.read(__dirname + '/pkg-bower-json/bower.json', { normalize: true }, function (err, json) {
if (err) {
return done(err);
}
expect(json.main).to.eql(['foo.js']);
done();
});
});
});
});
describe('.readSync', function () {
it('should give error if file does not exists', function (done) {
var err = bowerJson.readSync(__dirname + '/willneverexist');
expect(err).to.be.an(Error);
expect(err.code).to.equal('ENOENT');
done();
});
it('should give error if when reading an invalid json', function (done) {
var err = bowerJson.readSync(__dirname + '/pkg-bower-json-malformed/bower.json');
expect(err).to.be.an(Error);
expect(err.code).to.equal('EMALFORMED');
expect(err.file).to.equal(path.resolve(__dirname + '/pkg-bower-json-malformed/bower.json'));
done();
});
it('should read the file and give an object', function (done) {
var json = bowerJson.readSync(__dirname + '/pkg-bower-json/bower.json');
expect(json).to.be.an('object');
expect(json.name).to.equal('some-pkg');
expect(json.version).to.equal('0.0.0');
done();
});
it('should find for a json file if a directory is given', function (done) {
var json = bowerJson.readSync(__dirname + '/pkg-component-json');
expect(json).to.be.an('object');
expect(json.name).to.equal('some-pkg');
expect(json.version).to.equal('0.0.0');
done();
});
it('should validate the returned object unless validate is false', function (done) {
var err = bowerJson.readSync(__dirname + '/pkg-bower-json-invalid/bower.json');
expect(err).to.be.an(Error);
expect(err.message).to.contain('name');
expect(err.file).to.equal(path.resolve(__dirname + '/pkg-bower-json-invalid/bower.json'));
err = bowerJson.readSync(__dirname + '/pkg-bower-json-invalid/bower.json', { validate: false });
expect(err).to.not.be.an(Error);
done();
});
it('should normalize the returned object if normalize is true', function (done) {
var json = bowerJson.readSync(__dirname + '/pkg-bower-json/bower.json');
expect(json.main).to.equal('foo.js');
json = bowerJson.readSync(__dirname + '/pkg-bower-json/bower.json', { normalize: true });
expect(json.main).to.eql(['foo.js']);
done();
});
});
describe('.parse', function () {
it('should return the same object, unless clone is true', function () {
var json = { name: 'foo' };
expect(bowerJson.parse(json)).to.equal(json);
expect(bowerJson.parse(json, { clone: true })).to.not.equal(json);
expect(bowerJson.parse(json, { clone: true })).to.eql(json);
});
it('should validate the passed object, unless validate is false', function () {
expect(function () {
bowerJson.parse({});
}).to.throwException(/name/);
expect(function () {
bowerJson.parse({}, { validate: false });
}).to.not.throwException();
});
it('should not normalize the passed object unless normalize is true', function () {
var json = { name: 'foo', main: 'foo.js' };
bowerJson.parse(json);
expect(json.main).to.eql('foo.js');
bowerJson.parse(json, { normalize: true });
expect(json.main).to.eql(['foo.js']);
});
});
describe('.getIssues', function () {
it('should print no errors even for weird package names', function () {
var json = { name: '@gruNt/my dependency' };
expect(bowerJson.getIssues(json).errors).to.be.empty();
});
it('should validate the name length', function () {
var json = { name: 'a_123456789_123456789_123456789_123456789_123456789_z' };
expect(bowerJson.getIssues(json).warnings).to.contain(
'The "name" is too long, the limit is 50 characters'
);
});
it('should validate the name is lowercase', function () {
var json = { name: 'gruNt' };
expect(bowerJson.getIssues(json).warnings).to.contain(
'The "name" is recommended to be lowercase, can contain digits, dots, dashes'
);
});
it('should validate the name starts with lowercase', function () {
var json = { name: '-runt' };
expect(bowerJson.getIssues(json).warnings).to.contain(
'The "name" cannot start with dot or dash'
);
});
it('should validate the name starts with lowercase', function () {
var json = { name: '.grunt' };
expect(bowerJson.getIssues(json).warnings).to.contain(
'The "name" cannot start with dot or dash'
);
});
it('should validate the name ends with lowercase', function () {
var json = { name: 'grun-' };
expect(bowerJson.getIssues(json).warnings).to.contain(
'The "name" cannot end with dot or dash'
);
});
it('should validate the name ends with lowercase', function () {
var json = { name: 'grun.' };
expect(bowerJson.getIssues(json).warnings).to.contain(
'The "name" cannot end with dot or dash'
);
});
it('should validate the name is valid', function () {
var json = { name: 'gru.n-t' };
expect(bowerJson.getIssues(json).warnings).to.eql([]);
});
it('should validate the description length', function () {
var json = {
name: 'foo',
description: _s.repeat('æ', 141)
};
expect(bowerJson.getIssues(json).warnings).to.contain(
'The "description" is too long, the limit is 140 characters'
);
});
it('should validate the description is valid', function () {
var json = {
name: 'foo',
description: _s.repeat('æ', 140)
};
expect(bowerJson.getIssues(json).warnings).to.eql([]);
});
it('should validate that main does not contain globs', function () {
var json = {
name: 'foo',
main: ['js/*.js']
};
expect(bowerJson.getIssues(json).warnings).to.contain(
'The "main" field cannot contain globs (example: "*.js")'
);
});
it('should validate that main does not contain minified files', function () {
var json = {
name: 'foo',
main: ['foo.min.css']
};
expect(bowerJson.getIssues(json).warnings).to.contain(
'The "main" field cannot contain minified files'
);
});
it('should validate that main does not contain fonts', function () {
var json = {
name: 'foo',
main: ['foo.woff']
};
expect(bowerJson.getIssues(json).warnings).to.contain(
'The "main" field cannot contain font, image, audio, or video files'
);
});
it('should validate that main does not contain images', function () {
var json = {
name: 'foo',
main: ['foo.png']
};
expect(bowerJson.getIssues(json).warnings).to.contain(
'The "main" field cannot contain font, image, audio, or video files'
);
});
it('should validate that main does not contain multiple files of the same filetype', function () {
var json = {
name: 'foo',
main: ['foo.js', 'bar.js']
};
expect(bowerJson.getIssues(json).warnings).to.contain(
'The "main" field has to contain only 1 file per filetype; found multiple .js files: ["foo.js","bar.js"]'
);
});
});
describe('.validate', function () {
it('should validate the name property', function () {
expect(function () {
bowerJson.validate({});
}).to.throwException(/name/);
});
it('should validate the type of main', function () {
var json = {
name: 'foo',
main: {}
};
expect(function () {
bowerJson.validate(json);
}).to.throwException();
});
it('should validate the type of items of an Array main', function () {
var json = {
name: 'foo',
main: [{}]
};
expect(function () {
bowerJson.validate(json);
}).to.throwException();
});
});
describe('.normalize', function () {
it('should normalize the main property', function () {
var json = { name: 'foo', main: 'foo.js' };
bowerJson.normalize(json);
expect(json.main).to.eql(['foo.js']);
});
});
describe('packages from bower registry', function () {
var packageList,
packageListUrl = 'http://bower.herokuapp.com/packages';
this.timeout(60000);
it('can be downloaded from online source ' + packageListUrl, function(done) {
request({
url: packageListUrl,
json: true
}, function(error, response, body) {
if(error) {
throw error;
}
expect(body).to.be.an('array');
expect(body).to.not.be.empty();
packageList = body;
done();
});
});
it('should validate each listed package', function (done) {
expect(packageList).to.be.an('array');
var invalidPackageCount = 0;
packageList.forEach(function(package) {
try {
bowerJson.validate(package);
} catch(e) {
invalidPackageCount++;
console.error('validation of "' + package.name + '" failed: ' + e.message);
}
});
if(invalidPackageCount) {
throw new Error(invalidPackageCount + '/' + packageList.length + ' package names do not validate');
}
done();
});
});

View File

@@ -0,0 +1,12 @@
root = true
[*]
indent_style = space
indent_size = 4
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
[*.md]
trim_trailing_whitespace = false

2
packages/bower-logger/.gitignore vendored Normal file
View File

@@ -0,0 +1,2 @@
/node_modules
/npm-debug.*

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