@mono-labs/cli 0.0.248 → 0.1.249
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/README.md +106 -0
- package/package.json +3 -3
package/README.md
ADDED
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
# @mono-labs/cli
|
|
2
|
+
|
|
3
|
+
The CLI runtime for Mono. Reads `.mono/` JSON command definitions and executes them with environment management, token replacement, and process orchestration.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
yarn add -D @mono-labs/cli
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
This makes the `mono` binary available in your project:
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
yarn mono <command> [argument] [--options]
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## Usage
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
# Run a command defined in .mono/dev.json
|
|
21
|
+
yarn mono dev
|
|
22
|
+
|
|
23
|
+
# Pass an argument
|
|
24
|
+
yarn mono deploy stage
|
|
25
|
+
|
|
26
|
+
# Use options
|
|
27
|
+
yarn mono deploy --region us-west-2
|
|
28
|
+
|
|
29
|
+
# Run a workspace command (falls back to yarn workspace)
|
|
30
|
+
yarn mono web dev
|
|
31
|
+
|
|
32
|
+
# Built-in tools
|
|
33
|
+
yarn mono tools prune
|
|
34
|
+
|
|
35
|
+
# Config management
|
|
36
|
+
yarn mono config list
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
## Exports
|
|
40
|
+
|
|
41
|
+
The package provides several subpath exports for use in other packages:
|
|
42
|
+
|
|
43
|
+
| Export | Description |
|
|
44
|
+
|--------|-------------|
|
|
45
|
+
| `@mono-labs/cli` | Core utilities: `setData`, `getData`, `mergeData`, `hasData`, `replaceTokens`, `generateNewEnvList`, `filterUnwantedEnvVars`, `filterUnwantedEnvVarsEAS`, `boot`, `getMonoConfig`, `getRootDirectory`, `getRootJson`, `buildCommands`, `runMonoCommand`, `verifyOptionValue` |
|
|
46
|
+
| `@mono-labs/cli/project` | Re-exports from `@mono-labs/project`: `findProjectRoot`, `getRootDirectory`, `getRootJson`, `resolveMonoDirectory`, `getMonoFiles`, `getMonoConfig`, `loadAppConfig`, `loadProjectConfig`, `loadMergedEnv` |
|
|
47
|
+
| `@mono-labs/cli/expo` | Re-exports from `@mono-labs/expo`: `replaceTokens`, `setUpConfig`, `filterUnwantedEnvVarsEAS` |
|
|
48
|
+
| `@mono-labs/cli/tools` | Tooling utilities: `replaceTokens`, `setUpConfig` |
|
|
49
|
+
| `@mono-labs/cli/cdk` | CDK helpers: `replaceTokens`, `setUpConfig` |
|
|
50
|
+
| `@mono-labs/cli/stack` | `CustomStack` abstract class for AWS CDK stacks |
|
|
51
|
+
|
|
52
|
+
### Core API
|
|
53
|
+
|
|
54
|
+
```typescript
|
|
55
|
+
import {
|
|
56
|
+
setData,
|
|
57
|
+
getData,
|
|
58
|
+
mergeData,
|
|
59
|
+
hasData,
|
|
60
|
+
replaceTokens,
|
|
61
|
+
generateNewEnvList,
|
|
62
|
+
filterUnwantedEnvVars,
|
|
63
|
+
filterUnwantedEnvVarsEAS
|
|
64
|
+
} from "@mono-labs/cli";
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
**Data Layer** -- Shared key-value store used during command execution:
|
|
68
|
+
|
|
69
|
+
- `setData(key, value)` -- Set a value
|
|
70
|
+
- `getData(key?)` -- Get a value (or all data if no key)
|
|
71
|
+
- `mergeData(obj)` -- Merge an object into the data layer
|
|
72
|
+
- `hasData(key)` -- Check if a key exists
|
|
73
|
+
|
|
74
|
+
**Token Replacement:**
|
|
75
|
+
|
|
76
|
+
- `replaceTokens(str, env)` -- Replace `${key}` and `$KEY` patterns in a string using the data layer and environment
|
|
77
|
+
|
|
78
|
+
**Environment Utilities:**
|
|
79
|
+
|
|
80
|
+
- `generateNewEnvList(processEnv)` -- Map `MONO_*` vars to configured prefixes via `envMap`
|
|
81
|
+
- `filterUnwantedEnvVars(env)` -- Minimal env var filtering for local dev
|
|
82
|
+
- `filterUnwantedEnvVarsEAS(env)` -- Aggressive env var filtering for EAS builds
|
|
83
|
+
|
|
84
|
+
### Types
|
|
85
|
+
|
|
86
|
+
```typescript
|
|
87
|
+
import type {
|
|
88
|
+
MonoConfig,
|
|
89
|
+
OptionConfig,
|
|
90
|
+
CommandConfig,
|
|
91
|
+
MonoFiles,
|
|
92
|
+
BootResult
|
|
93
|
+
} from "@mono-labs/cli";
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
## Development
|
|
97
|
+
|
|
98
|
+
Build the CLI package:
|
|
99
|
+
|
|
100
|
+
```bash
|
|
101
|
+
yarn build:cli
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
The binary entry point is `bin/mono.js`, which loads `dist/lib/index.js`. The command system is built on [Commander.js](https://github.com/tj/commander.js/).
|
|
105
|
+
|
|
106
|
+
See the [Contributing guide](../../CONTRIBUTING.md) for full development setup.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mono-labs/cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.1.249",
|
|
4
4
|
"type": "commonjs",
|
|
5
5
|
"description": "A CLI tool for building and deploying projects",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -70,8 +70,8 @@
|
|
|
70
70
|
"node": ">=20.0.0"
|
|
71
71
|
},
|
|
72
72
|
"dependencies": {
|
|
73
|
-
"@mono-labs/project": "0.
|
|
74
|
-
"@mono-labs/expo": "0.
|
|
73
|
+
"@mono-labs/project": "0.1.249",
|
|
74
|
+
"@mono-labs/expo": "0.1.249",
|
|
75
75
|
"chalk": "^4.1.2",
|
|
76
76
|
"commander": "^11.1.0",
|
|
77
77
|
"cross-spawn": "^7.0.6",
|