-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathyarnrc.ts
More file actions
45 lines (40 loc) · 1.17 KB
/
yarnrc.ts
File metadata and controls
45 lines (40 loc) · 1.17 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
import path from "node:path";
import { readYaml, writeYaml } from "./yaml.js";
// https://yarnpkg.com/configuration/yarnrc
type Yarnrc = {
cacheFolder: string;
caFilePath: string;
changesetBaseRefs: string[];
changesetIgnorePatterns: string[];
checksumBehavior: "throw" | "update" | "ignore";
cloneConcurrency: number;
compressionLevel: number | "mixed";
constraintsPath: string;
defaultLanguageName: string;
defaultProtocol: string;
defaultSemverRangePrefix: string;
deferredVersionFolder: string;
enableColors: boolean;
enableGlobalCache: boolean;
enableHyperlinks: boolean;
enableImmutableCache: boolean;
enableImmutableInstalls: boolean;
// @todo: etc, fix later
nodeLinker: "node-modules" | "pnp" | "pnpm";
npmPublishAccess: "public" | "restricted";
};
const YARNRC_FILENAME = ".yarnrc.yml";
export async function readYarnrc({ directory }: { directory: string }) {
return readYaml<Partial<Yarnrc>>({
path: path.join(directory, YARNRC_FILENAME),
});
}
export async function writeYarnrc({
directory,
data,
}: {
directory: string;
data: Partial<Yarnrc>;
}) {
await writeYaml({ path: path.join(directory, YARNRC_FILENAME), data });
}