Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

fixturify-project

Package Overview
Dependencies
Maintainers
5
Versions
47
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fixturify-project - npm Package Compare versions

Comparing version 7.1.0-alpha.0 to 7.1.0

2

dist/index.d.ts

@@ -158,2 +158,4 @@ import fixturify from 'fixturify';

private writeLinkedPackage;
private knownWorkspaces;
private discoverWorkspaces;
private publishedPackageContents;

@@ -160,0 +162,0 @@ private hardLinkContents;

49

dist/index.js

@@ -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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc