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

fixturify-project

Package Overview
Dependencies
Maintainers
4
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 4.1.0 to 4.1.1

6

index.d.ts
import fixturify from 'fixturify';
import { PackageJson as BasePackageJson } from 'type-fest';
declare type PackageJson = BasePackageJson & {
[name: string]: {};
};
declare type PackageJson = BasePackageJson & Record<string, any>;
interface ReadDirOpts {

@@ -48,3 +46,3 @@ linkDeps?: boolean;

writeSync(): void;
private writeProject;
protected writeProject(): void;
private binLinks;

@@ -51,0 +49,0 @@ private writeLinkedPackage;

@@ -14,3 +14,5 @@ "use strict";

const binLinks = require("bin-links");
const walk_sync_1 = require("walk-sync");
const walkSync = require("walk-sync");
const util_1 = require("util");
const { entries } = walkSync;
tmp.setGracefulCleanup();

@@ -204,3 +206,2 @@ function deserializePackageJson(serialized) {

writeSync() {
console.warn('this method is deprecated, please use write instead');
this.writeProject();

@@ -225,8 +226,6 @@ }

async binLinks() {
for (let { pkg, baseDir: path } of this.dependencyProjects()) {
let nodeModules = path.join(this.baseDir, 'node_modules');
for (const { pkg, path } of readPackages(nodeModules)) {
await binLinks({ pkg, path, top: false, global: false, force: true });
}
for (let { pkg, baseDir: path } of this.devDependencyProjects()) {
await binLinks({ pkg, path, top: false, global: false, force: true });
}
}

@@ -262,3 +261,3 @@ writeLinkedPackage(name, target) {

fs.ensureDirSync(destination);
for (let entry of (0, walk_sync_1.entries)(target, { ignore: ['node_modules'] })) {
for (let entry of entries(target, { ignore: ['node_modules'] })) {
if (entry.isDirectory()) {

@@ -487,2 +486,61 @@ fs.ensureDirSync(path.join(destination, entry.relativePath));

}
function isErrnoException(e) {
return e instanceof Error && 'code' in e;
}
function readString(name) {
try {
return fs.readFileSync(name, 'utf8');
}
catch (e) {
if (isErrnoException(e)) {
if (e.code === 'ENOENT' || e.code === 'EISDIR') {
return;
}
}
throw e;
}
}
function readdir(name) {
try {
return fs.readdirSync(name);
}
catch (e) {
if (isErrnoException(e)) {
if (e.code === 'ENOENT' || e.code === 'ENOTDIR') {
return [];
}
}
throw e;
}
}
function readPackage(dir) {
if (dir) {
const fileName = path.join(dir, 'package.json');
const content = readString(fileName);
if (content) {
return { pkg: deserializePackageJson(content), path: dir };
}
}
return;
}
function readPackages(modulesPath) {
const pkgs = [];
for (const name of readdir(modulesPath)) {
if (name.startsWith('@')) {
const scopePath = path.join(modulesPath, name);
for (const name of readdir(scopePath)) {
const pkg = readPackage(path.join(scopePath, name));
if (pkg)
pkgs.push(pkg);
}
}
else {
const pkg = readPackage(path.join(modulesPath, name));
if (pkg)
pkgs.push(pkg);
}
}
return pkgs;
}
Project.prototype.writeSync = (0, util_1.deprecate)(Project.prototype.writeSync, 'project.writeSync() is deprecated. Use await project.write() instead');
//# sourceMappingURL=index.js.map
{
"name": "fixturify-project",
"version": "4.1.0",
"version": "4.1.1",
"main": "index.js",

@@ -5,0 +5,0 @@ "repository": "git@github.com:stefanpenner/node-fixturify-project",

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