rman 2.18.0 → 2.18.2
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.
|
@@ -83,7 +83,8 @@ const config = {
|
|
|
83
83
|
target: 'both',
|
|
84
84
|
describe: 'Make the bump a prerelease with this identifier (e.g. "beta" -> 1.2.3-beta.0). ' +
|
|
85
85
|
'Running again with the same --preid increments it (-> 1.2.3-beta.1); a different ' +
|
|
86
|
-
'identifier
|
|
86
|
+
'identifier keeps the version when it already holds the change (2.19.0-alpha.1 -> ' +
|
|
87
|
+
'2.19.0-beta.0). Ignored when bump is an explicit version. ' +
|
|
87
88
|
'Default: .rmanrc "version.preid", which every member of a group has to agree on.',
|
|
88
89
|
type: 'string',
|
|
89
90
|
},
|
package/constants.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const version = '2.18.
|
|
1
|
+
export const version = '2.18.2';
|
|
@@ -133,6 +133,12 @@ export declare class SemverScheme extends VersionScheme {
|
|
|
133
133
|
* inventing one. Same answer for a release, which has no prerelease at all.
|
|
134
134
|
*/
|
|
135
135
|
prereleaseId(version: string): string | undefined;
|
|
136
|
+
/**
|
|
137
|
+
* Whether the release a prerelease of `version` leads to already holds a change of size `bump` -
|
|
138
|
+
* `X.Y.0` a minor, `X.0.0` a major, and anything a patch. The rule `semver.inc` itself applies:
|
|
139
|
+
* `minor` on `2.19.0-alpha.1` is `2.19.0`, not `2.20.0`.
|
|
140
|
+
*/
|
|
141
|
+
protected coversBump(version: string, bump: string): boolean;
|
|
136
142
|
}
|
|
137
143
|
/**
|
|
138
144
|
* The default, and what every package gets unless something says otherwise - so nothing about
|
|
@@ -128,8 +128,18 @@ export class SemverScheme extends VersionScheme {
|
|
|
128
128
|
*/
|
|
129
129
|
const existing = semver.prerelease(current);
|
|
130
130
|
const sameLine = existing && String(existing[0]) === preid;
|
|
131
|
-
|
|
132
|
-
|
|
131
|
+
if (sameLine)
|
|
132
|
+
return semver.inc(current, 'prerelease', preid) ?? current;
|
|
133
|
+
/**
|
|
134
|
+
* **A prerelease moving to another identifier keeps its version when that version already
|
|
135
|
+
* holds the change** - `2.19.0-alpha.1` -> `2.19.0-beta.0` for a fix or a feature, since
|
|
136
|
+
* `2.19.0` is a minor's target already. It moves on only when the change needs more than the
|
|
137
|
+
* target gives: a breaking change on `2.19.0-alpha.1` is `3.0.0-beta.0`.
|
|
138
|
+
*/
|
|
139
|
+
if (existing && this.coversBump(current, bump)) {
|
|
140
|
+
return `${semver.major(current)}.${semver.minor(current)}.${semver.patch(current)}-${preid}.0`;
|
|
141
|
+
}
|
|
142
|
+
return semver.inc(current, `pre${releaseType}`, preid) ?? current;
|
|
133
143
|
}
|
|
134
144
|
isPrerelease(version) {
|
|
135
145
|
return !!semver.prerelease(version);
|
|
@@ -145,6 +155,22 @@ export class SemverScheme extends VersionScheme {
|
|
|
145
155
|
const first = semver.prerelease(version)?.[0];
|
|
146
156
|
return typeof first === 'string' ? first : undefined;
|
|
147
157
|
}
|
|
158
|
+
/**
|
|
159
|
+
* Whether the release a prerelease of `version` leads to already holds a change of size `bump` -
|
|
160
|
+
* `X.Y.0` a minor, `X.0.0` a major, and anything a patch. The rule `semver.inc` itself applies:
|
|
161
|
+
* `minor` on `2.19.0-alpha.1` is `2.19.0`, not `2.20.0`.
|
|
162
|
+
*/
|
|
163
|
+
/* **Only consulted when the identifier changes.** On the same identifier the counter advances
|
|
164
|
+
* whatever the size - a permanent `-rev.N` line (`version.preid: rev`) counts revisions of one
|
|
165
|
+
* upstream version, so a feature there is `rev.9`, not a new base. That is a statement about the
|
|
166
|
+
* line, and changing it would move `panates/browsery` off the version it wraps. */
|
|
167
|
+
coversBump(version, bump) {
|
|
168
|
+
if (bump === 'major')
|
|
169
|
+
return semver.minor(version) === 0 && semver.patch(version) === 0;
|
|
170
|
+
if (bump === 'minor')
|
|
171
|
+
return semver.patch(version) === 0;
|
|
172
|
+
return true;
|
|
173
|
+
}
|
|
148
174
|
}
|
|
149
175
|
/**
|
|
150
176
|
* The default, and what every package gets unless something says otherwise - so nothing about
|
|
@@ -114,6 +114,15 @@ origin) {
|
|
|
114
114
|
`\`${plain}: ({ value }) => [...value, 'x']\`, or \`"\${{ [...value, 'x'] }}"\` in YAML. ` +
|
|
115
115
|
`\`value\` is the layers below this one, and spreads as empty when there are none.`);
|
|
116
116
|
}
|
|
117
|
+
/**
|
|
118
|
+
* **An empty key says nothing**, so what the layers below said stands. In YAML a key with
|
|
119
|
+
* nothing after it - `run:` - is `null`, and replacing with it erased the inherited value whole.
|
|
120
|
+
* Measured on `abisena/syncbridge-iomt`: an empty `run:` under `"[*]"` wiped the shared preset's
|
|
121
|
+
* entire `run` block, and `rman build` answered `No package defines a "build" script.`
|
|
122
|
+
* Nothing in rman uses `null` to unset a key, so there is no meaning to lose.
|
|
123
|
+
*/
|
|
124
|
+
if (value === null || value === undefined)
|
|
125
|
+
continue;
|
|
117
126
|
/** `plugins`/`commands`/`publishTargets`: additive at every layer, so the closer one adds
|
|
118
127
|
* rather than takes over. A glob among them is anchored to its own file on the way in - see
|
|
119
128
|
* `anchorContributions`. */
|