@zukhruf/nx 0.8.65 → 0.8.67

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 CHANGED
@@ -837,15 +837,16 @@ npx nx migrate --run-migrations
837
837
 
838
838
  `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. `packageJsonUpdates` in `migrations.json` move each third-party peer that the generators install to its pin in `versions.ts`, in a repo that has it, so a narrower peer range does not stop npm. [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.
839
839
 
840
- | Migration | Version | Brings |
841
- | ------------------------------- | ------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
842
- | `add-portless-proxy-env` | 0.8.40 | `PORTLESS_UNPRIVILEGED=1` and `PORTLESS_HTTPS=1` in `targetDefaults.portless` (#4768) |
843
- | `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) |
844
- | `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 |
845
- | `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); since 0.8.60 it writes the rule of ADR 0019 |
846
- | `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) |
847
- | `add-generated-source-defaults` | 0.8.60 | the rule of ADR 0019 in a repo whose `nx.json` lists the three plugins of `init`; removes the `dependsOn: ["^sdk"]` of a web `test` target; logs each other target that hides the rule (#5219) |
848
- | `add-sdk-build-edges` | 0.8.60 | `build-deps` in each node-app backend; `implicitDependencies` on the backend, `dependsOn: ["^build-deps"]` and the inputs of ADR 0021 in its client's `sdk`, when that target is the one `node-app` wrote; logs any other `sdk` target with the values to write (#5102) |
840
+ | Migration | Version | Brings |
841
+ | ------------------------------- | ------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
842
+ | `add-portless-proxy-env` | 0.8.40 | `PORTLESS_UNPRIVILEGED=1` and `PORTLESS_HTTPS=1` in `targetDefaults.portless` (#4768) |
843
+ | `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) |
844
+ | `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 |
845
+ | `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); since 0.8.60 it writes the rule of ADR 0019 |
846
+ | `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) |
847
+ | `add-generated-source-defaults` | 0.8.60 | the rule of ADR 0019 in a repo whose `nx.json` lists the three plugins of `init`; removes the `dependsOn: ["^sdk"]` of a web `test` target; logs each other target that hides the rule (#5219) |
848
+ | `add-sdk-build-edges` | 0.8.60 | `build-deps` in each node-app backend; `implicitDependencies` on the backend, `dependsOn: ["^build-deps"]` and the inputs of ADR 0021 in its client's `sdk`, when that target is the one `node-app` wrote; logs any other `sdk` target with the values to write (#5102) |
849
+ | `rename-eslint-react-config` | 0.8.66 | `zukhruf.configs['shadcn']` for `zukhruf.configs['react']` or `.react` (whatever the default import of `@zukhruf/eslint` is called) and `'zukhruf/shadcn'` for `'zukhruf/react'` in an `extends` array, in each `eslint.config.*`; `@zukhruf/eslint/react` stays; logs each edit (#5263, ADR 0017 decision 10) |
849
850
 
850
851
  ## release
851
852
 
@@ -907,7 +908,7 @@ This is the path for meddit, which has only `.git`. Nx 24 supports it, and no st
907
908
  - An Nx generator writes files through a `Tree`. It never removes a folder that it did not write, so `.git` stays.
908
909
  - In a folder that is already a Git work tree, create-nx-workspace runs no `git init`, no `git add` and no commit (`create-nx-workspace/dist/src/utils/git/git.js:141-149`). The first commit is yours.
909
910
 
910
- A smoke test on 2026-11-18 ran this command with the `@zukhruf/nx` preset in a folder with only `git init` (see [Test the preset before a release](#test-the-preset-before-a-release)). The folder and `.git` stayed, `git log` showed no commit, `git status` showed each file as new, `core.hooksPath` was `.husky`, and the first commit passed the hooks. The preset `npm` behaves differently: create-nx-workspace maps it to the template flow for an agent (`bin/create-nx-workspace.js:362-380`), and that flow amends the README and can leave an `error.log` (`create-workspace.js:269-288`).
911
+ A smoke test on 2026-11-18 ran this command with the `@zukhruf/nx` preset in a folder with only `git init` (see [Test the preset](#test-the-preset)). The folder and `.git` stayed, `git log` showed no commit, `git status` showed each file as new, `core.hooksPath` was `.husky`, and the first commit passed the hooks. The preset `npm` behaves differently: create-nx-workspace maps it to the template flow for an agent (`bin/create-nx-workspace.js:362-380`), and that flow amends the README and can leave an `error.log` (`create-workspace.js:269-288`).
911
912
 
912
913
  Two other seams do not work for an empty repo:
913
914
 
@@ -1048,7 +1049,7 @@ The Git hooks are the same in each repo. `Sync` stages `**/tsconfig*.json` and `
1048
1049
  ### Versions that the generators write
