adonia 0.1.0 → 0.2.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 +87 -41
- package/build/cli.js +1 -1
- package/package.json +4 -3
- package/registry/README.md +3 -3
package/README.md
CHANGED
|
@@ -1,64 +1,110 @@
|
|
|
1
|
-
#
|
|
1
|
+
# adonia
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Your AdonisJS app owns the files. Adonia only copies them in.
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
`
|
|
5
|
+
**Requirements:** Node.js 24+, npm 11+, an AdonisJS app (`adonisrc.ts` and
|
|
6
|
+
`@adonisjs/core`).
|
|
7
7
|
|
|
8
8
|
```bash
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
npx adonia@latest init --wire
|
|
10
|
+
npx adonia@latest add auth
|
|
11
11
|
```
|
|
12
12
|
|
|
13
|
-
##
|
|
13
|
+
## Quick start
|
|
14
|
+
|
|
15
|
+
From an AdonisJS API app:
|
|
14
16
|
|
|
15
17
|
```bash
|
|
16
|
-
npx adonia
|
|
17
|
-
npx adonia
|
|
18
|
-
|
|
19
|
-
npx adonia
|
|
20
|
-
npx adonia
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
18
|
+
npx adonia init --wire
|
|
19
|
+
npx adonia add auth
|
|
20
|
+
npx adonia add auth --with-adapters
|
|
21
|
+
npx adonia add auth --with-routes --wire-routes
|
|
22
|
+
npx adonia check
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
Plain `add` copies the domain slice under `modules/` only. Models,
|
|
26
|
+
migrations, controllers, validators, adapters, and routes are
|
|
27
|
+
opt-in.
|
|
28
|
+
|
|
29
|
+
Every module in one command:
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
npx adonia init --scaffold
|
|
24
33
|
```
|
|
25
34
|
|
|
35
|
+
That wires the host and copies every feature module with stubs and
|
|
36
|
+
routes.
|
|
37
|
+
|
|
26
38
|
## Commands
|
|
27
39
|
|
|
28
40
|
| Command | Role |
|
|
29
41
|
|---------|------|
|
|
30
|
-
| `init`
|
|
42
|
+
| `init` | Write `adonia.json` and copy the API core |
|
|
43
|
+
| `init --wire` | Also set import aliases, `ctx.respond`, and the JSON exception handler |
|
|
31
44
|
| `init --scaffold` | Core + all feature modules with stubs and routes (implies `--wire`) |
|
|
32
|
-
| `add
|
|
33
|
-
| `list`
|
|
45
|
+
| `add <name…>` | Copy one or more modules (and optional stubs) |
|
|
46
|
+
| `list` | Registry names and install status |
|
|
47
|
+
| `diff <name>` | Compare host files to the registry |
|
|
48
|
+
| `check` | Validate the host install |
|
|
34
49
|
|
|
35
|
-
|
|
50
|
+
`check` fails after a plain `add auth` until `#models/user` and
|
|
51
|
+
`#models/password_reset` exist. Pass `--with-models` / `--with-stubs`,
|
|
52
|
+
or add those files yourself.
|
|
36
53
|
|
|
37
|
-
|
|
54
|
+
## Bundled modules
|
|
55
|
+
|
|
56
|
+
| Name | Role |
|
|
57
|
+
|------|------|
|
|
58
|
+
| `api` | Shared envelopes, `ApiService`, `ctx.respond`, exception handler |
|
|
59
|
+
| `types`, `constants`, `contracts` | Core types and the shared `UserStore` port (installed with `api`) |
|
|
60
|
+
| `auth` | Registration, login, verification, password reset |
|
|
61
|
+
| `account` | Profile, email change, password change, deletion |
|
|
62
|
+
| `notification` | Multi-channel dispatcher with a host-owned registry |
|
|
63
|
+
| `creem` | Creem checkout, portal, invoices, webhooks |
|
|
64
|
+
| `subscription` | Subscription state synced from Creem webhooks |
|
|
65
|
+
|
|
66
|
+
`add` walks `registryDependencies`. For example,
|
|
67
|
+
`adonia add subscription` installs `creem` and core first when they
|
|
68
|
+
are missing.
|
|
69
|
+
|
|
70
|
+
## `add` flags
|
|
71
|
+
|
|
72
|
+
| Flag | Copies |
|
|
38
73
|
|------|--------|
|
|
39
|
-
| `--with-models` |
|
|
40
|
-
| `--with-migrations` |
|
|
41
|
-
| `--with-controllers` |
|
|
42
|
-
| `--with-validators` |
|
|
43
|
-
| `--with-adapters` |
|
|
44
|
-
| `--with-stubs` | Models, migrations, controllers, validators, adapters, Vine provider, limiter stub
|
|
45
|
-
| `--with-routes` |
|
|
46
|
-
| `--wire-routes` |
|
|
47
|
-
| `--with-tests` |
|
|
74
|
+
| `--with-models` | `stubs/models/` → `app/models/` |
|
|
75
|
+
| `--with-migrations` | `stubs/migrations/` → `database/migrations/` |
|
|
76
|
+
| `--with-controllers` | Controllers (implies adapters) |
|
|
77
|
+
| `--with-validators` | Validators and the Vine provider |
|
|
78
|
+
| `--with-adapters` | Lucid/SDK adapters → `app/adapters/` |
|
|
79
|
+
| `--with-stubs` | Models, migrations, controllers, validators, adapters, Vine provider, limiter stub. **Not** routes |
|
|
80
|
+
| `--with-routes` | `start/routes/<name>.ts` and `start/limiter.ts` |
|
|
81
|
+
| `--wire-routes` | Import that route file from `start/routes.ts` |
|
|
82
|
+
| `--with-tests` | Colocated tests under `modules/<name>/tests/` |
|
|
48
83
|
|
|
49
|
-
`
|
|
50
|
-
module tree only.
|
|
84
|
+
`--with-stubs` does not copy routes. Combine with `--with-routes`.
|
|
51
85
|
|
|
52
|
-
Adonis
|
|
53
|
-
`@adonisjs/limiter`) are not installed
|
|
54
|
-
|
|
55
|
-
|
|
86
|
+
Adonis packages used by stubs (`@adonisjs/mail`, `@adonisjs/drive`,
|
|
87
|
+
`@adonisjs/limiter`) are not installed for you. `add` and `check`
|
|
88
|
+
print `node ace add @adonisjs/<pkg>` when a copied stub needs a
|
|
89
|
+
missing package.
|
|
56
90
|
|
|
57
|
-
Shared flags
|
|
91
|
+
## Shared flags
|
|
58
92
|
|
|
59
|
-
|
|
93
|
+
| Flag | Effect |
|
|
94
|
+
|------|--------|
|
|
95
|
+
| `--cwd <dir>` | Host app directory |
|
|
96
|
+
| `-y`, `--yes` | Hide “continuing” log lines (does not prompt) |
|
|
97
|
+
| `--dry-run` | Print the plan; write nothing |
|
|
98
|
+
| `--registry <dir>` | Local registry path |
|
|
99
|
+
| `--overwrite` | Replace host files whose contents differ |
|
|
60
100
|
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
101
|
+
## Documentation
|
|
102
|
+
|
|
103
|
+
- [Getting started](https://github.com/britzdylan/adonia/blob/main/apps/docs/guide/getting-started.md)
|
|
104
|
+
- [CLI](https://github.com/britzdylan/adonia/blob/main/apps/docs/cli/overview.md)
|
|
105
|
+
- [Modules](https://github.com/britzdylan/adonia/blob/main/apps/docs/modules/overview.md)
|
|
106
|
+
- [Source](https://github.com/britzdylan/adonia)
|
|
107
|
+
|
|
108
|
+
## License
|
|
109
|
+
|
|
110
|
+
MIT
|
package/build/cli.js
CHANGED
|
@@ -10,7 +10,7 @@ import { packageVersion } from './host.js';
|
|
|
10
10
|
const program = new Command();
|
|
11
11
|
program
|
|
12
12
|
.name('adonia')
|
|
13
|
-
.description('
|
|
13
|
+
.description('A CLI that copies AdonisJS modules from a registry into your app.')
|
|
14
14
|
.version(packageVersion());
|
|
15
15
|
function shared(cmd) {
|
|
16
16
|
const opts = cmd.optsWithGlobals();
|
package/package.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "adonia",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"type": "module",
|
|
6
|
-
"description": "
|
|
6
|
+
"description": "A CLI that copies AdonisJS modules from a registry into your app.",
|
|
7
7
|
"bin": {
|
|
8
8
|
"adonia": "./build/cli.js"
|
|
9
9
|
},
|
|
@@ -17,7 +17,8 @@
|
|
|
17
17
|
"registry"
|
|
18
18
|
],
|
|
19
19
|
"engines": {
|
|
20
|
-
"node": ">=
|
|
20
|
+
"node": ">=24",
|
|
21
|
+
"npm": ">=11"
|
|
21
22
|
},
|
|
22
23
|
"scripts": {
|
|
23
24
|
"build": "tsc",
|
package/registry/README.md
CHANGED
|
@@ -10,7 +10,7 @@ npx adonia@latest add auth
|
|
|
10
10
|
npx adonia@latest add auth --with-adapters
|
|
11
11
|
npx adonia@latest add auth --with-stubs
|
|
12
12
|
npx adonia@latest add auth --with-routes --wire-routes
|
|
13
|
-
# or
|
|
13
|
+
# or every module:
|
|
14
14
|
npx adonia@latest init --scaffold
|
|
15
15
|
```
|
|
16
16
|
|
|
@@ -49,9 +49,9 @@ Each feature module (and `api`) ships a manifest:
|
|
|
49
49
|
them. `--with-adapters` copies Lucid/SDK adapters to `app/adapters/`.
|
|
50
50
|
`--with-controllers` and `--with-stubs` imply adapters. `--with-validators`
|
|
51
51
|
also copies `providers/`; `--with-routes` and `--with-stubs` also copy
|
|
52
|
-
`start/` (limiter example). Adonis
|
|
52
|
+
`start/` (limiter example). Adonis packages (`@adonisjs/mail`,
|
|
53
53
|
`@adonisjs/drive`, `@adonisjs/limiter`) are not stubbed with no-ops.
|
|
54
|
-
`add` and `check` warn when a copied stub needs a
|
|
54
|
+
`add` and `check` warn when a copied stub needs a package that is missing
|
|
55
55
|
from `package.json` and print `node ace add @adonisjs/<pkg>`.
|
|
56
56
|
- **dependencies** — npm packages this module imports.
|
|
57
57
|
- **registryDependencies** — other modules that must already be present.
|