diff --git a/test-packages/unstable-release/.eslintrc.cjs b/test-packages/unstable-release/.eslintrc.cjs index bc1f19a2b..79667c4c4 100644 --- a/test-packages/unstable-release/.eslintrc.cjs +++ b/test-packages/unstable-release/.eslintrc.cjs @@ -12,7 +12,8 @@ module.exports = { }, extends: ['eslint:recommended', 'plugin:prettier/recommended'], env: { - browser: true, + browser: false, + node: true, }, overrides: [ // node files diff --git a/test-packages/unstable-release/publish.js b/test-packages/unstable-release/publish.js index 84e11ee55..075787428 100644 --- a/test-packages/unstable-release/publish.js +++ b/test-packages/unstable-release/publish.js @@ -5,9 +5,25 @@ import { dirname } from 'path'; async function publish() { let publicWorkspaces = await listPublicWorkspaces(); + const errors = []; + for (let workspace of publicWorkspaces) { console.info(`Publishing ${workspace}`); - await execaCommand('npm publish --tag=unstable --verbose', { cwd: dirname(workspace) }); + try { + await execaCommand('npm publish --tag=unstable --verbose', { cwd: dirname(workspace) }); + } catch (err) { + console.info(`Publishing ${workspace} has failed. A full list of errors will be printed at the end of this run`); + errors.push(err); + continue; + } + + console.info(`Publishing ${workspace} completed successfully!`); + } + + if (errors.length) { + console.error('Errors were encountered while publishing these packages'); + errors.forEach(error => console.log(error.stderr)); + process.exit(1); } }