Commit Graph

104 Commits

Author SHA1 Message Date
zkochan
124d9c7368 fix(scripts): run prepublish only on argumentless install
Close #396
2016-10-06 22:11:00 +03:00
zkochan
647b305291 fix(cli): return a non-zero status code on errors
When a command is passed through to npm, return the status code
that was returned by it.

Close #402
2016-10-06 21:37:04 +03:00
zkochan
38dc0f99c1 fix(scripts): build native addons 2016-10-05 22:30:23 +03:00
zkochan
d4400482de fix(install): always try to install a newer version
Close #390
2016-10-04 01:22:56 +03:00
zkochan
d9ffb73f0e fix(uninstall): keep subdeps if they are required by the package
Close #391
2016-10-03 23:01:59 +03:00
zkochan
beb8835224 feat(install): support the force parameter 2016-10-02 23:28:24 +03:00
zkochan
1f99193656 fix(install): overwriting removes the previous version
If a different version of a package is installed, the previous
version should be removed from the store if no other package is
dependent on it.
2016-10-02 01:31:38 +03:00
Zoltan Kochan
aa71a3e01b refactor(tests): quiet by default and use API for testing 2016-09-29 12:33:18 +03:00
zkochan
816345a8c5 feat(api): make the install API consistent with other API functions
BREAKING CHANGE:

The `installPkgDeps` API function is now called `install`.

The old `install` is renamed to `installPkgs`. Unlike the old `install`,
`installPkgs` does nothing, if the `pkgs` array contains no elements.
2016-09-29 00:26:18 +03:00
Zoltan Kochan
5d1b4fb203 test: use the official registry for e2e tests 2016-09-28 20:30:24 +03:00
zkochan
df05c83757 refactor(prune): move the overload of prune to a separate function
Divide the logic of prune into two functions: prune and prunePkgs.

PR #372
2016-09-27 00:02:10 +03:00
zkochan
0dfe73fd48 refactor(tests): use async exists checks
PR #372
2016-09-27 00:02:10 +03:00
zkochan
c27b8ddf48 feat: prune
Close #299
2016-09-27 00:02:10 +03:00
zkochan
40621818bc fix(uninstall): dependencies from all sources can be deleted
pnpm uninstall could not always link the dependency name to the
dependency ID (used in the store). To solve this issue, a dependency
name to ID map is added to the dependencies section of `store.json`.

PR #371

BREAKING CHANGE:

The structure of the `store.json` has been changed.

Previously the dependencies property contained just a list of
dependency IDs. E.g.:

```json
{
  "dependencies": {
    "math": [
      "sum@1.0.0",
      "@zkochan+max@2.1.0"
    ]
  }
}
```

With this structure it was hard to link the dependencies to their IDs.
The new structure uses a map which links the dependency to its ID:

```json
{
  "dependencies": {
    "map": {
      "sum": "sum@1.0.0",
      "@zkochan/max": "@zkochan+max@2.1.0"
    }
  }
}
```

Unfortunately the stores created by older version of pnpm are not usable
after this breaking change. They have to be removed before using the new
version of pnpm.
2016-09-25 21:28:47 +03:00
zkochan
0993635003 refactor(tests): use async/await 2016-09-25 18:26:29 +03:00
zkochan
138440ce1f refactor(tests): divide tests into several files 2016-09-25 17:22:53 +03:00
zkochan
f33e9b8341 feat: support dependencies from GIT
Close #285, PR #366
2016-09-21 23:07:50 +03:00
zkochan
34394b9485 feat: add an option to make local dependencies linked
If the link-local config key is true, local dependencies are
not copy-pasted into the store but linked to the node_modules
folder.

This option makes pnpm suitable for usage in monorepos.

Ref #349
2016-09-18 00:21:56 +03:00
zkochan
7925b64f91 fix(install): GitHub API rate limit issue
GitHub API usage removed. The tarball is used from codeload.github.com

Close #361, PR #363

BREAKING CHANGE:

The folder names of packages fetched from GitHub changed to not contain
information that would require an API request to get.

Old folder name: is-negative@github+kevva+is-negative+HEAD

New folder name: github+kevva+is-negative+HEAD

