@objectstack/cli 2.0.6 → 3.0.0
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 +10 -6
- package/CHANGELOG.md +30 -0
- package/README.md +88 -3
- package/dist/bin.js +691 -425
- package/dist/chunk-CSHQEILI.js +246 -0
- package/dist/chunk-Q74JNWKD.js +248 -0
- package/dist/config-A7BN6UIT.js +11 -0
- package/dist/config-UN34WBHT.js +10 -0
- package/dist/index.d.ts +14 -1
- package/dist/index.js +641 -382
- package/package.json +9 -9
- package/src/bin.ts +18 -1
- package/src/commands/generate.ts +181 -3
- package/src/commands/plugin.ts +372 -0
- package/src/index.ts +2 -0
- package/src/utils/plugin-commands.ts +163 -0
- package/test/commands.test.ts +6 -0
- package/test/plugin-commands.test.ts +162 -0
- package/test/plugin.test.ts +173 -0
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
> @objectstack/cli@
|
|
2
|
+
> @objectstack/cli@3.0.0 build /home/runner/work/spec/spec/packages/cli
|
|
3
3
|
> tsup
|
|
4
4
|
|
|
5
5
|
[34mCLI[39m Building entry: src/bin.ts
|
|
@@ -15,10 +15,14 @@
|
|
|
15
15
|
[34mESM[39m Build start
|
|
16
16
|
[34mCLI[39m Cleaning output folder
|
|
17
17
|
[34mESM[39m Build start
|
|
18
|
-
[32mESM[39m [1mdist/index.js
|
|
19
|
-
[32mESM[39m
|
|
20
|
-
[32mESM[39m [1mdist/
|
|
18
|
+
[32mESM[39m [1mdist/index.js [22m[32m69.92 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 188ms
|
|
22
|
+
[32mESM[39m [1mdist/bin.js [22m[32m72.87 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
|
|
21
25
|
[32mESM[39m ⚡️ Build success in 186ms
|
|
22
26
|
[34mDTS[39m Build start
|
|
23
|
-
[32mDTS[39m ⚡️ Build success in
|
|
24
|
-
[32mDTS[39m [1mdist/index.d.ts [22m[
|
|
27
|
+
[32mDTS[39m ⚡️ Build success in 9514ms
|
|
28
|
+
[32mDTS[39m [1mdist/index.d.ts [22m[32m3.42 KB[39m
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,35 @@
|
|
|
1
1
|
# @objectstack/cli
|
|
2
2
|
|
|
3
|
+
## 3.0.0
|
|
4
|
+
|
|
5
|
+
### Major Changes
|
|
6
|
+
|
|
7
|
+
- Release v3.0.0 — unified version bump for all ObjectStack packages.
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- Updated dependencies
|
|
12
|
+
- @objectstack/spec@3.0.0
|
|
13
|
+
- @objectstack/core@3.0.0
|
|
14
|
+
- @objectstack/objectql@3.0.0
|
|
15
|
+
- @objectstack/runtime@3.0.0
|
|
16
|
+
- @objectstack/rest@3.0.0
|
|
17
|
+
- @objectstack/driver-memory@3.0.0
|
|
18
|
+
- @objectstack/plugin-hono-server@3.0.0
|
|
19
|
+
|
|
20
|
+
## 2.0.7
|
|
21
|
+
|
|
22
|
+
### Patch Changes
|
|
23
|
+
|
|
24
|
+
- Updated dependencies
|
|
25
|
+
- @objectstack/spec@2.0.7
|
|
26
|
+
- @objectstack/core@2.0.7
|
|
27
|
+
- @objectstack/objectql@2.0.7
|
|
28
|
+
- @objectstack/driver-memory@2.0.7
|
|
29
|
+
- @objectstack/plugin-hono-server@2.0.7
|
|
30
|
+
- @objectstack/rest@2.0.7
|
|
31
|
+
- @objectstack/runtime@2.0.7
|
|
32
|
+
|
|
3
33
|
## 2.0.6
|
|
4
34
|
|
|
5
35
|
### Patch Changes
|
package/README.md
CHANGED
|
@@ -58,6 +58,15 @@ os compile
|
|
|
58
58
|
|
|
59
59
|
Available generate types: `object`, `view`, `action`, `flow`, `agent`, `dashboard`, `app`
|
|
60
60
|
|
|
61
|
+
### Plugin Management
|
|
62
|
+
|
|
63
|
+
| Command | Description |
|
|
64
|
+
|---------|-------------|
|
|
65
|
+
| `os plugin list [config]` | List plugins defined in configuration (alias: `os plugin ls`) |
|
|
66
|
+
| `os plugin info <name> [config]` | Show detailed plugin information |
|
|
67
|
+
| `os plugin add <package>` | Add a plugin import and entry to config |
|
|
68
|
+
| `os plugin remove <name>` | Remove a plugin from config (alias: `os plugin rm`) |
|
|
69
|
+
|
|
61
70
|
### Quality
|
|
62
71
|
|
|
63
72
|
| Command | Description |
|
|
@@ -118,6 +127,81 @@ export default defineStack({
|
|
|
118
127
|
- `-d, --dir <directory>` — Override target directory
|
|
119
128
|
- `--dry-run` — Preview without writing files
|
|
120
129
|
|
|
130
|
+
### `os plugin list`
|
|
131
|
+
|
|
132
|
+
- `--json` — Output as JSON
|
|
133
|
+
|
|
134
|
+
### `os plugin add`
|
|
135
|
+
|
|
136
|
+
- `-d, --dev` — Add as a dev-only plugin
|
|
137
|
+
- `-c, --config <path>` — Configuration file path
|
|
138
|
+
|
|
139
|
+
### `os plugin remove`
|
|
140
|
+
|
|
141
|
+
- `-c, --config <path>` — Configuration file path
|
|
142
|
+
|
|
143
|
+
## Plugin CLI Extensions
|
|
144
|
+
|
|
145
|
+
Plugins can extend the CLI with custom commands via the `contributes.commands` manifest field. The CLI automatically discovers and loads these commands at startup.
|
|
146
|
+
|
|
147
|
+
### How to Create a CLI Plugin
|
|
148
|
+
|
|
149
|
+
**1. Declare commands in the plugin manifest:**
|
|
150
|
+
|
|
151
|
+
```typescript
|
|
152
|
+
export default defineStack({
|
|
153
|
+
manifest: {
|
|
154
|
+
id: 'com.acme.marketplace',
|
|
155
|
+
version: '1.0.0',
|
|
156
|
+
type: 'plugin',
|
|
157
|
+
name: 'Marketplace Plugin',
|
|
158
|
+
contributes: {
|
|
159
|
+
commands: [
|
|
160
|
+
{
|
|
161
|
+
name: 'marketplace',
|
|
162
|
+
description: 'Manage marketplace applications',
|
|
163
|
+
module: './dist/cli.js',
|
|
164
|
+
},
|
|
165
|
+
],
|
|
166
|
+
},
|
|
167
|
+
},
|
|
168
|
+
});
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
**2. Export Commander.js commands from the module:**
|
|
172
|
+
|
|
173
|
+
```typescript
|
|
174
|
+
// src/cli.ts
|
|
175
|
+
import { Command } from 'commander';
|
|
176
|
+
|
|
177
|
+
const marketplaceCommand = new Command('marketplace')
|
|
178
|
+
.description('Manage marketplace applications')
|
|
179
|
+
.addCommand(
|
|
180
|
+
new Command('search')
|
|
181
|
+
.argument('<query>')
|
|
182
|
+
.action(async (query) => { /* ... */ })
|
|
183
|
+
)
|
|
184
|
+
.addCommand(
|
|
185
|
+
new Command('install')
|
|
186
|
+
.argument('<app>')
|
|
187
|
+
.action(async (app) => { /* ... */ })
|
|
188
|
+
);
|
|
189
|
+
|
|
190
|
+
// Named export (recommended)
|
|
191
|
+
export const commands = [marketplaceCommand];
|
|
192
|
+
// Also supports: export default Command | Command[]
|
|
193
|
+
```
|
|
194
|
+
|
|
195
|
+
**3. Register the plugin in the host project and use:**
|
|
196
|
+
|
|
197
|
+
```bash
|
|
198
|
+
os plugin add @acme/plugin-marketplace
|
|
199
|
+
os marketplace search "crm"
|
|
200
|
+
os marketplace install com.acme.crm
|
|
201
|
+
```
|
|
202
|
+
|
|
203
|
+
For a complete guide, see the [Plugin CLI Extensions](/docs/guides/plugins#cli-command-extensions) section in the Plugins guide.
|
|
204
|
+
|
|
121
205
|
### `os info`
|
|
122
206
|
|
|
123
207
|
- `--json` — Output as JSON
|
|
@@ -133,9 +217,10 @@ os init # 1. Create project
|
|
|
133
217
|
os generate object customer # 2. Add a Customer object
|
|
134
218
|
os generate object order # 3. Add an Order object
|
|
135
219
|
os generate view customer # 4. Add a list view
|
|
136
|
-
os
|
|
137
|
-
os
|
|
138
|
-
os
|
|
220
|
+
os plugin add @objectstack/plugin-auth # 5. Add auth plugin
|
|
221
|
+
os validate # 6. Validate everything
|
|
222
|
+
os dev # 7. Start dev server
|
|
223
|
+
os compile # 8. Build for production
|
|
139
224
|
```
|
|
140
225
|
|
|
141
226
|
## License
|