@naseej/blox 1.5.1 → 1.5.3

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 (4) hide show
  1. package/bin/run.ts +2 -0
  2. package/dist/run.js +650 -281
  3. package/package.json +10 -5
  4. package/readme.md +104 -17
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@naseej/blox",
3
- "version": "1.5.1",
3
+ "version": "1.5.3",
4
4
  "description": "blox cli",
5
5
  "bin": {
6
6
  "blox": "./bin/run"
@@ -21,8 +21,8 @@
21
21
  "compile": "tsc",
22
22
  "start": "tsx ./bin/run.ts",
23
23
  "start:node": "node ./bin/run",
24
- "test": "vitest run",
25
- "test:watch": "vitest",
24
+ "test": "playwright test",
25
+ "test:watch": "playwright test --ui",
26
26
  "lint": "eslint \"*/**/*.{js,ts,tsx}\" --quiet --fix",
27
27
  "lint:fix": "eslint \"*/**/*.{js,ts,tsx}\" --fix",
28
28
  "lint:stage": "yarn lint -- -c .eslintrc.staging.cjs",
@@ -32,6 +32,7 @@
32
32
  "postinstall": "patch-package"
33
33
  },
34
34
  "devDependencies": {
35
+ "@playwright/test": "^1.59.1",
35
36
  "@tsconfig/node20": "^20.1.4",
36
37
  "@types/cross-spawn": "^6.0.6",
37
38
  "@types/ejs": "3.1.5",
@@ -41,6 +42,7 @@
41
42
  "@types/ms": "0.7.34",
42
43
  "@types/node": "^20.12.12",
43
44
  "@types/prompts": "^2.4.9",
45
+ "@types/semver": "^7.7.1",
44
46
  "@types/signale": "^1.4.7",
45
47
  "@types/yargs": "^17.0.32",
46
48
  "@typescript-eslint/eslint-plugin": "^8.17.0",
@@ -52,8 +54,10 @@
52
54
  "eslint-plugin-import": "^2.29.1",
53
55
  "eslint-plugin-prettier": "^5.1.3",
54
56
  "eslint-plugin-react": "^7.34.1",
55
- "eslint-plugin-unused-imports": "^3.2.0",
57
+ "eslint-plugin-unused-imports": "^4.1.4",
58
+ "execa": "^9.6.1",
56
59
  "husky": "^9.1.7",
60
+ "node-pty": "^1.1.0",
57
61
  "patch-package": "^8.0.0",
58
62
  "prettier": "^3.2.5",
59
63
  "tsup": "^8.0.2",
@@ -75,6 +79,7 @@
75
79
  "ignore": "^7.0.5",
76
80
  "klaw": "^4.1.0",
77
81
  "lodash": "^4.17.21",
78
- "ms": "2.1.3"
82
+ "ms": "2.1.3",
83
+ "semver": "^7.7.4"
79
84
  }
80
85
  }
package/readme.md CHANGED
@@ -12,7 +12,7 @@ It can have many way to be installed, mainly as global npm package
12
12
  npm install -g patch-package @naseej/blox
13
13
  ```
14
14
 
15
- * make sure npm is already in you $Path to be able to use blox globally
15
+ - make sure npm is already in you $Path to be able to use blox globally
16
16
 
17
17
  ### Usage
18
18
 
@@ -26,12 +26,14 @@ BLOX CLI
26
26
  Commands:
27
27
  blox init Init new app [alias: i]
28
28
  blox add Add block to app [alias: a]
29
+ blox remove Remove block from app [alias: rm]
29
30
  blox update Update app/block [alias: u]
30
31
  blox contribute Contribute changes to template/base/block repos [alias: cb]
31
32
  blox conf Set blox global config [alias: c]
32
33
  blox upgrade Upgrade blox cli to latest version
33
34
  blox migrate Migrate blox schema
34
35
  blox detach Detach to base
36
+ blox skills Install and manage BLOX CLI skills (wraps npx skills)
35
37
 
36
38
  Options:
37
39
  -V, --version Show version number [boolean]
@@ -40,17 +42,38 @@ Options:
40
42
  -m, --minimal Works in minimal mode [boolean]
41
43
  ```
42
44
 
43
- * Use minimal mode if spinners are getting in the way of needed input for example.
45
+ - Use minimal mode if spinners are getting in the way of needed input for example.
44
46
 
45
47
  ### Available commands
46
48
 
