@mono-labs/cli 0.0.33 → 0.0.35
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/index.js +7 -9
- package/package.json +1 -1
package/lib/index.js
CHANGED
|
@@ -15,21 +15,19 @@ import './commands/submit/index.js'
|
|
|
15
15
|
import './commands/update/index.js'
|
|
16
16
|
import './commands/build-process/index.js'
|
|
17
17
|
|
|
18
|
+
const workspaceMap = {
|
|
19
|
+
"web": "next-app",
|
|
20
|
+
"app": "expo-app"
|
|
21
|
+
}
|
|
22
|
+
|
|
18
23
|
|
|
19
24
|
program.on('command:*', (operands) => {
|
|
20
|
-
console.log('Received unknown command event');
|
|
21
|
-
console.log('Operands:', operands);
|
|
22
25
|
const [cmd] = operands; // e.g. "destroy3"
|
|
23
|
-
console.log('Command:', cmd);
|
|
24
26
|
const raw = program.rawArgs.slice(2); // after `node script.js`
|
|
25
|
-
console.log('Raw args:', raw);
|
|
26
27
|
const i = raw.indexOf(cmd);
|
|
27
|
-
console.log('Index of command in raw args:', i);
|
|
28
28
|
const tokens = i >= 0 ? raw.slice(i) : operands;
|
|
29
|
-
console.log('Tokens:', tokens);
|
|
30
29
|
|
|
31
|
-
|
|
32
|
-
const workspace = tokens[0];
|
|
30
|
+
const workspace = workspaceMap[tokens[0]] || tokens[0];
|
|
33
31
|
let rest = tokens.slice(1);
|
|
34
32
|
console.log('Workspace:', workspace);
|
|
35
33
|
console.log('Rest:', rest);
|
|
@@ -39,7 +37,7 @@ program.on('command:*', (operands) => {
|
|
|
39
37
|
console.log('Rest is empty or starts with flags, inserting DEFAULT_SCRIPT');
|
|
40
38
|
// Prefer an explicit script name; if you want to always use `run`, do:
|
|
41
39
|
// rest = ['run', DEFAULT_SCRIPT, ...rest];
|
|
42
|
-
rest = [
|
|
40
|
+
rest = [ ...rest]; // yarn workspace <ws> dev --flags
|
|
43
41
|
console.log('Rest after inserting DEFAULT_SCRIPT:', rest);
|
|
44
42
|
}
|
|
45
43
|
|