@zukhruf/nx 0.8.38 → 0.8.40
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 +54 -32
- package/dist/generators/auth/files.d.ts +2 -2
- package/dist/generators/auth/files.d.ts.map +1 -1
- package/dist/generators/auth/files.js +21 -20
- package/dist/generators/auth/files.js.map +1 -1
- package/dist/generators/auth/generator.d.ts.map +1 -1
- package/dist/generators/auth/generator.js +13 -17
- package/dist/generators/auth/generator.js.map +1 -1
- package/dist/generators/dokploy/files.d.ts.map +1 -1
- package/dist/generators/dokploy/files.js +16 -1
- package/dist/generators/dokploy/files.js.map +1 -1
- package/dist/generators/env-file.d.ts +8 -0
- package/dist/generators/env-file.d.ts.map +1 -0
- package/dist/generators/env-file.js +13 -0
- package/dist/generators/env-file.js.map +1 -0
- package/dist/generators/init/files.js +2 -2
- package/dist/generators/init/nx-json.d.ts +7 -0
- package/dist/generators/init/nx-json.d.ts.map +1 -1
- package/dist/generators/init/nx-json.js +19 -1
- package/dist/generators/init/nx-json.js.map +1 -1
- package/dist/generators/node-app/files.d.ts +3 -3
- package/dist/generators/node-app/files.d.ts.map +1 -1
- package/dist/generators/node-app/files.js +48 -35
- package/dist/generators/node-app/files.js.map +1 -1
- package/dist/generators/node-app/generator.js +7 -23
- package/dist/generators/node-app/generator.js.map +1 -1
- package/dist/generators/pair/files.d.ts +11 -2
- package/dist/generators/pair/files.d.ts.map +1 -1
- package/dist/generators/pair/files.js +51 -34
- package/dist/generators/pair/files.js.map +1 -1
- package/dist/generators/pair/generator.d.ts.map +1 -1
- package/dist/generators/pair/generator.js +22 -8
- package/dist/generators/pair/generator.js.map +1 -1
- package/dist/generators/portless-env.d.ts +14 -0
- package/dist/generators/portless-env.d.ts.map +1 -0
- package/dist/generators/portless-env.js +26 -0
- package/dist/generators/portless-env.js.map +1 -0
- package/dist/generators/prisma/files.d.ts.map +1 -1
- package/dist/generators/prisma/files.js +2 -0
- package/dist/generators/prisma/files.js.map +1 -1
- package/dist/generators/prisma/generator.d.ts +35 -1
- package/dist/generators/prisma/generator.d.ts.map +1 -1
- package/dist/generators/prisma/generator.js +57 -36
- package/dist/generators/prisma/generator.js.map +1 -1
- package/dist/generators/react-app/generator.js +10 -20
- package/dist/generators/react-app/generator.js.map +1 -1
- package/dist/generators/ui-package/files.d.ts.map +1 -1
- package/dist/generators/ui-package/files.js +7 -8
- package/dist/generators/ui-package/files.js.map +1 -1
- package/dist/generators/ui-package/generator.d.ts.map +1 -1
- package/dist/generators/ui-package/generator.js +3 -1
- package/dist/generators/ui-package/generator.js.map +1 -1
- package/dist/migrations/update-0-8-40/add-local-postgres.d.ts +14 -0
- package/dist/migrations/update-0-8-40/add-local-postgres.d.ts.map +1 -0
- package/dist/migrations/update-0-8-40/add-local-postgres.js +125 -0
- package/dist/migrations/update-0-8-40/add-local-postgres.js.map +1 -0
- package/dist/migrations/update-0-8-40/add-portless-proxy-env.d.ts +9 -0
- package/dist/migrations/update-0-8-40/add-portless-proxy-env.d.ts.map +1 -0
- package/dist/migrations/update-0-8-40/add-portless-proxy-env.js +21 -0
- package/dist/migrations/update-0-8-40/add-portless-proxy-env.js.map +1 -0
- package/dist/migrations/update-0-8-40/add-prisma-client-inputs.d.ts +11 -0
- package/dist/migrations/update-0-8-40/add-prisma-client-inputs.d.ts.map +1 -0
- package/dist/migrations/update-0-8-40/add-prisma-client-inputs.js +20 -0
- package/dist/migrations/update-0-8-40/add-prisma-client-inputs.js.map +1 -0
- package/dist/migrations/update-0-8-40/node-env-production.d.ts +13 -0
- package/dist/migrations/update-0-8-40/node-env-production.d.ts.map +1 -0
- package/dist/migrations/update-0-8-40/node-env-production.js +189 -0
- package/dist/migrations/update-0-8-40/node-env-production.js.map +1 -0
- package/dist/migrations/workspace.d.ts +31 -0
- package/dist/migrations/workspace.d.ts.map +1 -0
- package/dist/migrations/workspace.js +53 -0
- package/dist/migrations/workspace.js.map +1 -0
- package/migrations.json +24 -0
- package/package.json +51 -3
- package/release.json +30 -0
package/README.md
CHANGED
|
@@ -14,6 +14,7 @@ The words in these documents have one meaning each. See the glossary in [CONTEXT
|
|
|
14
14
|
| portless | `@zukhruf/nx/portless` | Candidate (#3336): 14 projects in 3 repos |
|
|
15
15
|
| opentofu, prisma | `@zukhruf/nx/<area>` | This README (#3339) |
|
|
16
16
|
| generators | `@zukhruf/nx:<name>` | This README: `preset` and `init` (#3337); `node-app`, `react-app`, `pair`, `ui-package` (#3338); `dokploy` (#4603); `prisma` (#4604) |
|
|
17
|
+
| migrations | `nx migrate` | This README (#4818) |
|
|
17
18
|
|
|
18
19
|
The lint rules stay in `@zukhruf/eslint`. The `lint` area gives only the inputs of the `lint` target (#3335).
|
|
19
20
|
|
|
@@ -67,7 +68,8 @@ No generator writes these and no check runs them. Each one cost time once.
|
|
|
67
68
|
- No lint-staged: it put the files of other sessions into commits. Never `--no-verify` without asking.
|
|
68
69
|
- Test fixtures (a Docker database, an HTTP server, a temp folder, msw) come from `@zukhruf/testing`, and `await using` cleans them up.
|
|
69
70
|
- A React component of a library package is tested with `node:test`: the test registers a DOM with `@happy-dom/global-registrator`, then imports `react`, `react-dom/client` and the component from the built package. Node cannot load `.tsx`.
|
|
70
|
-
- `serve` of a backend runs the source
|
|
71
|
+
- `serve` of a backend runs the source with no `UI_ROOT`, so it has no UI route. In development the web app runs on the Vite dev server.
|
|
72
|
+
- NODE_ENV is `production` in every setup, and the generated code never reads it; each behavior that differs between setups has its own setting (`HOST`, `ALLOWED_ORIGINS`, `LOG_DIR`, `LOG_PRETTY`, `UI_ROOT`). The web `dev` and `serve` targets set `development` and its `test` target `test`, and so does the `test` of a ui-package ([ADR 0016](./docs/adr/0016-the-generated-code-reads-explicit-settings-and-never-nodeenv.md)).
|
|
71
73
|
- CI installs each tool that a target runs, for example OpenTofu for the `typecheck` of the infra project. It passed locally only because Homebrew had `tofu`.
|
|
72
74
|
- On a paid GitHub plan, move the deploy secrets into a `production` environment that only `main` can use.
|
|
73
75
|
- The owner does each one-time step: `gh auth refresh -s workflow` (a push of a workflow file needs the scope) and the repository secrets.
|
|
@@ -417,7 +419,7 @@ A `scripts.test` in a `package.json` replaces the inferred target. Nx runs it wi
|
|
|
417
419
|
|
|
418
420
|
| Workspace | Today | Changes |
|
|
419
421
|
| ---------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
420
|
-
| zukhruf | `targetDefaults.test` with filters `tag:test:node` and `tag:test:docker`; `dependsOn` `["build", "^build"]`; `--test-force-exit` for each project | 30 tagged projects; 2 Docker projects (mutex, testing) keep their own global setup; `dependsOn` `["...", "build"]`; `flags
|
|
422
|
+
| zukhruf | `targetDefaults.test` with filters `tag:test:node` and `tag:test:docker`; `dependsOn` `["build", "^build"]`; `--test-force-exit` for each project | 30 tagged projects; 2 Docker projects (mutex, testing) keep their own global setup; `dependsOn` `["...", "build"]`; no `flags`: since 2026-11-19 only the `test:docker` projects force-exit, as each other suite exits by itself (all 43 measured without the flag) |
|
|
421
423
|
| factory | 2 targets: `api` with Docker arguments; `foundation` with its tests in `tests/` | delete `apps/factory/api/src/testing/docker-global-setup.ts`; `dependsOn` `["...", "^sdk"]` |
|
|
422
424
|
| whatisgoingon | 1 target | 1 |
|
|
423
425
|
| deepagents | 11 tagged projects, 3 Docker projects, 4 demo scripts | delete `tools/src/docker-global-setup.ts`; `dependsOn` `["...", "build"]`; module mocks in `flags` or in the `args` of a project; the 4 demo scripts and the Docker context script stay |
|
|
@@ -810,6 +812,24 @@ text2sql also has a target `prisma` that runs the Prisma CLI with the arguments
|
|
|
810
812
|
|
|
811
813
|
The backlog item of the area is #3339.
|
|
812
814
|
|
|
815
|
+
## migrations
|
|
816
|
+
|
|
817
|
+
A change to what a generator writes reaches a repo that ran the generator before through an Nx migration, when someone runs:
|
|
818
|
+
|
|
819
|
+
```sh
|
|
820
|
+
npx nx migrate @zukhruf/nx@latest
|
|
821
|
+
npx nx migrate --run-migrations
|
|
822
|
+
```
|
|
823
|
+
|
|
824
|
+
`nx migrate` moves every published @zukhruf package with `@zukhruf/nx` (`packageGroup`), and nothing runs the migrations otherwise. Each one adds only what is missing, writes what the generators write now, and logs the step to take by hand where a file lost the shape that the generator wrote. [ADR 0017](./docs/adr/0017-nx-migrations-bring-a-change-of-generated-output-to-the-repos-that-ran-the-generator-before.md) has the rules.
|
|
825
|
+
|
|
826
|
+
| Migration | Version | Brings |
|
|
827
|
+
| -------------------------- | ------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
828
|
+
| `add-portless-proxy-env` | 0.8.40 | `PORTLESS_UNPRIVILEGED=1` and `PORTLESS_HTTPS=1` in `targetDefaults.portless` (#4768) |
|
|
829
|
+
| `add-local-postgres` | 0.8.40 | the root `compose.dev.yml`, `up` and `down` of each db package, the local `CONNECTION_STRING`, and `^up` in its backend serve (ADR 0012 decisions 16 and 17) |
|
|
830
|
+
| `node-env-production` | 0.8.40 | the NODE_ENV configuration of ADR 0016 (nx.json defaults, target env, the web exceptions, `.env.example`, the workflow env, `ALLOWED_ORIGINS`), and a log of each NODE_ENV read in source |
|
|
831
|
+
| `add-prisma-client-inputs` | 0.8.40 | `...` and `{ "dependentTasksOutputFiles": "**/*.ts" }` in the `inputs` of `targetDefaults.typecheck` and `.build` of a repo with `@zukhruf/nx/prisma`, so a schema change rebuilds the db package (#4826) |
|
|
832
|
+
|
|
813
833
|
## generators
|
|
814
834
|
|
|
815
835
|
The root files of a workspace are the same in each repo: `package.json`, `nx.json`, the tsconfig files, `.npmrc`, the Git hooks and more (see [monorepo standard](#monorepo-standard)). factory writes them with the `workspace` generator of its private package `@factory/foundation`. Other repos copy them by hand: 3 to 7 copies of each file. meddit is the third repo that starts from the standard, so the generator moves here (#3259).
|
|
@@ -956,12 +976,13 @@ type InitOptions = Record<string, never>;
|
|
|
956
976
|
|
|
957
977
|
The `targetDefaults` that `init` writes:
|
|
958
978
|
|
|
959
|
-
| Target | Default
|
|
960
|
-
| ----------------------------------------- |
|
|
961
|
-
| `typecheck` | `dependsOn: ["lint", "format:check", "..."]`; `"..."` keeps the `^typecheck` of `@nx/js/typescript`
|
|
962
|
-
| `dev`, `serve`, `preview`, `serve-static` | `continuous: false`; Nx reports a continuous task that no task depends on as a success, whatever its exit code
|
|
979
|
+
| Target | Default |
|
|
980
|
+
| ----------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
981
|
+
| `typecheck` | `dependsOn: ["lint", "format:check", "..."]`; `"..."` keeps the `^typecheck` of `@nx/js/typescript` |
|
|
982
|
+
| `dev`, `serve`, `preview`, `serve-static` | `continuous: false`; Nx reports a continuous task that no task depends on as a success, whatever its exit code |
|
|
983
|
+
| `test`, `serve` | `options.env.NODE_ENV: "production"` (ADR 0016); a `NODE_ENV` that is there stays, and a project target with its own `options.env` replaces it |
|
|
963
984
|
|
|
964
|
-
It writes no `format`, `format:check
|
|
985
|
+
It writes no `format`, `format:check` or `lint` default, and no `test` default but the env above. The `format`, `lint` and `test` areas give those targets, and a default with more would replace them (see the sections above). Not `build`: the backend build runs the `@nx/esbuild` executor, whose schema may refuse an `env` option.
|
|
965
986
|
|
|
966
987
|
### What only an app generator writes
|
|
967
988
|
|
|
@@ -1113,14 +1134,14 @@ Each schema sets `additionalProperties: false`. The project name is the package
|
|
|
1113
1134
|
|
|
1114
1135
|
### What each app generator writes
|
|
1115
1136
|
|
|
1116
|
-
| Generator | Files of the project
|
|
1117
|
-
| ------------ |
|
|
1118
|
-
| `node-app` | `src/server.ts` (terminus, the `@nx-target-name: serve` header), `app.ts` (Hono on `/api`), `env.ts` (zod, `BUILD_SHA`), `logging.ts` (evlog), `startup.ts`, `routes/healthz.route.ts`, `app.test.ts`; `.env.example` (always) and `.env` (when missing); `Dockerfile
|
|
1119
|
-
| `react-app` | `index.html`, `src/main.tsx` (React Router 8 in data mode), `src/app/app.tsx` and its test, `src/styles.css` (Tailwind with the sync markers), `vite.config.ts` (the React Compiler, Tailwind, brotli and gzip, the portless and `/api` dev proxy, the `test` block), `tsconfig.app.json` writing to `out-tsc`, `tsconfig.spec.json`, `eslint.config.mjs` with `@zukhruf/eslint/react`, `react-router` and `tailwind`
|
|
1120
|
-
| `pair` | in the web: `src/api.ts` and the client, `zod` and `fast-content-type-parse` in its manifest; in the api: `src/routes/ui.route.ts`, its mount in `app.ts`, and the Dockerfile again with the web build
|
|
1121
|
-
| `ui-package` | `package.json` with the `development` export of `src/index.ts`, `src/package-name.tsx` (a `PackageName` component), `vite.config.ts` (a library with `vite-plugin-dts`), the tsconfigs, `eslint.config.mjs` with `@zukhruf/eslint/react` and `tailwind`, `tests/public-api.test.mjs`, `tests/package-name.test.mjs` (renders `PackageName` in happy-dom under `node:test`; `@happy-dom/global-registrator` and `react-dom` in its `devDependencies`)
|
|
1137
|
+
| Generator | Files of the project | Root and nx.json |
|
|
1138
|
+
| ------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
1139
|
+
| `node-app` | `src/server.ts` (terminus, the `@nx-target-name: serve` header), `app.ts` (Hono on `/api`), `env.ts` (zod: `HOST` required, `BUILD_SHA`, `LOG_DIR`, `LOG_PRETTY`, no `NODE_ENV`), `logging.ts` (evlog: a file drain when `LOG_DIR` is set, pretty output when `LOG_PRETTY` is `true`), `startup.ts`, `routes/healthz.route.ts`, `app.test.ts`; `.env.example` (always: `NODE_ENV=production`, `HOST=127.0.0.1`, `ALLOWED_ORIGINS=`, `LOG_DIR=.evlog/logs/<app>`, `LOG_PRETTY=true`) and `.env` (when missing); `Dockerfile` (`HOST=0.0.0.0`); `sdk-it.config.ts` and the client stub in `.sdk-it/`; the tsconfigs; `eslint.config.mjs` with `hono`, Modern Node and the env settings | `@nx/node`, `@nx/esbuild`, `esbuild`, `@sdk-it/cli`; `.dockerignore` when missing; the client in `workspaces`; the `.sdk-it` lines of `.gitignore` and `.prettierignore`; the `@nx/esbuild:esbuild` default; `^sdk` in `build`, `dev`, `typecheck` and `test` (`["...", "^sdk"]`); the sdk-it exclusion of `production`; `generators["@nx/node"]` |
|
|
1140
|
+
| `react-app` | `index.html`, `src/main.tsx` (React Router 8 in data mode), `src/app/app.tsx` and its test, `src/styles.css` (Tailwind with the sync markers), `vite.config.ts` (the React Compiler, Tailwind, brotli and gzip, the portless and `/api` dev proxy, dev-server `allowedHosts` for `.localhost` and `.trycloudflare.com` (ADR 0010 decision 11), the `test` block), `tsconfig.app.json` writing to `out-tsc`, `tsconfig.spec.json`, `eslint.config.mjs` with `@zukhruf/eslint/react`, `react-router` and `tailwind` | `@nx/react`, `@nx/vite`, `@nx/vitest` with `testMode: "run"`, Vite, Vitest, Testing Library, happy-dom, Tailwind, the 4 React lint plugins; `prettier-plugin-tailwindcss` in `.prettierrc`; the Tailwind sync generator in `sync` and in `build`, `dev`, `serve`; `generators["@nx/react"]`; the `test` default as it was |
|
|
1141
|
+
| `pair` | in the web: `src/api.ts` and the client, `zod` and `fast-content-type-parse` in its manifest; in the api: `src/routes/ui.route.ts`, its mount in `app.ts` when `UI_ROOT` is set (the process exits at startup when `<UI_ROOT>/index.html` is missing), `UI_ROOT` (optional) in `env.ts`, and the Dockerfile again with the web build and `UI_ROOT=/app/<web>/dist` | — |
|
|
1142
|
+
| `ui-package` | `package.json` with the `development` export of `src/index.ts`, `src/package-name.tsx` (a `PackageName` component), `vite.config.ts` (a library with `vite-plugin-dts`), the tsconfigs, `eslint.config.mjs` with `@zukhruf/eslint/react` and `tailwind`, `tests/public-api.test.mjs`, `tests/package-name.test.mjs` (renders `PackageName` in happy-dom under `node:test`; `@happy-dom/global-registrator` and `react-dom` in its `devDependencies`) | the React root packages; `fsevents: false` in `allowScripts` |
|
|
1122
1143
|
|
|
1123
|
-
The targets of a project are in the `nx` key of its `package.json`: the generators pass `useProjectJson: false` and `addPlugin: true` to Nx, so Nx 23 and 24 write the same shape. `format`, `lint`, `test` (node) and `typecheck` come from the inference plugins; `node-app` writes `build` (one ESM esbuild bundle, each npm package external, with a `require` banner), `serve` (with `NODE_ENV=
|
|
1144
|
+
The targets of a project are in the `nx` key of its `package.json`: the generators pass `useProjectJson: false` and `addPlugin: true` to Nx, so Nx 23 and 24 write the same shape. `format`, `lint`, `test` (node) and `typecheck` come from the inference plugins; `node-app` writes `build` (one ESM esbuild bundle, each npm package external, with a `require` banner), `serve` (with `NODE_ENV=production`), `portless` (`<app>.<scope>`), `docker:build` and `docker:run`, and keeps `prune-lockfile` of `@nx/node`. `react-app` writes `portless`, `dev` and `serve` with `NODE_ENV=development` (Vite turns React Fast Refresh off under production), and the `test` target of the project (`^sdk`, `NODE_ENV=test`, because production React has no `act()`).
|
|
1124
1145
|
|
|
1125
1146
|
Both app generators add `PORTLESS_UNPRIVILEGED=1` and `PORTLESS_HTTPS=1` to `targetDefaults.portless.options.env` in `nx.json`, and keep any key that is already there. One portless proxy serves every app on the machine, and the first target to start it sets its mode. Unprivileged mode needs no sudo, so an agent with no TTY can start the proxy; without it, the start exits 1 with `Proxy is not running and no TTY is available for sudo`. HTTPS is set explicitly because portless 0.18 keeps the unprivileged mode when the proxy stops but resets its TLS, and an unprivileged proxy restarts on plain HTTP. That breaks the generated wiring, which expects `https://<name>.localhost`: the HMR client in `vite.config.ts` dials `wss` on port 443, and a plain-HTTP proxy does not serve 443. The generators set no `PORTLESS_TLD`: `localhost` is the default, and a set TLD replaces the TLDs that another repo's proxy saved. A repo that needs a real dev domain sets the TLD itself. A target with its own `options.env` drops this default unless that env starts with `"...": true`.
|
|
1126
1147
|
|
|
@@ -1157,7 +1178,7 @@ The brand: the fonts, colors and favicons of `index.html`. The generated `index.
|
|
|
1157
1178
|
|
|
1158
1179
|
### Tests of the app generators
|
|
1159
1180
|
|
|
1160
|
-
The tests run each generator on a virtual `Tree` with Nx 23.2.1, which zukhruf's root installs (`src/generators/*/generator.test.ts`, helpers in `src/testing/generator-tree.ts`). They port factory's `node-app`, `react-app`, `pair` and `ui-package` tests, and add the build sha, `testMode: "run"`, `test.dependsOn` after `node-app` and `react-app`, a backend-only workspace with no React, Vite, Vitest or Tailwind package, the workspace scope in the portless domain, and no brand in the web files. They drop factory's `modern-node.test.ts` and `root-vite.test.ts`, which write to disk and read zukhruf's installed versions; the smoke test below runs lint and a strict `npm install` instead. What Nx 24.0.6 writes itself is proven by the smoke test.
|
|
1181
|
+
The tests run each generator on a virtual `Tree` with Nx 23.2.1, which zukhruf's root installs (`src/generators/*/generator.test.ts`, helpers in `src/testing/generator-tree.ts`). They port factory's `node-app`, `react-app`, `pair` and `ui-package` tests, and add the build sha, `testMode: "run"`, `test.dependsOn` after `node-app` and `react-app`, a backend-only workspace with no React, Vite, Vitest or Tailwind package, the workspace scope in the portless domain, and no brand in the web files. They drop factory's `modern-node.test.ts` and `root-vite.test.ts`, which write to disk and read zukhruf's installed versions; the smoke test below runs lint and a strict `npm install` instead. What Nx 24.0.6 writes itself is proven by the smoke test. Each app generator's test also lints the package.json and project.json files it writes with the manifest rules of @zukhruf/eslint (`src/testing/lint-manifests.ts`), except the rules that read files beyond the manifest, its workspace root or the project graph: `manifest/dependency-checks`, `manifest/no-root-script`, `manifest/nx-family-pinned`, `zukhruf/no-generate-package-json`, `zukhruf/no-duplicate-nx-key`, `zukhruf/no-missing-asset-input` and `zukhruf/no-missing-dependency-build`.
|
|
1161
1182
|
|
|
1162
1183
|
### Test the app generators before a release
|
|
1163
1184
|
|
|
@@ -1208,7 +1229,7 @@ The schema sets `additionalProperties: false`. The package name is `@<scope>/<la
|
|
|
1208
1229
|
| `tsconfig.lib.json` | the build: JavaScript and declarations into `dist`, with `rewriteRelativeImportExtensions`, because the generated client imports `.ts` files |
|
|
1209
1230
|
| `tsconfig.json`, `tsconfig.test.json` | the solution file and the tests, as in node-app |
|
|
1210
1231
|
| `eslint.config.mjs` | ignores `src/prisma`; Modern Node; `allowDefaultProject` for `prisma.config.ts` |
|
|
1211
|
-
| `.env.example`, `.env` | `CONNECTION_STRING=postgresql://postgres:postgres@127.0.0.1:<port>/<scope>`, the local Postgres, and `SHADOW_CONNECTION_STRING=`; `.env` only when missing
|
|
1232
|
+
| `.env.example`, `.env` | `NODE_ENV=production`, `CONNECTION_STRING=postgresql://postgres:postgres@127.0.0.1:<port>/<scope>`, the local Postgres, and `SHADOW_CONNECTION_STRING=`; `.env` only when missing |
|
|
1212
1233
|
| `package.json` `nx.targets` | `up`: `docker compose --file <root>/compose.dev.yml up --detach --wait database`, then `prisma migrate deploy`, with `CONNECTION_STRING` pinned to the local URL; `down`: `docker compose … down`, which keeps the volume |
|
|
1213
1234
|
| `Dockerfile.migration` | `npm ci --workspace=<package>` installs the CLI from the lockfile, and `CMD npx prisma migrate deploy` applies the migrations to the `CONNECTION_STRING` of the container |
|
|
1214
1235
|
|
|
@@ -1265,7 +1286,7 @@ npx nx g @zukhruf/nx:auth --backend apps/backend --db packages/db --web apps/web
|
|
|
1265
1286
|
|
|
1266
1287
|
Pair the web with the backend first. `apps/web/src/auth-client.ts` then exports `authClient`, which calls `/api/auth` on the page origin: the Vite proxy in development, the backend in production. The backend trusts the two origins that the browser sends in development: `http://localhost:5173` (`nx run @acme/web:dev`) and `https://web.acme.localhost` (`nx run @acme/web:portless`). If your portless proxy uses another TLD or a prefix, add that origin to `ALLOWED_ORIGINS` in `apps/backend/.env`; better-auth answers any other origin with 403 `INVALID_ORIGIN`.
|
|
1267
1288
|
|
|
1268
|
-
In
|
|
1289
|
+
In every setup, better-auth builds its links (email verification, password reset) on the host of the page that asked for them when that host is in `ALLOWED_ORIGINS`, so a link opened from the Vite dev server, from portless or from the deployed app signs in that same page. A request from any other host gets `BETTER_AUTH_URL`. better-auth refuses an empty `allowedHosts`, so `ALLOWED_ORIGINS` names at least one origin; the dokploy generator sets the public origin.
|
|
1269
1290
|
|
|
1270
1291
|
### Require a session
|
|
1271
1292
|
|
|
@@ -1314,12 +1335,12 @@ interface AuthOptions {
|
|
|
1314
1335
|
|
|
1315
1336
|
| File | Content |
|
|
1316
1337
|
| ------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
1317
|
-
| `<backend>/src/auth.ts` | `createAuth({ prisma, secret, baseURL, trustedOrigins })`: better-auth on `prismaAdapter` with `emailAndPassword`; `baseURL` is
|
|
1338
|
+
| `<backend>/src/auth.ts` | `createAuth({ prisma, secret, baseURL, trustedOrigins })`: better-auth on `prismaAdapter` with `emailAndPassword`; `baseURL` is `{ fallback, allowedHosts }`; it reads no environment; only when missing |
|
|
1318
1339
|
| `<backend>/src/session.ts` | `export const signedIn = requireSession(sessions)` from `@zukhruf/authentication/hono`; `sessions` loads `startup.ts` on the first request and has the type of the app's session; only when missing |
|
|
1319
1340
|
| `<backend>/src/auth.cli.ts` | `export const auth` for the better-auth CLI, on `createPrisma` with no connection and placeholder secret and URL; it imports no `env.ts` and no `startup.ts`; only when missing |
|
|
1320
1341
|
| `<backend>/src/routes/auth.route.ts` | `GET` and `POST` `/api/auth/*` to `auth.handler`; the handler loads `startup.ts` on the first request, so `app.test.ts` needs no database; only when missing |
|
|
1321
1342
|
| `<backend>/src/app.ts` | the mount of the auth route, before the UI mount of pair and before `notFound` |
|
|
1322
|
-
| `<backend>/src/startup.ts` | `export const auth = createAuth(...)` on the app's client, `BETTER_AUTH_SECRET`, `BETTER_AUTH_URL` and `ALLOWED_ORIGINS`; in
|
|
1343
|
+
| `<backend>/src/startup.ts` | `export const auth = createAuth(...)` on the app's client, `BETTER_AUTH_SECRET`, `BETTER_AUTH_URL` and `ALLOWED_ORIGINS`; in every setup, `baseURL` is the host of an allowed origin, else `BETTER_AUTH_URL` |
|
|
1323
1344
|
| `<backend>/src/env.ts` | `BETTER_AUTH_SECRET: z.string().min(32)` and `BETTER_AUTH_URL: z.url()` |
|
|
1324
1345
|
| `<backend>/.env.example`, `.env` | `BETTER_AUTH_SECRET=` and `BETTER_AUTH_URL=http://localhost:<PORT>`; `.env` gets a random 43-character secret; a key that is there keeps its value |
|
|
1325
1346
|
| `<backend>/package.json` | `better-auth` and `@zukhruf/authentication` in `dependencies`; the `auth:generate` and `auth:check` targets |
|
|
@@ -1335,7 +1356,7 @@ At the root: the CLI `auth` in `devDependencies`. The generator writes no migrat
|
|
|
1335
1356
|
|
|
1336
1357
|
### What the auth targets run
|
|
1337
1358
|
|
|
1338
|
-
Both run in the backend root with `NODE_OPTIONS=--conditions=development`, so jiti loads the source of the db package, and with `NODE_ENV=
|
|
1359
|
+
Both run in the backend root with `NODE_OPTIONS=--conditions=development`, so jiti loads the source of the db package, and with `NODE_ENV=production`, as every target: `auth.cli.ts` passes a throwaway secret of 32 or more characters, so better-auth never meets its default secret, which it refuses under production. Both depend on `^generate`, because that source imports the generated client.
|
|
1339
1360
|
|
|
1340
1361
|
- `auth:generate`: `npx auth generate --adapter prisma --config src/auth.cli.ts --output <db>/models/auth.prisma --yes`, then `nx run <db>:generate`. Run it after you add a plugin to `createAuth`.
|
|
1341
1362
|
- `auth:check`: `npx auth check schema --config src/auth.cli.ts`. It only reads. It exits 1 when the generated client misses a table or column of the plugins, and 2 when it cannot load the config.
|
|
@@ -1382,7 +1403,8 @@ module "stack" {
|
|
|
1382
1403
|
registry = { username = "octocat", password = var.ghcr_pull_token }
|
|
1383
1404
|
|
|
1384
1405
|
env = {
|
|
1385
|
-
PUBLIC_HOST
|
|
1406
|
+
PUBLIC_HOST = local.host
|
|
1407
|
+
ALLOWED_ORIGINS = "https://${local.host}"
|
|
1386
1408
|
# Generators add env keys above this line.
|
|
1387
1409
|
}
|
|
1388
1410
|
}
|
|
@@ -1425,17 +1447,17 @@ interface DokployOptions {
|
|
|
1425
1447
|
|
|
1426
1448
|
### What the dokploy generator writes
|
|
1427
1449
|
|
|
1428
|
-
| File | What it holds
|
|
1429
|
-
| ---------------------------------------- |
|
|
1430
|
-
| `infra/project.json` | `@<scope>/infra`; `@zukhruf/nx/opentofu` gives its targets, and the generator lists that plugin after `@zukhruf/nx/format` in `nx.json`
|
|
1431
|
-
| `infra/compose.dokploy.yml` | the app image with `env_file: .env` on `dokploy-network` with the Traefik labels (`web` redirects, `websecure` with Let's Encrypt); with `database`, `postgres:18-alpine` and the one-shot `migrate`, which the app waits for
|
|
1432
|
-
| `infra/.env.example`, `infra/.gitignore` | the secrets of a local run, `TF_VAR_dokploy_api_key=${DOKPLOY_API_KEY}` (and `TF_VAR_ghcr_pull_token`); the plaintext backups, `.terraform/` and `tfplan`
|
|
1433
|
-
| `src/environments/production/*.tf` | `versions`, `backend` (local, the encrypted state committed), `encryption` (pbkdf2 and aes_gcm, enforced), `providers`, `dns`, `main` (the module call; `registry` is its input), `outputs` (`dokploy_api`, `compose_id`, `host`), `variables`
|
|
1434
|
-
| `.terraform.lock.hcl` | the providers for `linux_amd64` and `darwin_arm64`, `hashicorp/random` always, because the module requires it, so `typecheck` (`-lockfile=readonly`) passes on CI and a Mac
|
|
1435
|
-
| `.prettierignore`, `.nxignore` | lines added when missing: `.terraform`, `tfplan` and the state for Prettier; the state for Nx, so the state commit of an apply makes no project affected
|
|
1436
|
-
| `.github/workflows/deploy.yml` | gate (`tested-commit`, `affected-range` since the last deploy, `affected-projects`), image (`ghcr-image`, a matrix: the app and `migrate`), promote to `:latest` (`ghcr-promote`), infra (`tofu-apply.yml`), release (`dokploy-deploy`, `wait-for-health`) |
|
|
1437
|
-
| `.github/workflows/ci.yml` | setup-workspace, OpenTofu in the background, `affected-range`, then `nx affected -t lint typecheck test build` beside `sync:check`, `prettier --check` and zizmor |
|
|
1438
|
-
| `.github/zizmor.yml` | tags and `@main` allowed (`ref-pin`), and the `workflow_run` of `deploy.yml`
|
|
1450
|
+
| File | What it holds |
|
|
1451
|
+
| ---------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
1452
|
+
| `infra/project.json` | `@<scope>/infra`; `@zukhruf/nx/opentofu` gives its targets, and the generator lists that plugin after `@zukhruf/nx/format` in `nx.json` |
|
|
1453
|
+
| `infra/compose.dokploy.yml` | the app image with `env_file: .env` on `dokploy-network` with the Traefik labels (`web` redirects, `websecure` with Let's Encrypt); with `database`, `postgres:18-alpine` and the one-shot `migrate`, which the app waits for |
|
|
1454
|
+
| `infra/.env.example`, `infra/.gitignore` | `NODE_ENV=production`, the secrets of a local run, `TF_VAR_dokploy_api_key=${DOKPLOY_API_KEY}` (and `TF_VAR_ghcr_pull_token`); the plaintext backups, `.terraform/` and `tfplan` |
|
|
1455
|
+
| `src/environments/production/*.tf` | `versions`, `backend` (local, the encrypted state committed), `encryption` (pbkdf2 and aes_gcm, enforced), `providers`, `dns`, `main` (the module call; `registry` is its input), `outputs` (`dokploy_api`, `compose_id`, `host`), `variables` |
|
|
1456
|
+
| `.terraform.lock.hcl` | the providers for `linux_amd64` and `darwin_arm64`, `hashicorp/random` always, because the module requires it, so `typecheck` (`-lockfile=readonly`) passes on CI and a Mac |
|
|
1457
|
+
| `.prettierignore`, `.nxignore` | lines added when missing: `.terraform`, `tfplan` and the state for Prettier; the state for Nx, so the state commit of an apply makes no project affected |
|
|
1458
|
+
| `.github/workflows/deploy.yml` | `env: NODE_ENV: production` at workflow level; gate (`tested-commit`, `affected-range` since the last deploy, `affected-projects`), image (`ghcr-image`, a matrix: the app and `migrate`), promote to `:latest` (`ghcr-promote`), infra (`tofu-apply.yml`), release (`dokploy-deploy`, `wait-for-health`) |
|
|
1459
|
+
| `.github/workflows/ci.yml` | `env: NODE_ENV: production` at workflow level; setup-workspace, OpenTofu in the background, `affected-range`, then `nx affected -t lint typecheck test build` beside `sync:check`, `prettier --check` and zizmor |
|
|
1460
|
+
| `.github/zizmor.yml` | tags and `@main` allowed (`ref-pin`), and the `workflow_run` of `deploy.yml` |
|
|
1439
1461
|
|
|
1440
1462
|
The compose reads `PUBLIC_HOST` in its labels, Postgres reads `POSTGRES_PASSWORD` and `migrate` reads `CONNECTION_STRING`, from the env that the module stores with it; a plan refuses a `${NAME}` that the env does not have. Postgres 18 keeps its data under `/var/lib/postgresql/18/docker`, so the volume is mounted at `/var/lib/postgresql`. Each variable refuses an empty value, because CI renders an unset secret as `""`. The stack has no `terraform_data` deployment: the release job deploys after a new image, after an apply that changed the stack, and while the infra project is affected since the last successful deploy, and it checks the build sha only after a new image. `.prettierignore` gets `.terraform`, `tfplan` and the state.
|
|
1441
1463
|
|
|
@@ -8,7 +8,7 @@ export declare const authMount = "(await import('./routes/auth.route.ts')).defau
|
|
|
8
8
|
/** The lines of env.ts that declare the environment of better-auth. */
|
|
9
9
|
export declare const authEnvTs = " // better-auth signs the session cookies with the secret, and builds its\n // links on the URL of this server.\n BETTER_AUTH_SECRET: z.string().min(32),\n BETTER_AUTH_URL: z.url(),\n";
|
|
10
10
|
/** The lines that startup.ts gets: the auth, on the app's client and validated environment. */
|
|
11
|
-
export declare const startupAuthTs = "\n// The auth of the app, on the client above. src/routes/auth.route.ts serves it.\nconst allowedOrigins = process.env.ALLOWED_ORIGINS.split(',')\n .map((origin) => origin.trim())\n .filter((origin) => origin !== '');\nexport const auth = createAuth({\n prisma,\n secret: process.env.BETTER_AUTH_SECRET,\n //
|
|
11
|
+
export declare const startupAuthTs = "\n// The auth of the app, on the client above. src/routes/auth.route.ts serves it.\nconst allowedOrigins = process.env.ALLOWED_ORIGINS.split(',')\n .map((origin) => origin.trim())\n .filter((origin) => origin !== '');\nexport const auth = createAuth({\n prisma,\n secret: process.env.BETTER_AUTH_SECRET,\n // A link of better-auth (email verification, password reset) opens on the\n // host of the page that asked for it, when that is the host of an allowed\n // origin, in every setup: the Vite dev server and portless proxy /api to\n // this server, and in production the backend serves the page, so the\n // cookie that the link sets reaches the page. Any other host gets\n // BETTER_AUTH_URL. better-auth refuses an empty allowedHosts, so\n // ALLOWED_ORIGINS names at least one origin.\n baseURL: {\n fallback: process.env.BETTER_AUTH_URL,\n allowedHosts: allowedOrigins.map((origin) => new URL(origin).host),\n },\n trustedOrigins: allowedOrigins,\n});\n";
|
|
12
12
|
/**
|
|
13
13
|
* The placeholder of the models of better-auth. The CLI writes its own
|
|
14
14
|
* generator and datasource blocks into a missing file, and prisma generate
|
|
@@ -35,7 +35,7 @@ export declare const backendSessionTs = "import { requireSession } from '@zukhru
|
|
|
35
35
|
*/
|
|
36
36
|
export declare const webSessionTs = "import {\n type RequireSessionOptions,\n requireSession,\n} from '@zukhruf/authentication/react-router';\nimport type { LoaderFunctionArgs } from 'react-router';\n\nimport { authClient } from './auth-client.ts';\n\n/**\n * The loader of a page behind sign-in. A visitor without a session goes to\n * `signIn`, with the page as the return path. The loader data is the session.\n */\nexport function signedInLoader(\n options: RequireSessionOptions<typeof authClient.$Infer.Session>,\n) {\n return ({ request }: LoaderFunctionArgs) =>\n requireSession(authClient, request, options);\n}\n";
|
|
37
37
|
/** The comment that auth puts above ALLOWED_ORIGINS when it adds the origins of the web app. */
|
|
38
|
-
export declare const allowedOriginsComment = "# better-auth
|
|
38
|
+
export declare const allowedOriginsComment = "# CORS and better-auth trust these origins in every setup, and better-auth\n# builds its links on their hosts. Here they are the origins of the web app:\n# the Vite dev server and portless.\n";
|
|
39
39
|
/**
|
|
40
40
|
* The lines that the env map of module "stack" in the main.tf of the dokploy
|
|
41
41
|
* generator gets above its marker. The comment line keeps tofu fmt from
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"files.d.ts","sourceRoot":"","sources":["../../../src/generators/auth/files.ts"],"names":[],"mappings":"AAGA,qHAAqH;AACrH,wBAAgB,MAAM,CAAC,aAAa,EAAE,MAAM,GAAG,MAAM,CAsCpD;AAED,oEAAoE;AACpE,wBAAgB,SAAS,CAAC,aAAa,EAAE,MAAM,GAAG,MAAM,
|
|
1
|
+
{"version":3,"file":"files.d.ts","sourceRoot":"","sources":["../../../src/generators/auth/files.ts"],"names":[],"mappings":"AAGA,qHAAqH;AACrH,wBAAgB,MAAM,CAAC,aAAa,EAAE,MAAM,GAAG,MAAM,CAsCpD;AAED,oEAAoE;AACpE,wBAAgB,SAAS,CAAC,aAAa,EAAE,MAAM,GAAG,MAAM,CAqBvD;AAED,eAAO,MAAM,WAAW,meAYvB,CAAC;AAEF,sDAAsD;AACtD,eAAO,MAAM,SAAS,2DAA2D,CAAC;AAElF,uEAAuE;AACvE,eAAO,MAAM,SAAS,gMAIrB,CAAC;AAEF,+FAA+F;AAC/F,eAAO,MAAM,aAAa,y9BAqBzB,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,UAAU,yFACtB,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,YAAY,uTAMxB,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,gBAAgB,4xBAuB5B,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,YAAY,qlBAkBxB,CAAC;AAEF,gGAAgG;AAChG,eAAO,MAAM,qBAAqB,oMAGjC,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,YAAY,qNAGpB,CAAC;AAEN,6FAA6F;AAC7F,eAAO,MAAM,MAAM,sZAYlB,CAAC"}
|
|
@@ -12,10 +12,10 @@ export interface AuthOptions {
|
|
|
12
12
|
/** Signs the session cookies; 32 characters or more. */
|
|
13
13
|
secret: string;
|
|
14
14
|
/**
|
|
15
|
-
* Where better-auth builds its links: the
|
|
16
|
-
*
|
|
15
|
+
* Where better-auth builds its links: the host of the request when it is
|
|
16
|
+
* one of \`allowedHosts\`, else \`fallback\`, the URL of this server.
|
|
17
17
|
*/
|
|
18
|
-
baseURL:
|
|
18
|
+
baseURL: { fallback: string; allowedHosts: string[] };
|
|
19
19
|
/** The browser origins that may call the auth routes. */
|
|
20
20
|
trustedOrigins: string[];
|
|
21
21
|
}
|
|
@@ -32,8 +32,8 @@ export function createAuth(options: AuthOptions) {
|
|
|
32
32
|
secret: options.secret,
|
|
33
33
|
baseURL: options.baseURL,
|
|
34
34
|
// A baseURL from the request takes the protocol of the page from
|
|
35
|
-
// x-forwarded-proto, which portless
|
|
36
|
-
advanced: { trustedProxyHeaders:
|
|
35
|
+
// x-forwarded-proto, which portless and the proxy in production send.
|
|
36
|
+
advanced: { trustedProxyHeaders: true },
|
|
37
37
|
trustedOrigins: options.trustedOrigins,
|
|
38
38
|
emailAndPassword: { enabled: true },
|
|
39
39
|
});
|
|
@@ -56,8 +56,9 @@ export const auth = createAuth({
|
|
|
56
56
|
prisma: createPrisma({
|
|
57
57
|
connectionString: process.env.CONNECTION_STRING ?? '',
|
|
58
58
|
}),
|
|
59
|
+
// A throwaway secret of 32+ characters: the CLI only reads the schema.
|
|
59
60
|
secret: 'the-better-auth-cli-reads-no-secret-from-here',
|
|
60
|
-
baseURL: 'http://localhost',
|
|
61
|
+
baseURL: { fallback: 'http://localhost', allowedHosts: ['localhost'] },
|
|
61
62
|
trustedOrigins: [],
|
|
62
63
|
});
|
|
63
64
|
`;
|
|
@@ -92,18 +93,17 @@ const allowedOrigins = process.env.ALLOWED_ORIGINS.split(',')
|
|
|
92
93
|
export const auth = createAuth({
|
|
93
94
|
prisma,
|
|
94
95
|
secret: process.env.BETTER_AUTH_SECRET,
|
|
95
|
-
//
|
|
96
|
-
//
|
|
97
|
-
//
|
|
98
|
-
// this server,
|
|
99
|
-
//
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
: process.env.BETTER_AUTH_URL,
|
|
96
|
+
// A link of better-auth (email verification, password reset) opens on the
|
|
97
|
+
// host of the page that asked for it, when that is the host of an allowed
|
|
98
|
+
// origin, in every setup: the Vite dev server and portless proxy /api to
|
|
99
|
+
// this server, and in production the backend serves the page, so the
|
|
100
|
+
// cookie that the link sets reaches the page. Any other host gets
|
|
101
|
+
// BETTER_AUTH_URL. better-auth refuses an empty allowedHosts, so
|
|
102
|
+
// ALLOWED_ORIGINS names at least one origin.
|
|
103
|
+
baseURL: {
|
|
104
|
+
fallback: process.env.BETTER_AUTH_URL,
|
|
105
|
+
allowedHosts: allowedOrigins.map((origin) => new URL(origin).host),
|
|
106
|
+
},
|
|
107
107
|
trustedOrigins: allowedOrigins,
|
|
108
108
|
});
|
|
109
109
|
`;
|
|
@@ -181,8 +181,9 @@ export function signedInLoader(
|
|
|
181
181
|
}
|
|
182
182
|
`;
|
|
183
183
|
/** The comment that auth puts above ALLOWED_ORIGINS when it adds the origins of the web app. */
|
|
184
|
-
export const allowedOriginsComment = `# better-auth
|
|
185
|
-
# are the origins of the web app:
|
|
184
|
+
export const allowedOriginsComment = `# CORS and better-auth trust these origins in every setup, and better-auth
|
|
185
|
+
# builds its links on their hosts. Here they are the origins of the web app:
|
|
186
|
+
# the Vite dev server and portless.
|
|
186
187
|
`;
|
|
187
188
|
/**
|
|
188
189
|
* The lines that the env map of module "stack" in the main.tf of the dokploy
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"files.js","sourceRoot":"","sources":["../../../src/generators/auth/files.ts"],"names":[],"mappings":"AAAA,uEAAuE;AACvE,+DAA+D;AAE/D,qHAAqH;AACrH,MAAM,UAAU,MAAM,CAAC,aAAqB;IAC1C,OAAO;;;qCAG4B,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAiCjD,CAAC;AACF,CAAC;AAED,oEAAoE;AACpE,MAAM,UAAU,SAAS,CAAC,aAAqB;IAC7C,OAAO,iCAAiC,aAAa
|
|
1
|
+
{"version":3,"file":"files.js","sourceRoot":"","sources":["../../../src/generators/auth/files.ts"],"names":[],"mappings":"AAAA,uEAAuE;AACvE,+DAA+D;AAE/D,qHAAqH;AACrH,MAAM,UAAU,MAAM,CAAC,aAAqB;IAC1C,OAAO;;;qCAG4B,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAiCjD,CAAC;AACF,CAAC;AAED,oEAAoE;AACpE,MAAM,UAAU,SAAS,CAAC,aAAqB;IAC7C,OAAO,iCAAiC,aAAa;;;;;;;;;;;;;;;;;;;CAmBtD,CAAC;AACF,CAAC;AAED,MAAM,CAAC,MAAM,WAAW,GAAG;;;;;;;;;;;;CAY1B,CAAC;AAEF,sDAAsD;AACtD,MAAM,CAAC,MAAM,SAAS,GAAG,wDAAwD,CAAC;AAElF,uEAAuE;AACvE,MAAM,CAAC,MAAM,SAAS,GAAG;;;;CAIxB,CAAC;AAEF,+FAA+F;AAC/F,MAAM,CAAC,MAAM,aAAa,GAAG;;;;;;;;;;;;;;;;;;;;;CAqB5B,CAAC;AAEF;;;;GAIG;AACH,MAAM,CAAC,MAAM,UAAU,GAAG;CACzB,CAAC;AAEF;;;;;GAKG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG;;;;;;CAM3B,CAAC;AAEF;;;;;GAKG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG;;;;;;;;;;;;;;;;;;;;;;;CAuB/B,CAAC;AAEF;;;GAGG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG;;;;;;;;;;;;;;;;;;CAkB3B,CAAC;AAEF,gGAAgG;AAChG,MAAM,CAAC,MAAM,qBAAqB,GAAG;;;CAGpC,CAAC;AAEF;;;;GAIG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG;;;KAGvB,CAAC;AAEN,6FAA6F;AAC7F,MAAM,CAAC,MAAM,MAAM,GAAG;;;;;;;;;;;;CAYrB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generator.d.ts","sourceRoot":"","sources":["../../../src/generators/auth/generator.ts"],"names":[],"mappings":"AAIA,OAAO,EACL,KAAK,iBAAiB,EACtB,KAAK,IAAI,EAMV,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"generator.d.ts","sourceRoot":"","sources":["../../../src/generators/auth/generator.ts"],"names":[],"mappings":"AAIA,OAAO,EACL,KAAK,iBAAiB,EACtB,KAAK,IAAI,EAMV,MAAM,YAAY,CAAC;AA6BpB,MAAM,WAAW,WAAW;IAC1B,kGAAkG;IAClG,OAAO,EAAE,MAAM,CAAC;IAChB,6FAA6F;IAC7F,EAAE,EAAE,MAAM,CAAC;IACX,wGAAwG;IACxG,GAAG,CAAC,EAAE,MAAM,CAAC;CACd;AAcD;;;;;;;GAOG;AACH,wBAA8B,aAAa,CACzC,IAAI,EAAE,IAAI,EACV,OAAO,EAAE,WAAW,GACnB,OAAO,CAAC,iBAAiB,CAAC,CAuF5B"}
|
|
@@ -4,7 +4,9 @@ import { posix } from 'node:path';
|
|
|
4
4
|
import { formatFiles, installPackagesTask, readJson, runTasksInSerial, updateJson, } from '@nx/devkit';
|
|
5
5
|
import { appDirectory, projectNameOf } from "../app-directory.js";
|
|
6
6
|
import { envMarker, infraRoot } from "../dokploy/files.js";
|
|
7
|
+
import { addEnvEntry } from "../env-file.js";
|
|
7
8
|
import initGenerator from "../init/generator.js";
|
|
9
|
+
import { uiMountComment, uiRouteImport } from "../pair/files.js";
|
|
8
10
|
import { portOf } from "../pair/generator.js";
|
|
9
11
|
import { rootDependencyNames, settleRootDependencies, } from "../root-dependencies.js";
|
|
10
12
|
import { appPackageVersions as versions, zukhrufVersion } from "../versions.js";
|
|
@@ -97,14 +99,6 @@ function insert(tree, path, marker, replacement) {
|
|
|
97
99
|
}
|
|
98
100
|
tree.write(path, content.replace(marker, replacement));
|
|
99
101
|
}
|
|
100
|
-
/** Adds `KEY=value` to an env file that has no line for the key. */
|
|
101
|
-
function addEnvEntry(tree, path, key, value) {
|
|
102
|
-
const content = tree.read(path, 'utf-8') ?? '';
|
|
103
|
-
if (new RegExp(`^${key}=`, 'm').test(content))
|
|
104
|
-
return;
|
|
105
|
-
const separator = content === '' || content.endsWith('\n') ? '' : '\n';
|
|
106
|
-
tree.write(path, `${content}${separator}${key}=${value}\n`);
|
|
107
|
-
}
|
|
108
102
|
/** startup.ts creates the auth from the client that the prisma generator wired. */
|
|
109
103
|
function wireStartup(tree, path, dbPackageName) {
|
|
110
104
|
if (tree.read(path, 'utf-8')?.includes('export const auth ='))
|
|
@@ -121,10 +115,11 @@ function mountRoutes(tree, path) {
|
|
|
121
115
|
const app = tree.read(path, 'utf-8') ?? '';
|
|
122
116
|
if (app.includes(authMount))
|
|
123
117
|
return;
|
|
124
|
-
const
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
118
|
+
const marker = !app.includes(uiRouteImport)
|
|
119
|
+
? '\napp.notFound((c) =>'
|
|
120
|
+
: app.includes(uiMountComment)
|
|
121
|
+
? `\n${uiMountComment}`
|
|
122
|
+
: '\n// pair fixed the path of the web build';
|
|
128
123
|
insert(tree, path, marker, `\n// better-auth answers under /api/auth.\n${authMount}\n${marker}`);
|
|
129
124
|
}
|
|
130
125
|
function wireEnvironment(tree, backendRoot) {
|
|
@@ -244,10 +239,11 @@ function addAllowedOrigins(tree, path, origins) {
|
|
|
244
239
|
/**
|
|
245
240
|
* The CLI imports the db package through its development export, which
|
|
246
241
|
* imports the generated client, so the client is generated first. NODE_OPTIONS
|
|
247
|
-
* gives jiti the development condition. NODE_ENV is
|
|
248
|
-
*
|
|
249
|
-
* production. auth:check only reads: it
|
|
250
|
-
* generated client with the plugins of the config, and exits 1 on
|
|
242
|
+
* gives jiti the development condition. NODE_ENV is production, as in every
|
|
243
|
+
* setup: auth.cli.ts passes a secret of its own, so better-auth never meets
|
|
244
|
+
* its default secret, which it refuses under production. auth:check only reads: it
|
|
245
|
+
* compares the generated client with the plugins of the config, and exits 1 on
|
|
246
|
+
* a mismatch.
|
|
251
247
|
*/
|
|
252
248
|
function authTargets(options) {
|
|
253
249
|
const { backendRoot, dbRoot, dbName } = options;
|
|
@@ -258,7 +254,7 @@ function authTargets(options) {
|
|
|
258
254
|
cwd: '{projectRoot}',
|
|
259
255
|
env: {
|
|
260
256
|
NODE_OPTIONS: '--conditions=development',
|
|
261
|
-
NODE_ENV: '
|
|
257
|
+
NODE_ENV: 'production',
|
|
262
258
|
},
|
|
263
259
|
};
|
|
264
260
|
return {
|
|
@@ -1 +1 @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pB,GAAG,EAAE;YACH,YAAY,EAAE,0BAA0B;YACxC,QAAQ,EAAE,aAAa;SACxB;KACF,CAAC;IACF,OAAO;QACL,eAAe,EAAE;YACf,QAAQ,EAAE,iBAAiB;YAC3B,SAAS,EAAE,cAAc;YACzB,OAAO,EAAE;gBACP,GAAG,MAAM;gBACT,QAAQ,EAAE;oBACR,+CAA+C,SAAS,aAAa,MAAM,QAAQ;oBACnF,cAAc,MAAM,WAAW;iBAChC;gBACD,QAAQ,EAAE,KAAK;aAChB;SACF;QACD,YAAY,EAAE;YACZ,QAAQ,EAAE,iBAAiB;YAC3B,SAAS,EAAE,cAAc;YACzB,OAAO,EAAE;gBACP,GAAG,MAAM;gBACT,OAAO,EAAE,kCAAkC,SAAS,EAAE;aACvD;SACF;KACF,CAAC;AACJ,CAAC;AAED;;;GAGG;AACH,SAAS,cAAc,CAAC,aAAqB,EAAE,WAAmB;IAChE,YAAY,CAAC,KAAK,EAAE,CAAC,IAAI,EAAE,KAAK,EAAE,GAAG,WAAW,gBAAgB,CAAC,EAAE;QACjE,GAAG,EAAE,aAAa;QAClB,KAAK,EAAE,SAAS;KACjB,CAAC,CAAC;AACL,CAAC"}
|
|
1
|
+
{"version":3,"file":"generator.js","sourceRoot":"","sources":["../../../src/generators/auth/generator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EAAE,KAAK,EAAE,MAAM,WAAW,CAAC;AAElC,OAAO,EAGL,WAAW,EACX,mBAAmB,EACnB,QAAQ,EACR,gBAAgB,EAChB,UAAU,GACX,MAAM,YAAY,CAAC;AAEpB,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAClE,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAC3D,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,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CAAC,KAAK,EAAE,KAAK,GAAG,MAAM,CAyBhD;AAED,wBAAgB,KAAK,CAAC,KAAK,EAAE,KAAK,GAAG,MAAM,CA0B1C;AAED,wBAAgB,MAAM,CAAC,KAAK,EAAE,KAAK,GAAG,MAAM,CAwC3C;AAED,wBAAgB,SAAS,CAAC,KAAK,EAAE,KAAK,GAAG,MAAM,CAgB9C;AAED,wBAAgB,WAAW,CAAC,KAAK,EAAE,KAAK,GAAG,MAAM,CA2BhD;AAED,eAAO,MAAM,SAAS,mdAarB,CAAC;AAEF,wBAAgB,KAAK,CAAC,KAAK,EAAE,KAAK,GAAG,MAAM,CA6E1C;AAED,wBAAgB,SAAS,CAAC,KAAK,EAAE,KAAK,GAAG,MAAM,CA4N9C"}
|
|
@@ -75,6 +75,9 @@ TF_VAR_ghcr_pull_token=\${GHCR_PULL_TOKEN}
|
|
|
75
75
|
# targets (init, preview, show, output) read it. CI reads the same names from
|
|
76
76
|
# repository secrets; applies run only in CI (.github/workflows/deploy.yml).
|
|
77
77
|
|
|
78
|
+
# Every setup runs under production; no code reads NODE_ENV (ADR 0016).
|
|
79
|
+
NODE_ENV=production
|
|
80
|
+
|
|
78
81
|
# Dokploy panel API key (sent as x-api-key). The stack reads it as
|
|
79
82
|
# var.dokploy_api_key; Nx expands the reference below.
|
|
80
83
|
DOKPLOY_API_KEY=
|
|
@@ -329,6 +332,7 @@ export function mainTf(stack) {
|
|
|
329
332
|
# replaces the environment.
|
|
330
333
|
#
|
|
331
334
|
# Each key of env reaches the ${app.name} through env_file: .env of the compose.
|
|
335
|
+
# ALLOWED_ORIGINS is the public origin: CORS and better-auth trust it.
|
|
332
336
|
module "stack" {
|
|
333
337
|
source = "${stackModuleSource}"
|
|
334
338
|
|
|
@@ -338,7 +342,8 @@ module "stack" {
|
|
|
338
342
|
compose_file = file("\${path.module}/../../../compose.dokploy.yml")
|
|
339
343
|
${databaseInput}${registryInput}
|
|
340
344
|
env = {
|
|
341
|
-
PUBLIC_HOST
|
|
345
|
+
PUBLIC_HOST = local.host
|
|
346
|
+
ALLOWED_ORIGINS = "https://\${local.host}"
|
|
342
347
|
${envMarker}
|
|
343
348
|
}
|
|
344
349
|
}
|
|
@@ -429,6 +434,12 @@ permissions:
|
|
|
429
434
|
actions: read
|
|
430
435
|
contents: read
|
|
431
436
|
|
|
437
|
+
# Every setup runs under production, CI too (ADR 0016 of @zukhruf/nx).
|
|
438
|
+
env:
|
|
439
|
+
NODE_ENV: production
|
|
440
|
+
# npm omits devDependencies under NODE_ENV=production; CI needs them.
|
|
441
|
+
npm_config_include: dev
|
|
442
|
+
|
|
432
443
|
jobs:
|
|
433
444
|
ci:
|
|
434
445
|
runs-on: ubuntu-latest
|
|
@@ -538,6 +549,10 @@ permissions:
|
|
|
538
549
|
cache-mode: read
|
|
539
550
|
|
|
540
551
|
env:
|
|
552
|
+
# Every setup runs under production (ADR 0016 of @zukhruf/nx).
|
|
553
|
+
NODE_ENV: production
|
|
554
|
+
# npm omits devDependencies under NODE_ENV=production; the deploy needs them.
|
|
555
|
+
npm_config_include: dev
|
|
541
556
|
SHA: \${{ github.event.workflow_run.head_sha }}
|
|
542
557
|
|
|
543
558
|
jobs:
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"files.js","sourceRoot":"","sources":["../../../src/generators/dokploy/files.ts"],"names":[],"mappings":"AAIA,OAAO,EAEL,eAAe,EACf,cAAc,EACd,cAAc,GACf,MAAM,gBAAgB,CAAC;AAExB,wCAAwC;AACxC,MAAM,CAAC,MAAM,SAAS,GAAG,OAAO,CAAC;AAEjC,8FAA8F;AAC9F,MAAM,CAAC,MAAM,iBAAiB,GAC5B,8FAA8F,CAAC;AAEjG,kGAAkG;AAClG,MAAM,CAAC,MAAM,SAAS,GAAG,4CAA4C,CAAC;AAEtE;;;GAGG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,oBAAoB,CAAC;AAElD,iFAAiF;AACjF,MAAM,SAAS,GAAe,CAAC,eAAe,EAAE,cAAc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,EAAE,CACxB,sBAAsB,KAAK,6BAA6B,UAAU,EAAE,CACvE;SACA,IAAI,CAAC,IAAI,CAAC,CAAC;IACd,MAAM,aAAa,GAAG,MAAM;SACzB,GAAG,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,sBAAsB,KAAK,EAAE,CAAC;SACjD,IAAI,CAAC,IAAI,CAAC,CAAC;IACd,MAAM,KAAK,GAAG,QAAQ;QACpB,CAAC,CAAC;;;4EAGsE;QACxE,CAAC,CAAC,EAAE,CAAC;IACP,MAAM,aAAa,GAAG,QAAQ;QAC5B,CAAC,CAAC;;;uCAGiC;QACnC,CAAC,CAAC,EAAE,CAAC;IACP,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;uBAmFc,GAAG,CAAC,aAAa,CAAC,IAAI,CAAC,GAAG,CAAC;;;;;;;uBAO3B,KAAK,CAAC,WAAW;;;;;;;4BAOZ,aAAa;;;;;;;;EAQvC,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;EA0BX,aAAa;;;;;;;;;;;;;;;;;;;;eAoBA,SAAS;;oBAEJ,SAAS;;;;kDAIqB,KAAK;;;;;;;;;;;;;;;;;;;;;;;+BAuBxB,GAAG,CAAC,IAAI;;;;;CAKtC,CAAC;AACF,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { Tree } from '@nx/devkit';
|
|
2
|
+
/**
|
|
3
|
+
* Adds `KEY=value` to an env file that has no line for the key. A line that is
|
|
4
|
+
* there keeps its value. A missing file gets the one line. The prisma and auth
|
|
5
|
+
* generators and the migrations use it (ADR 0014 decision 12, ADR 0017).
|
|
6
|
+
*/
|
|
7
|
+
export declare function addEnvEntry(tree: Tree, path: string, key: string, value: string): void;
|
|
8
|
+
//# sourceMappingURL=env-file.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"env-file.d.ts","sourceRoot":"","sources":["../../src/generators/env-file.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAEvC;;;;GAIG;AACH,wBAAgB,WAAW,CACzB,IAAI,EAAE,IAAI,EACV,IAAI,EAAE,MAAM,EACZ,GAAG,EAAE,MAAM,EACX,KAAK,EAAE,MAAM,GACZ,IAAI,CAKN"}
|