Commit Graph

70 Commits

Author SHA1 Message Date
Zoltan Kochan
5d04767778 fix: peers are resolved similarly during named and general install (#726)
* fix: peers are resolved similarly during named and general install

There is no need to always run a general installation for
creating a predictable `node_modules` structure. If peers are
resolved from top dependencies, the peers are not linked to
the dependent package. The dependent package can see such peers
w/o additional manipulations

Ref #724

* fix: don't print warning when peer is resolved from top dep

* test: verify the peer warning are reported correctly
2017-04-26 14:40:45 +03:00
zkochan
765a139ede fix: store status doesn't fail on skipped optional deps
A new property called `skipped` added to
`node_modules/.modules.yaml`. The property is an array of
package IDs, of those packages that are optional an were
skipped during installation.

Close #681
2017-04-09 14:06:49 +03:00
zkochan
5a4a46815e feat: rename pnpm verify to pnpm store status
BREAKING CHANGE: `pnpm verify` renamed to `pnpm store status`

BREAKING CHANGE: don't run `pnpm verify` before `pnpm publish`

Ref #430, Ref #658
2017-03-23 21:36:28 +02:00
zkochan
4b02b85f0a feat: when resolution only a shasum, fold the property
Close #664, PR #666
2017-03-19 00:35:10 +02:00
zkochan
686abe864b fix: registry can be passed in via parameter 2017-03-19 00:35:10 +02:00
zkochan
be2b13d6ae feat: smaller shrinkwrap
pkg IDs are shorter for packages hosted on the default registry

Ref #664, PR #666
2017-03-19 00:35:10 +02:00
zkochan
317cac03b6 feat: make shrinkwrap.yaml smaller
Ref #664
2017-03-19 00:35:10 +02:00
zkochan
02145310d3 fix: internal shrinkwrap.yaml not recreated on forced install 2017-03-16 01:42:42 +02:00
zkochan
d3b0bb0c75 feat: use a shrinkwrap file instead of graph.yaml
Ref #658

BREAKING CHANGE: no `node_modules/.graph.yaml` used anymore
2017-03-13 21:23:41 +02:00
zkochan
e1b132789a refactor: use ramda instead of lodash 2017-03-08 01:43:18 +02:00
zkochan
022ba5b96e fix(shrinkwrap): ignore breaking changes on CI server
Breaking changes in `shrinkwrap.yaml` should not fail
installation on CI servers.
2017-03-04 23:21:16 +02:00
zkochan
91849fd88a feat(shrinkwrap): don't save empty shrinkwrap files 2017-03-04 16:07:48 +02:00
zkochan
1a8f7628a4 fix(shrinkwrap): ignore shrinkwrap when it is out of date
BREAKING CHANGE: shrinkwrap format changed

Close #634
2017-03-04 16:07:48 +02:00
zkochan
15402c4803 fix: resolve local-registry config 2017-02-27 00:10:01 +02:00
zkochan
8e034fb4c0 fix: too many open files
`graceful-fs` solves the issue of EMFILE errors. However,
the global fs modules has to be patched.

This same solution is used by npm.

Close #609
2017-02-27 00:09:24 +02:00
Zoltan Kochan
213e92348f perf: filter package dirs asynchronously 2017-02-25 16:17:29 +02:00
zkochan
0cb26a7026 refactor: use a constant graph entry point property 2017-02-20 22:29:20 +02:00
zkochan
3b6ceaaebd refactor: use mkdirp-promise
Ref #441
2017-02-15 23:30:04 +02:00
zkochan
980249cf42 refactor: use link-dir package
Ref #441
2017-02-15 02:44:30 +02:00
zkochan
a73ae78a08 fix(shrinkwrap): don't fail when shrinkwrap misses a resolution 2017-02-14 00:49:43 +02:00
zkochan
b01ca6b98f refactor(shrinkwrap): rename a property in the shrinkwrap error object 2017-02-12 23:28:53 +02:00
zkochan
686b88e223 feat(shrinkwrap): prune shrinkwrap file before saving 2017-02-12 15:59:37 +02:00
zkochan
d8a4e44403 refactor(shrinkwrap): use a nicer YAML format for shrinkwrap.yaml 2017-02-12 14:19:32 +02:00
zkochan
c5faf44f55 refactor(fs): use packages for loading/writing YAML files 2017-02-12 13:25:04 +02:00
zkochan
5169b3725b feat: better shrinkwrap.yaml
Close #587

BREAKING CHANGE:

the `shrinkwrap.yaml` format has been changed
2017-02-12 13:25:04 +02:00
zkochan
8679371b27 fix(package): package.json should not be normalized 2017-02-12 02:41:06 +02:00
zkochan
c40264a9cd refactor: use read-pkg 2017-02-07 01:27:43 +02:00
zkochan
b2decbeced fix: use @zkochan/dirsum instead of dirsum 2017-02-06 20:41:01 +02:00
zkochan
7ac987ea06 feat: save the original shasum of each package in the store
Rel #585
2017-02-05 15:43:10 +02:00
zkochan
32e4130bea refactor: remove preserve-symlinks and flat-tree options
Close #546

BREAKING CHANGE:

Removed preserve-symlinks option

BREAKING CHANGE:

Removed flat-tree option
2017-01-25 22:12:38 +02:00
zkochan
6345c19f95 fix: remove spread-operator usage to support Node 4 2017-01-20 02:26:02 +02:00
Andrey Popp
b035c1d1f9 refactor: provide b/c for shrinkwrap 2017-01-20 01:20:52 +02:00
Andrey Popp
cf729e1a65 refactor: save every resolution to shrinkwrap 2017-01-20 01:20:52 +02:00
Andrey Popp
95f247e123 refactor: make resolvers return {resolution, package}
That removes pkg field from package resolution and we can simplify code which
saves resolution to a shrinkwrap. Also we now can unify package and tarball
resolutions.
2017-01-20 01:20:52 +02:00
Andrey Popp
fd806ac561 refactor: factor out fetch code from resolve
I replaved `ResolveResult` with `Resolution` which is more detailed type, a
discriminated union.

Then I removed `fetch` attribute from `ResolveResult` and moved that logic to
`fetchResolution` function. Thus removing `src/resolve/fetch` module entirely.
2017-01-20 01:20:52 +02:00
zkochan
0619600501 refactor: unite to if statements in hardlinkDir 2017-01-17 01:37:07 +02:00
Andrey Popp
2e49815ca1 refactor: log a warning in case of a broken symlink found 2017-01-17 01:37:07 +02:00
Andrey Popp
48e5a1d1c9 refactor: check for ENOENT in safeLink instead of doing a stat 2017-01-17 01:37:07 +02:00
Andrey Popp
d5f6b09806 fix: filter out broken symlinks when linking installs
We use `fs.lstat()` so we can gather the info about the link itself then use
`fs.exists()` in case of symbolic link to test if symlink is valid. Skip if it's
not.

Fixes #550
2017-01-17 01:37:07 +02:00
zkochan
a7d508782c refactor: move reporters to separate packages 2017-01-16 20:49:18 +02:00
zkochan
a33870b4b9 refactor: use pnpm namespaced logs 2017-01-16 20:49:18 +02:00
zkochan
53f94417e7 feat(log): use ndjson for console output
Close #538
2017-01-16 20:49:18 +02:00
zkochan
8d228124dc fix(install): ignore EEXIST errors when linking
Ref #531
2017-01-10 21:57:40 +02:00
Zoltan Kochan
38837b131c Pure store (#524)
* feat: drop Node.js <= 6.3 support

BREAKING CHANGE:

drop support of Node.js pre-6.3

* refactor: remove the redundant subfolder in store

* refactor: rename linkPeers

* refactor: remove not used code

* feat: link each file separately

* refactor: change store structure

* refactor: resolve github dependencies to commits

* chore(package.json): pass --preserve-symlinks to ts-node

* test: temporarily skip failing tests

* refactor(git): use more human-friendly Git IDs

* refactor: resolve

* refactor: divide resolution and fetching

* refactor(fetch): better variable naming

* feat: add shrinkwrap.yaml

* test(shrinkwrap): shrinkwrap locks dependencies

* style: fix typing issue

* fix(fetch): properly link node_modules on repeat install

* refactor: comment skipped test with single-line comments

* fix: circular symlinks are avoided

* refactor(fetch): remove redundant type properties

* test: additional check for circular symlinks

* feat: saving dependency graph in node_modules instead of in store

BREAKING CHANGE:

Dependency graph moved out from store

* feat: add store.yaml with info about dependent projects

* refactor: remove name from FetchedPackage

* refactor: change the location of packages from npm in store

BREAKING CHANGE:

Structure of store changed

* refactor: change global store path

BREAKING CHANGE:

Move the store path out of ~/.pnpm

* refactor: remove justFetched from FetchedPackage

* refactor(install): use functional programming to filter deps

* refactor(install): remove redundant node_modules creation

* fix(install): installation of concurent circular dependencies

* feat: copy not link some packages

Packages that have install lifecycle events are copied not linked.

* fix(store.yaml): don't duplicate records

* perf: resolve a package only once per project

* test: concurrent installation of the same dependency

* fix: packages are not removed in the middle of fetch

* fix: dependencies are linked only once

* fix: make linking work on Windows

* fix: installing local dependencies on Windows

* fix: don't reinstall dependencies of the same package

* fix(bin): the run function always returns a Promise

* fix: use hard links to link files to the .resolutions folder

* fix: peers are linked into the correct location

* fix: bundled dependencies are not reinstalled

* refactor: remove unsymlink

It is not used anymore

* chore(CI): test on Node.js v4 as well

* refactor: use UPPER_CASE for constants

* chore(package): return support of Node.js v4

* fix: make pnpm Node.js 4 compatible again

* test: don't run tsnode with --preserve-symlinks

--preserve-symlinks makes tests fail on Node.js 4

* fix(bin): don't use --preserve-symlinks on Node pre-6.3

* test: use global stores in tests

* fix: flat-tree installation should not work on Node 4

* fix: show warning

When trying to install into a node_modules created by older pnpm

* refactor: change the global store location

From `~/.store` to `~/.pnpm-store`

* docs: note that some of the info is out of date

* test: fix typing error

* test: fix frequently failing test
2017-01-08 15:47:50 +02:00
Zoltan Kochan
0e368ae6b1 refactor(*.ts): use definition packages 2016-11-22 06:43:45 -08:00
Zoltan Kochan
e1cea455f5 chore: update typescript 2016-11-20 10:40:18 -08:00
zkochan
5a8ac720a6 refactor: sort keys in yaml files: 2016-11-18 07:30:36 -08:00
zkochan
78f74f75b3 fix: peers linking on Node.js >= 6.3.0
Close #433
2016-10-28 02:11:05 +03:00
zkochan
26fbe5dd51 perf: read pkg json files asynchronously
Use load-json-file and mem
2016-10-22 21:02:07 +03:00
Zoltan Kochan
163d6b9a72 refactor: use write-pkg 2016-10-22 17:06:13 +03:00