You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Pick a strategy below based on the shape of your data.
57
57
58
-
The key of each custom type is its name, this is equivalent to the default names such as `prod` and `dev` and can be used in all of the same places those can:
58
+
## `name@version`
59
+
60
+
A single string combining name and version, separated by `@`.
The name of the new dependency type you are adding to syncpack. Syncpack ships with built-in types like `prod`, `dev`, and `peer`; defining a custom type adds your chosen name to that list, ready to be referenced from:
The location in each package.json of the `"name@version"` string. Use dot notation for nested properties (eg. `packageManager`, `some.nested.property`).
70
91
71
-
A strategy defines how syncpack should read and write dependency names and versions.
The name and version are combined in a single string. Commonly seen in package manager specifications.
98
+
The name and version live at two separate paths. Both must point directly to **string** values, not to a containing object.
78
99
79
100
```json title="package.json"
80
101
{
81
-
"packageManager": "pnpm@7.27.0"
102
+
"devEngines": {
103
+
"runtime": {
104
+
"name": "node",
105
+
"version": "22.11.0"
106
+
}
107
+
}
82
108
}
83
109
```
84
110
85
-
### `name~version`
111
+
```json title=".syncpackrc.json"
112
+
{
113
+
"customTypes": {
114
+
"devEnginesRuntime": {
115
+
"strategy": "name~version",
116
+
"namePath": "devEngines.runtime.name",
117
+
"path": "devEngines.runtime.version"
118
+
}
119
+
}
120
+
}
121
+
```
122
+
123
+
A common mistake is pointing `path` at the containing object (`devEngines.runtime`) and `namePath` at `name` relative to it. Both paths are absolute from the package.json root and must resolve to strings.
The name of the new dependency type you are adding to syncpack. Syncpack ships with built-in types like `prod`, `dev`, and `peer`; defining a custom type adds your chosen name to that list, ready to be referenced from:
The name of the new dependency type you are adding to syncpack. Syncpack ships with built-in types like `prod`, `dev`, and `peer`; defining a custom type adds your chosen name to that list, ready to be referenced from:
174
+
175
+
1.`--dependency-types`
176
+
1.`versionGroup.dependencyTypes`
177
+
1.`semverGroup.dependencyTypes`
178
+
1.`dependencyGroup.dependencyTypes`
179
+
180
+
For the `version` strategy specifically, this name is also used as the dependency name in reports and grouping (since the data has no name field of its own).
The name of the new dependency type you are adding to syncpack. Syncpack ships with built-in types like `prod`, `dev`, and `peer`; defining a custom type adds your chosen name to that list, ready to be referenced from:
The location in each package.json of the `{ "name": "version" }` object. Use dot notation for nested properties (eg. `dependencies`, `pnpm.overrides`).
0 commit comments