@naseej/blox 1.11.0 → 1.12.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 +821 -522
  2. package/package.json +1 -1
  3. package/readme.md +18 -13
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@naseej/blox",
3
- "version": "1.11.0",
3
+ "version": "1.12.0",
4
4
  "description": "blox cli",
5
5
  "exports": {
6
6
  "./sdk": {
package/readme.md CHANGED
@@ -54,46 +54,50 @@ Available commands:
54
54
 
55
55
  ## Projects with applications
56
56
 
57
- A BLOX project can contain complete applications vendored under `apps/` inside a single repository. Each application is a full BLOX project with its own `.blox`, configuration, dependencies, and `blocks/` directory:
57
+ A BLOX project can act as a workspace containing complete applications under `apps/`. The workspace is itself a full BLOX template with its own Git repository, and every application is an independent BLOX project with its own Git repository, `.blox`, configuration, dependencies, and `blocks/` directory:
58
58
 
59
59
  ```text
60
60
  my-project/
61
+ ├── .git/
61
62
  ├── .blox
62
- ├── blocks/ # shared root blocks
63
+ ├── .gitignore # ignores apps/<name> directories
64
+ ├── blocks/ # workspace root blocks
63
65
  └── apps/
64
66
  ├── web/
67
+ │ ├── .git/
65
68
  │ ├── .blox
66
69
  │ └── blocks/ # web-specific blocks
67
70
  └── api/
71
+ ├── .git/
68
72
  ├── .blox
69
73
  └── blocks/
70
74
  ```
71
75
 
72
76
  Key behaviors:
73
77
 
74
- - There is one Git repository at the workspace root — applications do not have nested repositories.
78
+ - The workspace and every application are independent Git repositories. Application directories are added to the workspace `.gitignore`, so the root repository never tracks them.
75
79
  - Commands run inside `apps/<name>` automatically scope to that application; `--app <name>` scopes them from the workspace root.
76
80
  - Applications are added and removed like blocks: `blox add app/web` materializes an application under `apps/`; `blox remove app/web` removes it.
77
- - Block dependencies resolve in the owning scope: application blocks resolve same-application blocks first, then root shared blocks; root blocks only resolve other root blocks.
81
+ - Blocks resolve only within their owning scope: application blocks resolve same-application blocks; root blocks only resolve other root blocks. There are no shared blocks between the workspace and its applications.
78
82
  - `blox update` at the workspace root updates the root project and every application sequentially; `--app <name>` restricts it to one application.
79
- - Registries declare applications in a nested `apps` map on the template entry, mirroring `blocks`:
83
+ - `blox contribute` at the workspace root contributes the workspace template; `--app <name>` contributes only that application's repository.
84
+ - Registries declare applications as an `apps` array on the template entry; each entry references an existing template in the registry:
80
85
 
81
86
  ```json
82
87
  {
83
88
  "templates": {
84
89
  "fullstack": {
85
- "apps": {
86
- "web": {
87
- "source": "/template-web",
88
- "destination": "web",
89
- "blocks": { "auth": {} }
90
- }
91
- }
90
+ "apps": [
91
+ { "template": "web-template", "name": "web", "version": 1 },
92
+ { "template": "api-service" }
93
+ ]
92
94
  }
93
95
  }
94
96
  }
95
97
  ```
96
98
 
99
+ `template` (required) names the template that provides the application's source and block catalog; `name` (optional) is the application name inside the workspace and defaults to the template name; `version` (optional) pins a requested major version, otherwise the latest available version is used.
100
+
97
101
  ### init
98
102
 
99
103
  Initialize a new app.
@@ -195,7 +199,7 @@ Important notes:
195
199
  - If `components` are omitted, BLOX prompts with a multiselect from installed blocks and applications.
196
200
  - You can pass registry keys or installed folder names under `blocks/`.
197
201
  - Only directories under `blocks/` containing a valid `.blox` file are treated as removable blocks. Applications are `apps/<name>` directories containing a `.blox` file.
198
- - Removing a root block checks dependents across the root and every application's blocks; removing an application block checks dependents only within the same application.
202
+ - Removing a block checks dependents within the same project scope only (the workspace root, or the application it belongs to).
199
203
  - Blocks are processed sequentially in the order provided.
200
204
 
201
205
  ### update
@@ -307,6 +311,7 @@ Important options:
307
311
  - `--breaking-summary <summary>`: breaking-change summary (required with `--breaking`)
308
312
  - `--breaking-migration <instructions>`: migration instructions (required with `--breaking`)
309
313
  - `--branch <name>`: existing contribution branch (used with `--existing`)
314
+ - `--app <name>`: contribute the application `apps/<name>` repository instead of the workspace; inside an application directory this is implicit
310
315
  - `--force`: bypass safety pre-flight checks
311
316
  - `--non-interactive`: run without prompts; missing inputs fail instead of prompting
312
317
  - `--json`: emit a machine-readable JSON result on stdout