@ckeditor/ckeditor5-dev-release-tools 54.2.2 → 54.3.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/LICENSE.md +1 -1
- package/lib/index.js +1 -1
- package/lib/tasks/cleanuppackages.js +1 -1
- package/lib/tasks/commitandtag.js +1 -1
- package/lib/tasks/creategithubrelease.js +1 -1
- package/lib/tasks/preparerepository.js +32 -22
- package/lib/tasks/publishpackages.js +1 -1
- package/lib/tasks/push.js +1 -1
- package/lib/tasks/reassignnpmtags.js +1 -1
- package/lib/tasks/updatedependencies.js +1 -1
- package/lib/tasks/updateversions.js +1 -1
- package/lib/utils/abortcontroller.js +1 -1
- package/lib/utils/assertfilestopublish.js +1 -1
- package/lib/utils/assertnpmauthorization.js +1 -1
- package/lib/utils/assertnpmtag.js +1 -1
- package/lib/utils/assertpackages.js +1 -1
- package/lib/utils/configurereleaseoptions.js +1 -1
- package/lib/utils/confirmincludingpackage.js +1 -1
- package/lib/utils/confirmnpmtag.js +1 -1
- package/lib/utils/constants.js +1 -1
- package/lib/utils/executeinparallel.js +1 -1
- package/lib/utils/getchangelog.js +1 -1
- package/lib/utils/getchangesforversion.js +1 -1
- package/lib/utils/getnpmtagfromversion.js +1 -1
- package/lib/utils/parallelworker.js +1 -1
- package/lib/utils/providetoken.js +1 -1
- package/lib/utils/publishpackageonnpmcallback.js +1 -1
- package/lib/utils/resolvepublishoverrides.js +36 -0
- package/lib/utils/validaterepositorytorelease.js +1 -1
- package/lib/utils/versions.js +1 -1
- package/package.json +2 -2
package/LICENSE.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
Software License Agreement
|
|
2
2
|
==========================
|
|
3
3
|
|
|
4
|
-
Copyright (c) 2003-
|
|
4
|
+
Copyright (c) 2003-2026, [CKSource](http://cksource.com) Holding sp. z o.o. All rights reserved.
|
|
5
5
|
|
|
6
6
|
Licensed under the terms of [GNU General Public License Version 2 or later](http://www.gnu.org/licenses/gpl.html).
|
|
7
7
|
|
package/lib/index.js
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Copyright (c) 2003-
|
|
2
|
+
* @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
3
|
* For licensing, see LICENSE.md.
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
import fs from 'node:fs/promises';
|
|
7
7
|
import { glob } from 'glob';
|
|
8
8
|
import upath from 'upath';
|
|
9
|
+
import resolvePublishOverrides from '../utils/resolvepublishoverrides.js';
|
|
9
10
|
|
|
10
11
|
/**
|
|
11
12
|
* The goal is to prepare the release directory containing the packages we want to publish.
|
|
@@ -42,32 +43,36 @@ export default async function prepareRepository( options ) {
|
|
|
42
43
|
throw new Error( `Output directory is not empty: "${ outputDirectoryPath }".` );
|
|
43
44
|
}
|
|
44
45
|
|
|
45
|
-
const copyPromises = [];
|
|
46
|
-
|
|
47
46
|
if ( rootPackageJson ) {
|
|
48
47
|
validateRootPackage( rootPackageJson );
|
|
49
48
|
|
|
50
|
-
|
|
49
|
+
await processRootPackage( {
|
|
51
50
|
cwd,
|
|
52
51
|
rootPackageJson,
|
|
53
52
|
outputDirectoryPath
|
|
54
53
|
} );
|
|
55
|
-
|
|
56
|
-
copyPromises.push( ...copyRootItemsPromises );
|
|
57
54
|
}
|
|
58
55
|
|
|
59
56
|
if ( packagesDirectory ) {
|
|
60
|
-
|
|
57
|
+
await processMonorepoPackages( {
|
|
61
58
|
cwd,
|
|
62
59
|
packagesDirectory,
|
|
63
60
|
packagesToCopy,
|
|
64
61
|
outputDirectoryPath
|
|
65
62
|
} );
|
|
63
|
+
}
|
|
66
64
|
|
|
67
|
-
|
|
65
|
+
const packageJsonPaths = await glob( '*/package.json', {
|
|
66
|
+
cwd: outputDirectoryPath,
|
|
67
|
+
absolute: true,
|
|
68
|
+
nodir: true
|
|
69
|
+
} );
|
|
70
|
+
|
|
71
|
+
for ( const packageJsonPath of packageJsonPaths ) {
|
|
72
|
+
await resolvePublishOverrides( packageJsonPath );
|
|
68
73
|
}
|
|
69
74
|
|
|
70
|
-
return Promise.
|
|
75
|
+
return Promise.resolve();
|
|
71
76
|
}
|
|
72
77
|
|
|
73
78
|
/**
|
|
@@ -90,7 +95,7 @@ function validateRootPackage( packageJson ) {
|
|
|
90
95
|
* @param {string} options.cwd
|
|
91
96
|
* @param {RootPackageJson} options.rootPackageJson
|
|
92
97
|
* @param {string} options.outputDirectoryPath
|
|
93
|
-
* @returns {Promise}
|
|
98
|
+
* @returns {Promise.<void>}
|
|
94
99
|
*/
|
|
95
100
|
async function processRootPackage( { cwd, rootPackageJson, outputDirectoryPath } ) {
|
|
96
101
|
const rootPackageDirName = rootPackageJson.name.replace( /^@.*\//, '' );
|
|
@@ -100,13 +105,16 @@ async function processRootPackage( { cwd, rootPackageJson, outputDirectoryPath }
|
|
|
100
105
|
await fs.mkdir( rootPackageOutputPath, { recursive: true } );
|
|
101
106
|
await fs.writeFile( pkgJsonOutputPath, JSON.stringify( rootPackageJson, null, 2 ) + '\n' );
|
|
102
107
|
|
|
103
|
-
|
|
104
|
-
.map( absoluteFilePath => {
|
|
105
|
-
const relativeFilePath = upath.relative( cwd, absoluteFilePath );
|
|
106
|
-
const absoluteFileOutputPath = upath.join( rootPackageOutputPath, relativeFilePath );
|
|
108
|
+
const filesToCopy = await glob( rootPackageJson.files, { cwd, absolute: true } );
|
|
107
109
|
|
|
108
|
-
|
|
109
|
-
|
|
110
|
+
for ( const absoluteFilePath of filesToCopy ) {
|
|
111
|
+
const relativeFilePath = upath.relative( cwd, absoluteFilePath );
|
|
112
|
+
const absoluteFileOutputPath = upath.join( rootPackageOutputPath, relativeFilePath );
|
|
113
|
+
|
|
114
|
+
await fs.cp( absoluteFilePath, absoluteFileOutputPath, { recursive: true } );
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
return Promise.resolve();
|
|
110
118
|
}
|
|
111
119
|
|
|
112
120
|
/**
|
|
@@ -115,29 +123,31 @@ async function processRootPackage( { cwd, rootPackageJson, outputDirectoryPath }
|
|
|
115
123
|
* @param {string} options.packagesDirectory
|
|
116
124
|
* @param {string} options.outputDirectoryPath
|
|
117
125
|
* @param {Array.<string>} [options.packagesToCopy]
|
|
118
|
-
* @returns {Promise}
|
|
126
|
+
* @returns {Promise.<void>}
|
|
119
127
|
*/
|
|
120
128
|
async function processMonorepoPackages( { cwd, packagesDirectory, packagesToCopy, outputDirectoryPath } ) {
|
|
121
129
|
const packagesDirectoryPath = upath.join( cwd, packagesDirectory );
|
|
122
130
|
const packageDirs = packagesToCopy || await fs.readdir( packagesDirectoryPath );
|
|
123
131
|
|
|
124
|
-
|
|
132
|
+
for ( const packageDir of packageDirs ) {
|
|
125
133
|
const packagePath = upath.join( packagesDirectoryPath, packageDir );
|
|
126
134
|
const isDir = ( await fs.lstat( packagePath ) ).isDirectory();
|
|
127
135
|
|
|
128
136
|
if ( !isDir ) {
|
|
129
|
-
|
|
137
|
+
continue;
|
|
130
138
|
}
|
|
131
139
|
|
|
132
140
|
const pkgJsonPath = upath.join( packagePath, 'package.json' );
|
|
133
141
|
const hasPkgJson = await fs.access( pkgJsonPath ).then( () => true, () => false );
|
|
134
142
|
|
|
135
143
|
if ( !hasPkgJson ) {
|
|
136
|
-
|
|
144
|
+
continue;
|
|
137
145
|
}
|
|
138
146
|
|
|
139
|
-
|
|
140
|
-
}
|
|
147
|
+
await fs.cp( packagePath, upath.join( outputDirectoryPath, packageDir ), { recursive: true } );
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
return Promise.resolve();
|
|
141
151
|
}
|
|
142
152
|
|
|
143
153
|
/**
|
package/lib/tasks/push.js
CHANGED
package/lib/utils/constants.js
CHANGED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
+
* For licensing, see LICENSE.md.
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import fs from 'node:fs/promises';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Applies publish-time overrides to a `package.json` file.
|
|
10
|
+
*
|
|
11
|
+
* Fields defined in `publishConfig` replace their top-level counterparts in the manifest.
|
|
12
|
+
*
|
|
13
|
+
* @param {string} packageJsonPath Absolute path to a `package.json` file.
|
|
14
|
+
* @returns {Promise<void>}
|
|
15
|
+
*/
|
|
16
|
+
export default async function resolvePublishOverrides( packageJsonPath ) {
|
|
17
|
+
const raw = await fs.readFile( packageJsonPath, 'utf8' );
|
|
18
|
+
const { publishConfig, ...pkg } = JSON.parse( raw );
|
|
19
|
+
|
|
20
|
+
// Covers `undefined` and `null`.
|
|
21
|
+
if ( publishConfig == null ) {
|
|
22
|
+
return;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
if ( !isPlainObject( publishConfig ) ) {
|
|
26
|
+
throw new Error( `"publishConfig" in "${ packageJsonPath }" must be a plain object.` );
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
const publishPkg = { ...pkg, ...publishConfig };
|
|
30
|
+
|
|
31
|
+
await fs.writeFile( packageJsonPath, JSON.stringify( publishPkg, null, 2 ) + '\n' );
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
function isPlainObject( value ) {
|
|
35
|
+
return Object.prototype.toString.call( value ) === '[object Object]';
|
|
36
|
+
}
|
package/lib/utils/versions.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ckeditor/ckeditor5-dev-release-tools",
|
|
3
|
-
"version": "54.
|
|
3
|
+
"version": "54.3.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.
|
|
25
|
+
"@ckeditor/ckeditor5-dev-utils": "^54.3.0",
|
|
26
26
|
"@octokit/rest": "^22.0.0",
|
|
27
27
|
"cli-columns": "^4.0.0",
|
|
28
28
|
"glob": "^13.0.0",
|