1049
1050
 
1050
1051
  - **The Nx family has one exact version.** `init` sets the root `nx` and each root `@nx/*` to `nxVersion`, also when the version is already there and is another one, a newer one included. Then npm installs one `nx` (#4532). An app generator adds its `@nx/*` packages at the same `nxVersion`. A test checks that the root `nx` equals `nxVersion` after `preset`, and that no root `@nx/*` has another version.
1051
- - **A missing `@zukhruf/*` package gets the version of `@zukhruf/nx` itself.** nx release gives each public package of zukhruf the same version, so the generator reads its own `package.json` and writes no list of versions. A version that is already there stays, for example a `file:` tarball in a smoke test.
1052
+ - **A missing `@zukhruf/*` package gets the version of `@zukhruf/nx` itself.** nx release gives each public package of zukhruf the same version, so the generator reads its own `package.json` and writes no list of versions. A version that is already there stays.
1052
1053
  - **The other root tools have exact versions** from one module, `src/generators/versions.ts`, that the app generators share: TypeScript 7 as `@typescript/native: "npm:typescript@7.x"` and the TypeScript 6 API as `typescript: "npm:@typescript/typescript6@6.x"` (see [Decisions and their reasons](#decisions-and-their-reasons)), ESLint 10, Prettier 3, `@trivago/prettier-plugin-sort-imports`, and the peers of `@zukhruf/eslint` that the root config loads. `init` adds a missing package at that version, and keeps a version that is already there.
1053
1054
  - **`allowScripts`** names each install script of a package that the generator installs: `nx: false` and `unrs-resolver: false`. `init` adds a missing name, and keeps a decision that is already there. The smoke test of 2026-11-18 proved the list: `npm install` with `strict-allow-scripts=true` passed.
1054
1055
 
@@ -1095,21 +1096,9 @@ The tests use a virtual `Tree` from `createTreeWithEmptyWorkspace` of `@nx/devki
1095
1096
  - Each hook that `init` creates has the mode `755`.
1096
1097
  - The backend-neutral output: no React, Vite, Vitest or Tailwind package in `package.json`, and no app wiring in `nx.json`.
1097
1098
 
1098
- ### Test the preset before a release
1099
+ ### Test the preset
1099
1100
 
1100
- create-nx-workspace takes the version of a third-party preset from `NX_E2E_PRESET_VERSION` when it is set (`@nx/workspace/dist/src/generators/new/new.js:114-118`). So the preset runs from a tarball of the checkout, before a release:
1101
-
1102
- ```sh
1103
- npx nx run nx:build
1104
- (cd packages/nx && npm pack --pack-destination <scratch>)
1105
- mkdir <scratch>/acme && cd <scratch>/acme && git init
1106
- NX_E2E_PRESET_VERSION=file:<scratch>/zukhruf-nx-<version>.tgz \
1107
- npx create-nx-workspace@latest . --preset=@zukhruf/nx --pm=npm --nxCloud=skip --aiAgents=none
1108
- ```
1109
-
1110
- Then check that `npm install` passes, that `npx nx run-many -t typecheck` and `npx nx run-many -t lint` pass, and that the first `git commit` passes the hooks. Delete the folder at the end. On 2026-11-18 both paths passed: a new folder (`acme`), and a folder with only `git init` (`.`). In the new folder, a demo package also passed `typecheck` (TypeScript 7.0.2) and `lint`, and its commit passed each hook. A second run of `npx nx g @zukhruf/nx:init` in the generated repo changed no file.
1111
-
1112
- After a release, two targets check the published version. `.github/workflows/nightly.yml` runs them each day and on `workflow_dispatch`, and no release waits for them ([ADR 0020](./docs/adr/0020-two-nightly-checks-run-the-generated-workspace-and-compare-an-upgraded-one-with-a-fresh-one.md)):
1101
+ A commit to main is a release (root [ADR 0007](../../docs/adr/0007-release-does-not-wait-for-ci.md)), so a test of the generators runs on a published version. Two targets do it, and `.github/workflows/nightly.yml` runs them each day and on `workflow_dispatch`, and no release waits for them ([ADR 0020](./docs/adr/0020-two-nightly-checks-run-the-generated-workspace-and-compare-an-upgraded-one-with-a-fresh-one.md)):
1113
1102
 
1114
1103
  ```sh
1115
1104
  npx nx run nx:e2e:smoke # latest
@@ -1235,9 +1224,9 @@ The brand: the fonts, colors and favicons of `index.html`. The generated `index.
1235
1224
 
1236
1225
  The tests run each generator on a virtual `Tree` with Nx 24.0.6, 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`.
1237
1226
 
1238
- ### Test the app generators before a release
1227
+ ### Test the app generators
1239
1228
 
1240
- After the steps of [Test the preset before a release](#test-the-preset-before-a-release), in the generated repo: run the 3 commands of [Add a backend, a web app and their pair](#add-a-backend-a-web-app-and-their-pair), then `npx nx run-many -t typecheck lint test build`, the first commit (each hook passes), `npx nx run @acme/backend:docker:build`, and a container whose `/api/healthz` reports `git rev-parse HEAD`.
1229
+ In a workspace from the published preset (`npx create-nx-workspace@latest acme --preset=@zukhruf/nx --pm=npm --nxCloud=skip --aiAgents=none`): run the 3 commands of [Add a backend, a web app and their pair](#add-a-backend-a-web-app-and-their-pair), then `npx nx run-many -t typecheck lint test build`, the first commit (each hook passes), `npx nx run @acme/backend:docker:build`, and a container whose `/api/healthz` reports `git rev-parse HEAD`.
1241
1230
 
1242
1231
  The decisions are in [ADR 0010](./docs/adr/0010-the-app-generators-move-here-and-call-the-generators-of-nx.md). The backlog item of the app generators is #3338.
1243
1232
 
@@ -1315,9 +1304,9 @@ Write each migration with `npx nx run @acme/db:migrate:create --name <name>`, th
1315
1304
  | `packages/db already belongs to @acme/other.` | `directory` holds another package |
1316
1305
  | `apps/backend/src/server.ts has no "import './startup.ts';", so the …` | a backend file lost the line that the wiring changes |
1317
1306
 
1318
- ### Test the prisma generator before a release
1307
+ ### Test the prisma generator
1319
1308
 
1320
- After the steps of [Test the preset before a release](#test-the-preset-before-a-release): `node-app apps/backend`, the 4 commands of [Add a db package](#add-a-db-package), and `npx nx run-many -t typecheck lint test build`. Then add a model and a first migration, put `@zukhruf/nx` back on the registry version (`npm ci` in an image cannot read a `file:` tarball), build `Dockerfile.migration`, and run its container against a new `postgres:18-alpine`: `prisma migrate deploy` applies the migration. On 2026-11-18 each step passed, and the backend image served `/api/healthz` with one database session and stopped at start with a wrong password.
1309
+ In a workspace from the published preset (`npx create-nx-workspace@latest acme --preset=@zukhruf/nx --pm=npm --nxCloud=skip --aiAgents=none`): `node-app apps/backend`, the 4 commands of [Add a db package](#add-a-db-package), and `npx nx run-many -t typecheck lint test build`. Then add a model and a first migration, build `Dockerfile.migration`, and run its container against a new `postgres:18-alpine`: `prisma migrate deploy` applies the migration. On 2026-11-18 each step passed, and the backend image served `/api/healthz` with one database session and stopped at start with a wrong password.
1321
1310
 
1322
1311
  The decisions are in [ADR 0012](./docs/adr/0012-the-prisma-generator-writes-a-postgres-db-package-and-wires-a-backend.md). The backlog item is #4604.
1323
1312
 
@@ -1430,13 +1419,13 @@ Both run in the backend root with `NODE_OPTIONS=--conditions=development`, so ji
1430
1419
  | `apps/web has no vite.config.ts, so it is not a react-app. Run …` | `--web` names a project that `react-app` did not write |
1431
1420
  | `infra/src/environments/production/main.tf calls module "stack" but its env has no "# Generators add env keys above this line.", so the generator cannot add BETTER_AUTH_SECRET = … and BETTER_AUTH_URL = …. Add the two lines to env, or put the marker back as the last line of env.` | the repo removed the marker from the `env` map of the module call, and the two keys are not there |
1432
1421
 
1433
- ### Test the auth generator before a release
1422
+ ### Test the auth generator
1434
1423
 
1435
- After the steps of [Test the prisma generator before a release](#test-the-prisma-generator-before-a-release) up to `run-many`: run `auth --backend apps/backend --db packages/db`, then check that `auth:check` exits 0, that `run-many -t typecheck lint build test` passes, and that a second run changes no file. On 2026-11-19 each step passed. The production bundle on a `postgres:18-alpine`, with the schema from `prisma migrate diff`, answered `POST /api/auth/sign-up/email` with 200.
1424
+ After the steps of [Test the prisma generator](#test-the-prisma-generator) up to `run-many`: run `auth --backend apps/backend --db packages/db`, then check that `auth:check` exits 0, that `run-many -t typecheck lint build test` passes, and that a second run changes no file. On 2026-11-19 each step passed. The production bundle on a `postgres:18-alpine`, with the schema from `prisma migrate diff`, answered `POST /api/auth/sign-up/email` with 200.
1436
1425
 
1437
1426
  For `--web`, also run `react-app apps/web` and `pair` before prisma, and `auth` with `--web apps/web`. Start `serve` of the backend and `dev` of the web, then send `POST http://localhost:5173/api/auth/sign-up/email` with `Origin: http://localhost:5173`: it answers 200, and with another origin 403. Repeat on `https://web.acme.localhost` under the `portless` target. On 2026-11-19 each step passed, and `authClient.signUp.email` in Chromium answered 200.
1438
1427
 
1439
- For the guards, add a route that lists `signedIn`: `GET` it without a cookie (401), then after sign-in (200). Until `@zukhruf/authentication` is on npm, install it from a tarball with an `overrides` entry (`file:<tgz>`), not with `npm link`: a link brings a second `hono`, and the app answers the refusal with 500. On 2026-11-19 both answers were right, through the Vite dev server, and a verification link opened through the Vite dev server and through portless signed in the page on that origin.
1428
+ For the guards, add a route that lists `signedIn`: `GET` it without a cookie (401), then after sign-in (200). On 2026-11-19 both answers were right, through the Vite dev server, and a verification link opened through the Vite dev server and through portless signed in the page on that origin.
1440
1429
 
1441
1430
  The decisions are in [ADR 0014](./docs/adr/0014-the-auth-generator-adds-better-auth-to-a-backend-and-its-db-package.md). The backlog item is #4719.
1442
1431
 
@@ -1526,9 +1515,9 @@ The compose reads `PUBLIC_HOST` in its labels, Postgres reads `POSTGRES_PASSWORD
1526
1515
  | `The host "app.example.org" is not a name in the zone "example.com".` | `--host` outside `--zone` |
1527
1516
  | `The name "My App" is not a lowercase name that starts with a letter.` | `--name`, or the scope, is not a lowercase name |
1528
1517
 
1529
- ### Test the dokploy generator before a release
1518
+ ### Test the dokploy generator
1530
1519
 
1531
- After the steps of [Test the app generators before a release](#test-the-app-generators-before-a-release), run `prisma` and then `dokploy` with `--database`, `--registryUser` and no `--host`, then `npm install`, `npx nx sync`, `npx nx run @acme/infra:typecheck`, `actionlint .github/workflows/*.yml`, `npx nx run-many -t typecheck lint`, `npx prettier --check .`, and `docker compose -f infra/compose.dokploy.yml config` (with an `infra/.env`, which the app's `env_file` names). actionlint 1.7.12 does not know the `parallel:` step of `ci.yml`, which GitHub runs. On 2026-11-18 each passed, also after a run with `--host` and no `--database` or `--registryUser`; after that, two runs with the first options passed again, and the second of them changed no file.
1520
+ After the steps of [Test the app generators](#test-the-app-generators), run `prisma` and then `dokploy` with `--database`, `--registryUser` and no `--host`, then `npm install`, `npx nx sync`, `npx nx run @acme/infra:typecheck`, `actionlint .github/workflows/*.yml`, `npx nx run-many -t typecheck lint`, `npx prettier --check .`, and `docker compose -f infra/compose.dokploy.yml config` (with an `infra/.env`, which the app's `env_file` names). actionlint 1.7.12 does not know the `parallel:` step of `ci.yml`, which GitHub runs. On 2026-11-18 each passed, also after a run with `--host` and no `--database` or `--registryUser`; after that, two runs with the first options passed again, and the second of them changed no file.
1532
1521
 
1533
1522
  The decisions are in [ADR 0011](./docs/adr/0011-the-dokploy-generator-writes-the-gitops-delivery-of-a-node-app.md) and [ADR 0015](./docs/adr/0015-an-opentofu-module-of-zukhruf-holds-the-dokploy-delivery-and-the-dokploy-generator-writes-infra-once.md). The backlog items of the dokploy generator are #4603 and #4733.
1534
1523
 
@@ -0,0 +1,12 @@
1
+ import { type Tree } from '@nx/devkit';
2
+ /**
3
+ * #5263: @zukhruf/eslint renamed its kit config from `react` to `shadcn`
4
+ * (#4990, its ADR 0011) and keeps `react` as a deprecated alias for one
5
+ * release. In each eslint.config of the repo, `configs['react']` and
6
+ * `configs.react` of the default import of `@zukhruf/eslint` become
7
+ * `configs['shadcn']`, and `'zukhruf/react'` in an `extends` array becomes
8
+ * `'zukhruf/shadcn'`. `@zukhruf/eslint/react`, the community React preset, is
9
+ * another export and stays.
10
+ */
11
+ export default function renameEslintReactConfig(tree: Tree): Promise<void>;
12
+ //# sourceMappingURL=rename-eslint-react-config.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rename-eslint-react-config.d.ts","sourceRoot":"","sources":["../../../src/migrations/update-0-8-66/rename-eslint-react-config.ts"],"names":[],"mappings":"AAEA,OAAO,EAGL,KAAK,IAAI,EAKV,MAAM,YAAY,CAAC;AAKpB;;;;;;;;GAQG;AACH,wBAA8B,uBAAuB,CACnD,IAAI,EAAE,IAAI,GACT,OAAO,CAAC,IAAI,CAAC,CAwBf"}
@@ -0,0 +1,111 @@
1
+ import { posix } from 'node:path';
2
+ import { ChangeType, applyChangesToString, formatFiles, logger, visitNotIgnoredFiles, } from '@nx/devkit';
3
+ import * as ts from 'typescript';
4
+ const ESLINT_CONFIG = /^eslint\.config\.[cm]?[jt]s$/;
5
+ /**
6
+ * #5263: @zukhruf/eslint renamed its kit config from `react` to `shadcn`
7
+ * (#4990, its ADR 0011) and keeps `react` as a deprecated alias for one
8
+ * release. In each eslint.config of the repo, `configs['react']` and
9
+ * `configs.react` of the default import of `@zukhruf/eslint` become
10
+ * `configs['shadcn']`, and `'zukhruf/react'` in an `extends` array becomes
11
+ * `'zukhruf/shadcn'`. `@zukhruf/eslint/react`, the community React preset, is
12
+ * another export and stays.
13
+ */
14
+ export default async function renameEslintReactConfig(tree) {
15
+ visitNotIgnoredFiles(tree, '', (path) => {
16
+ if (!ESLINT_CONFIG.test(posix.basename(path)))
17
+ return;
18
+ const before = tree.read(path, 'utf8');
19
+ if (before === null)
20
+ return;
21
+ const edits = renames(path, before);
22
+ if (edits.length === 0)
23
+ return;
24
+ tree.write(path, applyChangesToString(before, edits.flatMap(({ start, from, to }) => [
25
+ { type: ChangeType.Delete, start, length: from.length },
26
+ { type: ChangeType.Insert, index: start, text: to },
27
+ ])));
28
+ for (const { line, from, to } of edits) {
29
+ logger.info(`rename-eslint-react-config: ${path}:${line} ${from} -> ${to}`);
30
+ }
31
+ });
32
+ await formatFiles(tree);
33
+ }
34
+ function renames(path, text) {
35
+ const source = ts.createSourceFile(path, text, ts.ScriptTarget.Latest, true);
36
+ const plugin = defaultImportOf(source, '@zukhruf/eslint');
37
+ const edits = [];
38
+ const replace = (node, to) => {
39
+ const start = node.getStart(source);
40
+ edits.push({
41
+ start,
42
+ line: source.getLineAndCharacterOfPosition(start).line + 1,
43
+ from: node.getText(source),
44
+ to,
45
+ });
46
+ };
47
+ const visit = (node) => {
48
+ if (plugin !== undefined && isReactConfigAccess(node, plugin)) {
49
+ replace(node, `${plugin}.configs['shadcn']`);
50
+ return;
51
+ }
52
+ if (isExtendsArray(node)) {
53
+ for (const element of node.elements) {
54
+ if (isText(element) && element.text === 'zukhruf/react') {
55
+ replace(element, `'zukhruf/shadcn'`);
56
+ }
57
+ }
58
+ }
59
+ ts.forEachChild(node, visit);
60
+ };
61
+ visit(source);
62
+ return edits;
63
+ }
64
+ /** The local name of `import name from 'module'`. */
65
+ function defaultImportOf(source, module) {
66
+ for (const statement of source.statements) {
67
+ if (ts.isImportDeclaration(statement) &&
68
+ ts.isStringLiteral(statement.moduleSpecifier) &&
69
+ statement.moduleSpecifier.text === module &&
70
+ statement.importClause?.name !== undefined) {
71
+ return statement.importClause.name.text;
72
+ }
73
+ }
74
+ return undefined;
75
+ }
76
+ /** `plugin.configs.react`, `plugin.configs['react']` or `plugin.configs["react"]`. */
77
+ function isReactConfigAccess(node, plugin) {
78
+ const configs = reactOf(node);
79
+ return (configs !== undefined &&
80
+ ts.isPropertyAccessExpression(configs) &&
81
+ configs.name.text === 'configs' &&
82
+ ts.isIdentifier(configs.expression) &&
83
+ configs.expression.text === plugin);
84
+ }
85
+ /** `x` of `x.react` or `x['react']`. */
86
+ function reactOf(node) {
87
+ if (ts.isPropertyAccessExpression(node)) {
88
+ return node.name.text === 'react' ? node.expression : undefined;
89
+ }
90
+ if (ts.isElementAccessExpression(node) &&
91
+ isText(node.argumentExpression) &&
92
+ node.argumentExpression.text === 'react') {
93
+ return node.expression;
94
+ }
95
+ return undefined;
96
+ }
97
+ /** The value of `extends: [...]` or `'extends': [...]`. */
98
+ function isExtendsArray(node) {
99
+ if (!ts.isArrayLiteralExpression(node))
100
+ return false;
101
+ const { parent } = node;
102
+ if (!ts.isPropertyAssignment(parent) || parent.initializer !== node) {
103
+ return false;
104
+ }
105
+ const key = parent.name;
106
+ return (ts.isIdentifier(key) || isText(key)) && key.text === 'extends';
107
+ }
108
+ function isText(node) {
109
+ return ts.isStringLiteral(node) || ts.isNoSubstitutionTemplateLiteral(node);
110
+ }
111
+ //# sourceMappingURL=rename-eslint-react-config.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rename-eslint-react-config.js","sourceRoot":"","sources":["../../../src/migrations/update-0-8-66/rename-eslint-react-config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,WAAW,CAAC;AAElC,OAAO,EACL,UAAU,EAGV,oBAAoB,EACpB,WAAW,EACX,MAAM,EACN,oBAAoB,GACrB,MAAM,YAAY,CAAC;AACpB,OAAO,KAAK,EAAE,MAAM,YAAY,CAAC;AAEjC,MAAM,aAAa,GAAG,8BAA8B,CAAC;AAErD;;;;;;;;GAQG;AACH,MAAM,CAAC,OAAO,CAAC,KAAK,UAAU,uBAAuB,CACnD,IAAU;IAEV,oBAAoB,CAAC,IAAI,EAAE,EAAE,EAAE,CAAC,IAAI,EAAE,EAAE;QACtC,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;YAAE,OAAO;QACtD,MAAM,MAAM,GAAG,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;QACvC,IAAI,MAAM,KAAK,IAAI;YAAE,OAAO;QAC5B,MAAM,KAAK,GAAG,OAAO,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;QACpC,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC;YAAE,OAAO;QAC/B,IAAI,CAAC,KAAK,CACR,IAAI,EACJ,oBAAoB,CAClB,MAAM,EACN,KAAK,CAAC,OAAO,CAAC,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE,EAAE,EAAkB,EAAE,CAAC;YACrD,EAAE,IAAI,EAAE,UAAU,CAAC,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,CAAC,MA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it client runs after the db generator, hashes its output, and is affected by its backend: each node-app backend gets the target build-deps, and its .sdk-it/package.json gets implicitDependencies on the backend, sdk dependsOn [\"^build-deps\"] and the inputs ^production and { \"dependentTasksOutputFiles\": \"**/*.ts\", \"transitive\": true } when its sdk target is the one node-app wrote; another sdk target is logged (#5102).",
36
36
  "implementation": "./dist/migrations/update-0-8-60/add-sdk-build-edges.js"
37
+ },
38
+ "rename-eslint-react-config": {
39
+ "version": "0.8.66",
40
+ "description": "An eslint.config reads the kit config of @zukhruf/eslint by its new name: zukhruf.configs['react'] and zukhruf.configs.react become zukhruf.configs['shadcn'], whatever the default import is called, and 'zukhruf/react' in an extends array becomes 'zukhruf/shadcn'; @zukhruf/eslint/react stays, and each changed file is logged (#5263, #4990).",
41
+ "implementation": "./dist/migrations/update-0-8-66/rename-eslint-react-config.js"
37
42
  }
38
43
  },
39
44
  "packageJsonUpdates": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zukhruf/nx",
3
- "version": "0.8.65",
3
+ "version": "0.8.67",
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,9 +131,10 @@
131
131
  "@nx/react": ">=24.0.6 <25.0.0",
132
132
  "@nx/vite": ">=24.0.6 <25.0.0",
133
133
  "@nx/vitest": ">=24.0.6 <25.0.0",
134
- "@zukhruf/testing": "^0.8.65",
134
+ "@zukhruf/testing": "^0.8.67",
135
135
  "nx": ">=24.0.6 <25.0.0",
136
- "prettier": "^3.0.0"
136
+ "prettier": "^3.0.0",
137
+ "typescript": ">=5.8.0 <6.1.0"
137
138
  },
138
139
  "peerDependenciesMeta": {
139
140
  "@nx/node": {
@@ -153,9 +154,9 @@
153
154
  }
154
155
  },
155
156
  "devDependencies": {
156
- "@zukhruf/eslint": "^0.8.65",
157
- "@zukhruf/fs": "^0.8.65",
158
- "@zukhruf/testing": "^0.8.65",
157
+ "@zukhruf/eslint": "^0.8.67",
158
+ "@zukhruf/fs": "^0.8.67",
159
+ "@zukhruf/testing": "^0.8.67",
159
160
  "semver": "^7.8.5"
160
161
  }
161
162
  }