fixturify-project
Advanced tools
Comparing version 7.0.0 to 7.1.0-alpha.0
@@ -151,3 +151,3 @@ import fixturify from 'fixturify'; | ||
dispose(): void; | ||
protected writeProject(): void; | ||
private writeProject; | ||
private assignBaseDirs; | ||
@@ -159,2 +159,3 @@ private writeFiles; | ||
private writeLinkedPackage; | ||
private publishedPackageContents; | ||
private hardLinkContents; | ||
@@ -161,0 +162,0 @@ private hardLinkFile; |
@@ -9,5 +9,5 @@ // src/index.ts | ||
import binLinks from "bin-links"; | ||
import walkSync from "walk-sync"; | ||
import deepmerge from "deepmerge"; | ||
var { entries } = walkSync; | ||
import Arborist from "@npmcli/arborist"; | ||
import packList from "npm-packlist"; | ||
tmp.setGracefulCleanup(); | ||
@@ -115,3 +115,3 @@ var defaultFiles = { | ||
} | ||
this.writeProject(); | ||
await this.writeProject(); | ||
await this.binLinks(); | ||
@@ -200,7 +200,7 @@ } | ||
} | ||
writeProject() { | ||
async writeProject() { | ||
this.assignBaseDirs(); | ||
let resolvedLinksMap = /* @__PURE__ */ new Map(); | ||
this.writeFiles(resolvedLinksMap); | ||
this.finalizeWrite(resolvedLinksMap); | ||
await this.finalizeWrite(resolvedLinksMap); | ||
} | ||
@@ -227,5 +227,5 @@ assignBaseDirs() { | ||
} | ||
finalizeWrite(resolvedLinksMap) { | ||
async finalizeWrite(resolvedLinksMap) { | ||
for (let [name, { dir: target }] of resolvedLinksMap.get(this)) { | ||
this.writeLinkedPackage(name, target, path.join(this.baseDir, "node_modules", name)); | ||
await this.writeLinkedPackage(name, target, path.join(this.baseDir, "node_modules", name)); | ||
} | ||
@@ -271,3 +271,3 @@ for (let depList of [this.dependencyProjects(), this.devDependencyProjects()]) { | ||
} | ||
writeLinkedPackage(name, target, destination) { | ||
async writeLinkedPackage(name, target, destination) { | ||
var _a; | ||
@@ -280,3 +280,3 @@ let targetPkg = fs.readJsonSync(`${target}/package.json`); | ||
} | ||
this.hardLinkContents(target, destination); | ||
await this.hardLinkContents(target, destination); | ||
for (let section of ["dependencies", "peerDependencies"]) { | ||
@@ -294,3 +294,3 @@ if (targetPkg[section]) { | ||
} | ||
this.writeLinkedPackage(depName, path.dirname(depTarget), path.join(destination, "node_modules", depName)); | ||
await this.writeLinkedPackage(depName, path.dirname(depTarget), path.join(destination, "node_modules", depName)); | ||
} | ||
@@ -300,10 +300,11 @@ } | ||
} | ||
hardLinkContents(target, destination) { | ||
async publishedPackageContents(targetDir) { | ||
let tree = await new Arborist({ path: targetDir }).loadActual(); | ||
return await packList(tree); | ||
} | ||
async hardLinkContents(target, destination) { | ||
fs.ensureDirSync(destination); | ||
for (let entry of entries(target, { ignore: ["node_modules"] })) { | ||
if (entry.isDirectory()) { | ||
fs.ensureDirSync(path.join(destination, entry.relativePath)); | ||
} else { | ||
this.hardLinkFile(entry.fullPath, path.join(destination, entry.relativePath)); | ||
} | ||
for (let relativePath of await this.publishedPackageContents(target)) { | ||
fs.ensureDirSync(path.dirname(path.join(destination, relativePath))); | ||
this.hardLinkFile(path.join(target, relativePath), path.join(destination, relativePath)); | ||
} | ||
@@ -310,0 +311,0 @@ } |
{ | ||
"name": "fixturify-project", | ||
"version": "7.0.0", | ||
"version": "7.1.0-alpha.0", | ||
"repository": "git@github.com:stefanpenner/node-fixturify-project", | ||
@@ -22,3 +22,3 @@ "license": "MIT", | ||
"scripts": { | ||
"build": "tsup-node src/index.ts --format cjs,esm --external 'fs-extra' --dts --clean", | ||
"build": "tsup-node src/index.ts --format cjs,esm --dts --clean", | ||
"docs:generate": "readme-api-generator src/index.ts --ts", | ||
@@ -31,9 +31,11 @@ "lint": "pnpm prettier --check *.ts", | ||
"dependencies": { | ||
"@npmcli/arborist": "^7.5.0", | ||
"bin-links": "^3.0.0", | ||
"deepmerge": "^4.2.2", | ||
"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", | ||
"walk-sync": "^3.0.0" | ||
"type-fest": "^4.1.0" | ||
}, | ||
@@ -45,5 +47,6 @@ "devDependencies": { | ||
"@types/node": "^16.9.1", | ||
"@types/npm-packlist": "^7.0.3", | ||
"@types/npmcli__arborist": "^5.6.6", | ||
"@types/tmp": "^0.0.33", | ||
"chai": "^4.3.4", | ||
"fs-extra": "^10.0.0", | ||
"prettier": "^2.3.0", | ||
@@ -55,3 +58,4 @@ "release-it": "^14.2.1", | ||
"vite": "^5.2.7", | ||
"vitest": "^0.9.3" | ||
"vitest": "^0.9.3", | ||
"walk-sync": "^3.0.0" | ||
}, | ||
@@ -58,0 +62,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
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
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
53669
1266
9
16
2
+ Added@npmcli/arborist@^7.5.0
+ Addedfs-extra@^10.0.0
+ Addednpm-packlist@^8.0.2
+ Added@isaacs/cliui@8.0.2(transitive)
+ Added@isaacs/string-locale-compare@1.1.0(transitive)
+ Added@npmcli/agent@2.2.2(transitive)
+ Added@npmcli/arborist@7.5.4(transitive)
+ Added@npmcli/fs@3.1.1(transitive)
+ Added@npmcli/git@5.0.8(transitive)
+ Added@npmcli/installed-package-contents@2.1.0(transitive)
+ Added@npmcli/map-workspaces@3.0.6(transitive)
+ Added@npmcli/metavuln-calculator@7.1.1(transitive)
+ Added@npmcli/name-from-folder@2.0.0(transitive)
+ Added@npmcli/node-gyp@3.0.0(transitive)
+ Added@npmcli/package-json@5.2.1(transitive)
+ Added@npmcli/promise-spawn@7.0.2(transitive)
+ Added@npmcli/query@3.1.0(transitive)
+ Added@npmcli/redact@2.0.1(transitive)
+ Added@npmcli/run-script@8.1.0(transitive)
+ Added@pkgjs/parseargs@0.11.0(transitive)
+ Added@sigstore/bundle@2.3.2(transitive)
+ Added@sigstore/core@1.1.0(transitive)
+ Added@sigstore/protobuf-specs@0.3.2(transitive)
+ Added@sigstore/sign@2.3.2(transitive)
+ Added@sigstore/tuf@2.3.4(transitive)
+ Added@sigstore/verify@1.2.1(transitive)
+ Added@tufjs/canonical-json@2.0.0(transitive)
+ Added@tufjs/models@2.0.1(transitive)
+ Addedabbrev@2.0.0(transitive)
+ Addedagent-base@7.1.3(transitive)
+ Addedaggregate-error@3.1.0(transitive)
+ Addedansi-regex@5.0.16.1.0(transitive)
+ Addedansi-styles@4.3.06.2.1(transitive)
+ Addedbin-links@4.0.4(transitive)
+ Addedbrace-expansion@2.0.1(transitive)
+ Addedcacache@18.0.4(transitive)
+ Addedclean-stack@2.2.0(transitive)
+ Addedcmd-shim@6.0.3(transitive)
+ Addedcolor-convert@2.0.1(transitive)
+ Addedcolor-name@1.1.4(transitive)
+ Addedcommon-ancestor-path@1.0.1(transitive)
+ Addedcross-spawn@7.0.6(transitive)
+ Addedcssesc@3.0.0(transitive)
+ Addeddebug@4.4.0(transitive)
+ Addedeastasianwidth@0.2.0(transitive)
+ Addedemoji-regex@8.0.09.2.2(transitive)
+ Addedencoding@0.1.13(transitive)
+ Addedenv-paths@2.2.1(transitive)
+ Addederr-code@2.0.3(transitive)
+ Addedexponential-backoff@3.1.1(transitive)
+ Addedforeground-child@3.3.0(transitive)
+ Addedfs-minipass@2.1.03.0.3(transitive)
+ Addedglob@10.4.5(transitive)
+ Addedhosted-git-info@7.0.2(transitive)
+ Addedhttp-cache-semantics@4.1.1(transitive)
+ Addedhttp-proxy-agent@7.0.2(transitive)
+ Addedhttps-proxy-agent@7.0.6(transitive)
+ Addediconv-lite@0.6.3(transitive)
+ Addedignore-walk@6.0.5(transitive)
+ Addedindent-string@4.0.0(transitive)
+ Addedini@4.1.3(transitive)
+ Addedip-address@9.0.5(transitive)
+ Addedis-fullwidth-code-point@3.0.0(transitive)
+ Addedis-lambda@1.0.1(transitive)
+ Addedisexe@2.0.03.1.1(transitive)
+ Addedjackspeak@3.4.3(transitive)
+ Addedjsbn@1.1.0(transitive)
+ Addedjson-parse-even-better-errors@3.0.2(transitive)
+ Addedjson-stringify-nice@1.1.4(transitive)
+ Addedjsonparse@1.3.1(transitive)
+ Addedjust-diff@6.0.2(transitive)
+ Addedjust-diff-apply@5.5.0(transitive)
+ Addedlru-cache@10.4.3(transitive)
+ Addedmake-fetch-happen@13.0.1(transitive)
+ Addedminimatch@9.0.5(transitive)
+ Addedminipass@3.3.65.0.07.1.2(transitive)
+ Addedminipass-collect@2.0.1(transitive)
+ Addedminipass-fetch@3.0.5(transitive)
+ Addedminipass-flush@1.0.5(transitive)
+ Addedminipass-pipeline@1.2.4(transitive)
+ Addedminipass-sized@1.0.3(transitive)
+ Addedminizlib@2.1.2(transitive)
+ Addedms@2.1.3(transitive)
+ Addednegotiator@0.6.4(transitive)
+ Addednode-gyp@10.3.1(transitive)
+ Addednopt@7.2.1(transitive)
+ Addednormalize-package-data@6.0.2(transitive)
+ Addednpm-bundled@3.0.1(transitive)
+ Addednpm-install-checks@6.3.0(transitive)
+ Addednpm-normalize-package-bin@3.0.1(transitive)
+ Addednpm-package-arg@11.0.3(transitive)
+ Addednpm-packlist@8.0.2(transitive)
+ Addednpm-pick-manifest@9.1.0(transitive)
+ Addednpm-registry-fetch@17.1.0(transitive)
+ Addedp-map@4.0.0(transitive)
+ Addedpackage-json-from-dist@1.0.1(transitive)
+ Addedpacote@18.0.6(transitive)
+ Addedparse-conflict-json@3.0.1(transitive)
+ Addedpath-key@3.1.1(transitive)
+ Addedpath-scurry@1.11.1(transitive)
+ Addedpostcss-selector-parser@6.1.2(transitive)
+ Addedproc-log@4.2.0(transitive)
+ Addedproggy@2.0.0(transitive)
+ Addedpromise-all-reject-late@1.0.1(transitive)
+ Addedpromise-call-limit@3.0.2(transitive)
+ Addedpromise-inflight@1.0.1(transitive)
+ Addedpromise-retry@2.0.1(transitive)
+ Addedread-cmd-shim@4.0.0(transitive)
+ Addedread-package-json-fast@3.0.2(transitive)
+ Addedretry@0.12.0(transitive)
+ Addedsafer-buffer@2.1.2(transitive)
+ Addedsemver@7.6.3(transitive)
+ Addedshebang-command@2.0.0(transitive)
+ Addedshebang-regex@3.0.0(transitive)
+ Addedsignal-exit@4.1.0(transitive)
+ Addedsigstore@2.3.1(transitive)
+ Addedsmart-buffer@4.2.0(transitive)
+ Addedsocks@2.8.3(transitive)
+ Addedsocks-proxy-agent@8.0.5(transitive)
+ Addedspdx-correct@3.2.0(transitive)
+ Addedspdx-exceptions@2.5.0(transitive)
+ Addedspdx-expression-parse@3.0.1(transitive)
+ Addedspdx-license-ids@3.0.20(transitive)
+ Addedsprintf-js@1.1.3(transitive)
+ Addedssri@10.0.6(transitive)
+ Addedstring-width@4.2.35.1.2(transitive)
+ Addedstrip-ansi@6.0.17.1.0(transitive)
+ Addedtar@6.2.1(transitive)
+ Addedtreeverse@3.0.0(transitive)
+ Addedtuf-js@2.2.1(transitive)
+ Addedunique-filename@3.0.0(transitive)
+ Addedunique-slug@4.0.0(transitive)
+ Addedutil-deprecate@1.0.2(transitive)
+ Addedvalidate-npm-package-license@3.0.4(transitive)
+ Addedvalidate-npm-package-name@5.0.1(transitive)
+ Addedwalk-up-path@3.0.1(transitive)
+ Addedwhich@2.0.24.0.0(transitive)
+ Addedwrap-ansi@7.0.08.1.0(transitive)
+ Addedwrite-file-atomic@5.0.1(transitive)
+ Addedyallist@4.0.0(transitive)
- Removedwalk-sync@^3.0.0