@abgov/nx-adsp 13.0.1 → 13.1.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 +14 -7
- package/package.json +1 -1
- package/src/generators/angular-app/files/AGENTS.md__tmpl__ +9 -0
- package/src/generators/angular-app/schema.json +6 -22
- package/src/generators/dotnet-service/schema.json +4 -14
- package/src/generators/express-service/files/AGENTS.md__tmpl__ +9 -0
- package/src/generators/express-service/schema.json +18 -19
- package/src/generators/mean/schema.json +7 -4
- package/src/generators/mern/schema.json +4 -14
- package/src/generators/mevn/schema.json +4 -14
- package/src/generators/pean/schema.json +4 -14
- package/src/generators/pern/schema.json +4 -14
- package/src/generators/pevn/schema.json +4 -14
- package/src/generators/react-app/files/AGENTS.md__tmpl__ +9 -0
- package/src/generators/react-app/schema.json +6 -22
- package/src/generators/react-dotnet/schema.json +4 -14
- package/src/generators/react-form/schema.json +4 -14
- package/src/generators/react-task-list/schema.json +4 -14
- package/src/generators/vue-app/files/AGENTS.md__tmpl__ +9 -0
- package/src/generators/vue-app/files/src/App.spec.ts__tmpl__ +27 -0
- package/src/generators/vue-app/files/src/App.vue__tmpl__ +13 -8
- package/src/generators/vue-app/schema.json +15 -14
- package/src/generators/vue-app/vue-app.js +9 -3
- package/src/generators/vue-app/vue-app.js.map +1 -1
- package/src/generators/vue-app/vue-app.spec.ts +21 -0
package/README.md
CHANGED
|
@@ -52,6 +52,13 @@ Prerequisites for the sandbox deploy (steps 4–5): `podman` (machine started on
|
|
|
52
52
|
macOS), `oc` logged in to the sandbox cluster, and the GitHub CLI (`gh`)
|
|
53
53
|
authenticated as an account with **`write:packages`** on your registry org.
|
|
54
54
|
|
|
55
|
+
> **Coding agents:** run generators with `--no-interactive` **and** every required
|
|
56
|
+
> option (name, `--env`, `--sandboxProject`, etc.) supplied — otherwise Nx prompts
|
|
57
|
+
> and your session hangs waiting for input. Setting `CI=true` in the env has the
|
|
58
|
+
> same effect and also skips the Nx Cloud prompt. (`nx run <target>` executors
|
|
59
|
+
> don't prompt — this only applies to `nx g` generators.) The commands below
|
|
60
|
+
> already follow this.
|
|
61
|
+
|
|
55
62
|
```bash
|
|
56
63
|
# 1. Empty folder → Nx workspace (the plugins require Nx 23)
|
|
57
64
|
npx create-nx-workspace@latest my-solution --preset=apps --workspaceType=integrated --nxCloud=skip --no-interactive
|
|
@@ -62,12 +69,12 @@ NXV=$(node -p "require('./node_modules/nx/package.json').version")
|
|
|
62
69
|
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
70
|
|
|
64
71
|
# 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
|
|
72
|
+
npx nx g @abgov/nx-adsp:pevn acme --env=dev --tenant=my-tenant --no-interactive
|
|
66
73
|
|
|
67
74
|
# 4. Add sandbox targets (registry derives from the git remote, or pass --registry=ghcr.io/<org>;
|
|
68
75
|
# 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
|
|
76
|
+
npx nx g @abgov/nx-oc:sandbox acme-service --sandboxProject=<namespace> --registry=ghcr.io/<org> --tenant=my-tenant --env=dev --no-interactive
|
|
77
|
+
npx nx g @abgov/nx-oc:sandbox acme-app --sandboxProject=<namespace> --tenant=my-tenant --env=dev --no-interactive
|
|
71
78
|
|
|
72
79
|
# 5. Deploy — backend first so the frontend's /api proxy resolves
|
|
73
80
|
npx nx run acme-service:sandbox
|
|
@@ -92,7 +99,7 @@ npx nx g @abgov/nx-adsp:express-service my-service --env dev --tenant my-tenant
|
|
|
92
99
|
| Option | Alias | Required | Description |
|
|
93
100
|
|--------|-------|----------|-------------|
|
|
94
101
|
| `name` | — | Yes | Name of the service |
|
|
95
|
-
| `env` | `-e` |
|
|
102
|
+
| `env` | `-e` | No | ADSP environment / access service. Defaults to `test` = access-uat.alberta.ca (UAT — use for dev and pre-prod); `prod` = access.alberta.ca; `dev` = ADSP platform dev (restricted) |
|
|
96
103
|
| `tenant` | `-t` | No | ADSP tenant name; looks up the Keycloak realm automatically via a single browser login |
|
|
97
104
|
| `tenantRealm` | `-tr` | No | Keycloak realm UUID; overrides the realm resolved from `--tenant` |
|
|
98
105
|
| `accessToken` | `-at` | No | Access token for non-interactive retrieval of ADSP configuration |
|
|
@@ -110,7 +117,7 @@ npx nx g @abgov/nx-adsp:react-app my-app --env dev --tenant my-tenant
|
|
|
110
117
|
| Option | Alias | Required | Description |
|
|
111
118
|
|--------|-------|----------|-------------|
|
|
112
119
|
| `name` | — | Yes | Name of the application |
|
|
113
|
-
| `env` | `-e` |
|
|
120
|
+
| `env` | `-e` | No | ADSP environment / access service. Defaults to `test` = access-uat.alberta.ca (UAT — use for dev and pre-prod); `prod` = access.alberta.ca; `dev` = ADSP platform dev (restricted) |
|
|
114
121
|
| `tenant` | `-t` | No | ADSP tenant name; looks up the Keycloak realm automatically via a single browser login |
|
|
115
122
|
| `tenantRealm` | `-tr` | No | Keycloak realm UUID; overrides the realm resolved from `--tenant` |
|
|
116
123
|
| `accessToken` | `-at` | No | Access token for non-interactive retrieval of ADSP configuration |
|
|
@@ -141,7 +148,7 @@ npx nx g @abgov/nx-adsp:dotnet-service my-service --env dev --accessToken $TOKEN
|
|
|
141
148
|
| Option | Alias | Required | Description |
|
|
142
149
|
|--------|-------|----------|-------------|
|
|
143
150
|
| `name` | — | Yes | Name of the service |
|
|
144
|
-
| `env` | `-e` |
|
|
151
|
+
| `env` | `-e` | No | ADSP environment / access service. Defaults to `test` = access-uat.alberta.ca (UAT — use for dev and pre-prod); `prod` = access.alberta.ca; `dev` = ADSP platform dev (restricted) |
|
|
145
152
|
| `accessToken` | `-at` | No | Access token for non-interactive retrieval of ADSP configuration |
|
|
146
153
|
|
|
147
154
|
---
|
|
@@ -169,7 +176,7 @@ npx nx g @abgov/nx-adsp:react-form my-app --env test
|
|
|
169
176
|
| Option | Alias | Required | Description |
|
|
170
177
|
|--------|-------|----------|-------------|
|
|
171
178
|
| `project` | — | Yes | Name of the existing Nx project to add the form component to |
|
|
172
|
-
| `env` | `-e` |
|
|
179
|
+
| `env` | `-e` | No | ADSP environment to fetch form definitions from. Defaults to `test` (UAT / access-uat.alberta.ca) |
|
|
173
180
|
| `accessToken` | `-at` | No | Access token for non-interactive retrieval of ADSP configuration |
|
|
174
181
|
|
|
175
182
|
---
|
package/package.json
CHANGED
|
@@ -9,8 +9,17 @@ This app is paired with **`<%= pairedProject %>`** — the Express backend it ta
|
|
|
9
9
|
API calls use the `/api/` prefix which the Angular dev proxy rewrites to `/<%= pairedProject %>/` on port 3333.
|
|
10
10
|
When working on a feature that spans both projects, read `apps/<%= pairedProject %>/AGENTS.md` for the service context.
|
|
11
11
|
<% } %>
|
|
12
|
+
## Running Nx commands (coding agents)
|
|
13
|
+
|
|
14
|
+
Run generators with `--no-interactive` **and** every required option supplied. With
|
|
15
|
+
`--no-interactive`, a missing required option errors instead of prompting, so an
|
|
16
|
+
interactive prompt never blocks your session (`CI=true` in the env does the same and
|
|
17
|
+
also skips the Nx Cloud prompt). This applies to `nx g` generators; `nx run <target>`
|
|
18
|
+
executors read options from `project.json` and do not prompt.
|
|
19
|
+
|
|
12
20
|
## Stack
|
|
13
21
|
|
|
22
|
+
|
|
14
23
|
- **UI**: Angular 19 standalone + GoA design system (`@abgov/angular-components` — `Goab*` components)
|
|
15
24
|
- **Auth**: `keycloak-angular` with `keycloak-js`
|
|
16
25
|
- **Router**: Angular Router with `createAuthGuard` from `keycloak-angular`
|
|
@@ -15,21 +15,14 @@
|
|
|
15
15
|
},
|
|
16
16
|
"env": {
|
|
17
17
|
"type": "string",
|
|
18
|
-
"description": "
|
|
18
|
+
"description": "ADSP environment / access service to target: test = access-uat.alberta.ca (UAT — use for dev and pre-prod), prod = access.alberta.ca, dev = ADSP platform dev (restricted). Defaults to test.",
|
|
19
19
|
"$default": {
|
|
20
20
|
"$source": "argv",
|
|
21
21
|
"index": 1
|
|
22
22
|
},
|
|
23
23
|
"alias": "e",
|
|
24
|
-
"
|
|
25
|
-
|
|
26
|
-
"type": "list",
|
|
27
|
-
"items": [
|
|
28
|
-
"dev",
|
|
29
|
-
"test",
|
|
30
|
-
"prod"
|
|
31
|
-
]
|
|
32
|
-
}
|
|
24
|
+
"enum": ["test", "prod", "dev"],
|
|
25
|
+
"default": "test"
|
|
33
26
|
},
|
|
34
27
|
"tenant": {
|
|
35
28
|
"type": "string",
|
|
@@ -65,10 +58,7 @@
|
|
|
65
58
|
"type": "string"
|
|
66
59
|
}
|
|
67
60
|
},
|
|
68
|
-
"required": [
|
|
69
|
-
"location",
|
|
70
|
-
"proxyPass"
|
|
71
|
-
]
|
|
61
|
+
"required": ["location", "proxyPass"]
|
|
72
62
|
}
|
|
73
63
|
},
|
|
74
64
|
{
|
|
@@ -81,10 +71,7 @@
|
|
|
81
71
|
"type": "string"
|
|
82
72
|
}
|
|
83
73
|
},
|
|
84
|
-
"required": [
|
|
85
|
-
"location",
|
|
86
|
-
"proxyPass"
|
|
87
|
-
]
|
|
74
|
+
"required": ["location", "proxyPass"]
|
|
88
75
|
}
|
|
89
76
|
]
|
|
90
77
|
},
|
|
@@ -94,9 +81,6 @@
|
|
|
94
81
|
"default": false
|
|
95
82
|
}
|
|
96
83
|
},
|
|
97
|
-
"required": [
|
|
98
|
-
"name",
|
|
99
|
-
"env"
|
|
100
|
-
],
|
|
84
|
+
"required": ["name", "env"],
|
|
101
85
|
"additionalProperties": false
|
|
102
86
|
}
|
|
@@ -15,21 +15,14 @@
|
|
|
15
15
|
},
|
|
16
16
|
"env": {
|
|
17
17
|
"type": "string",
|
|
18
|
-
"description": "
|
|
18
|
+
"description": "ADSP environment / access service to target: test = access-uat.alberta.ca (UAT — use for dev and pre-prod), prod = access.alberta.ca, dev = ADSP platform dev (restricted). Defaults to test.",
|
|
19
19
|
"$default": {
|
|
20
20
|
"$source": "argv",
|
|
21
21
|
"index": 1
|
|
22
22
|
},
|
|
23
23
|
"alias": "e",
|
|
24
|
-
"
|
|
25
|
-
|
|
26
|
-
"type": "list",
|
|
27
|
-
"items": [
|
|
28
|
-
"dev",
|
|
29
|
-
"test",
|
|
30
|
-
"prod"
|
|
31
|
-
]
|
|
32
|
-
}
|
|
24
|
+
"enum": ["test", "prod", "dev"],
|
|
25
|
+
"default": "test"
|
|
33
26
|
},
|
|
34
27
|
"accessToken": {
|
|
35
28
|
"type": "string",
|
|
@@ -37,9 +30,6 @@
|
|
|
37
30
|
"alias": "at"
|
|
38
31
|
}
|
|
39
32
|
},
|
|
40
|
-
"required": [
|
|
41
|
-
"name",
|
|
42
|
-
"env"
|
|
43
|
-
],
|
|
33
|
+
"required": ["name", "env"],
|
|
44
34
|
"additionalProperties": false
|
|
45
35
|
}
|
|
@@ -9,8 +9,17 @@ This service is paired with **`<%= pairedProject %>`** — the frontend app it s
|
|
|
9
9
|
The frontend proxies `/api/` to `/<%= projectName %>/` on port 3333 (dev) and via nginx (production).
|
|
10
10
|
When working on a feature that spans both projects, read `apps/<%= pairedProject %>/AGENTS.md` for the frontend context.
|
|
11
11
|
<% } %>
|
|
12
|
+
## Running Nx commands (coding agents)
|
|
13
|
+
|
|
14
|
+
Run generators with `--no-interactive` **and** every required option supplied. With
|
|
15
|
+
`--no-interactive`, a missing required option errors instead of prompting, so an
|
|
16
|
+
interactive prompt never blocks your session (`CI=true` in the env does the same and
|
|
17
|
+
also skips the Nx Cloud prompt). This applies to `nx g` generators; `nx run <target>`
|
|
18
|
+
executors read options from `project.json` and do not prompt.
|
|
19
|
+
|
|
12
20
|
## Stack
|
|
13
21
|
|
|
22
|
+
|
|
14
23
|
- **Runtime**: Node.js + Express
|
|
15
24
|
- **Auth**: passport.js with tenant strategy from `@abgov/adsp-service-sdk`
|
|
16
25
|
- **Config**: `envalid` with `.env` file (see `src/environment.ts`)
|
|
@@ -15,21 +15,14 @@
|
|
|
15
15
|
},
|
|
16
16
|
"env": {
|
|
17
17
|
"type": "string",
|
|
18
|
-
"description": "
|
|
18
|
+
"description": "ADSP environment / access service to target: test = access-uat.alberta.ca (UAT — use for dev and pre-prod), prod = access.alberta.ca, dev = ADSP platform dev (restricted). Defaults to test.",
|
|
19
19
|
"$default": {
|
|
20
20
|
"$source": "argv",
|
|
21
21
|
"index": 1
|
|
22
22
|
},
|
|
23
23
|
"alias": "e",
|
|
24
|
-
"
|
|
25
|
-
|
|
26
|
-
"type": "list",
|
|
27
|
-
"items": [
|
|
28
|
-
"dev",
|
|
29
|
-
"test",
|
|
30
|
-
"prod"
|
|
31
|
-
]
|
|
32
|
-
}
|
|
24
|
+
"enum": ["test", "prod", "dev"],
|
|
25
|
+
"default": "test"
|
|
33
26
|
},
|
|
34
27
|
"accessToken": {
|
|
35
28
|
"type": "string",
|
|
@@ -38,7 +31,7 @@
|
|
|
38
31
|
},
|
|
39
32
|
"tenantRealm": {
|
|
40
33
|
"type": "string",
|
|
41
|
-
"description": "Keycloak realm UUID. Optional when --tenant is provided
|
|
34
|
+
"description": "Keycloak realm UUID. Optional when --tenant is provided — overrides the realm looked up from the tenant service.",
|
|
42
35
|
"alias": "tr"
|
|
43
36
|
},
|
|
44
37
|
"tenant": {
|
|
@@ -55,9 +48,18 @@
|
|
|
55
48
|
"message": "Which database would you like to include?",
|
|
56
49
|
"type": "list",
|
|
57
50
|
"items": [
|
|
58
|
-
{
|
|
59
|
-
|
|
60
|
-
|
|
51
|
+
{
|
|
52
|
+
"value": "none",
|
|
53
|
+
"label": "None — add a database later"
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
"value": "postgres",
|
|
57
|
+
"label": "PostgreSQL (Drizzle)"
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
"value": "mongo",
|
|
61
|
+
"label": "MongoDB (Mongoose)"
|
|
62
|
+
}
|
|
61
63
|
]
|
|
62
64
|
}
|
|
63
65
|
},
|
|
@@ -67,9 +69,6 @@
|
|
|
67
69
|
"default": false
|
|
68
70
|
}
|
|
69
71
|
},
|
|
70
|
-
"required": [
|
|
71
|
-
"name",
|
|
72
|
-
"env"
|
|
73
|
-
],
|
|
72
|
+
"required": ["name", "env"],
|
|
74
73
|
"additionalProperties": false
|
|
75
|
-
}
|
|
74
|
+
}
|
|
@@ -8,14 +8,17 @@
|
|
|
8
8
|
"name": {
|
|
9
9
|
"type": "string",
|
|
10
10
|
"description": "Name of the project.",
|
|
11
|
-
"$default": {
|
|
11
|
+
"$default": {
|
|
12
|
+
"$source": "argv",
|
|
13
|
+
"index": 0
|
|
14
|
+
},
|
|
12
15
|
"x-prompt": "What name would you like to use for the project?"
|
|
13
16
|
},
|
|
14
17
|
"env": {
|
|
15
18
|
"type": "string",
|
|
16
|
-
"description": "ADSP environment to
|
|
17
|
-
"enum": ["
|
|
18
|
-
"default": "
|
|
19
|
+
"description": "ADSP environment / access service to target: test = access-uat.alberta.ca (UAT — use for dev and pre-prod), prod = access.alberta.ca, dev = ADSP platform dev (restricted). Defaults to test.",
|
|
20
|
+
"enum": ["test", "prod", "dev"],
|
|
21
|
+
"default": "test"
|
|
19
22
|
},
|
|
20
23
|
"tenant": {
|
|
21
24
|
"type": "string",
|
|
@@ -15,21 +15,14 @@
|
|
|
15
15
|
},
|
|
16
16
|
"env": {
|
|
17
17
|
"type": "string",
|
|
18
|
-
"description": "
|
|
18
|
+
"description": "ADSP environment / access service to target: test = access-uat.alberta.ca (UAT — use for dev and pre-prod), prod = access.alberta.ca, dev = ADSP platform dev (restricted). Defaults to test.",
|
|
19
19
|
"$default": {
|
|
20
20
|
"$source": "argv",
|
|
21
21
|
"index": 1
|
|
22
22
|
},
|
|
23
23
|
"alias": "e",
|
|
24
|
-
"
|
|
25
|
-
|
|
26
|
-
"type": "list",
|
|
27
|
-
"items": [
|
|
28
|
-
"dev",
|
|
29
|
-
"test",
|
|
30
|
-
"prod"
|
|
31
|
-
]
|
|
32
|
-
}
|
|
24
|
+
"enum": ["test", "prod", "dev"],
|
|
25
|
+
"default": "test"
|
|
33
26
|
},
|
|
34
27
|
"tenant": {
|
|
35
28
|
"type": "string",
|
|
@@ -52,9 +45,6 @@
|
|
|
52
45
|
"default": false
|
|
53
46
|
}
|
|
54
47
|
},
|
|
55
|
-
"required": [
|
|
56
|
-
"name",
|
|
57
|
-
"env"
|
|
58
|
-
],
|
|
48
|
+
"required": ["name", "env"],
|
|
59
49
|
"additionalProperties": false
|
|
60
50
|
}
|
|
@@ -15,21 +15,14 @@
|
|
|
15
15
|
},
|
|
16
16
|
"env": {
|
|
17
17
|
"type": "string",
|
|
18
|
-
"description": "
|
|
18
|
+
"description": "ADSP environment / access service to target: test = access-uat.alberta.ca (UAT — use for dev and pre-prod), prod = access.alberta.ca, dev = ADSP platform dev (restricted). Defaults to test.",
|
|
19
19
|
"$default": {
|
|
20
20
|
"$source": "argv",
|
|
21
21
|
"index": 1
|
|
22
22
|
},
|
|
23
23
|
"alias": "e",
|
|
24
|
-
"
|
|
25
|
-
|
|
26
|
-
"type": "list",
|
|
27
|
-
"items": [
|
|
28
|
-
"dev",
|
|
29
|
-
"test",
|
|
30
|
-
"prod"
|
|
31
|
-
]
|
|
32
|
-
}
|
|
24
|
+
"enum": ["test", "prod", "dev"],
|
|
25
|
+
"default": "test"
|
|
33
26
|
},
|
|
34
27
|
"tenant": {
|
|
35
28
|
"type": "string",
|
|
@@ -52,9 +45,6 @@
|
|
|
52
45
|
"default": false
|
|
53
46
|
}
|
|
54
47
|
},
|
|
55
|
-
"required": [
|
|
56
|
-
"name",
|
|
57
|
-
"env"
|
|
58
|
-
],
|
|
48
|
+
"required": ["name", "env"],
|
|
59
49
|
"additionalProperties": false
|
|
60
50
|
}
|
|
@@ -15,21 +15,14 @@
|
|
|
15
15
|
},
|
|
16
16
|
"env": {
|
|
17
17
|
"type": "string",
|
|
18
|
-
"description": "
|
|
18
|
+
"description": "ADSP environment / access service to target: test = access-uat.alberta.ca (UAT — use for dev and pre-prod), prod = access.alberta.ca, dev = ADSP platform dev (restricted). Defaults to test.",
|
|
19
19
|
"$default": {
|
|
20
20
|
"$source": "argv",
|
|
21
21
|
"index": 1
|
|
22
22
|
},
|
|
23
23
|
"alias": "e",
|
|
24
|
-
"
|
|
25
|
-
|
|
26
|
-
"type": "list",
|
|
27
|
-
"items": [
|
|
28
|
-
"dev",
|
|
29
|
-
"test",
|
|
30
|
-
"prod"
|
|
31
|
-
]
|
|
32
|
-
}
|
|
24
|
+
"enum": ["test", "prod", "dev"],
|
|
25
|
+
"default": "test"
|
|
33
26
|
},
|
|
34
27
|
"tenant": {
|
|
35
28
|
"type": "string",
|
|
@@ -52,9 +45,6 @@
|
|
|
52
45
|
"default": false
|
|
53
46
|
}
|
|
54
47
|
},
|
|
55
|
-
"required": [
|
|
56
|
-
"name",
|
|
57
|
-
"env"
|
|
58
|
-
],
|
|
48
|
+
"required": ["name", "env"],
|
|
59
49
|
"additionalProperties": false
|
|
60
50
|
}
|
|
@@ -15,21 +15,14 @@
|
|
|
15
15
|
},
|
|
16
16
|
"env": {
|
|
17
17
|
"type": "string",
|
|
18
|
-
"description": "
|
|
18
|
+
"description": "ADSP environment / access service to target: test = access-uat.alberta.ca (UAT — use for dev and pre-prod), prod = access.alberta.ca, dev = ADSP platform dev (restricted). Defaults to test.",
|
|
19
19
|
"$default": {
|
|
20
20
|
"$source": "argv",
|
|
21
21
|
"index": 1
|
|
22
22
|
},
|
|
23
23
|
"alias": "e",
|
|
24
|
-
"
|
|
25
|
-
|
|
26
|
-
"type": "list",
|
|
27
|
-
"items": [
|
|
28
|
-
"dev",
|
|
29
|
-
"test",
|
|
30
|
-
"prod"
|
|
31
|
-
]
|
|
32
|
-
}
|
|
24
|
+
"enum": ["test", "prod", "dev"],
|
|
25
|
+
"default": "test"
|
|
33
26
|
},
|
|
34
27
|
"tenant": {
|
|
35
28
|
"type": "string",
|
|
@@ -52,9 +45,6 @@
|
|
|
52
45
|
"default": false
|
|
53
46
|
}
|
|
54
47
|
},
|
|
55
|
-
"required": [
|
|
56
|
-
"name",
|
|
57
|
-
"env"
|
|
58
|
-
],
|
|
48
|
+
"required": ["name", "env"],
|
|
59
49
|
"additionalProperties": false
|
|
60
50
|
}
|
|
@@ -15,21 +15,14 @@
|
|
|
15
15
|
},
|
|
16
16
|
"env": {
|
|
17
17
|
"type": "string",
|
|
18
|
-
"description": "
|
|
18
|
+
"description": "ADSP environment / access service to target: test = access-uat.alberta.ca (UAT — use for dev and pre-prod), prod = access.alberta.ca, dev = ADSP platform dev (restricted). Defaults to test.",
|
|
19
19
|
"$default": {
|
|
20
20
|
"$source": "argv",
|
|
21
21
|
"index": 1
|
|
22
22
|
},
|
|
23
23
|
"alias": "e",
|
|
24
|
-
"
|
|
25
|
-
|
|
26
|
-
"type": "list",
|
|
27
|
-
"items": [
|
|
28
|
-
"dev",
|
|
29
|
-
"test",
|
|
30
|
-
"prod"
|
|
31
|
-
]
|
|
32
|
-
}
|
|
24
|
+
"enum": ["test", "prod", "dev"],
|
|
25
|
+
"default": "test"
|
|
33
26
|
},
|
|
34
27
|
"tenant": {
|
|
35
28
|
"type": "string",
|
|
@@ -52,9 +45,6 @@
|
|
|
52
45
|
"default": false
|
|
53
46
|
}
|
|
54
47
|
},
|
|
55
|
-
"required": [
|
|
56
|
-
"name",
|
|
57
|
-
"env"
|
|
58
|
-
],
|
|
48
|
+
"required": ["name", "env"],
|
|
59
49
|
"additionalProperties": false
|
|
60
50
|
}
|
|
@@ -9,8 +9,17 @@ This app is paired with **`<%= pairedProject %>`** — the Express backend it ta
|
|
|
9
9
|
API calls use the `/api/` prefix which the webpack dev proxy rewrites to `/<%= pairedProject %>/` on port 3333.
|
|
10
10
|
When working on a feature that spans both projects, read `apps/<%= pairedProject %>/AGENTS.md` for the service context.
|
|
11
11
|
<% } %>
|
|
12
|
+
## Running Nx commands (coding agents)
|
|
13
|
+
|
|
14
|
+
Run generators with `--no-interactive` **and** every required option supplied. With
|
|
15
|
+
`--no-interactive`, a missing required option errors instead of prompting, so an
|
|
16
|
+
interactive prompt never blocks your session (`CI=true` in the env does the same and
|
|
17
|
+
also skips the Nx Cloud prompt). This applies to `nx g` generators; `nx run <target>`
|
|
18
|
+
executors read options from `project.json` and do not prompt.
|
|
19
|
+
|
|
12
20
|
## Stack
|
|
13
21
|
|
|
22
|
+
|
|
14
23
|
- **UI**: React 18 + GoA design system (`@abgov/react-components` — `Goab*` components)
|
|
15
24
|
- **Auth**: `keycloak-js` via Redux Toolkit slice (`src/app/user.slice.ts`)
|
|
16
25
|
- **State**: Redux Toolkit — store in `src/store.ts`
|
|
@@ -15,21 +15,14 @@
|
|
|
15
15
|
},
|
|
16
16
|
"env": {
|
|
17
17
|
"type": "string",
|
|
18
|
-
"description": "
|
|
18
|
+
"description": "ADSP environment / access service to target: test = access-uat.alberta.ca (UAT — use for dev and pre-prod), prod = access.alberta.ca, dev = ADSP platform dev (restricted). Defaults to test.",
|
|
19
19
|
"$default": {
|
|
20
20
|
"$source": "argv",
|
|
21
21
|
"index": 1
|
|
22
22
|
},
|
|
23
23
|
"alias": "e",
|
|
24
|
-
"
|
|
25
|
-
|
|
26
|
-
"type": "list",
|
|
27
|
-
"items": [
|
|
28
|
-
"dev",
|
|
29
|
-
"test",
|
|
30
|
-
"prod"
|
|
31
|
-
]
|
|
32
|
-
}
|
|
24
|
+
"enum": ["test", "prod", "dev"],
|
|
25
|
+
"default": "test"
|
|
33
26
|
},
|
|
34
27
|
"tenant": {
|
|
35
28
|
"type": "string",
|
|
@@ -65,10 +58,7 @@
|
|
|
65
58
|
"type": "string"
|
|
66
59
|
}
|
|
67
60
|
},
|
|
68
|
-
"required": [
|
|
69
|
-
"location",
|
|
70
|
-
"proxyPass"
|
|
71
|
-
]
|
|
61
|
+
"required": ["location", "proxyPass"]
|
|
72
62
|
}
|
|
73
63
|
},
|
|
74
64
|
{
|
|
@@ -81,10 +71,7 @@
|
|
|
81
71
|
"type": "string"
|
|
82
72
|
}
|
|
83
73
|
},
|
|
84
|
-
"required": [
|
|
85
|
-
"location",
|
|
86
|
-
"proxyPass"
|
|
87
|
-
]
|
|
74
|
+
"required": ["location", "proxyPass"]
|
|
88
75
|
}
|
|
89
76
|
]
|
|
90
77
|
},
|
|
@@ -94,9 +81,6 @@
|
|
|
94
81
|
"default": false
|
|
95
82
|
}
|
|
96
83
|
},
|
|
97
|
-
"required": [
|
|
98
|
-
"name",
|
|
99
|
-
"env"
|
|
100
|
-
],
|
|
84
|
+
"required": ["name", "env"],
|
|
101
85
|
"additionalProperties": false
|
|
102
86
|
}
|
|
@@ -15,21 +15,14 @@
|
|
|
15
15
|
},
|
|
16
16
|
"env": {
|
|
17
17
|
"type": "string",
|
|
18
|
-
"description": "
|
|
18
|
+
"description": "ADSP environment / access service to target: test = access-uat.alberta.ca (UAT — use for dev and pre-prod), prod = access.alberta.ca, dev = ADSP platform dev (restricted). Defaults to test.",
|
|
19
19
|
"$default": {
|
|
20
20
|
"$source": "argv",
|
|
21
21
|
"index": 1
|
|
22
22
|
},
|
|
23
23
|
"alias": "e",
|
|
24
|
-
"
|
|
25
|
-
|
|
26
|
-
"type": "list",
|
|
27
|
-
"items": [
|
|
28
|
-
"dev",
|
|
29
|
-
"test",
|
|
30
|
-
"prod"
|
|
31
|
-
]
|
|
32
|
-
}
|
|
24
|
+
"enum": ["test", "prod", "dev"],
|
|
25
|
+
"default": "test"
|
|
33
26
|
},
|
|
34
27
|
"accessToken": {
|
|
35
28
|
"type": "string",
|
|
@@ -37,9 +30,6 @@
|
|
|
37
30
|
"alias": "at"
|
|
38
31
|
}
|
|
39
32
|
},
|
|
40
|
-
"required": [
|
|
41
|
-
"name",
|
|
42
|
-
"env"
|
|
43
|
-
],
|
|
33
|
+
"required": ["name", "env"],
|
|
44
34
|
"additionalProperties": false
|
|
45
35
|
}
|
|
@@ -15,21 +15,14 @@
|
|
|
15
15
|
},
|
|
16
16
|
"env": {
|
|
17
17
|
"type": "string",
|
|
18
|
-
"description": "
|
|
18
|
+
"description": "ADSP environment / access service to target: test = access-uat.alberta.ca (UAT — use for dev and pre-prod), prod = access.alberta.ca, dev = ADSP platform dev (restricted). Defaults to test.",
|
|
19
19
|
"$default": {
|
|
20
20
|
"$source": "argv",
|
|
21
21
|
"index": 1
|
|
22
22
|
},
|
|
23
23
|
"alias": "e",
|
|
24
|
-
"
|
|
25
|
-
|
|
26
|
-
"type": "list",
|
|
27
|
-
"items": [
|
|
28
|
-
"test",
|
|
29
|
-
"prod",
|
|
30
|
-
"dev"
|
|
31
|
-
]
|
|
32
|
-
}
|
|
24
|
+
"enum": ["test", "prod", "dev"],
|
|
25
|
+
"default": "test"
|
|
33
26
|
},
|
|
34
27
|
"accessToken": {
|
|
35
28
|
"type": "string",
|
|
@@ -37,9 +30,6 @@
|
|
|
37
30
|
"alias": "at"
|
|
38
31
|
}
|
|
39
32
|
},
|
|
40
|
-
"required": [
|
|
41
|
-
"project",
|
|
42
|
-
"env"
|
|
43
|
-
],
|
|
33
|
+
"required": ["project", "env"],
|
|
44
34
|
"additionalProperties": false
|
|
45
35
|
}
|
|
@@ -15,21 +15,14 @@
|
|
|
15
15
|
},
|
|
16
16
|
"env": {
|
|
17
17
|
"type": "string",
|
|
18
|
-
"description": "
|
|
18
|
+
"description": "ADSP environment / access service to target: test = access-uat.alberta.ca (UAT — use for dev and pre-prod), prod = access.alberta.ca, dev = ADSP platform dev (restricted). Defaults to test.",
|
|
19
19
|
"$default": {
|
|
20
20
|
"$source": "argv",
|
|
21
21
|
"index": 1
|
|
22
22
|
},
|
|
23
23
|
"alias": "e",
|
|
24
|
-
"
|
|
25
|
-
|
|
26
|
-
"type": "list",
|
|
27
|
-
"items": [
|
|
28
|
-
"test",
|
|
29
|
-
"prod",
|
|
30
|
-
"dev"
|
|
31
|
-
]
|
|
32
|
-
}
|
|
24
|
+
"enum": ["test", "prod", "dev"],
|
|
25
|
+
"default": "test"
|
|
33
26
|
},
|
|
34
27
|
"accessToken": {
|
|
35
28
|
"type": "string",
|
|
@@ -37,9 +30,6 @@
|
|
|
37
30
|
"alias": "at"
|
|
38
31
|
}
|
|
39
32
|
},
|
|
40
|
-
"required": [
|
|
41
|
-
"project",
|
|
42
|
-
"env"
|
|
43
|
-
],
|
|
33
|
+
"required": ["project", "env"],
|
|
44
34
|
"additionalProperties": false
|
|
45
35
|
}
|
|
@@ -9,8 +9,17 @@ This app is paired with **`<%= pairedProject %>`** — the Express backend it ta
|
|
|
9
9
|
API calls use the `/api/` prefix which the Vite dev proxy rewrites to `/<%= pairedProject %>/` on port 3333.
|
|
10
10
|
When working on a feature that spans both projects, read `apps/<%= pairedProject %>/AGENTS.md` for the service context.
|
|
11
11
|
<% } %>
|
|
12
|
+
## Running Nx commands (coding agents)
|
|
13
|
+
|
|
14
|
+
Run generators with `--no-interactive` **and** every required option supplied. With
|
|
15
|
+
`--no-interactive`, a missing required option errors instead of prompting, so an
|
|
16
|
+
interactive prompt never blocks your session (`CI=true` in the env does the same and
|
|
17
|
+
also skips the Nx Cloud prompt). This applies to `nx g` generators; `nx run <target>`
|
|
18
|
+
executors read options from `project.json` and do not prompt.
|
|
19
|
+
|
|
12
20
|
## Stack
|
|
13
21
|
|
|
22
|
+
|
|
14
23
|
- **UI**: Vue 3 (Composition API) + GoA design system (`@abgov/web-components` — `goa-*` custom elements)
|
|
15
24
|
- **Auth**: `@dsb-norge/vue-keycloak-js` (wraps `keycloak-js`)
|
|
16
25
|
- **State**: Pinia
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { mount } from '@vue/test-utils';
|
|
2
|
+
import { ref } from 'vue';
|
|
3
|
+
import { describe, it, expect, vi } from 'vitest';
|
|
4
|
+
|
|
5
|
+
vi.mock('@dsb-norge/vue-keycloak-js', () => ({
|
|
6
|
+
useKeycloak: () => ({
|
|
7
|
+
authenticated: ref(false),
|
|
8
|
+
fullName: ref(''),
|
|
9
|
+
// ready stays false — Keycloak's check-sso hasn't resolved (or failed).
|
|
10
|
+
ready: ref(false),
|
|
11
|
+
keycloak: { login: vi.fn(), logout: vi.fn() },
|
|
12
|
+
}),
|
|
13
|
+
}));
|
|
14
|
+
|
|
15
|
+
import App from './App.vue';
|
|
16
|
+
|
|
17
|
+
describe('App shell header', () => {
|
|
18
|
+
it('shows Sign in when unauthenticated even before Keycloak is ready', () => {
|
|
19
|
+
const wrapper = mount(App, { global: { stubs: { RouterView: true } } });
|
|
20
|
+
|
|
21
|
+
// The sign-in affordance must not be gated on `ready`: if check-sso never
|
|
22
|
+
// resolves, the button would be hidden and the user could never log in.
|
|
23
|
+
const group = wrapper.find('goa-button-group');
|
|
24
|
+
expect(group.exists()).toBe(true);
|
|
25
|
+
expect(group.html()).toContain('Sign in');
|
|
26
|
+
});
|
|
27
|
+
});
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { useKeycloak } from '@dsb-norge/vue-keycloak-js';
|
|
3
3
|
import { RouterView } from 'vue-router';
|
|
4
4
|
|
|
5
|
-
const { authenticated, fullName,
|
|
5
|
+
const { authenticated, fullName, keycloak } = useKeycloak();
|
|
6
6
|
|
|
7
7
|
function login() { keycloak?.login(); }
|
|
8
8
|
function logout() { keycloak?.logout({ redirectUri: window.location.origin }); }
|
|
@@ -11,13 +11,18 @@ function logout() { keycloak?.logout({ redirectUri: window.location.origin }); }
|
|
|
11
11
|
<template>
|
|
12
12
|
<goa-microsite-header type="alpha" />
|
|
13
13
|
<goa-app-header url="/" heading="<%= projectName %>">
|
|
14
|
-
<
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
14
|
+
<goa-button-group alignment="end">
|
|
15
|
+
<span v-if="authenticated && fullName">{{ fullName }}</span>
|
|
16
|
+
<!-- Gate on !authenticated only, not `ready`: if Keycloak's check-sso
|
|
17
|
+
doesn't resolve (e.g. the silent-SSO iframe is blocked), we still
|
|
18
|
+
want the sign-in affordance — login() does a full redirect anyway. -->
|
|
19
|
+
<goa-button v-if="!authenticated" type="tertiary" @_click="login">
|
|
20
|
+
Sign in
|
|
21
|
+
</goa-button>
|
|
22
|
+
<goa-button v-if="authenticated" type="tertiary" @_click="logout">
|
|
23
|
+
Sign out
|
|
24
|
+
</goa-button>
|
|
25
|
+
</goa-button-group>
|
|
21
26
|
</goa-app-header>
|
|
22
27
|
<goa-hero-banner heading="<%= projectName %>" backgroundurl="/assets/banner.jpg" />
|
|
23
28
|
<main>
|
|
@@ -15,21 +15,14 @@
|
|
|
15
15
|
},
|
|
16
16
|
"env": {
|
|
17
17
|
"type": "string",
|
|
18
|
-
"description": "
|
|
18
|
+
"description": "ADSP environment / access service to target: test = access-uat.alberta.ca (UAT — use for dev and pre-prod), prod = access.alberta.ca, dev = ADSP platform dev (restricted). Defaults to test.",
|
|
19
19
|
"$default": {
|
|
20
20
|
"$source": "argv",
|
|
21
21
|
"index": 1
|
|
22
22
|
},
|
|
23
23
|
"alias": "e",
|
|
24
|
-
"
|
|
25
|
-
|
|
26
|
-
"type": "list",
|
|
27
|
-
"items": [
|
|
28
|
-
"dev",
|
|
29
|
-
"test",
|
|
30
|
-
"prod"
|
|
31
|
-
]
|
|
32
|
-
}
|
|
24
|
+
"enum": ["test", "prod", "dev"],
|
|
25
|
+
"default": "test"
|
|
33
26
|
},
|
|
34
27
|
"tenant": {
|
|
35
28
|
"type": "string",
|
|
@@ -58,8 +51,12 @@
|
|
|
58
51
|
"items": {
|
|
59
52
|
"type": "object",
|
|
60
53
|
"properties": {
|
|
61
|
-
"location": {
|
|
62
|
-
|
|
54
|
+
"location": {
|
|
55
|
+
"type": "string"
|
|
56
|
+
},
|
|
57
|
+
"proxyPass": {
|
|
58
|
+
"type": "string"
|
|
59
|
+
}
|
|
63
60
|
},
|
|
64
61
|
"required": ["location", "proxyPass"]
|
|
65
62
|
}
|
|
@@ -67,8 +64,12 @@
|
|
|
67
64
|
{
|
|
68
65
|
"type": "object",
|
|
69
66
|
"properties": {
|
|
70
|
-
"location": {
|
|
71
|
-
|
|
67
|
+
"location": {
|
|
68
|
+
"type": "string"
|
|
69
|
+
},
|
|
70
|
+
"proxyPass": {
|
|
71
|
+
"type": "string"
|
|
72
|
+
}
|
|
72
73
|
},
|
|
73
74
|
"required": ["location", "proxyPass"]
|
|
74
75
|
}
|
|
@@ -74,11 +74,17 @@ function default_1(host, options) {
|
|
|
74
74
|
'eslint-plugin-security': '^3.0.0',
|
|
75
75
|
'eslint-plugin-no-secrets': '^2.0.0',
|
|
76
76
|
});
|
|
77
|
-
// Remove Nx scaffold files replaced by our templates.
|
|
78
|
-
//
|
|
79
|
-
//
|
|
77
|
+
// Remove Nx scaffold files replaced by our templates. @nx/vue (Nx 23) scaffolds
|
|
78
|
+
// its demo under src/app/ (App.vue, App.spec.ts, NxWelcome.vue) and emits
|
|
79
|
+
// vite.config.mts; we provide our own App.vue (at src root), views, and a
|
|
80
|
+
// GoA-aware vite.config.ts. Drop the demo + its now-stale test (which fails
|
|
81
|
+
// against our shell) and the duplicate config. Paths from older @nx/vue
|
|
82
|
+
// layouts are kept for safety — host.delete is a no-op when they're absent.
|
|
80
83
|
for (const f of [
|
|
81
84
|
'src/App.vue',
|
|
85
|
+
'src/app/App.vue',
|
|
86
|
+
'src/app/App.spec.ts',
|
|
87
|
+
'src/app/NxWelcome.vue',
|
|
82
88
|
'src/components/HelloWorld.vue',
|
|
83
89
|
'src/views/AboutView.vue',
|
|
84
90
|
'vite.config.mts',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vue-app.js","sourceRoot":"","sources":["../../../../../../packages/nx-adsp/src/generators/vue-app/vue-app.ts"],"names":[],"mappings":";;AAgEA,
|
|
1
|
+
{"version":3,"file":"vue-app.js","sourceRoot":"","sources":["../../../../../../packages/nx-adsp/src/generators/vue-app/vue-app.ts"],"names":[],"mappings":";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E,QAAQ;oBAC/B,iCAAiC,EAAE,aAAa;iBACjD;aACF,EACD,IAAI,EACJ,iBAAiB,CAAC,WAAW,CAC9B,CAAC,CAAC;QACL,CAAC;QAED,MAAM,IAAA,2BAAmB,EAAC,IAAI,kCACzB,iBAAiB,KACpB,OAAO,EAAE,UAAU,EACnB,OAAO,EAAE,iBAAiB,CAAC,WAAW,IACtC,CAAC;QAEH,OAAO,GAAG,EAAE;YACV,IAAA,4BAAmB,EAAC,IAAI,CAAC,CAAC;QAC5B,CAAC,CAAC;IACJ,CAAC;CAAA"}
|
|
@@ -83,6 +83,27 @@ describe('Vue App Generator', () => {
|
|
|
83
83
|
expect(viteConfig).toContain("isCustomElement: (tag) => tag.startsWith('goa-')");
|
|
84
84
|
}, 30000);
|
|
85
85
|
|
|
86
|
+
it('shows the Sign in button without gating on Keycloak readiness', async () => {
|
|
87
|
+
await generator(host, options);
|
|
88
|
+
const app = host.read('apps/test/src/App.vue').toString();
|
|
89
|
+
expect(app).toContain('Sign in');
|
|
90
|
+
// The reported bug: gating Sign in on `ready` hides it when check-sso never
|
|
91
|
+
// resolves. It must gate on !authenticated only (like the react/angular apps).
|
|
92
|
+
expect(app).not.toContain('!authenticated && ready');
|
|
93
|
+
// Header actions grouped for layout, matching react/angular.
|
|
94
|
+
expect(app).toContain('goa-button-group');
|
|
95
|
+
}, 30000);
|
|
96
|
+
|
|
97
|
+
it('removes the @nx/vue demo scaffold and ships a passing App test', async () => {
|
|
98
|
+
await generator(host, options);
|
|
99
|
+
// The stale nx demo + its failing test must be gone (they fail against our shell).
|
|
100
|
+
expect(host.exists('apps/test/src/app/App.vue')).toBeFalsy();
|
|
101
|
+
expect(host.exists('apps/test/src/app/App.spec.ts')).toBeFalsy();
|
|
102
|
+
expect(host.exists('apps/test/src/app/NxWelcome.vue')).toBeFalsy();
|
|
103
|
+
// Replaced by our own App test.
|
|
104
|
+
expect(host.exists('apps/test/src/App.spec.ts')).toBeTruthy();
|
|
105
|
+
}, 30000);
|
|
106
|
+
|
|
86
107
|
it('environment.ts is pre-populated with tenant config', async () => {
|
|
87
108
|
await generator(host, options);
|
|
88
109
|
const env = host.read('apps/test/src/environments/environment.ts').toString();
|