syncpack 14.0.0-alpha.2 → 14.0.0-alpha.20

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,54 +1,167 @@
1
1
  # syncpack
2
2
 
3
3
  <p align="center">
4
- <img src="https://jamiemason.github.io/syncpack/logo.svg" width="200" height="179" alt="">
4
+ <img src="https://jamiemason.github.io/syncpack/logo.svg" width="134" height="120" alt="">
5
5
  <br>Consistent dependency versions in large JavaScript Monorepos.
6
6
  <br><a href="https://jamiemason.github.io/syncpack">https://jamiemason.github.io/syncpack</a>
7
7
  </p>
8
8
 
9
+ > [!NOTE]
10
+ > This is the README for v14-alpha, a Rust rewrite which is due to replace [`v13.x.x`](https://github.com/JamieMason/syncpack/tree/13.x.x?tab=readme-ov-file#syncpack)
11
+
9
12
  ## Installation
10
13
 
11
14
  ```bash
12
- npm install --save-dev syncpack
15
+ npm install --save-dev syncpack@alpha
13
16
  ```
14
17
 
15
18
  ## Commands
16
19
 
17
- ### [fix-mismatches](https://jamiemason.github.io/syncpack/command/fix-mismatches)
20
+ > All command line options can be combined to target packages and dependencies in multiple ways.
18
21
 
19
- Ensure that multiple packages requiring the same dependency define the same version, so that every package requires eg. `react@16.4.2`, instead of a combination of `react@16.4.2`, `react@0.15.9`, and `react@16.0.0`.
22
+ ### [lint](https://jamiemason.github.io/syncpack/command/lint)
20
23
 
21
- ### [format](https://jamiemason.github.io/syncpack/command/format)
24
+ Ensure that multiple packages requiring the same dependency define the same version, so that every package requires eg. `react@17.0.2`, instead of a combination of `react@17.0.2`, `react@16.8.3`, and `react@16.14.0`.
22
25
 
23
- Organise package.json files according to a conventional format, where fields appear in a predictable order and nested fields are ordered alphabetically. Shorthand properties are used where available, such as the `"repository"` and `"bugs"` fields.
26
+ #### Examples
24
27
 
25
- ### [lint](https://jamiemason.github.io/syncpack/command/lint)
28
+ ```bash
29
+ # Find all issues in "dependencies" or "devDependencies"
30
+ syncpack lint --dependency-types prod,dev
31
+ # Only lint issues in "react" specifically
32
+ syncpack lint --dependencies react
33
+ # Look for issues in dependencies containing "react" in the name
34
+ syncpack lint --dependencies '**react**'
35
+ # Find issues in scoped packages only
36
+ syncpack lint --dependencies '@types/**'
37
+ # Find issues everywhere except "peerDependencies"
38
+ syncpack lint --dependency-types '!peer'
39
+ # Only look for issues where an exact version is used (eg "1.2.3")
40
+ syncpack lint --specifier-types exact
41
+ # Sort dependencies by how many times they are used
42
+ syncpack lint --sort count
43
+ # See more examples
44
+ syncpack lint --help
45
+ # See a short summary of options
46
+ syncpack lint -h
47
+ ```
26
48
 
27
- Lint all versions and ranges and exit with 0 or 1 based on whether all files match your Syncpack configuration file.
49
+ ### [fix](https://jamiemason.github.io/syncpack/command/fix)
28
50
 
29
- ### [lint-semver-ranges](https://jamiemason.github.io/syncpack/command/lint-semver-ranges)
51
+ Fix every autofixable issue found by `syncpack lint`.
30
52
 
31
- Check whether dependency versions used within "dependencies", "devDependencies", etc follow a consistent format.
53
+ #### Examples
32
54
 
33
- ### [list](https://jamiemason.github.io/syncpack/command/list)
55
+ ```bash
56
+ # Only fix issues in dependencies and devDependencies
57
+ syncpack fix --dependency-types prod,dev
58
+ # Only fix inconsistencies with exact versions (eg "1.2.3")
59
+ syncpack fix --specifier-types exact
60
+ # Only fix issues in "react" specifically
61
+ syncpack fix --dependencies react
62
+ # See more examples
63
+ syncpack fix --help
64
+ # See a short summary of options
65
+ syncpack fix -h
66
+ ```
67
+
68
+ ### [update](https://jamiemason.github.io/syncpack/command/update)
69
+
70
+ Update packages to the latest versions from the npm registry, wherever they are in your monorepo.<br/>Semver range preferences are preserved when updating.
71
+
72
+ #### Examples
73
+
74
+ ```bash
75
+ # Accept any update in latest (x.x.x)
76
+ syncpack update --target latest
77
+ # Only update minor versions (1.x.x)
78
+ syncpack update --target minor
79
+ # Only update patch versions (1.2.x)
80
+ syncpack update --target patch
81
+ # Check for outdated dependencies in one package
82
+ syncpack update --check --source 'packages/pingu/package.json'
83
+ # Update dependencies and devDependencies in the whole monorepo
84
+ syncpack update --dependency-types dev,prod
85
+ # Only update dependencies with a semver range specifier (^, ~, etc.)
86
+ syncpack update --specifier-types range
87
+ # Update dependencies where name exactly matches 'react'
88
+ syncpack update --dependencies 'react'
89
+ # Update dependencies where name contains 'react'
90
+ syncpack update --dependencies '**react**'
91
+ # Update dependencies with the '@aws-sdk' scope
92
+ syncpack update --dependencies '@aws-sdk/**'
93
+ # See more examples
94
+ syncpack update --help
95
+ # See a short summary of options
96
+ syncpack update -h
97
+ ```
34
98
 
35
- List all dependencies required by your packages.
99
+ ### [format](https://jamiemason.github.io/syncpack/command/format)
36
100
 
37
- ### [list-mismatches](https://jamiemason.github.io/syncpack/command/list-mismatches)
101
+ Organise package.json files according to a conventional format, where fields appear in a predictable order and nested fields are ordered alphabetically. Shorthand properties are used where available, such as the `"repository"` and `"bugs"` fields.
38
102
 
39
- List dependencies which are required by multiple packages, where the version is not the same across every package.
103
+ #### Examples
40
104
 
41
- ### [prompt](https://jamiemason.github.io/syncpack/command/prompt)
105
+ ```bash
106
+ # Fix every formatting issue in the monorepo
107
+ syncpack format
108
+ # List all formatting issues in the monorepo
109
+ syncpack format --check
110
+ # Check the formatting of one package
111
+ syncpack format --check --source 'packages/pingu/package.json'
112
+ # See more examples
113
+ syncpack format --help
114
+ # See a short summary of options
115
+ syncpack format -h
116
+ ```
42
117
 
43
- Displays a series of prompts to fix mismatches which syncpack cannot fix automatically.
118
+ ### [list](https://jamiemason.github.io/syncpack/command/list)
44
119
 
45
- ### [set-semver-ranges](https://jamiemason.github.io/syncpack/command/set-semver-ranges)
120
+ Query and inspect all dependencies in your project, both valid and invalid.
46
121
 
47
- Ensure dependency versions used within `"dependencies"`, `"devDependencies"` etc follow a consistent format.
122
+ #### Examples
48
123
 
49
- ### [update](https://jamiemason.github.io/syncpack/command/update)
124
+ ```bash
125
+ # Sort dependencies by how many times they are used
126
+ syncpack list --sort count
127
+ # Show every instance of each dependency, not just their names
128
+ syncpack list --show instances
129
+ # Show dependencies ignored in your syncpack config
130
+ syncpack list --show ignored
131
+ # Show highest level of detail
132
+ syncpack list --show all
133
+ # Choose only some values
134
+ syncpack list --show hints,statuses
135
+ # List all "peerDependencies"
136
+ syncpack list --dependency-types peer
137
+ # List all types packages
138
+ syncpack list --dependencies '@types/**'
139
+ # List instances of an exact version being used as a peer dependency
140
+ syncpack list --specifier-types exact --show instances --dependency-types peer
141
+ # See more examples
142
+ syncpack list --help
143
+ # See a short summary of options
144
+ syncpack list -h
145
+ ```
146
+
147
+ ### [json](https://jamiemason.github.io/syncpack/command/json)
148
+
149
+ Output the state of every instance of every dependency as a JSON object, one per line. This command is best used with tools like [`jq`](https://jqlang.org/) for filtering and processing.
50
150
 
51
- Interactively update packages to the latest versions from the npm registry, wherever they are in your monorepo. You can update every dependency, just dev/peer/prod dependencies, just packages which match a name filter, and more.
151
+ #### Examples
152
+
153
+ ```bash
154
+ # Output all dependencies as JSON
155
+ syncpack json
156
+ # Output only AWS SDK dependencies
157
+ syncpack json --dependencies '@aws-sdk/**'
158
+ # Count dependencies by type
159
+ syncpack json | jq -r '.dependencyType' | sort | uniq -c
160
+ # See more examples
161
+ syncpack json --help
162
+ # See a short summary of options
163
+ syncpack json -h
164
+ ```
52
165
 
53
166
  ## Badges
54
167
 
package/index.cjs ADDED
@@ -0,0 +1,18 @@
1
+ #!/usr/bin/env node
2
+
3
+ const { spawnSync } = require('node:child_process');
4
+
5
+ const args = process.argv.slice(2);
6
+ const arch = process.arch;
7
+ const [os, extension] = ['win32', 'cygwin'].includes(process.platform) ? ['windows', '.exe'] : [process.platform, ''];
8
+ const optionalDep = `syncpack-${os}-${arch}`;
9
+ const pkgSpecifier = `${optionalDep}/bin/syncpack${extension}`;
10
+ const pathToBinary = require.resolve(pkgSpecifier);
11
+
12
+ process.exit(
13
+ spawnSync(pathToBinary, args, {
14
+ cwd: process.cwd(),
15
+ stdio: ['ignore', 'inherit', 'inherit'],
16
+ env: process.env,
17
+ }).status || 0,
18
+ );
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "syncpack",
3
3
  "description": "Consistent dependency versions in large JavaScript Monorepos",
4
- "version": "14.0.0-alpha.2",
4
+ "version": "14.0.0-alpha.20",
5
5
  "author": "Jamie Mason <jamie@foldleft.io> (https://github.com/JamieMason)",
6
6
  "bugs": "https://github.com/JamieMason/syncpack/issues",
7
7
  "contributors": [
@@ -14,7 +14,9 @@
14
14
  "Aparajita Fishman (https://github.com/aparajita)",
15
15
  "Artur Wierzbicki (https://github.com/ArturWierzbicki)",
16
16
  "Chase Holdren (https://github.com/chaseholdren)",
17
+ "Chase Tamnoon (https://github.com/chase-tamnoon)",
17
18
  "Daniel Silva (https://github.com/dsilvasc)",
19
+ "Dustin McCormick (https://github.com/djmccormick)",
18
20
  "Elchin Valiyev (https://github.com/evaliyev)",
19
21
  "Gabriel Pereira Woitechen (https://github.com/wtchnm)",
20
22
  "Jamie Haywood (https://github.com/jamiehaywood)",
@@ -29,12 +31,12 @@
29
31
  "Michał Warać (https://github.com/auto200)",
30
32
  "Nick Saunders (https://github.com/nsaunders)",
31
33
  "Siraj (https://github.com/Syhner)",
34
+ "Steve Beaugé (https://github.com/stevebeauge)",
32
35
  "Stuart Knightley (https://github.com/Stuk)",
33
36
  "Tom Fletcher (https://github.com/tom-fletcher)"
34
37
  ],
35
38
  "dependencies": {
36
- "cosmiconfig": "9.0.0",
37
- "typescript": "5.7.3"
39
+ "tsx": "^4.20.5"
38
40
  },
39
41
  "engines": {
40
42
  "node": ">=14.17.0"
@@ -64,15 +66,15 @@
64
66
  "license": "MIT",
65
67
  "repository": "JamieMason/syncpack",
66
68
  "bin": {
67
- "syncpack": "./index.js"
69
+ "syncpack": "./index.cjs"
68
70
  },
69
71
  "optionalDependencies": {
70
- "syncpack-linux-x64": "14.0.0-alpha.2",
71
- "syncpack-linux-arm64": "14.0.0-alpha.2",
72
- "syncpack-darwin-x64": "14.0.0-alpha.2",
73
- "syncpack-darwin-arm64": "14.0.0-alpha.2",
74
- "syncpack-windows-x64": "14.0.0-alpha.2",
75
- "syncpack-windows-arm64": "14.0.0-alpha.2"
72
+ "syncpack-linux-x64": "14.0.0-alpha.20",
73
+ "syncpack-linux-arm64": "14.0.0-alpha.20",
74
+ "syncpack-darwin-x64": "14.0.0-alpha.20",
75
+ "syncpack-darwin-arm64": "14.0.0-alpha.20",
76
+ "syncpack-windows-x64": "14.0.0-alpha.20",
77
+ "syncpack-windows-arm64": "14.0.0-alpha.20"
76
78
  },
77
79
  "types": "./syncpack.d.ts"
78
80
  }
package/schema.json CHANGED
@@ -99,11 +99,93 @@
99
99
  ],
100
100
  "type": "object"
101
101
  },
