@pnpm/modules-yaml
Advanced tools
Comparing version 4.0.0 to 5.0.0
@@ -19,6 +19,7 @@ import { DependenciesField, Registries } from '@pnpm/types'; | ||
store: string; | ||
virtualStoreDir: string; | ||
} | ||
export declare function read(virtualStoreDir: string): Promise<Modules | null>; | ||
export declare function write(virtualStoreDir: string, modules: Modules & { | ||
export declare function read(modulesDir: string): Promise<Modules | null>; | ||
export declare function write(modulesDir: string, modules: Modules & { | ||
registries: Registries; | ||
}): Promise<void>; |
@@ -9,6 +9,10 @@ "use strict"; | ||
const MODULES_FILENAME = '.modules.yaml'; | ||
async function read(virtualStoreDir) { | ||
const modulesYamlPath = path.join(virtualStoreDir, MODULES_FILENAME); | ||
async function read(modulesDir) { | ||
const modulesYamlPath = path.join(modulesDir, MODULES_FILENAME); | ||
try { | ||
return await read_yaml_file_1.default(modulesYamlPath); | ||
const modules = await read_yaml_file_1.default(modulesYamlPath); | ||
if (!modules.virtualStoreDir) { | ||
modules.virtualStoreDir = path.join(modulesDir, '.pnpm'); | ||
} | ||
return modules; | ||
} | ||
@@ -24,4 +28,4 @@ catch (err) { | ||
const YAML_OPTS = { sortKeys: true }; | ||
function write(virtualStoreDir, modules) { | ||
const modulesYamlPath = path.join(virtualStoreDir, MODULES_FILENAME); | ||
function write(modulesDir, modules) { | ||
const modulesYamlPath = path.join(modulesDir, MODULES_FILENAME); | ||
if (modules.skipped) | ||
@@ -28,0 +32,0 @@ modules.skipped.sort(); |
{ | ||
"name": "@pnpm/modules-yaml", | ||
"version": "4.0.0", | ||
"version": "5.0.0", | ||
"description": "Reads/writes `node_modules/.modules.yaml`", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
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
5239
62