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
Discourage postponing release of changed packages (#29)
When the tool generates a release spec, it will list all packages that
have changed since their last release. Editing the release spec to
remove a package so that it is no longer included in the release is
potentially dangerous, because it means that any package which relies on
that package that *is* included in the release could be broken in
production.
Since it's sometimes necessary to delay the release of a package, this
commit changes the release spec validation step such that if it detects
that a package that should be listed in the release spec *isn't*, it
will throw an error, advising the user of the danger, yet provide a
hidden option should the user really want to proceed.
Co-authored-by: Mark Stacey <[email protected]>
it('errors before making any changes if the edited release spec omits changed packages',async()=>{
277
+
awaitwithMonorepoProjectEnvironment(
278
+
{
279
+
packages: {
280
+
$root$: {
281
+
name: '@scope/monorepo',
282
+
version: '1.0.0',
283
+
directoryPath: '.',
284
+
},
285
+
a: {
286
+
name: '@scope/a',
287
+
version: '0.1.2',
288
+
directoryPath: 'packages/a',
289
+
},
290
+
b: {
291
+
name: '@scope/b',
292
+
version: '1.1.4',
293
+
directoryPath: 'packages/b',
294
+
},
295
+
c: {
296
+
name: '@scope/c',
297
+
version: '2.0.13',
298
+
directoryPath: 'packages/c',
299
+
},
300
+
d: {
301
+
name: '@scope/d',
302
+
version: '1.2.3',
303
+
directoryPath: 'packages/d',
304
+
},
305
+
},
306
+
workspaces: {
307
+
'.': ['packages/*'],
308
+
},
309
+
},
310
+
async(environment)=>{
311
+
awaitexpect(
312
+
environment.runTool({
313
+
releaseSpecification: {
314
+
packages: {
315
+
a: 'major',
316
+
c: 'patch',
317
+
},
318
+
},
319
+
}),
320
+
).toThrowExecaError(
321
+
`
322
+
Error: Your release spec could not be processed due to the following issues:
323
+
324
+
* The following packages, which have changed since their latest release, are missing.
325
+
326
+
- @scope/b
327
+
- @scope/d
328
+
329
+
Consider including them in the release spec so that any packages that rely on them won't break in production.
330
+
331
+
If you are ABSOLUTELY SURE that this won't occur, however, and want to postpone the release of a package, then list it with a directive of "intentionally-skip". For example:
332
+
333
+
packages:
334
+
"@scope/b": intentionally-skip
335
+
"@scope/d": intentionally-skip
336
+
337
+
The release spec file has been retained for you to edit again and make the necessary fixes. Once you've done this, re-run this tool.
0 commit comments