102
+ "DependencyGroup": {
103
+ "additionalProperties": false,
104
+ "properties": {
105
+ "aliasName": {
106
+ "see": "https://jamiemason.github.io/syncpack/config/dependency-groups/#aliasname",
107
+ "type": "string"
108
+ },
109
+ "dependencies": {
110
+ "items": {
111
+ "type": "string"
112
+ },
113
+ "see": "https://jamiemason.github.io/syncpack/config/dependency-groups/#dependencies",
114
+ "type": "array"
115
+ },
116
+ "dependencyTypes": {
117
+ "items": {
118
+ "anyOf": [
119
+ {
120
+ "type": "string"
121
+ },
122
+ {
123
+ "enum": [
124
+ "dev",
125
+ "local",
126
+ "overrides",
127
+ "peer",
128
+ "pnpmOverrides",
129
+ "prod",
130
+ "resolutions"
131
+ ],
132
+ "type": "string"
133
+ }
134
+ ]
135
+ },
136
+ "see": "https://jamiemason.github.io/syncpack/config/dependency-groups/#dependencytypes",
137
+ "type": "array"
138
+ },
139
+ "packages": {
140
+ "items": {
141
+ "type": "string"
142
+ },
143
+ "see": "https://jamiemason.github.io/syncpack/config/dependency-groups/#packages",
144
+ "type": "array"
145
+ },
146
+ "specifierTypes": {
147
+ "items": {
148
+ "anyOf": [
149
+ {
150
+ "type": "string"
151
+ },
152
+ {
153
+ "enum": [
154
+ "alias",
155
+ "exact",
156
+ "file",
157
+ "git",
158
+ "latest",
159
+ "major",
160
+ "minor",
161
+ "missing",
162
+ "range",
163
+ "range-complex",
164
+ "range-major",
165
+ "range-minor",
166
+ "tag",
167
+ "unsupported",
168
+ "url",
169
+ "workspace-protocol"
170
+ ],
171
+ "type": "string"
172
+ }
173
+ ]
174
+ },
175
+ "see": "https://jamiemason.github.io/syncpack/config/dependency-groups/#specifiertypes",
176
+ "type": "array"
177
+ }
178
+ },
179
+ "required": [
180
+ "aliasName"
181
+ ],
182
+ "type": "object"
183
+ },
102
184
  "RcFile": {
103
185
  "additionalProperties": false,
104
186
  "properties": {
105
187
  "$schema": {
106
- "see": "https://jamiemason.github.io/syncpack/integrations/json-schema",
188
+ "see": "https://jamiemason.github.io/syncpack/config/syncpackrc/#json",
107
189
  "type": "string"
108
190
  },
109
191
  "customTypes": {
@@ -113,6 +195,13 @@
113
195
  "see": "https://jamiemason.github.io/syncpack/config/custom-types",
114
196
  "type": "object"
115
197
  },
198
+ "dependencyGroups": {
199
+ "items": {
200
+ "$ref": "#/definitions/DependencyGroup"
201
+ },
202
+ "see": "https://jamiemason.github.io/syncpack/config/dependency-groups",
203
+ "type": "array"
204
+ },
116
205
  "formatBugs": {
117
206
  "see": "https://jamiemason.github.io/syncpack/config/format-bugs",
118
207
  "type": "boolean"
@@ -125,11 +214,15 @@
125
214
  "see": "https://jamiemason.github.io/syncpack/config/indent",
126
215
  "type": "string"
127
216
  },
217
+ "maxConcurrentRequests": {
218
+ "see": "https://jamiemason.github.io/syncpack/config/max-concurrent-requests",
219
+ "type": "number"
220
+ },
128
221
  "semverGroups": {
129
222
  "items": {
130
223
  "$ref": "#/definitions/SemverGroup.Any"
131
224
  },
132
- "see": "https://jamiemason.github.io/syncpack/config/semver-groups",
225
+ "see": "https://jamiemason.github.io/syncpack/semver-groups",
133
226
  "type": "array"
134
227
  },
135
228
  "sortAz": {
@@ -164,11 +257,15 @@
164
257
  "see": "https://jamiemason.github.io/syncpack/config/source",
165
258
  "type": "array"
166
259
  },
260
+ "strict": {
261
+ "see": "https://jamiemason.github.io/syncpack/config/strict",
262
+ "type": "boolean"
263
+ },
167
264
  "versionGroups": {
168
265
  "items": {
169
266
  "$ref": "#/definitions/VersionGroup.Any"
170
267
  },
171
- "see": "https://jamiemason.github.io/syncpack/config/version-groups",
268
+ "see": "https://jamiemason.github.io/syncpack/version-groups",
172
269
  "type": "array"
173
270
  }
174
271
  },
@@ -191,7 +288,7 @@
191
288
  "items": {
192
289
  "type": "string"
193
290
  },
194
- "see": "https://jamiemason.github.io/syncpack/config/version-groups/standard/#dependencies",
291
+ "see": "https://jamiemason.github.io/syncpack/version-groups/highest-semver/#dependencies",
195
292
  "type": "array"
196
293
  },
