@mono-labs/cli 0.0.41 → 0.0.43

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.
@@ -1,4 +1,5 @@
1
1
  import { execSync } from 'child_process';
2
+ import { getRootJson } from '../loadFromRoot.js';
2
3
 
3
4
  //Run Action List before all script actions
4
5
 
@@ -7,11 +8,18 @@ export function executeCommandsIfWorkspaceAction(commands = [], action) {
7
8
  const result = execSync('yarn workspaces list --json', { encoding: 'utf8' })
8
9
  .trim()
9
10
  .split('\n')
10
- .map((line) => JSON.parse(line));
11
+ .map((line) => JSON.parse(line))
12
+ .filter((obj) => obj !== '.');
11
13
 
12
14
  console.log(result.map((w) => w.location)); // list of workspace paths
15
+ const rootJson = getRootJson();
16
+ const workspacesList = (rootJson.workspaces || []).map((item) =>
17
+ item.replace(/[\.\/\*]/, '')
18
+ );
19
+
20
+ console.log('workspacesList', workspacesList);
13
21
  // Check if the action is a workspace action
14
- if (action && action.type === 'workspace') {
22
+ if (action) {
15
23
  // Execute each command in the context of the workspace
16
24
  commands.forEach((cmd) => {
17
25
  console.log(`Executing command in workspace: ${cmd}`);
package/lib/index.js CHANGED
@@ -37,7 +37,7 @@ program.on('command:*', (operands) => {
37
37
  console.log('Final args for yarn:', args);
38
38
 
39
39
  console.error(`Unknown command. Falling back to: yarn ${args.join(' ')}`);
40
- executeCommandsIfWorkspaceAction(['yarn', ...args], { type: 'workspace' });
40
+ executeCommandsIfWorkspaceAction(['yarn', ...args]);
41
41
  console.log('yarn', args, {
42
42
  stdio: 'inherit',
43
43
  shell: process.platform === 'win32',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mono-labs/cli",
3
- "version": "0.0.41",
3
+ "version": "0.0.43",
4
4
  "description": "A CLI tool for building and deploying projects",
5
5
  "type": "module",
6
6
  "main": "index.js",