Users are forced to redownload their stores to avoid orphan folders after
the naming change.
2016-09-17 19:41:23 +03:00
zkochan
ab4c89f3d3 refactor: rewrite the bin file to TypeScript 2016-09-14 22:54:09 +03:00
zkochan
f2b0960f8a style(*.ts): .ts files have camelCase names 2016-09-14 22:06:28 +03:00
Zoltan Kochan
554e8ccb6e refactor(tests): rewrite tests to TypeScript 2016-09-14 21:37:47 +03:00
Zoltan Kochan
7b25ba269e feat: rewrite to TypeScript
PR #357, Ref #347
2016-09-12 22:00:56 +03:00
Zoltan Kochan
d97f9f0083 fix: failing to install some tarball dependencies
close #351
2016-09-07 10:07:36 +03:00
Zoltan Kochan
e1abc46bd1 feat: create a pnpm-debug.log file on fail
close #336
2016-09-03 23:57:34 +03:00
Zoltan Kochan
053b717d28 test: skip GitHub tests on CI servers
Tests that make requests to GitHub frequently fail
because they exceed the rate limit
2016-09-01 01:39:44 +03:00
Zoltan Kochan
1b82eecc67 fix: installation should not fail when peer has no version
Expose the version when possible, but the installation shouldn't
fail even when one of the peer dependencies have no version.

close #293, PR #333
2016-08-31 11:02:02 +03:00
Zoltan Kochan
d89b35c6e8 feat(install): install from local packages
close #301, PR #331
2016-08-31 10:55:44 +03:00
Zoltan Kochan
94de1f8e84 refactor(tests): instead of random temp dir names, use date
It is easier to debug when the folders are sorted
2016-08-31 00:12:19 +03:00
Zoltan Kochan
1f37f18ab4 fix(install): local subdependencies are installed
PR #332
2016-08-30 21:36:13 +03:00
Zoltan Kochan
81e7dffed3 refactor(tests): show meaningful error message instead of timeout fail 2016-08-30 20:47:36 +03:00
Zoltan Kochan
875656fc4e test: retry fetch more 2016-08-28 16:53:56 +03:00
Zoltan Kochan
1f38086088 feat: support the npm fetch-* configs
Use the retry package to support all the different
retry strategy configurations that can be used with npm:

fetch-retries
fetch-retry-factor
fetch-retry-mintimeout
fetch-retry-maxtimeout

More info about the configs: https://docs.npmjs.com/misc/config#fetch-retries

close #317, PR #327
2016-08-27 21:37:00 +03:00
Andrey Popp
5205deeb6a test(install): test scoped package from local dir
Ref: #325, PR #326
2016-08-26 23:00:46 +03:00
Zoltan Kochan
31346e6c4a refactor: use global npm in shrinkwrap test
Remove the npm devDependency and use the global instance of npm
in the shrinkwrap test.
2016-08-23 23:11:00 +03:00
Zoltan Kochan
9bc97e76d4 style: use more ES6 syntax
Use lebab to transpile ES5 code to ES6.
Use eslint to fix styling issues afterwards.
Run all js in strict mode to allow let/const
in Node 4.
2016-08-23 21:12:01 +03:00
Zoltan Kochan
83b1e6a34b Implement pnpm link (#302)
close #235
2016-08-19 18:33:55 +03:00
Zoltan Kochan
9950c02ca4 Fix uninstall API function, test the API 2016-08-16 17:26:44 +03:00
Zoltan Kochan
46bcdac831 Add a public API
No breaking changes. An additional function exposed for package dependencies installation.

close #125
2016-08-16 14:54:56 +03:00
Zoltan Kochan
a45a3fbdd9 Support global install (#288)
close #283
2016-08-14 18:19:09 +03:00
Zoltan Kochan
5a9e972ed6 Make the locking tests more reliable, cover the CLI with tests 2016-08-11 00:50:55 +03:00
Zoltan Kochan
b9b1f0fa52 Test executables
Test if executables in .bin workd correctly. Refactor tests that are using local packages.
2016-08-09 23:45:18 +03:00
Zoltan Kochan
5e34ee61e5 Covering preserved symlinks with tests
Test only on NodeJS >= 6.3.0

Fix preserved symlinkg on Windows
2016-08-09 19:45:35 +03:00
Zoltan Kochan
a9afddacfd Read package.json before updating (#284)
* Read package.json before updating

Using the cached version of package.json can cause ovewriting of changes

close #280

* Skip GitHub test on CI

The GitHub test fails frequently with 403 error with no good no reason
2016-08-09 20:33:39 +03:00
Zoltan Kochan
8675c7f641 Remove bin files when uninstalling package 2016-08-07 14:31:33 +03:00
Zoltan Kochan
0c247a1f4c Lock store when running commands
close #82
2016-08-07 14:31:33 +03:00
Zoltan Kochan
0b1264a372 Uninstall support
close #144
2016-08-07 14:31:33 +03:00
Zoltan Kochan
f5d740fcaf Add test for installing from github 2016-08-07 14:26:28 +03:00
Zoltan Kochan
a750d3f78f Fix postinstall script execution, cover with unit test 2016-08-07 14:26:11 +03:00
Zoltan Kochan
37a91b8aa0 Add coverage info 2016-08-07 14:25:34 +03:00