forked from drivenets/design-system
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsyncpack.config.ts
More file actions
33 lines (29 loc) · 889 Bytes
/
syncpack.config.ts
File metadata and controls
33 lines (29 loc) · 889 Bytes
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
import * as fs from 'node:fs';
import * as path from 'node:path';
import * as yaml from 'yaml';
import type { RcFile } from 'syncpack';
export default {
versionGroups: [
{
label: 'Use workspace protocol for local packages',
dependencies: ['$LOCAL'],
dependencyTypes: ['!local'],
pinVersion: 'workspace:*',
},
{
label: "Allow different peer dependencies versions than what's used in the package",
dependencyTypes: ['peer'],
isIgnored: true,
},
{
label: 'Require usage of catalog protocol for shared dependencies',
pinVersion: 'catalog:',
dependencies: extractCatalogPackages(),
},
],
} satisfies RcFile;
function extractCatalogPackages() {
const pnpmWorkspace = fs.readFileSync(path.resolve(__dirname, 'pnpm-workspace.yaml'), 'utf-8');
const { catalog } = yaml.parse(pnpmWorkspace) as { catalog: string[] };
return Object.keys(catalog);
}