From c776db1a7d2800325c1dc95475197b06ca47514b Mon Sep 17 00:00:00 2001 From: Zoltan Kochan Date: Mon, 22 Jun 2020 01:40:24 +0300 Subject: [PATCH] fix: pnpm list --long --- .changeset/clean-rules-dress.md | 7 + .../circular/package.json | 0 .../circular/pnpm-lock.yaml | 2 +- .../list/test => fixtures}/empty/package.json | 0 .../pkg/.npmrc | 0 .../pkg/package.json | 0 .../pnpm-lock.yaml | 2 +- .../pnpm-workspace.yaml | 0 .../package.json | 0 .../pnpm-lock.yaml | 0 .../fixture-with-no-pkg-version/package.json | 0 .../pnpm-lock.yaml | 0 .../test => fixtures}/fixture/package.json | 0 .../test => fixtures}/fixture/pnpm-lock.yaml | 0 .../fixtureWithLinks/.npmrc | 0 .../fixtureWithLinks/general/package.json | 0 .../fixtureWithLinks/general/pnpm-lock.yaml | 2 +- .../fixtureWithLinks/pnpm-workspace.yaml | 0 .../with-links-only/package.json | 0 .../with-links-only/pnpm-lock.yaml | 0 .../general/package.json | 0 .../general/pnpm-lock.yaml | 2 +- .../node_modules/.modules.yaml | 17 ++ .../node_modules/.pnpm/lock.yaml | 4 +- .../node_modules/is-negative | 1 + .../node_modules/is-positive | 1 + fixtures/has-not-outdated-deps/pnpm-lock.yaml | 4 +- .../monorepo}/.npmrc | 0 .../monorepo}/package/package.json | 0 .../monorepo}/pnpm-lock.yaml | 0 .../monorepo}/pnpm-workspace.yaml | 0 fixtures/package.yaml | 5 + fixtures/pnpm-workspace.yaml | 10 +- .../with-aliased-dep/package.json | 0 .../with-aliased-dep/pnpm-lock.yaml | 0 .../with-file-dep/package.json | 0 .../with-file-dep/pnpm-lock.yaml | 2 +- .../with-peer/package.json | 0 .../with-peer/pnpm-lock.yaml | 0 fixtures/with-unsaved-deps/.npmrc | 2 + .../with-unsaved-deps/package.json | 0 .../with-unsaved-deps/pnpm-lock.yaml | 2 +- package.json | 2 +- .../fixtureMonorepo/.gitignore | 1 - .../node_modules/.modules.yaml | 15 -- .../node_modules/.shrinkwrap.yaml | 14 -- .../dependencies-hierarchy/fixtures/.npmrc | 3 - .../fixtures/with-unsaved-deps/.gitignore | 6 - .../node_modules/is-positive/index.js | 4 - .../node_modules/is-positive/license | 21 -- .../node_modules/is-positive/package.json | 63 ----- .../node_modules/is-positive/readme.md | 44 ---- packages/dependencies-hierarchy/package.json | 2 +- packages/dependencies-hierarchy/src/index.ts | 12 +- .../test/circularTree.json | 42 ++-- packages/dependencies-hierarchy/test/index.ts | 51 ++-- .../.gitignore | 1 - .../node_modules/.modules.yaml | 13 - .../node_modules/.pnpm/lock.yaml | 14 -- .../1.0.0/node_modules/is-positive/index.js | 9 - .../1.0.0/node_modules/is-positive/license | 21 -- .../node_modules/is-positive/package.json | 29 --- .../1.0.0/node_modules/is-positive/readme.md | 31 --- .../pkg/node_modules/is-positive | 1 - .../.gitignore | 1 - .../node_modules/.modules.yaml | 11 - .../node_modules/.pnpm/lock.yaml | 94 ------- .../1.3.0/node_modules/make-dir/index.js | 85 ------- .../1.3.0/node_modules/make-dir/license | 9 - .../1.3.0/node_modules/make-dir/package.json | 54 ---- .../1.3.0/node_modules/make-dir/readme.md | 116 --------- .../make-dir/1.3.0/node_modules/pify | 1 - .../sort-keys/2.0.0/node_modules/is-plain-obj | 1 - .../2.0.0/node_modules/sort-keys/index.js | 55 ---- .../2.0.0/node_modules/sort-keys/license | 9 - .../2.0.0/node_modules/sort-keys/package.json | 40 --- .../2.0.0/node_modules/sort-keys/readme.md | 60 ----- .../2.4.3/node_modules/graceful-fs | 1 - .../2.4.3/node_modules/imurmurhash | 1 - .../2.4.3/node_modules/signal-exit | 1 - .../write-file-atomic/CHANGELOG.md | 25 -- .../node_modules/write-file-atomic/LICENSE | 6 - .../node_modules/write-file-atomic/README.md | 56 ----- .../node_modules/write-file-atomic/index.js | 238 ------------------ .../write-file-atomic/package.json | 41 --- .../2.3.0/node_modules/detect-indent | 1 - .../2.3.0/node_modules/graceful-fs | 1 - .../2.3.0/node_modules/make-dir | 1 - .../write-json-file/2.3.0/node_modules/pify | 1 - .../2.3.0/node_modules/sort-keys | 1 - .../2.3.0/node_modules/write-file-atomic | 1 - .../node_modules/write-json-file/index.js | 73 ------ .../node_modules/write-json-file/license | 9 - .../node_modules/write-json-file/package.json | 48 ---- .../node_modules/write-json-file/readme.md | 83 ------ .../node_modules/is-negative | 1 - .../node_modules/is-positive | 1 - .../node_modules/write-json-file | 1 - .../fixture-with-no-pkg-version/.gitignore | 1 - .../node_modules/.modules.yaml | 11 - .../node_modules/.pnpm/lock.yaml | 94 ------- .../1.3.0/node_modules/make-dir/index.js | 85 ------- .../1.3.0/node_modules/make-dir/license | 9 - .../1.3.0/node_modules/make-dir/package.json | 54 ---- .../1.3.0/node_modules/make-dir/readme.md | 116 --------- .../make-dir/1.3.0/node_modules/pify | 1 - .../sort-keys/2.0.0/node_modules/is-plain-obj | 1 - .../2.0.0/node_modules/sort-keys/index.js | 55 ---- .../2.0.0/node_modules/sort-keys/license | 9 - .../2.0.0/node_modules/sort-keys/package.json | 40 --- .../2.0.0/node_modules/sort-keys/readme.md | 60 ----- .../2.4.3/node_modules/graceful-fs | 1 - .../2.4.3/node_modules/imurmurhash | 1 - .../2.4.3/node_modules/signal-exit | 1 - .../write-file-atomic/CHANGELOG.md | 25 -- .../node_modules/write-file-atomic/LICENSE | 6 - .../node_modules/write-file-atomic/README.md | 56 ----- .../node_modules/write-file-atomic/index.js | 238 ------------------ .../write-file-atomic/package.json | 41 --- .../2.3.0/node_modules/detect-indent | 1 - .../2.3.0/node_modules/graceful-fs | 1 - .../2.3.0/node_modules/make-dir | 1 - .../write-json-file/2.3.0/node_modules/pify | 1 - .../2.3.0/node_modules/sort-keys | 1 - .../2.3.0/node_modules/write-file-atomic | 1 - .../node_modules/write-json-file/index.js | 73 ------ .../node_modules/write-json-file/license | 9 - .../node_modules/write-json-file/package.json | 48 ---- .../node_modules/write-json-file/readme.md | 83 ------ .../node_modules/is-negative | 1 - .../node_modules/is-positive | 1 - .../node_modules/write-json-file | 1 - packages/list/test/fixture/.gitignore | 1 - .../test/fixture/node_modules/.modules.yaml | 11 - .../test/fixture/node_modules/.pnpm/lock.yaml | 94 ------- .../1.3.0/node_modules/make-dir/index.js | 85 ------- .../1.3.0/node_modules/make-dir/license | 9 - .../1.3.0/node_modules/make-dir/package.json | 54 ---- .../1.3.0/node_modules/make-dir/readme.md | 116 --------- .../make-dir/1.3.0/node_modules/pify | 1 - .../sort-keys/2.0.0/node_modules/is-plain-obj | 1 - .../2.0.0/node_modules/sort-keys/index.js | 55 ---- .../2.0.0/node_modules/sort-keys/license | 9 - .../2.0.0/node_modules/sort-keys/package.json | 40 --- .../2.0.0/node_modules/sort-keys/readme.md | 60 ----- .../2.4.3/node_modules/graceful-fs | 1 - .../2.4.3/node_modules/imurmurhash | 1 - .../2.4.3/node_modules/signal-exit | 1 - .../write-file-atomic/CHANGELOG.md | 25 -- .../node_modules/write-file-atomic/LICENSE | 6 - .../node_modules/write-file-atomic/README.md | 56 ----- .../node_modules/write-file-atomic/index.js | 238 ------------------ .../write-file-atomic/package.json | 41 --- .../2.3.0/node_modules/detect-indent | 1 - .../2.3.0/node_modules/graceful-fs | 1 - .../2.3.0/node_modules/make-dir | 1 - .../write-json-file/2.3.0/node_modules/pify | 1 - .../2.3.0/node_modules/sort-keys | 1 - .../2.3.0/node_modules/write-file-atomic | 1 - .../node_modules/write-json-file/index.js | 73 ------ .../node_modules/write-json-file/license | 9 - .../node_modules/write-json-file/package.json | 48 ---- .../node_modules/write-json-file/readme.md | 83 ------ .../test/fixture/node_modules/is-negative | 1 - .../test/fixture/node_modules/is-positive | 1 - .../test/fixture/node_modules/write-json-file | 1 - packages/list/test/index.ts | 99 ++++---- .../list/test/with-aliased-dep/.gitignore | 1 - .../.ignored_positive/package.json | 29 --- .../node_modules/.modules.yaml | 11 - .../node_modules/.pnpm/lock.yaml | 12 - .../node_modules/is-positive/package.json | 29 --- .../with-aliased-dep/node_modules/positive | 1 - .../list/test/with-aliased-dep/package.json | 7 - .../list/test/with-aliased-dep/pnpm-lock.yaml | 12 - pnpm-lock.yaml | 2 + 176 files changed, 161 insertions(+), 3885 deletions(-) create mode 100644 .changeset/clean-rules-dress.md rename {packages/dependencies-hierarchy/fixtures => fixtures}/circular/package.json (100%) rename {packages/dependencies-hierarchy/fixtures => fixtures}/circular/pnpm-lock.yaml (97%) rename {packages/list/test => fixtures}/empty/package.json (100%) rename {packages/list/test => fixtures}/fixture-with-external-shrinkwrap/pkg/.npmrc (100%) rename {packages/list/test => fixtures}/fixture-with-external-shrinkwrap/pkg/package.json (100%) rename {packages/list/test => fixtures}/fixture-with-external-shrinkwrap/pnpm-lock.yaml (92%) rename {packages/dependencies-hierarchy/fixtureMonorepo => fixtures/fixture-with-external-shrinkwrap}/pnpm-workspace.yaml (100%) rename {packages/list/test => fixtures}/fixture-with-no-pkg-name-and-no-version/package.json (100%) rename {packages/list/test => fixtures}/fixture-with-no-pkg-name-and-no-version/pnpm-lock.yaml (100%) rename {packages/list/test => fixtures}/fixture-with-no-pkg-version/package.json (100%) rename {packages/list/test => fixtures}/fixture-with-no-pkg-version/pnpm-lock.yaml (100%) rename {packages/list/test => fixtures}/fixture/package.json (100%) rename {packages/list/test => fixtures}/fixture/pnpm-lock.yaml (100%) rename {packages/dependencies-hierarchy => fixtures}/fixtureWithLinks/.npmrc (100%) rename {packages/dependencies-hierarchy => fixtures}/fixtureWithLinks/general/package.json (100%) rename {packages/dependencies-hierarchy => fixtures}/fixtureWithLinks/general/pnpm-lock.yaml (99%) rename {packages/dependencies-hierarchy => fixtures}/fixtureWithLinks/pnpm-workspace.yaml (100%) rename {packages/dependencies-hierarchy => fixtures}/fixtureWithLinks/with-links-only/package.json (100%) rename {packages/dependencies-hierarchy => fixtures}/fixtureWithLinks/with-links-only/pnpm-lock.yaml (100%) rename {packages/dependencies-hierarchy/fixtures => fixtures}/general/package.json (100%) rename {packages/dependencies-hierarchy/fixtures => fixtures}/general/pnpm-lock.yaml (99%) create mode 100644 fixtures/has-not-outdated-deps/node_modules/.modules.yaml create mode 120000 fixtures/has-not-outdated-deps/node_modules/is-negative create mode 120000 fixtures/has-not-outdated-deps/node_modules/is-positive rename {packages/dependencies-hierarchy/fixtureMonorepo => fixtures/monorepo}/.npmrc (100%) rename {packages/dependencies-hierarchy/fixtureMonorepo => fixtures/monorepo}/package/package.json (100%) rename {packages/dependencies-hierarchy/fixtureMonorepo => fixtures/monorepo}/pnpm-lock.yaml (100%) rename {packages/dependencies-hierarchy/fixtures => fixtures/monorepo}/pnpm-workspace.yaml (100%) create mode 100644 fixtures/package.yaml rename {packages/dependencies-hierarchy/fixtures => fixtures}/with-aliased-dep/package.json (100%) rename {packages/dependencies-hierarchy/fixtures => fixtures}/with-aliased-dep/pnpm-lock.yaml (100%) rename {packages/dependencies-hierarchy/fixtures => fixtures}/with-file-dep/package.json (100%) rename {packages/dependencies-hierarchy/fixtures => fixtures}/with-file-dep/pnpm-lock.yaml (92%) rename {packages/dependencies-hierarchy/fixtures => fixtures}/with-peer/package.json (100%) rename {packages/dependencies-hierarchy/fixtures => fixtures}/with-peer/pnpm-lock.yaml (100%) create mode 100644 fixtures/with-unsaved-deps/.npmrc rename {packages/dependencies-hierarchy/fixtures => fixtures}/with-unsaved-deps/package.json (100%) rename {packages/dependencies-hierarchy/fixtures => fixtures}/with-unsaved-deps/pnpm-lock.yaml (99%) delete mode 100644 packages/dependencies-hierarchy/fixtureMonorepo/.gitignore delete mode 100644 packages/dependencies-hierarchy/fixtureMonorepo/node_modules/.modules.yaml delete mode 100644 packages/dependencies-hierarchy/fixtureMonorepo/node_modules/.shrinkwrap.yaml delete mode 100644 packages/dependencies-hierarchy/fixtures/.npmrc delete mode 100644 packages/dependencies-hierarchy/fixtures/with-unsaved-deps/.gitignore delete mode 100644 packages/dependencies-hierarchy/fixtures/with-unsaved-deps/node_modules/is-positive/index.js delete mode 100644 packages/dependencies-hierarchy/fixtures/with-unsaved-deps/node_modules/is-positive/license delete mode 100644 packages/dependencies-hierarchy/fixtures/with-unsaved-deps/node_modules/is-positive/package.json delete mode 100644 packages/dependencies-hierarchy/fixtures/with-unsaved-deps/node_modules/is-positive/readme.md delete mode 100644 packages/list/test/fixture-with-external-shrinkwrap/.gitignore delete mode 100644 packages/list/test/fixture-with-external-shrinkwrap/node_modules/.modules.yaml delete mode 100644 packages/list/test/fixture-with-external-shrinkwrap/node_modules/.pnpm/lock.yaml delete mode 100644 packages/list/test/fixture-with-external-shrinkwrap/node_modules/.pnpm/registry.npmjs.org/is-positive/1.0.0/node_modules/is-positive/index.js delete mode 100644 packages/list/test/fixture-with-external-shrinkwrap/node_modules/.pnpm/registry.npmjs.org/is-positive/1.0.0/node_modules/is-positive/license delete mode 100644 packages/list/test/fixture-with-external-shrinkwrap/node_modules/.pnpm/registry.npmjs.org/is-positive/1.0.0/node_modules/is-positive/package.json delete mode 100644 packages/list/test/fixture-with-external-shrinkwrap/node_modules/.pnpm/registry.npmjs.org/is-positive/1.0.0/node_modules/is-positive/readme.md delete mode 120000 packages/list/test/fixture-with-external-shrinkwrap/pkg/node_modules/is-positive delete mode 100644 packages/list/test/fixture-with-no-pkg-name-and-no-version/.gitignore delete mode 100644 packages/list/test/fixture-with-no-pkg-name-and-no-version/node_modules/.modules.yaml delete mode 100644 packages/list/test/fixture-with-no-pkg-name-and-no-version/node_modules/.pnpm/lock.yaml delete mode 100644 packages/list/test/fixture-with-no-pkg-name-and-no-version/node_modules/.pnpm/registry.npmjs.org/make-dir/1.3.0/node_modules/make-dir/index.js delete mode 100644 packages/list/test/fixture-with-no-pkg-name-and-no-version/node_modules/.pnpm/registry.npmjs.org/make-dir/1.3.0/node_modules/make-dir/license delete mode 100644 packages/list/test/fixture-with-no-pkg-name-and-no-version/node_modules/.pnpm/registry.npmjs.org/make-dir/1.3.0/node_modules/make-dir/package.json delete mode 100644 packages/list/test/fixture-with-no-pkg-name-and-no-version/node_modules/.pnpm/registry.npmjs.org/make-dir/1.3.0/node_modules/make-dir/readme.md delete mode 120000 packages/list/test/fixture-with-no-pkg-name-and-no-version/node_modules/.pnpm/registry.npmjs.org/make-dir/1.3.0/node_modules/pify delete mode 120000 packages/list/test/fixture-with-no-pkg-name-and-no-version/node_modules/.pnpm/registry.npmjs.org/sort-keys/2.0.0/node_modules/is-plain-obj delete mode 100644 packages/list/test/fixture-with-no-pkg-name-and-no-version/node_modules/.pnpm/registry.npmjs.org/sort-keys/2.0.0/node_modules/sort-keys/index.js delete mode 100644 packages/list/test/fixture-with-no-pkg-name-and-no-version/node_modules/.pnpm/registry.npmjs.org/sort-keys/2.0.0/node_modules/sort-keys/license delete mode 100644 packages/list/test/fixture-with-no-pkg-name-and-no-version/node_modules/.pnpm/registry.npmjs.org/sort-keys/2.0.0/node_modules/sort-keys/package.json delete mode 100644 packages/list/test/fixture-with-no-pkg-name-and-no-version/node_modules/.pnpm/registry.npmjs.org/sort-keys/2.0.0/node_modules/sort-keys/readme.md delete mode 120000 packages/list/test/fixture-with-no-pkg-name-and-no-version/node_modules/.pnpm/registry.npmjs.org/write-file-atomic/2.4.3/node_modules/graceful-fs delete mode 120000 packages/list/test/fixture-with-no-pkg-name-and-no-version/node_modules/.pnpm/registry.npmjs.org/write-file-atomic/2.4.3/node_modules/imurmurhash delete mode 120000 packages/list/test/fixture-with-no-pkg-name-and-no-version/node_modules/.pnpm/registry.npmjs.org/write-file-atomic/2.4.3/node_modules/signal-exit delete mode 100644 packages/list/test/fixture-with-no-pkg-name-and-no-version/node_modules/.pnpm/registry.npmjs.org/write-file-atomic/2.4.3/node_modules/write-file-atomic/CHANGELOG.md delete mode 100644 packages/list/test/fixture-with-no-pkg-name-and-no-version/node_modules/.pnpm/registry.npmjs.org/write-file-atomic/2.4.3/node_modules/write-file-atomic/LICENSE delete mode 100644 packages/list/test/fixture-with-no-pkg-name-and-no-version/node_modules/.pnpm/registry.npmjs.org/write-file-atomic/2.4.3/node_modules/write-file-atomic/README.md delete mode 100644 packages/list/test/fixture-with-no-pkg-name-and-no-version/node_modules/.pnpm/registry.npmjs.org/write-file-atomic/2.4.3/node_modules/write-file-atomic/index.js delete mode 100644 packages/list/test/fixture-with-no-pkg-name-and-no-version/node_modules/.pnpm/registry.npmjs.org/write-file-atomic/2.4.3/node_modules/write-file-atomic/package.json delete mode 120000 packages/list/test/fixture-with-no-pkg-name-and-no-version/node_modules/.pnpm/registry.npmjs.org/write-json-file/2.3.0/node_modules/detect-indent delete mode 120000 packages/list/test/fixture-with-no-pkg-name-and-no-version/node_modules/.pnpm/registry.npmjs.org/write-json-file/2.3.0/node_modules/graceful-fs delete mode 120000 packages/list/test/fixture-with-no-pkg-name-and-no-version/node_modules/.pnpm/registry.npmjs.org/write-json-file/2.3.0/node_modules/make-dir delete mode 120000 packages/list/test/fixture-with-no-pkg-name-and-no-version/node_modules/.pnpm/registry.npmjs.org/write-json-file/2.3.0/node_modules/pify delete mode 120000 packages/list/test/fixture-with-no-pkg-name-and-no-version/node_modules/.pnpm/registry.npmjs.org/write-json-file/2.3.0/node_modules/sort-keys delete mode 120000 packages/list/test/fixture-with-no-pkg-name-and-no-version/node_modules/.pnpm/registry.npmjs.org/write-json-file/2.3.0/node_modules/write-file-atomic delete mode 100644 packages/list/test/fixture-with-no-pkg-name-and-no-version/node_modules/.pnpm/registry.npmjs.org/write-json-file/2.3.0/node_modules/write-json-file/index.js delete mode 100644 packages/list/test/fixture-with-no-pkg-name-and-no-version/node_modules/.pnpm/registry.npmjs.org/write-json-file/2.3.0/node_modules/write-json-file/license delete mode 100644 packages/list/test/fixture-with-no-pkg-name-and-no-version/node_modules/.pnpm/registry.npmjs.org/write-json-file/2.3.0/node_modules/write-json-file/package.json delete mode 100644 packages/list/test/fixture-with-no-pkg-name-and-no-version/node_modules/.pnpm/registry.npmjs.org/write-json-file/2.3.0/node_modules/write-json-file/readme.md delete mode 120000 packages/list/test/fixture-with-no-pkg-name-and-no-version/node_modules/is-negative delete mode 120000 packages/list/test/fixture-with-no-pkg-name-and-no-version/node_modules/is-positive delete mode 120000 packages/list/test/fixture-with-no-pkg-name-and-no-version/node_modules/write-json-file delete mode 100644 packages/list/test/fixture-with-no-pkg-version/.gitignore delete mode 100644 packages/list/test/fixture-with-no-pkg-version/node_modules/.modules.yaml delete mode 100644 packages/list/test/fixture-with-no-pkg-version/node_modules/.pnpm/lock.yaml delete mode 100644 packages/list/test/fixture-with-no-pkg-version/node_modules/.pnpm/registry.npmjs.org/make-dir/1.3.0/node_modules/make-dir/index.js delete mode 100644 packages/list/test/fixture-with-no-pkg-version/node_modules/.pnpm/registry.npmjs.org/make-dir/1.3.0/node_modules/make-dir/license delete mode 100644 packages/list/test/fixture-with-no-pkg-version/node_modules/.pnpm/registry.npmjs.org/make-dir/1.3.0/node_modules/make-dir/package.json delete mode 100644 packages/list/test/fixture-with-no-pkg-version/node_modules/.pnpm/registry.npmjs.org/make-dir/1.3.0/node_modules/make-dir/readme.md delete mode 120000 packages/list/test/fixture-with-no-pkg-version/node_modules/.pnpm/registry.npmjs.org/make-dir/1.3.0/node_modules/pify delete mode 120000 packages/list/test/fixture-with-no-pkg-version/node_modules/.pnpm/registry.npmjs.org/sort-keys/2.0.0/node_modules/is-plain-obj delete mode 100644 packages/list/test/fixture-with-no-pkg-version/node_modules/.pnpm/registry.npmjs.org/sort-keys/2.0.0/node_modules/sort-keys/index.js delete mode 100644 packages/list/test/fixture-with-no-pkg-version/node_modules/.pnpm/registry.npmjs.org/sort-keys/2.0.0/node_modules/sort-keys/license delete mode 100644 packages/list/test/fixture-with-no-pkg-version/node_modules/.pnpm/registry.npmjs.org/sort-keys/2.0.0/node_modules/sort-keys/package.json delete mode 100644 packages/list/test/fixture-with-no-pkg-version/node_modules/.pnpm/registry.npmjs.org/sort-keys/2.0.0/node_modules/sort-keys/readme.md delete mode 120000 packages/list/test/fixture-with-no-pkg-version/node_modules/.pnpm/registry.npmjs.org/write-file-atomic/2.4.3/node_modules/graceful-fs delete mode 120000 packages/list/test/fixture-with-no-pkg-version/node_modules/.pnpm/registry.npmjs.org/write-file-atomic/2.4.3/node_modules/imurmurhash delete mode 120000 packages/list/test/fixture-with-no-pkg-version/node_modules/.pnpm/registry.npmjs.org/write-file-atomic/2.4.3/node_modules/signal-exit delete mode 100644 packages/list/test/fixture-with-no-pkg-version/node_modules/.pnpm/registry.npmjs.org/write-file-atomic/2.4.3/node_modules/write-file-atomic/CHANGELOG.md delete mode 100644 packages/list/test/fixture-with-no-pkg-version/node_modules/.pnpm/registry.npmjs.org/write-file-atomic/2.4.3/node_modules/write-file-atomic/LICENSE delete mode 100644 packages/list/test/fixture-with-no-pkg-version/node_modules/.pnpm/registry.npmjs.org/write-file-atomic/2.4.3/node_modules/write-file-atomic/README.md delete mode 100644 packages/list/test/fixture-with-no-pkg-version/node_modules/.pnpm/registry.npmjs.org/write-file-atomic/2.4.3/node_modules/write-file-atomic/index.js delete mode 100644 packages/list/test/fixture-with-no-pkg-version/node_modules/.pnpm/registry.npmjs.org/write-file-atomic/2.4.3/node_modules/write-file-atomic/package.json delete mode 120000 packages/list/test/fixture-with-no-pkg-version/node_modules/.pnpm/registry.npmjs.org/write-json-file/2.3.0/node_modules/detect-indent delete mode 120000 packages/list/test/fixture-with-no-pkg-version/node_modules/.pnpm/registry.npmjs.org/write-json-file/2.3.0/node_modules/graceful-fs delete mode 120000 packages/list/test/fixture-with-no-pkg-version/node_modules/.pnpm/registry.npmjs.org/write-json-file/2.3.0/node_modules/make-dir delete mode 120000 packages/list/test/fixture-with-no-pkg-version/node_modules/.pnpm/registry.npmjs.org/write-json-file/2.3.0/node_modules/pify delete mode 120000 packages/list/test/fixture-with-no-pkg-version/node_modules/.pnpm/registry.npmjs.org/write-json-file/2.3.0/node_modules/sort-keys delete mode 120000 packages/list/test/fixture-with-no-pkg-version/node_modules/.pnpm/registry.npmjs.org/write-json-file/2.3.0/node_modules/write-file-atomic delete mode 100644 packages/list/test/fixture-with-no-pkg-version/node_modules/.pnpm/registry.npmjs.org/write-json-file/2.3.0/node_modules/write-json-file/index.js delete mode 100644 packages/list/test/fixture-with-no-pkg-version/node_modules/.pnpm/registry.npmjs.org/write-json-file/2.3.0/node_modules/write-json-file/license delete mode 100644 packages/list/test/fixture-with-no-pkg-version/node_modules/.pnpm/registry.npmjs.org/write-json-file/2.3.0/node_modules/write-json-file/package.json delete mode 100644 packages/list/test/fixture-with-no-pkg-version/node_modules/.pnpm/registry.npmjs.org/write-json-file/2.3.0/node_modules/write-json-file/readme.md delete mode 120000 packages/list/test/fixture-with-no-pkg-version/node_modules/is-negative delete mode 120000 packages/list/test/fixture-with-no-pkg-version/node_modules/is-positive delete mode 120000 packages/list/test/fixture-with-no-pkg-version/node_modules/write-json-file delete mode 100644 packages/list/test/fixture/.gitignore delete mode 100644 packages/list/test/fixture/node_modules/.modules.yaml delete mode 100644 packages/list/test/fixture/node_modules/.pnpm/lock.yaml delete mode 100644 packages/list/test/fixture/node_modules/.pnpm/registry.npmjs.org/make-dir/1.3.0/node_modules/make-dir/index.js delete mode 100644 packages/list/test/fixture/node_modules/.pnpm/registry.npmjs.org/make-dir/1.3.0/node_modules/make-dir/license delete mode 100644 packages/list/test/fixture/node_modules/.pnpm/registry.npmjs.org/make-dir/1.3.0/node_modules/make-dir/package.json delete mode 100644 packages/list/test/fixture/node_modules/.pnpm/registry.npmjs.org/make-dir/1.3.0/node_modules/make-dir/readme.md delete mode 120000 packages/list/test/fixture/node_modules/.pnpm/registry.npmjs.org/make-dir/1.3.0/node_modules/pify delete mode 120000 packages/list/test/fixture/node_modules/.pnpm/registry.npmjs.org/sort-keys/2.0.0/node_modules/is-plain-obj delete mode 100644 packages/list/test/fixture/node_modules/.pnpm/registry.npmjs.org/sort-keys/2.0.0/node_modules/sort-keys/index.js delete mode 100644 packages/list/test/fixture/node_modules/.pnpm/registry.npmjs.org/sort-keys/2.0.0/node_modules/sort-keys/license delete mode 100644 packages/list/test/fixture/node_modules/.pnpm/registry.npmjs.org/sort-keys/2.0.0/node_modules/sort-keys/package.json delete mode 100644 packages/list/test/fixture/node_modules/.pnpm/registry.npmjs.org/sort-keys/2.0.0/node_modules/sort-keys/readme.md delete mode 120000 packages/list/test/fixture/node_modules/.pnpm/registry.npmjs.org/write-file-atomic/2.4.3/node_modules/graceful-fs delete mode 120000 packages/list/test/fixture/node_modules/.pnpm/registry.npmjs.org/write-file-atomic/2.4.3/node_modules/imurmurhash delete mode 120000 packages/list/test/fixture/node_modules/.pnpm/registry.npmjs.org/write-file-atomic/2.4.3/node_modules/signal-exit delete mode 100644 packages/list/test/fixture/node_modules/.pnpm/registry.npmjs.org/write-file-atomic/2.4.3/node_modules/write-file-atomic/CHANGELOG.md delete mode 100644 packages/list/test/fixture/node_modules/.pnpm/registry.npmjs.org/write-file-atomic/2.4.3/node_modules/write-file-atomic/LICENSE delete mode 100644 packages/list/test/fixture/node_modules/.pnpm/registry.npmjs.org/write-file-atomic/2.4.3/node_modules/write-file-atomic/README.md delete mode 100644 packages/list/test/fixture/node_modules/.pnpm/registry.npmjs.org/write-file-atomic/2.4.3/node_modules/write-file-atomic/index.js delete mode 100644 packages/list/test/fixture/node_modules/.pnpm/registry.npmjs.org/write-file-atomic/2.4.3/node_modules/write-file-atomic/package.json delete mode 120000 packages/list/test/fixture/node_modules/.pnpm/registry.npmjs.org/write-json-file/2.3.0/node_modules/detect-indent delete mode 120000 packages/list/test/fixture/node_modules/.pnpm/registry.npmjs.org/write-json-file/2.3.0/node_modules/graceful-fs delete mode 120000 packages/list/test/fixture/node_modules/.pnpm/registry.npmjs.org/write-json-file/2.3.0/node_modules/make-dir delete mode 120000 packages/list/test/fixture/node_modules/.pnpm/registry.npmjs.org/write-json-file/2.3.0/node_modules/pify delete mode 120000 packages/list/test/fixture/node_modules/.pnpm/registry.npmjs.org/write-json-file/2.3.0/node_modules/sort-keys delete mode 120000 packages/list/test/fixture/node_modules/.pnpm/registry.npmjs.org/write-json-file/2.3.0/node_modules/write-file-atomic delete mode 100644 packages/list/test/fixture/node_modules/.pnpm/registry.npmjs.org/write-json-file/2.3.0/node_modules/write-json-file/index.js delete mode 100644 packages/list/test/fixture/node_modules/.pnpm/registry.npmjs.org/write-json-file/2.3.0/node_modules/write-json-file/license delete mode 100644 packages/list/test/fixture/node_modules/.pnpm/registry.npmjs.org/write-json-file/2.3.0/node_modules/write-json-file/package.json delete mode 100644 packages/list/test/fixture/node_modules/.pnpm/registry.npmjs.org/write-json-file/2.3.0/node_modules/write-json-file/readme.md delete mode 120000 packages/list/test/fixture/node_modules/is-negative delete mode 120000 packages/list/test/fixture/node_modules/is-positive delete mode 120000 packages/list/test/fixture/node_modules/write-json-file delete mode 100644 packages/list/test/with-aliased-dep/.gitignore delete mode 100644 packages/list/test/with-aliased-dep/node_modules/.ignored_positive/package.json delete mode 100644 packages/list/test/with-aliased-dep/node_modules/.modules.yaml delete mode 100644 packages/list/test/with-aliased-dep/node_modules/.pnpm/lock.yaml delete mode 100644 packages/list/test/with-aliased-dep/node_modules/.pnpm/registry.npmjs.org/is-positive/1.0.0/node_modules/is-positive/package.json delete mode 120000 packages/list/test/with-aliased-dep/node_modules/positive delete mode 100644 packages/list/test/with-aliased-dep/package.json delete mode 100644 packages/list/test/with-aliased-dep/pnpm-lock.yaml diff --git a/.changeset/clean-rules-dress.md b/.changeset/clean-rules-dress.md new file mode 100644 index 0000000000..4936f1a77f --- /dev/null +++ b/.changeset/clean-rules-dress.md @@ -0,0 +1,7 @@ +--- +"dependencies-hierarchy": major +"@pnpm/list": major +--- + +Look for dependencies at the correct location. +The dependency paths have changed in the `node_modules` created by pnpm v5. diff --git a/packages/dependencies-hierarchy/fixtures/circular/package.json b/fixtures/circular/package.json similarity index 100% rename from packages/dependencies-hierarchy/fixtures/circular/package.json rename to fixtures/circular/package.json diff --git a/packages/dependencies-hierarchy/fixtures/circular/pnpm-lock.yaml b/fixtures/circular/pnpm-lock.yaml similarity index 97% rename from packages/dependencies-hierarchy/fixtures/circular/pnpm-lock.yaml rename to fixtures/circular/pnpm-lock.yaml index f62c953c2e..961ce4e833 100644 --- a/packages/dependencies-hierarchy/fixtures/circular/pnpm-lock.yaml +++ b/fixtures/circular/pnpm-lock.yaml @@ -1,6 +1,6 @@ dependencies: es6-iterator: 2.0.1 -lockfileVersion: 5 +lockfileVersion: 5.1 packages: /d/1.0.0: dependencies: diff --git a/packages/list/test/empty/package.json b/fixtures/empty/package.json similarity index 100% rename from packages/list/test/empty/package.json rename to fixtures/empty/package.json diff --git a/packages/list/test/fixture-with-external-shrinkwrap/pkg/.npmrc b/fixtures/fixture-with-external-shrinkwrap/pkg/.npmrc similarity index 100% rename from packages/list/test/fixture-with-external-shrinkwrap/pkg/.npmrc rename to fixtures/fixture-with-external-shrinkwrap/pkg/.npmrc diff --git a/packages/list/test/fixture-with-external-shrinkwrap/pkg/package.json b/fixtures/fixture-with-external-shrinkwrap/pkg/package.json similarity index 100% rename from packages/list/test/fixture-with-external-shrinkwrap/pkg/package.json rename to fixtures/fixture-with-external-shrinkwrap/pkg/package.json diff --git a/packages/list/test/fixture-with-external-shrinkwrap/pnpm-lock.yaml b/fixtures/fixture-with-external-shrinkwrap/pnpm-lock.yaml similarity index 92% rename from packages/list/test/fixture-with-external-shrinkwrap/pnpm-lock.yaml rename to fixtures/fixture-with-external-shrinkwrap/pnpm-lock.yaml index 76d822a10e..9e9fb4cbdb 100644 --- a/packages/list/test/fixture-with-external-shrinkwrap/pnpm-lock.yaml +++ b/fixtures/fixture-with-external-shrinkwrap/pnpm-lock.yaml @@ -4,7 +4,7 @@ importers: is-positive: 1.0.0 specifiers: is-positive: 1.0.0 -lockfileVersion: 5 +lockfileVersion: 5.1 packages: /is-positive/1.0.0: dev: false diff --git a/packages/dependencies-hierarchy/fixtureMonorepo/pnpm-workspace.yaml b/fixtures/fixture-with-external-shrinkwrap/pnpm-workspace.yaml similarity index 100% rename from packages/dependencies-hierarchy/fixtureMonorepo/pnpm-workspace.yaml rename to fixtures/fixture-with-external-shrinkwrap/pnpm-workspace.yaml diff --git a/packages/list/test/fixture-with-no-pkg-name-and-no-version/package.json b/fixtures/fixture-with-no-pkg-name-and-no-version/package.json similarity index 100% rename from packages/list/test/fixture-with-no-pkg-name-and-no-version/package.json rename to fixtures/fixture-with-no-pkg-name-and-no-version/package.json diff --git a/packages/list/test/fixture-with-no-pkg-name-and-no-version/pnpm-lock.yaml b/fixtures/fixture-with-no-pkg-name-and-no-version/pnpm-lock.yaml similarity index 100% rename from packages/list/test/fixture-with-no-pkg-name-and-no-version/pnpm-lock.yaml rename to fixtures/fixture-with-no-pkg-name-and-no-version/pnpm-lock.yaml diff --git a/packages/list/test/fixture-with-no-pkg-version/package.json b/fixtures/fixture-with-no-pkg-version/package.json similarity index 100% rename from packages/list/test/fixture-with-no-pkg-version/package.json rename to fixtures/fixture-with-no-pkg-version/package.json diff --git a/packages/list/test/fixture-with-no-pkg-version/pnpm-lock.yaml b/fixtures/fixture-with-no-pkg-version/pnpm-lock.yaml similarity index 100% rename from packages/list/test/fixture-with-no-pkg-version/pnpm-lock.yaml rename to fixtures/fixture-with-no-pkg-version/pnpm-lock.yaml diff --git a/packages/list/test/fixture/package.json b/fixtures/fixture/package.json similarity index 100% rename from packages/list/test/fixture/package.json rename to fixtures/fixture/package.json diff --git a/packages/list/test/fixture/pnpm-lock.yaml b/fixtures/fixture/pnpm-lock.yaml similarity index 100% rename from packages/list/test/fixture/pnpm-lock.yaml rename to fixtures/fixture/pnpm-lock.yaml diff --git a/packages/dependencies-hierarchy/fixtureWithLinks/.npmrc b/fixtures/fixtureWithLinks/.npmrc similarity index 100% rename from packages/dependencies-hierarchy/fixtureWithLinks/.npmrc rename to fixtures/fixtureWithLinks/.npmrc diff --git a/packages/dependencies-hierarchy/fixtureWithLinks/general/package.json b/fixtures/fixtureWithLinks/general/package.json similarity index 100% rename from packages/dependencies-hierarchy/fixtureWithLinks/general/package.json rename to fixtures/fixtureWithLinks/general/package.json diff --git a/packages/dependencies-hierarchy/fixtureWithLinks/general/pnpm-lock.yaml b/fixtures/fixtureWithLinks/general/pnpm-lock.yaml similarity index 99% rename from packages/dependencies-hierarchy/fixtureWithLinks/general/pnpm-lock.yaml rename to fixtures/fixtureWithLinks/general/pnpm-lock.yaml index 7833929721..9ac2ffb67b 100644 --- a/packages/dependencies-hierarchy/fixtureWithLinks/general/pnpm-lock.yaml +++ b/fixtures/fixtureWithLinks/general/pnpm-lock.yaml @@ -3,7 +3,7 @@ dependencies: rimraf: 2.5.1 devDependencies: is-positive: 1.0.0 -lockfileVersion: 5 +lockfileVersion: 5.1 optionalDependencies: is-negative: 1.0.0 packages: diff --git a/packages/dependencies-hierarchy/fixtureWithLinks/pnpm-workspace.yaml b/fixtures/fixtureWithLinks/pnpm-workspace.yaml similarity index 100% rename from packages/dependencies-hierarchy/fixtureWithLinks/pnpm-workspace.yaml rename to fixtures/fixtureWithLinks/pnpm-workspace.yaml diff --git a/packages/dependencies-hierarchy/fixtureWithLinks/with-links-only/package.json b/fixtures/fixtureWithLinks/with-links-only/package.json similarity index 100% rename from packages/dependencies-hierarchy/fixtureWithLinks/with-links-only/package.json rename to fixtures/fixtureWithLinks/with-links-only/package.json diff --git a/packages/dependencies-hierarchy/fixtureWithLinks/with-links-only/pnpm-lock.yaml b/fixtures/fixtureWithLinks/with-links-only/pnpm-lock.yaml similarity index 100% rename from packages/dependencies-hierarchy/fixtureWithLinks/with-links-only/pnpm-lock.yaml rename to fixtures/fixtureWithLinks/with-links-only/pnpm-lock.yaml diff --git a/packages/dependencies-hierarchy/fixtures/general/package.json b/fixtures/general/package.json similarity index 100% rename from packages/dependencies-hierarchy/fixtures/general/package.json rename to fixtures/general/package.json diff --git a/packages/dependencies-hierarchy/fixtures/general/pnpm-lock.yaml b/fixtures/general/pnpm-lock.yaml similarity index 99% rename from packages/dependencies-hierarchy/fixtures/general/pnpm-lock.yaml rename to fixtures/general/pnpm-lock.yaml index 36593b51ce..514d3025a4 100644 --- a/packages/dependencies-hierarchy/fixtures/general/pnpm-lock.yaml +++ b/fixtures/general/pnpm-lock.yaml @@ -3,7 +3,7 @@ dependencies: rimraf: 2.5.1 devDependencies: is-positive: 1.0.0 -lockfileVersion: 5 +lockfileVersion: 5.1 optionalDependencies: is-negative: 1.0.0 packages: diff --git a/fixtures/has-not-outdated-deps/node_modules/.modules.yaml b/fixtures/has-not-outdated-deps/node_modules/.modules.yaml new file mode 100644 index 0000000000..def0f42111 --- /dev/null +++ b/fixtures/has-not-outdated-deps/node_modules/.modules.yaml @@ -0,0 +1,17 @@ +hoistPattern: + - '*' +hoistedDependencies: {} +included: + dependencies: true + devDependencies: true + optionalDependencies: true +layoutVersion: 4 +packageManager: pnpm@0.0.0-2020520224551 +pendingBuilds: [] +publicHoistPattern: + - '@types/*' +registries: + default: 'https://registry.npmjs.org/' +skipped: [] +storeDir: /home/zoli/.pnpm-store/v3 +virtualStoreDir: .pnpm diff --git a/fixtures/has-not-outdated-deps/node_modules/.pnpm/lock.yaml b/fixtures/has-not-outdated-deps/node_modules/.pnpm/lock.yaml index abdb48566b..e6f727bb71 100644 --- a/fixtures/has-not-outdated-deps/node_modules/.pnpm/lock.yaml +++ b/fixtures/has-not-outdated-deps/node_modules/.pnpm/lock.yaml @@ -1,12 +1,14 @@ dependencies: is-negative: 2.1.0 is-positive: 3.1.0 -lockfileVersion: 5 +lockfileVersion: 5.1 packages: /is-negative/2.1.0: + dev: false resolution: integrity: sha1-8Nhjd6oVpkw0lh84rCqb4rQKEYc= /is-positive/3.1.0: + dev: false resolution: integrity: sha1-hX21hKG6XRyymAUn/DtsQ103sP0= specifiers: diff --git a/fixtures/has-not-outdated-deps/node_modules/is-negative b/fixtures/has-not-outdated-deps/node_modules/is-negative new file mode 120000 index 0000000000..2bafd9a07e --- /dev/null +++ b/fixtures/has-not-outdated-deps/node_modules/is-negative @@ -0,0 +1 @@ +.pnpm/is-negative@2.1.0/node_modules/is-negative \ No newline at end of file diff --git a/fixtures/has-not-outdated-deps/node_modules/is-positive b/fixtures/has-not-outdated-deps/node_modules/is-positive new file mode 120000 index 0000000000..999c87934b --- /dev/null +++ b/fixtures/has-not-outdated-deps/node_modules/is-positive @@ -0,0 +1 @@ +.pnpm/is-positive@3.1.0/node_modules/is-positive \ No newline at end of file diff --git a/fixtures/has-not-outdated-deps/pnpm-lock.yaml b/fixtures/has-not-outdated-deps/pnpm-lock.yaml index abdb48566b..e6f727bb71 100644 --- a/fixtures/has-not-outdated-deps/pnpm-lock.yaml +++ b/fixtures/has-not-outdated-deps/pnpm-lock.yaml @@ -1,12 +1,14 @@ dependencies: is-negative: 2.1.0 is-positive: 3.1.0 -lockfileVersion: 5 +lockfileVersion: 5.1 packages: /is-negative/2.1.0: + dev: false resolution: integrity: sha1-8Nhjd6oVpkw0lh84rCqb4rQKEYc= /is-positive/3.1.0: + dev: false resolution: integrity: sha1-hX21hKG6XRyymAUn/DtsQ103sP0= specifiers: diff --git a/packages/dependencies-hierarchy/fixtureMonorepo/.npmrc b/fixtures/monorepo/.npmrc similarity index 100% rename from packages/dependencies-hierarchy/fixtureMonorepo/.npmrc rename to fixtures/monorepo/.npmrc diff --git a/packages/dependencies-hierarchy/fixtureMonorepo/package/package.json b/fixtures/monorepo/package/package.json similarity index 100% rename from packages/dependencies-hierarchy/fixtureMonorepo/package/package.json rename to fixtures/monorepo/package/package.json diff --git a/packages/dependencies-hierarchy/fixtureMonorepo/pnpm-lock.yaml b/fixtures/monorepo/pnpm-lock.yaml similarity index 100% rename from packages/dependencies-hierarchy/fixtureMonorepo/pnpm-lock.yaml rename to fixtures/monorepo/pnpm-lock.yaml diff --git a/packages/dependencies-hierarchy/fixtures/pnpm-workspace.yaml b/fixtures/monorepo/pnpm-workspace.yaml similarity index 100% rename from packages/dependencies-hierarchy/fixtures/pnpm-workspace.yaml rename to fixtures/monorepo/pnpm-workspace.yaml diff --git a/fixtures/package.yaml b/fixtures/package.yaml new file mode 100644 index 0000000000..14b7c86a37 --- /dev/null +++ b/fixtures/package.yaml @@ -0,0 +1,5 @@ +scripts: + prepareFixtures: > + pnpm install -rf --frozen-lockfile --no-shared-workspace-lockfile --no-link-workspace-packages && + pnpm install -rf -C fixtureWithLinks --frozen-lockfile --link-workspace-packages --no-shared-workspace-lockfile && + cd ./fixture-with-external-shrinkwrap/pkg && pnpm install -f --frozen-lockfile diff --git a/fixtures/pnpm-workspace.yaml b/fixtures/pnpm-workspace.yaml index 9a3cd4defa..63ad282e76 100644 --- a/fixtures/pnpm-workspace.yaml +++ b/fixtures/pnpm-workspace.yaml @@ -1 +1,9 @@ -# This file is only created so that tests don't look up the pnpm-workspace.yaml in the root +packages: + - '*' + - '!fixtureWithLinks/*' + - '!has-major-outdated-deps' + - '!has-no-lockfile' + - '!has-npm-shrinkwrap-json' + - '!has-package-lock-json' + - '!hello-world-js-bin' + - '!has-outdated-deps' diff --git a/packages/dependencies-hierarchy/fixtures/with-aliased-dep/package.json b/fixtures/with-aliased-dep/package.json similarity index 100% rename from packages/dependencies-hierarchy/fixtures/with-aliased-dep/package.json rename to fixtures/with-aliased-dep/package.json diff --git a/packages/dependencies-hierarchy/fixtures/with-aliased-dep/pnpm-lock.yaml b/fixtures/with-aliased-dep/pnpm-lock.yaml similarity index 100% rename from packages/dependencies-hierarchy/fixtures/with-aliased-dep/pnpm-lock.yaml rename to fixtures/with-aliased-dep/pnpm-lock.yaml diff --git a/packages/dependencies-hierarchy/fixtures/with-file-dep/package.json b/fixtures/with-file-dep/package.json similarity index 100% rename from packages/dependencies-hierarchy/fixtures/with-file-dep/package.json rename to fixtures/with-file-dep/package.json diff --git a/packages/dependencies-hierarchy/fixtures/with-file-dep/pnpm-lock.yaml b/fixtures/with-file-dep/pnpm-lock.yaml similarity index 92% rename from packages/dependencies-hierarchy/fixtures/with-file-dep/pnpm-lock.yaml rename to fixtures/with-file-dep/pnpm-lock.yaml index eec93a0bb5..b39f467236 100644 --- a/packages/dependencies-hierarchy/fixtures/with-file-dep/pnpm-lock.yaml +++ b/fixtures/with-file-dep/pnpm-lock.yaml @@ -1,7 +1,7 @@ dependencies: general: 'link:../general' is-positive: 3.1.0 -lockfileVersion: 5 +lockfileVersion: 5.1 packages: /is-positive/3.1.0: dev: false diff --git a/packages/dependencies-hierarchy/fixtures/with-peer/package.json b/fixtures/with-peer/package.json similarity index 100% rename from packages/dependencies-hierarchy/fixtures/with-peer/package.json rename to fixtures/with-peer/package.json diff --git a/packages/dependencies-hierarchy/fixtures/with-peer/pnpm-lock.yaml b/fixtures/with-peer/pnpm-lock.yaml similarity index 100% rename from packages/dependencies-hierarchy/fixtures/with-peer/pnpm-lock.yaml rename to fixtures/with-peer/pnpm-lock.yaml diff --git a/fixtures/with-unsaved-deps/.npmrc b/fixtures/with-unsaved-deps/.npmrc new file mode 100644 index 0000000000..a8af1b6aa8 --- /dev/null +++ b/fixtures/with-unsaved-deps/.npmrc @@ -0,0 +1,2 @@ +shamefully-hoist=false +public-hoist-pattern[]= diff --git a/packages/dependencies-hierarchy/fixtures/with-unsaved-deps/package.json b/fixtures/with-unsaved-deps/package.json similarity index 100% rename from packages/dependencies-hierarchy/fixtures/with-unsaved-deps/package.json rename to fixtures/with-unsaved-deps/package.json diff --git a/packages/dependencies-hierarchy/fixtures/with-unsaved-deps/pnpm-lock.yaml b/fixtures/with-unsaved-deps/pnpm-lock.yaml similarity index 99% rename from packages/dependencies-hierarchy/fixtures/with-unsaved-deps/pnpm-lock.yaml rename to fixtures/with-unsaved-deps/pnpm-lock.yaml index 985bd5c4e8..76c5ce5908 100644 --- a/packages/dependencies-hierarchy/fixtures/with-unsaved-deps/pnpm-lock.yaml +++ b/fixtures/with-unsaved-deps/pnpm-lock.yaml @@ -1,6 +1,6 @@ dependencies: symlink-dir: 2.0.2 -lockfileVersion: 5 +lockfileVersion: 5.1 packages: /@types/mz/0.0.32: dependencies: diff --git a/package.json b/package.json index 2dafd900b9..8ba8cffd4c 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "private": true, "scripts": { "preinstall": "npx only-allow pnpm", - "prepare": "pnpm install --dir verdaccio", + "prepare": "pnpm install --dir verdaccio && pnpm run prepareFixtures -C fixtures", "lint": "tslint --config tslint.json **/src/**/*.ts **/test/**/*.ts --exclude '**/node_modules/**'", "test-master": "pnpm run lint && pnpm run compile && run-p -r verdaccio test-pkgs-master", "test-pkgs-master": "cross-env PNPM_REGISTRY_MOCK_UPLINK=http://localhost:7348 pnpm run _test --no-sort --filter=./packages --filter=./privatePackages --workspace-concurrency=2", diff --git a/packages/dependencies-hierarchy/fixtureMonorepo/.gitignore b/packages/dependencies-hierarchy/fixtureMonorepo/.gitignore deleted file mode 100644 index cf4bab9ddd..0000000000 --- a/packages/dependencies-hierarchy/fixtureMonorepo/.gitignore +++ /dev/null @@ -1 +0,0 @@ -!node_modules diff --git a/packages/dependencies-hierarchy/fixtureMonorepo/node_modules/.modules.yaml b/packages/dependencies-hierarchy/fixtureMonorepo/node_modules/.modules.yaml deleted file mode 100644 index 938b8e7d77..0000000000 --- a/packages/dependencies-hierarchy/fixtureMonorepo/node_modules/.modules.yaml +++ /dev/null @@ -1,15 +0,0 @@ -importers: - package: - hoistedAliases: {} - shamefullyFlatten: false -included: - dependencies: true - devDependencies: true - optionalDependencies: true -layoutVersion: 1 -packageManager: pnpm@2.25.5 -pendingBuilds: [] -registries: - default: 'https://registry.npmjs.org/' -skipped: [] -store: /home/zoltan/.pnpm-store/2 diff --git a/packages/dependencies-hierarchy/fixtureMonorepo/node_modules/.shrinkwrap.yaml b/packages/dependencies-hierarchy/fixtureMonorepo/node_modules/.shrinkwrap.yaml deleted file mode 100644 index fa42397401..0000000000 --- a/packages/dependencies-hierarchy/fixtureMonorepo/node_modules/.shrinkwrap.yaml +++ /dev/null @@ -1,14 +0,0 @@ -importers: - foobarpackage: - dependencies: - is-positive: 3.1.0 - specifiers: - is-positive: 3.1.0 -packages: - /is-positive/3.1.0: - dev: false - engines: - node: '>=0.10.0' - resolution: - integrity: sha1-hX21hKG6XRyymAUn/DtsQ103sP0= -shrinkwrapVersion: 4 diff --git a/packages/dependencies-hierarchy/fixtures/.npmrc b/packages/dependencies-hierarchy/fixtures/.npmrc deleted file mode 100644 index 82d607ba27..0000000000 --- a/packages/dependencies-hierarchy/fixtures/.npmrc +++ /dev/null @@ -1,3 +0,0 @@ -shamefully-hoist=false -shared-workspace-lockfile=false -link-workspace-packages=false diff --git a/packages/dependencies-hierarchy/fixtures/with-unsaved-deps/.gitignore b/packages/dependencies-hierarchy/fixtures/with-unsaved-deps/.gitignore deleted file mode 100644 index decc5c7aa1..0000000000 --- a/packages/dependencies-hierarchy/fixtures/with-unsaved-deps/.gitignore +++ /dev/null @@ -1,6 +0,0 @@ -!node_modules -node_modules/.bin -node_modules/.pnpm -node_modules/general -node_modules/symlink-dir -node_modules/.modules.yaml diff --git a/packages/dependencies-hierarchy/fixtures/with-unsaved-deps/node_modules/is-positive/index.js b/packages/dependencies-hierarchy/fixtures/with-unsaved-deps/node_modules/is-positive/index.js deleted file mode 100644 index ce27efbbbf..0000000000 --- a/packages/dependencies-hierarchy/fixtures/with-unsaved-deps/node_modules/is-positive/index.js +++ /dev/null @@ -1,4 +0,0 @@ -'use strict'; -module.exports = function (n) { - return toString.call(n) === '[object Number]' && n > 0; -}; diff --git a/packages/dependencies-hierarchy/fixtures/with-unsaved-deps/node_modules/is-positive/license b/packages/dependencies-hierarchy/fixtures/with-unsaved-deps/node_modules/is-positive/license deleted file mode 100644 index 0f8cf79c3c..0000000000 --- a/packages/dependencies-hierarchy/fixtures/with-unsaved-deps/node_modules/is-positive/license +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) Kevin Martensson (github.com/kevva) - -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. diff --git a/packages/dependencies-hierarchy/fixtures/with-unsaved-deps/node_modules/is-positive/package.json b/packages/dependencies-hierarchy/fixtures/with-unsaved-deps/node_modules/is-positive/package.json deleted file mode 100644 index 1b8c43682f..0000000000 --- a/packages/dependencies-hierarchy/fixtures/with-unsaved-deps/node_modules/is-positive/package.json +++ /dev/null @@ -1,63 +0,0 @@ -{ - "_from": "is-positive@3.1.0", - "_id": "is-positive@3.1.0", - "_inBundle": false, - "_integrity": "sha1-hX21hKG6XRyymAUn/DtsQ103sP0=", - "_location": "/is-positive", - "_phantomChildren": {}, - "_requested": { - "type": "version", - "registry": true, - "raw": "is-positive@3.1.0", - "name": "is-positive", - "escapedName": "is-positive", - "rawSpec": "3.1.0", - "saveSpec": null, - "fetchSpec": "3.1.0" - }, - "_requiredBy": [ - "#USER" - ], - "_resolved": "https://registry.npmjs.org/is-positive/-/is-positive-3.1.0.tgz", - "_shasum": "857db584a1ba5d1cb2980527fc3b6c435d37b0fd", - "_spec": "is-positive@3.1.0", - "_where": "C:\\Users\\zoltan\\src\\pnpm\\pnpm\\packages\\dependencies-hierarchy\\fixtures\\with-undeclared-deps", - "author": { - "name": "Kevin Martensson", - "email": "kevinmartensson@gmail.com", - "url": "github.com/kevva" - }, - "bugs": { - "url": "https://github.com/kevva/is-positive/issues" - }, - "bundleDependencies": false, - "deprecated": false, - "description": "Check if something is a positive number", - "devDependencies": { - "ava": "*", - "xo": "*" - }, - "engines": { - "node": ">=0.10.0" - }, - "files": [ - "index.js" - ], - "homepage": "https://github.com/kevva/is-positive#readme", - "keywords": [ - "number", - "positive", - "test", - "check" - ], - "license": "MIT", - "name": "is-positive", - "repository": { - "type": "git", - "url": "git+https://github.com/kevva/is-positive.git" - }, - "scripts": { - "test": "xo && ava" - }, - "version": "3.1.0" -} diff --git a/packages/dependencies-hierarchy/fixtures/with-unsaved-deps/node_modules/is-positive/readme.md b/packages/dependencies-hierarchy/fixtures/with-unsaved-deps/node_modules/is-positive/readme.md deleted file mode 100644 index f80e8a0c48..0000000000 --- a/packages/dependencies-hierarchy/fixtures/with-unsaved-deps/node_modules/is-positive/readme.md +++ /dev/null @@ -1,44 +0,0 @@ -# is-positive [![Build Status](https://travis-ci.org/kevva/is-positive.svg?branch=master)](https://travis-ci.org/kevva/is-positive) - -> Check if something is a positive number - - -## Install - -``` -$ npm install --save is-positive -``` - - -## Usage - -```js -const isPositive = require('is-positive'); - -isPositive(1); -//=> true - -isPositive(0); -//=> false - -isPositive(-1); -//=> false - -isPositive('1'); -//=> false - -isPositive(Number(1)) -//=> true -``` - -_Note: This module doesn't consider `0` to be a positive number and doesn't distinguish between `-0` and `0`. If you want to detect `0`, use the [`positive-zero`](https://github.com/sindresorhus/positive-zero) module._ - - -## Related - -- [is-negative](https://github.com/kevva/is-negative) - Check if something is a negative number - - -## License - -MIT © [Kevin Martensson](http://github.com/kevva) diff --git a/packages/dependencies-hierarchy/package.json b/packages/dependencies-hierarchy/package.json index 1b98eff4a3..cace3fac92 100644 --- a/packages/dependencies-hierarchy/package.json +++ b/packages/dependencies-hierarchy/package.json @@ -10,7 +10,6 @@ ], "scripts": { "lint": "tslint -c ../../tslint.json src/**/*.ts test/**/*.ts", - "pre_test": "pnpm install -rf -C fixtures --frozen-lockfile --no-shared-workspace-lockfile --no-link-workspace-packages && pnpm install -rf -C fixtureWithLinks --frozen-lockfile --link-workspace-packages --no-shared-workspace-lockfile", "_test": "cd ../.. && c8 --reporter lcov --reports-dir packages/dependencies-hierarchy/coverage ts-node packages/dependencies-hierarchy/test --type-check", "test": "pnpm run compile && pnpm run _test", "prepublishOnly": "pnpm run compile", @@ -37,6 +36,7 @@ "@pnpm/lockfile-utils": "workspace:2.0.14", "@pnpm/modules-yaml": "workspace:8.0.0", "@pnpm/normalize-registries": "workspace:1.0.2", + "@pnpm/pkgid-to-filename": "^3.0.0", "@pnpm/read-modules-dir": "workspace:2.0.1", "@pnpm/read-package-json": "workspace:3.1.2", "@pnpm/types": "workspace:6.1.0", diff --git a/packages/dependencies-hierarchy/src/index.ts b/packages/dependencies-hierarchy/src/index.ts index 379bcef52c..6308d55d0c 100644 --- a/packages/dependencies-hierarchy/src/index.ts +++ b/packages/dependencies-hierarchy/src/index.ts @@ -13,10 +13,11 @@ import { } from '@pnpm/lockfile-utils' import { read as readModulesYaml } from '@pnpm/modules-yaml' import normalizeRegistries from '@pnpm/normalize-registries' +import pkgIdToFilename from '@pnpm/pkgid-to-filename' import readModulesDir from '@pnpm/read-modules-dir' import { safeReadPackageFromDir } from '@pnpm/read-package-json' import { DependenciesField, DEPENDENCIES_FIELDS, Registries } from '@pnpm/types' -import { refToAbsolute, refToRelative } from 'dependency-path' +import { refToRelative } from 'dependency-path' import normalizePath = require('normalize-path') import path = require('path') import realpathMissing = require('realpath-missing') @@ -129,6 +130,7 @@ async function dependenciesHierarchyForPackage ( currentDepth: 1, currentPackages: currentLockfile.packages || {}, includeOptionalDependencies: opts.include.optionalDependencies === true, + lockfileDir: opts.lockfileDir, maxDepth: opts.depth, modulesDir, registries: opts.registries, @@ -144,6 +146,7 @@ async function dependenciesHierarchyForPackage ( const { packageInfo, packageAbsolutePath } = getPkgInfo({ alias, currentPackages: currentLockfile.packages || {}, + lockfileDir: opts.lockfileDir, modulesDir, ref: topDeps[alias], registries: opts.registries, @@ -224,6 +227,7 @@ function getAllDirectDependencies (projectSnapshot: ProjectSnapshot) { type GetTreeOpts = { currentDepth: number, maxDepth: number, + lockfileDir: string, modulesDir: string, includeOptionalDependencies: boolean, search?: SearchFunction, @@ -274,6 +278,7 @@ function getTreeHelper ( const { packageInfo, packageAbsolutePath } = getPkgInfo({ alias, currentPackages: opts.currentPackages, + lockfileDir: opts.lockfileDir, modulesDir: opts.modulesDir, peers, ref: deps[alias], @@ -337,6 +342,7 @@ function getTreeHelper ( function getPkgInfo ( opts: { alias: string, + lockfileDir: string, modulesDir: string, ref: string, currentPackages: PackageSnapshots, @@ -381,14 +387,14 @@ function getPkgInfo ( name = opts.alias version = opts.ref } - const packageAbsolutePath = refToAbsolute(opts.ref, opts.alias, opts.registries) + const packageAbsolutePath = refToRelative(opts.ref, opts.alias) const packageInfo = { alias: opts.alias, isMissing, isPeer: Boolean(opts.peers && opts.peers.has(opts.alias)), isSkipped, name, - path: packageAbsolutePath && path.join(opts.modulesDir, '.pnpm', packageAbsolutePath) || path.join(opts.modulesDir, '..', opts.ref.substr(5)), + path: depPath ? path.join(opts.modulesDir, '.pnpm', pkgIdToFilename(depPath, opts.lockfileDir)) : path.join(opts.modulesDir, '..', opts.ref.substr(5)), version, } if (resolved) { diff --git a/packages/dependencies-hierarchy/test/circularTree.json b/packages/dependencies-hierarchy/test/circularTree.json index 601142c944..628128f107 100644 --- a/packages/dependencies-hierarchy/test/circularTree.json +++ b/packages/dependencies-hierarchy/test/circularTree.json @@ -1,7 +1,7 @@ { "dependencies": [ { - "path": "registry.npmjs.org/es6-iterator/2.0.1", + "path": "es6-iterator@2.0.1", "dev": false, "isMissing": false, "isPeer": false, @@ -11,7 +11,7 @@ "version": "2.0.1", "dependencies": [ { - "path": "registry.npmjs.org/d/1.0.0", + "path": "d@1.0.0", "dev": false, "isMissing": false, "isPeer": false, @@ -21,7 +21,7 @@ "version": "1.0.0", "dependencies": [ { - "path": "registry.npmjs.org/es5-ext/0.10.24", + "path": "es5-ext@0.10.24", "dev": false, "isMissing": false, "isPeer": false, @@ -31,7 +31,7 @@ "version": "0.10.24", "dependencies": [ { - "path": "registry.npmjs.org/es6-iterator/2.0.1", + "path": "es6-iterator@2.0.1", "dev": false, "isMissing": false, "isPeer": false, @@ -42,7 +42,7 @@ "circular": true }, { - "path": "registry.npmjs.org/es6-symbol/3.1.1", + "path": "es6-symbol@3.1.1", "dev": false, "isMissing": false, "isPeer": false, @@ -52,7 +52,7 @@ "version": "3.1.1", "dependencies": [ { - "path": "registry.npmjs.org/d/1.0.0", + "path": "d@1.0.0", "dev": false, "isMissing": false, "isPeer": false, @@ -63,7 +63,7 @@ "circular": true }, { - "path": "registry.npmjs.org/es5-ext/0.10.24", + "path": "es5-ext@0.10.24", "dev": false, "isMissing": false, "isPeer": false, @@ -80,7 +80,7 @@ ] }, { - "path": "registry.npmjs.org/es5-ext/0.10.24", + "path": "es5-ext@0.10.24", "dev": false, "isMissing": false, "isPeer": false, @@ -90,7 +90,7 @@ "version": "0.10.24", "dependencies": [ { - "path": "registry.npmjs.org/es6-iterator/2.0.1", + "path": "es6-iterator@2.0.1", "dev": false, "isMissing": false, "isPeer": false, @@ -101,7 +101,7 @@ "circular": true }, { - "path": "registry.npmjs.org/es6-symbol/3.1.1", + "path": "es6-symbol@3.1.1", "dev": false, "isMissing": false, "isPeer": false, @@ -111,7 +111,7 @@ "version": "3.1.1", "dependencies": [ { - "path": "registry.npmjs.org/d/1.0.0", + "path": "d@1.0.0", "dev": false, "isMissing": false, "isPeer": false, @@ -121,7 +121,7 @@ "version": "1.0.0", "dependencies": [ { - "path": "registry.npmjs.org/es5-ext/0.10.24", + "path": "es5-ext@0.10.24", "dev": false, "isMissing": false, "isPeer": false, @@ -134,7 +134,7 @@ ] }, { - "path": "registry.npmjs.org/es5-ext/0.10.24", + "path": "es5-ext@0.10.24", "dev": false, "isMissing": false, "isPeer": false, @@ -149,7 +149,7 @@ ] }, { - "path": "registry.npmjs.org/es6-symbol/3.1.1", + "path": "es6-symbol@3.1.1", "dev": false, "isMissing": false, "isPeer": false, @@ -159,7 +159,7 @@ "version": "3.1.1", "dependencies": [ { - "path": "registry.npmjs.org/d/1.0.0", + "path": "d@1.0.0", "dev": false, "isMissing": false, "isPeer": false, @@ -169,7 +169,7 @@ "version": "1.0.0", "dependencies": [ { - "path": "registry.npmjs.org/es5-ext/0.10.24", + "path": "es5-ext@0.10.24", "dev": false, "isMissing": false, "isPeer": false, @@ -179,7 +179,7 @@ "version": "0.10.24", "dependencies": [ { - "path": "registry.npmjs.org/es6-iterator/2.0.1", + "path": "es6-iterator@2.0.1", "dev": false, "isMissing": false, "isPeer": false, @@ -190,7 +190,7 @@ "circular": true }, { - "path": "registry.npmjs.org/es6-symbol/3.1.1", + "path": "es6-symbol@3.1.1", "dev": false, "isMissing": false, "isPeer": false, @@ -205,7 +205,7 @@ ] }, { - "path": "registry.npmjs.org/es5-ext/0.10.24", + "path": "es5-ext@0.10.24", "dev": false, "isMissing": false, "isPeer": false, @@ -215,7 +215,7 @@ "version": "0.10.24", "dependencies": [ { - "path": "registry.npmjs.org/es6-iterator/2.0.1", + "path": "es6-iterator@2.0.1", "dev": false, "isMissing": false, "isPeer": false, @@ -226,7 +226,7 @@ "circular": true }, { - "path": "registry.npmjs.org/es6-symbol/3.1.1", + "path": "es6-symbol@3.1.1", "dev": false, "isMissing": false, "isPeer": false, diff --git a/packages/dependencies-hierarchy/test/index.ts b/packages/dependencies-hierarchy/test/index.ts index 20053c64e9..3903bb0fa4 100644 --- a/packages/dependencies-hierarchy/test/index.ts +++ b/packages/dependencies-hierarchy/test/index.ts @@ -4,12 +4,12 @@ import dh, { PackageNode } from 'dependencies-hierarchy' import path = require('path') import test = require('tape') -const fixtures = path.join(__dirname, '..', 'fixtures') +const fixtures = path.join(__dirname, '../../../fixtures') const generalFixture = path.join(fixtures, 'general') const withPeerFixture = path.join(fixtures, 'with-peer') const circularFixture = path.join(fixtures, 'circular') const withFileDepFixture = path.join(fixtures, 'with-file-dep') -const withLinksOnlyFixture = path.join(__dirname, '..', 'fixtureWithLinks', 'with-links-only') +const withLinksOnlyFixture = path.join(fixtures, 'fixtureWithLinks/with-links-only') const withUnsavedDepsFixture = path.join(fixtures, 'with-unsaved-deps') const fixtureMonorepo = path.join(__dirname, '..', 'fixtureMonorepo') const withAliasedDepFixture = path.join(fixtures, 'with-aliased-dep') @@ -28,7 +28,7 @@ test('one package depth 0', async t => { isPeer: false, isSkipped: false, name: 'minimatch', - path: path.join(modulesDir, '.pnpm/registry.npmjs.org/minimatch/3.0.4'), + path: path.join(modulesDir, '.pnpm/minimatch@3.0.4'), resolved: 'https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz', version: '3.0.4', }, @@ -39,7 +39,7 @@ test('one package depth 0', async t => { isPeer: false, isSkipped: false, name: 'rimraf', - path: path.join(modulesDir, '.pnpm/registry.npmjs.org/rimraf/2.5.1'), + path: path.join(modulesDir, '.pnpm/rimraf@2.5.1'), resolved: 'https://registry.npmjs.org/rimraf/-/rimraf-2.5.1.tgz', version: '2.5.1', }, @@ -52,7 +52,7 @@ test('one package depth 0', async t => { isPeer: false, isSkipped: false, name: 'is-positive', - path: path.join(modulesDir, '.pnpm/registry.npmjs.org/is-positive/1.0.0'), + path: path.join(modulesDir, '.pnpm/is-positive@1.0.0'), resolved: 'https://registry.npmjs.org/is-positive/-/is-positive-1.0.0.tgz', version: '1.0.0', }, @@ -66,7 +66,7 @@ test('one package depth 0', async t => { isSkipped: false, name: 'is-negative', optional: true, - path: path.join(modulesDir, '.pnpm/registry.npmjs.org/is-negative/1.0.0'), + path: path.join(modulesDir, '.pnpm/is-negative@1.0.0'), resolved: 'https://registry.npmjs.org/is-negative/-/is-negative-1.0.0.tgz', version: '1.0.0', }, @@ -91,7 +91,7 @@ test('one package depth 1', async t => { isPeer: false, isSkipped: false, name: 'minimatch', - path: path.join(modulesDir, '.pnpm/registry.npmjs.org/minimatch/3.0.4'), + path: path.join(modulesDir, '.pnpm/minimatch@3.0.4'), resolved: 'https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz', version: '3.0.4', @@ -103,7 +103,7 @@ test('one package depth 1', async t => { isPeer: false, isSkipped: false, name: 'brace-expansion', - path: path.join(modulesDir, '.pnpm/registry.npmjs.org/brace-expansion/1.1.8'), + path: path.join(modulesDir, '.pnpm/brace-expansion@1.1.8'), resolved: 'https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.8.tgz', version: '1.1.8', }, @@ -116,7 +116,7 @@ test('one package depth 1', async t => { isPeer: false, isSkipped: false, name: 'rimraf', - path: path.join(modulesDir, '.pnpm/registry.npmjs.org/rimraf/2.5.1'), + path: path.join(modulesDir, '.pnpm/rimraf@2.5.1'), resolved: 'https://registry.npmjs.org/rimraf/-/rimraf-2.5.1.tgz', version: '2.5.1', @@ -128,7 +128,7 @@ test('one package depth 1', async t => { isPeer: false, isSkipped: false, name: 'glob', - path: path.join(modulesDir, '.pnpm/registry.npmjs.org/glob/6.0.4'), + path: path.join(modulesDir, '.pnpm/glob@6.0.4'), resolved: 'https://registry.npmjs.org/glob/-/glob-6.0.4.tgz', version: '6.0.4', }, @@ -143,7 +143,7 @@ test('one package depth 1', async t => { isPeer: false, isSkipped: false, name: 'is-positive', - path: path.join(modulesDir, '.pnpm/registry.npmjs.org/is-positive/1.0.0'), + path: path.join(modulesDir, '.pnpm/is-positive@1.0.0'), resolved: 'https://registry.npmjs.org/is-positive/-/is-positive-1.0.0.tgz', version: '1.0.0', }, @@ -157,7 +157,7 @@ test('one package depth 1', async t => { isSkipped: false, name: 'is-negative', optional: true, - path: path.join(modulesDir, '.pnpm/registry.npmjs.org/is-negative/1.0.0'), + path: path.join(modulesDir, '.pnpm/is-negative@1.0.0'), resolved: 'https://registry.npmjs.org/is-negative/-/is-negative-1.0.0.tgz', version: '1.0.0', }, @@ -193,7 +193,7 @@ test('only prod depth 0', async t => { isPeer: false, isSkipped: false, name: 'minimatch', - path: path.join(modulesDir, '.pnpm/registry.npmjs.org/minimatch/3.0.4'), + path: path.join(modulesDir, '.pnpm/minimatch@3.0.4'), resolved: 'https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz', version: '3.0.4', }, @@ -204,7 +204,7 @@ test('only prod depth 0', async t => { isPeer: false, isSkipped: false, name: 'rimraf', - path: path.join(modulesDir, '.pnpm/registry.npmjs.org/rimraf/2.5.1'), + path: path.join(modulesDir, '.pnpm/rimraf@2.5.1'), resolved: 'https://registry.npmjs.org/rimraf/-/rimraf-2.5.1.tgz', version: '2.5.1', }, @@ -240,7 +240,7 @@ test('only dev depth 0', async t => { isPeer: false, isSkipped: false, name: 'is-positive', - path: path.join(modulesDir, '.pnpm/registry.npmjs.org/is-positive/1.0.0'), + path: path.join(modulesDir, '.pnpm/is-positive@1.0.0'), resolved: 'https://registry.npmjs.org/is-positive/-/is-positive-1.0.0.tgz', version: '1.0.0', }, @@ -290,7 +290,7 @@ test('filter 1 package with depth 0', async t => { isPeer: false, isSkipped: false, name: 'rimraf', - path: path.join(modulesDir, '.pnpm/registry.npmjs.org/rimraf/2.5.1'), + path: path.join(modulesDir, '.pnpm/rimraf@2.5.1'), resolved: 'https://registry.npmjs.org/rimraf/-/rimraf-2.5.1.tgz', searched: true, version: '2.5.1', @@ -361,7 +361,7 @@ test('local package depth 0', async t => { isPeer: false, isSkipped: false, name: 'is-positive', - path: path.join(modulesDir, '.pnpm/registry.npmjs.org/is-positive/3.1.0'), + path: path.join(modulesDir, '.pnpm/is-positive@3.1.0'), resolved: 'https://registry.npmjs.org/is-positive/-/is-positive-3.1.0.tgz', version: '3.1.0', }, @@ -386,7 +386,7 @@ test('on a package that has only links', async t => { isPeer: false, isSkipped: false, name: 'general', - path: path.join(__dirname, '..', 'fixtureWithLinks', 'general'), + path: path.join(fixtures, 'fixtureWithLinks/general'), version: 'link:../general', }, ], @@ -412,7 +412,7 @@ test('unsaved dependencies are listed', async t => { isPeer: false, isSkipped: false, name: 'symlink-dir', - path: path.join(modulesDir, '.pnpm/registry.npmjs.org/symlink-dir/2.0.2'), + path: path.join(modulesDir, '.pnpm/symlink-dir@2.0.2'), resolved: 'https://registry.npmjs.org/symlink-dir/-/symlink-dir-2.0.2.tgz', version: '2.0.2', }, @@ -429,15 +429,6 @@ test('unsaved dependencies are listed', async t => { path: generalFixture, version: 'link:../general', }, - { - alias: 'is-positive', - isMissing: false, - isPeer: false, - isSkipped: false, - name: 'is-positive', - path: path.join(modulesDir, 'is-positive'), - version: '3.1.0', - }, ], }, } @@ -466,7 +457,7 @@ test('unsaved dependencies are listed and filtered', async t => { isPeer: false, isSkipped: false, name: 'symlink-dir', - path: path.join(modulesDir, '.pnpm/registry.npmjs.org/symlink-dir/2.0.2'), + path: path.join(modulesDir, '.pnpm/symlink-dir@2.0.2'), resolved: 'https://registry.npmjs.org/symlink-dir/-/symlink-dir-2.0.2.tgz', searched: true, version: '2.0.2', @@ -500,7 +491,7 @@ test('dependency with an alias', async t => { isPeer: false, isSkipped: false, name: 'is-positive', - path: path.join(modulesDir, '.pnpm/registry.npmjs.org/is-positive/1.0.0'), + path: path.join(modulesDir, '.pnpm/is-positive@1.0.0'), resolved: 'https://registry.npmjs.org/is-positive/-/is-positive-1.0.0.tgz', version: '1.0.0', }, diff --git a/packages/list/test/fixture-with-external-shrinkwrap/.gitignore b/packages/list/test/fixture-with-external-shrinkwrap/.gitignore deleted file mode 100644 index cf4bab9ddd..0000000000 --- a/packages/list/test/fixture-with-external-shrinkwrap/.gitignore +++ /dev/null @@ -1 +0,0 @@ -!node_modules diff --git a/packages/list/test/fixture-with-external-shrinkwrap/node_modules/.modules.yaml b/packages/list/test/fixture-with-external-shrinkwrap/node_modules/.modules.yaml deleted file mode 100644 index 78002f193d..0000000000 --- a/packages/list/test/fixture-with-external-shrinkwrap/node_modules/.modules.yaml +++ /dev/null @@ -1,13 +0,0 @@ -importers: - pkg: - hoistedAliases: {} - shamefullyFlatten: false -included: - dependencies: true - devDependencies: true - optionalDependencies: true -layoutVersion: 1 -packageManager: pnpm@2.17.0-4 -pendingBuilds: [] -skipped: [] -store: /home/zoltan/.pnpm-store/2 diff --git a/packages/list/test/fixture-with-external-shrinkwrap/node_modules/.pnpm/lock.yaml b/packages/list/test/fixture-with-external-shrinkwrap/node_modules/.pnpm/lock.yaml deleted file mode 100644 index 76d822a10e..0000000000 --- a/packages/list/test/fixture-with-external-shrinkwrap/node_modules/.pnpm/lock.yaml +++ /dev/null @@ -1,14 +0,0 @@ -importers: - pkg: - dependencies: - is-positive: 1.0.0 - specifiers: - is-positive: 1.0.0 -lockfileVersion: 5 -packages: - /is-positive/1.0.0: - dev: false - engines: - node: '>=0.10.0' - resolution: - integrity: sha1-iACYVrZKLx632LsBeUGEJK4EUss= diff --git a/packages/list/test/fixture-with-external-shrinkwrap/node_modules/.pnpm/registry.npmjs.org/is-positive/1.0.0/node_modules/is-positive/index.js b/packages/list/test/fixture-with-external-shrinkwrap/node_modules/.pnpm/registry.npmjs.org/is-positive/1.0.0/node_modules/is-positive/index.js deleted file mode 100644 index 8e020cac33..0000000000 --- a/packages/list/test/fixture-with-external-shrinkwrap/node_modules/.pnpm/registry.npmjs.org/is-positive/1.0.0/node_modules/is-positive/index.js +++ /dev/null @@ -1,9 +0,0 @@ -'use strict'; - -module.exports = function (n) { - if (typeof n !== 'number') { - throw new TypeError('Expected a number'); - } - - return n >= 0; -}; diff --git a/packages/list/test/fixture-with-external-shrinkwrap/node_modules/.pnpm/registry.npmjs.org/is-positive/1.0.0/node_modules/is-positive/license b/packages/list/test/fixture-with-external-shrinkwrap/node_modules/.pnpm/registry.npmjs.org/is-positive/1.0.0/node_modules/is-positive/license deleted file mode 100644 index 0f8cf79c3c..0000000000 --- a/packages/list/test/fixture-with-external-shrinkwrap/node_modules/.pnpm/registry.npmjs.org/is-positive/1.0.0/node_modules/is-positive/license +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) Kevin Martensson (github.com/kevva) - -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. diff --git a/packages/list/test/fixture-with-external-shrinkwrap/node_modules/.pnpm/registry.npmjs.org/is-positive/1.0.0/node_modules/is-positive/package.json b/packages/list/test/fixture-with-external-shrinkwrap/node_modules/.pnpm/registry.npmjs.org/is-positive/1.0.0/node_modules/is-positive/package.json deleted file mode 100644 index 5c708cef76..0000000000 --- a/packages/list/test/fixture-with-external-shrinkwrap/node_modules/.pnpm/registry.npmjs.org/is-positive/1.0.0/node_modules/is-positive/package.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "name": "is-positive", - "version": "1.0.0", - "description": "Test if a number is positive", - "license": "MIT", - "repository": "kevva/is-positive", - "author": { - "name": "Kevin Martensson", - "email": "kevinmartensson@gmail.com", - "url": "github.com/kevva" - }, - "engines": { - "node": ">=0.10.0" - }, - "scripts": { - "test": "node test.js" - }, - "files": [ - "index.js" - ], - "keywords": [ - "number", - "positive", - "test" - ], - "devDependencies": { - "ava": "^0.0.4" - } -} diff --git a/packages/list/test/fixture-with-external-shrinkwrap/node_modules/.pnpm/registry.npmjs.org/is-positive/1.0.0/node_modules/is-positive/readme.md b/packages/list/test/fixture-with-external-shrinkwrap/node_modules/.pnpm/registry.npmjs.org/is-positive/1.0.0/node_modules/is-positive/readme.md deleted file mode 100644 index 07b59926c5..0000000000 --- a/packages/list/test/fixture-with-external-shrinkwrap/node_modules/.pnpm/registry.npmjs.org/is-positive/1.0.0/node_modules/is-positive/readme.md +++ /dev/null @@ -1,31 +0,0 @@ -# is-positive [![Build Status](https://travis-ci.org/kevva/is-positive.svg?branch=master)](https://travis-ci.org/kevva/is-positive) - -> Test if a number is positive - - -## Install - -``` -$ npm install --save is-positive -``` - - -## Usage - -```js -var isPositive = require('is-positive'); - -isPositive(1); -//=> true - -isPositive(0); -//=> true - -isPositive(-1); -//=> false -``` - - -## License - -MIT © [Kevin Martensson](http://github.com/kevva) diff --git a/packages/list/test/fixture-with-external-shrinkwrap/pkg/node_modules/is-positive b/packages/list/test/fixture-with-external-shrinkwrap/pkg/node_modules/is-positive deleted file mode 120000 index d223c3576f..0000000000 --- a/packages/list/test/fixture-with-external-shrinkwrap/pkg/node_modules/is-positive +++ /dev/null @@ -1 +0,0 @@ -../../../../../../../../../.pnpm-store/2/registry.npmjs.org/is-positive/1.0.0/node_modules/is-positive \ No newline at end of file diff --git a/packages/list/test/fixture-with-no-pkg-name-and-no-version/.gitignore b/packages/list/test/fixture-with-no-pkg-name-and-no-version/.gitignore deleted file mode 100644 index cf4bab9ddd..0000000000 --- a/packages/list/test/fixture-with-no-pkg-name-and-no-version/.gitignore +++ /dev/null @@ -1 +0,0 @@ -!node_modules diff --git a/packages/list/test/fixture-with-no-pkg-name-and-no-version/node_modules/.modules.yaml b/packages/list/test/fixture-with-no-pkg-name-and-no-version/node_modules/.modules.yaml deleted file mode 100644 index 2f7cf36f68..0000000000 --- a/packages/list/test/fixture-with-no-pkg-name-and-no-version/node_modules/.modules.yaml +++ /dev/null @@ -1,11 +0,0 @@ -included: - dependencies: true - devDependencies: true - optionalDependencies: true -layoutVersion: 3 -packageManager: pnpm@3.8.1 -pendingBuilds: [] -registries: - default: 'https://registry.npmjs.org/' -skipped: [] -store: /home/zoltan/.pnpm-store/2 diff --git a/packages/list/test/fixture-with-no-pkg-name-and-no-version/node_modules/.pnpm/lock.yaml b/packages/list/test/fixture-with-no-pkg-name-and-no-version/node_modules/.pnpm/lock.yaml deleted file mode 100644 index 688ab59425..0000000000 --- a/packages/list/test/fixture-with-no-pkg-name-and-no-version/node_modules/.pnpm/lock.yaml +++ /dev/null @@ -1,94 +0,0 @@ -dependencies: - write-json-file: 2.3.0 -devDependencies: - is-positive: 3.1.0 -lockfileVersion: 5.1 -optionalDependencies: - is-negative: 2.1.0 -packages: - /detect-indent/5.0.0: - dev: false - engines: - node: '>=4' - resolution: - integrity: sha1-OHHMCmoALow+Wzz38zYmRnXwa50= - /graceful-fs/4.2.2: - dev: false - resolution: - integrity: sha512-IItsdsea19BoLC7ELy13q1iJFNmd7ofZH5+X/pJr90/nRoPEX0DJo1dHDbgtYWOhJhcCgMDTOw84RZ72q6lB+Q== - /imurmurhash/0.1.4: - dev: false - engines: - node: '>=0.8.19' - resolution: - integrity: sha1-khi5srkoojixPcT7a21XbyMUU+o= - /is-negative/2.1.0: - dev: false - engines: - node: '>=0.10.0' - optional: true - resolution: - integrity: sha1-8Nhjd6oVpkw0lh84rCqb4rQKEYc= - /is-plain-obj/1.1.0: - dev: false - engines: - node: '>=0.10.0' - resolution: - integrity: sha1-caUMhCnfync8kqOQpKA7OfzVHT4= - /is-positive/3.1.0: - dev: true - engines: - node: '>=0.10.0' - resolution: - integrity: sha1-hX21hKG6XRyymAUn/DtsQ103sP0= - /make-dir/1.3.0: - dependencies: - pify: 3.0.0 - dev: false - engines: - node: '>=4' - resolution: - integrity: sha512-2w31R7SJtieJJnQtGc7RVL2StM2vGYVfqUOvUDxH6bC6aJTxPxTF0GnIgCyu7tjockiUWAYQRbxa7vKn34s5sQ== - /pify/3.0.0: - dev: false - engines: - node: '>=4' - resolution: - integrity: sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY= - /signal-exit/3.0.2: - dev: false - resolution: - integrity: sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0= - /sort-keys/2.0.0: - dependencies: - is-plain-obj: 1.1.0 - dev: false - engines: - node: '>=4' - resolution: - integrity: sha1-ZYU1WEhh7JfXMNbPQYIuH1ZoQSg= - /write-file-atomic/2.4.3: - dependencies: - graceful-fs: 4.2.2 - imurmurhash: 0.1.4 - signal-exit: 3.0.2 - dev: false - resolution: - integrity: sha512-GaETH5wwsX+GcnzhPgKcKjJ6M2Cq3/iZp1WyY/X1CSqrW+jVNM9Y7D8EC2sM4ZG/V8wZlSniJnCKWPmBYAucRQ== - /write-json-file/2.3.0: - dependencies: - detect-indent: 5.0.0 - graceful-fs: 4.2.2 - make-dir: 1.3.0 - pify: 3.0.0 - sort-keys: 2.0.0 - write-file-atomic: 2.4.3 - dev: false - engines: - node: '>=4' - resolution: - integrity: sha1-K2TIozAE1UuGmMdtWFp3zrYdoy8= -specifiers: - is-negative: ^2.1.0 - is-positive: ^3.1.0 - write-json-file: ^2.2.0 diff --git a/packages/list/test/fixture-with-no-pkg-name-and-no-version/node_modules/.pnpm/registry.npmjs.org/make-dir/1.3.0/node_modules/make-dir/index.js b/packages/list/test/fixture-with-no-pkg-name-and-no-version/node_modules/.pnpm/registry.npmjs.org/make-dir/1.3.0/node_modules/make-dir/index.js deleted file mode 100644 index 18439555f8..0000000000 --- a/packages/list/test/fixture-with-no-pkg-name-and-no-version/node_modules/.pnpm/registry.npmjs.org/make-dir/1.3.0/node_modules/make-dir/index.js +++ /dev/null @@ -1,85 +0,0 @@ -'use strict'; -const fs = require('fs'); -const path = require('path'); -const pify = require('pify'); - -const defaults = { - mode: 0o777 & (~process.umask()), - fs -}; - -// https://github.com/nodejs/node/issues/8987 -// https://github.com/libuv/libuv/pull/1088 -const checkPath = pth => { - if (process.platform === 'win32') { - const pathHasInvalidWinCharacters = /[<>:"|?*]/.test(pth.replace(path.parse(pth).root, '')); - - if (pathHasInvalidWinCharacters) { - const err = new Error(`Path contains invalid characters: ${pth}`); - err.code = 'EINVAL'; - throw err; - } - } -}; - -module.exports = (input, opts) => Promise.resolve().then(() => { - checkPath(input); - opts = Object.assign({}, defaults, opts); - - const mkdir = pify(opts.fs.mkdir); - const stat = pify(opts.fs.stat); - - const make = pth => { - return mkdir(pth, opts.mode) - .then(() => pth) - .catch(err => { - if (err.code === 'ENOENT') { - if (err.message.includes('null bytes') || path.dirname(pth) === pth) { - throw err; - } - - return make(path.dirname(pth)).then(() => make(pth)); - } - - return stat(pth) - .then(stats => stats.isDirectory() ? pth : Promise.reject()) - .catch(() => { - throw err; - }); - }); - }; - - return make(path.resolve(input)); -}); - -module.exports.sync = (input, opts) => { - checkPath(input); - opts = Object.assign({}, defaults, opts); - - const make = pth => { - try { - opts.fs.mkdirSync(pth, opts.mode); - } catch (err) { - if (err.code === 'ENOENT') { - if (err.message.includes('null bytes') || path.dirname(pth) === pth) { - throw err; - } - - make(path.dirname(pth)); - return make(pth); - } - - try { - if (!opts.fs.statSync(pth).isDirectory()) { - throw new Error('The path is not a directory'); - } - } catch (_) { - throw err; - } - } - - return pth; - }; - - return make(path.resolve(input)); -}; diff --git a/packages/list/test/fixture-with-no-pkg-name-and-no-version/node_modules/.pnpm/registry.npmjs.org/make-dir/1.3.0/node_modules/make-dir/license b/packages/list/test/fixture-with-no-pkg-name-and-no-version/node_modules/.pnpm/registry.npmjs.org/make-dir/1.3.0/node_modules/make-dir/license deleted file mode 100644 index e7af2f7710..0000000000 --- a/packages/list/test/fixture-with-no-pkg-name-and-no-version/node_modules/.pnpm/registry.npmjs.org/make-dir/1.3.0/node_modules/make-dir/license +++ /dev/null @@ -1,9 +0,0 @@ -MIT License - -Copyright (c) Sindre Sorhus (sindresorhus.com) - -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. diff --git a/packages/list/test/fixture-with-no-pkg-name-and-no-version/node_modules/.pnpm/registry.npmjs.org/make-dir/1.3.0/node_modules/make-dir/package.json b/packages/list/test/fixture-with-no-pkg-name-and-no-version/node_modules/.pnpm/registry.npmjs.org/make-dir/1.3.0/node_modules/make-dir/package.json deleted file mode 100644 index ec907a71f8..0000000000 --- a/packages/list/test/fixture-with-no-pkg-name-and-no-version/node_modules/.pnpm/registry.npmjs.org/make-dir/1.3.0/node_modules/make-dir/package.json +++ /dev/null @@ -1,54 +0,0 @@ -{ - "name": "make-dir", - "version": "1.3.0", - "description": "Make a directory and its parents if needed - Think `mkdir -p`", - "license": "MIT", - "repository": "sindresorhus/make-dir", - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" - }, - "engines": { - "node": ">=4" - }, - "scripts": { - "test": "xo && nyc ava" - }, - "files": [ - "index.js" - ], - "keywords": [ - "mkdir", - "mkdirp", - "make", - "directories", - "dir", - "dirs", - "folders", - "directory", - "folder", - "path", - "parent", - "parents", - "intermediate", - "recursively", - "recursive", - "create", - "fs", - "filesystem", - "file-system" - ], - "dependencies": { - "pify": "^3.0.0" - }, - "devDependencies": { - "ava": "*", - "codecov": "^3.0.0", - "graceful-fs": "^4.1.11", - "nyc": "^11.3.0", - "path-type": "^3.0.0", - "tempy": "^0.2.1", - "xo": "^0.20.0" - } -} diff --git a/packages/list/test/fixture-with-no-pkg-name-and-no-version/node_modules/.pnpm/registry.npmjs.org/make-dir/1.3.0/node_modules/make-dir/readme.md b/packages/list/test/fixture-with-no-pkg-name-and-no-version/node_modules/.pnpm/registry.npmjs.org/make-dir/1.3.0/node_modules/make-dir/readme.md deleted file mode 100644 index 8a32bf4714..0000000000 --- a/packages/list/test/fixture-with-no-pkg-name-and-no-version/node_modules/.pnpm/registry.npmjs.org/make-dir/1.3.0/node_modules/make-dir/readme.md +++ /dev/null @@ -1,116 +0,0 @@ -# make-dir [![Build Status: macOS & Linux](https://travis-ci.org/sindresorhus/make-dir.svg?branch=master)](https://travis-ci.org/sindresorhus/make-dir) [![Build status: Windows](https://ci.appveyor.com/api/projects/status/e0vtt8y600w91gcs/branch/master?svg=true)](https://ci.appveyor.com/project/sindresorhus/make-dir/branch/master) [![codecov](https://codecov.io/gh/sindresorhus/make-dir/branch/master/graph/badge.svg)](https://codecov.io/gh/sindresorhus/make-dir) - -> Make a directory and its parents if needed - Think `mkdir -p` - - -## Advantages over [`mkdirp`](https://github.com/substack/node-mkdirp) - -- Promise API *(Async/await ready!)* -- Fixes many `mkdirp` issues: [#96](https://github.com/substack/node-mkdirp/pull/96) [#70](https://github.com/substack/node-mkdirp/issues/70) [#66](https://github.com/substack/node-mkdirp/issues/66) -- 100% test coverage -- CI-tested on macOS, Linux, and Windows -- Actively maintained -- Doesn't bundle a CLI - - -## Install - -``` -$ npm install make-dir -``` - - -## Usage - -``` -$ pwd -/Users/sindresorhus/fun -$ tree -. -``` - -```js -const makeDir = require('make-dir'); - -makeDir('unicorn/rainbow/cake').then(path => { - console.log(path); - //=> '/Users/sindresorhus/fun/unicorn/rainbow/cake' -}); -``` - -``` -$ tree -. -└── unicorn - └── rainbow - └── cake -``` - -Multiple directories: - -```js -const makeDir = require('make-dir'); - -Promise.all([ - makeDir('unicorn/rainbow') - makeDir('foo/bar') -]).then(paths => { - console.log(paths); - /* - [ - '/Users/sindresorhus/fun/unicorn/rainbow', - '/Users/sindresorhus/fun/foo/bar' - ] - */ -}); -``` - - -## API - -### makeDir(path, [options]) - -Returns a `Promise` for the path to the created directory. - -### makeDir.sync(path, [options]) - -Returns the path to the created directory. - -#### path - -Type: `string` - -Directory to create. - -#### options - -Type: `Object` - -##### mode - -Type: `integer`
-Default: `0o777 & (~process.umask())` - -Directory [permissions](https://x-team.com/blog/file-system-permissions-umask-node-js/). - -##### fs - -Type: `Object`
-Default: `require('fs')` - -Use a custom `fs` implementation. For example [`graceful-fs`](https://github.com/isaacs/node-graceful-fs). - - -## Related - -- [make-dir-cli](https://github.com/sindresorhus/make-dir-cli) - CLI for this module -- [del](https://github.com/sindresorhus/del) - Delete files and directories -- [globby](https://github.com/sindresorhus/globby) - User-friendly glob matching -- [cpy](https://github.com/sindresorhus/cpy) - Copy files -- [cpy-cli](https://github.com/sindresorhus/cpy-cli) - Copy files on the command-line -- [move-file](https://github.com/sindresorhus/move-file) - Move a file - - -## License - -MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/packages/list/test/fixture-with-no-pkg-name-and-no-version/node_modules/.pnpm/registry.npmjs.org/make-dir/1.3.0/node_modules/pify b/packages/list/test/fixture-with-no-pkg-name-and-no-version/node_modules/.pnpm/registry.npmjs.org/make-dir/1.3.0/node_modules/pify deleted file mode 120000 index 9efa2a6efb..0000000000 --- a/packages/list/test/fixture-with-no-pkg-name-and-no-version/node_modules/.pnpm/registry.npmjs.org/make-dir/1.3.0/node_modules/pify +++ /dev/null @@ -1 +0,0 @@ -../../../../../../../../../../../../../.pnpm-store/2/registry.npmjs.org/pify/3.0.0/node_modules/pify \ No newline at end of file diff --git a/packages/list/test/fixture-with-no-pkg-name-and-no-version/node_modules/.pnpm/registry.npmjs.org/sort-keys/2.0.0/node_modules/is-plain-obj b/packages/list/test/fixture-with-no-pkg-name-and-no-version/node_modules/.pnpm/registry.npmjs.org/sort-keys/2.0.0/node_modules/is-plain-obj deleted file mode 120000 index aed859d2a8..0000000000 --- a/packages/list/test/fixture-with-no-pkg-name-and-no-version/node_modules/.pnpm/registry.npmjs.org/sort-keys/2.0.0/node_modules/is-plain-obj +++ /dev/null @@ -1 +0,0 @@ -../../../../../../../../../../../../../.pnpm-store/2/registry.npmjs.org/is-plain-obj/1.1.0/node_modules/is-plain-obj \ No newline at end of file diff --git a/packages/list/test/fixture-with-no-pkg-name-and-no-version/node_modules/.pnpm/registry.npmjs.org/sort-keys/2.0.0/node_modules/sort-keys/index.js b/packages/list/test/fixture-with-no-pkg-name-and-no-version/node_modules/.pnpm/registry.npmjs.org/sort-keys/2.0.0/node_modules/sort-keys/index.js deleted file mode 100644 index 53489d7888..0000000000 --- a/packages/list/test/fixture-with-no-pkg-name-and-no-version/node_modules/.pnpm/registry.npmjs.org/sort-keys/2.0.0/node_modules/sort-keys/index.js +++ /dev/null @@ -1,55 +0,0 @@ -'use strict'; -const isPlainObj = require('is-plain-obj'); - -module.exports = (obj, opts) => { - if (!isPlainObj(obj)) { - throw new TypeError('Expected a plain object'); - } - - opts = opts || {}; - - // DEPRECATED - if (typeof opts === 'function') { - throw new TypeError('Specify the compare function as an option instead'); - } - - const deep = opts.deep; - const seenInput = []; - const seenOutput = []; - - const sortKeys = x => { - const seenIndex = seenInput.indexOf(x); - - if (seenIndex !== -1) { - return seenOutput[seenIndex]; - } - - const ret = {}; - const keys = Object.keys(x).sort(opts.compare); - - seenInput.push(x); - seenOutput.push(ret); - - for (let i = 0; i < keys.length; i++) { - const key = keys[i]; - const val = x[key]; - - if (deep && Array.isArray(val)) { - const retArr = []; - - for (let j = 0; j < val.length; j++) { - retArr[j] = isPlainObj(val[j]) ? sortKeys(val[j]) : val[j]; - } - - ret[key] = retArr; - continue; - } - - ret[key] = deep && isPlainObj(val) ? sortKeys(val) : val; - } - - return ret; - }; - - return sortKeys(obj); -}; diff --git a/packages/list/test/fixture-with-no-pkg-name-and-no-version/node_modules/.pnpm/registry.npmjs.org/sort-keys/2.0.0/node_modules/sort-keys/license b/packages/list/test/fixture-with-no-pkg-name-and-no-version/node_modules/.pnpm/registry.npmjs.org/sort-keys/2.0.0/node_modules/sort-keys/license deleted file mode 100644 index e7af2f7710..0000000000 --- a/packages/list/test/fixture-with-no-pkg-name-and-no-version/node_modules/.pnpm/registry.npmjs.org/sort-keys/2.0.0/node_modules/sort-keys/license +++ /dev/null @@ -1,9 +0,0 @@ -MIT License - -Copyright (c) Sindre Sorhus (sindresorhus.com) - -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. diff --git a/packages/list/test/fixture-with-no-pkg-name-and-no-version/node_modules/.pnpm/registry.npmjs.org/sort-keys/2.0.0/node_modules/sort-keys/package.json b/packages/list/test/fixture-with-no-pkg-name-and-no-version/node_modules/.pnpm/registry.npmjs.org/sort-keys/2.0.0/node_modules/sort-keys/package.json deleted file mode 100644 index 3da9c7659d..0000000000 --- a/packages/list/test/fixture-with-no-pkg-name-and-no-version/node_modules/.pnpm/registry.npmjs.org/sort-keys/2.0.0/node_modules/sort-keys/package.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "name": "sort-keys", - "version": "2.0.0", - "description": "Sort the keys of an object", - "license": "MIT", - "repository": "sindresorhus/sort-keys", - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" - }, - "engines": { - "node": ">=4" - }, - "scripts": { - "test": "xo && ava" - }, - "files": [ - "index.js" - ], - "keywords": [ - "sort", - "object", - "keys", - "obj", - "key", - "stable", - "deterministic", - "deep", - "recursive", - "recursively" - ], - "dependencies": { - "is-plain-obj": "^1.0.0" - }, - "devDependencies": { - "ava": "*", - "xo": "*" - } -} diff --git a/packages/list/test/fixture-with-no-pkg-name-and-no-version/node_modules/.pnpm/registry.npmjs.org/sort-keys/2.0.0/node_modules/sort-keys/readme.md b/packages/list/test/fixture-with-no-pkg-name-and-no-version/node_modules/.pnpm/registry.npmjs.org/sort-keys/2.0.0/node_modules/sort-keys/readme.md deleted file mode 100644 index a671ffb3de..0000000000 --- a/packages/list/test/fixture-with-no-pkg-name-and-no-version/node_modules/.pnpm/registry.npmjs.org/sort-keys/2.0.0/node_modules/sort-keys/readme.md +++ /dev/null @@ -1,60 +0,0 @@ -# sort-keys [![Build Status](https://travis-ci.org/sindresorhus/sort-keys.svg?branch=master)](https://travis-ci.org/sindresorhus/sort-keys) - -> Sort the keys of an object - -Useful to get a deterministically ordered object, as the order of keys can vary between engines. - - -## Install - -``` -$ npm install --save sort-keys -``` - - -## Usage - -```js -const sortKeys = require('sort-keys'); - -sortKeys({c: 0, a: 0, b: 0}); -//=> {a: 0, b: 0, c: 0} - -sortKeys({b: {b: 0, a: 0}, a: 0}, {deep: true}); -//=> {a: 0, b: {a: 0, b: 0}} - -sortKeys({c: 0, a: 0, b: 0}, { - compare: (a, b) => -a.localeCompare(b) -}); -//=> {c: 0, b: 0, a: 0} -``` - - -## API - -### sortKeys(input, [options]) - -Returns a new object with sorted keys. - -#### input - -Type: `Object` - -#### options - -##### deep - -Type: `boolean` - -Recursively sort keys. - -##### compare - -Type: `Function` - -[Compare function.](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort) - - -## License - -MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/packages/list/test/fixture-with-no-pkg-name-and-no-version/node_modules/.pnpm/registry.npmjs.org/write-file-atomic/2.4.3/node_modules/graceful-fs b/packages/list/test/fixture-with-no-pkg-name-and-no-version/node_modules/.pnpm/registry.npmjs.org/write-file-atomic/2.4.3/node_modules/graceful-fs deleted file mode 120000 index f7e698f2d8..0000000000 --- a/packages/list/test/fixture-with-no-pkg-name-and-no-version/node_modules/.pnpm/registry.npmjs.org/write-file-atomic/2.4.3/node_modules/graceful-fs +++ /dev/null @@ -1 +0,0 @@ -../../../../../../../../../../../../../.pnpm-store/2/registry.npmjs.org/graceful-fs/4.2.2/node_modules/graceful-fs \ No newline at end of file diff --git a/packages/list/test/fixture-with-no-pkg-name-and-no-version/node_modules/.pnpm/registry.npmjs.org/write-file-atomic/2.4.3/node_modules/imurmurhash b/packages/list/test/fixture-with-no-pkg-name-and-no-version/node_modules/.pnpm/registry.npmjs.org/write-file-atomic/2.4.3/node_modules/imurmurhash deleted file mode 120000 index 6ea03bf6c9..0000000000 --- a/packages/list/test/fixture-with-no-pkg-name-and-no-version/node_modules/.pnpm/registry.npmjs.org/write-file-atomic/2.4.3/node_modules/imurmurhash +++ /dev/null @@ -1 +0,0 @@ -../../../../../../../../../../../../../.pnpm-store/2/registry.npmjs.org/imurmurhash/0.1.4/node_modules/imurmurhash \ No newline at end of file diff --git a/packages/list/test/fixture-with-no-pkg-name-and-no-version/node_modules/.pnpm/registry.npmjs.org/write-file-atomic/2.4.3/node_modules/signal-exit b/packages/list/test/fixture-with-no-pkg-name-and-no-version/node_modules/.pnpm/registry.npmjs.org/write-file-atomic/2.4.3/node_modules/signal-exit deleted file mode 120000 index 70dc3a3818..0000000000 --- a/packages/list/test/fixture-with-no-pkg-name-and-no-version/node_modules/.pnpm/registry.npmjs.org/write-file-atomic/2.4.3/node_modules/signal-exit +++ /dev/null @@ -1 +0,0 @@ -../../../../../../../../../../../../../.pnpm-store/2/registry.npmjs.org/signal-exit/3.0.2/node_modules/signal-exit \ No newline at end of file diff --git a/packages/list/test/fixture-with-no-pkg-name-and-no-version/node_modules/.pnpm/registry.npmjs.org/write-file-atomic/2.4.3/node_modules/write-file-atomic/CHANGELOG.md b/packages/list/test/fixture-with-no-pkg-name-and-no-version/node_modules/.pnpm/registry.npmjs.org/write-file-atomic/2.4.3/node_modules/write-file-atomic/CHANGELOG.md deleted file mode 100644 index 920ae2cb4d..0000000000 --- a/packages/list/test/fixture-with-no-pkg-name-and-no-version/node_modules/.pnpm/registry.npmjs.org/write-file-atomic/2.4.3/node_modules/write-file-atomic/CHANGELOG.md +++ /dev/null @@ -1,25 +0,0 @@ -# 2.4.3 - -* Ignore errors raised by `fs.closeSync` when cleaning up after a write - error. - -# 2.4.2 - -* A pair of patches to fix some fd leaks. We would leak fds with sync use - when errors occured and with async use any time fsync was not in use. (#34) - -# 2.4.1 - -* Fix a bug where `signal-exit` instances would be leaked. This was fixed when addressing #35. - -# 2.4.0 - -## Features - -* Allow chown and mode options to be set to false to disable the defaulting behavior. (#20) -* Support passing encoding strings in options slot for compat with Node.js API. (#31) -* Add support for running inside of worker threads (#37) - -## Fixes - -* Remove unneeded call when returning success (#36) diff --git a/packages/list/test/fixture-with-no-pkg-name-and-no-version/node_modules/.pnpm/registry.npmjs.org/write-file-atomic/2.4.3/node_modules/write-file-atomic/LICENSE b/packages/list/test/fixture-with-no-pkg-name-and-no-version/node_modules/.pnpm/registry.npmjs.org/write-file-atomic/2.4.3/node_modules/write-file-atomic/LICENSE deleted file mode 100644 index 95e65a7706..0000000000 --- a/packages/list/test/fixture-with-no-pkg-name-and-no-version/node_modules/.pnpm/registry.npmjs.org/write-file-atomic/2.4.3/node_modules/write-file-atomic/LICENSE +++ /dev/null @@ -1,6 +0,0 @@ -Copyright (c) 2015, Rebecca Turner - -Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - diff --git a/packages/list/test/fixture-with-no-pkg-name-and-no-version/node_modules/.pnpm/registry.npmjs.org/write-file-atomic/2.4.3/node_modules/write-file-atomic/README.md b/packages/list/test/fixture-with-no-pkg-name-and-no-version/node_modules/.pnpm/registry.npmjs.org/write-file-atomic/2.4.3/node_modules/write-file-atomic/README.md deleted file mode 100644 index ca28e99a2b..0000000000 --- a/packages/list/test/fixture-with-no-pkg-name-and-no-version/node_modules/.pnpm/registry.npmjs.org/write-file-atomic/2.4.3/node_modules/write-file-atomic/README.md +++ /dev/null @@ -1,56 +0,0 @@ -write-file-atomic ------------------ - -This is an extension for node's `fs.writeFile` that makes its operation -atomic and allows you set ownership (uid/gid of the file). - -### var writeFileAtomic = require('write-file-atomic')
writeFileAtomic(filename, data, [options], callback) - -* filename **String** -* data **String** | **Buffer** -* options **Object** | **String** - * chown **Object** default, uid & gid of existing file, if any - * uid **Number** - * gid **Number** - * encoding **String** | **Null** default = 'utf8' - * fsync **Boolean** default = true - * mode **Number** default, from existing file, if any - * Promise **Object** default = native Promise object -* callback **Function** - -Atomically and asynchronously writes data to a file, replacing the file if it already -exists. data can be a string or a buffer. - -The file is initially named `filename + "." + murmurhex(__filename, process.pid, ++invocations)`. -Note that `require('worker_threads').threadId` is used in addition to `process.pid` if running inside of a worker thread. -If writeFile completes successfully then, if passed the **chown** option it will change -the ownership of the file. Finally it renames the file back to the filename you specified. If -it encounters errors at any of these steps it will attempt to unlink the temporary file and then -pass the error back to the caller. -If multiple writes are concurrently issued to the same file, the write operations are put into a queue and serialized in the order they were called, using Promises. Native promises are used by default, but you can inject your own promise-like object with the **Promise** option. Writes to different files are still executed in parallel. - -If provided, the **chown** option requires both **uid** and **gid** properties or else -you'll get an error. If **chown** is not specified it will default to using -the owner of the previous file. To prevent chown from being ran you can -also pass `false`, in which case the file will be created with the current user's credentials. - -If **mode** is not specified, it will default to using the permissions from -an existing file, if any. Expicitly setting this to `false` remove this default, resulting -in a file created with the system default permissions. - -If options is a String, it's assumed to be the **encoding** option. The **encoding** option is ignored if **data** is a buffer. It defaults to 'utf8'. - -If the **fsync** option is **false**, writeFile will skip the final fsync call. - -Example: - -```javascript -writeFileAtomic('message.txt', 'Hello Node', {chown:{uid:100,gid:50}}, function (err) { - if (err) throw err; - console.log('It\'s saved!'); -}); -``` - -### var writeFileAtomicSync = require('write-file-atomic').sync
writeFileAtomicSync(filename, data, [options]) - -The synchronous version of **writeFileAtomic**. diff --git a/packages/list/test/fixture-with-no-pkg-name-and-no-version/node_modules/.pnpm/registry.npmjs.org/write-file-atomic/2.4.3/node_modules/write-file-atomic/index.js b/packages/list/test/fixture-with-no-pkg-name-and-no-version/node_modules/.pnpm/registry.npmjs.org/write-file-atomic/2.4.3/node_modules/write-file-atomic/index.js deleted file mode 100644 index 64ae987c01..0000000000 --- a/packages/list/test/fixture-with-no-pkg-name-and-no-version/node_modules/.pnpm/registry.npmjs.org/write-file-atomic/2.4.3/node_modules/write-file-atomic/index.js +++ /dev/null @@ -1,238 +0,0 @@ -'use strict' -module.exports = writeFile -module.exports.sync = writeFileSync -module.exports._getTmpname = getTmpname // for testing -module.exports._cleanupOnExit = cleanupOnExit - -var fs = require('graceful-fs') -var MurmurHash3 = require('imurmurhash') -var onExit = require('signal-exit') -var path = require('path') -var activeFiles = {} - -// if we run inside of a worker_thread, `process.pid` is not unique -/* istanbul ignore next */ -var threadId = (function getId () { - try { - var workerThreads = require('worker_threads') - - /// if we are in main thread, this is set to `0` - return workerThreads.threadId - } catch (e) { - // worker_threads are not available, fallback to 0 - return 0 - } -})() - -var invocations = 0 -function getTmpname (filename) { - return filename + '.' + - MurmurHash3(__filename) - .hash(String(process.pid)) - .hash(String(threadId)) - .hash(String(++invocations)) - .result() -} - -function cleanupOnExit (tmpfile) { - return function () { - try { - fs.unlinkSync(typeof tmpfile === 'function' ? tmpfile() : tmpfile) - } catch (_) {} - } -} - -function writeFile (filename, data, options, callback) { - if (options) { - if (options instanceof Function) { - callback = options - options = {} - } else if (typeof options === 'string') { - options = { encoding: options } - } - } else { - options = {} - } - - var Promise = options.Promise || global.Promise - var truename - var fd - var tmpfile - /* istanbul ignore next -- The closure only gets called when onExit triggers */ - var removeOnExitHandler = onExit(cleanupOnExit(() => tmpfile)) - var absoluteName = path.resolve(filename) - - new Promise(function serializeSameFile (resolve) { - // make a queue if it doesn't already exist - if (!activeFiles[absoluteName]) activeFiles[absoluteName] = [] - - activeFiles[absoluteName].push(resolve) // add this job to the queue - if (activeFiles[absoluteName].length === 1) resolve() // kick off the first one - }).then(function getRealPath () { - return new Promise(function (resolve) { - fs.realpath(filename, function (_, realname) { - truename = realname || filename - tmpfile = getTmpname(truename) - resolve() - }) - }) - }).then(function stat () { - return new Promise(function stat (resolve) { - if (options.mode && options.chown) resolve() - else { - // Either mode or chown is not explicitly set - // Default behavior is to copy it from original file - fs.stat(truename, function (err, stats) { - if (err || !stats) resolve() - else { - options = Object.assign({}, options) - - if (options.mode == null) { - options.mode = stats.mode - } - if (options.chown == null && process.getuid) { - options.chown = { uid: stats.uid, gid: stats.gid } - } - resolve() - } - }) - } - }) - }).then(function thenWriteFile () { - return new Promise(function (resolve, reject) { - fs.open(tmpfile, 'w', options.mode, function (err, _fd) { - fd = _fd - if (err) reject(err) - else resolve() - }) - }) - }).then(function write () { - return new Promise(function (resolve, reject) { - if (Buffer.isBuffer(data)) { - fs.write(fd, data, 0, data.length, 0, function (err) { - if (err) reject(err) - else resolve() - }) - } else if (data != null) { - fs.write(fd, String(data), 0, String(options.encoding || 'utf8'), function (err) { - if (err) reject(err) - else resolve() - }) - } else resolve() - }) - }).then(function syncAndClose () { - return new Promise(function (resolve, reject) { - if (options.fsync !== false) { - fs.fsync(fd, function (err) { - if (err) fs.close(fd, () => reject(err)) - else fs.close(fd, resolve) - }) - } else { - fs.close(fd, resolve) - } - }) - }).then(function chown () { - fd = null - if (options.chown) { - return new Promise(function (resolve, reject) { - fs.chown(tmpfile, options.chown.uid, options.chown.gid, function (err) { - if (err) reject(err) - else resolve() - }) - }) - } - }).then(function chmod () { - if (options.mode) { - return new Promise(function (resolve, reject) { - fs.chmod(tmpfile, options.mode, function (err) { - if (err) reject(err) - else resolve() - }) - }) - } - }).then(function rename () { - return new Promise(function (resolve, reject) { - fs.rename(tmpfile, truename, function (err) { - if (err) reject(err) - else resolve() - }) - }) - }).then(function success () { - removeOnExitHandler() - callback() - }, function fail (err) { - return new Promise(resolve => { - return fd ? fs.close(fd, resolve) : resolve() - }).then(() => { - removeOnExitHandler() - fs.unlink(tmpfile, function () { - callback(err) - }) - }) - }).then(function checkQueue () { - activeFiles[absoluteName].shift() // remove the element added by serializeSameFile - if (activeFiles[absoluteName].length > 0) { - activeFiles[absoluteName][0]() // start next job if one is pending - } else delete activeFiles[absoluteName] - }) -} - -function writeFileSync (filename, data, options) { - if (typeof options === 'string') options = { encoding: options } - else if (!options) options = {} - try { - filename = fs.realpathSync(filename) - } catch (ex) { - // it's ok, it'll happen on a not yet existing file - } - var tmpfile = getTmpname(filename) - - if (!options.mode || !options.chown) { - // Either mode or chown is not explicitly set - // Default behavior is to copy it from original file - try { - var stats = fs.statSync(filename) - options = Object.assign({}, options) - if (!options.mode) { - options.mode = stats.mode - } - if (!options.chown && process.getuid) { - options.chown = { uid: stats.uid, gid: stats.gid } - } - } catch (ex) { - // ignore stat errors - } - } - - var fd - var cleanup = cleanupOnExit(tmpfile) - var removeOnExitHandler = onExit(cleanup) - - try { - fd = fs.openSync(tmpfile, 'w', options.mode) - if (Buffer.isBuffer(data)) { - fs.writeSync(fd, data, 0, data.length, 0) - } else if (data != null) { - fs.writeSync(fd, String(data), 0, String(options.encoding || 'utf8')) - } - if (options.fsync !== false) { - fs.fsyncSync(fd) - } - fs.closeSync(fd) - if (options.chown) fs.chownSync(tmpfile, options.chown.uid, options.chown.gid) - if (options.mode) fs.chmodSync(tmpfile, options.mode) - fs.renameSync(tmpfile, filename) - removeOnExitHandler() - } catch (err) { - if (fd) { - try { - fs.closeSync(fd) - } catch (ex) { - // ignore close errors at this stage, error may have closed fd already. - } - } - removeOnExitHandler() - cleanup() - throw err - } -} diff --git a/packages/list/test/fixture-with-no-pkg-name-and-no-version/node_modules/.pnpm/registry.npmjs.org/write-file-atomic/2.4.3/node_modules/write-file-atomic/package.json b/packages/list/test/fixture-with-no-pkg-name-and-no-version/node_modules/.pnpm/registry.npmjs.org/write-file-atomic/2.4.3/node_modules/write-file-atomic/package.json deleted file mode 100644 index bbb0fa2345..0000000000 --- a/packages/list/test/fixture-with-no-pkg-name-and-no-version/node_modules/.pnpm/registry.npmjs.org/write-file-atomic/2.4.3/node_modules/write-file-atomic/package.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "name": "write-file-atomic", - "version": "2.4.3", - "description": "Write files in an atomic fashion w/configurable ownership", - "main": "index.js", - "scripts": { - "test": "standard && tap --100 test/*.js", - "preversion": "npm test", - "postversion": "npm publish", - "postpublish": "git push origin --follow-tags" - }, - "repository": { - "type": "git", - "url": "git@github.com:iarna/write-file-atomic.git" - }, - "keywords": [ - "writeFile", - "atomic" - ], - "author": "Rebecca Turner (http://re-becca.org)", - "license": "ISC", - "bugs": { - "url": "https://github.com/iarna/write-file-atomic/issues" - }, - "homepage": "https://github.com/iarna/write-file-atomic", - "dependencies": { - "graceful-fs": "^4.1.11", - "imurmurhash": "^0.1.4", - "signal-exit": "^3.0.2" - }, - "devDependencies": { - "mkdirp": "^0.5.1", - "require-inject": "^1.4.0", - "rimraf": "^2.5.4", - "standard": "^12.0.1", - "tap": "^12.1.3" - }, - "files": [ - "index.js" - ] -} diff --git a/packages/list/test/fixture-with-no-pkg-name-and-no-version/node_modules/.pnpm/registry.npmjs.org/write-json-file/2.3.0/node_modules/detect-indent b/packages/list/test/fixture-with-no-pkg-name-and-no-version/node_modules/.pnpm/registry.npmjs.org/write-json-file/2.3.0/node_modules/detect-indent deleted file mode 120000 index d8e1c5611a..0000000000 --- a/packages/list/test/fixture-with-no-pkg-name-and-no-version/node_modules/.pnpm/registry.npmjs.org/write-json-file/2.3.0/node_modules/detect-indent +++ /dev/null @@ -1 +0,0 @@ -../../../../../../../../../../../../../.pnpm-store/2/registry.npmjs.org/detect-indent/5.0.0/node_modules/detect-indent \ No newline at end of file diff --git a/packages/list/test/fixture-with-no-pkg-name-and-no-version/node_modules/.pnpm/registry.npmjs.org/write-json-file/2.3.0/node_modules/graceful-fs b/packages/list/test/fixture-with-no-pkg-name-and-no-version/node_modules/.pnpm/registry.npmjs.org/write-json-file/2.3.0/node_modules/graceful-fs deleted file mode 120000 index f7e698f2d8..0000000000 --- a/packages/list/test/fixture-with-no-pkg-name-and-no-version/node_modules/.pnpm/registry.npmjs.org/write-json-file/2.3.0/node_modules/graceful-fs +++ /dev/null @@ -1 +0,0 @@ -../../../../../../../../../../../../../.pnpm-store/2/registry.npmjs.org/graceful-fs/4.2.2/node_modules/graceful-fs \ No newline at end of file diff --git a/packages/list/test/fixture-with-no-pkg-name-and-no-version/node_modules/.pnpm/registry.npmjs.org/write-json-file/2.3.0/node_modules/make-dir b/packages/list/test/fixture-with-no-pkg-name-and-no-version/node_modules/.pnpm/registry.npmjs.org/write-json-file/2.3.0/node_modules/make-dir deleted file mode 120000 index 355d12609e..0000000000 --- a/packages/list/test/fixture-with-no-pkg-name-and-no-version/node_modules/.pnpm/registry.npmjs.org/write-json-file/2.3.0/node_modules/make-dir +++ /dev/null @@ -1 +0,0 @@ -../../../make-dir/1.3.0/node_modules/make-dir \ No newline at end of file diff --git a/packages/list/test/fixture-with-no-pkg-name-and-no-version/node_modules/.pnpm/registry.npmjs.org/write-json-file/2.3.0/node_modules/pify b/packages/list/test/fixture-with-no-pkg-name-and-no-version/node_modules/.pnpm/registry.npmjs.org/write-json-file/2.3.0/node_modules/pify deleted file mode 120000 index 9efa2a6efb..0000000000 --- a/packages/list/test/fixture-with-no-pkg-name-and-no-version/node_modules/.pnpm/registry.npmjs.org/write-json-file/2.3.0/node_modules/pify +++ /dev/null @@ -1 +0,0 @@ -../../../../../../../../../../../../../.pnpm-store/2/registry.npmjs.org/pify/3.0.0/node_modules/pify \ No newline at end of file diff --git a/packages/list/test/fixture-with-no-pkg-name-and-no-version/node_modules/.pnpm/registry.npmjs.org/write-json-file/2.3.0/node_modules/sort-keys b/packages/list/test/fixture-with-no-pkg-name-and-no-version/node_modules/.pnpm/registry.npmjs.org/write-json-file/2.3.0/node_modules/sort-keys deleted file mode 120000 index 5068a4a28c..0000000000 --- a/packages/list/test/fixture-with-no-pkg-name-and-no-version/node_modules/.pnpm/registry.npmjs.org/write-json-file/2.3.0/node_modules/sort-keys +++ /dev/null @@ -1 +0,0 @@ -../../../sort-keys/2.0.0/node_modules/sort-keys \ No newline at end of file diff --git a/packages/list/test/fixture-with-no-pkg-name-and-no-version/node_modules/.pnpm/registry.npmjs.org/write-json-file/2.3.0/node_modules/write-file-atomic b/packages/list/test/fixture-with-no-pkg-name-and-no-version/node_modules/.pnpm/registry.npmjs.org/write-json-file/2.3.0/node_modules/write-file-atomic deleted file mode 120000 index d4df92b2b5..0000000000 --- a/packages/list/test/fixture-with-no-pkg-name-and-no-version/node_modules/.pnpm/registry.npmjs.org/write-json-file/2.3.0/node_modules/write-file-atomic +++ /dev/null @@ -1 +0,0 @@ -../../../write-file-atomic/2.4.3/node_modules/write-file-atomic \ No newline at end of file diff --git a/packages/list/test/fixture-with-no-pkg-name-and-no-version/node_modules/.pnpm/registry.npmjs.org/write-json-file/2.3.0/node_modules/write-json-file/index.js b/packages/list/test/fixture-with-no-pkg-name-and-no-version/node_modules/.pnpm/registry.npmjs.org/write-json-file/2.3.0/node_modules/write-json-file/index.js deleted file mode 100644 index cbd7e706a0..0000000000 --- a/packages/list/test/fixture-with-no-pkg-name-and-no-version/node_modules/.pnpm/registry.npmjs.org/write-json-file/2.3.0/node_modules/write-json-file/index.js +++ /dev/null @@ -1,73 +0,0 @@ -'use strict'; -const path = require('path'); -const fs = require('graceful-fs'); -const writeFileAtomic = require('write-file-atomic'); -const sortKeys = require('sort-keys'); -const makeDir = require('make-dir'); -const pify = require('pify'); -const detectIndent = require('detect-indent'); - -const init = (fn, fp, data, opts) => { - if (!fp) { - throw new TypeError('Expected a filepath'); - } - - if (data === undefined) { - throw new TypeError('Expected data to stringify'); - } - - opts = Object.assign({ - indent: '\t', - sortKeys: false - }, opts); - - if (opts.sortKeys) { - data = sortKeys(data, { - deep: true, - compare: typeof opts.sortKeys === 'function' && opts.sortKeys - }); - } - - return fn(fp, data, opts); -}; - -const readFile = fp => pify(fs.readFile)(fp, 'utf8').catch(() => {}); - -const main = (fp, data, opts) => { - return (opts.detectIndent ? readFile(fp) : Promise.resolve()) - .then(str => { - const indent = str ? detectIndent(str).indent : opts.indent; - const json = JSON.stringify(data, opts.replacer, indent); - - return pify(writeFileAtomic)(fp, `${json}\n`, {mode: opts.mode}); - }); -}; - -const mainSync = (fp, data, opts) => { - let indent = opts.indent; - - if (opts.detectIndent) { - try { - const file = fs.readFileSync(fp, 'utf8'); - indent = detectIndent(file).indent; - } catch (err) { - if (err.code !== 'ENOENT') { - throw err; - } - } - } - - const json = JSON.stringify(data, opts.replacer, indent); - - return writeFileAtomic.sync(fp, `${json}\n`, {mode: opts.mode}); -}; - -module.exports = (fp, data, opts) => { - return makeDir(path.dirname(fp), {fs}) - .then(() => init(main, fp, data, opts)); -}; - -module.exports.sync = (fp, data, opts) => { - makeDir.sync(path.dirname(fp), {fs}); - init(mainSync, fp, data, opts); -}; diff --git a/packages/list/test/fixture-with-no-pkg-name-and-no-version/node_modules/.pnpm/registry.npmjs.org/write-json-file/2.3.0/node_modules/write-json-file/license b/packages/list/test/fixture-with-no-pkg-name-and-no-version/node_modules/.pnpm/registry.npmjs.org/write-json-file/2.3.0/node_modules/write-json-file/license deleted file mode 100644 index e7af2f7710..0000000000 --- a/packages/list/test/fixture-with-no-pkg-name-and-no-version/node_modules/.pnpm/registry.npmjs.org/write-json-file/2.3.0/node_modules/write-json-file/license +++ /dev/null @@ -1,9 +0,0 @@ -MIT License - -Copyright (c) Sindre Sorhus (sindresorhus.com) - -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. diff --git a/packages/list/test/fixture-with-no-pkg-name-and-no-version/node_modules/.pnpm/registry.npmjs.org/write-json-file/2.3.0/node_modules/write-json-file/package.json b/packages/list/test/fixture-with-no-pkg-name-and-no-version/node_modules/.pnpm/registry.npmjs.org/write-json-file/2.3.0/node_modules/write-json-file/package.json deleted file mode 100644 index 169c7a888b..0000000000 --- a/packages/list/test/fixture-with-no-pkg-name-and-no-version/node_modules/.pnpm/registry.npmjs.org/write-json-file/2.3.0/node_modules/write-json-file/package.json +++ /dev/null @@ -1,48 +0,0 @@ -{ - "name": "write-json-file", - "version": "2.3.0", - "description": "Stringify and write JSON to a file atomically", - "license": "MIT", - "repository": "sindresorhus/write-json-file", - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" - }, - "engines": { - "node": ">=4" - }, - "scripts": { - "test": "xo && ava" - }, - "files": [ - "index.js" - ], - "keywords": [ - "write", - "json", - "stringify", - "file", - "fs", - "graceful", - "stable", - "sort", - "newline", - "indent", - "atomic", - "atomically" - ], - "dependencies": { - "detect-indent": "^5.0.0", - "graceful-fs": "^4.1.2", - "make-dir": "^1.0.0", - "pify": "^3.0.0", - "sort-keys": "^2.0.0", - "write-file-atomic": "^2.0.0" - }, - "devDependencies": { - "ava": "*", - "tempfile": "^2.0.0", - "xo": "*" - } -} diff --git a/packages/list/test/fixture-with-no-pkg-name-and-no-version/node_modules/.pnpm/registry.npmjs.org/write-json-file/2.3.0/node_modules/write-json-file/readme.md b/packages/list/test/fixture-with-no-pkg-name-and-no-version/node_modules/.pnpm/registry.npmjs.org/write-json-file/2.3.0/node_modules/write-json-file/readme.md deleted file mode 100644 index c148f05290..0000000000 --- a/packages/list/test/fixture-with-no-pkg-name-and-no-version/node_modules/.pnpm/registry.npmjs.org/write-json-file/2.3.0/node_modules/write-json-file/readme.md +++ /dev/null @@ -1,83 +0,0 @@ -# write-json-file [![Build Status](https://travis-ci.org/sindresorhus/write-json-file.svg?branch=master)](https://travis-ci.org/sindresorhus/write-json-file) - -> Stringify and write JSON to a file [atomically](https://github.com/npm/write-file-atomic) - -Creates directories for you as needed. - - -## Install - -``` -$ npm install write-json-file -``` - - -## Usage - -```js -const writeJsonFile = require('write-json-file'); - -writeJsonFile('foo.json', {foo: true}).then(() => { - console.log('done'); -}); -``` - - -## API - -### writeJsonFile(filepath, data, [options]) - -Returns a `Promise`. - -### writeJsonFile.sync(filepath, data, [options]) - -#### options - -Type: `Object` - -##### indent - -Type: `string` `number`
-Default: `'\t'` - -Indentation as a string or number of spaces.
-Pass in `null` for no formatting. - -##### detectIndent - -Type: `boolean`
-Default: `false` - -Detect indentation automatically if the file exists. - -##### sortKeys - -Type: `boolean` `function`
-Default: `false` - -Sort the keys recursively.
-Optionally pass in a [`compare`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort) function. - -##### replacer - -Type: `function` - -Passed into [`JSON.stringify`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify#The_replacer_parameter). - -##### mode - -Type: `number`
-Default: `0o666` - -[Mode](https://en.wikipedia.org/wiki/File_system_permissions#Numeric_notation) used when writing the file. - - -## Related - -- [load-json-file](https://github.com/sindresorhus/load-json-file) - Read and parse a JSON file -- [make-dir](https://github.com/sindresorhus/make-dir) - Make a directory and its parents if needed - - -## License - -MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/packages/list/test/fixture-with-no-pkg-name-and-no-version/node_modules/is-negative b/packages/list/test/fixture-with-no-pkg-name-and-no-version/node_modules/is-negative deleted file mode 120000 index eaa5d610d0..0000000000 --- a/packages/list/test/fixture-with-no-pkg-name-and-no-version/node_modules/is-negative +++ /dev/null @@ -1 +0,0 @@ -../../../../../../../../.pnpm-store/2/registry.npmjs.org/is-negative/2.1.0/node_modules/is-negative \ No newline at end of file diff --git a/packages/list/test/fixture-with-no-pkg-name-and-no-version/node_modules/is-positive b/packages/list/test/fixture-with-no-pkg-name-and-no-version/node_modules/is-positive deleted file mode 120000 index 45afa70d3b..0000000000 --- a/packages/list/test/fixture-with-no-pkg-name-and-no-version/node_modules/is-positive +++ /dev/null @@ -1 +0,0 @@ -../../../../../../../../.pnpm-store/2/registry.npmjs.org/is-positive/3.1.0/node_modules/is-positive \ No newline at end of file diff --git a/packages/list/test/fixture-with-no-pkg-name-and-no-version/node_modules/write-json-file b/packages/list/test/fixture-with-no-pkg-name-and-no-version/node_modules/write-json-file deleted file mode 120000 index 31d7377aa0..0000000000 --- a/packages/list/test/fixture-with-no-pkg-name-and-no-version/node_modules/write-json-file +++ /dev/null @@ -1 +0,0 @@ -.pnpm/registry.npmjs.org/write-json-file/2.3.0/node_modules/write-json-file \ No newline at end of file diff --git a/packages/list/test/fixture-with-no-pkg-version/.gitignore b/packages/list/test/fixture-with-no-pkg-version/.gitignore deleted file mode 100644 index cf4bab9ddd..0000000000 --- a/packages/list/test/fixture-with-no-pkg-version/.gitignore +++ /dev/null @@ -1 +0,0 @@ -!node_modules diff --git a/packages/list/test/fixture-with-no-pkg-version/node_modules/.modules.yaml b/packages/list/test/fixture-with-no-pkg-version/node_modules/.modules.yaml deleted file mode 100644 index 2f7cf36f68..0000000000 --- a/packages/list/test/fixture-with-no-pkg-version/node_modules/.modules.yaml +++ /dev/null @@ -1,11 +0,0 @@ -included: - dependencies: true - devDependencies: true - optionalDependencies: true -layoutVersion: 3 -packageManager: pnpm@3.8.1 -pendingBuilds: [] -registries: - default: 'https://registry.npmjs.org/' -skipped: [] -store: /home/zoltan/.pnpm-store/2 diff --git a/packages/list/test/fixture-with-no-pkg-version/node_modules/.pnpm/lock.yaml b/packages/list/test/fixture-with-no-pkg-version/node_modules/.pnpm/lock.yaml deleted file mode 100644 index 688ab59425..0000000000 --- a/packages/list/test/fixture-with-no-pkg-version/node_modules/.pnpm/lock.yaml +++ /dev/null @@ -1,94 +0,0 @@ -dependencies: - write-json-file: 2.3.0 -devDependencies: - is-positive: 3.1.0 -lockfileVersion: 5.1 -optionalDependencies: - is-negative: 2.1.0 -packages: - /detect-indent/5.0.0: - dev: false - engines: - node: '>=4' - resolution: - integrity: sha1-OHHMCmoALow+Wzz38zYmRnXwa50= - /graceful-fs/4.2.2: - dev: false - resolution: - integrity: sha512-IItsdsea19BoLC7ELy13q1iJFNmd7ofZH5+X/pJr90/nRoPEX0DJo1dHDbgtYWOhJhcCgMDTOw84RZ72q6lB+Q== - /imurmurhash/0.1.4: - dev: false - engines: - node: '>=0.8.19' - resolution: - integrity: sha1-khi5srkoojixPcT7a21XbyMUU+o= - /is-negative/2.1.0: - dev: false - engines: - node: '>=0.10.0' - optional: true - resolution: - integrity: sha1-8Nhjd6oVpkw0lh84rCqb4rQKEYc= - /is-plain-obj/1.1.0: - dev: false - engines: - node: '>=0.10.0' - resolution: - integrity: sha1-caUMhCnfync8kqOQpKA7OfzVHT4= - /is-positive/3.1.0: - dev: true - engines: - node: '>=0.10.0' - resolution: - integrity: sha1-hX21hKG6XRyymAUn/DtsQ103sP0= - /make-dir/1.3.0: - dependencies: - pify: 3.0.0 - dev: false - engines: - node: '>=4' - resolution: - integrity: sha512-2w31R7SJtieJJnQtGc7RVL2StM2vGYVfqUOvUDxH6bC6aJTxPxTF0GnIgCyu7tjockiUWAYQRbxa7vKn34s5sQ== - /pify/3.0.0: - dev: false - engines: - node: '>=4' - resolution: - integrity: sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY= - /signal-exit/3.0.2: - dev: false - resolution: - integrity: sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0= - /sort-keys/2.0.0: - dependencies: - is-plain-obj: 1.1.0 - dev: false - engines: - node: '>=4' - resolution: - integrity: sha1-ZYU1WEhh7JfXMNbPQYIuH1ZoQSg= - /write-file-atomic/2.4.3: - dependencies: - graceful-fs: 4.2.2 - imurmurhash: 0.1.4 - signal-exit: 3.0.2 - dev: false - resolution: - integrity: sha512-GaETH5wwsX+GcnzhPgKcKjJ6M2Cq3/iZp1WyY/X1CSqrW+jVNM9Y7D8EC2sM4ZG/V8wZlSniJnCKWPmBYAucRQ== - /write-json-file/2.3.0: - dependencies: - detect-indent: 5.0.0 - graceful-fs: 4.2.2 - make-dir: 1.3.0 - pify: 3.0.0 - sort-keys: 2.0.0 - write-file-atomic: 2.4.3 - dev: false - engines: - node: '>=4' - resolution: - integrity: sha1-K2TIozAE1UuGmMdtWFp3zrYdoy8= -specifiers: - is-negative: ^2.1.0 - is-positive: ^3.1.0 - write-json-file: ^2.2.0 diff --git a/packages/list/test/fixture-with-no-pkg-version/node_modules/.pnpm/registry.npmjs.org/make-dir/1.3.0/node_modules/make-dir/index.js b/packages/list/test/fixture-with-no-pkg-version/node_modules/.pnpm/registry.npmjs.org/make-dir/1.3.0/node_modules/make-dir/index.js deleted file mode 100644 index 18439555f8..0000000000 --- a/packages/list/test/fixture-with-no-pkg-version/node_modules/.pnpm/registry.npmjs.org/make-dir/1.3.0/node_modules/make-dir/index.js +++ /dev/null @@ -1,85 +0,0 @@ -'use strict'; -const fs = require('fs'); -const path = require('path'); -const pify = require('pify'); - -const defaults = { - mode: 0o777 & (~process.umask()), - fs -}; - -// https://github.com/nodejs/node/issues/8987 -// https://github.com/libuv/libuv/pull/1088 -const checkPath = pth => { - if (process.platform === 'win32') { - const pathHasInvalidWinCharacters = /[<>:"|?*]/.test(pth.replace(path.parse(pth).root, '')); - - if (pathHasInvalidWinCharacters) { - const err = new Error(`Path contains invalid characters: ${pth}`); - err.code = 'EINVAL'; - throw err; - } - } -}; - -module.exports = (input, opts) => Promise.resolve().then(() => { - checkPath(input); - opts = Object.assign({}, defaults, opts); - - const mkdir = pify(opts.fs.mkdir); - const stat = pify(opts.fs.stat); - - const make = pth => { - return mkdir(pth, opts.mode) - .then(() => pth) - .catch(err => { - if (err.code === 'ENOENT') { - if (err.message.includes('null bytes') || path.dirname(pth) === pth) { - throw err; - } - - return make(path.dirname(pth)).then(() => make(pth)); - } - - return stat(pth) - .then(stats => stats.isDirectory() ? pth : Promise.reject()) - .catch(() => { - throw err; - }); - }); - }; - - return make(path.resolve(input)); -}); - -module.exports.sync = (input, opts) => { - checkPath(input); - opts = Object.assign({}, defaults, opts); - - const make = pth => { - try { - opts.fs.mkdirSync(pth, opts.mode); - } catch (err) { - if (err.code === 'ENOENT') { - if (err.message.includes('null bytes') || path.dirname(pth) === pth) { - throw err; - } - - make(path.dirname(pth)); - return make(pth); - } - - try { - if (!opts.fs.statSync(pth).isDirectory()) { - throw new Error('The path is not a directory'); - } - } catch (_) { - throw err; - } - } - - return pth; - }; - - return make(path.resolve(input)); -}; diff --git a/packages/list/test/fixture-with-no-pkg-version/node_modules/.pnpm/registry.npmjs.org/make-dir/1.3.0/node_modules/make-dir/license b/packages/list/test/fixture-with-no-pkg-version/node_modules/.pnpm/registry.npmjs.org/make-dir/1.3.0/node_modules/make-dir/license deleted file mode 100644 index e7af2f7710..0000000000 --- a/packages/list/test/fixture-with-no-pkg-version/node_modules/.pnpm/registry.npmjs.org/make-dir/1.3.0/node_modules/make-dir/license +++ /dev/null @@ -1,9 +0,0 @@ -MIT License - -Copyright (c) Sindre Sorhus (sindresorhus.com) - -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. diff --git a/packages/list/test/fixture-with-no-pkg-version/node_modules/.pnpm/registry.npmjs.org/make-dir/1.3.0/node_modules/make-dir/package.json b/packages/list/test/fixture-with-no-pkg-version/node_modules/.pnpm/registry.npmjs.org/make-dir/1.3.0/node_modules/make-dir/package.json deleted file mode 100644 index ec907a71f8..0000000000 --- a/packages/list/test/fixture-with-no-pkg-version/node_modules/.pnpm/registry.npmjs.org/make-dir/1.3.0/node_modules/make-dir/package.json +++ /dev/null @@ -1,54 +0,0 @@ -{ - "name": "make-dir", - "version": "1.3.0", - "description": "Make a directory and its parents if needed - Think `mkdir -p`", - "license": "MIT", - "repository": "sindresorhus/make-dir", - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" - }, - "engines": { - "node": ">=4" - }, - "scripts": { - "test": "xo && nyc ava" - }, - "files": [ - "index.js" - ], - "keywords": [ - "mkdir", - "mkdirp", - "make", - "directories", - "dir", - "dirs", - "folders", - "directory", - "folder", - "path", - "parent", - "parents", - "intermediate", - "recursively", - "recursive", - "create", - "fs", - "filesystem", - "file-system" - ], - "dependencies": { - "pify": "^3.0.0" - }, - "devDependencies": { - "ava": "*", - "codecov": "^3.0.0", - "graceful-fs": "^4.1.11", - "nyc": "^11.3.0", - "path-type": "^3.0.0", - "tempy": "^0.2.1", - "xo": "^0.20.0" - } -} diff --git a/packages/list/test/fixture-with-no-pkg-version/node_modules/.pnpm/registry.npmjs.org/make-dir/1.3.0/node_modules/make-dir/readme.md b/packages/list/test/fixture-with-no-pkg-version/node_modules/.pnpm/registry.npmjs.org/make-dir/1.3.0/node_modules/make-dir/readme.md deleted file mode 100644 index 8a32bf4714..0000000000 --- a/packages/list/test/fixture-with-no-pkg-version/node_modules/.pnpm/registry.npmjs.org/make-dir/1.3.0/node_modules/make-dir/readme.md +++ /dev/null @@ -1,116 +0,0 @@ -# make-dir [![Build Status: macOS & Linux](https://travis-ci.org/sindresorhus/make-dir.svg?branch=master)](https://travis-ci.org/sindresorhus/make-dir) [![Build status: Windows](https://ci.appveyor.com/api/projects/status/e0vtt8y600w91gcs/branch/master?svg=true)](https://ci.appveyor.com/project/sindresorhus/make-dir/branch/master) [![codecov](https://codecov.io/gh/sindresorhus/make-dir/branch/master/graph/badge.svg)](https://codecov.io/gh/sindresorhus/make-dir) - -> Make a directory and its parents if needed - Think `mkdir -p` - - -## Advantages over [`mkdirp`](https://github.com/substack/node-mkdirp) - -- Promise API *(Async/await ready!)* -- Fixes many `mkdirp` issues: [#96](https://github.com/substack/node-mkdirp/pull/96) [#70](https://github.com/substack/node-mkdirp/issues/70) [#66](https://github.com/substack/node-mkdirp/issues/66) -- 100% test coverage -- CI-tested on macOS, Linux, and Windows -- Actively maintained -- Doesn't bundle a CLI - - -## Install - -``` -$ npm install make-dir -``` - - -## Usage - -``` -$ pwd -/Users/sindresorhus/fun -$ tree -. -``` - -```js -const makeDir = require('make-dir'); - -makeDir('unicorn/rainbow/cake').then(path => { - console.log(path); - //=> '/Users/sindresorhus/fun/unicorn/rainbow/cake' -}); -``` - -``` -$ tree -. -└── unicorn - └── rainbow - └── cake -``` - -Multiple directories: - -```js -const makeDir = require('make-dir'); - -Promise.all([ - makeDir('unicorn/rainbow') - makeDir('foo/bar') -]).then(paths => { - console.log(paths); - /* - [ - '/Users/sindresorhus/fun/unicorn/rainbow', - '/Users/sindresorhus/fun/foo/bar' - ] - */ -}); -``` - - -## API - -### makeDir(path, [options]) - -Returns a `Promise` for the path to the created directory. - -### makeDir.sync(path, [options]) - -Returns the path to the created directory. - -#### path - -Type: `string` - -Directory to create. - -#### options - -Type: `Object` - -##### mode - -Type: `integer`
-Default: `0o777 & (~process.umask())` - -Directory [permissions](https://x-team.com/blog/file-system-permissions-umask-node-js/). - -##### fs - -Type: `Object`
-Default: `require('fs')` - -Use a custom `fs` implementation. For example [`graceful-fs`](https://github.com/isaacs/node-graceful-fs). - - -## Related - -- [make-dir-cli](https://github.com/sindresorhus/make-dir-cli) - CLI for this module -- [del](https://github.com/sindresorhus/del) - Delete files and directories -- [globby](https://github.com/sindresorhus/globby) - User-friendly glob matching -- [cpy](https://github.com/sindresorhus/cpy) - Copy files -- [cpy-cli](https://github.com/sindresorhus/cpy-cli) - Copy files on the command-line -- [move-file](https://github.com/sindresorhus/move-file) - Move a file - - -## License - -MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/packages/list/test/fixture-with-no-pkg-version/node_modules/.pnpm/registry.npmjs.org/make-dir/1.3.0/node_modules/pify b/packages/list/test/fixture-with-no-pkg-version/node_modules/.pnpm/registry.npmjs.org/make-dir/1.3.0/node_modules/pify deleted file mode 120000 index 9efa2a6efb..0000000000 --- a/packages/list/test/fixture-with-no-pkg-version/node_modules/.pnpm/registry.npmjs.org/make-dir/1.3.0/node_modules/pify +++ /dev/null @@ -1 +0,0 @@ -../../../../../../../../../../../../../.pnpm-store/2/registry.npmjs.org/pify/3.0.0/node_modules/pify \ No newline at end of file diff --git a/packages/list/test/fixture-with-no-pkg-version/node_modules/.pnpm/registry.npmjs.org/sort-keys/2.0.0/node_modules/is-plain-obj b/packages/list/test/fixture-with-no-pkg-version/node_modules/.pnpm/registry.npmjs.org/sort-keys/2.0.0/node_modules/is-plain-obj deleted file mode 120000 index aed859d2a8..0000000000 --- a/packages/list/test/fixture-with-no-pkg-version/node_modules/.pnpm/registry.npmjs.org/sort-keys/2.0.0/node_modules/is-plain-obj +++ /dev/null @@ -1 +0,0 @@ -../../../../../../../../../../../../../.pnpm-store/2/registry.npmjs.org/is-plain-obj/1.1.0/node_modules/is-plain-obj \ No newline at end of file diff --git a/packages/list/test/fixture-with-no-pkg-version/node_modules/.pnpm/registry.npmjs.org/sort-keys/2.0.0/node_modules/sort-keys/index.js b/packages/list/test/fixture-with-no-pkg-version/node_modules/.pnpm/registry.npmjs.org/sort-keys/2.0.0/node_modules/sort-keys/index.js deleted file mode 100644 index 53489d7888..0000000000 --- a/packages/list/test/fixture-with-no-pkg-version/node_modules/.pnpm/registry.npmjs.org/sort-keys/2.0.0/node_modules/sort-keys/index.js +++ /dev/null @@ -1,55 +0,0 @@ -'use strict'; -const isPlainObj = require('is-plain-obj'); - -module.exports = (obj, opts) => { - if (!isPlainObj(obj)) { - throw new TypeError('Expected a plain object'); - } - - opts = opts || {}; - - // DEPRECATED - if (typeof opts === 'function') { - throw new TypeError('Specify the compare function as an option instead'); - } - - const deep = opts.deep; - const seenInput = []; - const seenOutput = []; - - const sortKeys = x => { - const seenIndex = seenInput.indexOf(x); - - if (seenIndex !== -1) { - return seenOutput[seenIndex]; - } - - const ret = {}; - const keys = Object.keys(x).sort(opts.compare); - - seenInput.push(x); - seenOutput.push(ret); - - for (let i = 0; i < keys.length; i++) { - const key = keys[i]; - const val = x[key]; - - if (deep && Array.isArray(val)) { - const retArr = []; - - for (let j = 0; j < val.length; j++) { - retArr[j] = isPlainObj(val[j]) ? sortKeys(val[j]) : val[j]; - } - - ret[key] = retArr; - continue; - } - - ret[key] = deep && isPlainObj(val) ? sortKeys(val) : val; - } - - return ret; - }; - - return sortKeys(obj); -}; diff --git a/packages/list/test/fixture-with-no-pkg-version/node_modules/.pnpm/registry.npmjs.org/sort-keys/2.0.0/node_modules/sort-keys/license b/packages/list/test/fixture-with-no-pkg-version/node_modules/.pnpm/registry.npmjs.org/sort-keys/2.0.0/node_modules/sort-keys/license deleted file mode 100644 index e7af2f7710..0000000000 --- a/packages/list/test/fixture-with-no-pkg-version/node_modules/.pnpm/registry.npmjs.org/sort-keys/2.0.0/node_modules/sort-keys/license +++ /dev/null @@ -1,9 +0,0 @@ -MIT License - -Copyright (c) Sindre Sorhus (sindresorhus.com) - -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. diff --git a/packages/list/test/fixture-with-no-pkg-version/node_modules/.pnpm/registry.npmjs.org/sort-keys/2.0.0/node_modules/sort-keys/package.json b/packages/list/test/fixture-with-no-pkg-version/node_modules/.pnpm/registry.npmjs.org/sort-keys/2.0.0/node_modules/sort-keys/package.json deleted file mode 100644 index 3da9c7659d..0000000000 --- a/packages/list/test/fixture-with-no-pkg-version/node_modules/.pnpm/registry.npmjs.org/sort-keys/2.0.0/node_modules/sort-keys/package.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "name": "sort-keys", - "version": "2.0.0", - "description": "Sort the keys of an object", - "license": "MIT", - "repository": "sindresorhus/sort-keys", - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" - }, - "engines": { - "node": ">=4" - }, - "scripts": { - "test": "xo && ava" - }, - "files": [ - "index.js" - ], - "keywords": [ - "sort", - "object", - "keys", - "obj", - "key", - "stable", - "deterministic", - "deep", - "recursive", - "recursively" - ], - "dependencies": { - "is-plain-obj": "^1.0.0" - }, - "devDependencies": { - "ava": "*", - "xo": "*" - } -} diff --git a/packages/list/test/fixture-with-no-pkg-version/node_modules/.pnpm/registry.npmjs.org/sort-keys/2.0.0/node_modules/sort-keys/readme.md b/packages/list/test/fixture-with-no-pkg-version/node_modules/.pnpm/registry.npmjs.org/sort-keys/2.0.0/node_modules/sort-keys/readme.md deleted file mode 100644 index a671ffb3de..0000000000 --- a/packages/list/test/fixture-with-no-pkg-version/node_modules/.pnpm/registry.npmjs.org/sort-keys/2.0.0/node_modules/sort-keys/readme.md +++ /dev/null @@ -1,60 +0,0 @@ -# sort-keys [![Build Status](https://travis-ci.org/sindresorhus/sort-keys.svg?branch=master)](https://travis-ci.org/sindresorhus/sort-keys) - -> Sort the keys of an object - -Useful to get a deterministically ordered object, as the order of keys can vary between engines. - - -## Install - -``` -$ npm install --save sort-keys -``` - - -## Usage - -```js -const sortKeys = require('sort-keys'); - -sortKeys({c: 0, a: 0, b: 0}); -//=> {a: 0, b: 0, c: 0} - -sortKeys({b: {b: 0, a: 0}, a: 0}, {deep: true}); -//=> {a: 0, b: {a: 0, b: 0}} - -sortKeys({c: 0, a: 0, b: 0}, { - compare: (a, b) => -a.localeCompare(b) -}); -//=> {c: 0, b: 0, a: 0} -``` - - -## API - -### sortKeys(input, [options]) - -Returns a new object with sorted keys. - -#### input - -Type: `Object` - -#### options - -##### deep - -Type: `boolean` - -Recursively sort keys. - -##### compare - -Type: `Function` - -[Compare function.](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort) - - -## License - -MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/packages/list/test/fixture-with-no-pkg-version/node_modules/.pnpm/registry.npmjs.org/write-file-atomic/2.4.3/node_modules/graceful-fs b/packages/list/test/fixture-with-no-pkg-version/node_modules/.pnpm/registry.npmjs.org/write-file-atomic/2.4.3/node_modules/graceful-fs deleted file mode 120000 index f7e698f2d8..0000000000 --- a/packages/list/test/fixture-with-no-pkg-version/node_modules/.pnpm/registry.npmjs.org/write-file-atomic/2.4.3/node_modules/graceful-fs +++ /dev/null @@ -1 +0,0 @@ -../../../../../../../../../../../../../.pnpm-store/2/registry.npmjs.org/graceful-fs/4.2.2/node_modules/graceful-fs \ No newline at end of file diff --git a/packages/list/test/fixture-with-no-pkg-version/node_modules/.pnpm/registry.npmjs.org/write-file-atomic/2.4.3/node_modules/imurmurhash b/packages/list/test/fixture-with-no-pkg-version/node_modules/.pnpm/registry.npmjs.org/write-file-atomic/2.4.3/node_modules/imurmurhash deleted file mode 120000 index 6ea03bf6c9..0000000000 --- a/packages/list/test/fixture-with-no-pkg-version/node_modules/.pnpm/registry.npmjs.org/write-file-atomic/2.4.3/node_modules/imurmurhash +++ /dev/null @@ -1 +0,0 @@ -../../../../../../../../../../../../../.pnpm-store/2/registry.npmjs.org/imurmurhash/0.1.4/node_modules/imurmurhash \ No newline at end of file diff --git a/packages/list/test/fixture-with-no-pkg-version/node_modules/.pnpm/registry.npmjs.org/write-file-atomic/2.4.3/node_modules/signal-exit b/packages/list/test/fixture-with-no-pkg-version/node_modules/.pnpm/registry.npmjs.org/write-file-atomic/2.4.3/node_modules/signal-exit deleted file mode 120000 index 70dc3a3818..0000000000 --- a/packages/list/test/fixture-with-no-pkg-version/node_modules/.pnpm/registry.npmjs.org/write-file-atomic/2.4.3/node_modules/signal-exit +++ /dev/null @@ -1 +0,0 @@ -../../../../../../../../../../../../../.pnpm-store/2/registry.npmjs.org/signal-exit/3.0.2/node_modules/signal-exit \ No newline at end of file diff --git a/packages/list/test/fixture-with-no-pkg-version/node_modules/.pnpm/registry.npmjs.org/write-file-atomic/2.4.3/node_modules/write-file-atomic/CHANGELOG.md b/packages/list/test/fixture-with-no-pkg-version/node_modules/.pnpm/registry.npmjs.org/write-file-atomic/2.4.3/node_modules/write-file-atomic/CHANGELOG.md deleted file mode 100644 index 920ae2cb4d..0000000000 --- a/packages/list/test/fixture-with-no-pkg-version/node_modules/.pnpm/registry.npmjs.org/write-file-atomic/2.4.3/node_modules/write-file-atomic/CHANGELOG.md +++ /dev/null @@ -1,25 +0,0 @@ -# 2.4.3 - -* Ignore errors raised by `fs.closeSync` when cleaning up after a write - error. - -# 2.4.2 - -* A pair of patches to fix some fd leaks. We would leak fds with sync use - when errors occured and with async use any time fsync was not in use. (#34) - -# 2.4.1 - -* Fix a bug where `signal-exit` instances would be leaked. This was fixed when addressing #35. - -# 2.4.0 - -## Features - -* Allow chown and mode options to be set to false to disable the defaulting behavior. (#20) -* Support passing encoding strings in options slot for compat with Node.js API. (#31) -* Add support for running inside of worker threads (#37) - -## Fixes - -* Remove unneeded call when returning success (#36) diff --git a/packages/list/test/fixture-with-no-pkg-version/node_modules/.pnpm/registry.npmjs.org/write-file-atomic/2.4.3/node_modules/write-file-atomic/LICENSE b/packages/list/test/fixture-with-no-pkg-version/node_modules/.pnpm/registry.npmjs.org/write-file-atomic/2.4.3/node_modules/write-file-atomic/LICENSE deleted file mode 100644 index 95e65a7706..0000000000 --- a/packages/list/test/fixture-with-no-pkg-version/node_modules/.pnpm/registry.npmjs.org/write-file-atomic/2.4.3/node_modules/write-file-atomic/LICENSE +++ /dev/null @@ -1,6 +0,0 @@ -Copyright (c) 2015, Rebecca Turner - -Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - diff --git a/packages/list/test/fixture-with-no-pkg-version/node_modules/.pnpm/registry.npmjs.org/write-file-atomic/2.4.3/node_modules/write-file-atomic/README.md b/packages/list/test/fixture-with-no-pkg-version/node_modules/.pnpm/registry.npmjs.org/write-file-atomic/2.4.3/node_modules/write-file-atomic/README.md deleted file mode 100644 index ca28e99a2b..0000000000 --- a/packages/list/test/fixture-with-no-pkg-version/node_modules/.pnpm/registry.npmjs.org/write-file-atomic/2.4.3/node_modules/write-file-atomic/README.md +++ /dev/null @@ -1,56 +0,0 @@ -write-file-atomic ------------------ - -This is an extension for node's `fs.writeFile` that makes its operation -atomic and allows you set ownership (uid/gid of the file). - -### var writeFileAtomic = require('write-file-atomic')
writeFileAtomic(filename, data, [options], callback) - -* filename **String** -* data **String** | **Buffer** -* options **Object** | **String** - * chown **Object** default, uid & gid of existing file, if any - * uid **Number** - * gid **Number** - * encoding **String** | **Null** default = 'utf8' - * fsync **Boolean** default = true - * mode **Number** default, from existing file, if any - * Promise **Object** default = native Promise object -* callback **Function** - -Atomically and asynchronously writes data to a file, replacing the file if it already -exists. data can be a string or a buffer. - -The file is initially named `filename + "." + murmurhex(__filename, process.pid, ++invocations)`. -Note that `require('worker_threads').threadId` is used in addition to `process.pid` if running inside of a worker thread. -If writeFile completes successfully then, if passed the **chown** option it will change -the ownership of the file. Finally it renames the file back to the filename you specified. If -it encounters errors at any of these steps it will attempt to unlink the temporary file and then -pass the error back to the caller. -If multiple writes are concurrently issued to the same file, the write operations are put into a queue and serialized in the order they were called, using Promises. Native promises are used by default, but you can inject your own promise-like object with the **Promise** option. Writes to different files are still executed in parallel. - -If provided, the **chown** option requires both **uid** and **gid** properties or else -you'll get an error. If **chown** is not specified it will default to using -the owner of the previous file. To prevent chown from being ran you can -also pass `false`, in which case the file will be created with the current user's credentials. - -If **mode** is not specified, it will default to using the permissions from -an existing file, if any. Expicitly setting this to `false` remove this default, resulting -in a file created with the system default permissions. - -If options is a String, it's assumed to be the **encoding** option. The **encoding** option is ignored if **data** is a buffer. It defaults to 'utf8'. - -If the **fsync** option is **false**, writeFile will skip the final fsync call. - -Example: - -```javascript -writeFileAtomic('message.txt', 'Hello Node', {chown:{uid:100,gid:50}}, function (err) { - if (err) throw err; - console.log('It\'s saved!'); -}); -``` - -### var writeFileAtomicSync = require('write-file-atomic').sync
writeFileAtomicSync(filename, data, [options]) - -The synchronous version of **writeFileAtomic**. diff --git a/packages/list/test/fixture-with-no-pkg-version/node_modules/.pnpm/registry.npmjs.org/write-file-atomic/2.4.3/node_modules/write-file-atomic/index.js b/packages/list/test/fixture-with-no-pkg-version/node_modules/.pnpm/registry.npmjs.org/write-file-atomic/2.4.3/node_modules/write-file-atomic/index.js deleted file mode 100644 index 64ae987c01..0000000000 --- a/packages/list/test/fixture-with-no-pkg-version/node_modules/.pnpm/registry.npmjs.org/write-file-atomic/2.4.3/node_modules/write-file-atomic/index.js +++ /dev/null @@ -1,238 +0,0 @@ -'use strict' -module.exports = writeFile -module.exports.sync = writeFileSync -module.exports._getTmpname = getTmpname // for testing -module.exports._cleanupOnExit = cleanupOnExit - -var fs = require('graceful-fs') -var MurmurHash3 = require('imurmurhash') -var onExit = require('signal-exit') -var path = require('path') -var activeFiles = {} - -// if we run inside of a worker_thread, `process.pid` is not unique -/* istanbul ignore next */ -var threadId = (function getId () { - try { - var workerThreads = require('worker_threads') - - /// if we are in main thread, this is set to `0` - return workerThreads.threadId - } catch (e) { - // worker_threads are not available, fallback to 0 - return 0 - } -})() - -var invocations = 0 -function getTmpname (filename) { - return filename + '.' + - MurmurHash3(__filename) - .hash(String(process.pid)) - .hash(String(threadId)) - .hash(String(++invocations)) - .result() -} - -function cleanupOnExit (tmpfile) { - return function () { - try { - fs.unlinkSync(typeof tmpfile === 'function' ? tmpfile() : tmpfile) - } catch (_) {} - } -} - -function writeFile (filename, data, options, callback) { - if (options) { - if (options instanceof Function) { - callback = options - options = {} - } else if (typeof options === 'string') { - options = { encoding: options } - } - } else { - options = {} - } - - var Promise = options.Promise || global.Promise - var truename - var fd - var tmpfile - /* istanbul ignore next -- The closure only gets called when onExit triggers */ - var removeOnExitHandler = onExit(cleanupOnExit(() => tmpfile)) - var absoluteName = path.resolve(filename) - - new Promise(function serializeSameFile (resolve) { - // make a queue if it doesn't already exist - if (!activeFiles[absoluteName]) activeFiles[absoluteName] = [] - - activeFiles[absoluteName].push(resolve) // add this job to the queue - if (activeFiles[absoluteName].length === 1) resolve() // kick off the first one - }).then(function getRealPath () { - return new Promise(function (resolve) { - fs.realpath(filename, function (_, realname) { - truename = realname || filename - tmpfile = getTmpname(truename) - resolve() - }) - }) - }).then(function stat () { - return new Promise(function stat (resolve) { - if (options.mode && options.chown) resolve() - else { - // Either mode or chown is not explicitly set - // Default behavior is to copy it from original file - fs.stat(truename, function (err, stats) { - if (err || !stats) resolve() - else { - options = Object.assign({}, options) - - if (options.mode == null) { - options.mode = stats.mode - } - if (options.chown == null && process.getuid) { - options.chown = { uid: stats.uid, gid: stats.gid } - } - resolve() - } - }) - } - }) - }).then(function thenWriteFile () { - return new Promise(function (resolve, reject) { - fs.open(tmpfile, 'w', options.mode, function (err, _fd) { - fd = _fd - if (err) reject(err) - else resolve() - }) - }) - }).then(function write () { - return new Promise(function (resolve, reject) { - if (Buffer.isBuffer(data)) { - fs.write(fd, data, 0, data.length, 0, function (err) { - if (err) reject(err) - else resolve() - }) - } else if (data != null) { - fs.write(fd, String(data), 0, String(options.encoding || 'utf8'), function (err) { - if (err) reject(err) - else resolve() - }) - } else resolve() - }) - }).then(function syncAndClose () { - return new Promise(function (resolve, reject) { - if (options.fsync !== false) { - fs.fsync(fd, function (err) { - if (err) fs.close(fd, () => reject(err)) - else fs.close(fd, resolve) - }) - } else { - fs.close(fd, resolve) - } - }) - }).then(function chown () { - fd = null - if (options.chown) { - return new Promise(function (resolve, reject) { - fs.chown(tmpfile, options.chown.uid, options.chown.gid, function (err) { - if (err) reject(err) - else resolve() - }) - }) - } - }).then(function chmod () { - if (options.mode) { - return new Promise(function (resolve, reject) { - fs.chmod(tmpfile, options.mode, function (err) { - if (err) reject(err) - else resolve() - }) - }) - } - }).then(function rename () { - return new Promise(function (resolve, reject) { - fs.rename(tmpfile, truename, function (err) { - if (err) reject(err) - else resolve() - }) - }) - }).then(function success () { - removeOnExitHandler() - callback() - }, function fail (err) { - return new Promise(resolve => { - return fd ? fs.close(fd, resolve) : resolve() - }).then(() => { - removeOnExitHandler() - fs.unlink(tmpfile, function () { - callback(err) - }) - }) - }).then(function checkQueue () { - activeFiles[absoluteName].shift() // remove the element added by serializeSameFile - if (activeFiles[absoluteName].length > 0) { - activeFiles[absoluteName][0]() // start next job if one is pending - } else delete activeFiles[absoluteName] - }) -} - -function writeFileSync (filename, data, options) { - if (typeof options === 'string') options = { encoding: options } - else if (!options) options = {} - try { - filename = fs.realpathSync(filename) - } catch (ex) { - // it's ok, it'll happen on a not yet existing file - } - var tmpfile = getTmpname(filename) - - if (!options.mode || !options.chown) { - // Either mode or chown is not explicitly set - // Default behavior is to copy it from original file - try { - var stats = fs.statSync(filename) - options = Object.assign({}, options) - if (!options.mode) { - options.mode = stats.mode - } - if (!options.chown && process.getuid) { - options.chown = { uid: stats.uid, gid: stats.gid } - } - } catch (ex) { - // ignore stat errors - } - } - - var fd - var cleanup = cleanupOnExit(tmpfile) - var removeOnExitHandler = onExit(cleanup) - - try { - fd = fs.openSync(tmpfile, 'w', options.mode) - if (Buffer.isBuffer(data)) { - fs.writeSync(fd, data, 0, data.length, 0) - } else if (data != null) { - fs.writeSync(fd, String(data), 0, String(options.encoding || 'utf8')) - } - if (options.fsync !== false) { - fs.fsyncSync(fd) - } - fs.closeSync(fd) - if (options.chown) fs.chownSync(tmpfile, options.chown.uid, options.chown.gid) - if (options.mode) fs.chmodSync(tmpfile, options.mode) - fs.renameSync(tmpfile, filename) - removeOnExitHandler() - } catch (err) { - if (fd) { - try { - fs.closeSync(fd) - } catch (ex) { - // ignore close errors at this stage, error may have closed fd already. - } - } - removeOnExitHandler() - cleanup() - throw err - } -} diff --git a/packages/list/test/fixture-with-no-pkg-version/node_modules/.pnpm/registry.npmjs.org/write-file-atomic/2.4.3/node_modules/write-file-atomic/package.json b/packages/list/test/fixture-with-no-pkg-version/node_modules/.pnpm/registry.npmjs.org/write-file-atomic/2.4.3/node_modules/write-file-atomic/package.json deleted file mode 100644 index bbb0fa2345..0000000000 --- a/packages/list/test/fixture-with-no-pkg-version/node_modules/.pnpm/registry.npmjs.org/write-file-atomic/2.4.3/node_modules/write-file-atomic/package.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "name": "write-file-atomic", - "version": "2.4.3", - "description": "Write files in an atomic fashion w/configurable ownership", - "main": "index.js", - "scripts": { - "test": "standard && tap --100 test/*.js", - "preversion": "npm test", - "postversion": "npm publish", - "postpublish": "git push origin --follow-tags" - }, - "repository": { - "type": "git", - "url": "git@github.com:iarna/write-file-atomic.git" - }, - "keywords": [ - "writeFile", - "atomic" - ], - "author": "Rebecca Turner (http://re-becca.org)", - "license": "ISC", - "bugs": { - "url": "https://github.com/iarna/write-file-atomic/issues" - }, - "homepage": "https://github.com/iarna/write-file-atomic", - "dependencies": { - "graceful-fs": "^4.1.11", - "imurmurhash": "^0.1.4", - "signal-exit": "^3.0.2" - }, - "devDependencies": { - "mkdirp": "^0.5.1", - "require-inject": "^1.4.0", - "rimraf": "^2.5.4", - "standard": "^12.0.1", - "tap": "^12.1.3" - }, - "files": [ - "index.js" - ] -} diff --git a/packages/list/test/fixture-with-no-pkg-version/node_modules/.pnpm/registry.npmjs.org/write-json-file/2.3.0/node_modules/detect-indent b/packages/list/test/fixture-with-no-pkg-version/node_modules/.pnpm/registry.npmjs.org/write-json-file/2.3.0/node_modules/detect-indent deleted file mode 120000 index d8e1c5611a..0000000000 --- a/packages/list/test/fixture-with-no-pkg-version/node_modules/.pnpm/registry.npmjs.org/write-json-file/2.3.0/node_modules/detect-indent +++ /dev/null @@ -1 +0,0 @@ -../../../../../../../../../../../../../.pnpm-store/2/registry.npmjs.org/detect-indent/5.0.0/node_modules/detect-indent \ No newline at end of file diff --git a/packages/list/test/fixture-with-no-pkg-version/node_modules/.pnpm/registry.npmjs.org/write-json-file/2.3.0/node_modules/graceful-fs b/packages/list/test/fixture-with-no-pkg-version/node_modules/.pnpm/registry.npmjs.org/write-json-file/2.3.0/node_modules/graceful-fs deleted file mode 120000 index f7e698f2d8..0000000000 --- a/packages/list/test/fixture-with-no-pkg-version/node_modules/.pnpm/registry.npmjs.org/write-json-file/2.3.0/node_modules/graceful-fs +++ /dev/null @@ -1 +0,0 @@ -../../../../../../../../../../../../../.pnpm-store/2/registry.npmjs.org/graceful-fs/4.2.2/node_modules/graceful-fs \ No newline at end of file diff --git a/packages/list/test/fixture-with-no-pkg-version/node_modules/.pnpm/registry.npmjs.org/write-json-file/2.3.0/node_modules/make-dir b/packages/list/test/fixture-with-no-pkg-version/node_modules/.pnpm/registry.npmjs.org/write-json-file/2.3.0/node_modules/make-dir deleted file mode 120000 index 355d12609e..0000000000 --- a/packages/list/test/fixture-with-no-pkg-version/node_modules/.pnpm/registry.npmjs.org/write-json-file/2.3.0/node_modules/make-dir +++ /dev/null @@ -1 +0,0 @@ -../../../make-dir/1.3.0/node_modules/make-dir \ No newline at end of file diff --git a/packages/list/test/fixture-with-no-pkg-version/node_modules/.pnpm/registry.npmjs.org/write-json-file/2.3.0/node_modules/pify b/packages/list/test/fixture-with-no-pkg-version/node_modules/.pnpm/registry.npmjs.org/write-json-file/2.3.0/node_modules/pify deleted file mode 120000 index 9efa2a6efb..0000000000 --- a/packages/list/test/fixture-with-no-pkg-version/node_modules/.pnpm/registry.npmjs.org/write-json-file/2.3.0/node_modules/pify +++ /dev/null @@ -1 +0,0 @@ -../../../../../../../../../../../../../.pnpm-store/2/registry.npmjs.org/pify/3.0.0/node_modules/pify \ No newline at end of file diff --git a/packages/list/test/fixture-with-no-pkg-version/node_modules/.pnpm/registry.npmjs.org/write-json-file/2.3.0/node_modules/sort-keys b/packages/list/test/fixture-with-no-pkg-version/node_modules/.pnpm/registry.npmjs.org/write-json-file/2.3.0/node_modules/sort-keys deleted file mode 120000 index 5068a4a28c..0000000000 --- a/packages/list/test/fixture-with-no-pkg-version/node_modules/.pnpm/registry.npmjs.org/write-json-file/2.3.0/node_modules/sort-keys +++ /dev/null @@ -1 +0,0 @@ -../../../sort-keys/2.0.0/node_modules/sort-keys \ No newline at end of file diff --git a/packages/list/test/fixture-with-no-pkg-version/node_modules/.pnpm/registry.npmjs.org/write-json-file/2.3.0/node_modules/write-file-atomic b/packages/list/test/fixture-with-no-pkg-version/node_modules/.pnpm/registry.npmjs.org/write-json-file/2.3.0/node_modules/write-file-atomic deleted file mode 120000 index d4df92b2b5..0000000000 --- a/packages/list/test/fixture-with-no-pkg-version/node_modules/.pnpm/registry.npmjs.org/write-json-file/2.3.0/node_modules/write-file-atomic +++ /dev/null @@ -1 +0,0 @@ -../../../write-file-atomic/2.4.3/node_modules/write-file-atomic \ No newline at end of file diff --git a/packages/list/test/fixture-with-no-pkg-version/node_modules/.pnpm/registry.npmjs.org/write-json-file/2.3.0/node_modules/write-json-file/index.js b/packages/list/test/fixture-with-no-pkg-version/node_modules/.pnpm/registry.npmjs.org/write-json-file/2.3.0/node_modules/write-json-file/index.js deleted file mode 100644 index cbd7e706a0..0000000000 --- a/packages/list/test/fixture-with-no-pkg-version/node_modules/.pnpm/registry.npmjs.org/write-json-file/2.3.0/node_modules/write-json-file/index.js +++ /dev/null @@ -1,73 +0,0 @@ -'use strict'; -const path = require('path'); -const fs = require('graceful-fs'); -const writeFileAtomic = require('write-file-atomic'); -const sortKeys = require('sort-keys'); -const makeDir = require('make-dir'); -const pify = require('pify'); -const detectIndent = require('detect-indent'); - -const init = (fn, fp, data, opts) => { - if (!fp) { - throw new TypeError('Expected a filepath'); - } - - if (data === undefined) { - throw new TypeError('Expected data to stringify'); - } - - opts = Object.assign({ - indent: '\t', - sortKeys: false - }, opts); - - if (opts.sortKeys) { - data = sortKeys(data, { - deep: true, - compare: typeof opts.sortKeys === 'function' && opts.sortKeys - }); - } - - return fn(fp, data, opts); -}; - -const readFile = fp => pify(fs.readFile)(fp, 'utf8').catch(() => {}); - -const main = (fp, data, opts) => { - return (opts.detectIndent ? readFile(fp) : Promise.resolve()) - .then(str => { - const indent = str ? detectIndent(str).indent : opts.indent; - const json = JSON.stringify(data, opts.replacer, indent); - - return pify(writeFileAtomic)(fp, `${json}\n`, {mode: opts.mode}); - }); -}; - -const mainSync = (fp, data, opts) => { - let indent = opts.indent; - - if (opts.detectIndent) { - try { - const file = fs.readFileSync(fp, 'utf8'); - indent = detectIndent(file).indent; - } catch (err) { - if (err.code !== 'ENOENT') { - throw err; - } - } - } - - const json = JSON.stringify(data, opts.replacer, indent); - - return writeFileAtomic.sync(fp, `${json}\n`, {mode: opts.mode}); -}; - -module.exports = (fp, data, opts) => { - return makeDir(path.dirname(fp), {fs}) - .then(() => init(main, fp, data, opts)); -}; - -module.exports.sync = (fp, data, opts) => { - makeDir.sync(path.dirname(fp), {fs}); - init(mainSync, fp, data, opts); -}; diff --git a/packages/list/test/fixture-with-no-pkg-version/node_modules/.pnpm/registry.npmjs.org/write-json-file/2.3.0/node_modules/write-json-file/license b/packages/list/test/fixture-with-no-pkg-version/node_modules/.pnpm/registry.npmjs.org/write-json-file/2.3.0/node_modules/write-json-file/license deleted file mode 100644 index e7af2f7710..0000000000 --- a/packages/list/test/fixture-with-no-pkg-version/node_modules/.pnpm/registry.npmjs.org/write-json-file/2.3.0/node_modules/write-json-file/license +++ /dev/null @@ -1,9 +0,0 @@ -MIT License - -Copyright (c) Sindre Sorhus (sindresorhus.com) - -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. diff --git a/packages/list/test/fixture-with-no-pkg-version/node_modules/.pnpm/registry.npmjs.org/write-json-file/2.3.0/node_modules/write-json-file/package.json b/packages/list/test/fixture-with-no-pkg-version/node_modules/.pnpm/registry.npmjs.org/write-json-file/2.3.0/node_modules/write-json-file/package.json deleted file mode 100644 index 169c7a888b..0000000000 --- a/packages/list/test/fixture-with-no-pkg-version/node_modules/.pnpm/registry.npmjs.org/write-json-file/2.3.0/node_modules/write-json-file/package.json +++ /dev/null @@ -1,48 +0,0 @@ -{ - "name": "write-json-file", - "version": "2.3.0", - "description": "Stringify and write JSON to a file atomically", - "license": "MIT", - "repository": "sindresorhus/write-json-file", - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" - }, - "engines": { - "node": ">=4" - }, - "scripts": { - "test": "xo && ava" - }, - "files": [ - "index.js" - ], - "keywords": [ - "write", - "json", - "stringify", - "file", - "fs", - "graceful", - "stable", - "sort", - "newline", - "indent", - "atomic", - "atomically" - ], - "dependencies": { - "detect-indent": "^5.0.0", - "graceful-fs": "^4.1.2", - "make-dir": "^1.0.0", - "pify": "^3.0.0", - "sort-keys": "^2.0.0", - "write-file-atomic": "^2.0.0" - }, - "devDependencies": { - "ava": "*", - "tempfile": "^2.0.0", - "xo": "*" - } -} diff --git a/packages/list/test/fixture-with-no-pkg-version/node_modules/.pnpm/registry.npmjs.org/write-json-file/2.3.0/node_modules/write-json-file/readme.md b/packages/list/test/fixture-with-no-pkg-version/node_modules/.pnpm/registry.npmjs.org/write-json-file/2.3.0/node_modules/write-json-file/readme.md deleted file mode 100644 index c148f05290..0000000000 --- a/packages/list/test/fixture-with-no-pkg-version/node_modules/.pnpm/registry.npmjs.org/write-json-file/2.3.0/node_modules/write-json-file/readme.md +++ /dev/null @@ -1,83 +0,0 @@ -# write-json-file [![Build Status](https://travis-ci.org/sindresorhus/write-json-file.svg?branch=master)](https://travis-ci.org/sindresorhus/write-json-file) - -> Stringify and write JSON to a file [atomically](https://github.com/npm/write-file-atomic) - -Creates directories for you as needed. - - -## Install - -``` -$ npm install write-json-file -``` - - -## Usage - -```js -const writeJsonFile = require('write-json-file'); - -writeJsonFile('foo.json', {foo: true}).then(() => { - console.log('done'); -}); -``` - - -## API - -### writeJsonFile(filepath, data, [options]) - -Returns a `Promise`. - -### writeJsonFile.sync(filepath, data, [options]) - -#### options - -Type: `Object` - -##### indent - -Type: `string` `number`
-Default: `'\t'` - -Indentation as a string or number of spaces.
-Pass in `null` for no formatting. - -##### detectIndent - -Type: `boolean`
-Default: `false` - -Detect indentation automatically if the file exists. - -##### sortKeys - -Type: `boolean` `function`
-Default: `false` - -Sort the keys recursively.
-Optionally pass in a [`compare`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort) function. - -##### replacer - -Type: `function` - -Passed into [`JSON.stringify`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify#The_replacer_parameter). - -##### mode - -Type: `number`
-Default: `0o666` - -[Mode](https://en.wikipedia.org/wiki/File_system_permissions#Numeric_notation) used when writing the file. - - -## Related - -- [load-json-file](https://github.com/sindresorhus/load-json-file) - Read and parse a JSON file -- [make-dir](https://github.com/sindresorhus/make-dir) - Make a directory and its parents if needed - - -## License - -MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/packages/list/test/fixture-with-no-pkg-version/node_modules/is-negative b/packages/list/test/fixture-with-no-pkg-version/node_modules/is-negative deleted file mode 120000 index eaa5d610d0..0000000000 --- a/packages/list/test/fixture-with-no-pkg-version/node_modules/is-negative +++ /dev/null @@ -1 +0,0 @@ -../../../../../../../../.pnpm-store/2/registry.npmjs.org/is-negative/2.1.0/node_modules/is-negative \ No newline at end of file diff --git a/packages/list/test/fixture-with-no-pkg-version/node_modules/is-positive b/packages/list/test/fixture-with-no-pkg-version/node_modules/is-positive deleted file mode 120000 index 45afa70d3b..0000000000 --- a/packages/list/test/fixture-with-no-pkg-version/node_modules/is-positive +++ /dev/null @@ -1 +0,0 @@ -../../../../../../../../.pnpm-store/2/registry.npmjs.org/is-positive/3.1.0/node_modules/is-positive \ No newline at end of file diff --git a/packages/list/test/fixture-with-no-pkg-version/node_modules/write-json-file b/packages/list/test/fixture-with-no-pkg-version/node_modules/write-json-file deleted file mode 120000 index 31d7377aa0..0000000000 --- a/packages/list/test/fixture-with-no-pkg-version/node_modules/write-json-file +++ /dev/null @@ -1 +0,0 @@ -.pnpm/registry.npmjs.org/write-json-file/2.3.0/node_modules/write-json-file \ No newline at end of file diff --git a/packages/list/test/fixture/.gitignore b/packages/list/test/fixture/.gitignore deleted file mode 100644 index cf4bab9ddd..0000000000 --- a/packages/list/test/fixture/.gitignore +++ /dev/null @@ -1 +0,0 @@ -!node_modules diff --git a/packages/list/test/fixture/node_modules/.modules.yaml b/packages/list/test/fixture/node_modules/.modules.yaml deleted file mode 100644 index 2f7cf36f68..0000000000 --- a/packages/list/test/fixture/node_modules/.modules.yaml +++ /dev/null @@ -1,11 +0,0 @@ -included: - dependencies: true - devDependencies: true - optionalDependencies: true -layoutVersion: 3 -packageManager: pnpm@3.8.1 -pendingBuilds: [] -registries: - default: 'https://registry.npmjs.org/' -skipped: [] -store: /home/zoltan/.pnpm-store/2 diff --git a/packages/list/test/fixture/node_modules/.pnpm/lock.yaml b/packages/list/test/fixture/node_modules/.pnpm/lock.yaml deleted file mode 100644 index 688ab59425..0000000000 --- a/packages/list/test/fixture/node_modules/.pnpm/lock.yaml +++ /dev/null @@ -1,94 +0,0 @@ -dependencies: - write-json-file: 2.3.0 -devDependencies: - is-positive: 3.1.0 -lockfileVersion: 5.1 -optionalDependencies: - is-negative: 2.1.0 -packages: - /detect-indent/5.0.0: - dev: false - engines: - node: '>=4' - resolution: - integrity: sha1-OHHMCmoALow+Wzz38zYmRnXwa50= - /graceful-fs/4.2.2: - dev: false - resolution: - integrity: sha512-IItsdsea19BoLC7ELy13q1iJFNmd7ofZH5+X/pJr90/nRoPEX0DJo1dHDbgtYWOhJhcCgMDTOw84RZ72q6lB+Q== - /imurmurhash/0.1.4: - dev: false - engines: - node: '>=0.8.19' - resolution: - integrity: sha1-khi5srkoojixPcT7a21XbyMUU+o= - /is-negative/2.1.0: - dev: false - engines: - node: '>=0.10.0' - optional: true - resolution: - integrity: sha1-8Nhjd6oVpkw0lh84rCqb4rQKEYc= - /is-plain-obj/1.1.0: - dev: false - engines: - node: '>=0.10.0' - resolution: - integrity: sha1-caUMhCnfync8kqOQpKA7OfzVHT4= - /is-positive/3.1.0: - dev: true - engines: - node: '>=0.10.0' - resolution: - integrity: sha1-hX21hKG6XRyymAUn/DtsQ103sP0= - /make-dir/1.3.0: - dependencies: - pify: 3.0.0 - dev: false - engines: - node: '>=4' - resolution: - integrity: sha512-2w31R7SJtieJJnQtGc7RVL2StM2vGYVfqUOvUDxH6bC6aJTxPxTF0GnIgCyu7tjockiUWAYQRbxa7vKn34s5sQ== - /pify/3.0.0: - dev: false - engines: - node: '>=4' - resolution: - integrity: sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY= - /signal-exit/3.0.2: - dev: false - resolution: - integrity: sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0= - /sort-keys/2.0.0: - dependencies: - is-plain-obj: 1.1.0 - dev: false - engines: - node: '>=4' - resolution: - integrity: sha1-ZYU1WEhh7JfXMNbPQYIuH1ZoQSg= - /write-file-atomic/2.4.3: - dependencies: - graceful-fs: 4.2.2 - imurmurhash: 0.1.4 - signal-exit: 3.0.2 - dev: false - resolution: - integrity: sha512-GaETH5wwsX+GcnzhPgKcKjJ6M2Cq3/iZp1WyY/X1CSqrW+jVNM9Y7D8EC2sM4ZG/V8wZlSniJnCKWPmBYAucRQ== - /write-json-file/2.3.0: - dependencies: - detect-indent: 5.0.0 - graceful-fs: 4.2.2 - make-dir: 1.3.0 - pify: 3.0.0 - sort-keys: 2.0.0 - write-file-atomic: 2.4.3 - dev: false - engines: - node: '>=4' - resolution: - integrity: sha1-K2TIozAE1UuGmMdtWFp3zrYdoy8= -specifiers: - is-negative: ^2.1.0 - is-positive: ^3.1.0 - write-json-file: ^2.2.0 diff --git a/packages/list/test/fixture/node_modules/.pnpm/registry.npmjs.org/make-dir/1.3.0/node_modules/make-dir/index.js b/packages/list/test/fixture/node_modules/.pnpm/registry.npmjs.org/make-dir/1.3.0/node_modules/make-dir/index.js deleted file mode 100644 index 18439555f8..0000000000 --- a/packages/list/test/fixture/node_modules/.pnpm/registry.npmjs.org/make-dir/1.3.0/node_modules/make-dir/index.js +++ /dev/null @@ -1,85 +0,0 @@ -'use strict'; -const fs = require('fs'); -const path = require('path'); -const pify = require('pify'); - -const defaults = { - mode: 0o777 & (~process.umask()), - fs -}; - -// https://github.com/nodejs/node/issues/8987 -// https://github.com/libuv/libuv/pull/1088 -const checkPath = pth => { - if (process.platform === 'win32') { - const pathHasInvalidWinCharacters = /[<>:"|?*]/.test(pth.replace(path.parse(pth).root, '')); - - if (pathHasInvalidWinCharacters) { - const err = new Error(`Path contains invalid characters: ${pth}`); - err.code = 'EINVAL'; - throw err; - } - } -}; - -module.exports = (input, opts) => Promise.resolve().then(() => { - checkPath(input); - opts = Object.assign({}, defaults, opts); - - const mkdir = pify(opts.fs.mkdir); - const stat = pify(opts.fs.stat); - - const make = pth => { - return mkdir(pth, opts.mode) - .then(() => pth) - .catch(err => { - if (err.code === 'ENOENT') { - if (err.message.includes('null bytes') || path.dirname(pth) === pth) { - throw err; - } - - return make(path.dirname(pth)).then(() => make(pth)); - } - - return stat(pth) - .then(stats => stats.isDirectory() ? pth : Promise.reject()) - .catch(() => { - throw err; - }); - }); - }; - - return make(path.resolve(input)); -}); - -module.exports.sync = (input, opts) => { - checkPath(input); - opts = Object.assign({}, defaults, opts); - - const make = pth => { - try { - opts.fs.mkdirSync(pth, opts.mode); - } catch (err) { - if (err.code === 'ENOENT') { - if (err.message.includes('null bytes') || path.dirname(pth) === pth) { - throw err; - } - - make(path.dirname(pth)); - return make(pth); - } - - try { - if (!opts.fs.statSync(pth).isDirectory()) { - throw new Error('The path is not a directory'); - } - } catch (_) { - throw err; - } - } - - return pth; - }; - - return make(path.resolve(input)); -}; diff --git a/packages/list/test/fixture/node_modules/.pnpm/registry.npmjs.org/make-dir/1.3.0/node_modules/make-dir/license b/packages/list/test/fixture/node_modules/.pnpm/registry.npmjs.org/make-dir/1.3.0/node_modules/make-dir/license deleted file mode 100644 index e7af2f7710..0000000000 --- a/packages/list/test/fixture/node_modules/.pnpm/registry.npmjs.org/make-dir/1.3.0/node_modules/make-dir/license +++ /dev/null @@ -1,9 +0,0 @@ -MIT License - -Copyright (c) Sindre Sorhus (sindresorhus.com) - -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. diff --git a/packages/list/test/fixture/node_modules/.pnpm/registry.npmjs.org/make-dir/1.3.0/node_modules/make-dir/package.json b/packages/list/test/fixture/node_modules/.pnpm/registry.npmjs.org/make-dir/1.3.0/node_modules/make-dir/package.json deleted file mode 100644 index ec907a71f8..0000000000 --- a/packages/list/test/fixture/node_modules/.pnpm/registry.npmjs.org/make-dir/1.3.0/node_modules/make-dir/package.json +++ /dev/null @@ -1,54 +0,0 @@ -{ - "name": "make-dir", - "version": "1.3.0", - "description": "Make a directory and its parents if needed - Think `mkdir -p`", - "license": "MIT", - "repository": "sindresorhus/make-dir", - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" - }, - "engines": { - "node": ">=4" - }, - "scripts": { - "test": "xo && nyc ava" - }, - "files": [ - "index.js" - ], - "keywords": [ - "mkdir", - "mkdirp", - "make", - "directories", - "dir", - "dirs", - "folders", - "directory", - "folder", - "path", - "parent", - "parents", - "intermediate", - "recursively", - "recursive", - "create", - "fs", - "filesystem", - "file-system" - ], - "dependencies": { - "pify": "^3.0.0" - }, - "devDependencies": { - "ava": "*", - "codecov": "^3.0.0", - "graceful-fs": "^4.1.11", - "nyc": "^11.3.0", - "path-type": "^3.0.0", - "tempy": "^0.2.1", - "xo": "^0.20.0" - } -} diff --git a/packages/list/test/fixture/node_modules/.pnpm/registry.npmjs.org/make-dir/1.3.0/node_modules/make-dir/readme.md b/packages/list/test/fixture/node_modules/.pnpm/registry.npmjs.org/make-dir/1.3.0/node_modules/make-dir/readme.md deleted file mode 100644 index 8a32bf4714..0000000000 --- a/packages/list/test/fixture/node_modules/.pnpm/registry.npmjs.org/make-dir/1.3.0/node_modules/make-dir/readme.md +++ /dev/null @@ -1,116 +0,0 @@ -# make-dir [![Build Status: macOS & Linux](https://travis-ci.org/sindresorhus/make-dir.svg?branch=master)](https://travis-ci.org/sindresorhus/make-dir) [![Build status: Windows](https://ci.appveyor.com/api/projects/status/e0vtt8y600w91gcs/branch/master?svg=true)](https://ci.appveyor.com/project/sindresorhus/make-dir/branch/master) [![codecov](https://codecov.io/gh/sindresorhus/make-dir/branch/master/graph/badge.svg)](https://codecov.io/gh/sindresorhus/make-dir) - -> Make a directory and its parents if needed - Think `mkdir -p` - - -## Advantages over [`mkdirp`](https://github.com/substack/node-mkdirp) - -- Promise API *(Async/await ready!)* -- Fixes many `mkdirp` issues: [#96](https://github.com/substack/node-mkdirp/pull/96) [#70](https://github.com/substack/node-mkdirp/issues/70) [#66](https://github.com/substack/node-mkdirp/issues/66) -- 100% test coverage -- CI-tested on macOS, Linux, and Windows -- Actively maintained -- Doesn't bundle a CLI - - -## Install - -``` -$ npm install make-dir -``` - - -## Usage - -``` -$ pwd -/Users/sindresorhus/fun -$ tree -. -``` - -```js -const makeDir = require('make-dir'); - -makeDir('unicorn/rainbow/cake').then(path => { - console.log(path); - //=> '/Users/sindresorhus/fun/unicorn/rainbow/cake' -}); -``` - -``` -$ tree -. -└── unicorn - └── rainbow - └── cake -``` - -Multiple directories: - -```js -const makeDir = require('make-dir'); - -Promise.all([ - makeDir('unicorn/rainbow') - makeDir('foo/bar') -]).then(paths => { - console.log(paths); - /* - [ - '/Users/sindresorhus/fun/unicorn/rainbow', - '/Users/sindresorhus/fun/foo/bar' - ] - */ -}); -``` - - -## API - -### makeDir(path, [options]) - -Returns a `Promise` for the path to the created directory. - -### makeDir.sync(path, [options]) - -Returns the path to the created directory. - -#### path - -Type: `string` - -Directory to create. - -#### options - -Type: `Object` - -##### mode - -Type: `integer`
-Default: `0o777 & (~process.umask())` - -Directory [permissions](https://x-team.com/blog/file-system-permissions-umask-node-js/). - -##### fs - -Type: `Object`
-Default: `require('fs')` - -Use a custom `fs` implementation. For example [`graceful-fs`](https://github.com/isaacs/node-graceful-fs). - - -## Related - -- [make-dir-cli](https://github.com/sindresorhus/make-dir-cli) - CLI for this module -- [del](https://github.com/sindresorhus/del) - Delete files and directories -- [globby](https://github.com/sindresorhus/globby) - User-friendly glob matching -- [cpy](https://github.com/sindresorhus/cpy) - Copy files -- [cpy-cli](https://github.com/sindresorhus/cpy-cli) - Copy files on the command-line -- [move-file](https://github.com/sindresorhus/move-file) - Move a file - - -## License - -MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/packages/list/test/fixture/node_modules/.pnpm/registry.npmjs.org/make-dir/1.3.0/node_modules/pify b/packages/list/test/fixture/node_modules/.pnpm/registry.npmjs.org/make-dir/1.3.0/node_modules/pify deleted file mode 120000 index 9efa2a6efb..0000000000 --- a/packages/list/test/fixture/node_modules/.pnpm/registry.npmjs.org/make-dir/1.3.0/node_modules/pify +++ /dev/null @@ -1 +0,0 @@ -../../../../../../../../../../../../../.pnpm-store/2/registry.npmjs.org/pify/3.0.0/node_modules/pify \ No newline at end of file diff --git a/packages/list/test/fixture/node_modules/.pnpm/registry.npmjs.org/sort-keys/2.0.0/node_modules/is-plain-obj b/packages/list/test/fixture/node_modules/.pnpm/registry.npmjs.org/sort-keys/2.0.0/node_modules/is-plain-obj deleted file mode 120000 index aed859d2a8..0000000000 --- a/packages/list/test/fixture/node_modules/.pnpm/registry.npmjs.org/sort-keys/2.0.0/node_modules/is-plain-obj +++ /dev/null @@ -1 +0,0 @@ -../../../../../../../../../../../../../.pnpm-store/2/registry.npmjs.org/is-plain-obj/1.1.0/node_modules/is-plain-obj \ No newline at end of file diff --git a/packages/list/test/fixture/node_modules/.pnpm/registry.npmjs.org/sort-keys/2.0.0/node_modules/sort-keys/index.js b/packages/list/test/fixture/node_modules/.pnpm/registry.npmjs.org/sort-keys/2.0.0/node_modules/sort-keys/index.js deleted file mode 100644 index 53489d7888..0000000000 --- a/packages/list/test/fixture/node_modules/.pnpm/registry.npmjs.org/sort-keys/2.0.0/node_modules/sort-keys/index.js +++ /dev/null @@ -1,55 +0,0 @@ -'use strict'; -const isPlainObj = require('is-plain-obj'); - -module.exports = (obj, opts) => { - if (!isPlainObj(obj)) { - throw new TypeError('Expected a plain object'); - } - - opts = opts || {}; - - // DEPRECATED - if (typeof opts === 'function') { - throw new TypeError('Specify the compare function as an option instead'); - } - - const deep = opts.deep; - const seenInput = []; - const seenOutput = []; - - const sortKeys = x => { - const seenIndex = seenInput.indexOf(x); - - if (seenIndex !== -1) { - return seenOutput[seenIndex]; - } - - const ret = {}; - const keys = Object.keys(x).sort(opts.compare); - - seenInput.push(x); - seenOutput.push(ret); - - for (let i = 0; i < keys.length; i++) { - const key = keys[i]; - const val = x[key]; - - if (deep && Array.isArray(val)) { - const retArr = []; - - for (let j = 0; j < val.length; j++) { - retArr[j] = isPlainObj(val[j]) ? sortKeys(val[j]) : val[j]; - } - - ret[key] = retArr; - continue; - } - - ret[key] = deep && isPlainObj(val) ? sortKeys(val) : val; - } - - return ret; - }; - - return sortKeys(obj); -}; diff --git a/packages/list/test/fixture/node_modules/.pnpm/registry.npmjs.org/sort-keys/2.0.0/node_modules/sort-keys/license b/packages/list/test/fixture/node_modules/.pnpm/registry.npmjs.org/sort-keys/2.0.0/node_modules/sort-keys/license deleted file mode 100644 index e7af2f7710..0000000000 --- a/packages/list/test/fixture/node_modules/.pnpm/registry.npmjs.org/sort-keys/2.0.0/node_modules/sort-keys/license +++ /dev/null @@ -1,9 +0,0 @@ -MIT License - -Copyright (c) Sindre Sorhus (sindresorhus.com) - -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. diff --git a/packages/list/test/fixture/node_modules/.pnpm/registry.npmjs.org/sort-keys/2.0.0/node_modules/sort-keys/package.json b/packages/list/test/fixture/node_modules/.pnpm/registry.npmjs.org/sort-keys/2.0.0/node_modules/sort-keys/package.json deleted file mode 100644 index 3da9c7659d..0000000000 --- a/packages/list/test/fixture/node_modules/.pnpm/registry.npmjs.org/sort-keys/2.0.0/node_modules/sort-keys/package.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "name": "sort-keys", - "version": "2.0.0", - "description": "Sort the keys of an object", - "license": "MIT", - "repository": "sindresorhus/sort-keys", - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" - }, - "engines": { - "node": ">=4" - }, - "scripts": { - "test": "xo && ava" - }, - "files": [ - "index.js" - ], - "keywords": [ - "sort", - "object", - "keys", - "obj", - "key", - "stable", - "deterministic", - "deep", - "recursive", - "recursively" - ], - "dependencies": { - "is-plain-obj": "^1.0.0" - }, - "devDependencies": { - "ava": "*", - "xo": "*" - } -} diff --git a/packages/list/test/fixture/node_modules/.pnpm/registry.npmjs.org/sort-keys/2.0.0/node_modules/sort-keys/readme.md b/packages/list/test/fixture/node_modules/.pnpm/registry.npmjs.org/sort-keys/2.0.0/node_modules/sort-keys/readme.md deleted file mode 100644 index a671ffb3de..0000000000 --- a/packages/list/test/fixture/node_modules/.pnpm/registry.npmjs.org/sort-keys/2.0.0/node_modules/sort-keys/readme.md +++ /dev/null @@ -1,60 +0,0 @@ -# sort-keys [![Build Status](https://travis-ci.org/sindresorhus/sort-keys.svg?branch=master)](https://travis-ci.org/sindresorhus/sort-keys) - -> Sort the keys of an object - -Useful to get a deterministically ordered object, as the order of keys can vary between engines. - - -## Install - -``` -$ npm install --save sort-keys -``` - - -## Usage - -```js -const sortKeys = require('sort-keys'); - -sortKeys({c: 0, a: 0, b: 0}); -//=> {a: 0, b: 0, c: 0} - -sortKeys({b: {b: 0, a: 0}, a: 0}, {deep: true}); -//=> {a: 0, b: {a: 0, b: 0}} - -sortKeys({c: 0, a: 0, b: 0}, { - compare: (a, b) => -a.localeCompare(b) -}); -//=> {c: 0, b: 0, a: 0} -``` - - -## API - -### sortKeys(input, [options]) - -Returns a new object with sorted keys. - -#### input - -Type: `Object` - -#### options - -##### deep - -Type: `boolean` - -Recursively sort keys. - -##### compare - -Type: `Function` - -[Compare function.](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort) - - -## License - -MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/packages/list/test/fixture/node_modules/.pnpm/registry.npmjs.org/write-file-atomic/2.4.3/node_modules/graceful-fs b/packages/list/test/fixture/node_modules/.pnpm/registry.npmjs.org/write-file-atomic/2.4.3/node_modules/graceful-fs deleted file mode 120000 index f7e698f2d8..0000000000 --- a/packages/list/test/fixture/node_modules/.pnpm/registry.npmjs.org/write-file-atomic/2.4.3/node_modules/graceful-fs +++ /dev/null @@ -1 +0,0 @@ -../../../../../../../../../../../../../.pnpm-store/2/registry.npmjs.org/graceful-fs/4.2.2/node_modules/graceful-fs \ No newline at end of file diff --git a/packages/list/test/fixture/node_modules/.pnpm/registry.npmjs.org/write-file-atomic/2.4.3/node_modules/imurmurhash b/packages/list/test/fixture/node_modules/.pnpm/registry.npmjs.org/write-file-atomic/2.4.3/node_modules/imurmurhash deleted file mode 120000 index 6ea03bf6c9..0000000000 --- a/packages/list/test/fixture/node_modules/.pnpm/registry.npmjs.org/write-file-atomic/2.4.3/node_modules/imurmurhash +++ /dev/null @@ -1 +0,0 @@ -../../../../../../../../../../../../../.pnpm-store/2/registry.npmjs.org/imurmurhash/0.1.4/node_modules/imurmurhash \ No newline at end of file diff --git a/packages/list/test/fixture/node_modules/.pnpm/registry.npmjs.org/write-file-atomic/2.4.3/node_modules/signal-exit b/packages/list/test/fixture/node_modules/.pnpm/registry.npmjs.org/write-file-atomic/2.4.3/node_modules/signal-exit deleted file mode 120000 index 70dc3a3818..0000000000 --- a/packages/list/test/fixture/node_modules/.pnpm/registry.npmjs.org/write-file-atomic/2.4.3/node_modules/signal-exit +++ /dev/null @@ -1 +0,0 @@ -../../../../../../../../../../../../../.pnpm-store/2/registry.npmjs.org/signal-exit/3.0.2/node_modules/signal-exit \ No newline at end of file diff --git a/packages/list/test/fixture/node_modules/.pnpm/registry.npmjs.org/write-file-atomic/2.4.3/node_modules/write-file-atomic/CHANGELOG.md b/packages/list/test/fixture/node_modules/.pnpm/registry.npmjs.org/write-file-atomic/2.4.3/node_modules/write-file-atomic/CHANGELOG.md deleted file mode 100644 index 920ae2cb4d..0000000000 --- a/packages/list/test/fixture/node_modules/.pnpm/registry.npmjs.org/write-file-atomic/2.4.3/node_modules/write-file-atomic/CHANGELOG.md +++ /dev/null @@ -1,25 +0,0 @@ -# 2.4.3 - -* Ignore errors raised by `fs.closeSync` when cleaning up after a write - error. - -# 2.4.2 - -* A pair of patches to fix some fd leaks. We would leak fds with sync use - when errors occured and with async use any time fsync was not in use. (#34) - -# 2.4.1 - -* Fix a bug where `signal-exit` instances would be leaked. This was fixed when addressing #35. - -# 2.4.0 - -## Features - -* Allow chown and mode options to be set to false to disable the defaulting behavior. (#20) -* Support passing encoding strings in options slot for compat with Node.js API. (#31) -* Add support for running inside of worker threads (#37) - -## Fixes - -* Remove unneeded call when returning success (#36) diff --git a/packages/list/test/fixture/node_modules/.pnpm/registry.npmjs.org/write-file-atomic/2.4.3/node_modules/write-file-atomic/LICENSE b/packages/list/test/fixture/node_modules/.pnpm/registry.npmjs.org/write-file-atomic/2.4.3/node_modules/write-file-atomic/LICENSE deleted file mode 100644 index 95e65a7706..0000000000 --- a/packages/list/test/fixture/node_modules/.pnpm/registry.npmjs.org/write-file-atomic/2.4.3/node_modules/write-file-atomic/LICENSE +++ /dev/null @@ -1,6 +0,0 @@ -Copyright (c) 2015, Rebecca Turner - -Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - diff --git a/packages/list/test/fixture/node_modules/.pnpm/registry.npmjs.org/write-file-atomic/2.4.3/node_modules/write-file-atomic/README.md b/packages/list/test/fixture/node_modules/.pnpm/registry.npmjs.org/write-file-atomic/2.4.3/node_modules/write-file-atomic/README.md deleted file mode 100644 index ca28e99a2b..0000000000 --- a/packages/list/test/fixture/node_modules/.pnpm/registry.npmjs.org/write-file-atomic/2.4.3/node_modules/write-file-atomic/README.md +++ /dev/null @@ -1,56 +0,0 @@ -write-file-atomic ------------------ - -This is an extension for node's `fs.writeFile` that makes its operation -atomic and allows you set ownership (uid/gid of the file). - -### var writeFileAtomic = require('write-file-atomic')
writeFileAtomic(filename, data, [options], callback) - -* filename **String** -* data **String** | **Buffer** -* options **Object** | **String** - * chown **Object** default, uid & gid of existing file, if any - * uid **Number** - * gid **Number** - * encoding **String** | **Null** default = 'utf8' - * fsync **Boolean** default = true - * mode **Number** default, from existing file, if any - * Promise **Object** default = native Promise object -* callback **Function** - -Atomically and asynchronously writes data to a file, replacing the file if it already -exists. data can be a string or a buffer. - -The file is initially named `filename + "." + murmurhex(__filename, process.pid, ++invocations)`. -Note that `require('worker_threads').threadId` is used in addition to `process.pid` if running inside of a worker thread. -If writeFile completes successfully then, if passed the **chown** option it will change -the ownership of the file. Finally it renames the file back to the filename you specified. If -it encounters errors at any of these steps it will attempt to unlink the temporary file and then -pass the error back to the caller. -If multiple writes are concurrently issued to the same file, the write operations are put into a queue and serialized in the order they were called, using Promises. Native promises are used by default, but you can inject your own promise-like object with the **Promise** option. Writes to different files are still executed in parallel. - -If provided, the **chown** option requires both **uid** and **gid** properties or else -you'll get an error. If **chown** is not specified it will default to using -the owner of the previous file. To prevent chown from being ran you can -also pass `false`, in which case the file will be created with the current user's credentials. - -If **mode** is not specified, it will default to using the permissions from -an existing file, if any. Expicitly setting this to `false` remove this default, resulting -in a file created with the system default permissions. - -If options is a String, it's assumed to be the **encoding** option. The **encoding** option is ignored if **data** is a buffer. It defaults to 'utf8'. - -If the **fsync** option is **false**, writeFile will skip the final fsync call. - -Example: - -```javascript -writeFileAtomic('message.txt', 'Hello Node', {chown:{uid:100,gid:50}}, function (err) { - if (err) throw err; - console.log('It\'s saved!'); -}); -``` - -### var writeFileAtomicSync = require('write-file-atomic').sync
writeFileAtomicSync(filename, data, [options]) - -The synchronous version of **writeFileAtomic**. diff --git a/packages/list/test/fixture/node_modules/.pnpm/registry.npmjs.org/write-file-atomic/2.4.3/node_modules/write-file-atomic/index.js b/packages/list/test/fixture/node_modules/.pnpm/registry.npmjs.org/write-file-atomic/2.4.3/node_modules/write-file-atomic/index.js deleted file mode 100644 index 64ae987c01..0000000000 --- a/packages/list/test/fixture/node_modules/.pnpm/registry.npmjs.org/write-file-atomic/2.4.3/node_modules/write-file-atomic/index.js +++ /dev/null @@ -1,238 +0,0 @@ -'use strict' -module.exports = writeFile -module.exports.sync = writeFileSync -module.exports._getTmpname = getTmpname // for testing -module.exports._cleanupOnExit = cleanupOnExit - -var fs = require('graceful-fs') -var MurmurHash3 = require('imurmurhash') -var onExit = require('signal-exit') -var path = require('path') -var activeFiles = {} - -// if we run inside of a worker_thread, `process.pid` is not unique -/* istanbul ignore next */ -var threadId = (function getId () { - try { - var workerThreads = require('worker_threads') - - /// if we are in main thread, this is set to `0` - return workerThreads.threadId - } catch (e) { - // worker_threads are not available, fallback to 0 - return 0 - } -})() - -var invocations = 0 -function getTmpname (filename) { - return filename + '.' + - MurmurHash3(__filename) - .hash(String(process.pid)) - .hash(String(threadId)) - .hash(String(++invocations)) - .result() -} - -function cleanupOnExit (tmpfile) { - return function () { - try { - fs.unlinkSync(typeof tmpfile === 'function' ? tmpfile() : tmpfile) - } catch (_) {} - } -} - -function writeFile (filename, data, options, callback) { - if (options) { - if (options instanceof Function) { - callback = options - options = {} - } else if (typeof options === 'string') { - options = { encoding: options } - } - } else { - options = {} - } - - var Promise = options.Promise || global.Promise - var truename - var fd - var tmpfile - /* istanbul ignore next -- The closure only gets called when onExit triggers */ - var removeOnExitHandler = onExit(cleanupOnExit(() => tmpfile)) - var absoluteName = path.resolve(filename) - - new Promise(function serializeSameFile (resolve) { - // make a queue if it doesn't already exist - if (!activeFiles[absoluteName]) activeFiles[absoluteName] = [] - - activeFiles[absoluteName].push(resolve) // add this job to the queue - if (activeFiles[absoluteName].length === 1) resolve() // kick off the first one - }).then(function getRealPath () { - return new Promise(function (resolve) { - fs.realpath(filename, function (_, realname) { - truename = realname || filename - tmpfile = getTmpname(truename) - resolve() - }) - }) - }).then(function stat () { - return new Promise(function stat (resolve) { - if (options.mode && options.chown) resolve() - else { - // Either mode or chown is not explicitly set - // Default behavior is to copy it from original file - fs.stat(truename, function (err, stats) { - if (err || !stats) resolve() - else { - options = Object.assign({}, options) - - if (options.mode == null) { - options.mode = stats.mode - } - if (options.chown == null && process.getuid) { - options.chown = { uid: stats.uid, gid: stats.gid } - } - resolve() - } - }) - } - }) - }).then(function thenWriteFile () { - return new Promise(function (resolve, reject) { - fs.open(tmpfile, 'w', options.mode, function (err, _fd) { - fd = _fd - if (err) reject(err) - else resolve() - }) - }) - }).then(function write () { - return new Promise(function (resolve, reject) { - if (Buffer.isBuffer(data)) { - fs.write(fd, data, 0, data.length, 0, function (err) { - if (err) reject(err) - else resolve() - }) - } else if (data != null) { - fs.write(fd, String(data), 0, String(options.encoding || 'utf8'), function (err) { - if (err) reject(err) - else resolve() - }) - } else resolve() - }) - }).then(function syncAndClose () { - return new Promise(function (resolve, reject) { - if (options.fsync !== false) { - fs.fsync(fd, function (err) { - if (err) fs.close(fd, () => reject(err)) - else fs.close(fd, resolve) - }) - } else { - fs.close(fd, resolve) - } - }) - }).then(function chown () { - fd = null - if (options.chown) { - return new Promise(function (resolve, reject) { - fs.chown(tmpfile, options.chown.uid, options.chown.gid, function (err) { - if (err) reject(err) - else resolve() - }) - }) - } - }).then(function chmod () { - if (options.mode) { - return new Promise(function (resolve, reject) { - fs.chmod(tmpfile, options.mode, function (err) { - if (err) reject(err) - else resolve() - }) - }) - } - }).then(function rename () { - return new Promise(function (resolve, reject) { - fs.rename(tmpfile, truename, function (err) { - if (err) reject(err) - else resolve() - }) - }) - }).then(function success () { - removeOnExitHandler() - callback() - }, function fail (err) { - return new Promise(resolve => { - return fd ? fs.close(fd, resolve) : resolve() - }).then(() => { - removeOnExitHandler() - fs.unlink(tmpfile, function () { - callback(err) - }) - }) - }).then(function checkQueue () { - activeFiles[absoluteName].shift() // remove the element added by serializeSameFile - if (activeFiles[absoluteName].length > 0) { - activeFiles[absoluteName][0]() // start next job if one is pending - } else delete activeFiles[absoluteName] - }) -} - -function writeFileSync (filename, data, options) { - if (typeof options === 'string') options = { encoding: options } - else if (!options) options = {} - try { - filename = fs.realpathSync(filename) - } catch (ex) { - // it's ok, it'll happen on a not yet existing file - } - var tmpfile = getTmpname(filename) - - if (!options.mode || !options.chown) { - // Either mode or chown is not explicitly set - // Default behavior is to copy it from original file - try { - var stats = fs.statSync(filename) - options = Object.assign({}, options) - if (!options.mode) { - options.mode = stats.mode - } - if (!options.chown && process.getuid) { - options.chown = { uid: stats.uid, gid: stats.gid } - } - } catch (ex) { - // ignore stat errors - } - } - - var fd - var cleanup = cleanupOnExit(tmpfile) - var removeOnExitHandler = onExit(cleanup) - - try { - fd = fs.openSync(tmpfile, 'w', options.mode) - if (Buffer.isBuffer(data)) { - fs.writeSync(fd, data, 0, data.length, 0) - } else if (data != null) { - fs.writeSync(fd, String(data), 0, String(options.encoding || 'utf8')) - } - if (options.fsync !== false) { - fs.fsyncSync(fd) - } - fs.closeSync(fd) - if (options.chown) fs.chownSync(tmpfile, options.chown.uid, options.chown.gid) - if (options.mode) fs.chmodSync(tmpfile, options.mode) - fs.renameSync(tmpfile, filename) - removeOnExitHandler() - } catch (err) { - if (fd) { - try { - fs.closeSync(fd) - } catch (ex) { - // ignore close errors at this stage, error may have closed fd already. - } - } - removeOnExitHandler() - cleanup() - throw err - } -} diff --git a/packages/list/test/fixture/node_modules/.pnpm/registry.npmjs.org/write-file-atomic/2.4.3/node_modules/write-file-atomic/package.json b/packages/list/test/fixture/node_modules/.pnpm/registry.npmjs.org/write-file-atomic/2.4.3/node_modules/write-file-atomic/package.json deleted file mode 100644 index bbb0fa2345..0000000000 --- a/packages/list/test/fixture/node_modules/.pnpm/registry.npmjs.org/write-file-atomic/2.4.3/node_modules/write-file-atomic/package.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "name": "write-file-atomic", - "version": "2.4.3", - "description": "Write files in an atomic fashion w/configurable ownership", - "main": "index.js", - "scripts": { - "test": "standard && tap --100 test/*.js", - "preversion": "npm test", - "postversion": "npm publish", - "postpublish": "git push origin --follow-tags" - }, - "repository": { - "type": "git", - "url": "git@github.com:iarna/write-file-atomic.git" - }, - "keywords": [ - "writeFile", - "atomic" - ], - "author": "Rebecca Turner (http://re-becca.org)", - "license": "ISC", - "bugs": { - "url": "https://github.com/iarna/write-file-atomic/issues" - }, - "homepage": "https://github.com/iarna/write-file-atomic", - "dependencies": { - "graceful-fs": "^4.1.11", - "imurmurhash": "^0.1.4", - "signal-exit": "^3.0.2" - }, - "devDependencies": { - "mkdirp": "^0.5.1", - "require-inject": "^1.4.0", - "rimraf": "^2.5.4", - "standard": "^12.0.1", - "tap": "^12.1.3" - }, - "files": [ - "index.js" - ] -} diff --git a/packages/list/test/fixture/node_modules/.pnpm/registry.npmjs.org/write-json-file/2.3.0/node_modules/detect-indent b/packages/list/test/fixture/node_modules/.pnpm/registry.npmjs.org/write-json-file/2.3.0/node_modules/detect-indent deleted file mode 120000 index d8e1c5611a..0000000000 --- a/packages/list/test/fixture/node_modules/.pnpm/registry.npmjs.org/write-json-file/2.3.0/node_modules/detect-indent +++ /dev/null @@ -1 +0,0 @@ -../../../../../../../../../../../../../.pnpm-store/2/registry.npmjs.org/detect-indent/5.0.0/node_modules/detect-indent \ No newline at end of file diff --git a/packages/list/test/fixture/node_modules/.pnpm/registry.npmjs.org/write-json-file/2.3.0/node_modules/graceful-fs b/packages/list/test/fixture/node_modules/.pnpm/registry.npmjs.org/write-json-file/2.3.0/node_modules/graceful-fs deleted file mode 120000 index f7e698f2d8..0000000000 --- a/packages/list/test/fixture/node_modules/.pnpm/registry.npmjs.org/write-json-file/2.3.0/node_modules/graceful-fs +++ /dev/null @@ -1 +0,0 @@ -../../../../../../../../../../../../../.pnpm-store/2/registry.npmjs.org/graceful-fs/4.2.2/node_modules/graceful-fs \ No newline at end of file diff --git a/packages/list/test/fixture/node_modules/.pnpm/registry.npmjs.org/write-json-file/2.3.0/node_modules/make-dir b/packages/list/test/fixture/node_modules/.pnpm/registry.npmjs.org/write-json-file/2.3.0/node_modules/make-dir deleted file mode 120000 index 355d12609e..0000000000 --- a/packages/list/test/fixture/node_modules/.pnpm/registry.npmjs.org/write-json-file/2.3.0/node_modules/make-dir +++ /dev/null @@ -1 +0,0 @@ -../../../make-dir/1.3.0/node_modules/make-dir \ No newline at end of file diff --git a/packages/list/test/fixture/node_modules/.pnpm/registry.npmjs.org/write-json-file/2.3.0/node_modules/pify b/packages/list/test/fixture/node_modules/.pnpm/registry.npmjs.org/write-json-file/2.3.0/node_modules/pify deleted file mode 120000 index 9efa2a6efb..0000000000 --- a/packages/list/test/fixture/node_modules/.pnpm/registry.npmjs.org/write-json-file/2.3.0/node_modules/pify +++ /dev/null @@ -1 +0,0 @@ -../../../../../../../../../../../../../.pnpm-store/2/registry.npmjs.org/pify/3.0.0/node_modules/pify \ No newline at end of file diff --git a/packages/list/test/fixture/node_modules/.pnpm/registry.npmjs.org/write-json-file/2.3.0/node_modules/sort-keys b/packages/list/test/fixture/node_modules/.pnpm/registry.npmjs.org/write-json-file/2.3.0/node_modules/sort-keys deleted file mode 120000 index 5068a4a28c..0000000000 --- a/packages/list/test/fixture/node_modules/.pnpm/registry.npmjs.org/write-json-file/2.3.0/node_modules/sort-keys +++ /dev/null @@ -1 +0,0 @@ -../../../sort-keys/2.0.0/node_modules/sort-keys \ No newline at end of file diff --git a/packages/list/test/fixture/node_modules/.pnpm/registry.npmjs.org/write-json-file/2.3.0/node_modules/write-file-atomic b/packages/list/test/fixture/node_modules/.pnpm/registry.npmjs.org/write-json-file/2.3.0/node_modules/write-file-atomic deleted file mode 120000 index d4df92b2b5..0000000000 --- a/packages/list/test/fixture/node_modules/.pnpm/registry.npmjs.org/write-json-file/2.3.0/node_modules/write-file-atomic +++ /dev/null @@ -1 +0,0 @@ -../../../write-file-atomic/2.4.3/node_modules/write-file-atomic \ No newline at end of file diff --git a/packages/list/test/fixture/node_modules/.pnpm/registry.npmjs.org/write-json-file/2.3.0/node_modules/write-json-file/index.js b/packages/list/test/fixture/node_modules/.pnpm/registry.npmjs.org/write-json-file/2.3.0/node_modules/write-json-file/index.js deleted file mode 100644 index cbd7e706a0..0000000000 --- a/packages/list/test/fixture/node_modules/.pnpm/registry.npmjs.org/write-json-file/2.3.0/node_modules/write-json-file/index.js +++ /dev/null @@ -1,73 +0,0 @@ -'use strict'; -const path = require('path'); -const fs = require('graceful-fs'); -const writeFileAtomic = require('write-file-atomic'); -const sortKeys = require('sort-keys'); -const makeDir = require('make-dir'); -const pify = require('pify'); -const detectIndent = require('detect-indent'); - -const init = (fn, fp, data, opts) => { - if (!fp) { - throw new TypeError('Expected a filepath'); - } - - if (data === undefined) { - throw new TypeError('Expected data to stringify'); - } - - opts = Object.assign({ - indent: '\t', - sortKeys: false - }, opts); - - if (opts.sortKeys) { - data = sortKeys(data, { - deep: true, - compare: typeof opts.sortKeys === 'function' && opts.sortKeys - }); - } - - return fn(fp, data, opts); -}; - -const readFile = fp => pify(fs.readFile)(fp, 'utf8').catch(() => {}); - -const main = (fp, data, opts) => { - return (opts.detectIndent ? readFile(fp) : Promise.resolve()) - .then(str => { - const indent = str ? detectIndent(str).indent : opts.indent; - const json = JSON.stringify(data, opts.replacer, indent); - - return pify(writeFileAtomic)(fp, `${json}\n`, {mode: opts.mode}); - }); -}; - -const mainSync = (fp, data, opts) => { - let indent = opts.indent; - - if (opts.detectIndent) { - try { - const file = fs.readFileSync(fp, 'utf8'); - indent = detectIndent(file).indent; - } catch (err) { - if (err.code !== 'ENOENT') { - throw err; - } - } - } - - const json = JSON.stringify(data, opts.replacer, indent); - - return writeFileAtomic.sync(fp, `${json}\n`, {mode: opts.mode}); -}; - -module.exports = (fp, data, opts) => { - return makeDir(path.dirname(fp), {fs}) - .then(() => init(main, fp, data, opts)); -}; - -module.exports.sync = (fp, data, opts) => { - makeDir.sync(path.dirname(fp), {fs}); - init(mainSync, fp, data, opts); -}; diff --git a/packages/list/test/fixture/node_modules/.pnpm/registry.npmjs.org/write-json-file/2.3.0/node_modules/write-json-file/license b/packages/list/test/fixture/node_modules/.pnpm/registry.npmjs.org/write-json-file/2.3.0/node_modules/write-json-file/license deleted file mode 100644 index e7af2f7710..0000000000 --- a/packages/list/test/fixture/node_modules/.pnpm/registry.npmjs.org/write-json-file/2.3.0/node_modules/write-json-file/license +++ /dev/null @@ -1,9 +0,0 @@ -MIT License - -Copyright (c) Sindre Sorhus (sindresorhus.com) - -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. diff --git a/packages/list/test/fixture/node_modules/.pnpm/registry.npmjs.org/write-json-file/2.3.0/node_modules/write-json-file/package.json b/packages/list/test/fixture/node_modules/.pnpm/registry.npmjs.org/write-json-file/2.3.0/node_modules/write-json-file/package.json deleted file mode 100644 index 169c7a888b..0000000000 --- a/packages/list/test/fixture/node_modules/.pnpm/registry.npmjs.org/write-json-file/2.3.0/node_modules/write-json-file/package.json +++ /dev/null @@ -1,48 +0,0 @@ -{ - "name": "write-json-file", - "version": "2.3.0", - "description": "Stringify and write JSON to a file atomically", - "license": "MIT", - "repository": "sindresorhus/write-json-file", - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" - }, - "engines": { - "node": ">=4" - }, - "scripts": { - "test": "xo && ava" - }, - "files": [ - "index.js" - ], - "keywords": [ - "write", - "json", - "stringify", - "file", - "fs", - "graceful", - "stable", - "sort", - "newline", - "indent", - "atomic", - "atomically" - ], - "dependencies": { - "detect-indent": "^5.0.0", - "graceful-fs": "^4.1.2", - "make-dir": "^1.0.0", - "pify": "^3.0.0", - "sort-keys": "^2.0.0", - "write-file-atomic": "^2.0.0" - }, - "devDependencies": { - "ava": "*", - "tempfile": "^2.0.0", - "xo": "*" - } -} diff --git a/packages/list/test/fixture/node_modules/.pnpm/registry.npmjs.org/write-json-file/2.3.0/node_modules/write-json-file/readme.md b/packages/list/test/fixture/node_modules/.pnpm/registry.npmjs.org/write-json-file/2.3.0/node_modules/write-json-file/readme.md deleted file mode 100644 index c148f05290..0000000000 --- a/packages/list/test/fixture/node_modules/.pnpm/registry.npmjs.org/write-json-file/2.3.0/node_modules/write-json-file/readme.md +++ /dev/null @@ -1,83 +0,0 @@ -# write-json-file [![Build Status](https://travis-ci.org/sindresorhus/write-json-file.svg?branch=master)](https://travis-ci.org/sindresorhus/write-json-file) - -> Stringify and write JSON to a file [atomically](https://github.com/npm/write-file-atomic) - -Creates directories for you as needed. - - -## Install - -``` -$ npm install write-json-file -``` - - -## Usage - -```js -const writeJsonFile = require('write-json-file'); - -writeJsonFile('foo.json', {foo: true}).then(() => { - console.log('done'); -}); -``` - - -## API - -### writeJsonFile(filepath, data, [options]) - -Returns a `Promise`. - -### writeJsonFile.sync(filepath, data, [options]) - -#### options - -Type: `Object` - -##### indent - -Type: `string` `number`
-Default: `'\t'` - -Indentation as a string or number of spaces.
-Pass in `null` for no formatting. - -##### detectIndent - -Type: `boolean`
-Default: `false` - -Detect indentation automatically if the file exists. - -##### sortKeys - -Type: `boolean` `function`
-Default: `false` - -Sort the keys recursively.
-Optionally pass in a [`compare`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort) function. - -##### replacer - -Type: `function` - -Passed into [`JSON.stringify`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify#The_replacer_parameter). - -##### mode - -Type: `number`
-Default: `0o666` - -[Mode](https://en.wikipedia.org/wiki/File_system_permissions#Numeric_notation) used when writing the file. - - -## Related - -- [load-json-file](https://github.com/sindresorhus/load-json-file) - Read and parse a JSON file -- [make-dir](https://github.com/sindresorhus/make-dir) - Make a directory and its parents if needed - - -## License - -MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/packages/list/test/fixture/node_modules/is-negative b/packages/list/test/fixture/node_modules/is-negative deleted file mode 120000 index eaa5d610d0..0000000000 --- a/packages/list/test/fixture/node_modules/is-negative +++ /dev/null @@ -1 +0,0 @@ -../../../../../../../../.pnpm-store/2/registry.npmjs.org/is-negative/2.1.0/node_modules/is-negative \ No newline at end of file diff --git a/packages/list/test/fixture/node_modules/is-positive b/packages/list/test/fixture/node_modules/is-positive deleted file mode 120000 index 45afa70d3b..0000000000 --- a/packages/list/test/fixture/node_modules/is-positive +++ /dev/null @@ -1 +0,0 @@ -../../../../../../../../.pnpm-store/2/registry.npmjs.org/is-positive/3.1.0/node_modules/is-positive \ No newline at end of file diff --git a/packages/list/test/fixture/node_modules/write-json-file b/packages/list/test/fixture/node_modules/write-json-file deleted file mode 120000 index 31d7377aa0..0000000000 --- a/packages/list/test/fixture/node_modules/write-json-file +++ /dev/null @@ -1 +0,0 @@ -.pnpm/registry.npmjs.org/write-json-file/2.3.0/node_modules/write-json-file \ No newline at end of file diff --git a/packages/list/test/index.ts b/packages/list/test/index.ts index 055d2744f5..2e7d866d39 100644 --- a/packages/list/test/index.ts +++ b/packages/list/test/index.ts @@ -21,12 +21,13 @@ const UNSAVED_DEPENDENCIES = chalk.cyanBright('not saved (you should add these d const highlighted = chalk.bold.inverse -const fixture = path.join(__dirname, 'fixture') -const fixtureWithNoPkgNameAndNoVersion = path.join(__dirname, 'fixture-with-no-pkg-name-and-no-version') -const fixtureWithNoPkgVersion = path.join(__dirname, 'fixture-with-no-pkg-version') -const fixtureWithExternalLockfile = path.join(__dirname, 'fixture-with-external-shrinkwrap', 'pkg') -const emptyFixture = path.join(__dirname, 'empty') -const fixtureWithAliasedDep = path.join(__dirname, 'with-aliased-dep') +const fixtures = path.join(__dirname, '../../../fixtures') +const fixture = path.join(fixtures, 'fixture') +const fixtureWithNoPkgNameAndNoVersion = path.join(fixtures, 'fixture-with-no-pkg-name-and-no-version') +const fixtureWithNoPkgVersion = path.join(fixtures, 'fixture-with-no-pkg-version') +const fixtureWithExternalLockfile = path.join(fixtures, 'fixture-with-external-shrinkwrap', 'pkg') +const emptyFixture = path.join(fixtures, 'empty') +const fixtureWithAliasedDep = path.join(fixtures, 'with-aliased-dep') test('list all deps of a package that has an external lockfile', async (t) => { t.equal(await list([fixtureWithExternalLockfile], { @@ -226,26 +227,30 @@ write-json-file ${VERSION_CLR('2.3.0')} ${DEV_DEPENDENCIES} ${DEV_DEP_ONLY_CLR('is-positive')} ${VERSION_CLR('3.1.0')} - [Could not find additional info about this dependency] + Check if something is a positive number + git+https://github.com/kevva/is-positive.git + https://github.com/kevva/is-positive#readme ${OPTIONAL_DEPENDENCIES} ${OPTIONAL_DEP_CLR('is-negative')} ${VERSION_CLR('2.1.0')} - [Could not find additional info about this dependency]`) + Check if something is a negative number + git+https://github.com/kevva/is-negative.git + https://github.com/kevva/is-negative#readme`) t.end() }) test('parseable list with depth 1', async t => { t.equal(await list([fixture], { reportAs: 'parseable', depth: 1, lockfileDir: fixture }), `${fixture} -${path.join(fixture, 'node_modules/.pnpm/registry.npmjs.org/detect-indent/5.0.0')} -${path.join(fixture, 'node_modules/.pnpm/registry.npmjs.org/graceful-fs/4.2.2')} -${path.join(fixture, 'node_modules/.pnpm/registry.npmjs.org/is-negative/2.1.0')} -${path.join(fixture, 'node_modules/.pnpm/registry.npmjs.org/is-positive/3.1.0')} -${path.join(fixture, 'node_modules/.pnpm/registry.npmjs.org/make-dir/1.3.0')} -${path.join(fixture, 'node_modules/.pnpm/registry.npmjs.org/pify/3.0.0')} -${path.join(fixture, 'node_modules/.pnpm/registry.npmjs.org/sort-keys/2.0.0')} -${path.join(fixture, 'node_modules/.pnpm/registry.npmjs.org/write-file-atomic/2.4.3')} -${path.join(fixture, 'node_modules/.pnpm/registry.npmjs.org/write-json-file/2.3.0')}`) +${path.join(fixture, 'node_modules/.pnpm/detect-indent@5.0.0')} +${path.join(fixture, 'node_modules/.pnpm/graceful-fs@4.2.2')} +${path.join(fixture, 'node_modules/.pnpm/is-negative@2.1.0')} +${path.join(fixture, 'node_modules/.pnpm/is-positive@3.1.0')} +${path.join(fixture, 'node_modules/.pnpm/make-dir@1.3.0')} +${path.join(fixture, 'node_modules/.pnpm/pify@3.0.0')} +${path.join(fixture, 'node_modules/.pnpm/sort-keys@2.0.0')} +${path.join(fixture, 'node_modules/.pnpm/write-file-atomic@2.4.3')} +${path.join(fixture, 'node_modules/.pnpm/write-json-file@2.3.0')}`) t.end() }) @@ -374,7 +379,7 @@ test('parseable list with depth 1 and dev only', async t => { reportAs: 'parseable', }), `${fixture} -${path.join(fixture, 'node_modules/.pnpm/registry.npmjs.org/is-positive/3.1.0')}` +${path.join(fixture, 'node_modules/.pnpm/is-positive@3.1.0')}` ) t.end() @@ -382,15 +387,15 @@ ${path.join(fixture, 'node_modules/.pnpm/registry.npmjs.org/is-positive/3.1.0')} test('long parseable list with depth 1', async t => { t.equal(await list([fixture], { reportAs: 'parseable', depth: 1, lockfileDir: fixture, long: true }), `${fixture}:fixture@1.0.0 -${path.join(fixture, 'node_modules/.pnpm/registry.npmjs.org/detect-indent/5.0.0')}:detect-indent@5.0.0 -${path.join(fixture, 'node_modules/.pnpm/registry.npmjs.org/graceful-fs/4.2.2')}:graceful-fs@4.2.2 -${path.join(fixture, 'node_modules/.pnpm/registry.npmjs.org/is-negative/2.1.0')}:is-negative@2.1.0 -${path.join(fixture, 'node_modules/.pnpm/registry.npmjs.org/is-positive/3.1.0')}:is-positive@3.1.0 -${path.join(fixture, 'node_modules/.pnpm/registry.npmjs.org/make-dir/1.3.0')}:make-dir@1.3.0 -${path.join(fixture, 'node_modules/.pnpm/registry.npmjs.org/pify/3.0.0')}:pify@3.0.0 -${path.join(fixture, 'node_modules/.pnpm/registry.npmjs.org/sort-keys/2.0.0')}:sort-keys@2.0.0 -${path.join(fixture, 'node_modules/.pnpm/registry.npmjs.org/write-file-atomic/2.4.3')}:write-file-atomic@2.4.3 -${path.join(fixture, 'node_modules/.pnpm/registry.npmjs.org/write-json-file/2.3.0')}:write-json-file@2.3.0`) +${path.join(fixture, 'node_modules/.pnpm/detect-indent@5.0.0')}:detect-indent@5.0.0 +${path.join(fixture, 'node_modules/.pnpm/graceful-fs@4.2.2')}:graceful-fs@4.2.2 +${path.join(fixture, 'node_modules/.pnpm/is-negative@2.1.0')}:is-negative@2.1.0 +${path.join(fixture, 'node_modules/.pnpm/is-positive@3.1.0')}:is-positive@3.1.0 +${path.join(fixture, 'node_modules/.pnpm/make-dir@1.3.0')}:make-dir@1.3.0 +${path.join(fixture, 'node_modules/.pnpm/pify@3.0.0')}:pify@3.0.0 +${path.join(fixture, 'node_modules/.pnpm/sort-keys@2.0.0')}:sort-keys@2.0.0 +${path.join(fixture, 'node_modules/.pnpm/write-file-atomic@2.4.3')}:write-file-atomic@2.4.3 +${path.join(fixture, 'node_modules/.pnpm/write-json-file@2.3.0')}:write-json-file@2.3.0`) t.end() }) @@ -398,15 +403,15 @@ ${path.join(fixture, 'node_modules/.pnpm/registry.npmjs.org/write-json-file/2.3. test('long parseable list with depth 1 when package has no version', async t => { t.equal(await list([fixtureWithNoPkgVersion], { reportAs: 'parseable', depth: 1, lockfileDir: fixtureWithNoPkgVersion, long: true }), `\ ${fixtureWithNoPkgVersion}:fixture -${path.join(fixtureWithNoPkgVersion, 'node_modules/.pnpm/registry.npmjs.org/detect-indent/5.0.0')}:detect-indent@5.0.0 -${path.join(fixtureWithNoPkgVersion, 'node_modules/.pnpm/registry.npmjs.org/graceful-fs/4.2.2')}:graceful-fs@4.2.2 -${path.join(fixtureWithNoPkgVersion, 'node_modules/.pnpm/registry.npmjs.org/is-negative/2.1.0')}:is-negative@2.1.0 -${path.join(fixtureWithNoPkgVersion, 'node_modules/.pnpm/registry.npmjs.org/is-positive/3.1.0')}:is-positive@3.1.0 -${path.join(fixtureWithNoPkgVersion, 'node_modules/.pnpm/registry.npmjs.org/make-dir/1.3.0')}:make-dir@1.3.0 -${path.join(fixtureWithNoPkgVersion, 'node_modules/.pnpm/registry.npmjs.org/pify/3.0.0')}:pify@3.0.0 -${path.join(fixtureWithNoPkgVersion, 'node_modules/.pnpm/registry.npmjs.org/sort-keys/2.0.0')}:sort-keys@2.0.0 -${path.join(fixtureWithNoPkgVersion, 'node_modules/.pnpm/registry.npmjs.org/write-file-atomic/2.4.3')}:write-file-atomic@2.4.3 -${path.join(fixtureWithNoPkgVersion, 'node_modules/.pnpm/registry.npmjs.org/write-json-file/2.3.0')}:write-json-file@2.3.0`) +${path.join(fixtureWithNoPkgVersion, 'node_modules/.pnpm/detect-indent@5.0.0')}:detect-indent@5.0.0 +${path.join(fixtureWithNoPkgVersion, 'node_modules/.pnpm/graceful-fs@4.2.2')}:graceful-fs@4.2.2 +${path.join(fixtureWithNoPkgVersion, 'node_modules/.pnpm/is-negative@2.1.0')}:is-negative@2.1.0 +${path.join(fixtureWithNoPkgVersion, 'node_modules/.pnpm/is-positive@3.1.0')}:is-positive@3.1.0 +${path.join(fixtureWithNoPkgVersion, 'node_modules/.pnpm/make-dir@1.3.0')}:make-dir@1.3.0 +${path.join(fixtureWithNoPkgVersion, 'node_modules/.pnpm/pify@3.0.0')}:pify@3.0.0 +${path.join(fixtureWithNoPkgVersion, 'node_modules/.pnpm/sort-keys@2.0.0')}:sort-keys@2.0.0 +${path.join(fixtureWithNoPkgVersion, 'node_modules/.pnpm/write-file-atomic@2.4.3')}:write-file-atomic@2.4.3 +${path.join(fixtureWithNoPkgVersion, 'node_modules/.pnpm/write-json-file@2.3.0')}:write-json-file@2.3.0`) t.end() }) @@ -418,15 +423,15 @@ test('long parseable list with depth 1 when package has no name and no version', { reportAs: 'parseable', depth: 1, lockfileDir: fixtureWithNoPkgNameAndNoVersion, long: true } ), `${fixtureWithNoPkgNameAndNoVersion} -${path.join(fixtureWithNoPkgNameAndNoVersion, 'node_modules/.pnpm/registry.npmjs.org/detect-indent/5.0.0')}:detect-indent@5.0.0 -${path.join(fixtureWithNoPkgNameAndNoVersion, 'node_modules/.pnpm/registry.npmjs.org/graceful-fs/4.2.2')}:graceful-fs@4.2.2 -${path.join(fixtureWithNoPkgNameAndNoVersion, 'node_modules/.pnpm/registry.npmjs.org/is-negative/2.1.0')}:is-negative@2.1.0 -${path.join(fixtureWithNoPkgNameAndNoVersion, 'node_modules/.pnpm/registry.npmjs.org/is-positive/3.1.0')}:is-positive@3.1.0 -${path.join(fixtureWithNoPkgNameAndNoVersion, 'node_modules/.pnpm/registry.npmjs.org/make-dir/1.3.0')}:make-dir@1.3.0 -${path.join(fixtureWithNoPkgNameAndNoVersion, 'node_modules/.pnpm/registry.npmjs.org/pify/3.0.0')}:pify@3.0.0 -${path.join(fixtureWithNoPkgNameAndNoVersion, 'node_modules/.pnpm/registry.npmjs.org/sort-keys/2.0.0')}:sort-keys@2.0.0 -${path.join(fixtureWithNoPkgNameAndNoVersion, 'node_modules/.pnpm/registry.npmjs.org/write-file-atomic/2.4.3')}:write-file-atomic@2.4.3 -${path.join(fixtureWithNoPkgNameAndNoVersion, 'node_modules/.pnpm/registry.npmjs.org/write-json-file/2.3.0')}:write-json-file@2.3.0` +${path.join(fixtureWithNoPkgNameAndNoVersion, 'node_modules/.pnpm/detect-indent@5.0.0')}:detect-indent@5.0.0 +${path.join(fixtureWithNoPkgNameAndNoVersion, 'node_modules/.pnpm/graceful-fs@4.2.2')}:graceful-fs@4.2.2 +${path.join(fixtureWithNoPkgNameAndNoVersion, 'node_modules/.pnpm/is-negative@2.1.0')}:is-negative@2.1.0 +${path.join(fixtureWithNoPkgNameAndNoVersion, 'node_modules/.pnpm/is-positive@3.1.0')}:is-positive@3.1.0 +${path.join(fixtureWithNoPkgNameAndNoVersion, 'node_modules/.pnpm/make-dir@1.3.0')}:make-dir@1.3.0 +${path.join(fixtureWithNoPkgNameAndNoVersion, 'node_modules/.pnpm/pify@3.0.0')}:pify@3.0.0 +${path.join(fixtureWithNoPkgNameAndNoVersion, 'node_modules/.pnpm/sort-keys@2.0.0')}:sort-keys@2.0.0 +${path.join(fixtureWithNoPkgNameAndNoVersion, 'node_modules/.pnpm/write-file-atomic@2.4.3')}:write-file-atomic@2.4.3 +${path.join(fixtureWithNoPkgNameAndNoVersion, 'node_modules/.pnpm/write-json-file@2.3.0')}:write-json-file@2.3.0` ) t.end() @@ -676,7 +681,7 @@ foo ${VERSION_CLR('1.0.0')} }) test('peer dependencies are marked', async (t) => { - const fixture = path.join(__dirname, '../../dependencies-hierarchy/fixtures/with-peer') + const fixture = path.join(fixtures, 'with-peer') const output = await list([fixture], { depth: 1, lockfileDir: fixture }) compareOutputs(t, output, `${LEGEND} @@ -694,7 +699,7 @@ ajv-keywords ${VERSION_CLR('3.4.1')} }) test('peer dependencies are marked when searching', async (t) => { - const fixture = path.join(__dirname, '../../dependencies-hierarchy/fixtures/with-peer') + const fixture = path.join(fixtures, 'with-peer') const output = await listForPackages(['ajv'], [fixture], { depth: 1, lockfileDir: fixture }) compareOutputs(t, output, `${LEGEND} diff --git a/packages/list/test/with-aliased-dep/.gitignore b/packages/list/test/with-aliased-dep/.gitignore deleted file mode 100644 index cf4bab9ddd..0000000000 --- a/packages/list/test/with-aliased-dep/.gitignore +++ /dev/null @@ -1 +0,0 @@ -!node_modules diff --git a/packages/list/test/with-aliased-dep/node_modules/.ignored_positive/package.json b/packages/list/test/with-aliased-dep/node_modules/.ignored_positive/package.json deleted file mode 100644 index 5c708cef76..0000000000 --- a/packages/list/test/with-aliased-dep/node_modules/.ignored_positive/package.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "name": "is-positive", - "version": "1.0.0", - "description": "Test if a number is positive", - "license": "MIT", - "repository": "kevva/is-positive", - "author": { - "name": "Kevin Martensson", - "email": "kevinmartensson@gmail.com", - "url": "github.com/kevva" - }, - "engines": { - "node": ">=0.10.0" - }, - "scripts": { - "test": "node test.js" - }, - "files": [ - "index.js" - ], - "keywords": [ - "number", - "positive", - "test" - ], - "devDependencies": { - "ava": "^0.0.4" - } -} diff --git a/packages/list/test/with-aliased-dep/node_modules/.modules.yaml b/packages/list/test/with-aliased-dep/node_modules/.modules.yaml deleted file mode 100644 index 2f7cf36f68..0000000000 --- a/packages/list/test/with-aliased-dep/node_modules/.modules.yaml +++ /dev/null @@ -1,11 +0,0 @@ -included: - dependencies: true - devDependencies: true - optionalDependencies: true -layoutVersion: 3 -packageManager: pnpm@3.8.1 -pendingBuilds: [] -registries: - default: 'https://registry.npmjs.org/' -skipped: [] -store: /home/zoltan/.pnpm-store/2 diff --git a/packages/list/test/with-aliased-dep/node_modules/.pnpm/lock.yaml b/packages/list/test/with-aliased-dep/node_modules/.pnpm/lock.yaml deleted file mode 100644 index 549479293f..0000000000 --- a/packages/list/test/with-aliased-dep/node_modules/.pnpm/lock.yaml +++ /dev/null @@ -1,12 +0,0 @@ -dependencies: - positive: /is-positive/1.0.0 -lockfileVersion: 5.1 -packages: - /is-positive/1.0.0: - dev: false - engines: - node: '>=0.10.0' - resolution: - integrity: sha1-iACYVrZKLx632LsBeUGEJK4EUss= -specifiers: - positive: 'npm:is-positive@1.0.0' diff --git a/packages/list/test/with-aliased-dep/node_modules/.pnpm/registry.npmjs.org/is-positive/1.0.0/node_modules/is-positive/package.json b/packages/list/test/with-aliased-dep/node_modules/.pnpm/registry.npmjs.org/is-positive/1.0.0/node_modules/is-positive/package.json deleted file mode 100644 index 5c708cef76..0000000000 --- a/packages/list/test/with-aliased-dep/node_modules/.pnpm/registry.npmjs.org/is-positive/1.0.0/node_modules/is-positive/package.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "name": "is-positive", - "version": "1.0.0", - "description": "Test if a number is positive", - "license": "MIT", - "repository": "kevva/is-positive", - "author": { - "name": "Kevin Martensson", - "email": "kevinmartensson@gmail.com", - "url": "github.com/kevva" - }, - "engines": { - "node": ">=0.10.0" - }, - "scripts": { - "test": "node test.js" - }, - "files": [ - "index.js" - ], - "keywords": [ - "number", - "positive", - "test" - ], - "devDependencies": { - "ava": "^0.0.4" - } -} diff --git a/packages/list/test/with-aliased-dep/node_modules/positive b/packages/list/test/with-aliased-dep/node_modules/positive deleted file mode 120000 index 23de69064e..0000000000 --- a/packages/list/test/with-aliased-dep/node_modules/positive +++ /dev/null @@ -1 +0,0 @@ -../../../../../../../../.pnpm-store/2/registry.npmjs.org/is-positive/1.0.0/node_modules/is-positive \ No newline at end of file diff --git a/packages/list/test/with-aliased-dep/package.json b/packages/list/test/with-aliased-dep/package.json deleted file mode 100644 index 7c252ae6e9..0000000000 --- a/packages/list/test/with-aliased-dep/package.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "name": "with-aliased-dep", - "version": "1.0.0", - "dependencies": { - "positive": "npm:is-positive@1.0.0" - } -} diff --git a/packages/list/test/with-aliased-dep/pnpm-lock.yaml b/packages/list/test/with-aliased-dep/pnpm-lock.yaml deleted file mode 100644 index 549479293f..0000000000 --- a/packages/list/test/with-aliased-dep/pnpm-lock.yaml +++ /dev/null @@ -1,12 +0,0 @@ -dependencies: - positive: /is-positive/1.0.0 -lockfileVersion: 5.1 -packages: - /is-positive/1.0.0: - dev: false - engines: - node: '>=0.10.0' - resolution: - integrity: sha1-iACYVrZKLx632LsBeUGEJK4EUss= -specifiers: - positive: 'npm:is-positive@1.0.0' diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index d98d01423d..9512560b03 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -322,6 +322,7 @@ importers: '@pnpm/lockfile-utils': 'link:../lockfile-utils' '@pnpm/modules-yaml': 'link:../modules-yaml' '@pnpm/normalize-registries': 'link:../normalize-registries' + '@pnpm/pkgid-to-filename': 3.0.0 '@pnpm/read-modules-dir': 'link:../read-modules-dir' '@pnpm/read-package-json': 'link:../read-package-json' '@pnpm/types': 'link:../types' @@ -341,6 +342,7 @@ importers: '@pnpm/logger': 3.2.2 '@pnpm/modules-yaml': 'workspace:8.0.0' '@pnpm/normalize-registries': 'workspace:1.0.2' + '@pnpm/pkgid-to-filename': ^3.0.0 '@pnpm/read-modules-dir': 'workspace:2.0.1' '@pnpm/read-package-json': 'workspace:3.1.2' '@pnpm/types': 'workspace:6.1.0'