197
294
  "dependencyTypes": {
@@ -214,23 +311,23 @@
214
311
  }
215
312
  ]
216
313
  },
217
- "see": "https://jamiemason.github.io/syncpack/config/version-groups/standard/#dependencytypes",
314
+ "see": "https://jamiemason.github.io/syncpack/version-groups/highest-semver/#dependencytypes",
218
315
  "type": "array"
219
316
  },
220
317
  "isIgnored": {
221
318
  "const": true,
222
- "see": "https://jamiemason.github.io/syncpack/config/semver-groups/ignored/#isignored",
319
+ "see": "https://jamiemason.github.io/syncpack/semver-groups/ignored/#isignored",
223
320
  "type": "boolean"
224
321
  },
225
322
  "label": {
226
- "see": "https://jamiemason.github.io/syncpack/config/version-groups/standard/#label",
323
+ "see": "https://jamiemason.github.io/syncpack/version-groups/highest-semver/#label",
227
324
  "type": "string"
228
325
  },
229
326
  "packages": {
230
327
  "items": {
231
328
  "type": "string"
232
329
  },
233
- "see": "https://jamiemason.github.io/syncpack/config/version-groups/standard/#packages",
330
+ "see": "https://jamiemason.github.io/syncpack/version-groups/highest-semver/#packages",
234
331
  "type": "array"
235
332
  },
