@mono-labs/cli 0.0.44 → 0.0.46
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.
- package/lib/commands/build-process/test.js +10 -1
- package/lib/index.js +2 -1
- package/package.json +1 -1
|
@@ -3,14 +3,22 @@ import { getRootJson } from '../loadFromRoot.js';
|
|
|
3
3
|
|
|
4
4
|
//Run Action List before all script actions
|
|
5
5
|
|
|
6
|
-
export function executeCommandsIfWorkspaceAction(
|
|
6
|
+
export function executeCommandsIfWorkspaceAction(action) {
|
|
7
7
|
console.log('we here');
|
|
8
|
+
const testVal = commands.join(',');
|
|
8
9
|
const result = execSync('yarn workspaces list --json', { encoding: 'utf8' })
|
|
9
10
|
.trim()
|
|
10
11
|
.split('\n')
|
|
11
12
|
.map((line) => JSON.parse(line))
|
|
12
13
|
.filter((obj) => obj !== '.');
|
|
13
14
|
|
|
15
|
+
const workspaces = result.map((w) => w.name);
|
|
16
|
+
|
|
17
|
+
console.log('testVal', testVal);
|
|
18
|
+
console.log('workspaces', workspaces);
|
|
19
|
+
console.log('action', action);
|
|
20
|
+
console.log('split-action', action.split('/'));
|
|
21
|
+
|
|
14
22
|
console.log(result.map((w) => w.location)); // list of workspace paths
|
|
15
23
|
const rootJson = getRootJson();
|
|
16
24
|
const workspacesList = (rootJson.workspaces || []).map((item) =>
|
|
@@ -18,6 +26,7 @@ export function executeCommandsIfWorkspaceAction(commands = [], action) {
|
|
|
18
26
|
);
|
|
19
27
|
|
|
20
28
|
console.log('workspacesList', workspacesList);
|
|
29
|
+
const workingDirectory = './';
|
|
21
30
|
// Check if the action is a workspace action
|
|
22
31
|
if (action) {
|
|
23
32
|
// Execute each command in the context of the workspace
|
package/lib/index.js
CHANGED
|
@@ -19,6 +19,7 @@ import { executeCommandsIfWorkspaceAction } from './commands/build-process/test.
|
|
|
19
19
|
const { config } = getHasteConfig();
|
|
20
20
|
|
|
21
21
|
const workspacemap = config.workspace?.packageMaps || {};
|
|
22
|
+
const preactions = config.workspace?.preactions || [];
|
|
22
23
|
|
|
23
24
|
program.on('command:*', (operands) => {
|
|
24
25
|
const [cmd] = operands; // e.g. "destroy3"
|
|
@@ -37,7 +38,7 @@ program.on('command:*', (operands) => {
|
|
|
37
38
|
console.log('Final args for yarn:', args);
|
|
38
39
|
|
|
39
40
|
console.error(`Unknown command. Falling back to: yarn ${args.join(' ')}`);
|
|
40
|
-
executeCommandsIfWorkspaceAction([
|
|
41
|
+
executeCommandsIfWorkspaceAction([...args]);
|
|
41
42
|
console.log('yarn', args, {
|
|
42
43
|
stdio: 'inherit',
|
|
43
44
|
shell: process.platform === 'win32',
|