@naseej/blox 1.8.0 → 1.9.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 +1245 -533
  2. package/package.json +11 -3
  3. package/readme.md +54 -12
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@naseej/blox",
3
- "version": "1.8.0",
3
+ "version": "1.9.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,12 +61,15 @@
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
75
  "typescript": "^5.7.2",
@@ -70,7 +77,8 @@
70
77
  "vitest": "2.1.8"
71
78
  },
72
79
  "dependencies": {
73
- "@clack/prompts": "^0.8.2",
80
+ "@clack/core": "0.3.5",
81
+ "@clack/prompts": "0.8.2",
74
82
  "@commander-js/extra-typings": "12.1.0",
75
83
  "ansis": "3.3.2",
76
84
  "commander": "12.1.0",
package/readme.md CHANGED
@@ -27,14 +27,29 @@ 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
38
53
 
39
54
  ### init
40
55
 
@@ -76,7 +91,12 @@ Important options:
76
91
  Important notes:
77
92
 
78
93
  - If `blocks` are omitted, BLOX prompts with a multiselect from available blocks.
94
+ - Installed blocks are marked in the list and skipped if selected again, including blocks installed under a custom destination.
79
95
  - Blocks are processed sequentially in the order provided.
96
+ - A failed block does not stop the remaining selections or roll back successful additions.
97
+ - 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).
98
+ - 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.
99
+ - 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
100
 
81
101
  ### remove
82
102
 
@@ -119,6 +139,8 @@ Important options:
119
139
 
120
140
  - `-s, --scope`: `app`, `bases`, `block`, or `all` (default: `all`)
121
141
  - `-b, --block`: block to update (valid only when `--scope block`)
142
+ - `--ignore <list...>`: ignore patterns scoped by repo name, for example `repo:file`
143
+ - `--hard`: overwrite local changes during update
122
144
 
123
145
  Important notes:
124
146
 
@@ -145,6 +167,12 @@ Important options:
145
167
  - `--type <type>`: target type (`template`, `base`, or `block`)
146
168
  - `--name <name>`: target name (used with `--type`)
147
169
 
170
+ Important notes:
171
+
172
+ - Without a matching `--type` and `--name`, BLOX lets you select one or more available targets. Press `s` in the target list to search.
173
+ - 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.
174
+ - If a selected target has no registry source, BLOX reports it as skipped and continues with the remaining targets.
175
+
148
176
  ### conf
149
177
 
150
178
  Set global BLOX configuration.
@@ -159,6 +187,20 @@ Important options:
159
187
 
160
188
  - `-r, --registries`: remote registry URLs
161
189
 
190
+ ### detach
191
+
192
+ Detach the app definition to one of its configured bases.
193
+
194
+ Usage:
195
+
196
+ ```sh
197
+ blox detach
198
+ ```
199
+
200
+ Important options:
201
+
202
+ - `--basic`: run detach only, without registry sync and migration first
203
+
162
204
  ### upgrade
163
205
 
164
206
  Upgrade BLOX CLI to the latest version.
@@ -191,8 +233,8 @@ blox skills <command> [options]
191
233
 
192
234
  Important notes:
193
235
 
194
- - BLOX passes the BLOX content URL directly to Skills CLI for `add` flows.
195
- - No repository URL is required.
236
+ - For `blox skills add`, BLOX injects the BLOX skills repository URL when you do not provide one.
237
+ - BLOX forwards the remaining arguments to `npx skills`.
196
238
 
197
239
  ## Features
198
240
 
@@ -223,10 +265,10 @@ Example root `.blox` configuration:
223
265
  How ignore sources are combined:
224
266
 
225
267
  - `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)
268
+ - remote template ignore (`definition.ignore`)
269
+ - local project ignore (`project.ignore` in local `.blox`)
270
+ - local `.gitignore`
271
+ - command option `--ignore` (when provided)
230
272
  - `blox contribute` also respects local `project.ignore`.
231
273
  - Local `project.ignore` is project-owned and is not replaced by remote template ignore during update.
232
274
 
@@ -292,7 +334,7 @@ Use `blox skills` to run the Skills CLI against the BLOX CLI skills repository.
292
334
  Behavior:
293
335
 
294
336
  - BLOX executes `npx skills` with all arguments passed after `skills`.
295
- - BLOX uses the BLOX content URL directly as the skills source .
337
+ - For `add` commands, BLOX injects the BLOX skills repository URL when the source argument is omitted.
296
338
 
297
339
  #### CLI Compatibility
298
340
 
@@ -321,7 +363,7 @@ Skills are not tied to a specific editor or product. They work across tools that
321
363
 
322
364
  Create a new template by starting from an existing one, updating its metadata, then publishing it.
323
365
 
324
- #### 1 - Initialize from an existing template
366
+ ### 1 - Initialize from an existing template
325
367
 
326
368
  Create a new project using the template you want to build on.
327
369
 
@@ -331,14 +373,14 @@ Example:
331
373
  blox init -n my-template -t existing-template
332
374
  ```
333
375
 
334
- #### 2 - Update `.blox` configuration
376
+ ### 2 - Update `.blox` configuration
335
377
 
336
378
  Edit your project's `.blox` file to describe the new template.
337
379
 
338
380
  - Set `definition.name` to your new template name.
339
381
  - Keep the original template in the `bases` list so you can continue receiving updates from it.
340
382
 
341
- #### 3 - Publish and register the template
383
+ ### 3 - Publish and register the template
342
384
 
343
385
  - Push the template project to a remote repository.
344
386
  - Add that repository to a BLOX registry (Or any custom registry) so BLOX CLI can discover and use your template.