236
333
  "specifierTypes": {
@@ -262,7 +359,7 @@
262
359
  }
263
360
  ]
264
361
  },
265
- "see": "https://jamiemason.github.io/syncpack/config/version-groups/standard/#specifiertypes",
362
+ "see": "https://jamiemason.github.io/syncpack/version-groups/highest-semver/#specifiertypes",
266
363
  "type": "array"
267
364
  }
268
365
  },
@@ -278,7 +375,7 @@
278
375
  "items": {
279
376
  "type": "string"
280
377
  },
281
- "see": "https://jamiemason.github.io/syncpack/config/version-groups/standard/#dependencies",
378
+ "see": "https://jamiemason.github.io/syncpack/version-groups/highest-semver/#dependencies",
282
379
  "type": "array"
283
380
  },
284
381
  "dependencyTypes": {
@@ -301,18 +398,18 @@
301
398
  }
302
399
  ]
303
400
  },
304
- "see": "https://jamiemason.github.io/syncpack/config/version-groups/standard/#dependencytypes",
401
+ "see": "https://jamiemason.github.io/syncpack/version-groups/highest-semver/#dependencytypes",
305
402
  "type": "array"
306
403
  },
307
404
  "label": {
308
- "see": "https://jamiemason.github.io/syncpack/config/version-groups/standard/#label",
405
+ "see": "https://jamiemason.github.io/syncpack/version-groups/highest-semver/#label",
309
406
  "type": "string"
310
407
  },
311
408
  "packages": {
312
409
  "items": {
313
410
  "type": "string"
314
411
  },
315
- "see": "https://jamiemason.github.io/syncpack/config/version-groups/standard/#packages",
412
+ "see": "https://jamiemason.github.io/syncpack/version-groups/highest-semver/#packages",
316
413
  "type": "array"
317
414
  },
318
415
  "range": {
@@ -327,7 +424,7 @@
327
424
  "^",
328
425
  "~"
329
426
  ],
330
- "see": "https://jamiemason.github.io/syncpack/config/semver-groups/with-range/#range",
427
+ "see": "https://jamiemason.github.io/syncpack/semver-groups/with-range/#range",
331
428
  "type": "string"
332
429
  },
333
430
  "specifierTypes": {
@@ -359,7 +456,7 @@
359
456
  }
360
457
  ]
361
458
  },
362
- "see": "https://jamiemason.github.io/syncpack/config/version-groups/standard/#specifiertypes",
459
+ "see": "https://jamiemason.github.io/syncpack/version-groups/highest-semver/#specifiertypes",
363
460
  "type": "array"
364
461
  }
365
462
  },
@@ -397,7 +494,7 @@
397
494
  "items": {
398
495
  "type": "string"
399
496
  },
400
- "see": "https://jamiemason.github.io/syncpack/config/version-groups/standard/#dependencies",
497
+ "see": "https://jamiemason.github.io/syncpack/version-groups/highest-semver/#dependencies",
401
498
  "type": "array"
402
499
  },
403
500
  "dependencyTypes": {
@@ -420,23 +517,23 @@
420
517
  }
421
518
  ]
422
519
  },
423
- "see": "https://jamiemason.github.io/syncpack/config/version-groups/standard/#dependencytypes",
520
+ "see": "https://jamiemason.github.io/syncpack/version-groups/highest-semver/#dependencytypes",
424
521
  "type": "array"
425
522
  },
426
523
  "isBanned": {
427
524
  "const": true,
428
- "see": "https://jamiemason.github.io/syncpack/config/version-groups/banned/#isbanned",
525
+ "see": "https://jamiemason.github.io/syncpack/version-groups/banned/#isbanned",
429
526
  "type": "boolean"
430
527
  },
431
528
  "label": {
432
- "see": "https://jamiemason.github.io/syncpack/config/version-groups/standard/#label",
529
+ "see": "https://jamiemason.github.io/syncpack/version-groups/highest-semver/#label",
433
530
  "type": "string"
434
531
  },
435
532
  "packages": {
436
533
  "items": {
437
534
  "type": "string"
438
535
  },
439
- "see": "https://jamiemason.github.io/syncpack/config/version-groups/standard/#packages",
536
+ "see": "https://jamiemason.github.io/syncpack/version-groups/highest-semver/#packages",
440
537
  "type": "array"
441
538
  },
442
539
  "specifierTypes": {
@@ -468,7 +565,7 @@
468
565
  }
469
566
  ]
470
567
  },
471
- "see": "https://jamiemason.github.io/syncpack/config/version-groups/standard/#specifiertypes",
568
+ "see": "https://jamiemason.github.io/syncpack/version-groups/highest-semver/#specifiertypes",
472
569
  "type": "array"
473
570
  }
474
571
  },
@@ -484,7 +581,7 @@
484
581
  "items": {
485
582
  "type": "string"
486
583
  },
487
- "see": "https://jamiemason.github.io/syncpack/config/version-groups/standard/#dependencies",
584
+ "see": "https://jamiemason.github.io/syncpack/version-groups/highest-semver/#dependencies",
488
585
  "type": "array"
489
586
  },
490
587
  "dependencyTypes": {
@@ -507,23 +604,23 @@
507
604
  }
