@naseej/blox 1.8.0 → 1.10.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.
Files changed (3) hide show
  1. package/dist/run.js +3433 -833
  2. package/package.json +12 -4
  3. package/readme.md +76 -12
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@naseej/blox",
3
- "version": "1.8.0",
3
+ "version": "1.10.0",
4
4
  "description": "blox cli",
5
5
  "exports": {
6
6
  "./sdk": {
@@ -28,7 +28,10 @@
28
28
  "compile": "tsc",
29
29
  "start": "tsx ./bin/run.ts",
30
30
  "start:node": "node ./bin/run",
31
- "test": "tsx --tsconfig tsconfig.scripts.json scripts/run-tests.ts",
31
+ "test": "tsx --tsconfig tsconfig.scripts.json scripts/run-all-tests.ts",
32
+ "test:e2e": "tsx --tsconfig tsconfig.scripts.json scripts/run-e2e-tests.ts",
33
+ "test:unit": "cross-env TEST_TYPE=unit vitest run",
34
+ "test:integration": "cross-env TEST_TYPE=integration vitest run",
32
35
  "test:watch": "playwright test --ui",
33
36
  "lint": "oxlint",
34
37
  "lint:fix": "oxlint --fix",
@@ -37,6 +40,7 @@
37
40
  "format:check": "oxfmt --check",
38
41
  "watch": "tsc --watch",
39
42
  "type-check": "tsc --noEmit",
43
+ "sync:tools": "tsx scripts/sync-tools.ts",
40
44
  "generate:schema": "tsx --tsconfig tsconfig.scripts.json scripts/generate-schema.ts",
41
45
  "check:schema": "tsx --tsconfig tsconfig.scripts.json scripts/check-schema.ts",
42
46
  "prepare": "husky",
@@ -57,23 +61,27 @@
57
61
  "@types/signale": "^1.4.7",
58
62
  "@types/yargs": "^17.0.32",
59
63
  "cli-docs-generator": "^1.0.7",
64
+ "cross-env": "^10.1.0",
65
+ "dotenv": "^18.0.8",
60
66
  "execa": "^9.6.1",
61
67
  "husky": "^9.1.7",
62
68
  "node-pty": "^1.1.0",
63
69
  "oxfmt": "^0.68.0",
64
70
  "oxlint": "^1.83.0",
65
71
  "patch-package": "^8.0.0",
72
+ "simple-git": "^4.0.2",
66
73
  "tsup": "^8.0.2",
67
74
  "tsx": "4.19.2",
68
- "typescript": "^5.7.2",
69
75
  "vite-tsconfig-paths": "^5.1.4",
70
76
  "vitest": "2.1.8"
71
77
  },
72
78
  "dependencies": {
73
- "@clack/prompts": "^0.8.2",
79
+ "@clack/core": "0.3.5",
80
+ "@clack/prompts": "0.8.2",
74
81
  "@commander-js/extra-typings": "12.1.0",
75
82
  "ansis": "3.3.2",
76
83
  "commander": "12.1.0",
84
+ "typescript": "^5.7.2",
77
85
  "cross-spawn": "^7.0.6",
78
86
  "dayjs": "1.11.13",
79
87
  "ejs": "^3.1.10",
package/readme.md CHANGED
@@ -27,14 +27,30 @@ Start with the core commands:
27
27
  blox --help
28
28
  blox init
29
29
  blox add
30
+ blox remove
30
31
  blox update
31
32
  ```
32
33
 
34
+ Global flags:
35
+
36
+ - `-d, --debug`: enable debug mode
37
+ - `-m, --minimal`: reduce interactive or spinner-heavy output
38
+
33
39
  ## Commands
34
40
 
35
- Other available command:
41
+ Available commands:
36
42
 
37
- - `blox detach`: detach to base
43
+ - `blox init`: initialize a new app
44
+ - `blox add`: add one or more blocks
45
+ - `blox remove`: remove one or more installed blocks
46
+ - `blox update`: update the app, bases, or blocks
47
+ - `blox conf`: set global BLOX configuration
48
+ - `blox contribute`: contribute changes back to template, base, or block repositories
49
+ - `blox detach`: detach the app definition to one of its bases
50
+ - `blox migrate`: migrate BLOX schema state
51
+ - `blox upgrade`: upgrade BLOX CLI
52
+ - `blox skills`: run BLOX CLI skills commands
53
+ - `blox doctor`: diagnose and optionally repair BLOX workspace issues
38
54
 
39
55
  ### init
40
56
 
@@ -76,7 +92,12 @@ Important options:
76
92
  Important notes:
77
93
 
78
94
  - If `blocks` are omitted, BLOX prompts with a multiselect from available blocks.
95
+ - Installed blocks are marked in the list and skipped if selected again, including blocks installed under a custom destination.
79
96
  - Blocks are processed sequentially in the order provided.
97
+ - A failed block does not stop the remaining selections or roll back successful additions.
98
+ - If a block hook fails, BLOX displays its error and output and asks whether to continue with a warning or abort that block (the default).
99
+ - Aborted additions remove newly created project files and restore `.blox` metadata. Pre-existing files, shared `.git` and `node_modules` directories, and completed dependencies are preserved. Other edits made by hooks to pre-existing files are not reverted; review those manually.
100
+ - A final summary lists additions, warnings, skipped blocks, and failures. Any failed block causes a non-zero exit code; accepted hook warnings alone do not.
80
101
 
81
102
  ### remove
82
103
 
@@ -119,6 +140,8 @@ Important options:
119
140
 
120
141
  - `-s, --scope`: `app`, `bases`, `block`, or `all` (default: `all`)
121
142
  - `-b, --block`: block to update (valid only when `--scope block`)
143
+ - `--ignore <list...>`: ignore patterns scoped by repo name, for example `repo:file`
144
+ - `--hard`: overwrite local changes during update
122
145
 
123
146
  Important notes:
124
147
 
@@ -145,6 +168,12 @@ Important options:
145
168
  - `--type <type>`: target type (`template`, `base`, or `block`)
146
169
  - `--name <name>`: target name (used with `--type`)
147
170
 
171
+ Important notes:
172
+
173
+ - Without a matching `--type` and `--name`, BLOX lets you select one or more available targets. Press `s` in the target list to search.
174
+ - When both flags match a discovered target, BLOX skips target selection. If the match is not found or only one flag is provided, BLOX warns and shows the available targets.
175
+ - If a selected target has no registry source, BLOX reports it as skipped and continues with the remaining targets.
176
+
148
177
  ### conf
149
178
 
150
179
  Set global BLOX configuration.
@@ -159,6 +188,20 @@ Important options:
159
188
 
160
189
  - `-r, --registries`: remote registry URLs
161
190
 
191
+ ### detach
192
+
193
+ Detach the app definition to one of its configured bases.
194
+
195
+ Usage:
196
+
197
+ ```sh
198
+ blox detach
199
+ ```
200
+
201
+ Important options:
202
+
203
+ - `--basic`: run detach only, without registry sync and migration first
204
+
162
205
  ### upgrade
163
206
 
164
207
  Upgrade BLOX CLI to the latest version.
@@ -191,8 +234,29 @@ blox skills <command> [options]
191
234
 
192
235
  Important notes:
193
236
 
194
- - BLOX passes the BLOX content URL directly to Skills CLI for `add` flows.
195
- - No repository URL is required.
237
+ - For `blox skills add`, BLOX injects the BLOX skills repository URL when you do not provide one.
238
+ - BLOX forwards the remaining arguments to `npx skills`.
239
+
240
+ ### doctor
241
+
242
+ Run diagnostic checks against the workspace and report findings as invalid, outdated, or informational. Ships with a `schema.validation` check that validates `.blox` files against the current schema; new checks plug into the same pipeline.
243
+
244
+ Usage:
245
+
246
+ ```sh
247
+ blox doctor
248
+ blox doctor --fix
249
+ ```
250
+
251
+ Options:
252
+
253
+ - `--fix`: attempt automatic repairs for findings that support them, then revalidate
254
+
255
+ Exit codes:
256
+
257
+ - `0`: checks completed with no unresolved invalid findings
258
+ - `1`: invalid findings remain, or a repair failed
259
+ - `2`: a check could not complete reliably
196
260
 
197
261
  ## Features
198
262
 
@@ -223,10 +287,10 @@ Example root `.blox` configuration:
223
287
  How ignore sources are combined:
224
288
 
225
289
  - `blox update` combines patterns from:
226
- - remote template ignore (`definition.ignore`)
227
- - local project ignore (`project.ignore` in local `.blox`)
228
- - local `.gitignore`
229
- - command option `--ignore` (when provided)
290
+ - remote template ignore (`definition.ignore`)
291
+ - local project ignore (`project.ignore` in local `.blox`)
292
+ - local `.gitignore`
293
+ - command option `--ignore` (when provided)
230
294
  - `blox contribute` also respects local `project.ignore`.
231
295
  - Local `project.ignore` is project-owned and is not replaced by remote template ignore during update.
232
296
 
@@ -292,7 +356,7 @@ Use `blox skills` to run the Skills CLI against the BLOX CLI skills repository.
292
356
  Behavior:
293
357
 
294
358
  - BLOX executes `npx skills` with all arguments passed after `skills`.
295
- - BLOX uses the BLOX content URL directly as the skills source .
359
+ - For `add` commands, BLOX injects the BLOX skills repository URL when the source argument is omitted.
296
360
 
297
361
  #### CLI Compatibility
298
362
 
@@ -321,7 +385,7 @@ Skills are not tied to a specific editor or product. They work across tools that
321
385
 
322
386
  Create a new template by starting from an existing one, updating its metadata, then publishing it.
323
387
 
324
- #### 1 - Initialize from an existing template
388
+ ### 1 - Initialize from an existing template
325
389
 
326
390
  Create a new project using the template you want to build on.
327
391
 
@@ -331,14 +395,14 @@ Example:
331
395
  blox init -n my-template -t existing-template
332
396
  ```
333
397
 
334
- #### 2 - Update `.blox` configuration
398
+ ### 2 - Update `.blox` configuration
335
399
 
336
400
  Edit your project's `.blox` file to describe the new template.
337
401
 
338
402
  - Set `definition.name` to your new template name.
339
403
  - Keep the original template in the `bases` list so you can continue receiving updates from it.
340
404
 
341
- #### 3 - Publish and register the template
405
+ ### 3 - Publish and register the template
342
406
 
343
407
  - Push the template project to a remote repository.
344
408
  - Add that repository to a BLOX registry (Or any custom registry) so BLOX CLI can discover and use your template.