@mono-labs/cli 0.0.165 → 0.0.170
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/app.js +49 -49
- package/lib/commands/build-process/cliFactory.js +7 -2
- package/lib/commands/build-process/runHasteCommand.js +20 -6
- package/lib/commands/build-process/testflag.js +1 -0
- package/lib/commands/generate/generateSeed.js +223 -223
- package/lib/commands/generate/index.js +30 -30
- package/lib/commands/prune/index.js +12 -12
- package/lib/commands/prune/prune.js +50 -50
- package/lib/commands/seed/import.js +30 -30
- package/lib/commands/seed/index.js +12 -12
- package/lib/commands/submit/index.js +38 -38
- package/lib/commands/update/eas.js +39 -39
- package/lib/commands/update/index.js +87 -87
- package/lib/config.js +4 -4
- package/lib/index.js +57 -57
- package/package.json +2 -3
package/lib/index.js
CHANGED
|
@@ -1,57 +1,57 @@
|
|
|
1
|
-
import 'dotenv/config';
|
|
2
|
-
import spawn from 'cross-spawn';
|
|
3
|
-
|
|
4
|
-
import { program } from './app.js';
|
|
5
|
-
import './commands/generate/index.js';
|
|
6
|
-
import './commands/prune/index.js';
|
|
7
|
-
import './commands/seed/index.js';
|
|
8
|
-
import './commands/submit/index.js';
|
|
9
|
-
import './commands/update/index.js';
|
|
10
|
-
import './commands/build-process/index.js';
|
|
11
|
-
import { getHasteConfig } from './commands/loadFromRoot.js';
|
|
12
|
-
import { executeCommandsIfWorkspaceAction } from './commands/build-process/test.js';
|
|
13
|
-
import os from 'node:os';
|
|
14
|
-
import path from 'node:path';
|
|
15
|
-
const homeBin = path.join(os.homedir(), 'bin');
|
|
16
|
-
const PATH = [homeBin, process.env.PATH].filter(Boolean).join(path.delimiter);
|
|
17
|
-
|
|
18
|
-
const { config } = getHasteConfig();
|
|
19
|
-
|
|
20
|
-
const workspacemap = config.workspace?.packageMaps || {};
|
|
21
|
-
const preactions = config.workspace?.preactions || [];
|
|
22
|
-
const envMapList = config.envMap ?? ['FAILURE'];
|
|
23
|
-
|
|
24
|
-
program.on('command:*', (operands) => {
|
|
25
|
-
const [cmd] = operands; // e.g. "destroy3"
|
|
26
|
-
const raw = program.rawArgs.slice(2); // after `node script.js`
|
|
27
|
-
const i = raw.indexOf(cmd);
|
|
28
|
-
const tokens = i >= 0 ? raw.slice(i) : operands;
|
|
29
|
-
|
|
30
|
-
const workspace = workspacemap[tokens[0]] || tokens[0];
|
|
31
|
-
let rest = tokens.slice(1);
|
|
32
|
-
|
|
33
|
-
const envKeys = Object.keys(process.env).filter((k) => k.startsWith('MONO_'));
|
|
34
|
-
|
|
35
|
-
let envObj = {};
|
|
36
|
-
|
|
37
|
-
envKeys.map((k) => {
|
|
38
|
-
envMapList.map((item) => {
|
|
39
|
-
envObj[k.replace('MONO', item)] = process.env[k];
|
|
40
|
-
});
|
|
41
|
-
});
|
|
42
|
-
|
|
43
|
-
const args = ['workspace', workspace, ...rest];
|
|
44
|
-
|
|
45
|
-
console.error(`Unknown command. Falling back to: yarn ${args.join(' ')}`);
|
|
46
|
-
executeCommandsIfWorkspaceAction(args, preactions, envObj);
|
|
47
|
-
const child = spawn('yarn', args, {
|
|
48
|
-
stdio: 'inherit',
|
|
49
|
-
shell: process.platform === 'win32',
|
|
50
|
-
env: { ...process.env, ...envObj, PATH },
|
|
51
|
-
});
|
|
52
|
-
child.on('exit', (code) => {
|
|
53
|
-
console.log('Child process exited with code:', code);
|
|
54
|
-
process.exitCode = code ?? 1;
|
|
55
|
-
});
|
|
56
|
-
});
|
|
57
|
-
program.parse();
|
|
1
|
+
import 'dotenv/config';
|
|
2
|
+
import spawn from 'cross-spawn';
|
|
3
|
+
|
|
4
|
+
import { program } from './app.js';
|
|
5
|
+
import './commands/generate/index.js';
|
|
6
|
+
import './commands/prune/index.js';
|
|
7
|
+
import './commands/seed/index.js';
|
|
8
|
+
import './commands/submit/index.js';
|
|
9
|
+
import './commands/update/index.js';
|
|
10
|
+
import './commands/build-process/index.js';
|
|
11
|
+
import { getHasteConfig } from './commands/loadFromRoot.js';
|
|
12
|
+
import { executeCommandsIfWorkspaceAction } from './commands/build-process/test.js';
|
|
13
|
+
import os from 'node:os';
|
|
14
|
+
import path from 'node:path';
|
|
15
|
+
const homeBin = path.join(os.homedir(), 'bin');
|
|
16
|
+
const PATH = [homeBin, process.env.PATH].filter(Boolean).join(path.delimiter);
|
|
17
|
+
|
|
18
|
+
const { config } = getHasteConfig();
|
|
19
|
+
|
|
20
|
+
const workspacemap = config.workspace?.packageMaps || {};
|
|
21
|
+
const preactions = config.workspace?.preactions || [];
|
|
22
|
+
const envMapList = config.envMap ?? ['FAILURE'];
|
|
23
|
+
|
|
24
|
+
program.on('command:*', (operands) => {
|
|
25
|
+
const [cmd] = operands; // e.g. "destroy3"
|
|
26
|
+
const raw = program.rawArgs.slice(2); // after `node script.js`
|
|
27
|
+
const i = raw.indexOf(cmd);
|
|
28
|
+
const tokens = i >= 0 ? raw.slice(i) : operands;
|
|
29
|
+
|
|
30
|
+
const workspace = workspacemap[tokens[0]] || tokens[0];
|
|
31
|
+
let rest = tokens.slice(1);
|
|
32
|
+
|
|
33
|
+
const envKeys = Object.keys(process.env).filter((k) => k.startsWith('MONO_'));
|
|
34
|
+
|
|
35
|
+
let envObj = {};
|
|
36
|
+
|
|
37
|
+
envKeys.map((k) => {
|
|
38
|
+
envMapList.map((item) => {
|
|
39
|
+
envObj[k.replace('MONO', item)] = process.env[k];
|
|
40
|
+
});
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
const args = ['workspace', workspace, ...rest];
|
|
44
|
+
|
|
45
|
+
console.error(`Unknown command. Falling back to: yarn ${args.join(' ')}`);
|
|
46
|
+
executeCommandsIfWorkspaceAction(args, preactions, envObj);
|
|
47
|
+
const child = spawn('yarn', args, {
|
|
48
|
+
stdio: 'inherit',
|
|
49
|
+
shell: process.platform === 'win32',
|
|
50
|
+
env: { ...process.env, ...envObj, PATH },
|
|
51
|
+
});
|
|
52
|
+
child.on('exit', (code) => {
|
|
53
|
+
console.log('Child process exited with code:', code);
|
|
54
|
+
process.exitCode = code ?? 1;
|
|
55
|
+
});
|
|
56
|
+
});
|
|
57
|
+
program.parse();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mono-labs/cli",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.170",
|
|
4
4
|
"description": "A CLI tool for building and deploying projects",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "index.js",
|
|
@@ -55,6 +55,5 @@
|
|
|
55
55
|
"lib/",
|
|
56
56
|
"types.d.ts",
|
|
57
57
|
"README.md"
|
|
58
|
-
]
|
|
59
|
-
"packageManager": "yarn@4.5.0"
|
|
58
|
+
]
|
|
60
59
|
}
|