very-express 0.9.0-alpha → 0.9.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.
Files changed (31) hide show
  1. package/AGENTS.md +24 -10
  2. package/dist/index.js +747 -969
  3. package/dist/templates/_middlewares/Authentication.ts +0 -3
  4. package/dist/templates/_middlewares/UserContext.ts +1 -18
  5. package/dist/templates/_projectSettings/env +13 -12
  6. package/dist/templates/_projectSettings/package.json +2 -2
  7. package/dist/templates/_routes/FirebaseAuthUI.gen.ts +20 -0
  8. package/dist/templates/_routes/LoginUI.ts +293 -242
  9. package/dist/templates/_services/TypeOrmRepositoryAdapter.ts +0 -6
  10. package/dist/templates/_services/VexDbConnector.ts +1 -26
  11. package/dist/templates/_services/auth/JWTService.ts +0 -15
  12. package/dist/templates/_types/auth.ts +12 -8
  13. package/dist/templates/_utils/hash.ts +0 -16
  14. package/dist/templates/root/public/js/deleteaccount.js +0 -54
  15. package/docs/appGenerated/auth.md +84 -0
  16. package/docs/architecture/authAndRouting.md +1 -1
  17. package/docs/architecture/databaseTargets.md +4 -2
  18. package/docs/features/accountDeletion.md +2 -3
  19. package/docs/features/auditFields.md +2 -2
  20. package/docs/releaseNote/v0-8-5.md +98 -0
  21. package/docs/releaseNote/v0-9-0.md +41 -47
  22. package/docs/superpowers/specs/2026-09-22-usercontext-audit-enforcement-design.md +9 -9
  23. package/docs/vexJsonSchema.md +17 -0
  24. package/package.json +1 -1
  25. package/vex.config.json +1 -6
  26. package/dist/templates/_routes/ExternalIdentityUI.gen.ts +0 -20
  27. package/dist/templates/root/public/js/externallogin.js +0 -133
  28. package/docs/features/auth.md +0 -34
  29. package/docs/features/externalIdentity.md +0 -163
  30. /package/docs/{ForeignKey.md → features/ForeignKey.md} +0 -0
  31. /package/docs/{apiUsage.md → features/apiUsage.md} +0 -0
package/AGENTS.md CHANGED
@@ -67,6 +67,16 @@ Read from `vex.config.json → jsonSchemaDir` (this repo: `./output/jsonSchema`)
67
67
  - **Auth is the only identity gate.** `UserContext` is established by `Authentication.middleware` from the verified token — there is no separate context middleware, and no generated decorator decides it. Never gate identity on `dataIsolation`: audit fields and ownership filtering are independent features. Use `utils.generator.isAuthEnabled()` when a code path depends on auth being on.
68
68
  - **A create that declares `onCreateUserId` with no identity in `UserContext` throws.** Both repository adapters enforce it; `onUpdateUserId` is deliberately not enforced. `dataIsolation` no longer has anything to do with whether the context exists.
69
69
  - **Boolean config defaults use `??`, not `||`.** `x || true` swallows an explicit `false`.
70
+ - **Never write to git.** No `git add`, `commit`, `push`, `reset`, `checkout`, `stash`, `rm`, `mv`. The
71
+ working tree is the deliverable and the user reads it with git; changes stay unstaged and
72
+ uncommitted. Reading (`status`, `diff`, `log`, `show`, `grep`) is fine.
73
+ - **Read-only mode means troubleshoot.** When the file policy is read-only, diagnose and report. Do not
74
+ attempt the edit, and do not request a wider mode — the user grants it when they want the change.
75
+ - **Only write js-doc/comment when need.** only leave js-doc/comment when things is complex and name does not tell what it does, only write short and clean comment. A comment earns its place only for what the code cannot say: a non-obvious rule, a workaround, a failure mode. If a comment would have to be edited together with the line below it, delete the comment. no history, no restating the signature.
76
+ - **Bump the version with `npm version`, never by hand.** `npm version <patch|minor|major>` runs the
77
+ `preversion` / `postversion` hooks; editing `version` in `package.json` / `package-lock.json`
78
+ yourself skips them. The `postversion` hook runs the build and pushes, so a bump is a publish
79
+ action — do it only when the user asks.
70
80
 
