iterate 0.2.3 → 0.2.4

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.
Files changed (2) hide show
  1. package/bin/iterate.js +12 -4
  2. package/package.json +1 -1
package/bin/iterate.js CHANGED
@@ -183,10 +183,18 @@ const getWorkspaceConfig = (configFile, workspacePath) => {
183
183
  * @param {string} workspacePath
184
184
  */
185
185
  const getMergedWorkspaceConfig = (configFile, workspacePath) => {
186
- return {
187
- ...configFile.global,
188
- ...getWorkspaceConfig(configFile, workspacePath),
189
- };
186
+ const configs = [];
187
+ while (workspacePath && workspacePath !== "/") {
188
+ if (workspacePath in (configFile.workspaces || {})) {
189
+ configs.push(configFile.workspaces?.[workspacePath]);
190
+ }
191
+ workspacePath = dirname(workspacePath);
192
+ }
193
+ configs.push(configFile.global);
194
+ /** @type {AuthConfig} */
195
+ return configs.reverse().reduce((acc, config) => {
196
+ return { ...acc, ...config };
197
+ }, {});
190
198
  };
191
199
 
192
200
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "iterate",
3
- "version": "0.2.3",
3
+ "version": "0.2.4",
4
4
  "description": "CLI for iterate",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",