fixturify-project
Advanced tools
Comparing version 7.1.0-alpha.0 to 7.1.0
@@ -158,2 +158,4 @@ import fixturify from 'fixturify'; | ||
private writeLinkedPackage; | ||
private knownWorkspaces; | ||
private discoverWorkspaces; | ||
private publishedPackageContents; | ||
@@ -160,0 +162,0 @@ private hardLinkContents; |
@@ -9,5 +9,7 @@ // src/index.ts | ||
import binLinks from "bin-links"; | ||
import walkSync from "walk-sync"; | ||
import deepmerge from "deepmerge"; | ||
import Arborist from "@npmcli/arborist"; | ||
import packList from "npm-packlist"; | ||
import { findWorkspaceDir } from "@pnpm/find-workspace-dir"; | ||
import { findWorkspacePackages } from "@pnpm/workspace.find-packages"; | ||
import { packlist } from "@pnpm/fs.packlist"; | ||
tmp.setGracefulCleanup(); | ||
@@ -28,2 +30,3 @@ var defaultFiles = { | ||
this.resolutionCache = new CacheGroup(); | ||
this.knownWorkspaces = /* @__PURE__ */ new Map(); | ||
let name; | ||
@@ -203,2 +206,3 @@ let version; | ||
let resolvedLinksMap = /* @__PURE__ */ new Map(); | ||
await this.discoverWorkspaces(); | ||
this.writeFiles(resolvedLinksMap); | ||
@@ -233,3 +237,3 @@ await this.finalizeWrite(resolvedLinksMap); | ||
for (let dep of depList) { | ||
dep.finalizeWrite(resolvedLinksMap); | ||
await dep.finalizeWrite(resolvedLinksMap); | ||
} | ||
@@ -279,3 +283,3 @@ } | ||
} | ||
await this.hardLinkContents(target, destination); | ||
await this.hardLinkContents(target, targetPkg, destination); | ||
for (let section of ["dependencies", "peerDependencies"]) { | ||
@@ -298,11 +302,36 @@ if (targetPkg[section]) { | ||
} | ||
async publishedPackageContents(targetDir) { | ||
let tree = await new Arborist({ path: targetDir }).loadActual(); | ||
return await packList(tree); | ||
async discoverWorkspaces() { | ||
for (let opts of this.dependencyLinks.values()) { | ||
if (!("baseDir" in opts)) { | ||
continue; | ||
} | ||
let dir = opts.baseDir; | ||
if (this.knownWorkspaces.has(dir)) { | ||
continue; | ||
} | ||
let top = await findWorkspaceDir(dir); | ||
if (top) { | ||
let packages = await findWorkspacePackages(top); | ||
for (let { dir: dir2 } of packages) { | ||
this.knownWorkspaces.set(dir2, true); | ||
} | ||
if (!this.knownWorkspaces.has(dir)) { | ||
this.knownWorkspaces.set(dir, false); | ||
} | ||
} else { | ||
this.knownWorkspaces.set(dir, false); | ||
} | ||
} | ||
} | ||
async hardLinkContents(target, destination) { | ||
async publishedPackageContents(packageDir, pkgJSON) { | ||
if (this.knownWorkspaces.get(packageDir)) { | ||
return await packlist(packageDir, { packageJsonCache: { packageDir: pkgJSON } }); | ||
} | ||
return walkSync(packageDir, { directories: false, ignore: ["node_modules"] }); | ||
} | ||
async hardLinkContents(source, pkgJSON, destination) { | ||
fs.ensureDirSync(destination); | ||
for (let relativePath of await this.publishedPackageContents(target)) { | ||
for (let relativePath of await this.publishedPackageContents(source, pkgJSON)) { | ||
fs.ensureDirSync(path.dirname(path.join(destination, relativePath))); | ||
this.hardLinkFile(path.join(target, relativePath), path.join(destination, relativePath)); | ||
this.hardLinkFile(path.join(source, relativePath), path.join(destination, relativePath)); | ||
} | ||
@@ -309,0 +338,0 @@ } |
{ | ||
"name": "fixturify-project", | ||
"version": "7.1.0-alpha.0", | ||
"version": "7.1.0", | ||
"repository": "git@github.com:stefanpenner/node-fixturify-project", | ||
@@ -30,11 +30,14 @@ "license": "MIT", | ||
"dependencies": { | ||
"@npmcli/arborist": "^7.5.0", | ||
"@pnpm/find-workspace-dir": "^7.0.0", | ||
"@pnpm/fs.packlist": "^2.0.0", | ||
"@pnpm/logger": "^5.0.0", | ||
"@pnpm/workspace.find-packages": "^2.0.3", | ||
"bin-links": "^3.0.0", | ||
"deepmerge": "^4.2.2", | ||
"fixturify": "^3.0.0", | ||
"fs-extra": "^10.0.0", | ||
"fixturify": "^3.0.0", | ||
"npm-packlist": "^8.0.2", | ||
"resolve-package-path": "^4.0.3", | ||
"tmp": "^0.0.33", | ||
"type-fest": "^4.1.0" | ||
"type-fest": "^4.1.0", | ||
"walk-sync": "^3.0.0" | ||
}, | ||
@@ -46,4 +49,2 @@ "devDependencies": { | ||
"@types/node": "^16.9.1", | ||
"@types/npm-packlist": "^7.0.3", | ||
"@types/npmcli__arborist": "^5.6.6", | ||
"@types/tmp": "^0.0.33", | ||
@@ -57,4 +58,3 @@ "chai": "^4.3.4", | ||
"vite": "^5.2.7", | ||
"vitest": "^0.9.3", | ||
"walk-sync": "^3.0.0" | ||
"vitest": "^0.9.3" | ||
}, | ||
@@ -61,0 +61,0 @@ "engines": { |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
55847
13
1326
1
12
+ Added@pnpm/fs.packlist@^2.0.0
+ Added@pnpm/logger@^5.0.0
+ Addedwalk-sync@^3.0.0
+ Added@babel/code-frame@7.26.2(transitive)
+ Added@babel/helper-validator-identifier@7.25.9(transitive)
+ Added@gwhitney/detect-indent@7.0.1(transitive)
+ Added@nodelib/fs.scandir@2.1.5(transitive)
+ Added@nodelib/fs.stat@2.0.5(transitive)
+ Added@nodelib/fs.walk@1.2.8(transitive)
+ Added@pnpm/cli-meta@6.0.1(transitive)
+ Added@pnpm/cli-utils@3.1.1(transitive)
+ Added@pnpm/config@21.4.0(transitive)
+ Added@pnpm/config.env-replace@1.1.03.0.0(transitive)
+ Added@pnpm/constants@10.0.08.0.0(transitive)
+ Added@pnpm/core-loggers@10.0.1(transitive)
+ Added@pnpm/crypto.base32-hash@3.0.0(transitive)
+ Added@pnpm/dedupe.issues-renderer@2.0.0(transitive)
+ Added@pnpm/dedupe.types@2.0.0(transitive)
+ Added@pnpm/default-reporter@13.1.4(transitive)
+ Added@pnpm/error@6.0.16.0.3(transitive)
+ Added@pnpm/fetcher-base@16.0.1(transitive)
+ Added@pnpm/find-workspace-dir@7.0.3(transitive)
+ Added@pnpm/fs.find-packages@3.0.2(transitive)
+ Added@pnpm/fs.packlist@2.0.0(transitive)
+ Added@pnpm/git-utils@2.0.0(transitive)
+ Added@pnpm/graceful-fs@4.0.0(transitive)
+ Added@pnpm/hooks.types@2.0.2(transitive)
+ Added@pnpm/lockfile-types@7.1.0(transitive)
+ Added@pnpm/logger@5.2.0(transitive)
+ Added@pnpm/manifest-utils@6.0.2(transitive)
+ Added@pnpm/matcher@6.0.0(transitive)
+ Added@pnpm/network.ca-file@1.0.2(transitive)
+ Added@pnpm/npm-conf@2.2.2(transitive)
+ Added@pnpm/package-is-installable@9.0.2(transitive)
+ Added@pnpm/parse-overrides@5.0.1(transitive)
+ Added@pnpm/parse-wanted-dependency@6.0.0(transitive)
+ Added@pnpm/pnpmfile@6.0.4(transitive)
+ Added@pnpm/ramda@0.28.1(transitive)
+ Added@pnpm/read-project-manifest@6.0.2(transitive)
+ Added@pnpm/render-peer-issues@5.0.2(transitive)
+ Added@pnpm/resolver-base@12.0.1(transitive)
+ Added@pnpm/store-controller-types@18.1.0(transitive)
+ Added@pnpm/text.comments-parser@3.0.0(transitive)
+ Added@pnpm/types@10.1.0(transitive)
+ Added@pnpm/util.lex-comparator@3.0.0(transitive)
+ Added@pnpm/workspace.find-packages@2.1.1(transitive)
+ Added@pnpm/workspace.read-manifest@2.0.1(transitive)
+ Added@pnpm/write-project-manifest@6.0.1(transitive)
+ Added@types/ssri@7.1.5(transitive)
+ Added@zkochan/which@2.0.3(transitive)
+ Addedansi-align@3.0.1(transitive)
+ Addedansi-diff@1.2.0(transitive)
+ Addedansi-regex@3.0.1(transitive)
+ Addedansi-split@1.0.1(transitive)
+ Addedarchy@1.0.0(transitive)
+ Addedargparse@2.0.1(transitive)
+ Addedas-table@1.0.55(transitive)
+ Addedastral-regex@2.0.0(transitive)
+ Addedbetter-path-resolve@1.0.0(transitive)
+ Addedbole@5.0.17(transitive)
+ Addedboxen@5.1.2(transitive)
+ Addedbraces@3.0.3(transitive)
+ Addedbuiltins@5.1.0(transitive)
+ Addedcamelcase@5.3.16.3.0(transitive)
+ Addedcamelcase-keys@6.2.2(transitive)
+ Addedcan-write-to-dir@1.1.1(transitive)
+ Addedchalk@4.1.2(transitive)
+ Addedchar-regex@1.0.2(transitive)
+ Addedcli-boxes@2.2.1(transitive)
+ Addedcli-columns@4.0.0(transitive)
+ Addedcli-truncate@2.1.0(transitive)
+ Addedclone@1.0.4(transitive)
+ Addedconfig-chain@1.1.13(transitive)
+ Addedcrypto-random-string@2.0.0(transitive)
+ Addeddata-uri-to-buffer@2.0.2(transitive)
+ Addeddefaults@1.0.4(transitive)
+ Addeddetect-libc@2.0.3(transitive)
+ Addederror-ex@1.3.2(transitive)
+ Addedescape-string-regexp@4.0.0(transitive)
+ Addedexeca@5.1.1(transitive)
+ Addedfast-deep-equal@3.1.3(transitive)
+ Addedfast-glob@3.3.2(transitive)
+ Addedfast-safe-stringify@2.1.1(transitive)
+ Addedfastq@1.17.1(transitive)
+ Addedfill-range@7.1.1(transitive)
+ Addedfind-up@5.0.0(transitive)
+ Addedget-source@2.0.12(transitive)
+ Addedget-stream@6.0.1(transitive)
+ Addedglob@8.1.0(transitive)
+ Addedglob-parent@5.1.2(transitive)
+ Addedgraceful-fs@4.2.10(transitive)
+ Addedhas-flag@4.0.0(transitive)
+ Addedhuman-signals@2.1.0(transitive)
+ Addedignore-walk@5.0.1(transitive)
+ Addedindividual@3.0.0(transitive)
+ Addedini@1.3.83.0.1(transitive)
+ Addedis-arrayish@0.2.1(transitive)
+ Addedis-extglob@2.1.1(transitive)
+ Addedis-glob@4.0.3(transitive)
+ Addedis-number@7.0.0(transitive)
+ Addedis-plain-obj@2.1.0(transitive)
+ Addedis-stream@2.0.1(transitive)
+ Addedis-subdir@1.2.0(transitive)
+ Addedis-windows@1.0.2(transitive)
+ Addedjs-tokens@4.0.0(transitive)
+ Addedjs-yaml@4.1.0(transitive)
+ Addedjson-parse-even-better-errors@2.3.1(transitive)
+ Addedjson-stringify-safe@5.0.1(transitive)
+ Addedjson5@2.2.3(transitive)
+ Addedlines-and-columns@1.2.4(transitive)
+ Addedload-json-file@6.2.0(transitive)
+ Addedlocate-path@6.0.0(transitive)
+ Addedlodash.clonedeep@4.5.0(transitive)
+ Addedmap-age-cleaner@0.1.3(transitive)
+ Addedmap-obj@4.3.0(transitive)
+ Addedmem@8.1.1(transitive)
+ Addedmerge-stream@2.0.0(transitive)
+ Addedmerge2@1.4.1(transitive)
+ Addedmicromatch@4.0.8(transitive)
+ Addedmimic-fn@2.1.03.1.0(transitive)
+ Addedminimatch@5.1.6(transitive)
+ Addedminimist@1.2.8(transitive)
+ Addedndjson@2.0.0(transitive)
+ Addednormalize-path@3.0.0(transitive)
+ Addednormalize-registry-url@2.0.0(transitive)
+ Addednpm-bundled@2.0.1(transitive)
+ Addednpm-packlist@5.1.3(transitive)
+ Addednpm-run-path@4.0.1(transitive)
+ Addedonetime@5.1.2(transitive)
+ Addedp-defer@1.0.0(transitive)
+ Addedp-filter@2.1.0(transitive)
+ Addedp-limit@3.1.0(transitive)
+ Addedp-locate@5.0.0(transitive)
+ Addedp-map@2.1.0(transitive)
+ Addedparse-json@5.2.0(transitive)
+ Addedparse-ms@2.1.0(transitive)
+ Addedpath-absolute@1.0.1(transitive)
+ Addedpath-exists@4.0.0(transitive)
+ Addedpath-name@1.0.0(transitive)
+ Addedpath-temp@2.1.0(transitive)
+ Addedpicocolors@1.1.1(transitive)
+ Addedpicomatch@2.3.1(transitive)
+ Addedpretty-bytes@5.6.0(transitive)
+ Addedpretty-ms@7.0.1(transitive)
+ Addedprintable-characters@1.0.42(transitive)
+ Addedproto-list@1.2.4(transitive)
+ Addedqueue-microtask@1.2.3(transitive)
+ Addedquick-lru@4.0.1(transitive)
+ Addedread-ini-file@4.0.0(transitive)
+ Addedread-yaml-file@2.1.0(transitive)
+ Addedreadable-stream@3.6.2(transitive)
+ Addedrealpath-missing@1.1.0(transitive)
+ Addedreusify@1.0.4(transitive)
+ Addedrfc4648@1.5.4(transitive)
+ Addedrun-parallel@1.2.0(transitive)
+ Addedrxjs@7.8.1(transitive)
+ Addedsafe-buffer@5.2.1(transitive)
+ Addedsafe-execa@0.1.2(transitive)
+ Addedslice-ansi@3.0.0(transitive)
+ Addedsort-keys@4.2.0(transitive)
+ Addedsource-map@0.6.1(transitive)
+ Addedsplit2@3.2.2(transitive)
+ Addedstacktracey@2.1.8(transitive)
+ Addedstring-length@4.0.2(transitive)
+ Addedstring_decoder@1.3.0(transitive)
+ Addedstrip-bom@4.0.0(transitive)
+ Addedstrip-comments-strings@1.2.0(transitive)
+ Addedstrip-final-newline@2.0.0(transitive)
+ Addedsupports-color@7.2.0(transitive)
+ Addedthrough2@4.0.2(transitive)
+ Addedto-regex-range@5.0.1(transitive)
+ Addedtslib@2.8.1(transitive)
+ Addedtype-fest@0.20.20.6.0(transitive)
+ Addedunique-string@2.0.0(transitive)
+ Addedvalidate-npm-package-name@5.0.0(transitive)
+ Addedwcwidth@1.0.1(transitive)
+ Addedwidest-line@3.1.0(transitive)
+ Addedwrite-yaml-file@5.0.0(transitive)
+ Addedyocto-queue@0.1.0(transitive)
- Removed@npmcli/arborist@^7.5.0
- Removednpm-packlist@^8.0.2
- Removed@isaacs/cliui@8.0.2(transitive)
- Removed@isaacs/string-locale-compare@1.1.0(transitive)
- Removed@npmcli/agent@2.2.2(transitive)
- Removed@npmcli/arborist@7.5.4(transitive)
- Removed@npmcli/fs@3.1.1(transitive)
- Removed@npmcli/git@5.0.8(transitive)
- Removed@npmcli/installed-package-contents@2.1.0(transitive)
- Removed@npmcli/map-workspaces@3.0.6(transitive)
- Removed@npmcli/metavuln-calculator@7.1.1(transitive)
- Removed@npmcli/name-from-folder@2.0.0(transitive)
- Removed@npmcli/node-gyp@3.0.0(transitive)
- Removed@npmcli/package-json@5.2.1(transitive)
- Removed@npmcli/promise-spawn@7.0.2(transitive)
- Removed@npmcli/query@3.1.0(transitive)
- Removed@npmcli/redact@2.0.1(transitive)
- Removed@npmcli/run-script@8.1.0(transitive)
- Removed@pkgjs/parseargs@0.11.0(transitive)
- Removed@sigstore/bundle@2.3.2(transitive)
- Removed@sigstore/core@1.1.0(transitive)
- Removed@sigstore/protobuf-specs@0.3.2(transitive)
- Removed@sigstore/sign@2.3.2(transitive)
- Removed@sigstore/tuf@2.3.4(transitive)
- Removed@sigstore/verify@1.2.1(transitive)
- Removed@tufjs/canonical-json@2.0.0(transitive)
- Removed@tufjs/models@2.0.1(transitive)
- Removedabbrev@2.0.0(transitive)
- Removedagent-base@7.1.3(transitive)
- Removedaggregate-error@3.1.0(transitive)
- Removedansi-regex@6.1.0(transitive)
- Removedansi-styles@6.2.1(transitive)
- Removedbin-links@4.0.4(transitive)
- Removedcacache@18.0.4(transitive)
- Removedclean-stack@2.2.0(transitive)
- Removedcmd-shim@6.0.3(transitive)
- Removedcommon-ancestor-path@1.0.1(transitive)
- Removedcssesc@3.0.0(transitive)
- Removeddebug@4.4.0(transitive)
- Removedeastasianwidth@0.2.0(transitive)
- Removedemoji-regex@9.2.2(transitive)
- Removedencoding@0.1.13(transitive)
- Removedenv-paths@2.2.1(transitive)
- Removederr-code@2.0.3(transitive)
- Removedexponential-backoff@3.1.1(transitive)
- Removedforeground-child@3.3.0(transitive)
- Removedfs-minipass@2.1.03.0.3(transitive)
- Removedglob@10.4.5(transitive)
- Removedhosted-git-info@7.0.2(transitive)
- Removedhttp-cache-semantics@4.1.1(transitive)
- Removedhttp-proxy-agent@7.0.2(transitive)
- Removedhttps-proxy-agent@7.0.6(transitive)
- Removediconv-lite@0.6.3(transitive)
- Removedignore-walk@6.0.5(transitive)
- Removedindent-string@4.0.0(transitive)
- Removedini@4.1.3(transitive)
- Removedip-address@9.0.5(transitive)
- Removedis-lambda@1.0.1(transitive)
- Removedjackspeak@3.4.3(transitive)
- Removedjsbn@1.1.0(transitive)
- Removedjson-parse-even-better-errors@3.0.2(transitive)
- Removedjson-stringify-nice@1.1.4(transitive)
- Removedjsonparse@1.3.1(transitive)
- Removedjust-diff@6.0.2(transitive)
- Removedjust-diff-apply@5.5.0(transitive)
- Removedlru-cache@10.4.3(transitive)
- Removedmake-fetch-happen@13.0.1(transitive)
- Removedminimatch@9.0.5(transitive)
- Removedminipass@3.3.65.0.07.1.2(transitive)
- Removedminipass-collect@2.0.1(transitive)
- Removedminipass-fetch@3.0.5(transitive)
- Removedminipass-flush@1.0.5(transitive)
- Removedminipass-pipeline@1.2.4(transitive)
- Removedminipass-sized@1.0.3(transitive)
- Removedminizlib@2.1.2(transitive)
- Removedms@2.1.3(transitive)
- Removednegotiator@0.6.4(transitive)
- Removednode-gyp@10.3.1(transitive)
- Removednopt@7.2.1(transitive)
- Removednormalize-package-data@6.0.2(transitive)
- Removednpm-bundled@3.0.1(transitive)
- Removednpm-install-checks@6.3.0(transitive)
- Removednpm-normalize-package-bin@3.0.1(transitive)
- Removednpm-package-arg@11.0.3(transitive)
- Removednpm-packlist@8.0.2(transitive)
- Removednpm-pick-manifest@9.1.0(transitive)
- Removednpm-registry-fetch@17.1.0(transitive)
- Removedp-map@4.0.0(transitive)
- Removedpackage-json-from-dist@1.0.1(transitive)
- Removedpacote@18.0.6(transitive)
- Removedparse-conflict-json@3.0.1(transitive)
- Removedpath-scurry@1.11.1(transitive)
- Removedpostcss-selector-parser@6.1.2(transitive)
- Removedproc-log@4.2.0(transitive)
- Removedproggy@2.0.0(transitive)
- Removedpromise-all-reject-late@1.0.1(transitive)
- Removedpromise-call-limit@3.0.2(transitive)
- Removedpromise-inflight@1.0.1(transitive)
- Removedpromise-retry@2.0.1(transitive)
- Removedread-cmd-shim@4.0.0(transitive)
- Removedread-package-json-fast@3.0.2(transitive)
- Removedretry@0.12.0(transitive)
- Removedsafer-buffer@2.1.2(transitive)
- Removedsigstore@2.3.1(transitive)
- Removedsmart-buffer@4.2.0(transitive)
- Removedsocks@2.8.3(transitive)
- Removedsocks-proxy-agent@8.0.5(transitive)
- Removedspdx-correct@3.2.0(transitive)
- Removedspdx-exceptions@2.5.0(transitive)
- Removedspdx-expression-parse@3.0.1(transitive)
- Removedspdx-license-ids@3.0.20(transitive)
- Removedsprintf-js@1.1.3(transitive)
- Removedssri@10.0.6(transitive)
- Removedstring-width@5.1.2(transitive)
- Removedstrip-ansi@7.1.0(transitive)
- Removedtar@6.2.1(transitive)
- Removedtreeverse@3.0.0(transitive)
- Removedtuf-js@2.2.1(transitive)
- Removedunique-filename@3.0.0(transitive)
- Removedunique-slug@4.0.0(transitive)
- Removedvalidate-npm-package-license@3.0.4(transitive)
- Removedvalidate-npm-package-name@5.0.1(transitive)
- Removedwalk-up-path@3.0.1(transitive)
- Removedwrap-ansi@8.1.0(transitive)
- Removedyallist@4.0.0(transitive)