71
81
  ## Conventions
72
82
 
@@ -78,13 +88,6 @@ Read from `vex.config.json → jsonSchemaDir` (this repo: `./output/jsonSchema`)
78
88
  | Template function | camelCase default export beside its generator | `controllerTemplate()` |
79
89
  | Role class | `Role{Name}` | `RoleAdmin` |
80
90
 
81
- ## Release notes
82
-
83
- `docs/releaseNote/vX-Y-Z.md` is a **TL;DR index, not a document**: bullets, one screen, and only what a
84
- reader needs to *use* the change. Detail belongs in `docs/features/` — link it, do not inline it. If a
85
- release note has grown subsections, caveat blocks and rationale, that content is in the wrong file.
86
- Cover: what broke, what is new, how to turn it on, and the ordered upgrade steps.
87
-
88
91
  ## Code style
89
92
 
90
93
  - Prefer readability and maintainability.
@@ -101,6 +104,18 @@ Smart caveman. Drop articles, filler, pleasantries, hedging. Fragments fine. Kee
101
104
  - Code blocks unchanged. Caveman around code, not in code.
102
105
  - Error messages quoted exact.
103
106
 
107
+ ## Writing docs
108
+
109
+ A document describes **what is true now**, for a reader who has only this repo. Write the thing, not
110
+ the argument for it.
111
+
112
+ - **State current state, not what it avoids.** purpose docs is to tell behaviour, not history.
113
+ - **Present tense, current code.** No "will", "we decided", "earlier drafts", "on purpose", "deliberately", "was rejected". What the code does is visible in the code; what changed belongs in `docs/releaseNote/`.
114
+ - **Cut the comparison.** "unlike X", "instead of Y", "no longer Z" — describe what the code does, not the road not taken.
115
+ - **No private context.** No other repositories, projects or issue ids. A reader cannot open them, so naming one is noise. Anything learned out there is restated as a fact checkable from here.
116
+
117
+ Only `docs/plan/` (design records) and `docs/releaseNote/` (what changed, and how to migrate) narrate time. Every other document is present tense.
118
+
104
119
  ## Documentation map
105
120
 
106
121
  This file covers only what every session needs. Deeper material lives in `docs/`:
@@ -113,12 +128,11 @@ This file covers only what every session needs. Deeper material lives in `docs/`
113
128
  | [`docs/architecture/databaseTargets.md`](docs/architecture/databaseTargets.md) | mongo vs sql, repository adapter, data isolation, join whitelist |
114
129
  | [`docs/architecture/authAndRouting.md`](docs/architecture/authAndRouting.md) | tsoa, auth routes, swagger, RBAC |
115
130
  | [`docs/vexJsonSchema.md`](docs/vexJsonSchema.md) | Full JSON Schema reference — `x-documentConfig`, `x-foreignKey`, `x-format`, `x-vexData` |
116
- | [`docs/apiUsage.md`](docs/apiUsage.md) | API client guide — pagination, search, response format |
117
- | [`docs/ForeignKey.md`](docs/ForeignKey.md) | FK joins via the API `join` parameter |
118
131
  | [`docs/developmentNote.md`](docs/developmentNote.md) | Why no ts-node, esbuild/dist working dir, `FUNC{{ }}` intent |
119
132
  | [`docs/CONTRIBUTING.md`](docs/CONTRIBUTING.md) | Setup, branch/PR workflow, PR checklist |
120
- | [`docs/features/`](docs/features/) | rbac, dataIsolation, filterOperators, joinWhitelist, auditFields, accountDeletion, externalIdentity |
133
+ | [`docs/features/`](docs/features/) | foreignKey, apiUsage, rbac, dataIsolation, filterOperators, joinWhitelist, auditFields, accountDeletion |
121
134
  | [`docs/appGenerated/auth.md`](docs/appGenerated/auth.md) | JWT rolling keys, OAuth2 providers |
135
+ | [`docs/plan/`](docs/plan/) | Design records and implementation plans — the one place that narrates decisions and rejected alternatives |
122
136
  | [`docs/roadMap/`](docs/roadMap/) | Released features and version milestones |
123
137
  | [`docs/releaseNote/`](docs/releaseNote/) | Per-version release notes |
124
138