@objectstack/cli 3.0.5 → 3.0.7
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/.turbo/turbo-build.log +2 -26
- package/CHANGELOG.md +27 -0
- package/README.md +98 -54
- package/bin/run-dev.js +5 -0
- package/bin/run.js +5 -0
- package/dist/bin.d.ts +11 -0
- package/dist/bin.d.ts.map +1 -0
- package/dist/bin.js +12 -3759
- package/dist/bin.js.map +1 -0
- package/dist/commands/codemod/v2-to-v3.d.ts +10 -0
- package/dist/commands/codemod/v2-to-v3.d.ts.map +1 -0
- package/dist/commands/codemod/v2-to-v3.js +145 -0
- package/dist/commands/codemod/v2-to-v3.js.map +1 -0
- package/dist/commands/compile.d.ts +13 -0
- package/dist/commands/compile.d.ts.map +1 -0
- package/dist/commands/compile.js +91 -0
- package/dist/commands/compile.js.map +1 -0
- package/dist/commands/create.d.ts +91 -0
- package/dist/commands/create.d.ts.map +1 -0
- package/dist/commands/create.js +259 -0
- package/dist/commands/create.js.map +1 -0
- package/dist/commands/dev.d.ts +14 -0
- package/dist/commands/dev.d.ts.map +1 -0
- package/dist/commands/dev.js +67 -0
- package/dist/commands/dev.js.map +1 -0
- package/dist/commands/diff.d.ts +16 -0
- package/dist/commands/diff.d.ts.map +1 -0
- package/dist/commands/diff.js +239 -0
- package/dist/commands/diff.js.map +1 -0
- package/dist/commands/doctor.d.ts +10 -0
- package/dist/commands/doctor.d.ts.map +1 -0
- package/dist/commands/doctor.js +532 -0
- package/dist/commands/doctor.js.map +1 -0
- package/dist/commands/explain.d.ts +12 -0
- package/dist/commands/explain.d.ts.map +1 -0
- package/dist/commands/explain.js +368 -0
- package/dist/commands/explain.js.map +1 -0
- package/dist/commands/generate.d.ts +17 -0
- package/dist/commands/generate.d.ts.map +1 -0
- package/dist/commands/generate.js +833 -0
- package/dist/commands/generate.js.map +1 -0
- package/dist/commands/info.d.ts +12 -0
- package/dist/commands/info.d.ts.map +1 -0
- package/dist/commands/info.js +100 -0
- package/dist/commands/info.js.map +1 -0
- package/dist/commands/init.d.ts +22 -0
- package/dist/commands/init.d.ts.map +1 -0
- package/dist/commands/init.js +295 -0
- package/dist/commands/init.js.map +1 -0
- package/dist/commands/lint.d.ts +13 -0
- package/dist/commands/lint.d.ts.map +1 -0
- package/dist/commands/lint.js +255 -0
- package/dist/commands/lint.js.map +1 -0
- package/dist/commands/plugin/add.d.ts +22 -0
- package/dist/commands/plugin/add.d.ts.map +1 -0
- package/dist/commands/plugin/add.js +93 -0
- package/dist/commands/plugin/add.js.map +1 -0
- package/dist/commands/plugin/info.d.ts +10 -0
- package/dist/commands/plugin/info.d.ts.map +1 -0
- package/dist/commands/plugin/info.js +65 -0
- package/dist/commands/plugin/info.js.map +1 -0
- package/dist/commands/plugin/list.d.ts +13 -0
- package/dist/commands/plugin/list.d.ts.map +1 -0
- package/dist/commands/plugin/list.js +78 -0
- package/dist/commands/plugin/list.js.map +1 -0
- package/dist/commands/plugin/remove.d.ts +20 -0
- package/dist/commands/plugin/remove.d.ts.map +1 -0
- package/dist/commands/plugin/remove.js +79 -0
- package/dist/commands/plugin/remove.js.map +1 -0
- package/dist/commands/serve.d.ts +15 -0
- package/dist/commands/serve.d.ts.map +1 -0
- package/dist/commands/serve.js +286 -0
- package/dist/commands/serve.js.map +1 -0
- package/dist/commands/studio.d.ts +19 -0
- package/dist/commands/studio.d.ts.map +1 -0
- package/dist/commands/studio.js +43 -0
- package/dist/commands/studio.js.map +1 -0
- package/dist/commands/test.d.ts +13 -0
- package/dist/commands/test.d.ts.map +1 -0
- package/dist/commands/test.js +120 -0
- package/dist/commands/test.js.map +1 -0
- package/dist/commands/validate.d.ts +13 -0
- package/dist/commands/validate.d.ts.map +1 -0
- package/dist/commands/validate.js +115 -0
- package/dist/commands/validate.js.map +1 -0
- package/dist/index.d.ts +15 -114
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +20 -2799
- package/dist/index.js.map +1 -0
- package/dist/utils/config.d.ts +21 -0
- package/dist/utils/config.d.ts.map +1 -0
- package/dist/utils/config.js +66 -0
- package/dist/utils/config.js.map +1 -0
- package/dist/utils/format.d.ts +52 -0
- package/dist/utils/format.d.ts.map +1 -0
- package/dist/utils/format.js +202 -0
- package/dist/utils/format.js.map +1 -0
- package/dist/utils/plugin-helpers.d.ts +14 -0
- package/dist/utils/plugin-helpers.d.ts.map +1 -0
- package/dist/utils/plugin-helpers.js +40 -0
- package/dist/utils/plugin-helpers.js.map +1 -0
- package/dist/utils/studio.d.ts +58 -0
- package/dist/utils/studio.d.ts.map +1 -0
- package/dist/utils/studio.js +288 -0
- package/dist/utils/studio.js.map +1 -0
- package/package.json +33 -15
- package/src/bin.ts +11 -104
- package/src/commands/{codemod.ts → codemod/v2-to-v3.ts} +21 -28
- package/src/commands/compile.ts +35 -25
- package/src/commands/create.ts +29 -19
- package/src/commands/dev.ts +21 -10
- package/src/commands/diff.ts +28 -19
- package/src/commands/doctor.ts +20 -11
- package/src/commands/explain.ts +20 -10
- package/src/commands/generate.ts +81 -90
- package/src/commands/info.ts +22 -11
- package/src/commands/init.ts +32 -20
- package/src/commands/lint.ts +27 -15
- package/src/commands/plugin/add.ts +112 -0
- package/src/commands/plugin/info.ts +79 -0
- package/src/commands/plugin/list.ts +93 -0
- package/src/commands/plugin/remove.ts +97 -0
- package/src/commands/serve.ts +30 -20
- package/src/commands/studio.ts +21 -11
- package/src/commands/test.ts +21 -10
- package/src/commands/validate.ts +36 -25
- package/src/index.ts +20 -12
- package/src/utils/format.ts +10 -6
- package/src/utils/plugin-helpers.ts +37 -0
- package/src/utils/studio.ts +0 -1
- package/test/commands.test.ts +76 -37
- package/test/plugin-commands.test.ts +42 -160
- package/test/plugin.test.ts +19 -23
- package/tsconfig.build.json +18 -0
- package/bin/objectstack.js +0 -2
- package/dist/chunk-CSHQEILI.js +0 -246
- package/dist/chunk-Q74JNWKD.js +0 -248
- package/dist/config-A7BN6UIT.js +0 -11
- package/dist/config-UN34WBHT.js +0 -10
- package/src/commands/plugin.ts +0 -372
- package/src/utils/plugin-commands.ts +0 -163
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,28 +1,4 @@
|
|
|
1
1
|
|
|
2
|
-
> @objectstack/cli@3.0.
|
|
3
|
-
>
|
|
2
|
+
> @objectstack/cli@3.0.7 build /home/runner/work/spec/spec/packages/cli
|
|
3
|
+
> tsc -p tsconfig.build.json
|
|
4
4
|
|
|
5
|
-
[34mCLI[39m Building entry: src/bin.ts
|
|
6
|
-
[34mCLI[39m Using tsconfig: tsconfig.json
|
|
7
|
-
[34mCLI[39m tsup v8.5.1
|
|
8
|
-
[34mCLI[39m Using tsup config: /home/runner/work/spec/spec/packages/cli/tsup.config.ts
|
|
9
|
-
[34mCLI[39m Building entry: src/index.ts
|
|
10
|
-
[34mCLI[39m Using tsconfig: tsconfig.json
|
|
11
|
-
[34mCLI[39m tsup v8.5.1
|
|
12
|
-
[34mCLI[39m Using tsup config: /home/runner/work/spec/spec/packages/cli/tsup.config.ts
|
|
13
|
-
[34mCLI[39m Target: es2022
|
|
14
|
-
[34mCLI[39m Target: es2022
|
|
15
|
-
[34mESM[39m Build start
|
|
16
|
-
[34mCLI[39m Cleaning output folder
|
|
17
|
-
[34mESM[39m Build start
|
|
18
|
-
[32mESM[39m [1mdist/index.js [22m[32m94.66 KB[39m
|
|
19
|
-
[32mESM[39m [1mdist/config-UN34WBHT.js [22m[32m151.00 B[39m
|
|
20
|
-
[32mESM[39m [1mdist/chunk-CSHQEILI.js [22m[32m7.29 KB[39m
|
|
21
|
-
[32mESM[39m ⚡️ Build success in 186ms
|
|
22
|
-
[32mESM[39m [1mdist/bin.js [22m[32m131.47 KB[39m
|
|
23
|
-
[32mESM[39m [1mdist/config-A7BN6UIT.js [22m[32m171.00 B[39m
|
|
24
|
-
[32mESM[39m [1mdist/chunk-Q74JNWKD.js [22m[32m7.31 KB[39m
|
|
25
|
-
[32mESM[39m ⚡️ Build success in 186ms
|
|
26
|
-
[34mDTS[39m Build start
|
|
27
|
-
[32mDTS[39m ⚡️ Build success in 14521ms
|
|
28
|
-
[32mDTS[39m [1mdist/index.d.ts [22m[32m3.42 KB[39m
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,32 @@
|
|
|
1
1
|
# @objectstack/cli
|
|
2
2
|
|
|
3
|
+
## 3.0.7
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies [0119bd7]
|
|
8
|
+
- Updated dependencies [5426bdf]
|
|
9
|
+
- @objectstack/spec@3.0.7
|
|
10
|
+
- @objectstack/core@3.0.7
|
|
11
|
+
- @objectstack/objectql@3.0.7
|
|
12
|
+
- @objectstack/driver-memory@3.0.7
|
|
13
|
+
- @objectstack/plugin-hono-server@3.0.7
|
|
14
|
+
- @objectstack/rest@3.0.7
|
|
15
|
+
- @objectstack/runtime@3.0.7
|
|
16
|
+
|
|
17
|
+
## 3.0.6
|
|
18
|
+
|
|
19
|
+
### Patch Changes
|
|
20
|
+
|
|
21
|
+
- Updated dependencies [5df254c]
|
|
22
|
+
- @objectstack/spec@3.0.6
|
|
23
|
+
- @objectstack/core@3.0.6
|
|
24
|
+
- @objectstack/objectql@3.0.6
|
|
25
|
+
- @objectstack/driver-memory@3.0.6
|
|
26
|
+
- @objectstack/plugin-hono-server@3.0.6
|
|
27
|
+
- @objectstack/rest@3.0.6
|
|
28
|
+
- @objectstack/runtime@3.0.6
|
|
29
|
+
|
|
3
30
|
## 3.0.5
|
|
4
31
|
|
|
5
32
|
### Patch Changes
|
package/README.md
CHANGED
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
Command Line Interface for building metadata-driven applications with the ObjectStack Protocol.
|
|
4
4
|
|
|
5
|
+
Built on [oclif](https://oclif.io/) — commands are auto-discovered, and plugins can extend the CLI without modifying the main package.
|
|
6
|
+
|
|
5
7
|
## Installation
|
|
6
8
|
|
|
7
9
|
```bash
|
|
@@ -40,6 +42,7 @@ os compile
|
|
|
40
42
|
| `os init [name]` | Initialize a new ObjectStack project in the current directory |
|
|
41
43
|
| `os dev [package]` | Start development mode with hot reload |
|
|
42
44
|
| `os serve [config]` | Start the ObjectStack server with plugin auto-detection |
|
|
45
|
+
| `os studio [config]` | Launch Studio UI with development server |
|
|
43
46
|
|
|
44
47
|
### Build & Validate
|
|
45
48
|
|
|
@@ -73,6 +76,20 @@ Available generate types: `object`, `view`, `action`, `flow`, `agent`, `dashboar
|
|
|
73
76
|
|---------|-------------|
|
|
74
77
|
| `os test [files]` | Run Quality Protocol test scenarios against a running server |
|
|
75
78
|
| `os doctor` | Check development environment health |
|
|
79
|
+
| `os lint [config]` | Check configuration for style and convention issues |
|
|
80
|
+
| `os diff [before] [after]` | Compare two configurations and detect breaking changes |
|
|
81
|
+
|
|
82
|
+
### Reference
|
|
83
|
+
|
|
84
|
+
| Command | Description |
|
|
85
|
+
|---------|-------------|
|
|
86
|
+
| `os explain [schema]` | Display human-readable explanation of an ObjectStack schema |
|
|
87
|
+
|
|
88
|
+
### Code Transforms
|
|
89
|
+
|
|
90
|
+
| Command | Description |
|
|
91
|
+
|---------|-------------|
|
|
92
|
+
| `os codemod v2-to-v3` | Migrate ObjectStack v2 config to v3 format |
|
|
76
93
|
|
|
77
94
|
## Configuration
|
|
78
95
|
|
|
@@ -120,12 +137,12 @@ export default defineStack({
|
|
|
120
137
|
|
|
121
138
|
- `-p, --port <port>` — Server port (default: `3000`)
|
|
122
139
|
- `--dev` — Run in development mode (load devPlugins, pretty logging)
|
|
140
|
+
- `--ui` — Enable Studio UI
|
|
123
141
|
- `--no-server` — Skip starting HTTP server plugin
|
|
124
142
|
|
|
125
143
|
### `os generate`
|
|
126
144
|
|
|
127
145
|
- `-d, --dir <directory>` — Override target directory
|
|
128
|
-
- `--dry-run` — Preview without writing files
|
|
129
146
|
|
|
130
147
|
### `os plugin list`
|
|
131
148
|
|
|
@@ -140,75 +157,78 @@ export default defineStack({
|
|
|
140
157
|
|
|
141
158
|
- `-c, --config <path>` — Configuration file path
|
|
142
159
|
|
|
143
|
-
|
|
160
|
+
### `os info`
|
|
161
|
+
|
|
162
|
+
- `--json` — Output as JSON
|
|
144
163
|
|
|
145
|
-
|
|
164
|
+
### `os doctor`
|
|
146
165
|
|
|
147
|
-
|
|
166
|
+
- `-v, --verbose` — Show fix suggestions for warnings
|
|
167
|
+
- `--scan-deprecations` — Scan for deprecated patterns
|
|
148
168
|
|
|
149
|
-
|
|
169
|
+
## oclif Plugin System
|
|
150
170
|
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
171
|
+
The CLI uses oclif's built-in plugin system for extensibility. Third-party plugins (e.g., cloud commands, marketplace tools) can extend the CLI without modifying the main package.
|
|
172
|
+
|
|
173
|
+
### How Plugin Extension Works
|
|
174
|
+
|
|
175
|
+
1. **Create an oclif plugin package** with its own `oclif` config in `package.json`
|
|
176
|
+
2. **Export oclif Command classes** from the plugin's `src/commands/` directory
|
|
177
|
+
3. **Install the plugin** via `os plugins install <package>` or declare it in the main CLI's `oclif.plugins`
|
|
178
|
+
|
|
179
|
+
### Creating a CLI Plugin
|
|
180
|
+
|
|
181
|
+
**1. Configure the plugin's `package.json`:**
|
|
182
|
+
|
|
183
|
+
```json
|
|
184
|
+
{
|
|
185
|
+
"name": "@acme/plugin-marketplace",
|
|
186
|
+
"oclif": {
|
|
187
|
+
"commands": {
|
|
188
|
+
"strategy": "pattern",
|
|
189
|
+
"target": "./dist/commands",
|
|
190
|
+
"glob": "**/*.js"
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
}
|
|
169
194
|
```
|
|
170
195
|
|
|
171
|
-
**2.
|
|
196
|
+
**2. Create oclif Command classes:**
|
|
172
197
|
|
|
173
198
|
```typescript
|
|
174
|
-
// src/
|
|
175
|
-
import { Command } from '
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
// Named export (recommended)
|
|
191
|
-
export const commands = [marketplaceCommand];
|
|
192
|
-
// Also supports: export default Command | Command[]
|
|
199
|
+
// src/commands/marketplace/search.ts
|
|
200
|
+
import { Args, Command, Flags } from '@oclif/core';
|
|
201
|
+
|
|
202
|
+
export default class MarketplaceSearch extends Command {
|
|
203
|
+
static override description = 'Search marketplace applications';
|
|
204
|
+
|
|
205
|
+
static override args = {
|
|
206
|
+
query: Args.string({ description: 'Search query', required: true }),
|
|
207
|
+
};
|
|
208
|
+
|
|
209
|
+
async run() {
|
|
210
|
+
const { args } = await this.parse(MarketplaceSearch);
|
|
211
|
+
// Implementation...
|
|
212
|
+
}
|
|
213
|
+
}
|
|
193
214
|
```
|
|
194
215
|
|
|
195
|
-
**3.
|
|
216
|
+
**3. Install and use:**
|
|
196
217
|
|
|
197
218
|
```bash
|
|
198
|
-
os
|
|
219
|
+
os plugins install @acme/plugin-marketplace
|
|
199
220
|
os marketplace search "crm"
|
|
200
|
-
os marketplace install com.acme.crm
|
|
201
221
|
```
|
|
202
222
|
|
|
203
|
-
|
|
223
|
+
### Key Differences from Previous Plugin Model
|
|
204
224
|
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
225
|
+
| Before (Commander.js) | After (oclif) |
|
|
226
|
+
|---|---|
|
|
227
|
+
| Plugins declared in `objectstack.config.ts` | Plugins installed via `os plugins install` or `oclif.plugins` |
|
|
228
|
+
| Custom `loadPluginCommands` mechanism | oclif's built-in plugin discovery |
|
|
229
|
+
| `contributes.commands` in manifest | `oclif.commands` in `package.json` |
|
|
230
|
+
| Commander.js `new Command(...)` exports | oclif `class extends Command` exports |
|
|
231
|
+
| Project config determines CLI commands | CLI commands available without project init |
|
|
212
232
|
|
|
213
233
|
## Typical Workflow
|
|
214
234
|
|
|
@@ -223,6 +243,30 @@ os dev # 7. Start dev server
|
|
|
223
243
|
os compile # 8. Build for production
|
|
224
244
|
```
|
|
225
245
|
|
|
246
|
+
## Architecture
|
|
247
|
+
|
|
248
|
+
```
|
|
249
|
+
@objectstack/cli (oclif)
|
|
250
|
+
├── bin/run.js # Entry point (os / objectstack)
|
|
251
|
+
├── src/commands/ # Auto-discovered command classes
|
|
252
|
+
│ ├── init.ts # os init
|
|
253
|
+
│ ├── dev.ts # os dev
|
|
254
|
+
│ ├── serve.ts # os serve
|
|
255
|
+
│ ├── compile.ts # os compile
|
|
256
|
+
│ ├── validate.ts # os validate
|
|
257
|
+
│ ├── generate.ts # os generate (alias: g)
|
|
258
|
+
│ ├── plugin/ # os plugin <subcommand>
|
|
259
|
+
│ │ ├── list.ts
|
|
260
|
+
│ │ ├── info.ts
|
|
261
|
+
│ │ ├── add.ts
|
|
262
|
+
│ │ └── remove.ts
|
|
263
|
+
│ ├── codemod/ # os codemod <subcommand>
|
|
264
|
+
│ │ └── v2-to-v3.ts
|
|
265
|
+
│ └── ...
|
|
266
|
+
├── src/utils/ # Shared utilities
|
|
267
|
+
└── package.json # oclif config under "oclif" key
|
|
268
|
+
```
|
|
269
|
+
|
|
226
270
|
## License
|
|
227
271
|
|
|
228
272
|
Apache-2.0
|
package/bin/run-dev.js
ADDED
package/bin/run.js
ADDED
package/dist/bin.d.ts
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ObjectStack CLI — oclif-based entry point.
|
|
3
|
+
*
|
|
4
|
+
* All commands are auto-discovered from `src/commands/` by oclif.
|
|
5
|
+
* Plugins extend the CLI via oclif's built-in plugin system
|
|
6
|
+
* (configured in package.json under "oclif.plugins").
|
|
7
|
+
*
|
|
8
|
+
* Run `os --help` for available commands.
|
|
9
|
+
*/
|
|
10
|
+
export { execute } from '@oclif/core';
|
|
11
|
+
//# sourceMappingURL=bin.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bin.d.ts","sourceRoot":"","sources":["../src/bin.ts"],"names":[],"mappings":"AAEA;;;;;;;;GAQG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC"}
|