-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1040 from ckeditor/i/17333
Fix (release-tools): The `publishPackages()` task should not throw an error after trying to publish packages after reaching an attempted limit. Instead, it should verify if the last try was successfully completed and throw the error if it wasn't. Closes ckeditor/ckeditor5#17333. Other (release-tools): Increased the attempts limit from 3 to 5. Other (release-tools): Created a decorated version of utils (`manifest()`, `packument()`) exposed by the `pacote` package. It prevents from using any cache when checking the npm registry. Direct calls have been replaced with the decorated version.
- Loading branch information
Showing
10 changed files
with
721 additions
and
412 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 33 additions & 0 deletions
33
packages/ckeditor5-dev-release-tools/lib/utils/pacotecacheless.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
/** | ||
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved. | ||
* For licensing, see LICENSE.md. | ||
*/ | ||
|
||
import os from 'os'; | ||
import { randomUUID } from 'crypto'; | ||
import upath from 'upath'; | ||
import fs from 'fs-extra'; | ||
import pacote from 'pacote'; | ||
|
||
export const manifest = cacheLessPacoteFactory( pacote.manifest ); | ||
export const packument = cacheLessPacoteFactory( pacote.packument ); | ||
|
||
function cacheLessPacoteFactory( callback ) { | ||
return async ( description, options = {} ) => { | ||
const uuid = randomUUID(); | ||
const cacheDir = upath.join( os.tmpdir(), `pacote--${ uuid }` ); | ||
|
||
await fs.ensureDir( cacheDir ); | ||
|
||
try { | ||
return await callback( description, { | ||
...options, | ||
cache: cacheDir, | ||
memoize: false, | ||
preferOnline: true | ||
} ); | ||
} finally { | ||
await fs.remove( cacheDir ); | ||
} | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.