508
605
  ]
509
606
  },
510
- "see": "https://jamiemason.github.io/syncpack/config/version-groups/standard/#dependencytypes",
607
+ "see": "https://jamiemason.github.io/syncpack/version-groups/highest-semver/#dependencytypes",
511
608
  "type": "array"
512
609
  },
513
610
  "isIgnored": {
514
611
  "const": true,
515
- "see": "https://jamiemason.github.io/syncpack/config/version-groups/ignored/#isignored",
612
+ "see": "https://jamiemason.github.io/syncpack/version-groups/ignored/#isignored",
516
613
  "type": "boolean"
517
614
  },
518
615
  "label": {
519
- "see": "https://jamiemason.github.io/syncpack/config/version-groups/standard/#label",
616
+ "see": "https://jamiemason.github.io/syncpack/version-groups/highest-semver/#label",
520
617
  "type": "string"
521
618
  },
522
619
  "packages": {
523
620
  "items": {
524
621
  "type": "string"
525
622
  },
526
- "see": "https://jamiemason.github.io/syncpack/config/version-groups/standard/#packages",
623
+ "see": "https://jamiemason.github.io/syncpack/version-groups/highest-semver/#packages",
527
624
  "type": "array"
528
625
  },
529
626
  "specifierTypes": {
@@ -555,7 +652,7 @@
555
652
  }
556
653
  ]
557
654
  },
558
- "see": "https://jamiemason.github.io/syncpack/config/version-groups/standard/#specifiertypes",
655
+ "see": "https://jamiemason.github.io/syncpack/version-groups/highest-semver/#specifiertypes",
559
656
  "type": "array"
560
657
  }
561
658
  },
@@ -571,7 +668,7 @@
571
668
  "items": {
572
669
  "type": "string"
573
670
  },
574
- "see": "https://jamiemason.github.io/syncpack/config/version-groups/standard/#dependencies",
671
+ "see": "https://jamiemason.github.io/syncpack/version-groups/highest-semver/#dependencies",
575
672
  "type": "array"
576
673
  },
577
674
  "dependencyTypes": {
@@ -594,22 +691,22 @@
594
691
  }
595
692
  ]
596
693
  },
597
- "see": "https://jamiemason.github.io/syncpack/config/version-groups/standard/#dependencytypes",
694
+ "see": "https://jamiemason.github.io/syncpack/version-groups/highest-semver/#dependencytypes",
598
695
  "type": "array"
599
696
  },
600
697
  "label": {
601
- "see": "https://jamiemason.github.io/syncpack/config/version-groups/standard/#label",
698
+ "see": "https://jamiemason.github.io/syncpack/version-groups/highest-semver/#label",
602
699
  "type": "string"
603
700
  },
604
701
  "packages": {
605
702
  "items": {
606
703
  "type": "string"
607
704
  },
608
- "see": "https://jamiemason.github.io/syncpack/config/version-groups/standard/#packages",
705
+ "see": "https://jamiemason.github.io/syncpack/version-groups/highest-semver/#packages",
609
706
  "type": "array"
610
707
  },
611
708
  "pinVersion": {
612
- "see": "https://jamiemason.github.io/syncpack/config/version-groups/pinned/#pinversion",
709
+ "see": "https://jamiemason.github.io/syncpack/version-groups/pinned/#pinversion",
613
710
  "type": "string"
614
711
  },
615
712
  "specifierTypes": {
@@ -641,7 +738,7 @@
641
738
  }
642
739
  ]
643
740
  },
644
- "see": "https://jamiemason.github.io/syncpack/config/version-groups/standard/#specifiertypes",
741
+ "see": "https://jamiemason.github.io/syncpack/version-groups/highest-semver/#specifiertypes",
645
742
  "type": "array"
646
743
  }
647
744
  },
@@ -657,7 +754,7 @@
657
754
  "items": {
658
755
  "type": "string"
659
756
  },
660
- "see": "https://jamiemason.github.io/syncpack/config/version-groups/standard/#dependencies",
757
+ "see": "https://jamiemason.github.io/syncpack/version-groups/highest-semver/#dependencies",
661
758
  "type": "array"
662
759
  },
663
760
  "dependencyTypes": {
@@ -680,23 +777,23 @@
680
777
  }
681
778
  ]
682
779
  },
683
- "see": "https://jamiemason.github.io/syncpack/config/version-groups/standard/#dependencytypes",
780
+ "see": "https://jamiemason.github.io/syncpack/version-groups/highest-semver/#dependencytypes",
684
781
  "type": "array"
685
782
  },
686
783
  "label": {
687
- "see": "https://jamiemason.github.io/syncpack/config/version-groups/standard/#label",
784
+ "see": "https://jamiemason.github.io/syncpack/version-groups/highest-semver/#label",
688
785
  "type": "string"
689
786
  },
690
787
  "packages": {
691
788
  "items": {
692
789
  "type": "string"
693
790
  },
694
- "see": "https://jamiemason.github.io/syncpack/config/version-groups/standard/#packages",
791
+ "see": "https://jamiemason.github.io/syncpack/version-groups/highest-semver/#packages",
695
792
  "type": "array"
696
793
  },
697
794
  "policy": {
698
795
  "const": "sameRange",
699
- "see": "https://jamiemason.github.io/syncpack/config/version-groups/same-range/#policy",
796
+ "see": "https://jamiemason.github.io/syncpack/version-groups/same-range/#policy",
700
797
  "type": "string"
701
798
  },
702
799
  "specifierTypes": {
@@ -728,7 +825,7 @@
728
825
  }
729
826
  ]
730
827
  },
731
- "see": "https://jamiemason.github.io/syncpack/config/version-groups/standard/#specifiertypes",
828
+ "see": "https://jamiemason.github.io/syncpack/version-groups/highest-semver/#specifiertypes",
732
829
  "type": "array"
733
830
  }
734
831
  },
@@ -744,7 +841,7 @@
744
841
  "items": {
745
842
  "type": "string"
746
843
  },
747
- "see": "https://jamiemason.github.io/syncpack/config/version-groups/standard/#dependencies",
844
+ "see": "https://jamiemason.github.io/syncpack/version-groups/highest-semver/#dependencies",
748
845
  "type": "array"
