@kithinji/pod 1.0.21 → 1.0.23
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 +453 -0
- package/dist/main.js +408 -218
- package/dist/main.js.map +2 -2
- package/dist/types/deploy/deploy.d.ts.map +1 -1
- package/package.json +31 -8
- package/build.js +0 -22
- package/src/add/component/component.ts +0 -496
- package/src/add/component/index.ts +0 -1
- package/src/add/index.ts +0 -3
- package/src/add/module/index.ts +0 -1
- package/src/add/module/module.ts +0 -545
- package/src/add/new/index.ts +0 -198
- package/src/config/config.ts +0 -141
- package/src/config/index.ts +0 -1
- package/src/deploy/deploy.ts +0 -592
- package/src/deploy/index.ts +0 -1
- package/src/dev/index.ts +0 -1
- package/src/dev/project.ts +0 -45
- package/src/dev/server.ts +0 -191
- package/src/docker/docker.ts +0 -697
- package/src/docker/index.ts +0 -1
- package/src/macros/expand_macros.ts +0 -791
- package/src/macros/index.ts +0 -2
- package/src/macros/macro_executer.ts +0 -189
- package/src/main.ts +0 -106
- package/src/plugins/analyzers/graph.ts +0 -279
- package/src/plugins/css/index.ts +0 -25
- package/src/plugins/generators/generate_controller.ts +0 -308
- package/src/plugins/generators/generate_rsc.ts +0 -274
- package/src/plugins/generators/generate_server_component.ts +0 -455
- package/src/plugins/generators/tsx_server_stub.ts +0 -315
- package/src/plugins/index.ts +0 -3
- package/src/plugins/my.ts +0 -282
- package/src/plugins/transformers/j2d.ts +0 -1080
- package/src/store/index.ts +0 -1
- package/src/store/store.ts +0 -44
- package/src/utils/cases.ts +0 -15
- package/src/utils/create.ts +0 -26
- package/src/utils/index.ts +0 -2
- package/tsconfig.json +0 -27
package/README.md
ADDED
|
@@ -0,0 +1,453 @@
|
|
|
1
|
+
<h1 align="center">Pod</h1>
|
|
2
|
+
<p align="center">
|
|
3
|
+
<img src="https://i.postimg.cc/Wpq8CWvV/orca.png" alt="pod-logo" width="150px"/>
|
|
4
|
+
<br>
|
|
5
|
+
<em>The CLI tool for Orca that handles everything from scaffolding to deployment.</em>
|
|
6
|
+
<br>
|
|
7
|
+
</p>
|
|
8
|
+
<p align="center">
|
|
9
|
+
<a href="https://orca.dafifi.net/"><strong>orca.dafifi.net</strong></a>
|
|
10
|
+
<br>
|
|
11
|
+
</p>
|
|
12
|
+
<p align="center">
|
|
13
|
+
<a href="https://www.npmjs.com/package/@kithinji/pod">
|
|
14
|
+
<img src="https://img.shields.io/badge/NPM_package-v1.0.21-blue" alt="Pod on npm" />
|
|
15
|
+
</a>
|
|
16
|
+
</p>
|
|
17
|
+
|
|
18
|
+
<p align="center">
|
|
19
|
+
<a href="https://github.com/kithinjibrian/orca">
|
|
20
|
+
<img src="https://img.shields.io/badge/Orca framework-blue" alt="Orca on github" />
|
|
21
|
+
</a>
|
|
22
|
+
</p>
|
|
23
|
+
|
|
24
|
+
<hr>
|
|
25
|
+
|
|
26
|
+
## What is Pod?
|
|
27
|
+
|
|
28
|
+
Pod is the official CLI tool for Orca. It's your command center for creating, developing, and deploying Orca applications.
|
|
29
|
+
|
|
30
|
+
Unlike most framework CLIs that stop at scaffolding, Pod follows you through the entire development lifecycle:
|
|
31
|
+
|
|
32
|
+
- **Create** new Orca projects with best-practice structure
|
|
33
|
+
- **Generate** components, services, and modules instantly
|
|
34
|
+
- **Develop** with a fast, integrated development server
|
|
35
|
+
- **Dockerize** your application with zero configuration
|
|
36
|
+
- **Deploy** to cloud platforms like AWS EC2 with built-in automation
|
|
37
|
+
|
|
38
|
+
Pod is designed with one philosophy: **never abandon the developer**. From `pod new` to production deployment, Pod is there every step of the way.
|
|
39
|
+
|
|
40
|
+
## Installation
|
|
41
|
+
|
|
42
|
+
Install Pod globally via npm:
|
|
43
|
+
|
|
44
|
+
```bash
|
|
45
|
+
npm install -g @kithinji/pod
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
Verify installation:
|
|
49
|
+
|
|
50
|
+
```bash
|
|
51
|
+
pod --version
|
|
52
|
+
# Output: 1.0.21
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
## Commands
|
|
56
|
+
|
|
57
|
+
### `pod new <name>`
|
|
58
|
+
|
|
59
|
+
Create a new Orca project with a complete starter template.
|
|
60
|
+
|
|
61
|
+
```bash
|
|
62
|
+
pod new my-app
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
**What it does:**
|
|
66
|
+
|
|
67
|
+
1. Scaffolds a complete Orca project structure
|
|
68
|
+
2. Installs all dependencies automatically
|
|
69
|
+
3. Starts the development server immediately
|
|
70
|
+
|
|
71
|
+
**Output structure:**
|
|
72
|
+
|
|
73
|
+
```
|
|
74
|
+
my-app/
|
|
75
|
+
├── src/
|
|
76
|
+
│ │ └── app/
|
|
77
|
+
│ │ ├── app.module.ts
|
|
78
|
+
│ │ ├── app.service.ts
|
|
79
|
+
│ │ └── app.page.tsx
|
|
80
|
+
│ └── main.ts
|
|
81
|
+
├── package.json
|
|
82
|
+
├── tsconfig.json
|
|
83
|
+
└── pod.config.tx
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
After running this command, your app is live at `http://localhost:8080` and ready for development.
|
|
87
|
+
|
|
88
|
+
---
|
|
89
|
+
|
|
90
|
+
### `pod dev`
|
|
91
|
+
|
|
92
|
+
Start the Orca development server with hot reload.
|
|
93
|
+
|
|
94
|
+
```bash
|
|
95
|
+
pod dev
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
**Features:**
|
|
99
|
+
|
|
100
|
+
- Hot module replacement for instant feedback
|
|
101
|
+
- Automatic TypeScript compilation
|
|
102
|
+
- Watches for file changes across the entire project
|
|
103
|
+
- Compiles separate client and server bundles
|
|
104
|
+
- Serves the application locally
|
|
105
|
+
|
|
106
|
+
**Development workflow:**
|
|
107
|
+
|
|
108
|
+
1. Make changes to any file (components, services, modules)
|
|
109
|
+
2. Pod detects the change and recompiles
|
|
110
|
+
3. Browser automatically refreshes with your changes
|
|
111
|
+
4. Check the terminal for any compilation errors
|
|
112
|
+
|
|
113
|
+
Run this command from your project root whenever you're ready to develop.
|
|
114
|
+
|
|
115
|
+
---
|
|
116
|
+
|
|
117
|
+
### `pod add <type> <name>`
|
|
118
|
+
|
|
119
|
+
Generate new code scaffolding instantly.
|
|
120
|
+
|
|
121
|
+
**Add a component:**
|
|
122
|
+
|
|
123
|
+
```bash
|
|
124
|
+
pod add c button
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
Creates `button.component.tsx`. This is inspired by `Shadcn/ui` where you components live inside your code instead of being hidden behind libraries.
|
|
128
|
+
|
|
129
|
+
**Add a feature module:**
|
|
130
|
+
|
|
131
|
+
```bash
|
|
132
|
+
pod add f user
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
Creates a complete feature module with:
|
|
136
|
+
|
|
137
|
+
```
|
|
138
|
+
src/features/user/
|
|
139
|
+
├── user.module.ts # Module definition
|
|
140
|
+
├── user.service.ts # Business logic service
|
|
141
|
+
└── user.page.tsx # UI page component
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
**Generated files include:**
|
|
145
|
+
|
|
146
|
+
- Proper imports and decorators
|
|
147
|
+
- Dependency injection setup
|
|
148
|
+
- Module exports configuration
|
|
149
|
+
- Component/service boilerplate
|
|
150
|
+
|
|
151
|
+
**Types:**
|
|
152
|
+
|
|
153
|
+
- `c` - Component: Creates a single component file
|
|
154
|
+
- `f` - Feature: Creates a complete module with service and component
|
|
155
|
+
|
|
156
|
+
This command saves you from writing repetitive boilerplate and ensures consistency across your codebase.
|
|
157
|
+
|
|
158
|
+
---
|
|
159
|
+
|
|
160
|
+
### `pod dockerize <env>`
|
|
161
|
+
|
|
162
|
+
Generate Docker configuration for your Orca application.
|
|
163
|
+
|
|
164
|
+
```bash
|
|
165
|
+
pod dockerize production
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
**What it generates:**
|
|
169
|
+
|
|
170
|
+
1. `Dockerfile` - Optimized multi-stage build configuration
|
|
171
|
+
2. `.dockerignore` - Excludes unnecessary files from the image
|
|
172
|
+
3. `docker-compose.yml` - Will read package.json to determine which services to generate.
|
|
173
|
+
|
|
174
|
+
**The generated Dockerfile:**
|
|
175
|
+
|
|
176
|
+
- Uses multi-stage builds for smaller images
|
|
177
|
+
- Installs only production dependencies
|
|
178
|
+
- Optimizes layer caching for faster builds
|
|
179
|
+
- Sets up proper Node.js environment
|
|
180
|
+
- Configures the application to run in production mode
|
|
181
|
+
|
|
182
|
+
**After generation:**
|
|
183
|
+
|
|
184
|
+
```bash
|
|
185
|
+
# Run the container
|
|
186
|
+
docker compose up --build
|
|
187
|
+
```
|
|
188
|
+
|
|
189
|
+
**Environment-specific configs:**
|
|
190
|
+
|
|
191
|
+
The `<env>` parameter can be used to generate environment-specific Docker configurations (e.g., `development`, `production`). Pod will adjust settings like:
|
|
192
|
+
|
|
193
|
+
- Environment variables
|
|
194
|
+
- Build optimization levels
|
|
195
|
+
- Included dev dependencies
|
|
196
|
+
- Exposed ports
|
|
197
|
+
- Tunnel database connections through ssh if in development
|
|
198
|
+
|
|
199
|
+
---
|
|
200
|
+
|
|
201
|
+
### `pod deploy <target> [options]`
|
|
202
|
+
|
|
203
|
+
Deploy your Orca application to cloud platforms.
|
|
204
|
+
|
|
205
|
+
```bash
|
|
206
|
+
pod deploy ec2
|
|
207
|
+
```
|
|
208
|
+
|
|
209
|
+
**Supported targets:**
|
|
210
|
+
|
|
211
|
+
- `ec2` - AWS EC2 instances
|
|
212
|
+
- More platforms coming soon (Heroku, DigitalOcean, etc.)
|
|
213
|
+
|
|
214
|
+
**What it does:**
|
|
215
|
+
|
|
216
|
+
1. Reads deployment configuration from `pod.deploy.yml`
|
|
217
|
+
2. Builds your application for production
|
|
218
|
+
3. Creates necessary cloud resources (if needed)
|
|
219
|
+
4. Uploads your application to the target
|
|
220
|
+
5. Starts the application
|
|
221
|
+
|
|
222
|
+
**Options:**
|
|
223
|
+
|
|
224
|
+
`--force-install` - Force reinstallation of dependencies even if already present on the target
|
|
225
|
+
|
|
226
|
+
```bash
|
|
227
|
+
pod deploy ec2 --force-install
|
|
228
|
+
```
|
|
229
|
+
|
|
230
|
+
**Configuration file (`pod.deploy.yml`):**
|
|
231
|
+
|
|
232
|
+
```yml
|
|
233
|
+
name: my-app
|
|
234
|
+
version: 1.0.0
|
|
235
|
+
|
|
236
|
+
vars:
|
|
237
|
+
deploy_path: &deploy_path "/home/ubuntu/app"
|
|
238
|
+
backup_path: &backup_path "/home/ubuntu/backups"
|
|
239
|
+
|
|
240
|
+
shared_operations:
|
|
241
|
+
install_docker: &install_docker
|
|
242
|
+
type: ensure
|
|
243
|
+
ensure:
|
|
244
|
+
docker:
|
|
245
|
+
version: "28.5.2"
|
|
246
|
+
addUserToGroup: true
|
|
247
|
+
|
|
248
|
+
stop_containers: &stop_containers
|
|
249
|
+
type: action
|
|
250
|
+
action:
|
|
251
|
+
command: docker compose down --remove-orphans 2>/dev/null || true
|
|
252
|
+
|
|
253
|
+
pull_images: &pull_images
|
|
254
|
+
type: action
|
|
255
|
+
action:
|
|
256
|
+
command: docker compose pull --quiet
|
|
257
|
+
|
|
258
|
+
build_and_start: &build_and_start
|
|
259
|
+
type: action
|
|
260
|
+
action:
|
|
261
|
+
command: docker compose up -d --build --remove-orphans --wait
|
|
262
|
+
|
|
263
|
+
cleanup_docker: &cleanup_docker
|
|
264
|
+
type: action
|
|
265
|
+
action:
|
|
266
|
+
command: docker system prune -f --volumes --filter "until=168h"
|
|
267
|
+
|
|
268
|
+
targets:
|
|
269
|
+
localhost:
|
|
270
|
+
type: local
|
|
271
|
+
operations:
|
|
272
|
+
#- name: "Environment Setup"
|
|
273
|
+
# <<: *install_docker
|
|
274
|
+
- name: "Refresh Stack"
|
|
275
|
+
<<: *build_and_start
|
|
276
|
+
|
|
277
|
+
ec2:
|
|
278
|
+
type: ssh
|
|
279
|
+
host: ec2-xx-xx-xxx-xxx.xx-xxxx-x.compute.amazonaws.com
|
|
280
|
+
user: ubuntu
|
|
281
|
+
keyPath: ~/xxxx.pem
|
|
282
|
+
port: 22
|
|
283
|
+
deployPath: *deploy_path
|
|
284
|
+
|
|
285
|
+
operations:
|
|
286
|
+
- name: "Provision Directories and Swap"
|
|
287
|
+
type: ensure
|
|
288
|
+
ensure:
|
|
289
|
+
swap:
|
|
290
|
+
size: 4G
|
|
291
|
+
|
|
292
|
+
- name: "Install Docker"
|
|
293
|
+
<<: *install_docker
|
|
294
|
+
|
|
295
|
+
- name: "Sync Source Files"
|
|
296
|
+
type: action
|
|
297
|
+
action:
|
|
298
|
+
rsync:
|
|
299
|
+
source: ./
|
|
300
|
+
destination: *deploy_path
|
|
301
|
+
delete: true
|
|
302
|
+
exclude:
|
|
303
|
+
- .git/
|
|
304
|
+
- node_modules/
|
|
305
|
+
- .env.local
|
|
306
|
+
- "*.log"
|
|
307
|
+
|
|
308
|
+
- name: "Navigate to Deploy Path"
|
|
309
|
+
type: action
|
|
310
|
+
action:
|
|
311
|
+
command: cd *deploy_path
|
|
312
|
+
|
|
313
|
+
- name: "Create Pre-deployment Backup"
|
|
314
|
+
type: action
|
|
315
|
+
action:
|
|
316
|
+
command: tar -czf *backup_path/backup-$(date +%Y%m%d-%H%M%S).tar.gz .
|
|
317
|
+
|
|
318
|
+
- name: "Pull Latest Images"
|
|
319
|
+
<<: *pull_images
|
|
320
|
+
|
|
321
|
+
- name: "Stop Existing Stack"
|
|
322
|
+
<<: *stop_containers
|
|
323
|
+
|
|
324
|
+
- name: "Build and Launch"
|
|
325
|
+
<<: *build_and_start
|
|
326
|
+
|
|
327
|
+
- name: "Verify Health Status"
|
|
328
|
+
type: verify
|
|
329
|
+
verify:
|
|
330
|
+
command: ! "[ $(docker compose ps --format json | grep -qv 'running\\|healthy') ]"
|
|
331
|
+
|
|
332
|
+
- name: "Maintenance: Cleanup"
|
|
333
|
+
type: action
|
|
334
|
+
action:
|
|
335
|
+
command: |
|
|
336
|
+
find *backup_path -name "backup-*.tar.gz" -mtime +7 -delete
|
|
337
|
+
docker image prune -af --filter "until=24h"
|
|
338
|
+
```
|
|
339
|
+
|
|
340
|
+
**First-time setup:**
|
|
341
|
+
|
|
342
|
+
Pod will guide you through setting up deployment credentials and configuration the first time you run `pod deploy`. It will:
|
|
343
|
+
|
|
344
|
+
- Prompt for necessary credentials (AWS keys, etc.)
|
|
345
|
+
- Validate your configuration
|
|
346
|
+
- Save settings to `pod.deploy.yml`
|
|
347
|
+
- Optionally create required cloud resources
|
|
348
|
+
|
|
349
|
+
**Deployment workflow:**
|
|
350
|
+
|
|
351
|
+
```bash
|
|
352
|
+
pod deploy ec2
|
|
353
|
+
|
|
354
|
+
# Pod handles the rest:
|
|
355
|
+
# ✓ Building production bundle
|
|
356
|
+
# ✓ Uploading to EC2
|
|
357
|
+
# ✓ Installing dependencies
|
|
358
|
+
# ✓ Starting the server
|
|
359
|
+
# ✓ Configuring environment
|
|
360
|
+
```
|
|
361
|
+
|
|
362
|
+
---
|
|
363
|
+
|
|
364
|
+
## Workflow Example
|
|
365
|
+
|
|
366
|
+
Here's a complete workflow from project creation to deployment:
|
|
367
|
+
|
|
368
|
+
```bash
|
|
369
|
+
# 1. Create a new Orca app
|
|
370
|
+
pod new my-app
|
|
371
|
+
# (Pod automatically installs deps and starts dev server)
|
|
372
|
+
|
|
373
|
+
# 2. Add a new feature
|
|
374
|
+
pod add f product
|
|
375
|
+
|
|
376
|
+
# 3. Develop your app
|
|
377
|
+
# (Make changes, Pod hot-reloads automatically)
|
|
378
|
+
|
|
379
|
+
# 4. When ready to deploy, dockerize it
|
|
380
|
+
pod dockerize prod
|
|
381
|
+
|
|
382
|
+
# 5. Deploy to EC2
|
|
383
|
+
pod deploy ec2
|
|
384
|
+
|
|
385
|
+
# Done! Your app is live.
|
|
386
|
+
```
|
|
387
|
+
|
|
388
|
+
## Why Pod?
|
|
389
|
+
|
|
390
|
+
Most framework CLIs give you `create-app` and then disappear. Pod stays with you through the entire lifecycle:
|
|
391
|
+
|
|
392
|
+
**From idea to production:**
|
|
393
|
+
|
|
394
|
+
- `pod new` - Start building
|
|
395
|
+
- `pod add` - Generate code as you grow
|
|
396
|
+
- `pod dev` - Develop with instant feedback
|
|
397
|
+
- `pod dockerize` - Containerize for deployment
|
|
398
|
+
- `pod deploy` - Ship to production
|
|
399
|
+
|
|
400
|
+
**One tool. End to end. No gaps.**
|
|
401
|
+
|
|
402
|
+
That's the Pod philosophy.
|
|
403
|
+
|
|
404
|
+
---
|
|
405
|
+
|
|
406
|
+
## Comparison with Other CLIs
|
|
407
|
+
|
|
408
|
+
| Feature | Pod | Create-React-App | Angular CLI | Next.js CLI |
|
|
409
|
+
| ----------------------- | --- | ---------------- | ----------- | ----------- |
|
|
410
|
+
| Project scaffolding | ✅ | ✅ | ✅ | ✅ |
|
|
411
|
+
| Component generation | ✅ | ❌ | ✅ | ❌ |
|
|
412
|
+
| Service generation | ✅ | ❌ | ✅ | ❌ |
|
|
413
|
+
| Module generation | ✅ | ❌ | ✅ | ❌ |
|
|
414
|
+
| Dev server | ✅ | ✅ | ✅ | ✅ |
|
|
415
|
+
| Built-in Docker support | ✅ | ❌ | ❌ | ❌ |
|
|
416
|
+
| One-command deployment | ✅ | ❌ | ❌ | ❌ |
|
|
417
|
+
| Full-stack architecture | ✅ | ❌ | ❌ | Partial |
|
|
418
|
+
|
|
419
|
+
Pod doesn't just scaffold; it's your development companion from first line to first user.
|
|
420
|
+
|
|
421
|
+
---
|
|
422
|
+
|
|
423
|
+
## Contributing
|
|
424
|
+
|
|
425
|
+
Pod is open source and welcomes contributions. Areas where we need help:
|
|
426
|
+
|
|
427
|
+
- Additional deployment targets (Heroku, DigitalOcean, Azure, etc.)
|
|
428
|
+
- Template customization
|
|
429
|
+
- Plugin development
|
|
430
|
+
- Documentation improvements
|
|
431
|
+
|
|
432
|
+
Check out the [contribution guidelines](https://github.com/kithinji/pod/CONTRIBUTING.md) to get started.
|
|
433
|
+
|
|
434
|
+
---
|
|
435
|
+
|
|
436
|
+
## Stay in Touch
|
|
437
|
+
|
|
438
|
+
- **Author**: [Kithinji Brian](https://www.linkedin.com/in/kithinjibrian/)
|
|
439
|
+
- **Website**: [orca.dafifi.net](https://orca.dafifi.net/)
|
|
440
|
+
- **NPM**: [@kithinji/pod](https://www.npmjs.com/package/@kithinji/pod)
|
|
441
|
+
- **GitHub**: [github.com/kithinji/pod](https://github.com/kithinji/pod)
|
|
442
|
+
|
|
443
|
+
---
|
|
444
|
+
|
|
445
|
+
## License
|
|
446
|
+
|
|
447
|
+
MIT
|
|
448
|
+
|
|
449
|
+
---
|
|
450
|
+
|
|
451
|
+
<p align="center">
|
|
452
|
+
<strong>Pod: The CLI that never abandons you.</strong>
|
|
453
|
+
</p>
|