forked from livestorejs/livestore
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsyncpack.config.mjs
More file actions
74 lines (68 loc) · 1.89 KB
/
syncpack.config.mjs
File metadata and controls
74 lines (68 loc) · 1.89 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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
// @ts-check
import fs from 'node:fs'
import path from 'node:path'
import url from 'node:url'
/*
Semver calculator: https://semver.npmjs.com
Semver cheat sheet: https://devhints.io/semver
Ranges:
~1.2.3 is >=1.2.3 <1.3.0
^1.2.3 is >=1.2.3 <2.0.0
^0.2.3 is >=0.2.3 <0.3.0 (0.x.x is special)
^0.0.1 is =0.0.1 (0.0.x is special)
^1.2 is >=1.2.0 <2.0.0 (like ^1.2.0)
~1.2 is >=1.2.0 <1.3.0 (like ~1.2.0)
*/
// const __dirname = import.meta.dirname // use this once supported broadly
const __dirname = url.fileURLToPath(new URL('.', import.meta.url))
const localPackages = fs
.readdirSync(path.join(__dirname, './packages/@livestore'))
.filter((dir) => fs.statSync(path.join(__dirname, './packages/@livestore', dir)).isDirectory())
.map((dir) => `@livestore/${dir}`)
/** @type {import("syncpack").RcFile} */
const config = {
sortFirst: ['name', 'version', 'type', 'sideEffects', 'private', 'exports', 'types', 'typesVersions'],
sortExports: [
'types',
'node-addons',
'node',
'browser',
'react-native',
'import',
'require',
'development',
'production',
'default',
],
semverGroups: [
{
label: 'default all to exact version for prod deps',
range: '',
dependencyTypes: ['prod'],
packages: ['**'],
},
{
label: 'default all to patch range for peer deps',
range: '~',
dependencyTypes: ['peer'],
packages: ['**'],
},
{
label: 'default all to minor range for dev deps',
range: '^',
dependencyTypes: ['dev'],
packages: ['**'],
},
],
versionGroups: [
{
label: 'use workspace protocol for local packages',
dependencies: [...localPackages, '@local/**'],
dependencyTypes: ['!local'],
// Except for standalone examples
packages: ['!livestore-example-standalone-**'],
pinVersion: 'workspace:*',
},
],
}
export default config