749
846
  },
750
847
  "dependencyTypes": {
@@ -767,25 +864,25 @@
767
864
  }
768
865
  ]
769
866
  },
770
- "see": "https://jamiemason.github.io/syncpack/config/version-groups/standard/#dependencytypes",
867
+ "see": "https://jamiemason.github.io/syncpack/version-groups/highest-semver/#dependencytypes",
771
868
  "type": "array"
772
869
  },
773
870
  "label": {
774
- "see": "https://jamiemason.github.io/syncpack/config/version-groups/standard/#label",
871
+ "see": "https://jamiemason.github.io/syncpack/version-groups/highest-semver/#label",
775
872
  "type": "string"
776
873
  },
777
874
  "packages": {
778
875
  "items": {
779
876
  "type": "string"
780
877
  },
781
- "see": "https://jamiemason.github.io/syncpack/config/version-groups/standard/#packages",
878
+ "see": "https://jamiemason.github.io/syncpack/version-groups/highest-semver/#packages",
782
879
  "type": "array"
783
880
  },
784
881
  "snapTo": {
785
882
  "items": {
786
883
  "type": "string"
787
884
  },
788
- "see": "https://jamiemason.github.io/syncpack/config/version-groups/snapped-to/#snapto",
885
+ "see": "https://jamiemason.github.io/syncpack/version-groups/snapped-to/#snapto",
789
886
  "type": "array"
790
887
  },
791
888
  "specifierTypes": {
@@ -817,7 +914,7 @@
817
914
  }
818
915
  ]
819
916
  },
820
- "see": "https://jamiemason.github.io/syncpack/config/version-groups/standard/#specifiertypes",
917
+ "see": "https://jamiemason.github.io/syncpack/version-groups/highest-semver/#specifiertypes",
821
918
  "type": "array"
822
919
  }
823
920
  },
@@ -833,7 +930,7 @@
833
930
  "items": {
834
931
  "type": "string"
835
932
  },
836
- "see": "https://jamiemason.github.io/syncpack/config/version-groups/standard/#dependencies",
933
+ "see": "https://jamiemason.github.io/syncpack/version-groups/highest-semver/#dependencies",
837
934
  "type": "array"
838
935
  },
839
936
  "dependencyTypes": {
@@ -856,18 +953,18 @@
856
953
  }
857
954
  ]
858
955
  },
859
- "see": "https://jamiemason.github.io/syncpack/config/version-groups/standard/#dependencytypes",
956
+ "see": "https://jamiemason.github.io/syncpack/version-groups/highest-semver/#dependencytypes",
860
957
  "type": "array"
861
958
  },
862
959
  "label": {
863
- "see": "https://jamiemason.github.io/syncpack/config/version-groups/standard/#label",
960
+ "see": "https://jamiemason.github.io/syncpack/version-groups/highest-semver/#label",
864
961
  "type": "string"
865
962
  },
866
963
  "packages": {
867
964
  "items": {
868
965
  "type": "string"
869
966
  },
870
- "see": "https://jamiemason.github.io/syncpack/config/version-groups/standard/#packages",
967
+ "see": "https://jamiemason.github.io/syncpack/version-groups/highest-semver/#packages",
871
968
  "type": "array"
872
969
  },
873
970
  "preferVersion": {
@@ -875,7 +972,7 @@
875
972
  "highestSemver",
876
973
  "lowestSemver"
877
974
  ],
878
- "see": "https://jamiemason.github.io/syncpack/config/version-groups/lowest-version/#preferversion",
975
+ "see": "https://jamiemason.github.io/syncpack/version-groups/lowest-semver/#preferversion",
879
976
  "type": "string"
880
977
  },
881
978
  "specifierTypes": {
@@ -907,7 +1004,7 @@
907
1004
  }
908
1005
  ]
909
1006
  },
910
- "see": "https://jamiemason.github.io/syncpack/config/version-groups/standard/#specifiertypes",
1007
+ "see": "https://jamiemason.github.io/syncpack/version-groups/highest-semver/#specifiertypes",
911
1008
  "type": "array"
912
1009
  }
913
1010
  },