47
- * [init](#init)
48
- * [add](#add)
49
- * [update](#update)
50
- * [contribute](#contribute)
51
- * [conf](#conf)
52
- * [upgrade](#upgrade)
53
- * [migrate](#migrate)
49
+ - [init](#init)
50
+ - [add](#add)
51
+ - [remove](#remove)
52
+ - [update](#update)
53
+ - [contribute](#contribute)
54
+ - [conf](#conf)
55
+ - [upgrade](#upgrade)
56
+ - [migrate](#migrate)
57
+ - [skills](#installing-blox-cli-skills)
58
+
59
+ ## Lifecycle hooks
60
+
61
+ Lifecycle hooks are **optional shell commands** defined in `.blox` files.
62
+ They can exist in:
63
+
64
+ - the **root template** (`.blox` at app root)
65
+ - each **block** (`blocks/<name>/.blox`)
66
+
67
+ hooks names: `init`, `add`, `update`, `remove`.
68
+
69
+ **When they run**
70
+
71
+ | Hook | Template (root `.blox`) | Block (`blocks/.../.blox`) |
72
+ | -------- | -------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- |
73
+ | `init` | Runs after`blox init` finishes creating the app. | Runs after a new block is cloned and initialized, before its dependencies are added. |
74
+ | `add` | Runs once per `blox add` command, but only if at least one new block was added (including dependencies). | Runs when the block is added , right after the `init` hook for that new block, still before dependencies. |
75
+ | `update` | After `blox update` when the **root template** or a **base** or a **block** remote actually advanced (new commit applied). | Only when that block’s remote actually advanced (new commit). Skipped if already up to date. |
76
+ | `remove` | After `blox remove` actually removed a block in that run. | Runs before the block is deleted, while its files still exist. |
54
77
 
55
78
  #### init
56
79
 
@@ -63,7 +86,7 @@ blox init
63
86
 
64
87
  Init new app
65
88
 
66
- Options:
89
+ Options:
67
90
  -n, --name App name
68
91
  -t, --template Template to use
69
92
  --branch, branch name to use
@@ -76,18 +99,43 @@ Options:
76
99
  ```
77
100
 
78
101
  ```
79
- blox add [block]
102
+ blox add [blocks]
80
103
 
81
104
  Add block to app
82
105
 
83
106
  Params:
84
- block Block name (Optional)
85
-
86
- Options:
87
- --branch, branch name to use
88
- --dest, destination dir
107
+ blocks Block names separated by space (optional; if omitted, prompts with multiselect from available blocks)
108
+
109
+ Options:
110
+ --branch, branch name to use (applies to all selected blocks)
111
+ --dest, destination dir (applies to all selected blocks)
112
+ ```
113
+
114
+ - You can add multiple blocks in one command, for example: `blox add components applet-template`.
115
+ - Blocks are processed sequentially in the order provided.
116
+
117
+ #### remove
118
+
119
+ ```sh
120
+ blox remove --help
121
+ ```
122
+
123
+ ```
124
+ blox remove [blocks]
125
+
126
+ Remove block from app
127
+
128
+ Params:
129
+ blocks Blocks to remove separated by space — registry keys or installed folder names under blocks/ (optional; prompts with multiselect from installed blocks)
130
+
131
+ Options:
132
+ -f, --force Remove even if other blocks declare a dependency on them (global for all selected blocks; skips dependency guard and post-remove version compatibility check)
89
133
  ```
90
134
 
135
+ - Only directories under `blocks/` that contain a valid `.blox` file are treated as removable blocks; other folders are ignored for selection and removal.
136
+ - You can remove multiple blocks in one command, for example: `blox remove components applet-template`.
137
+ - Blocks are processed sequentially in the order provided.
138
+
91
139
  #### update
92
140
 
93
141
  ```sh
@@ -104,7 +152,7 @@ Options:
104
152
  -b, --block Block to update, valid only with scope block
105
153
  ```
106
154
 
107
- * Note: you may need to resolve merge conflicts if found
155
+ - Note: you may need to resolve merge conflicts if found
108
156
 
109
157
  #### contribute
110
158
 
@@ -153,6 +201,7 @@ blox upgrade
153
201
 
154
202
  Upgrade blox cli to latest version
155
203
  ```
204
+
156
205
  #### migrate
157
206
 
158
207
  ```sh
@@ -164,3 +213,41 @@ blox migrate
164
213
 
165
214
  Migrate blox schema
166
215
  ```
216
+
217
+ ## Installing Blox CLI Skills
218
+
219
+ Use **`blox skills`** to run the [Skills CLI](https://github.com/vercel-labs/skills) against the **BLOX CLI skills repository**. No repo URL needed, BLOX clones the repo, executes `npx skills` with your arguments, then cleans up. Anything you pass after `skills` works the same as with `npx skills`.
220
+
221
+ ### CLI version compatibility
222
+
223
+ Skills declare a **`cliCompatibility`** range in `skill.json` (npm semver range). For **`blox skills add`** and **`blox skills update`**, BLOX checks that your installed CLI version satisfies that range before running `npx skills`. If it does not, you’ll see a warning with the required range and your current version, then a **Yes / No** prompt: continue anyway, or exit and run **`blox upgrade`** first.
224
+
225
+ ### Common commands
226
+
227
+ Add skills :
228
+
229
+ ```bash
230
+ blox skills add
231
+ ```
232
+
233
+ Install to **Cursor** only, skipping prompts where supported:
234
+
235
+ ```bash
236
+ blox skills add -a cursor -y
237
+ ```
238
+
239
+ Install to **several** agents at once:
240
+
241
+ ```bash
242
+ blox skills add -a cursor -a claude-code -y
243
+ ```
244
+
245
+ List skills already installed (project and global):
246
+
247
+ ```bash
248
+ blox skills list
249
+ ```
250
+
251
+ ## Compatibility
252
+
253
+ These skills are **not tied to a specific editor or product**. They work across tools that support skill-style instructions. Metadata marks agents as `generic` for broad use.