@solution-lib/space 0.0.6 → 0.0.7
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/README.md +299 -74
- package/dist/main.cjs +12 -12
- package/dist/main.cjs.map +1 -1
- package/dist/main.js +12 -12
- package/dist/main.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
</div>
|
|
9
9
|
|
|
10
10
|
<div align="center">
|
|
11
|
-
<img src="https://img.shields.io/badge/v-0.0.
|
|
11
|
+
<img src="https://img.shields.io/badge/v-0.0.7-black"/>
|
|
12
12
|
<a href="https://github.com/maysara-elshewehy">
|
|
13
13
|
</a>
|
|
14
14
|
<a href="https://github.com/solution-lib"> <img src="https://img.shields.io/badge/@-solution--lib-black"/> </a>
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
|
|
26
26
|
```bash
|
|
27
27
|
# install via bun or npm
|
|
28
|
-
bun install
|
|
28
|
+
bun install @solution-lib/space -g
|
|
29
29
|
|
|
30
30
|
# Now use 'space' anywhere
|
|
31
31
|
space --help
|
|
@@ -36,103 +36,330 @@
|
|
|
36
36
|
space init
|
|
37
37
|
|
|
38
38
|
# Or with options
|
|
39
|
-
space init my-lib -t lib
|
|
39
|
+
space init my-lib -t lib
|
|
40
40
|
|
|
41
41
|
# Navigate and setup
|
|
42
42
|
cd my-lib
|
|
43
|
-
space
|
|
43
|
+
space install
|
|
44
44
|
space build
|
|
45
45
|
```
|
|
46
46
|
|
|
47
|
-
<
|
|
47
|
+
<br>
|
|
48
48
|
|
|
49
49
|
- ## Commands
|
|
50
50
|
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
51
|
+
- ### Space Management
|
|
52
|
+
|
|
53
|
+
```bash
|
|
54
|
+
# Create new space (interactive mode)
|
|
55
|
+
space init [name]
|
|
56
|
+
|
|
57
|
+
# Create with options
|
|
58
|
+
space init my-lib -t lib # Specify type (lib, cli, server, web)
|
|
59
|
+
space init my-lib -t lib --desc "My lib" # With description
|
|
60
|
+
|
|
61
|
+
# Show current space information
|
|
62
|
+
space info
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
<div align="center"> <img src="./assets/img/line.png" alt="line" style="display: block; margin-top:20px;margin-bottom:20px;width:500px;"/> <br> </div>
|
|
66
|
+
|
|
67
|
+
- ### Package Manager (Bun wrapper)
|
|
68
|
+
|
|
69
|
+
```bash
|
|
70
|
+
# Install dependencies
|
|
71
|
+
space install # Install all from package.json
|
|
72
|
+
space i # Alias for install
|
|
73
|
+
space install lodash axios # Install specific packages
|
|
74
|
+
space install lodash --dev # Install as dev dependency
|
|
75
|
+
space install lodash --global # Install globally
|
|
76
|
+
|
|
77
|
+
# Remove packages
|
|
78
|
+
space remove <packages...> # Remove with confirmation
|
|
79
|
+
space r <packages...> # Alias for remove
|
|
80
|
+
space remove lodash axios # Remove multiple packages
|
|
81
|
+
space remove lodash --global # Remove global package
|
|
82
|
+
|
|
83
|
+
# Update packages
|
|
84
|
+
space update # Update all (interactive)
|
|
85
|
+
space up # Alias for update
|
|
86
|
+
space update lodash # Update specific packages
|
|
87
|
+
|
|
88
|
+
# Link packages
|
|
89
|
+
space link # Link current package globally
|
|
90
|
+
space link <package> # Link global package to project
|
|
91
|
+
space unlink # Unlink current package globally
|
|
92
|
+
space unlink <package> # Unlink global package from project
|
|
93
|
+
|
|
94
|
+
# List packages
|
|
95
|
+
space list # List local packages
|
|
96
|
+
space ls # Alias for list
|
|
97
|
+
space list --global # List global packages
|
|
98
|
+
|
|
99
|
+
# Run scripts
|
|
100
|
+
space run <script> # Run any script from package.json
|
|
101
|
+
space run dev # Example: run dev script
|
|
102
|
+
space run build -- --watch # Pass additional args to script
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
<div align="center"> <img src="./assets/img/line.png" alt="line" style="display: block; margin-top:20px;margin-bottom:20px;width:500px;"/> <br> </div>
|
|
106
|
+
|
|
107
|
+
- ### Build & Development
|
|
108
|
+
|
|
109
|
+
```bash
|
|
110
|
+
# Build the project
|
|
111
|
+
space build
|
|
112
|
+
|
|
113
|
+
# Start the project (builds first, then runs)
|
|
114
|
+
space start # Run the built main file
|
|
115
|
+
space start --help # Pass args to your app
|
|
116
|
+
space start arg1 arg2 --flag # All args passed through
|
|
117
|
+
|
|
118
|
+
# Run tests
|
|
119
|
+
space test # Run all tests
|
|
120
|
+
space test path/to/test.ts # Run specific test file
|
|
121
|
+
space test --coverage # Generate coverage report
|
|
122
|
+
space test --coverage --coverage-reporter=lcov # Specify reporter format
|
|
123
|
+
space test --watch # Run in watch mode
|
|
124
|
+
space test --bail # Exit on first failure
|
|
125
|
+
space test --timeout 5000 # Set timeout (ms)
|
|
126
|
+
space test --rerun-each 3 # Re-run each test N times
|
|
127
|
+
space test --concurrent # Run tests concurrently
|
|
128
|
+
space test -t "math" # Filter by test name pattern
|
|
129
|
+
space test --coverage --watch # Combine multiple options
|
|
130
|
+
|
|
131
|
+
# Clean build artifacts
|
|
132
|
+
space clean
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
<div align="center"> <img src="./assets/img/line.png" alt="line" style="display: block; margin-top:20px;margin-bottom:20px;width:500px;"/> <br> </div>
|
|
136
|
+
|
|
137
|
+
- ### Publishing
|
|
138
|
+
|
|
139
|
+
```bash
|
|
140
|
+
# Publish to npm (interactive)
|
|
141
|
+
space publish
|
|
142
|
+
|
|
143
|
+
# Publish with options
|
|
144
|
+
space publish --tag beta # Publish with tag
|
|
145
|
+
space publish --access public # Set access level (public/restricted)
|
|
146
|
+
space publish --tag next --access public
|
|
147
|
+
```
|
|
78
148
|
|
|
79
|
-
<
|
|
149
|
+
<br>
|
|
80
150
|
|
|
81
151
|
- ## Space Types and Examples
|
|
82
152
|
|
|
83
|
-
|
|
153
|
+
- ### Available Types
|
|
154
|
+
|
|
155
|
+
- **`lib`** - TypeScript library for npm
|
|
156
|
+
|
|
157
|
+
> Zero dependencies template
|
|
158
|
+
>
|
|
159
|
+
> Perfect for publishing reusable packages
|
|
160
|
+
>
|
|
161
|
+
> Example: [solution-dist/lib](https://github.com/solution-dist/lib)
|
|
162
|
+
|
|
163
|
+
- **`cli`** - Command-line tool
|
|
84
164
|
|
|
85
|
-
|
|
165
|
+
> Includes `@je-es/cli` for CLI development
|
|
166
|
+
>
|
|
167
|
+
> Built-in argument parsing and command handling
|
|
168
|
+
>
|
|
169
|
+
> Example: [solution-dist/cli](https://github.com/solution-dist/cli)
|
|
86
170
|
|
|
87
|
-
|
|
171
|
+
- **`server`** - Backend server application
|
|
88
172
|
|
|
89
|
-
|
|
173
|
+
> Includes `@je-es/server` for server development
|
|
174
|
+
>
|
|
175
|
+
> Ready for API and backend services
|
|
176
|
+
>
|
|
177
|
+
> Example: [solution-dist/server](https://github.com/solution-dist/server)
|
|
178
|
+
|
|
179
|
+
- **`web`** - Full-stack web application
|
|
180
|
+
|
|
181
|
+
> Includes `@je-es/server` and `@je-es/client`
|
|
182
|
+
>
|
|
183
|
+
> Complete web application stack
|
|
184
|
+
>
|
|
185
|
+
> Example: [solution-dist/web](https://github.com/solution-dist/web)
|
|
90
186
|
|
|
91
187
|
<div align="center"> <img src="./assets/img/line.png" alt="line" style="display: block; margin-top:20px;margin-bottom:20px;width:500px;"/> <br> </div>
|
|
92
188
|
|
|
189
|
+
- ### Templates
|
|
190
|
+
|
|
191
|
+
> Each space type currently supports the **`clean`** template:
|
|
192
|
+
|
|
193
|
+
- Minimal setup with essential tools
|
|
194
|
+
|
|
195
|
+
- TypeScript configured
|
|
196
|
+
|
|
197
|
+
- Build system ready (tsup)
|
|
198
|
+
|
|
199
|
+
- Type-safe and production-ready
|
|
200
|
+
|
|
201
|
+
<br>
|
|
202
|
+
|
|
93
203
|
- ## Configuration
|
|
94
204
|
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
"
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
"
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
205
|
+
- ### `.space` File
|
|
206
|
+
|
|
207
|
+
> Each space contains a `.space` configuration file that stores project metadata:
|
|
208
|
+
|
|
209
|
+
```json
|
|
210
|
+
{
|
|
211
|
+
"type" : "cli",
|
|
212
|
+
"template" : "clean",
|
|
213
|
+
"pm" : "bun",
|
|
214
|
+
|
|
215
|
+
"repo" : {
|
|
216
|
+
"org" : "solution-lib",
|
|
217
|
+
"name" : "space",
|
|
218
|
+
"version" : "0.0.1",
|
|
219
|
+
"desc" : "Creates and manages the spaces",
|
|
220
|
+
"kw" : ["solution", "space", "framework"],
|
|
221
|
+
"license" : "MIT",
|
|
222
|
+
"issues" : "https://github.com/solution-lib/space/issues",
|
|
223
|
+
"homepage" : "https://github.com/solution-lib/space#readme",
|
|
224
|
+
"git_url" : "git+https://github.com/solution-lib/space.git"
|
|
225
|
+
},
|
|
226
|
+
|
|
227
|
+
"author" : {
|
|
228
|
+
"id" : "maysara-elshewehy",
|
|
229
|
+
"name" : "Maysara",
|
|
230
|
+
"email" : "maysara.elshewehy@gmail.com",
|
|
231
|
+
"url" : "https://github.com/maysara-elshewehy"
|
|
232
|
+
},
|
|
233
|
+
|
|
234
|
+
"createdAt" : "2025-11-29T01:22:48.497Z"
|
|
235
|
+
}
|
|
236
|
+
```
|
|
237
|
+
|
|
238
|
+
<div align="center"> <img src="./assets/img/line.png" alt="line" style="display: block; margin-top:20px;margin-bottom:20px;width:500px;"/> <br> </div>
|
|
239
|
+
|
|
240
|
+
- ### Key Features
|
|
241
|
+
|
|
242
|
+
- **Automatic Configuration**: Space automatically manages your `package.json` with proper formatting
|
|
243
|
+
|
|
244
|
+
- **Organization Support**: Create scoped packages with `@org/package-name` format
|
|
245
|
+
|
|
246
|
+
- **GitHub Integration**: Automatic repository URLs and author links
|
|
247
|
+
|
|
248
|
+
- **Consistent Formatting**: JSON files formatted with aligned colons and proper indentation
|
|
249
|
+
|
|
250
|
+
<br>
|
|
251
|
+
|
|
252
|
+
- ## Advanced Usage
|
|
125
253
|
|
|
126
|
-
|
|
254
|
+
- ### Creating Scoped Packages
|
|
255
|
+
|
|
256
|
+
```bash
|
|
257
|
+
# Create a package under an organization
|
|
258
|
+
space init @my-org/awesome-lib -t lib
|
|
259
|
+
|
|
260
|
+
# During interactive mode, enter: @my-org/package-name
|
|
261
|
+
space init
|
|
262
|
+
# name: @my-org/package-name
|
|
263
|
+
```
|
|
264
|
+
|
|
265
|
+
<div align="center"> <img src="./assets/img/line.png" alt="line" style="display: block; margin-top:20px;margin-bottom:20px;width:500px;"/> <br> </div>
|
|
266
|
+
|
|
267
|
+
- ### Using Current Directory
|
|
268
|
+
|
|
269
|
+
```bash
|
|
270
|
+
# Create space in current directory (if folder name matches)
|
|
271
|
+
mkdir my-project
|
|
272
|
+
cd my-project
|
|
273
|
+
space init my-project -t lib
|
|
274
|
+
# Prompt: "Use current directory 'my-project' as the space root?" → Yes
|
|
275
|
+
```
|
|
127
276
|
|
|
128
277
|
<div align="center"> <img src="./assets/img/line.png" alt="line" style="display: block; margin-top:20px;margin-bottom:20px;width:500px;"/> <br> </div>
|
|
129
278
|
|
|
279
|
+
- ### Test Workflows
|
|
280
|
+
|
|
281
|
+
```bash
|
|
282
|
+
# Development with watch mode
|
|
283
|
+
space test --watch
|
|
284
|
+
|
|
285
|
+
# CI/CD with coverage
|
|
286
|
+
space test --coverage --bail
|
|
287
|
+
|
|
288
|
+
# Generate coverage for external tools
|
|
289
|
+
space test --coverage --coverage-reporter=lcov
|
|
290
|
+
|
|
291
|
+
# Debug specific tests
|
|
292
|
+
space test -t "should handle errors" --bail
|
|
293
|
+
|
|
294
|
+
# Performance testing
|
|
295
|
+
space test --rerun-each 100 --concurrent
|
|
296
|
+
```
|
|
297
|
+
|
|
298
|
+
<div align="center"> <img src="./assets/img/line.png" alt="line" style="display: block; margin-top:20px;margin-bottom:20px;width:500px;"/> <br> </div>
|
|
299
|
+
|
|
300
|
+
- ### Link Workflows
|
|
301
|
+
|
|
302
|
+
```bash
|
|
303
|
+
# Link your library for local development
|
|
304
|
+
cd my-lib
|
|
305
|
+
space link # Links globally
|
|
306
|
+
|
|
307
|
+
cd ../my-app
|
|
308
|
+
space link my-lib # Links my-lib to this project
|
|
309
|
+
|
|
310
|
+
# After development
|
|
311
|
+
cd ../my-app
|
|
312
|
+
space unlink my-lib # Unlink from project
|
|
313
|
+
|
|
314
|
+
cd ../my-lib
|
|
315
|
+
space unlink # Unlink globally
|
|
316
|
+
```
|
|
317
|
+
|
|
318
|
+
<div align="center"> <img src="./assets/img/line.png" alt="line" style="display: block; margin-top:20px;margin-bottom:20px;width:500px;"/> <br> </div>
|
|
319
|
+
|
|
320
|
+
- ### Publishing Workflow
|
|
321
|
+
|
|
322
|
+
```bash
|
|
323
|
+
# 1. Update version in package.json
|
|
324
|
+
# 2. Build and test
|
|
325
|
+
space build
|
|
326
|
+
space test --coverage
|
|
327
|
+
|
|
328
|
+
# 3. Publish (interactive)
|
|
329
|
+
space publish
|
|
330
|
+
# Confirms: package name, version, tag, access level
|
|
331
|
+
|
|
332
|
+
# Or publish directly
|
|
333
|
+
space publish --access public
|
|
334
|
+
|
|
335
|
+
# Beta releases
|
|
336
|
+
space publish --tag beta
|
|
337
|
+
```
|
|
338
|
+
|
|
339
|
+
<br>
|
|
340
|
+
|
|
341
|
+
- ## Requirements
|
|
342
|
+
|
|
343
|
+
> **Bun** >= 1.3.3
|
|
344
|
+
|
|
345
|
+
> **Git** (for template cloning)
|
|
346
|
+
|
|
347
|
+
> **Node.js** (optional, for npm compatibility)
|
|
348
|
+
|
|
349
|
+
<br>
|
|
350
|
+
|
|
130
351
|
- ## Documentation
|
|
131
352
|
|
|
132
353
|
> Full documentation coming soon at [Github Pages](#)
|
|
133
354
|
|
|
134
|
-
> For now, run `space --help` or check
|
|
355
|
+
> For now, run `space --help` or check individual command help:
|
|
135
356
|
|
|
357
|
+
```bash
|
|
358
|
+
space --help
|
|
359
|
+
space init --help
|
|
360
|
+
space test --help
|
|
361
|
+
space publish --help
|
|
362
|
+
```
|
|
136
363
|
|
|
137
364
|
<!-- ╚═════════════════════════════════════════════════════════════════╝ -->
|
|
138
365
|
|
|
@@ -141,11 +368,9 @@
|
|
|
141
368
|
<!-- ╔══════════════════════════════ END ══════════════════════════════╗ -->
|
|
142
369
|
|
|
143
370
|
<br>
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
</div>
|
|
148
|
-
<br>
|
|
371
|
+
|
|
372
|
+
---
|
|
373
|
+
|
|
149
374
|
<div align="center">
|
|
150
375
|
<a href="https://github.com/maysara-elshewehy"><img src="https://img.shields.io/badge/by-Maysara-black"/></a>
|
|
151
376
|
</div>
|