From 5f4614ba3fe8148d4158ca8498488280fa0f0361 Mon Sep 17 00:00:00 2001 From: "Rico Sta. Cruz" Date: Mon, 1 Feb 2016 20:10:28 +0800 Subject: [PATCH 1/3] Support windows junctions --- lib/rel_symlink.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/rel_symlink.js b/lib/rel_symlink.js index e1c99575cc..8fc946be26 100644 --- a/lib/rel_symlink.js +++ b/lib/rel_symlink.js @@ -7,6 +7,10 @@ var relative = require('path').relative */ module.exports = function relSymlink (src, dest) { - var rel = relative(dirname(dest), src) - return symlink(rel, dest) + // Turn it into a relative path when not in win32. + var rel = process.platform === 'win32' + ? relative(dirname(dest), src) + : src + + return symlink(rel, dest, 'junction') } From 6c3f4b7e5e2e18bf6b51f77bdd9fec2808ec0191 Mon Sep 17 00:00:00 2001 From: "Rico Sta. Cruz" Date: Mon, 1 Feb 2016 20:11:12 +0800 Subject: [PATCH 2/3] Update docs with windows support --- docs/roadmap.md | 1 + docs/vs-npm.md | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/roadmap.md b/docs/roadmap.md index 7b286030aa..c1d3313ae0 100644 --- a/docs/roadmap.md +++ b/docs/roadmap.md @@ -12,6 +12,7 @@ - [ ] git-hosted packages (`npm i rstacruz/scourjs`) - [ ] optional dependencies (`npm i escodegen@1.8.0` wants `source-map@~0.2.0`) - [ ] file packages (`npm i file:../path`) + - [x] windows support - [x] bin executables - [ ] `--global` installs - [x] `--save` (et al) diff --git a/docs/vs-npm.md b/docs/vs-npm.md index 0a2f22f230..af97d670f9 100644 --- a/docs/vs-npm.md +++ b/docs/vs-npm.md @@ -31,7 +31,6 @@ On the other hand, pnpm manages `node_modules` as an addressable storage in its ## Limitations -- Windows is [not fully supported](https://github.com/rstacruz/pnpm/issues/6) (yet). - You can't install from [shrinkwrap][] (yet). - Peer dependencies are a little trickier to deal with. - You can't publish npm modules with `bundleDependencies` managed by pnpm. From bdaf8cdbf72792eff9aba061e4ce0e01eb5d0cd0 Mon Sep 17 00:00:00 2001 From: "Rico Sta. Cruz" Date: Mon, 1 Feb 2016 20:12:52 +0800 Subject: [PATCH 3/3] Fix symlink support --- lib/rel_symlink.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/rel_symlink.js b/lib/rel_symlink.js index 8fc946be26..1c3c19c8a9 100644 --- a/lib/rel_symlink.js +++ b/lib/rel_symlink.js @@ -8,9 +8,8 @@ var relative = require('path').relative module.exports = function relSymlink (src, dest) { // Turn it into a relative path when not in win32. - var rel = process.platform === 'win32' - ? relative(dirname(dest), src) - : src + var isWindows = process.platform === 'win32' + var rel = isWindows ? src : relative(dirname(dest), src) return symlink(rel, dest, 'junction') }