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

@pnpm/modules-yaml

Package Overview
Dependencies
Maintainers
3
Versions
73
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@pnpm/modules-yaml - npm Package Compare versions

Comparing version 7.0.0 to 8.0.0

13

CHANGELOG.md
# @pnpm/modules-yaml
## 8.0.0
### Major Changes
- 71a8c8ce3: Breaking changes to the `node_modules/.modules.yaml` file:
- `hoistedAliases` replaced with `hoistedDependencies`.
- `shamefullyHoist` replaced with `publicHoistPattern`.
### Patch Changes
- Updated dependencies [71a8c8ce3]
- @pnpm/types@6.1.0
## 7.0.0

@@ -4,0 +17,0 @@

8

lib/index.d.ts

@@ -1,2 +0,2 @@

import { DependenciesField, Registries } from '@pnpm/types';
import { DependenciesField, HoistedDependencies, Registries } from '@pnpm/types';
export declare type IncludedDependencies = {

@@ -6,5 +6,6 @@ [dependenciesField in DependenciesField]: boolean;

export interface Modules {
hoistedAliases: {
hoistedAliases?: {
[depPath: string]: string[];
};
hoistedDependencies: HoistedDependencies;
hoistPattern?: string[];

@@ -16,3 +17,4 @@ included: IncludedDependencies;

registries?: Registries;
shamefullyHoist: boolean;
shamefullyHoist?: boolean;
publicHoistPattern?: string[];
skipped: string[];

@@ -19,0 +21,0 @@ storeDir: string;

@@ -13,11 +13,5 @@ "use strict";

const modulesYamlPath = path.join(modulesDir, MODULES_FILENAME);
let modules;
try {
const modules = await read_yaml_file_1.default(modulesYamlPath);
if (!modules.virtualStoreDir) {
modules.virtualStoreDir = path.join(modulesDir, '.pnpm');
}
else if (!path.isAbsolute(modules.virtualStoreDir)) {
modules.virtualStoreDir = path.join(modulesDir, modules.virtualStoreDir);
}
return modules;
modules = await read_yaml_file_1.default(modulesYamlPath);
}

@@ -30,5 +24,46 @@ catch (err) {

}
if (!modules.virtualStoreDir) {
modules.virtualStoreDir = path.join(modulesDir, '.pnpm');
}
else if (!path.isAbsolute(modules.virtualStoreDir)) {
modules.virtualStoreDir = path.join(modulesDir, modules.virtualStoreDir);
}
switch (modules.shamefullyHoist) {
case true:
if (!modules.publicHoistPattern) {
modules.publicHoistPattern = ['*'];
}
if (modules.hoistedAliases && !modules.hoistedDependencies) {
modules.hoistedDependencies = {};
for (const depPath of Object.keys(modules.hoistedAliases)) {
modules.hoistedDependencies[depPath] = {};
for (const alias of modules.hoistedAliases[depPath]) {
modules.hoistedDependencies[depPath][alias] = 'public';
}
}
}
break;
case false:
if (!modules.publicHoistPattern) {
modules.publicHoistPattern = [];
}
if (modules.hoistedAliases && !modules.hoistedDependencies) {
modules.hoistedDependencies = {};
for (const depPath of Object.keys(modules.hoistedAliases)) {
modules.hoistedDependencies[depPath] = {};
for (const alias of modules.hoistedAliases[depPath]) {
modules.hoistedDependencies[depPath][alias] = 'private';
}
}
}
break;
}
return modules;
}
exports.read = read;
const YAML_OPTS = { sortKeys: true };
const YAML_OPTS = {
noCompatMode: true,
noRefs: true,
sortKeys: true,
};
function write(modulesDir, modules) {

@@ -42,2 +77,7 @@ const modulesYamlPath = path.join(modulesDir, MODULES_FILENAME);

delete saveModules.hoistPattern;
}
if (!saveModules.publicHoistPattern) {
delete saveModules.publicHoistPattern;
}
if (!saveModules.hoistedAliases || !saveModules.hoistPattern && !saveModules.publicHoistPattern) {
delete saveModules.hoistedAliases;

@@ -44,0 +84,0 @@ }

{
"name": "@pnpm/modules-yaml",
"version": "7.0.0",
"version": "8.0.0",
"description": "Reads/writes `node_modules/.modules.yaml`",

@@ -34,3 +34,3 @@ "main": "lib/index.js",

"dependencies": {
"@pnpm/types": "6.0.0",
"@pnpm/types": "6.1.0",
"is-windows": "1.0.2",

@@ -37,0 +37,0 @@ "read-yaml-file": "2.0.0",

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