@zukhruf/nx 0.8.43 → 0.8.44
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 +64 -20
- package/dist/generators/prisma/generator.d.ts +6 -0
- package/dist/generators/prisma/generator.d.ts.map +1 -1
- package/dist/generators/prisma/generator.js +14 -1
- package/dist/generators/prisma/generator.js.map +1 -1
- package/dist/migrations/update-0-8-44/add-migrate-check.d.ts +9 -0
- package/dist/migrations/update-0-8-44/add-migrate-check.d.ts.map +1 -0
- package/dist/migrations/update-0-8-44/add-migrate-check.js +16 -0
- package/dist/migrations/update-0-8-44/add-migrate-check.js.map +1 -0
- package/dist/prisma/migrate-diff.d.ts +2 -0
- package/dist/prisma/migrate-diff.d.ts.map +1 -0
- package/dist/prisma/migrate-diff.js +72 -0
- package/dist/prisma/migrate-diff.js.map +1 -0
- package/dist/prisma/plugin.d.ts +2 -1
- package/dist/prisma/plugin.d.ts.map +1 -1
- package/dist/prisma/plugin.js +21 -4
- package/dist/prisma/plugin.js.map +1 -1
- package/migrations.json +5 -0
- package/package.json +8 -4
package/README.md
CHANGED
|
@@ -1,20 +1,21 @@
|
|
|
1
1
|
# @zukhruf/nx
|
|
2
2
|
|
|
3
|
-
This package is the Nx part of the monorepo standard. Each workspace copied the same Nx configuration into each project. This package gives that configuration one time, in areas. Each area has its own import path, and the package has no root entry point. Two [generators](#generators) write the root files of a workspace, four [app generators](#app-generators) add its projects, the [prisma generator](#prisma-generator) adds a db package, and the [dokploy generator](#dokploy-generator) adds the delivery of a backend. The lint rules stay in `@zukhruf/eslint`, and the Git hooks stay in `@zukhruf/git-hooks`. [Monorepo standard](#monorepo-standard) says where each rule of the standard lives, and why.
|
|
3
|
+
This package is the Nx part of the monorepo standard. Each workspace copied the same Nx configuration into each project. This package gives that configuration one time, in areas. Each area has its own import path, and the package has no root entry point. Two [generators](#generators) write the root files of a workspace, four [app generators](#app-generators) add its projects, the [prisma generator](#prisma-generator) adds a db package, the [auth generator](#auth-generator) adds sign-in to a backend, and the [dokploy generator](#dokploy-generator) adds the delivery of a backend. The [release configuration](#release) gives the release policy that `nx.json` extends. The lint rules stay in `@zukhruf/eslint`, and the Git hooks stay in `@zukhruf/git-hooks`. [Monorepo standard](#monorepo-standard) says where each rule of the standard lives, and why.
|
|
4
4
|
|
|
5
5
|
The words in these documents have one meaning each. See the glossary in [CONTEXT.md](./CONTEXT.md).
|
|
6
6
|
|
|
7
7
|
## Areas
|
|
8
8
|
|
|
9
|
-
| Area | Import path
|
|
10
|
-
| ---------------- |
|
|
11
|
-
| format | `@zukhruf/nx/format`
|
|
12
|
-
| test | `@zukhruf/nx/test`
|
|
13
|
-
| lint | `@zukhruf/nx/lint`
|
|
14
|
-
| portless | `@zukhruf/nx/portless`
|
|
15
|
-
| opentofu, prisma | `@zukhruf/nx/<area>`
|
|
16
|
-
| generators | `@zukhruf/nx:<name>`
|
|
17
|
-
| migrations | `nx migrate`
|
|
9
|
+
| Area | Import path | Status |
|
|
10
|
+
| ---------------- | -------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
11
|
+
| format | `@zukhruf/nx/format` | This README |
|
|
12
|
+
| test | `@zukhruf/nx/test` | This README |
|
|
13
|
+
| lint | `@zukhruf/nx/lint` | This README |
|
|
14
|
+
| portless | `@zukhruf/nx/portless` | Candidate (#3336): 14 projects in 3 repos |
|
|
15
|
+
| opentofu, prisma | `@zukhruf/nx/<area>` | This README (#3339) |
|
|
16
|
+
| generators | `@zukhruf/nx:<name>` | This README: `preset` and `init` (#3337); `node-app`, `react-app`, `pair`, `ui-package` (#3338); `dokploy` (#4603); `prisma` (#4604); `auth` (#4719) |
|
|
17
|
+
| migrations | `nx migrate` | This README (#4818) |
|
|
18
|
+
| release | `@zukhruf/nx/release.json` | This README (#4677) |
|
|
18
19
|
|
|
19
20
|
The lint rules stay in `@zukhruf/eslint`. The `lint` area gives only the inputs of the `lint` target (#3335).
|
|
20
21
|
|
|
@@ -744,7 +745,7 @@ You need Nx 23.2.1 or later, and `prisma` and `@prisma/client` in the lockfile.
|
|
|
744
745
|
"plugins": ["@zukhruf/nx/prisma"],
|
|
745
746
|
"targetDefaults": {
|
|
746
747
|
"typecheck": {
|
|
747
|
-
"dependsOn": ["lint", "format:check", "generate", "..."],
|
|
748
|
+
"dependsOn": ["lint", "format:check", "generate", "migrate:check", "..."],
|
|
748
749
|
},
|
|
749
750
|
"build": {
|
|
750
751
|
"dependsOn": ["generate", "..."],
|
|
@@ -753,7 +754,7 @@ You need Nx 23.2.1 or later, and `prisma` and `@prisma/client` in the lockfile.
|
|
|
753
754
|
}
|
|
754
755
|
```
|
|
755
756
|
|
|
756
|
-
Keep the entries that are already in the lists. Nx skips a `dependsOn` on a target that the project does not have, so a project with no Prisma is not changed. The plugin does not change `typecheck` or `build`. Those targets belong to other plugins, as for `format:check` ([ADR 0001](./docs/adr/0001-inferred-targets-not-copied-defaults.md)). The `typecheck:generate` tag of text2sql is then not necessary. See [ADR 0008](./docs/adr/0008-prisma-targets-from-prisma-config-with-outputs-from-the-schema.md).
|
|
757
|
+
Keep the entries that are already in the lists. Nx skips a `dependsOn` on a target that the project does not have, so a project with no Prisma is not changed. `migrate:check` needs Docker and `@zukhruf/testing` (see [Check the migrations](#check-the-migrations)). The plugin does not change `typecheck` or `build`. Those targets belong to other plugins, as for `format:check` ([ADR 0001](./docs/adr/0001-inferred-targets-not-copied-defaults.md)). The `typecheck:generate` tag of text2sql is then not necessary. See [ADR 0008](./docs/adr/0008-prisma-targets-from-prisma-config-with-outputs-from-the-schema.md).
|
|
757
758
|
|
|
758
759
|
### Signature of the prisma area
|
|
759
760
|
|
|
@@ -772,13 +773,15 @@ A project root gets the Prisma targets when it has a `prisma.config.ts` directly
|
|
|
772
773
|
|
|
773
774
|
Each target runs in `{projectRoot}`.
|
|
774
775
|
|
|
775
|
-
| Target
|
|
776
|
-
|
|
|
777
|
-
| `generate`
|
|
778
|
-
| `migrate`
|
|
779
|
-
| `
|
|
780
|
-
| `
|
|
781
|
-
| `
|
|
776
|
+
| Target | Command | Cached | Depends on |
|
|
777
|
+
| ---------------- | ----------------------------------------------------------------------------------------------------------------------------------------------- | ------ | ---------- |
|
|
778
|
+
| `generate` | `prisma generate` | yes | — |
|
|
779
|
+
| `migrate` | `prisma migrate dev` | no | `generate` |
|
|
780
|
+
| `migrate:check` | `prisma migrate diff --from-migrations migrations --to-schema . --exit-code`, on a shadow database | yes | — |
|
|
781
|
+
| `migrate:create` | `prisma migrate diff --from-migrations migrations --to-schema . --script --output migrations/<time>_<name>/migration.sql`, on a shadow database | no | — |
|
|
782
|
+
| `deploy` | `prisma migrate deploy` | no | — |
|
|
783
|
+
| `reset` | `prisma migrate reset` | no | — |
|
|
784
|
+
| `pull` | `prisma db pull` | no | — |
|
|
782
785
|
|
|
783
786
|
- The inputs of `generate` are `{projectRoot}/**/*.prisma`, `{projectRoot}/prisma.config.ts`, and the packages `prisma` and `@prisma/client` (`externalDependencies`). Thus a new model file in `models/` runs `generate` again, and an update of Prisma does too. The copies had the whole `package-lock.json` as an input, so each update of any package ran `generate` again.
|
|
784
787
|
- The outputs of `generate` are the `output` folders of the `generator` blocks in the `*.prisma` files of the project. A path is relative to the file of its block, as Prisma reads it. For example, `output = "src/prisma"` in `schema.prisma` gives `{projectRoot}/src/prisma`. Nx restores these folders from the cache.
|
|
@@ -788,6 +791,21 @@ Each target runs in `{projectRoot}`.
|
|
|
788
791
|
|
|
789
792
|
text2sql also has a target `prisma` that runs the Prisma CLI with the arguments that you give. It stays in each project that wants it.
|
|
790
793
|
|
|
794
|
+
### Check the migrations
|
|
795
|
+
|
|
796
|
+
`migrate:check` fails when the migrations in `migrations/` do not build the schema of the project folder: a model changed with no migration, or a migration with no change of the models. It prints Prisma's diff from the migrations to the schema. `migrate:create` writes that diff as a new migration:
|
|
797
|
+
|
|
798
|
+
```sh
|
|
799
|
+
npx nx run @acme/db:migrate:create --name add_patient_age
|
|
800
|
+
npx nx run @acme/db:migrate:check
|
|
801
|
+
```
|
|
802
|
+
|
|
803
|
+
- Both run `src/prisma/migrate-diff.ts` of this package. It takes a new, empty database from `@zukhruf/testing/postgres`, gives it to Prisma as `SHADOW_CONNECTION_STRING`, and drops it after the diff. Prisma replays the migrations there. So the targets need Docker and `@zukhruf/testing`, as the tests of a db package do, and no `.env` entry, dev database or CI step. A `SHADOW_CONNECTION_STRING` in `.env` or in the shell is not used, so its database is never emptied.
|
|
804
|
+
- `prisma.config.ts` must read `datasource.shadowDatabaseUrl` from `SHADOW_CONNECTION_STRING`, as the [prisma generator](#prisma-generator) writes it. Else Prisma stops with "You must set `datasource.shadowDatabaseUrl`".
|
|
805
|
+
- The schema is the project folder (`--to-schema .`), with each `*.prisma` file under it, as `schema: '.'` of the generated config. A diff to `schema.prisma` alone removes every table that `models/*.prisma` holds.
|
|
806
|
+
- The folder name of `migrate:create` is the UTC time to the second and the name, as `prisma migrate dev` names it. With no change, the file is `-- This is an empty migration.`, for SQL that you write. `migrate:create` needs no TTY and no dev database, where `migrate dev --create-only` refuses a data-loss warning with no TTY. Its SQL can still fail on a table with rows, for example a required column with no default: edit it before `deploy`.
|
|
807
|
+
- `migrate:check` is cached on the `*.prisma` files, `prisma.config.ts`, the migrations and the package `prisma`. The [prisma generator](#prisma-generator) adds it to `targetDefaults.typecheck.dependsOn`. See [ADR 0018](./docs/adr/0018-migrate-check-diffs-the-migrations-on-a-shadow-database-that-it-makes.md).
|
|
808
|
+
|
|
791
809
|
### Migrate a workspace to the prisma area
|
|
792
810
|
|
|
793
811
|
1. Add `@zukhruf/nx/prisma` to `plugins` in `nx.json`.
|
|
@@ -829,6 +847,32 @@ npx nx migrate --run-migrations
|
|
|
829
847
|
| `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
848
|
| `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
849
|
| `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) |
|
|
850
|
+
| `add-migrate-check` | 0.8.44 | `migrate:check` in `targetDefaults.typecheck.dependsOn` of a repo with `@zukhruf/nx/prisma`, so the typecheck of a db package fails when its migrations do not build its schema (#4937, ADR 0018) |
|
|
851
|
+
|
|
852
|
+
## release
|
|
853
|
+
|
|
854
|
+
The release block of `nx.json` was the same in zukhruf, elt, deepagents and sdk-it. The file `@zukhruf/nx/release.json` gives that block one time, and `nx.json` extends it (#4677, commit 001377af):
|
|
855
|
+
|
|
856
|
+
```json
|
|
857
|
+
{
|
|
858
|
+
"extends": "@zukhruf/nx/release.json"
|
|
859
|
+
}
|
|
860
|
+
```
|
|
861
|
+
|
|
862
|
+
Nx's `extends` is a shallow merge (commit 001377af). A `release` key in the `nx.json` of the workspace replaces the whole block of the file.
|
|
863
|
+
|
|
864
|
+
| Field | Value | What it does |
|
|
865
|
+
| ------------------------------------------ | ------------------------------------------------ | ------------------------------------------------------------------------------------- |
|
|
866
|
+
| `projects` | `["tag:npm:public"]` | Releases only the projects with the tag `npm:public`. |
|
|
867
|
+
| `conventionalCommits.types.refactor` | `{ "semverBump": "patch" }` | A `refactor` commit makes a patch version. |
|
|
868
|
+
| `changelog.workspaceChangelog.file` | `false` | Writes no changelog file for the workspace. |
|
|
869
|
+
| `version.preVersionCommand` | `nx run-many -t build --projects=tag:npm:public` | Builds the released projects before Nx writes the versions. |
|
|
870
|
+
| `version.conventionalCommits` | `true` | Takes the next version from the conventional commits. |
|
|
871
|
+
| `version.preserveMatchingDependencyRanges` | `false` | Writes the new version into each dependency range, also into a range that matches it. |
|
|
872
|
+
| `version.git` | `{ "commit": true, "tag": true, "push": true }` | Commits the versions, tags the commit and pushes it. |
|
|
873
|
+
| `releaseTag.pattern` | `release/{version}` | Names each tag `release/<version>`, such as `release/0.8.40`. |
|
|
874
|
+
|
|
875
|
+
zukhruf ([nx.json](../../nx.json)) and deepagents extend the file. The release workflow of deepagents runs `nx release version` with it, and the `preVersionCommand` builds the `tag:npm:public` packages before the versions change.
|
|
832
876
|
|
|
833
877
|
## generators
|
|
834
878
|
|
|
@@ -1233,7 +1277,7 @@ The schema sets `additionalProperties: false`. The package name is `@<scope>/<la
|
|
|
1233
1277
|
| `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 |
|
|
1234
1278
|
| `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 |
|
|
1235
1279
|
|
|
1236
|
-
At the root: `compose.dev.yml` when missing, with one `database` service (the `postgres:18-alpine` of the deployed stack on `127.0.0.1:<port>`, the database `<scope>`, a named volume at `/var/lib/postgresql`, a `pg_isready` healthcheck); `@zukhruf/nx/prisma` in `plugins`; `generate` in the `dependsOn` of the `typecheck` and `build` defaults, with `...`; `<root>/src/prisma` in `.gitignore` and `.prettierignore`; `.dockerignore` when missing; the package root in `workspaces` when no `<parent>/*` glob holds it; `@zukhruf/testing`; and `@prisma/engines: true`, `prisma: false`, `ssh2: false`, `cpu-features: false` in `allowScripts`. A second run keeps the files of the package and adds no line or key twice.
|
|
1280
|
+
At the root: `compose.dev.yml` when missing, with one `database` service (the `postgres:18-alpine` of the deployed stack on `127.0.0.1:<port>`, the database `<scope>`, a named volume at `/var/lib/postgresql`, a `pg_isready` healthcheck); `@zukhruf/nx/prisma` in `plugins`; `generate` in the `dependsOn` of the `typecheck` and `build` defaults, and `migrate:check` in that of `typecheck`, with `...`; `<root>/src/prisma` in `.gitignore` and `.prettierignore`; `.dockerignore` when missing; the package root in `workspaces` when no `<parent>/*` glob holds it; `@zukhruf/testing`; and `@prisma/engines: true`, `prisma: false`, `ssh2: false`, `cpu-features: false` in `allowScripts`. A second run keeps the files of the package and adds no line or key twice.
|
|
1237
1281
|
|
|
1238
1282
|
With `--backend`, the node-app gets:
|
|
1239
1283
|
|
|
@@ -50,4 +50,10 @@ export declare function localDatabaseTargets(rootOffset: string, database: Local
|
|
|
50
50
|
* migration call it (#4826).
|
|
51
51
|
*/
|
|
52
52
|
export declare function addPrismaTargetDefaults(nxJson: NxJsonConfiguration): void;
|
|
53
|
+
/**
|
|
54
|
+
* `migrate:check` in `targetDefaults.typecheck`, as `format:check` is, so a
|
|
55
|
+
* schema change without its migration fails the typecheck of the db package
|
|
56
|
+
* (ADR 0018). The generator and the add-migrate-check migration call it.
|
|
57
|
+
*/
|
|
58
|
+
export declare function addMigrateCheck(nxJson: NxJsonConfiguration): void;
|
|
53
59
|
//# sourceMappingURL=generator.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generator.d.ts","sourceRoot":"","sources":["../../../src/generators/prisma/generator.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,KAAK,iBAAiB,EACtB,KAAK,mBAAmB,EACxB,KAAK,IAAI,EAOV,MAAM,YAAY,CAAC;AAcpB,OAAO,EACL,KAAK,aAAa,EAanB,MAAM,YAAY,CAAC;AAEpB,MAAM,WAAW,aAAa;IAC5B,qEAAqE;IACrE,SAAS,EAAE,MAAM,CAAC;IAClB,iHAAiH;IACjH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,iHAAiH;IACjH,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAgCD;;;;;;;GAOG;AACH,wBAA8B,eAAe,CAC3C,IAAI,EAAE,IAAI,EACV,OAAO,EAAE,aAAa,GACrB,OAAO,CAAC,iBAAiB,CAAC,CAgE5B;AAED;;;;;;GAMG;AACH,wBAAgB,oBAAoB,CAClC,UAAU,EAAE,MAAM,EAClB,QAAQ,EAAE,aAAa;;;;;;;;;;;;;;;;;;;EAwBxB;
|
|
1
|
+
{"version":3,"file":"generator.d.ts","sourceRoot":"","sources":["../../../src/generators/prisma/generator.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,KAAK,iBAAiB,EACtB,KAAK,mBAAmB,EACxB,KAAK,IAAI,EAOV,MAAM,YAAY,CAAC;AAcpB,OAAO,EACL,KAAK,aAAa,EAanB,MAAM,YAAY,CAAC;AAEpB,MAAM,WAAW,aAAa;IAC5B,qEAAqE;IACrE,SAAS,EAAE,MAAM,CAAC;IAClB,iHAAiH;IACjH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,iHAAiH;IACjH,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAgCD;;;;;;;GAOG;AACH,wBAA8B,eAAe,CAC3C,IAAI,EAAE,IAAI,EACV,OAAO,EAAE,aAAa,GACrB,OAAO,CAAC,iBAAiB,CAAC,CAgE5B;AAED;;;;;;GAMG;AACH,wBAAgB,oBAAoB,CAClC,UAAU,EAAE,MAAM,EAClB,QAAQ,EAAE,aAAa;;;;;;;;;;;;;;;;;;;EAwBxB;AAyID;;;;GAIG;AACH,wBAAgB,uBAAuB,CAAC,MAAM,EAAE,mBAAmB,GAAG,IAAI,CAYzE;AAED;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,mBAAmB,GAAG,IAAI,CAKjE"}
|
|
@@ -212,7 +212,8 @@ function addWorkspace(tree, projectRoot) {
|
|
|
212
212
|
}
|
|
213
213
|
/**
|
|
214
214
|
* The plugin gives the Prisma targets, and `generate` runs before each
|
|
215
|
-
* typecheck and build, because the client is not committed (ADR 0008).
|
|
215
|
+
* typecheck and build, because the client is not committed (ADR 0008).
|
|
216
|
+
* `migrate:check` runs before each typecheck (ADR 0018). Nx
|
|
216
217
|
* skips a dependency on a target that the project does not have, and `...`
|
|
217
218
|
* keeps the dependencies and inputs that the plugins infer.
|
|
218
219
|
*
|
|
@@ -228,6 +229,7 @@ function mergePrismaNxJson(tree) {
|
|
|
228
229
|
nxJson.plugins = [...plugins, '@zukhruf/nx/prisma'];
|
|
229
230
|
}
|
|
230
231
|
addPrismaTargetDefaults(nxJson);
|
|
232
|
+
addMigrateCheck(nxJson);
|
|
231
233
|
return nxJson;
|
|
232
234
|
});
|
|
233
235
|
}
|
|
@@ -249,6 +251,17 @@ export function addPrismaTargetDefaults(nxJson) {
|
|
|
249
251
|
}));
|
|
250
252
|
}
|
|
251
253
|
}
|
|
254
|
+
/**
|
|
255
|
+
* `migrate:check` in `targetDefaults.typecheck`, as `format:check` is, so a
|
|
256
|
+
* schema change without its migration fails the typecheck of the db package
|
|
257
|
+
* (ADR 0018). The generator and the add-migrate-check migration call it.
|
|
258
|
+
*/
|
|
259
|
+
export function addMigrateCheck(nxJson) {
|
|
260
|
+
updateTargetDefault(nxJson, 'typecheck', (entry) => ({
|
|
261
|
+
...entry,
|
|
262
|
+
dependsOn: unique([...(entry.dependsOn ?? []), 'migrate:check', '...']),
|
|
263
|
+
}));
|
|
264
|
+
}
|
|
252
265
|
/** Replaces `marker` in a file of the backend, or stops when the file has no marker. */
|
|
253
266
|
function insert(tree, path, marker, replacement) {
|
|
254
267
|
const content = tree.read(path, 'utf-8');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generator.js","sourceRoot":"","sources":["../../../src/generators/prisma/generator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,WAAW,CAAC;AAElC,OAAO,EAIL,WAAW,EACX,mBAAmB,EACnB,QAAQ,EACR,gBAAgB,EAChB,UAAU,EACV,SAAS,GACV,MAAM,YAAY,CAAC;AAEpB,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC3C,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,aAAa,MAAM,sBAAsB,C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AM,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,SAAS,IAAI,EAAE,CAAC,EAAE,KAAK,CAAC,CAAC;iBACvD;aACF;SACF,CAAC;QACF,OAAO,WAAW,CAAC;IACrB,CAAC,CACF,CAAC;IACF,MAAM,QAAQ,GAAG,GAAG,WAAW,uBAAuB,CAAC;IACvD,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,EAAE,CAAC;QAC3B,IAAI,CAAC,KAAK,CACR,QAAQ,EACR,cAAc,CAAC;YACb,MAAM,EAAE,WAAW;YACnB,OAAO,EAAE,GAAG,WAAW,UAAU;SAClC,CAAC,CACH,CAAC;IACJ,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type Tree } from '@nx/devkit';
|
|
2
|
+
/**
|
|
3
|
+
* #4937: the prisma generator adds `migrate:check` to
|
|
4
|
+
* `targetDefaults.typecheck.dependsOn`, so the typecheck of a db package
|
|
5
|
+
* fails when its migrations do not build its schema (ADR 0018). A repo whose
|
|
6
|
+
* nx.json lists `@zukhruf/nx/prisma` gets it; the entries that are there stay.
|
|
7
|
+
*/
|
|
8
|
+
export default function addMigrateCheckDefault(tree: Tree): Promise<void>;
|
|
9
|
+
//# sourceMappingURL=add-migrate-check.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"add-migrate-check.d.ts","sourceRoot":"","sources":["../../../src/migrations/update-0-8-44/add-migrate-check.ts"],"names":[],"mappings":"AAAA,OAAO,EAA4B,KAAK,IAAI,EAAe,MAAM,YAAY,CAAC;AAK9E;;;;;GAKG;AACH,wBAA8B,sBAAsB,CAClD,IAAI,EAAE,IAAI,GACT,OAAO,CAAC,IAAI,CAAC,CAIf"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { formatFiles } from '@nx/devkit';
|
|
2
|
+
import { addMigrateCheck } from "../../generators/prisma/generator.js";
|
|
3
|
+
import { hasPlugin, updateJsonIfChanged } from "../workspace.js";
|
|
4
|
+
/**
|
|
5
|
+
* #4937: the prisma generator adds `migrate:check` to
|
|
6
|
+
* `targetDefaults.typecheck.dependsOn`, so the typecheck of a db package
|
|
7
|
+
* fails when its migrations do not build its schema (ADR 0018). A repo whose
|
|
8
|
+
* nx.json lists `@zukhruf/nx/prisma` gets it; the entries that are there stay.
|
|
9
|
+
*/
|
|
10
|
+
export default async function addMigrateCheckDefault(tree) {
|
|
11
|
+
if (!hasPlugin(tree, '@zukhruf/nx/prisma'))
|
|
12
|
+
return;
|
|
13
|
+
updateJsonIfChanged(tree, 'nx.json', addMigrateCheck);
|
|
14
|
+
await formatFiles(tree);
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=add-migrate-check.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"add-migrate-check.js","sourceRoot":"","sources":["../../../src/migrations/update-0-8-44/add-migrate-check.ts"],"names":[],"mappings":"AAAA,OAAO,EAAuC,WAAW,EAAE,MAAM,YAAY,CAAC;AAE9E,OAAO,EAAE,eAAe,EAAE,MAAM,sCAAsC,CAAC;AACvE,OAAO,EAAE,SAAS,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAEjE;;;;;GAKG;AACH,MAAM,CAAC,OAAO,CAAC,KAAK,UAAU,sBAAsB,CAClD,IAAU;IAEV,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,oBAAoB,CAAC;QAAE,OAAO;IACnD,mBAAmB,CAAsB,IAAI,EAAE,SAAS,EAAE,eAAe,CAAC,CAAC;IAC3E,MAAM,WAAW,CAAC,IAAI,CAAC,CAAC;AAC1B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"migrate-diff.d.ts","sourceRoot":"","sources":["../../src/prisma/migrate-diff.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
// The migration targets of `@zukhruf/nx/prisma` run this in the project root:
|
|
2
|
+
// `node migrate-diff.js check` for `migrate:check`, and
|
|
3
|
+
// `node migrate-diff.js create --name <name>` for `migrate:create`. Each runs
|
|
4
|
+
// `prisma migrate diff` from the migrations folder to the schema folder.
|
|
5
|
+
// Prisma replays the migrations on the shadow database, which it reads from
|
|
6
|
+
// `datasource.shadowDatabaseUrl` of prisma.config.ts and never creates (ADR
|
|
7
|
+
// 0018). The generated config reads it from SHADOW_CONNECTION_STRING, so this
|
|
8
|
+
// script sets that variable to a new, empty database of
|
|
9
|
+
// @zukhruf/testing/postgres, and drops the database after the diff.
|
|
10
|
+
import { spawn } from 'node:child_process';
|
|
11
|
+
import { parseArgs } from 'node:util';
|
|
12
|
+
import { Postgres } from '@zukhruf/testing/postgres';
|
|
13
|
+
function parse() {
|
|
14
|
+
const { positionals, values } = parseArgs({
|
|
15
|
+
allowPositionals: true,
|
|
16
|
+
options: { name: { type: 'string' } },
|
|
17
|
+
});
|
|
18
|
+
const [command] = positionals;
|
|
19
|
+
if (command === 'check' && values.name === undefined) {
|
|
20
|
+
return { command };
|
|
21
|
+
}
|
|
22
|
+
if (command === 'create' && values.name !== undefined) {
|
|
23
|
+
// The folder name of `prisma migrate dev`: the UTC time to the second,
|
|
24
|
+
// then the name.
|
|
25
|
+
const time = new Date().toISOString().replaceAll(/\D/g, '').slice(0, 14);
|
|
26
|
+
return {
|
|
27
|
+
command,
|
|
28
|
+
output: `migrations/${time}_${values.name}/migration.sql`,
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
if (command === 'create') {
|
|
32
|
+
throw new Error('Name the new migration: migrate:create --name <name>.');
|
|
33
|
+
}
|
|
34
|
+
throw new Error('Run `migrate-diff.js check`, or `migrate-diff.js create --name <name>`.');
|
|
35
|
+
}
|
|
36
|
+
const run = parse();
|
|
37
|
+
await using shadow = await new Postgres({
|
|
38
|
+
environment: process.env,
|
|
39
|
+
}).database();
|
|
40
|
+
const prisma = spawn('prisma', [
|
|
41
|
+
'migrate',
|
|
42
|
+
'diff',
|
|
43
|
+
'--from-migrations',
|
|
44
|
+
'migrations',
|
|
45
|
+
// The folder, not schema.prisma: with the models in models/*.prisma, a
|
|
46
|
+
// diff to schema.prisma alone removes every table.
|
|
47
|
+
'--to-schema',
|
|
48
|
+
'.',
|
|
49
|
+
...(run.command === 'check'
|
|
50
|
+
? ['--exit-code']
|
|
51
|
+
: ['--script', '--output', run.output]),
|
|
52
|
+
], {
|
|
53
|
+
stdio: 'inherit',
|
|
54
|
+
env: { ...process.env, SHADOW_CONNECTION_STRING: shadow.connectionString },
|
|
55
|
+
});
|
|
56
|
+
const { promise: exit, resolve, reject, } = Promise.withResolvers();
|
|
57
|
+
prisma.once('error', reject);
|
|
58
|
+
prisma.once('close', (code, signal) => resolve({ code, signal }));
|
|
59
|
+
// Node gives the code null when a signal ended the child.
|
|
60
|
+
const { code, signal } = await exit;
|
|
61
|
+
if (code === null) {
|
|
62
|
+
throw new Error(`prisma migrate diff stopped on ${signal}.`);
|
|
63
|
+
}
|
|
64
|
+
// With --exit-code, Prisma exits 2 when the diff is not empty.
|
|
65
|
+
if (run.command === 'check' && code === 2) {
|
|
66
|
+
console.error('The migrations do not build the schema. The diff above goes from the migrations to the schema. Write it as a new migration with the migrate:create target of this project (--name <name>), or change the schema to match the migrations.');
|
|
67
|
+
}
|
|
68
|
+
if (run.command === 'create' && code === 0) {
|
|
69
|
+
console.error(`Wrote ${run.output}.`);
|
|
70
|
+
}
|
|
71
|
+
process.exitCode = code;
|
|
72
|
+
//# sourceMappingURL=migrate-diff.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"migrate-diff.js","sourceRoot":"","sources":["../../src/prisma/migrate-diff.ts"],"names":[],"mappings":"AAAA,8EAA8E;AAC9E,wDAAwD;AACxD,8EAA8E;AAC9E,yEAAyE;AACzE,4EAA4E;AAC5E,4EAA4E;AAC5E,8EAA8E;AAC9E,wDAAwD;AACxD,oEAAoE;AACpE,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,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O,CAAC,QAAQ,GAAG,IAAI,CAAC"}
|
package/dist/prisma/plugin.d.ts
CHANGED
|
@@ -3,7 +3,8 @@ import { type CreateNodes } from '@nx/devkit';
|
|
|
3
3
|
* Gives the Prisma targets to each project root with a `prisma.config.ts`.
|
|
4
4
|
* `generate` is cached: its inputs are the schema files, the config and the
|
|
5
5
|
* Prisma packages, and its outputs are the `output` folders of the generator
|
|
6
|
-
* blocks.
|
|
6
|
+
* blocks. `migrate:check` is cached on the schema files and the migrations.
|
|
7
|
+
* It does not change `typecheck` or `build` (ADR 0001).
|
|
7
8
|
*/
|
|
8
9
|
export declare const createNodes: CreateNodes;
|
|
9
10
|
//# sourceMappingURL=plugin.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../src/prisma/plugin.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,KAAK,WAAW,EAGjB,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../src/prisma/plugin.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,KAAK,WAAW,EAGjB,MAAM,YAAY,CAAC;AAcpB;;;;;;GAMG;AACH,eAAO,MAAM,WAAW,EAAE,WA+CzB,CAAC"}
|
package/dist/prisma/plugin.js
CHANGED
|
@@ -1,14 +1,18 @@
|
|
|
1
1
|
import { readFileSync } from 'node:fs';
|
|
2
|
-
import { basename, dirname, join, relative } from 'node:path';
|
|
2
|
+
import { basename, dirname, extname, join, relative } from 'node:path';
|
|
3
3
|
import { createNodesFromFiles, } from '@nx/devkit';
|
|
4
4
|
import { nearestRoot, projectRootFiles } from "../project-roots.js";
|
|
5
|
+
// The migration diff ships beside this file: `.ts` in the source that zukhruf
|
|
6
|
+
// runs, `.js` in the build that npm installs.
|
|
7
|
+
const migrateDiff = join(import.meta.dirname, `migrate-diff${extname(import.meta.filename)}`);
|
|
5
8
|
const generatorBlock = /^\s*generator\s+\w+\s*\{([^}]*)\}/gm;
|
|
6
9
|
const outputLine = /^\s*output\s*=\s*"([^"]+)"/m;
|
|
7
10
|
/**
|
|
8
11
|
* Gives the Prisma targets to each project root with a `prisma.config.ts`.
|
|
9
12
|
* `generate` is cached: its inputs are the schema files, the config and the
|
|
10
13
|
* Prisma packages, and its outputs are the `output` folders of the generator
|
|
11
|
-
* blocks.
|
|
14
|
+
* blocks. `migrate:check` is cached on the schema files and the migrations.
|
|
15
|
+
* It does not change `typecheck` or `build` (ADR 0001).
|
|
12
16
|
*/
|
|
13
17
|
export const createNodes = [
|
|
14
18
|
'{package.json,**/package.json,project.json,**/project.json,prisma.config.ts,**/prisma.config.ts,**/*.prisma}',
|
|
@@ -31,7 +35,7 @@ export const createNodes = [
|
|
|
31
35
|
? {
|
|
32
36
|
projects: {
|
|
33
37
|
[root]: {
|
|
34
|
-
targets: targets(root, generatorOutputs(context.workspaceRoot, schemas.get(root) ?? [])),
|
|
38
|
+
targets: targets(root, relative(join(context.workspaceRoot, root), migrateDiff), generatorOutputs(context.workspaceRoot, schemas.get(root) ?? [])),
|
|
35
39
|
},
|
|
36
40
|
},
|
|
37
41
|
}
|
|
@@ -50,7 +54,7 @@ function generatorOutputs(workspaceRoot, schemas) {
|
|
|
50
54
|
return output === undefined ? undefined : join(dirname(schema), output);
|
|
51
55
|
}));
|
|
52
56
|
}
|
|
53
|
-
function targets(root, outputs) {
|
|
57
|
+
function targets(root, script, outputs) {
|
|
54
58
|
const command = (line, dependsOn = []) => ({
|
|
55
59
|
executor: 'nx:run-commands',
|
|
56
60
|
options: { command: line, cwd: '{projectRoot}' },
|
|
@@ -75,6 +79,19 @@ function targets(root, outputs) {
|
|
|
75
79
|
: { cache: false }),
|
|
76
80
|
},
|
|
77
81
|
migrate: command('prisma migrate dev', ['generate']),
|
|
82
|
+
// Both diff the migrations on a shadow database that the script makes
|
|
83
|
+
// (ADR 0018). The check only reads, so it is cached.
|
|
84
|
+
'migrate:check': {
|
|
85
|
+
...command(`node "${script}" check`),
|
|
86
|
+
cache: true,
|
|
87
|
+
inputs: [
|
|
88
|
+
'{projectRoot}/**/*.prisma',
|
|
89
|
+
'{projectRoot}/prisma.config.ts',
|
|
90
|
+
'{projectRoot}/migrations/**/*',
|
|
91
|
+
{ externalDependencies: ['prisma'] },
|
|
92
|
+
],
|
|
93
|
+
},
|
|
94
|
+
'migrate:create': command(`node "${script}" create`),
|
|
78
95
|
deploy: command('prisma migrate deploy'),
|
|
79
96
|
reset: command('prisma migrate reset'),
|
|
80
97
|
pull: command('prisma db pull'),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.js","sourceRoot":"","sources":["../../src/prisma/plugin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"plugin.js","sourceRoot":"","sources":["../../src/prisma/plugin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAEvE,OAAO,EAGL,oBAAoB,GACrB,MAAM,YAAY,CAAC;AAEpB,OAAO,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAEpE,8EAA8E;AAC9E,8CAA8C;AAC9C,MAAM,WAAW,GAAG,IAAI,CACtB,MAAM,CAAC,IAAI,CAAC,OAAO,EACnB,eAAe,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE,CAC/C,CAAC;AAEF,MAAM,cAAc,GAAG,qCAAqC,CAAC;AAC7D,MAAM,UAAU,GAAG,6BAA6B,CAAC;AAEjD;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,WAAW,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,EAAE;gBACN,2BAA2B;gBAC3B,gCAAgC;gBAChC,+BAA+B;gBAC/B,EAAE,oBAAoB,EAAE,CAAC,QAAQ,CAAC,EAAE;aACrC;SACF;QACD,gBAAgB,EAAE,OAAO,CAAC,SAAS,MAAM,UAAU,CAAC;QACpD,MAAM,EAAE,OAAO,CAAC,uBAAuB,CAAC;QACxC,KAAK,EAAE,OAAO,CAAC,sBAAsB,CAAC;QACtC,IAAI,EAAE,OAAO,CAAC,gBAAgB,CAAC;KAChC,CAAC;AACJ,CAAC"}
|
package/migrations.json
CHANGED
|
@@ -19,6 +19,11 @@
|
|
|
19
19
|
"version": "0.8.40",
|
|
20
20
|
"description": "A repo with @zukhruf/nx/prisma hashes the generated Prisma client: targetDefaults.typecheck and .build get the inputs \"...\" and { \"dependentTasksOutputFiles\": \"**/*.ts\" } (#4826, ADR 0012 decision 6).",
|
|
21
21
|
"implementation": "./dist/migrations/update-0-8-40/add-prisma-client-inputs.js"
|
|
22
|
+
},
|
|
23
|
+
"add-migrate-check": {
|
|
24
|
+
"version": "0.8.44",
|
|
25
|
+
"description": "The typecheck of a db package runs migrate:check, which fails when the migrations do not build the schema: targetDefaults.typecheck.dependsOn gets \"migrate:check\" in a repo with @zukhruf/nx/prisma (#4937, ADR 0018).",
|
|
26
|
+
"implementation": "./dist/migrations/update-0-8-44/add-migrate-check.js"
|
|
22
27
|
}
|
|
23
28
|
}
|
|
24
29
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zukhruf/nx",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.44",
|
|
4
4
|
"description": "The Nx part of the monorepo standard: inference plugins for format, test, lint, opentofu and prisma targets, and generators for the root files (preset, init), apps (node-app, react-app, pair, ui-package), a db package (prisma) and delivery (dokploy).",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -131,6 +131,7 @@
|
|
|
131
131
|
"@nx/react": ">=23.2.1 <25.0.0",
|
|
132
132
|
"@nx/vite": ">=23.2.1 <25.0.0",
|
|
133
133
|
"@nx/vitest": ">=23.2.1 <25.0.0",
|
|
134
|
+
"@zukhruf/testing": "^0.8.44",
|
|
134
135
|
"nx": ">=23.2.1 <25.0.0",
|
|
135
136
|
"prettier": "^3.0.0"
|
|
136
137
|
},
|
|
@@ -146,11 +147,14 @@
|
|
|
146
147
|
},
|
|
147
148
|
"@nx/vitest": {
|
|
148
149
|
"optional": true
|
|
150
|
+
},
|
|
151
|
+
"@zukhruf/testing": {
|
|
152
|
+
"optional": true
|
|
149
153
|
}
|
|
150
154
|
},
|
|
151
155
|
"devDependencies": {
|
|
152
|
-
"@zukhruf/eslint": "^0.8.
|
|
153
|
-
"@zukhruf/fs": "^0.8.
|
|
154
|
-
"@zukhruf/testing": "^0.8.
|
|
156
|
+
"@zukhruf/eslint": "^0.8.44",
|
|
157
|
+
"@zukhruf/fs": "^0.8.44",
|
|
158
|
+
"@zukhruf/testing": "^0.8.44"
|
|
155
159
|
}
|
|
156
160
|
}
|