diff --git a/.yarn/versions/60f61bde.yml b/.yarn/versions/60f61bde.yml new file mode 100644 index 00000000000..1f2a5d9c201 --- /dev/null +++ b/.yarn/versions/60f61bde.yml @@ -0,0 +1,9 @@ +releases: + "@moonrepo/cli": patch + "@moonrepo/core-linux-arm64-gnu": patch + "@moonrepo/core-linux-arm64-musl": patch + "@moonrepo/core-linux-x64-gnu": patch + "@moonrepo/core-linux-x64-musl": patch + "@moonrepo/core-macos-arm64": patch + "@moonrepo/core-macos-x64": patch + "@moonrepo/core-windows-x64-msvc": patch diff --git a/nextgen/config/src/toolchain/node_config.rs b/nextgen/config/src/toolchain/node_config.rs index 3b3bfc8719d..37831cf477e 100644 --- a/nextgen/config/src/toolchain/node_config.rs +++ b/nextgen/config/src/toolchain/node_config.rs @@ -140,9 +140,17 @@ impl NodeConfig { self.inherit_proto_npm(proto_tools)?; } NodePackageManager::Pnpm => { + if self.pnpm.is_none() { + self.pnpm = Some(PnpmConfig::default()); + } + self.inherit_proto_pnpm(proto_tools)?; } NodePackageManager::Yarn => { + if self.yarn.is_none() { + self.yarn = Some(YarnConfig::default()); + } + self.inherit_proto_yarn(proto_tools)?; } }; diff --git a/nextgen/config/tests/toolchain_config_test.rs b/nextgen/config/tests/toolchain_config_test.rs index ef094405217..e9e5e7a992e 100644 --- a/nextgen/config/tests/toolchain_config_test.rs +++ b/nextgen/config/tests/toolchain_config_test.rs @@ -404,6 +404,30 @@ node: ); } + #[test] + fn inherits_plugin_locator_when_none() { + let config = test_load_config( + FILENAME, + r" +node: + packageManager: pnpm +", + |path| { + let mut tools = ToolsConfig::default(); + tools.inherit_builtin_plugins(); + + ToolchainConfig::load_from(path, &tools) + }, + ); + + assert_eq!( + config.node.unwrap().pnpm.unwrap().plugin.unwrap(), + PluginLocator::SourceUrl { + url: "https://github.com/moonrepo/node-plugin/releases/latest/download/node_depman_plugin.wasm".into() + } + ); + } + #[test] fn proto_version_doesnt_override() { let config = test_load_config( @@ -499,6 +523,30 @@ node: ); } + #[test] + fn inherits_plugin_locator_when_none() { + let config = test_load_config( + FILENAME, + r" +node: + packageManager: yarn +", + |path| { + let mut tools = ToolsConfig::default(); + tools.inherit_builtin_plugins(); + + ToolchainConfig::load_from(path, &tools) + }, + ); + + assert_eq!( + config.node.unwrap().yarn.unwrap().plugin.unwrap(), + PluginLocator::SourceUrl { + url: "https://github.com/moonrepo/node-plugin/releases/latest/download/node_depman_plugin.wasm".into() + } + ); + } + #[test] fn proto_version_doesnt_override() { let config = test_load_config( diff --git a/nextgen/task-builder/src/tasks_builder.rs b/nextgen/task-builder/src/tasks_builder.rs index 8daa7cb03a1..cff3a56b25e 100644 --- a/nextgen/task-builder/src/tasks_builder.rs +++ b/nextgen/task-builder/src/tasks_builder.rs @@ -224,7 +224,7 @@ impl<'proj> TasksBuilder<'proj> { let mut args_sets = vec![]; for link in &chain { - let (command, base_args) = self.get_command_and_args(&link.config)?; + let (command, base_args) = self.get_command_and_args(link.config)?; if let Some(command) = command { task.command = command; diff --git a/packages/cli/CHANGELOG.md b/packages/cli/CHANGELOG.md index 4f2120797d8..368788bb453 100644 --- a/packages/cli/CHANGELOG.md +++ b/packages/cli/CHANGELOG.md @@ -1,5 +1,11 @@ # Changelog +## Unreleased + +#### 🐞 Fixes + +- Fixed an issue where `pnpm` or `yarn` would panic based on configuration combination. + ## 1.13.1 #### 🐞 Fixes