@ckeditor/ckeditor5-dev-release-tools 54.2.2 → 54.2.3
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/preparerepository.js +21 -22
- package/package.json +2 -2
|
@@ -42,32 +42,26 @@ export default async function prepareRepository( options ) {
|
|
|
42
42
|
throw new Error( `Output directory is not empty: "${ outputDirectoryPath }".` );
|
|
43
43
|
}
|
|
44
44
|
|
|
45
|
-
const copyPromises = [];
|
|
46
|
-
|
|
47
45
|
if ( rootPackageJson ) {
|
|
48
46
|
validateRootPackage( rootPackageJson );
|
|
49
47
|
|
|
50
|
-
|
|
48
|
+
await processRootPackage( {
|
|
51
49
|
cwd,
|
|
52
50
|
rootPackageJson,
|
|
53
51
|
outputDirectoryPath
|
|
54
52
|
} );
|
|
55
|
-
|
|
56
|
-
copyPromises.push( ...copyRootItemsPromises );
|
|
57
53
|
}
|
|
58
54
|
|
|
59
55
|
if ( packagesDirectory ) {
|
|
60
|
-
|
|
56
|
+
await processMonorepoPackages( {
|
|
61
57
|
cwd,
|
|
62
58
|
packagesDirectory,
|
|
63
59
|
packagesToCopy,
|
|
64
60
|
outputDirectoryPath
|
|
65
61
|
} );
|
|
66
|
-
|
|
67
|
-
copyPromises.push( ...copyPackagesPromises );
|
|
68
62
|
}
|
|
69
63
|
|
|
70
|
-
return Promise.
|
|
64
|
+
return Promise.resolve();
|
|
71
65
|
}
|
|
72
66
|
|
|
73
67
|
/**
|
|
@@ -90,7 +84,7 @@ function validateRootPackage( packageJson ) {
|
|
|
90
84
|
* @param {string} options.cwd
|
|
91
85
|
* @param {RootPackageJson} options.rootPackageJson
|
|
92
86
|
* @param {string} options.outputDirectoryPath
|
|
93
|
-
* @returns {Promise}
|
|
87
|
+
* @returns {Promise.<void>}
|
|
94
88
|
*/
|
|
95
89
|
async function processRootPackage( { cwd, rootPackageJson, outputDirectoryPath } ) {
|
|
96
90
|
const rootPackageDirName = rootPackageJson.name.replace( /^@.*\//, '' );
|
|
@@ -100,13 +94,16 @@ async function processRootPackage( { cwd, rootPackageJson, outputDirectoryPath }
|
|
|
100
94
|
await fs.mkdir( rootPackageOutputPath, { recursive: true } );
|
|
101
95
|
await fs.writeFile( pkgJsonOutputPath, JSON.stringify( rootPackageJson, null, 2 ) + '\n' );
|
|
102
96
|
|
|
103
|
-
|
|
104
|
-
.map( absoluteFilePath => {
|
|
105
|
-
const relativeFilePath = upath.relative( cwd, absoluteFilePath );
|
|
106
|
-
const absoluteFileOutputPath = upath.join( rootPackageOutputPath, relativeFilePath );
|
|
97
|
+
const filesToCopy = await glob( rootPackageJson.files, { cwd, absolute: true } );
|
|
107
98
|
|
|
108
|
-
|
|
109
|
-
|
|
99
|
+
for ( const absoluteFilePath of filesToCopy ) {
|
|
100
|
+
const relativeFilePath = upath.relative( cwd, absoluteFilePath );
|
|
101
|
+
const absoluteFileOutputPath = upath.join( rootPackageOutputPath, relativeFilePath );
|
|
102
|
+
|
|
103
|
+
await fs.cp( absoluteFilePath, absoluteFileOutputPath, { recursive: true } );
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
return Promise.resolve();
|
|
110
107
|
}
|
|
111
108
|
|
|
112
109
|
/**
|
|
@@ -115,29 +112,31 @@ async function processRootPackage( { cwd, rootPackageJson, outputDirectoryPath }
|
|
|
115
112
|
* @param {string} options.packagesDirectory
|
|
116
113
|
* @param {string} options.outputDirectoryPath
|
|
117
114
|
* @param {Array.<string>} [options.packagesToCopy]
|
|
118
|
-
* @returns {Promise}
|
|
115
|
+
* @returns {Promise.<void>}
|
|
119
116
|
*/
|
|
120
117
|
async function processMonorepoPackages( { cwd, packagesDirectory, packagesToCopy, outputDirectoryPath } ) {
|
|
121
118
|
const packagesDirectoryPath = upath.join( cwd, packagesDirectory );
|
|
122
119
|
const packageDirs = packagesToCopy || await fs.readdir( packagesDirectoryPath );
|
|
123
120
|
|
|
124
|
-
|
|
121
|
+
for ( const packageDir of packageDirs ) {
|
|
125
122
|
const packagePath = upath.join( packagesDirectoryPath, packageDir );
|
|
126
123
|
const isDir = ( await fs.lstat( packagePath ) ).isDirectory();
|
|
127
124
|
|
|
128
125
|
if ( !isDir ) {
|
|
129
|
-
|
|
126
|
+
continue;
|
|
130
127
|
}
|
|
131
128
|
|
|
132
129
|
const pkgJsonPath = upath.join( packagePath, 'package.json' );
|
|
133
130
|
const hasPkgJson = await fs.access( pkgJsonPath ).then( () => true, () => false );
|
|
134
131
|
|
|
135
132
|
if ( !hasPkgJson ) {
|
|
136
|
-
|
|
133
|
+
continue;
|
|
137
134
|
}
|
|
138
135
|
|
|
139
|
-
|
|
140
|
-
}
|
|
136
|
+
await fs.cp( packagePath, upath.join( outputDirectoryPath, packageDir ), { recursive: true } );
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
return Promise.resolve();
|
|
141
140
|
}
|
|
142
141
|
|
|
143
142
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ckeditor/ckeditor5-dev-release-tools",
|
|
3
|
-
"version": "54.2.
|
|
3
|
+
"version": "54.2.3",
|
|
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.2.
|
|
25
|
+
"@ckeditor/ckeditor5-dev-utils": "^54.2.3",
|
|
26
26
|
"@octokit/rest": "^22.0.0",
|
|
27
27
|
"cli-columns": "^4.0.0",
|
|
28
28
|
"glob": "^13.0.0",
|