@ckeditor/ckeditor5-dev-release-tools 54.4.0 → 54.6.0

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
@@ -2,7 +2,7 @@ CKEditor 5 release tools
2
2
  ========================
3
3
 
4
4
  [![npm version](https://badge.fury.io/js/%40ckeditor%2Fckeditor5-dev-release-tools.svg)](https://www.npmjs.com/package/@ckeditor/ckeditor5-dev-release-tools)
5
- [![CircleCI](https://circleci.com/gh/ckeditor/ckeditor5-dev.svg?style=shield)](https://app.circleci.com/pipelines/github/ckeditor/ckeditor5-dev?branch=master)
5
+ [![CircleCI](https://circleci.com/gh/ckeditor/ckeditor5-dev.svg?style=shield)](https://app.circleci.com/pipelines/github/ckeditor/ckeditor5-dev?branch=master-v54)
6
6
 
7
7
  Contains tools used during a release of [CKEditor 5](https://ckeditor.com) and related packages.
8
8
 
@@ -37,6 +37,7 @@ import { workspaces, npm } from '@ckeditor/ckeditor5-dev-utils';
37
37
  * @param {ListrTaskObject} [options.listrTask] An instance of `ListrTask`.
38
38
  * @param {AbortSignal|null} [options.signal=null] Signal to abort the asynchronous process.
39
39
  * @param {string} [options.npmTag='staging'] The npm distribution tag.
40
+ * @param {boolean} [options.disallowLatestNpmTag=false] Whether to disallow publishing packages using the `latest` npm distribution tag.
40
41
  * @param {Object.<string, Array.<string>>|null} [options.optionalEntries=null] Specifies which entries from the `files` field in the
41
42
  * `package.json` are optional. The key is a package name, and its value is an array of optional entries from the `files` field, for which
42
43
  * it is allowed not to match any file. The `options.optionalEntries` object may also contain the `default` key, which is used for all
@@ -59,6 +60,7 @@ export default async function publishPackages( options ) {
59
60
  listrTask,
60
61
  signal = null,
61
62
  npmTag = 'staging',
63
+ disallowLatestNpmTag = false,
62
64
  optionalEntries = null,
63
65
  confirmationCallback = null,
64
66
  requireEntryPoint = false,
@@ -94,7 +96,7 @@ export default async function publishPackages( options ) {
94
96
 
95
97
  await assertPackages( packagesToProcess, { requireEntryPoint, optionalEntryPointPackages } );
96
98
  await assertFilesToPublish( packagesToProcess, optionalEntries );
97
- await assertNpmTag( packagesToProcess, npmTag );
99
+ await assertNpmTag( packagesToProcess, npmTag, { disallowLatestNpmTag } );
98
100
 
99
101
  const shouldPublishPackages = confirmationCallback ? await confirmationCallback() : true;
100
102
 
@@ -19,11 +19,18 @@ const ALLOWED_NPM_LATEST_TAGS = [
19
19
  *
20
20
  * @param {Array.<string>} packagePaths
21
21
  * @param {string} npmTag
22
+ * @param {object} [options={}]
23
+ * @param {boolean} [options.disallowLatestNpmTag=false] Whether to disallow publishing packages using the `latest` npm distribution tag.
22
24
  * @returns {Promise}
23
25
  */
24
- export default async function assertNpmTag( packagePaths, npmTag ) {
26
+ export default async function assertNpmTag( packagePaths, npmTag, options = {} ) {
27
+ const { disallowLatestNpmTag = false } = options;
25
28
  const errors = [];
26
29
 
30
+ if ( disallowLatestNpmTag && npmTag === 'latest' ) {
31
+ throw new Error( 'Publishing with the npm tag "latest" is disallowed.' );
32
+ }
33
+
27
34
  for ( const packagePath of packagePaths ) {
28
35
  const path = upath.join( packagePath, 'package.json' );
29
36
  const file = await fs.readFile( path, 'utf-8' );
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ckeditor/ckeditor5-dev-release-tools",
3
- "version": "54.4.0",
3
+ "version": "54.6.0",
4
4
  "description": "Tools used for releasing CKEditor 5 and related packages.",
5
5
  "keywords": [],
6
6
  "author": "CKSource (http://cksource.com/)",
@@ -22,7 +22,7 @@
22
22
  "lib"
23
23
  ],
24
24
  "dependencies": {
25
- "@ckeditor/ckeditor5-dev-utils": "^54.4.0",
25
+ "@ckeditor/ckeditor5-dev-utils": "^54.6.0",
26
26
  "@octokit/rest": "^22.0.0",
27
27
  "cli-columns": "^4.0.0",
28
28
  "glob": "^13.0.0",