slicejs-cli 3.6.3 → 3.6.5

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.
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,226 +1,225 @@
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 doctor` | Run project diagnostics |
115
- | `slice postinstall` | Configure npm scripts (alternative to postinstall) |
116
-
117
- ## Postinstall Scripts
118
-
119
- When you install `slicejs-cli`, the `postinstall` script automatically configures `slice:*` npm scripts in your `package.json`:
120
-
121
- ```json
122
- {
123
- "scripts": {
124
- "slice:init": "node ./node_modules/slicejs-cli/client.js init",
125
- "slice:dev": "node ./node_modules/slicejs-cli/client.js dev",
126
- "slice:build": "node ./node_modules/slicejs-cli/client.js build",
127
- "slice:start": "node ./node_modules/slicejs-cli/client.js start",
128
- "slice:create": "node ./node_modules/slicejs-cli/client.js component create",
129
- "slice:list": "node ./node_modules/slicejs-cli/client.js component list",
130
- "slice:delete": "node ./node_modules/slicejs-cli/client.js component delete",
131
- "slice:get": "node ./node_modules/slicejs-cli/client.js get",
132
- "slice:browse": "node ./node_modules/slicejs-cli/client.js browse",
133
- "slice:sync": "node ./node_modules/slicejs-cli/client.js sync",
134
- "slice:doctor": "node ./node_modules/slicejs-cli/client.js doctor",
135
- "slice:version": "node ./node_modules/slicejs-cli/client.js version",
136
- "slice:help": "node ./node_modules/slicejs-cli/client.js --help",
137
- "slice:update": "node ./node_modules/slicejs-cli/client.js update",
138
- "slice:types": "node ./node_modules/slicejs-cli/client.js types generate"
139
- }
140
- }
141
- ```
142
-
143
- If you installed with `--ignore-scripts`, run manually:
144
-
145
- ```bash
146
- npx slicejs-cli postinstall
147
- ```
148
-
149
- ## Quick start
150
-
151
- `slice init` creates the project folder itself no `mkdir` or `npm init` needed.
152
- Everything (package.json, node_modules, lockfile, src/, api/) lives inside the new folder.
153
-
154
- ```bash
155
- # With npm
156
- npx slicejs-cli init
157
- cd my-app
158
- npm run dev
159
- ```
160
-
161
- ```bash
162
- # With pnpm
163
- pnpm dlx slicejs-cli init
164
- cd my-app
165
- pnpm run dev
166
- ```
167
-
168
- Non-interactive (for scripts/CI):
169
-
170
- ```bash
171
- npx slicejs-cli init -y my-app --pm pnpm
172
- ```
173
-
174
- init pins the chosen package manager in the `packageManager` field, installs
175
- `slicejs-web-framework` as a dependency and `slicejs-cli` as a devDependency of
176
- the new project. Versions are never hard-pinned at install time, so hardened pnpm
177
- setups (`minimumReleaseAge` quarantine, `ignore-scripts`) work out of the box.
178
-
179
- ## Tests
180
-
181
- The CLI uses Node.js native test runner:
182
-
183
- ```bash
184
- # All tests
185
- node --test
186
-
187
- # Specific tests
188
- node --test tests/postinstall-command.test.js
189
- ```
190
-
191
- ## Project structure
192
-
193
- ```
194
- slicejs-cli/
195
- ├── client.js # CLI entry point
196
- ├── commands/ # Command implementations
197
- │ ├── init/ # slice init
198
- │ ├── build/ # slice build
199
- │ ├── startServer/ # slice dev / slice start
200
- ├── createComponent/ # slice component create
201
- │ └── utils/ # PathHelper, VersionChecker, etc.
202
- ├── tests/ # Tests
203
- └── post.js # Postinstall hook
204
- ```
205
-
206
- ## Local delegation
207
-
208
- When the `slice` command is globally available, it automatically delegates to the project-local CLI (`node_modules/slicejs-cli`). To disable:
209
-
210
- ```bash
211
- SLICE_NO_LOCAL_DELEGATION=1 slice version
212
- ```
213
-
214
- ## Contributing
215
-
216
- We welcome contributions. Please review the guidelines in [CODE_OF_CONDUCT.md](CODE_OF_CONDUCT.md) before submitting changes.
217
-
218
- ## License
219
-
220
- Distributed under the ISC License. See `LICENSE` for more information.
221
-
222
- ## Links
223
-
224
- - 📘 Documentation: https://slice-js-docs.vercel.app/Documentation/CLI
225
- - 🐙 GitHub: https://github.com/VKneider/slicejs-cli
226
- - 📦 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 doctor` | Run project diagnostics |
115
+ | `slice postinstall` | Configure npm scripts (alternative to postinstall) |
116
+
117
+ ## Postinstall Scripts
118
+
119
+ When you install `slicejs-cli`, the `postinstall` script automatically configures `slice:*` npm scripts in your `package.json`:
120
+
121
+ ```json
122
+ {
123
+ "scripts": {
124
+ "slice:init": "node ./node_modules/slicejs-cli/client.js init",
125
+ "slice:dev": "node ./node_modules/slicejs-cli/client.js dev",
126
+ "slice:build": "node ./node_modules/slicejs-cli/client.js build",
127
+ "slice:start": "node ./node_modules/slicejs-cli/client.js start",
128
+ "slice:create": "node ./node_modules/slicejs-cli/client.js component create",
129
+ "slice:list": "node ./node_modules/slicejs-cli/client.js component list",
130
+ "slice:delete": "node ./node_modules/slicejs-cli/client.js component delete",
131
+ "slice:get": "node ./node_modules/slicejs-cli/client.js get",
132
+ "slice:browse": "node ./node_modules/slicejs-cli/client.js browse",
133
+ "slice:sync": "node ./node_modules/slicejs-cli/client.js sync",
134
+ "slice:doctor": "node ./node_modules/slicejs-cli/client.js doctor",
135
+ "slice:version": "node ./node_modules/slicejs-cli/client.js version",
136
+ "slice:help": "node ./node_modules/slicejs-cli/client.js --help",
137
+ "slice:types": "node ./node_modules/slicejs-cli/client.js types generate"
138
+ }
139
+ }
140
+ ```
141
+
142
+ If you installed with `--ignore-scripts`, run manually:
143
+
144
+ ```bash
145
+ npx slicejs-cli postinstall
146
+ ```
147
+
148
+ ## Quick start
149
+
150
+ `slice init` creates the project folder itself — no `mkdir` or `npm init` needed.
151
+ Everything (package.json, node_modules, lockfile, src/, api/) lives inside the new folder.
152
+
153
+ ```bash
154
+ # With npm
155
+ npx slicejs-cli init
156
+ cd my-app
157
+ npm run dev
158
+ ```
159
+
160
+ ```bash
161
+ # With pnpm
162
+ pnpm dlx slicejs-cli init
163
+ cd my-app
164
+ pnpm run dev
165
+ ```
166
+
167
+ Non-interactive (for scripts/CI):
168
+
169
+ ```bash
170
+ npx slicejs-cli init -y my-app --pm pnpm
171
+ ```
172
+
173
+ init pins the chosen package manager in the `packageManager` field, installs
174
+ `slicejs-web-framework` as a dependency and `slicejs-cli` as a devDependency of
175
+ the new project. Versions are never hard-pinned at install time, so hardened pnpm
176
+ setups (`minimumReleaseAge` quarantine, `ignore-scripts`) work out of the box.
177
+
178
+ ## Tests
179
+
180
+ The CLI uses Node.js native test runner:
181
+
182
+ ```bash
183
+ # All tests
184
+ node --test
185
+
186
+ # Specific tests
187
+ node --test tests/postinstall-command.test.js
188
+ ```
189
+
190
+ ## Project structure
191
+
192
+ ```
193
+ slicejs-cli/
194
+ ├── client.js # CLI entry point
195
+ ├── commands/ # Command implementations
196
+ ├── init/ # slice init
197
+ │ ├── build/ # slice build
198
+ │ ├── startServer/ # slice dev / slice start
199
+ │ ├── createComponent/ # slice component create
200
+ └── utils/ # PathHelper, VersionChecker, etc.
201
+ ├── tests/ # Tests
202
+ └── post.js # Postinstall hook
203
+ ```
204
+
205
+ ## Local delegation
206
+
207
+ When the `slice` command is globally available, it automatically delegates to the project-local CLI (`node_modules/slicejs-cli`). To disable:
208
+
209
+ ```bash
210
+ SLICE_NO_LOCAL_DELEGATION=1 slice version
211
+ ```
212
+
213
+ ## Contributing
214
+
215
+ We welcome contributions. Please review the guidelines in [CODE_OF_CONDUCT.md](CODE_OF_CONDUCT.md) before submitting changes.
216
+
217
+ ## License
218
+
219
+ Distributed under the ISC License. See `LICENSE` for more information.
220
+
221
+ ## Links
222
+
223
+ - 📘 Documentation: https://slice-js-docs.vercel.app/Documentation/CLI
224
+ - 🐙 GitHub: https://github.com/VKneider/slicejs-cli
225
+ - 📦 npm: https://www.npmjs.com/package/slicejs-cli