@axiomify/cli 4.0.0 → 5.0.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.
- package/README.md +56 -52
- package/dist/index.js +3199 -59
- package/dist/index.mjs +3198 -59
- package/package.json +5 -2
package/README.md
CHANGED
|
@@ -1,85 +1,89 @@
|
|
|
1
1
|
# @axiomify/cli
|
|
2
2
|
|
|
3
|
-
The
|
|
3
|
+
The Axiomify command-line interface — scaffold projects, run the dev server, and inspect routes.
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
## 📦 Installation
|
|
8
|
-
|
|
9
|
-
We recommend installing the CLI locally as a development dependency in your project so your CI/CD pipelines can utilize it:
|
|
10
|
-
|
|
11
|
-
```bash
|
|
12
|
-
npm install @axiomify/cli -D
|
|
13
|
-
````
|
|
14
|
-
|
|
15
|
-
You can also install it globally if you want to use the `init` command anywhere on your machine:
|
|
5
|
+
## Install
|
|
16
6
|
|
|
17
7
|
```bash
|
|
18
8
|
npm install -g @axiomify/cli
|
|
9
|
+
# or use without installing:
|
|
10
|
+
npx @axiomify/cli init my-api
|
|
19
11
|
```
|
|
20
12
|
|
|
21
|
-
##
|
|
22
|
-
|
|
23
|
-
| Command | Description |
|
|
24
|
-
| :--- | :--- |
|
|
25
|
-
| `axiomify init` | Scaffolds a new, production-ready Axiomify project. |
|
|
26
|
-
| `axiomify dev <entry>` | Starts the development server with hot-module reloading (HMR). |
|
|
27
|
-
| `axiomify build <entry>` | Compiles your TypeScript application for production. |
|
|
28
|
-
| `axiomify routes <entry>`| Inspects your app and prints a visual table of all registered routes. |
|
|
13
|
+
## Commands
|
|
29
14
|
|
|
30
|
-
|
|
15
|
+
### `axiomify init <name>`
|
|
31
16
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
Quickly generate a new project with all the necessary TypeScript configurations and adapter boilerplates:
|
|
17
|
+
Scaffolds a new Axiomify project with your chosen adapter.
|
|
35
18
|
|
|
36
19
|
```bash
|
|
37
|
-
|
|
20
|
+
axiomify init my-api
|
|
38
21
|
```
|
|
39
22
|
|
|
40
|
-
|
|
23
|
+
Prompts:
|
|
41
24
|
|
|
42
|
-
|
|
25
|
+
1. **Adapter** — Native (uWS, fastest) *(default)*, Fastify, Express, Hapi, or Node HTTP
|
|
26
|
+
2. **Plugins** — Auth, CORS, Helmet, Rate Limit, Metrics, Logger, OpenAPI (multi-select)
|
|
27
|
+
3. **Language** — TypeScript *(default)* or JavaScript
|
|
43
28
|
|
|
44
|
-
|
|
45
|
-
|
|
29
|
+
Generates:
|
|
30
|
+
```
|
|
31
|
+
my-api/
|
|
32
|
+
├── src/
|
|
33
|
+
│ ├── index.ts # Entry point with chosen adapter
|
|
34
|
+
│ ├── routes/ # Example routes
|
|
35
|
+
│ └── plugins/ # Plugin configuration
|
|
36
|
+
├── package.json
|
|
37
|
+
├── tsconfig.json
|
|
38
|
+
└── README.md
|
|
46
39
|
```
|
|
47
40
|
|
|
48
|
-
###
|
|
41
|
+
### `axiomify dev`
|
|
49
42
|
|
|
50
|
-
|
|
43
|
+
Starts the development server with hot-reload powered by esbuild.
|
|
51
44
|
|
|
52
45
|
```bash
|
|
53
|
-
|
|
46
|
+
axiomify dev # watches src/, rebuilds on change
|
|
47
|
+
axiomify dev --port 4000 # custom port
|
|
48
|
+
axiomify dev --debug # verbose logging
|
|
54
49
|
```
|
|
55
50
|
|
|
56
|
-
###
|
|
51
|
+
### `axiomify build`
|
|
57
52
|
|
|
58
|
-
Compiles
|
|
53
|
+
Compiles the application for production.
|
|
59
54
|
|
|
60
55
|
```bash
|
|
61
|
-
|
|
56
|
+
axiomify build # outputs to dist/
|
|
57
|
+
axiomify build --minify # minified output
|
|
58
|
+
axiomify build --sourcemap # include source maps
|
|
62
59
|
```
|
|
63
60
|
|
|
64
|
-
|
|
61
|
+
### `axiomify routes`
|
|
65
62
|
|
|
66
|
-
|
|
63
|
+
Visualises all registered routes in a table.
|
|
67
64
|
|
|
68
|
-
```
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
65
|
+
```bash
|
|
66
|
+
axiomify routes
|
|
67
|
+
|
|
68
|
+
┌─────────────────────────────────────┬────────┬───────────────────────────────┐
|
|
69
|
+
│ Path │ Method │ Plugins │
|
|
70
|
+
├─────────────────────────────────────┼────────┼───────────────────────────────┤
|
|
71
|
+
│ /users │ GET │ requireAuth, rateLimiter │
|
|
72
|
+
│ /users │ POST │ requireAuth │
|
|
73
|
+
│ /users/:id │ GET │ requireAuth │
|
|
74
|
+
│ /auth/login │ POST │ loginRateLimit │
|
|
75
|
+
│ /auth/refresh │ POST │ refreshRateLimit │
|
|
76
|
+
│ /health │ GET │ — │
|
|
77
|
+
│ /metrics │ GET │ — │
|
|
78
|
+
└─────────────────────────────────────┴────────┴───────────────────────────────┘
|
|
77
79
|
```
|
|
78
80
|
|
|
79
|
-
##
|
|
80
|
-
|
|
81
|
-
For complete documentation, guides, and ecosystem packages, please visit the [Axiomify Master Repository](https://github.com/OTopman/axiomify).
|
|
82
|
-
|
|
83
|
-
## 📄 License
|
|
81
|
+
## Adapter choices in `axiomify init`
|
|
84
82
|
|
|
85
|
-
|
|
83
|
+
| Adapter | Req/s (1 core) | Use case |
|
|
84
|
+
|---|---:|---|
|
|
85
|
+
| **Native (uWS)** | ~50k | Maximum throughput, production APIs |
|
|
86
|
+
| **Fastify** | ~10k | Recommended default — best ecosystem balance |
|
|
87
|
+
| **Express** | ~5k | Legacy migration, Express middleware ecosystem |
|
|
88
|
+
| **Hapi** | ~5k | Enterprise Hapi plugin ecosystem |
|
|
89
|
+
| **Node HTTP** | ~10k | Zero dependencies, edge/serverless |
|