package/syncpack.d.ts CHANGED
@@ -1,15 +1,21 @@
1
1
  export interface RcFile {
2
- /** @see https://jamiemason.github.io/syncpack/integrations/json-schema */
2
+ /** @see https://jamiemason.github.io/syncpack/config/syncpackrc/#json */
3
3
  $schema?: string;
4
4
  /** @see https://jamiemason.github.io/syncpack/config/custom-types */
5
- customTypes?: Record<string, CustomType.Any>;
5
+ customTypes?: {
6
+ [name: string]: CustomType.Any;
7
+ };
8
+ /** @see https://jamiemason.github.io/syncpack/config/dependency-groups */
9
+ dependencyGroups?: DependencyGroup[];
6
10
  /** @see https://jamiemason.github.io/syncpack/config/format-bugs */
7
11
  formatBugs?: boolean;
8
12
  /** @see https://jamiemason.github.io/syncpack/config/format-repository */
9
13
  formatRepository?: boolean;
10
14
  /** @see https://jamiemason.github.io/syncpack/config/indent */
11
15
  indent?: string;
12
- /** @see https://jamiemason.github.io/syncpack/config/semver-groups */
16
+ /** @see https://jamiemason.github.io/syncpack/config/max-concurrent-requests */
17
+ maxConcurrentRequests?: number;
18
+ /** @see https://jamiemason.github.io/syncpack/semver-groups */
13
19
  semverGroups?: SemverGroup.Any[];
14
20
  /** @see https://jamiemason.github.io/syncpack/config/sort-az */
15
21
  sortAz?: string[];
@@ -21,7 +27,9 @@ export interface RcFile {
21
27
  sortPackages?: boolean;
22
28
  /** @see https://jamiemason.github.io/syncpack/config/source */
23
29
  source?: string[];
24
- /** @see https://jamiemason.github.io/syncpack/config/version-groups */
30
+ /** @see https://jamiemason.github.io/syncpack/config/strict */
31
+ strict?: boolean;
32
+ /** @see https://jamiemason.github.io/syncpack/version-groups */
25
33
  versionGroups?: VersionGroup.Any[];
26
34
  /** @deprecated */
27
35
  dependencyTypes?: never;
@@ -36,53 +44,65 @@ export interface RcFile {
36
44
  /** @deprecated */
37
45
  specifierTypes?: never;
38
46
  }
39
- export interface DependencyGroup {
40
- /** @see https://jamiemason.github.io/syncpack/config/version-groups/standard/#dependencies */
47
+ export interface GroupSelector {
48
+ /** @see https://jamiemason.github.io/syncpack/version-groups/highest-semver/#dependencies */
41
49
  dependencies?: string[];
42
- /** @see https://jamiemason.github.io/syncpack/config/version-groups/standard/#dependencytypes */
50
+ /** @see https://jamiemason.github.io/syncpack/version-groups/highest-semver/#dependencytypes */
43
51
  dependencyTypes?: DependencyType[];
44
- /** @see https://jamiemason.github.io/syncpack/config/version-groups/standard/#label */
52
+ /** @see https://jamiemason.github.io/syncpack/version-groups/highest-semver/#label */
45
53
  label?: string;
46
- /** @see https://jamiemason.github.io/syncpack/config/version-groups/standard/#packages */
54
+ /** @see https://jamiemason.github.io/syncpack/version-groups/highest-semver/#packages */
55
+ packages?: string[];
56
+ /** @see https://jamiemason.github.io/syncpack/version-groups/highest-semver/#specifiertypes */
57
+ specifierTypes?: SpecifierType[];
58
+ }
59
+ export interface DependencyGroup {
60
+ /** @see https://jamiemason.github.io/syncpack/config/dependency-groups/#aliasname */
61
+ aliasName: string;
62
+ /** @see https://jamiemason.github.io/syncpack/config/dependency-groups/#dependencies */
63
+ dependencies?: string[];
64
+ /** @see https://jamiemason.github.io/syncpack/config/dependency-groups/#dependencytypes */
65
+ dependencyTypes?: DependencyType[];
66
+ /** @see https://jamiemason.github.io/syncpack/config/dependency-groups/#packages */
47
67
  packages?: string[];
48
- /** @see https://jamiemason.github.io/syncpack/config/version-groups/standard/#specifiertypes */
68
+ /** @see https://jamiemason.github.io/syncpack/config/dependency-groups/#specifiertypes */
49
69
  specifierTypes?: SpecifierType[];
50
70
  }
51
71
  declare namespace SemverGroup {
52
- interface Ignored extends DependencyGroup {
53
- /** @see https://jamiemason.github.io/syncpack/config/semver-groups/ignored/#isignored */
72
+ interface Ignored extends GroupSelector {
73
+ /** @see https://jamiemason.github.io/syncpack/semver-groups/ignored/#isignored */
54
74
  isIgnored: true;
55
75
  }
56
- interface WithRange extends DependencyGroup {
57
- /** @see https://jamiemason.github.io/syncpack/config/semver-groups/with-range/#range */
76
+ interface WithRange extends GroupSelector {
77
+ /** @see https://jamiemason.github.io/syncpack/semver-groups/with-range/#range */
58
78
  range: SemverRange;
59
79
  }
60
80
  type Any = Ignored | WithRange;
61
81
  }
62
82
  declare namespace VersionGroup {
63
- interface Banned extends DependencyGroup {
64
- /** @see https://jamiemason.github.io/syncpack/config/version-groups/banned/#isbanned */
83
+ interface Banned extends GroupSelector {
84
+ /** @see https://jamiemason.github.io/syncpack/version-groups/banned/#isbanned */
65
85
  isBanned: true;
66
86
  }
67
- interface Ignored extends DependencyGroup {
68
- /** @see https://jamiemason.github.io/syncpack/config/version-groups/ignored/#isignored */
87
+ interface Ignored extends GroupSelector {
88
+ /** @see https://jamiemason.github.io/syncpack/version-groups/ignored/#isignored */
69
89
  isIgnored: true;
70
90
  }
71
- interface Pinned extends DependencyGroup {
72
- /** @see https://jamiemason.github.io/syncpack/config/version-groups/pinned/#pinversion */
91
+ interface Pinned extends GroupSelector {
92
+ /** @see https://jamiemason.github.io/syncpack/version-groups/pinned/#pinversion */
73
93
  pinVersion: string;
74
94
  }
75
- interface SnappedTo extends DependencyGroup {
76
- /** @see https://jamiemason.github.io/syncpack/config/version-groups/snapped-to/#snapto */
95
+ interface SnappedTo extends GroupSelector {
96
+ /** @see https://jamiemason.github.io/syncpack/version-groups/snapped-to/#snapto */
77
97
  snapTo: string[];
78
98
  }
79
- interface SameRange extends DependencyGroup {
80
- /** @see https://jamiemason.github.io/syncpack/config/version-groups/same-range/#policy */
81
- policy: "sameRange";
99
+ interface SameRange extends GroupSelector {
100
+ /** @see https://jamiemason.github.io/syncpack/version-groups/same-range/#policy */
101
+ policy: 'sameRange';
82
102
  }
83
- interface Standard extends DependencyGroup {
84
- /** @see https://jamiemason.github.io/syncpack/config/version-groups/lowest-version/#preferversion */
85
- preferVersion?: "highestSemver" | "lowestSemver";
103
+ interface Standard extends GroupSelector {
104
+ /** @see https://jamiemason.github.io/syncpack/version-groups/lowest-semver/#preferversion */
105
+ preferVersion?: 'highestSemver' | 'lowestSemver';
86
106
  }
87
107
  type Any = Banned | Ignored | Pinned | SameRange | SnappedTo | Standard;
88
108
  }
@@ -93,30 +113,52 @@ declare namespace CustomType {
93
113
  /** @see https://jamiemason.github.io/syncpack/config/custom-types/#name */
94
114
  path: string;
95
115
  /** @see https://jamiemason.github.io/syncpack/config/custom-types/#namestrategy */
96
- strategy: "name~version";
116
+ strategy: 'name~version';
97
117
  }
98
118
  interface NamedVersionString {
99
119
  /** @see https://jamiemason.github.io/syncpack/config/custom-types/#name */
100
120
  path: string;
101
121
  /** @see https://jamiemason.github.io/syncpack/config/custom-types/#namestrategy */
102
- strategy: "name@version";
122
+ strategy: 'name@version';
103
123
  }
104
124
  interface UnnamedVersionString {
105
125
  /** @see https://jamiemason.github.io/syncpack/config/custom-types/#name */
106
126
  path: string;
107
127
  /** @see https://jamiemason.github.io/syncpack/config/custom-types/#namestrategy */
108
- strategy: "version";
128
+ strategy: 'version';
109
129
  }
110
130
  interface VersionsByName {
111
131
  /** @see https://jamiemason.github.io/syncpack/config/custom-types/#name */
112
132
  path: string;
113
133
  /** @see https://jamiemason.github.io/syncpack/config/custom-types/#namestrategy */
114
- strategy: "versionsByName";
134
+ strategy: 'versionsByName';
115
135
  }
116
136
  type Any = NameAndVersionProps | NamedVersionString | UnnamedVersionString | VersionsByName;
117
137
  }
118
- type SemverRange = "" | "*" | ">" | ">=" | ".x" | "<" | "<=" | "^" | "~";
119
- type DependencyType = "dev" | "local" | "overrides" | "peer" | "pnpmOverrides" | "prod" | "resolutions" | AnyString;
120
- type SpecifierType = "alias" | "exact" | "file" | "git" | "latest" | "major" | "minor" | "missing" | "range" | "range-complex" | "range-major" | "range-minor" | "tag" | "unsupported" | "url" | "workspace-protocol" | AnyString;
138
+ type SemverRange = '' | '*' | '>' | '>=' | '.x' | '<' | '<=' | '^' | '~';
139
+ type DependencyType = 'dev' | 'local' | 'overrides' | 'peer' | 'pnpmOverrides' | 'prod' | 'resolutions' | AnyString;
140
+ type SpecifierType = 'alias' | 'exact' | 'file' | 'git' | 'latest' | 'major' | 'minor' | 'missing' | 'range' | 'range-complex' | 'range-major' | 'range-minor' | 'tag' | 'unsupported' | 'url' | 'workspace-protocol' | AnyString;
121
141
  type AnyString = string & {};
142
+ /** Each Instance printed by `syncpack json` */
143
+ export type JsonOutput = {
144
+ dependency: string;
145
+ dependencyGroup: string;
146
+ dependencyType: DependencyType;
147
+ package: string;
148
+ property: ['dependencies'];
149
+ strategy: CustomType.Any['strategy'];
150
+ versionGroup: VersionGroupVariant;
151
+ preferredSemverRange: SemverRange | null;
152
+ statusCode: StatusCode;
153
+ actual: {
154
+ raw: string;
155
+ type: SpecifierType;
156
+ };
157
+ expected: {
158
+ raw: string;
159
+ type: SpecifierType;
160
+ } | null;
161
+ };
162
+ export type VersionGroupVariant = 'Banned' | 'HighestSemver' | 'Ignored' | 'LowestSemver' | 'Pinned' | 'SameRange' | 'SnappedTo';
163
+ export type StatusCode = 'IsHighestOrLowestSemver' | 'IsIdenticalToLocal' | 'IsIdenticalToPin' | 'IsIdenticalToSnapTarget' | 'IsIgnored' | 'IsLocalAndValid' | 'IsNonSemverButIdentical' | 'SatisfiesHighestOrLowestSemver' | 'SatisfiesLocal' | 'SatisfiesSameRangeGroup' | 'SatisfiesSnapTarget' | 'DiffersToHighestOrLowestSemver' | 'DiffersToLocal' | 'DiffersToNpmRegistry' | 'DiffersToPin' | 'DiffersToSnapTarget' | 'IsBanned' | 'PinOverridesSemverRange' | 'PinOverridesSemverRangeMismatch' | 'SemverRangeMismatch' | 'DependsOnInvalidLocalPackage' | 'NonSemverMismatch' | 'SameRangeMismatch' | 'DependsOnMissingSnapTarget' | 'InvalidLocalVersion' | 'RefuseToBanLocal' | 'RefuseToPinLocal' | 'RefuseToSnapLocal' | 'MatchConflictsWithHighestOrLowestSemver' | 'MatchConflictsWithLocal' | 'MatchConflictsWithSnapTarget' | 'MismatchConflictsWithHighestOrLowestSemver' | 'MismatchConflictsWithLocal' | 'MismatchConflictsWithSnapTarget';
122
164
  export {};
package/index.js DELETED
@@ -1,48 +0,0 @@
1
- #!/usr/bin/env node
2
-
3
- const { spawnSync } = require("child_process");
4
- const { cosmiconfig } = require("cosmiconfig");
5
-
6
- const args = process.argv.slice(2);
7
- const arch = process.arch;
8
- const [os, extension] = ["win32", "cygwin"].includes(process.platform)
9
- ? ["windows", ".exe"]
10
- : [process.platform, ""];
11
- const optionalDep = `syncpack-${os}-${arch}`;
12
- const pkgSpecifier = `${optionalDep}/bin/syncpack${extension}`;
13
-
14
- cosmiconfig("syncpack")
15
- .search()
16
- .then(({ config }) => (config ? JSON.stringify(config) : "{}"))
17
- .catch(() => "{}")
18
- .then((rcfileAsJson) => ({
19
- pathToBinary: require.resolve(pkgSpecifier),
20
- rcfileAsJson,
21
- }))
22
- .catch((err) => {
23
- panic(
24
- `expected optionalDependency "${optionalDep}" containing a Rust binary at "${pkgSpecifier}"`,
25
- err
26
- );
27
- })
28
- .then(({ pathToBinary, rcfileAsJson }) => {
29
- process.exit(
30
- spawnSync(pathToBinary, args, {
31
- input: rcfileAsJson,
32
- stdio: ["pipe", "inherit", "inherit"],
33
- }).status ?? 0
34
- );
35
- })
36
- .catch((err) => {
37
- panic("syncpack encountered an unknown error", err);
38
- });
39
-
40
- function panic(message, err) {
41
- console.error(
42
- "\x1b[31m%s\n%s\x1b[0m",
43
- `! ${message}`,
44
- " Please raise issue at https://github.com/JamieMason/syncpack/issues/new?template=bug_report.yaml",
45
- err
46
- );
47
- process.exit(1);
48
- }