@ckeditor/ckeditor5-dev-release-tools 61.2.0 → 62.1.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.
@@ -54,6 +54,8 @@ import { workspaces, npm } from '@ckeditor/ckeditor5-dev-utils';
54
54
  * @param {Array.<string>} [options.optionalEntryPointPackages=[]] If the entry point validator is enabled (`requireEntryPoint=true`),
55
55
  * this array contains a list of packages that will not be checked. In other words, they do not have to define the entry point.
56
56
  * @param {string} [options.cwd=process.cwd()] Current working directory from which all paths will be resolved.
57
+ * @param {string} [options.workerDirectory='build'] A directory, relative to `options.cwd`, where temporary worker modules are stored.
58
+ * See `executeInParallel()` for details.
57
59
  * @param {number} [options.concurrency=4] Number of CPUs that will execute the task.
58
60
  * @param {number} [options.attempts=3] Number of attempts. After reaching 0, it won't be publishing packages again.
59
61
  * @returns {Promise}
@@ -72,6 +74,7 @@ export default async function publishPackages( options ) {
72
74
  requireEntryPoint = false,
73
75
  optionalEntryPointPackages = [],
74
76
  cwd = process.cwd(),
77
+ workerDirectory = 'build',
75
78
  concurrency = 2,
76
79
  attempts = 5
77
80
  } = options;
@@ -127,7 +130,8 @@ export default async function publishPackages( options ) {
127
130
  npmTag
128
131
  },
129
132
  signal,
130
- concurrency
133
+ concurrency,
134
+ workerDirectory
131
135
  } );
132
136
 
133
137
  listrTask.output = 'Let\'s give an npm a moment for taking a breath (~10 sec)...';
@@ -31,6 +31,9 @@ const WORKER_SCRIPT = new URL( './parallelworker.js', import.meta.url );
31
31
  * @param {ExecuteInParallelPackagesDirectoryFilter|null} [options.packagesDirectoryFilter=null] An optional callback allowing filtering out
32
32
  * directories/packages that should not be touched by the task.
33
33
  * @param {string} [options.cwd=process.cwd()] Current working directory from which all paths will be resolved.
34
+ * @param {string} [options.workerDirectory='build'] A directory, relative to `options.cwd`, where temporary worker modules are stored.
35
+ * It must be inside the project so workers can resolve dependencies from `node_modules`. The default `build` directory is usually ignored
36
+ * by git, preventing leftover files from polluting the working tree.
34
37
  * @param {number} [options.concurrency=require( 'os' ).cpus().length / 2] Number of CPUs that will execute the task.
35
38
  * @returns {Promise}
36
39
  */
@@ -43,6 +46,7 @@ export default async function executeInParallel( options ) {
43
46
  taskOptions = null,
44
47
  packagesDirectoryFilter = null,
45
48
  cwd = process.cwd(),
49
+ workerDirectory = 'build',
46
50
  concurrency = os.cpus().length / 2
47
51
  } = options;
48
52
 
@@ -53,7 +57,10 @@ export default async function executeInParallel( options ) {
53
57
 
54
58
  const packagesInThreads = getPackagesGroupedByThreads( packagesToProcess, concurrencyAsInteger );
55
59
 
56
- const callbackModule = upath.join( cwd, crypto.randomUUID() + '.mjs' );
60
+ const callbackModuleDirectory = upath.join( cwd, workerDirectory );
61
+ const callbackModule = upath.join( callbackModuleDirectory, crypto.randomUUID() + '.mjs' );
62
+
63
+ await fs.mkdir( callbackModuleDirectory, { recursive: true } );
57
64
  await fs.writeFile( callbackModule, `export default ${ taskToExecute };`, 'utf-8' );
58
65
 
59
66
  const onPackageDone = progressFactory( listrTask, packagesToProcess.length );
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ckeditor/ckeditor5-dev-release-tools",
3
- "version": "61.2.0",
3
+ "version": "62.1.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": "^61.2.0",
25
+ "@ckeditor/ckeditor5-dev-utils": "^62.1.0",
26
26
  "@octokit/rest": "^22.0.1",
27
27
  "cli-columns": "^4.0.0",
28
28
  "glob": "^13.0.6",