@ckeditor/ckeditor5-dev-release-tools 38.2.0 → 38.2.1
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/lib/tasks/cleanuppackages.js +17 -3
- package/package.json +2 -2
|
@@ -23,7 +23,8 @@ const { glob } = require( 'glob' );
|
|
|
23
23
|
*
|
|
24
24
|
* @param {Object} options
|
|
25
25
|
* @param {String} options.packagesDirectory Relative path to a location of packages to be cleaned up.
|
|
26
|
-
* @param {Array.<String
|
|
26
|
+
* @param {Array.<String>|PackageJsonFieldsToRemoveCallback} [options.packageJsonFieldsToRemove] Fields to remove from `package.json`.
|
|
27
|
+
* If not set, a predefined list is used. If the callback is used, the first argument is the list with defaults.
|
|
27
28
|
* @param {Boolean} [options.preservePostInstallHook] Whether to preserve the postinstall hook in `package.json`.
|
|
28
29
|
* @param {String} [options.cwd] Current working directory from which all paths will be resolved.
|
|
29
30
|
* @returns {Promise}
|
|
@@ -53,15 +54,18 @@ module.exports = async function cleanUpPackages( options ) {
|
|
|
53
54
|
*
|
|
54
55
|
* @param {Object} options
|
|
55
56
|
* @param {String} options.packagesDirectory
|
|
56
|
-
* @param {Array.<String
|
|
57
|
+
* @param {Array.<String>|PackageJsonFieldsToRemoveCallback} [options.packageJsonFieldsToRemove=DefaultFieldsToRemove]
|
|
57
58
|
* @param {Boolean} [options.preservePostInstallHook]
|
|
58
59
|
* @param {String} [options.cwd=process.cwd()]
|
|
59
60
|
* @returns {Object}
|
|
60
61
|
*/
|
|
61
62
|
function parseOptions( options ) {
|
|
63
|
+
const defaultPackageJsonFieldsToRemove = [ 'devDependencies', 'depcheckIgnore', 'scripts', 'private' ];
|
|
64
|
+
const packageJsonFieldsToRemove = typeof options.packageJsonFieldsToRemove === 'function' ?
|
|
65
|
+
options.packageJsonFieldsToRemove( defaultPackageJsonFieldsToRemove ) :
|
|
66
|
+
options.packageJsonFieldsToRemove || defaultPackageJsonFieldsToRemove;
|
|
62
67
|
const {
|
|
63
68
|
packagesDirectory,
|
|
64
|
-
packageJsonFieldsToRemove = [ 'devDependencies', 'depcheckIgnore', 'scripts', 'private' ],
|
|
65
69
|
preservePostInstallHook = false,
|
|
66
70
|
cwd = process.cwd()
|
|
67
71
|
} = options;
|
|
@@ -184,3 +188,13 @@ function sortPathsFromDeepestFirst( firstPath, secondPath ) {
|
|
|
184
188
|
|
|
185
189
|
return secondPathSegments - firstPathSegments;
|
|
186
190
|
}
|
|
191
|
+
|
|
192
|
+
/**
|
|
193
|
+
* @typedef {['devDependencies','depcheckIgnore','scripts','private']} DefaultFieldsToRemove
|
|
194
|
+
*/
|
|
195
|
+
|
|
196
|
+
/**
|
|
197
|
+
* @callback PackageJsonFieldsToRemoveCallback
|
|
198
|
+
* @param {DefaultFieldsToRemove} defaults
|
|
199
|
+
* @returns {Array.<String>}
|
|
200
|
+
*/
|
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ckeditor/ckeditor5-dev-release-tools",
|
|
3
|
-
"version": "38.2.
|
|
3
|
+
"version": "38.2.1",
|
|
4
4
|
"description": "Tools used for releasing CKEditor 5 and related packages.",
|
|
5
5
|
"keywords": [],
|
|
6
6
|
"main": "lib/index.js",
|
|
7
7
|
"dependencies": {
|
|
8
|
-
"@ckeditor/ckeditor5-dev-utils": "^38.2.
|
|
8
|
+
"@ckeditor/ckeditor5-dev-utils": "^38.2.1",
|
|
9
9
|
"@octokit/rest": "^19.0.0",
|
|
10
10
|
"chalk": "^4.0.0",
|
|
11
11
|
"cli-table": "^0.3.1",
|