slicejs-cli 4.2.0 → 4.4.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 (49) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +260 -257
  3. package/client.js +927 -780
  4. package/commands/Print.js +163 -163
  5. package/commands/Validations.js +92 -92
  6. package/commands/build/build.js +97 -107
  7. package/commands/buildProduction/buildProduction.js +613 -613
  8. package/commands/bundle/bundle.js +251 -239
  9. package/commands/createComponent/VisualComponentTemplate.js +55 -55
  10. package/commands/createComponent/createComponent.js +128 -128
  11. package/commands/deleteComponent/deleteComponent.js +81 -81
  12. package/commands/docs/docs.js +365 -0
  13. package/commands/doctor/doctor.js +677 -563
  14. package/commands/getComponent/getComponent.js +842 -842
  15. package/commands/init/init.js +526 -475
  16. package/commands/lint/lint.js +75 -0
  17. package/commands/lint/types.js +85 -0
  18. package/commands/listComponents/listComponents.js +172 -172
  19. package/commands/seo/check.js +91 -0
  20. package/commands/seo/images.js +586 -0
  21. package/commands/seo/sitemap.js +106 -0
  22. package/commands/seo/support.js +130 -0
  23. package/commands/setup/lint.js +151 -0
  24. package/commands/skill/skill.js +236 -236
  25. package/commands/startServer/startServer.js +240 -240
  26. package/commands/startServer/watchServer.js +66 -66
  27. package/commands/typecheck/typecheck.js +83 -0
  28. package/commands/types/types.js +1378 -1097
  29. package/commands/utils/JsMinifier.js +230 -230
  30. package/commands/utils/LocalCliDelegation.js +78 -53
  31. package/commands/utils/PackageManager.js +148 -148
  32. package/commands/utils/PathHelper.js +87 -75
  33. package/commands/utils/ProjectValidation.js +274 -0
  34. package/commands/utils/SourceDiagnostics.js +201 -201
  35. package/commands/utils/VersionChecker.js +169 -169
  36. package/commands/utils/analyzeSource.js +77 -77
  37. package/commands/utils/bundling/BundleGenerator.js +3748 -3776
  38. package/commands/utils/bundling/DependencyAnalyzer.js +976 -976
  39. package/commands/utils/bundling/ExternalModuleBundler.js +298 -298
  40. package/commands/utils/componentAudit.js +74 -0
  41. package/commands/utils/compressAssets.js +103 -103
  42. package/commands/utils/cssScope.js +83 -0
  43. package/commands/utils/loadConfig.js +31 -31
  44. package/commands/utils/semver.js +66 -0
  45. package/commands/utils/sliceConfigSchema.js +72 -0
  46. package/commands/utils/sliceScripts.js +48 -48
  47. package/commands/utils/updateManager.js +471 -471
  48. package/eslint-config.js +128 -0
  49. package/package.json +19 -13
