@pnpm/modules-yaml
Advanced tools
+7
-3
@@ -1,6 +0,6 @@ | ||
| import { type DepPath, type DependenciesField, type HoistedDependencies, type Registries } from '@pnpm/types'; | ||
| import { type DepPath, type DependenciesField, type HoistedDependencies, type IgnoredBuilds, type Registries } from '@pnpm/types'; | ||
| export type IncludedDependencies = { | ||
| [dependenciesField in DependenciesField]: boolean; | ||
| }; | ||
| export interface Modules { | ||
| interface ModulesRaw { | ||
| hoistedAliases?: { | ||
@@ -16,3 +16,3 @@ [depPath: DepPath]: string[]; | ||
| pendingBuilds: string[]; | ||
| ignoredBuilds?: string[]; | ||
| ignoredBuilds?: DepPath[]; | ||
| prunedAt: string; | ||
@@ -29,2 +29,5 @@ registries?: Registries; | ||
| } | ||
| export type Modules = Omit<ModulesRaw, 'ignoredBuilds'> & { | ||
| ignoredBuilds?: IgnoredBuilds; | ||
| }; | ||
| export declare function readModulesManifest(modulesDir: string): Promise<Modules | null>; | ||
@@ -37,1 +40,2 @@ export interface StrictModules extends Modules { | ||
| }): Promise<void>; | ||
| export {}; |
+9
-5
@@ -18,7 +18,7 @@ "use strict"; | ||
| const modulesYamlPath = path_1.default.join(modulesDir, MODULES_FILENAME); | ||
| let modules; | ||
| let modulesRaw; | ||
| try { | ||
| modules = await (0, read_yaml_file_1.default)(modulesYamlPath); | ||
| if (!modules) | ||
| return modules; | ||
| modulesRaw = await (0, read_yaml_file_1.default)(modulesYamlPath); | ||
| if (!modulesRaw) | ||
| return modulesRaw; | ||
| } | ||
@@ -31,2 +31,6 @@ catch (err) { // eslint-disable-line | ||
| } | ||
| const modules = { | ||
| ...modulesRaw, | ||
| ignoredBuilds: modulesRaw.ignoredBuilds ? new Set(modulesRaw.ignoredBuilds) : undefined, | ||
| }; | ||
| if (!modules.virtualStoreDir) { | ||
@@ -78,3 +82,3 @@ modules.virtualStoreDir = path_1.default.join(modulesDir, '.pnpm'); | ||
| const modulesYamlPath = path_1.default.join(modulesDir, MODULES_FILENAME); | ||
| const saveModules = { ...modules }; | ||
| const saveModules = { ...modules, ignoredBuilds: modules.ignoredBuilds ? Array.from(modules.ignoredBuilds) : undefined }; | ||
| if (saveModules.skipped) | ||
@@ -81,0 +85,0 @@ saveModules.skipped.sort(); |
+3
-3
| { | ||
| "name": "@pnpm/modules-yaml", | ||
| "version": "1000.3.8", | ||
| "version": "1001.0.0", | ||
| "description": "Reads/writes `node_modules/.modules.yaml`", | ||
@@ -32,3 +32,3 @@ "keywords": [ | ||
| "write-yaml-file": "^5.0.0", | ||
| "@pnpm/types": "1001.0.1" | ||
| "@pnpm/types": "1001.1.0" | ||
| }, | ||
@@ -39,3 +39,3 @@ "devDependencies": { | ||
| "tempy": "^1.0.1", | ||
| "@pnpm/modules-yaml": "1000.3.8" | ||
| "@pnpm/modules-yaml": "1001.0.0" | ||
| }, | ||
@@ -42,0 +42,0 @@ "engines": { |
Sorry, the diff of this file is not supported yet
12912
5.08%148
5.71%+ Added
- Removed
Updated