@abgov/nx-adsp 13.0.0-beta.6 → 13.0.1
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 +47 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -6,13 +6,20 @@ The plugin provides generators for Node/Express services, React and Angular fron
|
|
|
6
6
|
|
|
7
7
|
## Prerequisites
|
|
8
8
|
|
|
9
|
+
Install only the framework peers for the generators you use — they are declared
|
|
10
|
+
as **optional** peer dependencies, so a workspace that only builds Vue apps
|
|
11
|
+
doesn't need `@nx/react`, `@nx/angular`, etc.
|
|
12
|
+
|
|
9
13
|
| Generator | Required peer dependency |
|
|
10
14
|
|-----------|--------------------------|
|
|
11
15
|
| `react-app` | `@nx/react` |
|
|
12
16
|
| `angular-app` | `@nx/angular` |
|
|
17
|
+
| `vue-app` | `@nx/vue` |
|
|
13
18
|
| `dotnet-service` | `@nx-dotnet/core` |
|
|
14
19
|
| `react-dotnet` | `@nx/react`, `@nx-dotnet/core` |
|
|
15
|
-
| `express-service` | `@nx/
|
|
20
|
+
| `express-service` | `@nx/express` |
|
|
21
|
+
| `pevn`, `mevn` (full-stack) | `@nx/express`, `@nx/vue` |
|
|
22
|
+
| `pern`, `pean` (full-stack) | `@nx/express`, `@nx/react`/`@nx/angular` |
|
|
16
23
|
| `react-form`, `react-task-list` | existing React project in the workspace |
|
|
17
24
|
|
|
18
25
|
## Installation
|
|
@@ -28,12 +35,50 @@ npm i -D @abgov/nx-adsp
|
|
|
28
35
|
npx create-nx-workspace my-workspace
|
|
29
36
|
|
|
30
37
|
# 2. Install the plugin and any required peer dependencies
|
|
31
|
-
npm i -D @abgov/nx-adsp @nx/
|
|
38
|
+
npm i -D @abgov/nx-adsp @nx/express
|
|
32
39
|
|
|
33
40
|
# 3. Generate a quickstart (interactive prompts fill missing options)
|
|
34
41
|
npx nx g @abgov/nx-adsp:express-service my-service --env dev --tenant my-tenant
|
|
35
42
|
```
|
|
36
43
|
|
|
44
|
+
## Full-stack quickstart (PEVN → sandbox)
|
|
45
|
+
|
|
46
|
+
This is the end-to-end path a coding agent can follow from an empty folder to a
|
|
47
|
+
running full-stack app in an OpenShift sandbox. **The Nx 23 line is published on
|
|
48
|
+
the `@beta` dist-tag** — append `@beta` to installs until it is promoted to
|
|
49
|
+
`latest`.
|
|
50
|
+
|
|
51
|
+
Prerequisites for the sandbox deploy (steps 4–5): `podman` (machine started on
|
|
52
|
+
macOS), `oc` logged in to the sandbox cluster, and the GitHub CLI (`gh`)
|
|
53
|
+
authenticated as an account with **`write:packages`** on your registry org.
|
|
54
|
+
|
|
55
|
+
```bash
|
|
56
|
+
# 1. Empty folder → Nx workspace (the plugins require Nx 23)
|
|
57
|
+
npx create-nx-workspace@latest my-solution --preset=apps --workspaceType=integrated --nxCloud=skip --no-interactive
|
|
58
|
+
cd my-solution
|
|
59
|
+
|
|
60
|
+
# 2. Install the plugins + stack peers (match @nx/* to the workspace nx version)
|
|
61
|
+
NXV=$(node -p "require('./node_modules/nx/package.json').version")
|
|
62
|
+
npm i -D @abgov/nx-oc@beta @abgov/nx-adsp@beta "@nx/express@$NXV" "@nx/vue@$NXV" "@nx/node@$NXV" "@nx/js@$NXV" "@nx/eslint@$NXV"
|
|
63
|
+
|
|
64
|
+
# 3. Scaffold a Postgres + Express + Vue + Node solution (opens a browser for the ADSP tenant login)
|
|
65
|
+
npx nx g @abgov/nx-adsp:pevn acme --env=dev --tenant=my-tenant
|
|
66
|
+
|
|
67
|
+
# 4. Add sandbox targets (registry derives from the git remote, or pass --registry=ghcr.io/<org>;
|
|
68
|
+
# the database is auto-detected from the service — no --database needed)
|
|
69
|
+
npx nx g @abgov/nx-oc:sandbox acme-service --sandboxProject=<namespace> --registry=ghcr.io/<org> --tenant=my-tenant --env=dev
|
|
70
|
+
npx nx g @abgov/nx-oc:sandbox acme-app --sandboxProject=<namespace> --tenant=my-tenant --env=dev
|
|
71
|
+
|
|
72
|
+
# 5. Deploy — backend first so the frontend's /api proxy resolves
|
|
73
|
+
npx nx run acme-service:sandbox
|
|
74
|
+
npx nx run acme-app:sandbox # or: --deployBackend to bring the backend up in the same run
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
Each generated app has an `AGENTS.md` (framework + ADSP context) and, once
|
|
78
|
+
step 4 runs, a `.openshift/<app>/SANDBOX.md` deploy/troubleshooting runbook.
|
|
79
|
+
See [`@abgov/nx-oc`](https://www.npmjs.com/package/@abgov/nx-oc) for the sandbox
|
|
80
|
+
deploy details.
|
|
81
|
+
|
|
37
82
|
## Generators
|
|
38
83
|
|
|
39
84
|
### `express-service`
|