package/LICENSE CHANGED
@@ -1,21 +1,21 @@
1
- MIT License
2
-
3
- Copyright (c) 2024 Victor Jose Kneider Alnahi and Julio Antonio Graterol Bracho
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
1
+ MIT License
2
+
3
+ Copyright (c) 2024 Victor Jose Kneider Alnahi and Julio Antonio Graterol Bracho
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,257 +1,260 @@
1
- <div align="center">
2
- <img src="./assets/Slice.js-logo.png" alt="Slice.js logo" width="150" />
3
- <h1>Slice.js CLI</h1>
4
- <p>Command-line client for building web applications with the Slice.js framework</p>
5
- <p>
6
- <a href="https://slice-js-docs.vercel.app/Documentation/CLI"><strong>Explore the docs »</strong></a>
7
- <br />
8
- <a href="https://www.npmjs.com/package/slicejs-cli"><img src="https://img.shields.io/npm/v/slicejs-cli.svg?label=CLI" alt="npm version" /></a>
9
- <img src="https://img.shields.io/badge/Node-%E2%89%A5%2020.0.0-339933?logo=node.js" alt="node requirement" />
10
- <a href="#license"><img src="https://img.shields.io/badge/License-ISC-blue.svg" alt="license" /></a>
11
- </p>
12
- </div>
13
-
14
- ## About this repository
15
-
16
- This repository contains the Slice.js CLI (`slicejs-cli`), the command-line tool for developing applications with the Slice.js framework. It includes a development server, build system, component management, and more.
17
-
18
- ## Prerequisites
19
-
20
- - Node.js >= 20
21
- - npm or pnpm
22
-
23
- ## Local development
24
-
25
- 1. **Clone the repository**
26
- ```bash
27
- git clone https://github.com/VKneider/slicejs-cli.git
28
- cd slicejs-cli
29
- ```
30
-
31
- 2. **Install dependencies** (the repo pins pnpm via the `packageManager` field)
32
- ```bash
33
- pnpm install --frozen-lockfile
34
- ```
35
-
36
- 3. **Test changes locally**
37
- ```bash
38
- node client.js --help
39
- ```
40
-
41
- To bypass delegation to a global installation:
42
- ```bash
43
- SLICE_NO_LOCAL_DELEGATION=1 node client.js --help
44
- ```
45
-
46
- 4. **Run tests**
47
- ```bash
48
- npm test
49
- ```
50
-
51
- ## Installation (for users)
52
-
53
- For a **new project** you don't install anything manually — `slice init` (see Quick
54
- start below) installs the CLI locally in the project it creates.
55
-
56
- ### Local in an existing project (Recommended)
57
-
58
- ```bash
59
- npm install slicejs-cli --save-dev # or: pnpm add -D slicejs-cli
60
- ```
61
-
62
- ### Global launcher (optional)
63
-
64
- ```bash
65
- npm install -g slicejs-cli # or: pnpm add -g slicejs-cli
66
- ```
67
-
68
- The launcher delegates to the nearest project-local `node_modules/slicejs-cli`,
69
- so each project keeps its pinned CLI version.
70
-
71
- ## Main commands
72
-
73
- Inside initialized projects, prefer package scripts (`pnpm run ...`, `npm run ...`)
74
- over direct binary calls.
75
-
76
- Common script workflow:
77
-
78
- ```bash
79
- pnpm run dev
80
- pnpm run build
81
- pnpm run start
82
- pnpm run browse
83
- pnpm run get -- Button
84
- pnpm run sync
85
- ```
86
-
87
- Alternative with local devDependency resolution:
88
-
89
- ```bash
90
- pnpm exec slice dev
91
- ```
92
-
93
- If `slicejs-cli` is installed globally, `slice` can be executed directly from PATH.
94
-
95
- For pnpm v10+, if build scripts are restricted, configure `allowBuilds` in
96
- `pnpm-workspace.yaml`:
97
-
98
- ```yaml
99
- allowBuilds:
100
- slicejs-cli: true
101
- ```
102
-
103
- `slice init --pm pnpm` now writes this automatically.
104
-
105
- | Command | Description |
106
- |---------|-------------|
107
- | `slice init` | Initialize a Slice.js project |
108
- | `slice dev` | Development server with hot reload |
109
- | `slice build` | Build for production |
110
- | `slice start` | Serve production build |
111
- | `slice get <component>` | Install components from the official registry |
112
- | `slice browse` | Browse available components |
113
- | `slice component create` | Create a local component |
114
- | `slice skill add` | Install the Slice.js Claude Code skill into `.claude/skills/` |
115
- | `slice doctor` | Run project diagnostics |
116
- | `slice postinstall` | Configure npm scripts (alternative to postinstall) |
117
-
118
- ## Claude Code skill (`slice skill`)
119
-
120
- Installs the `slice-js-developer` skill — the guide Claude Code uses to build Slice.js
121
- apps correctly — into your project by fetching it from the official docs repo
122
- (`VKneider/slicejs_docs`), which is the single source of truth. A `manifest.json`
123
- there pins the skill version, its framework-compatibility range, and the exact file
124
- list, so the install never drifts.
125
-
126
- | Command | Description |
127
- |---------|-------------|
128
- | `slice skill add` | Install the skill (prompts before overwriting an existing copy; `--force` skips the prompt) |
129
- | `slice skill update` | Update the installed skill to the latest compatible version |
130
- | `slice skill status` | Show the installed version vs. the latest available |
131
-
132
- The skill is written to **`.claude/skills/slice-js-developer/`** at the **project
133
- root** — inside Claude Code's standard skills path, not a loose folder next to `src/`:
134
-
135
- ```
136
- my-app/
137
- ├── .claude/skills/slice-js-developer/ ← installed here
138
- ├── api/
139
- ├── src/ ← untouched
140
- └── package.json
141
- ```
142
-
143
- > **Run `slice skill` commands from the project root.** All three subcommands
144
- > (`add`, `update`, `status`) resolve the target from `INIT_CWD` / the current working
145
- > directory, so running from a subfolder can place `.claude/` somewhere unexpected.
146
- > The install path itself is configurable via the `installPath` field in the docs
147
- > repo's `manifest.json`. After installing, reload Claude Code to pick up the skill.
148
-
149
- ## Postinstall Scripts
150
-
151
- When you install `slicejs-cli`, the `postinstall` script automatically configures `slice:*` npm scripts in your `package.json`:
152
-
153
- ```json
154
- {
155
- "scripts": {
156
- "slice:init": "node ./node_modules/slicejs-cli/client.js init",
157
- "slice:dev": "node ./node_modules/slicejs-cli/client.js dev",
158
- "slice:build": "node ./node_modules/slicejs-cli/client.js build",
159
- "slice:start": "node ./node_modules/slicejs-cli/client.js start",
160
- "slice:create": "node ./node_modules/slicejs-cli/client.js component create",
161
- "slice:list": "node ./node_modules/slicejs-cli/client.js component list",
162
- "slice:delete": "node ./node_modules/slicejs-cli/client.js component delete",
163
- "slice:get": "node ./node_modules/slicejs-cli/client.js get",
164
- "slice:browse": "node ./node_modules/slicejs-cli/client.js browse",
165
- "slice:sync": "node ./node_modules/slicejs-cli/client.js sync",
166
- "slice:doctor": "node ./node_modules/slicejs-cli/client.js doctor",
167
- "slice:version": "node ./node_modules/slicejs-cli/client.js version",
168
- "slice:help": "node ./node_modules/slicejs-cli/client.js --help",
169
- "slice:types": "node ./node_modules/slicejs-cli/client.js types generate"
170
- }
171
- }
172
- ```
173
-
174
- If you installed with `--ignore-scripts`, run manually:
175
-
176
- ```bash
177
- npx slicejs-cli postinstall
178
- ```
179
-
180
- ## Quick start
181
-
182
- `slice init` creates the project folder itself — no `mkdir` or `npm init` needed.
183
- Everything (package.json, node_modules, lockfile, src/, api/) lives inside the new folder.
184
-
185
- ```bash
186
- # With npm
187
- npx slicejs-cli init
188
- cd my-app
189
- npm run dev
190
- ```
191
-
192
- ```bash
193
- # With pnpm
194
- pnpm dlx slicejs-cli init
195
- cd my-app
196
- pnpm run dev
197
- ```
198
-
199
- Non-interactive (for scripts/CI):
200
-
201
- ```bash
202
- npx slicejs-cli init -y my-app --pm pnpm
203
- ```
204
-
205
- init pins the chosen package manager in the `packageManager` field, installs
206
- `slicejs-web-framework` as a dependency and `slicejs-cli` as a devDependency of
207
- the new project. Versions are never hard-pinned at install time, so hardened pnpm
208
- setups (`minimumReleaseAge` quarantine, `ignore-scripts`) work out of the box.
209
-
210
- ## Tests
211
-
212
- The CLI uses Node.js native test runner:
213
-
214
- ```bash
215
- # All tests
216
- node --test
217
-
218
- # Specific tests
219
- node --test tests/postinstall-command.test.js
220
- ```
221
-
222
- ## Project structure
223
-
224
- ```
225
- slicejs-cli/
226
- ├── client.js # CLI entry point
227
- ├── commands/ # Command implementations
228
- │ ├── init/ # slice init
229
- │ ├── build/ # slice build
230
- │ ├── startServer/ # slice dev / slice start
231
- │ ├── createComponent/ # slice component create
232
- │ └── utils/ # PathHelper, VersionChecker, etc.
233
- ├── tests/ # Tests
234
- └── post.js # Postinstall hook
235
- ```
236
-
237
- ## Local delegation
238
-
239
- When the `slice` command is globally available, it automatically delegates to the project-local CLI (`node_modules/slicejs-cli`). To disable:
240
-
241
- ```bash
242
- SLICE_NO_LOCAL_DELEGATION=1 slice version
243
- ```
244
-
245
- ## Contributing
246
-
247
- We welcome contributions. Please review the guidelines in [CODE_OF_CONDUCT.md](CODE_OF_CONDUCT.md) before submitting changes.
248
-
249
- ## License
250
-
251
- Distributed under the ISC License. See `LICENSE` for more information.
252
-
253
- ## Links
254
-
255
- - 📘 Documentation: https://slice-js-docs.vercel.app/Documentation/CLI
256
- - 🐙 GitHub: https://github.com/VKneider/slicejs-cli
257
- - 📦 npm: https://www.npmjs.com/package/slicejs-cli
1
+ <div align="center">
2
+ <img src="./assets/Slice.js-logo.png" alt="Slice.js logo" width="150" />
3
+ <h1>Slice.js CLI</h1>
4
+ <p>Command-line client for building web applications with the Slice.js framework</p>
5
+ <p>
6
+ <a href="https://slice-js-docs.vercel.app/Documentation/CLI"><strong>Explore the docs »</strong></a>
7
+ <br />
8
+ <a href="https://www.npmjs.com/package/slicejs-cli"><img src="https://img.shields.io/npm/v/slicejs-cli.svg?label=CLI" alt="npm version" /></a>
9
+ <img src="https://img.shields.io/badge/Node-%E2%89%A5%2020.0.0-339933?logo=node.js" alt="node requirement" />
10
+ <a href="#license"><img src="https://img.shields.io/badge/License-ISC-blue.svg" alt="license" /></a>
11
+ </p>
12
+ </div>
13
+
14
+ ## About this repository
15
+
16
+ This repository contains the Slice.js CLI (`slicejs-cli`), the command-line tool for developing applications with the Slice.js framework. It includes a development server, build system, component management, and more.
17
+
18
+ ## Prerequisites
19
+
20
+ - Node.js >= 20
21
+ - npm or pnpm
22
+
23
+ ## Local development
24
+
25
+ 1. **Clone the repository**
26
+ ```bash
27
+ git clone https://github.com/VKneider/slicejs-cli.git
28
+ cd slicejs-cli
29
+ ```
30
+
31
+ 2. **Install dependencies** (the repo pins pnpm via the `packageManager` field)
32
+ ```bash
33
+ pnpm install --frozen-lockfile
34
+ ```
35
+
36
+ 3. **Test changes locally**
37
+ ```bash
38
+ node client.js --help
39
+ ```
40
+
41
+ To bypass delegation to a global installation:
42
+ ```bash
43
+ SLICE_NO_LOCAL_DELEGATION=1 node client.js --help
44
+ ```
45
+
46
+ 4. **Run tests**
47
+ ```bash
48
+ npm test
49
+ ```
50
+
51
+ ## Installation (for users)
52
+
53
+ For a **new project** you don't install anything manually — `slice init` (see Quick
54
+ start below) installs the CLI locally in the project it creates.
55
+
56
+ ### Local in an existing project (Recommended)
57
+
58
+ ```bash
59
+ npm install slicejs-cli --save-dev # or: pnpm add -D slicejs-cli
60
+ ```
61
+
62
+ ### Global launcher (optional)
63
+
64
+ ```bash
65
+ npm install -g slicejs-cli # or: pnpm add -g slicejs-cli
66
+ ```
67
+
68
+ The launcher delegates to the nearest project-local `node_modules/slicejs-cli`,
69
+ so each project keeps its pinned CLI version.
70
+
71
+ ## Main commands
72
+
73
+ Inside initialized projects, prefer package scripts (`pnpm run ...`, `npm run ...`)
74
+ over direct binary calls.
75
+
76
+ Common script workflow:
77
+
78
+ ```bash
79
+ pnpm run dev
80
+ pnpm run build
81
+ pnpm run start
82
+ pnpm run browse
83
+ pnpm run get -- Button
84
+ pnpm run sync
85
+ ```
86
+
87
+ Alternative with local devDependency resolution:
88
+
89
+ ```bash
90
+ pnpm exec slice dev
91
+ ```
92
+
93
+ If `slicejs-cli` is installed globally, `slice` can be executed directly from PATH.
94
+
95
+ For pnpm v10+, if build scripts are restricted, configure `allowBuilds` in
96
+ `pnpm-workspace.yaml`:
97
+
98
+ ```yaml
99
+ allowBuilds:
100
+ slicejs-cli: true
101
+ ```
102
+
103
+ `slice init --pm pnpm` now writes this automatically.
104
+
105
+ | Command | Description |
106
+ |---------|-------------|
107
+ | `slice init` | Initialize a Slice.js project |
108
+ | `slice dev` | Development server with hot reload |
109
+ | `slice build` | Build for production |
110
+ | `slice start` | Serve production build |
111
+ | `slice get <component>` | Install components from the official registry |
112
+ | `slice browse` | Browse available components |
113
+ | `slice component create` | Create a local component |
114
+ | `slice skill add` | Install the Slice.js Claude Code skill into `.claude/skills/` |
115
+ | `slice doctor` | Run project diagnostics |
116
+ | `slice lint` | Run ESLint with the shared Slice config |
117
+ | `slice typecheck` | Type-check with the project's TypeScript |
118
+ | `slice setup lint` | Add ESLint (and `--with-types` for typecheck) |
119
+ | `slice postinstall` | Configure npm scripts (alternative to postinstall) |
120
+
121
+ ## Claude Code skill (`slice skill`)
122
+
123
+ Installs the `slice-js-developer` skill — the guide Claude Code uses to build Slice.js
124
+ apps correctly — into your project by fetching it from the official docs repo
125
+ (`VKneider/slicejs_docs`), which is the single source of truth. A `manifest.json`
126
+ there pins the skill version, its framework-compatibility range, and the exact file
127
+ list, so the install never drifts.
128
+
129
+ | Command | Description |
130
+ |---------|-------------|
131
+ | `slice skill add` | Install the skill (prompts before overwriting an existing copy; `--force` skips the prompt) |
132
+ | `slice skill update` | Update the installed skill to the latest compatible version |
133
+ | `slice skill status` | Show the installed version vs. the latest available |
134
+
135
+ The skill is written to **`.claude/skills/slice-js-developer/`** at the **project
136
+ root** — inside Claude Code's standard skills path, not a loose folder next to `src/`:
137
+
138
+ ```
139
+ my-app/
140
+ ├── .claude/skills/slice-js-developer/ ← installed here
141
+ ├── api/
142
+ ├── src/ ← untouched
143
+ └── package.json
144
+ ```
145
+
146
+ > **Run `slice skill` commands from the project root.** All three subcommands
147
+ > (`add`, `update`, `status`) resolve the target from `INIT_CWD` / the current working
148
+ > directory, so running from a subfolder can place `.claude/` somewhere unexpected.
149
+ > The install path itself is configurable via the `installPath` field in the docs
150
+ > repo's `manifest.json`. After installing, reload Claude Code to pick up the skill.
151
+
152
+ ## Postinstall Scripts
153
+
154
+ When you install `slicejs-cli`, the `postinstall` script automatically configures `slice:*` npm scripts in your `package.json`:
155
+
156
+ ```json
157
+ {
158
+ "scripts": {
159
+ "slice:init": "node ./node_modules/slicejs-cli/client.js init",
160
+ "slice:dev": "node ./node_modules/slicejs-cli/client.js dev",
161
+ "slice:build": "node ./node_modules/slicejs-cli/client.js build",
162
+ "slice:start": "node ./node_modules/slicejs-cli/client.js start",
163
+ "slice:create": "node ./node_modules/slicejs-cli/client.js component create",
164
+ "slice:list": "node ./node_modules/slicejs-cli/client.js component list",
165
+ "slice:delete": "node ./node_modules/slicejs-cli/client.js component delete",
166
+ "slice:get": "node ./node_modules/slicejs-cli/client.js get",
167
+ "slice:browse": "node ./node_modules/slicejs-cli/client.js browse",
168
+ "slice:sync": "node ./node_modules/slicejs-cli/client.js sync",
169
+ "slice:doctor": "node ./node_modules/slicejs-cli/client.js doctor",
170
+ "slice:version": "node ./node_modules/slicejs-cli/client.js version",
171
+ "slice:help": "node ./node_modules/slicejs-cli/client.js --help",
172
+ "slice:types": "node ./node_modules/slicejs-cli/client.js types generate"
173
+ }
174
+ }
175
+ ```
176
+
177
+ If you installed with `--ignore-scripts`, run manually:
178
+
179
+ ```bash
180
+ npx slicejs-cli postinstall
181
+ ```
182
+
183
+ ## Quick start
184
+
185
+ `slice init` creates the project folder itself — no `mkdir` or `npm init` needed.
186
+ Everything (package.json, node_modules, lockfile, src/, api/) lives inside the new folder.
187
+
188
+ ```bash
189
+ # With npm
190
+ npx slicejs-cli init
191
+ cd my-app
192
+ npm run dev
193
+ ```
194
+
195
+ ```bash
196
+ # With pnpm
197
+ pnpm dlx slicejs-cli init
198
+ cd my-app
199
+ pnpm run dev
200
+ ```
201
+
202
+ Non-interactive (for scripts/CI):
203
+
204
+ ```bash
205
+ npx slicejs-cli init -y my-app --pm pnpm
206
+ ```
207
+
208
+ init pins the chosen package manager in the `packageManager` field, installs
209
+ `slicejs-web-framework` as a dependency and `slicejs-cli` as a devDependency of
210
+ the new project. Versions are never hard-pinned at install time, so hardened pnpm
211
+ setups (`minimumReleaseAge` quarantine, `ignore-scripts`) work out of the box.
212
+
213
+ ## Tests
214
+
215
+ The CLI uses Node.js native test runner:
216
+
217
+ ```bash
218
+ # All tests
219
+ node --test
220
+
221
+ # Specific tests
222
+ node --test tests/postinstall-command.test.js
223
+ ```
224
+
225
+ ## Project structure
226
+
227
+ ```
228
+ slicejs-cli/
229
+ ├── client.js # CLI entry point
230
+ ├── commands/ # Command implementations
231
+ │ ├── init/ # slice init
232
+ │ ├── build/ # slice build
233
+ │ ├── startServer/ # slice dev / slice start
234
+ │ ├── createComponent/ # slice component create
235
+ │ └── utils/ # PathHelper, VersionChecker, etc.
236
+ ├── tests/ # Tests
237
+ └── post.js # Postinstall hook
238
+ ```
239
+
240
+ ## Local delegation
241
+
242
+ When the `slice` command is globally available, it automatically delegates to the project-local CLI (`node_modules/slicejs-cli`). To disable:
243
+
244
+ ```bash
245
+ SLICE_NO_LOCAL_DELEGATION=1 slice version
246
+ ```
247
+
248
+ ## Contributing
249
+
250
+ We welcome contributions. Please review the guidelines in [CODE_OF_CONDUCT.md](CODE_OF_CONDUCT.md) before submitting changes.
251
+
252
+ ## License
253
+
254
+ Distributed under the ISC License. See `LICENSE` for more information.
255
+
256
+ ## Links
257
+
258
+ - 📘 Documentation: https://slice-js-docs.vercel.app/Documentation/CLI
259
+ - 🐙 GitHub: https://github.com/VKneider/slicejs-cli
260
+ - 📦 npm: https://www.npmjs.com/package/slicejs-cli