diff --git a/.yarn/plugins/@yarnpkg/plugin-bump.js b/.yarn/plugins/@yarnpkg/plugin-bump.js index 6521996..84df11b 100644 --- a/.yarn/plugins/@yarnpkg/plugin-bump.js +++ b/.yarn/plugins/@yarnpkg/plugin-bump.js @@ -178,27 +178,23 @@ module.exports = { } async execute() { - const configuration = await core_1.Configuration.find(this.context.cwd, this.context.plugins); - const { - workspace - } = await core_1.Project.find(configuration, this.context.cwd); - - if (!workspace) { - throw new Error(`Workspace setting is not found. - Please run the command in path where yarn initialized.`); - } - if (!plugin_essentials_1.default.commands) { throw new Error(`Yarn commands could not be loaded. Please upgrade to Yarn 2.`); } - const dependencies = this.getDependencies(workspace); - const descriptors = [...dependencies.values()].filter(descriptor => this.resolveFullPackageName(descriptor).match(this.packages.join('|') || '.*')).filter(descriptor => !this.resolveFullPackageName(descriptor).match(this.exclude.join('|') || null)); - const packageNames = descriptors.map(this.resolveFullPackageName); - const cli = clipanion_1.Cli.from(plugin_essentials_1.default.commands); - const result = await cli.runExit(['up', ...packageNames], this.context); - return result; + const configuration = await core_1.Configuration.find(this.context.cwd, this.context.plugins); + const { + project + } = await core_1.Project.find(configuration, this.context.cwd); + + for (const workspace of project.workspaces) { + const dependencies = this.getDependencies(workspace); + const descriptors = [...dependencies.values()].filter(descriptor => this.resolveFullPackageName(descriptor).match(this.packages.join('|') || '.*')).filter(descriptor => !this.resolveFullPackageName(descriptor).match(this.exclude.join('|') || null)); + const packageNames = descriptors.map(this.resolveFullPackageName); + const cli = clipanion_1.Cli.from(plugin_essentials_1.default.commands); + await cli.runExit(['up', ...packageNames], this.context); + } } } diff --git a/sources/commands/bump.tsx b/sources/commands/bump.tsx index 789ce72..4e55983 100644 --- a/sources/commands/bump.tsx +++ b/sources/commands/bump.tsx @@ -69,22 +69,6 @@ export default class BumpCommand extends BaseCommand { @Command.Path('bump') async execute(): Promise { - const configuration = await Configuration.find( - this.context.cwd, - this.context.plugins - ); - const { workspace } = await Project.find( - configuration, - this.context.cwd - ); - - if (!workspace) { - throw new Error( - `Workspace setting is not found. -Please run the command in path where yarn initialized.` - ); - } - if (!Essentials.commands) { throw new Error( `Yarn commands could not be loaded. @@ -92,18 +76,28 @@ Please upgrade to Yarn 2.` ); } - const dependencies = this.getDependencies(workspace); - const descriptors = [...dependencies.values()] - .filter(descriptor => this.resolveFullPackageName(descriptor) - .match(this.packages.join('|') || '.*' as any)) - .filter(descriptor => !this.resolveFullPackageName(descriptor) - .match(this.exclude.join('|') || null as any)); + const configuration = await Configuration.find( + this.context.cwd, + this.context.plugins + ); + + const { project } = await Project.find( + configuration, + this.context.cwd + ); - const packageNames = descriptors.map(this.resolveFullPackageName); + for (const workspace of project.workspaces) { + const dependencies = this.getDependencies(workspace); + const descriptors = [...dependencies.values()] + .filter(descriptor => this.resolveFullPackageName(descriptor) + .match(this.packages.join('|') || '.*' as any)) + .filter(descriptor => !this.resolveFullPackageName(descriptor) + .match(this.exclude.join('|') || null as any)); - const cli = Cli.from(Essentials.commands); - const result = await cli.runExit(['up', ...packageNames], this.context); + const packageNames = descriptors.map(this.resolveFullPackageName); - return result; + const cli = Cli.from(Essentials.commands); + await cli.runExit(['up', ...packageNames], this.context); + } } }