From 4c7586c82d199c85c90336deca8bfe5e0542ec0b Mon Sep 17 00:00:00 2001 From: James Henry Date: Fri, 20 Jun 2025 01:37:16 +0400 Subject: [PATCH] chore(repo): migrate to conformance v3 (#31475) --- .../external-generated/packages-metadata.json | 9 ++ .../azure-cache/documents/overview.md | 6 +- .../documents/create-conformance-rule.md | 74 +++++------ .../conformance/documents/overview.md | 2 + .../conformance/generators/create-rule.json | 13 +- .../conformance/generators/preset.json | 19 +++ .../packages/gcs-cache/documents/overview.md | 6 +- .../packages/owners/documents/overview.md | 2 + .../packages/s3-cache/documents/overview.md | 6 +- .../shared-fs-cache/documents/overview.md | 10 +- docs/generated/manifests/menus.json | 8 ++ docs/generated/manifests/new-nx-api.json | 9 ++ .../conformance/create-conformance-rule.md | 74 +++++------ .../packages/s3-cache/s3-cache-plugin.md | 2 +- docs/shared/reference/sitemap.md | 1 + package.json | 8 +- pnpm-lock.yaml | 118 +++++++++--------- .../blog-cover-image/index.ts | 17 ++- .../blog-description/index.ts | 15 ++- .../migration-groups/index.ts | 11 +- .../project-package-json/index.ts | 11 +- 21 files changed, 214 insertions(+), 207 deletions(-) create mode 100644 docs/external-generated/packages/conformance/generators/preset.json diff --git a/docs/external-generated/packages-metadata.json b/docs/external-generated/packages-metadata.json index 23c20e7940..0658eee02e 100644 --- a/docs/external-generated/packages-metadata.json +++ b/docs/external-generated/packages-metadata.json @@ -69,6 +69,15 @@ "originalFilePath": "/libs/nx-packages/conformance/src/generators/create-rule/schema.json", "path": "conformance/generators/create-rule", "type": "generator" + }, + { + "description": "Nx workspace preset which includes a working conformance rule", + "file": "external-generated/packages/conformance/generators/preset.json", + "hidden": false, + "name": "preset", + "originalFilePath": "/libs/nx-packages/conformance/src/generators/preset/schema.json", + "path": "conformance/generators/preset", + "type": "generator" } ], "migrations": [], diff --git a/docs/external-generated/packages/azure-cache/documents/overview.md b/docs/external-generated/packages/azure-cache/documents/overview.md index a74d8ec7b1..1e73b7ec6a 100644 --- a/docs/external-generated/packages/azure-cache/documents/overview.md +++ b/docs/external-generated/packages/azure-cache/documents/overview.md @@ -3,6 +3,8 @@ title: Overview of the Nx Azure Cache Plugin description: The @nx/azure-cache plugin enables you to use Azure Storage to host your remote cache for efficient build caching across your team. --- +# @nx/azure-cache + The `@nx/azure-cache` plugin enables you to self-host your remote cache on [Azure Storage](https://azure.microsoft.com/en-us/products/storage/blobs). {% callout type="deepdive" title="Free managed remote cache with Nx Cloud" %} @@ -15,9 +17,9 @@ If you are an enterprise and **data privacy and security is a concern**, [reach {% /callout %} -{% callout type="info" title="Self-hosted caching is now free" %} +{% callout type="warning" title="Bucket-based caches are vulnerable to poisoning and often prohibited in organizations" %} -Self-hosted caching is **now free for everyone** to use. +CREEP (CVE-2025-36852) is a critical vulnerability in bucket-based self-hosted remote caches. It lets attackers with PR access poison production builds via a race condition during artifact creation—before security checks can catch it. [Learn more](/blog/cve-2025-36852-critical-cache-poisoning-vulnerability-creep) {% /callout %} diff --git a/docs/external-generated/packages/conformance/documents/create-conformance-rule.md b/docs/external-generated/packages/conformance/documents/create-conformance-rule.md index 3ac33a858a..f8833024a0 100644 --- a/docs/external-generated/packages/conformance/documents/create-conformance-rule.md +++ b/docs/external-generated/packages/conformance/documents/create-conformance-rule.md @@ -17,7 +17,6 @@ To write your own conformance rule, run the `@nx/conformance:create-rule` genera ✔ What is the name of the rule? · local-conformance-rule-example ✔ Which directory do you want to create the rule directory in? · packages/my-plugin/local-conformance-rule ✔ What category does this rule belong to? · security -✔ What reporter do you want to use for this rule? · project-reporter ✔ What is the description of the rule? · an example of a conformance rule CREATE packages/my-plugin/local-conformance-rule/local-conformance-rule-example/index.ts CREATE packages/my-plugin/local-conformance-rule/local-conformance-rule-example/schema.json @@ -26,15 +25,14 @@ CREATE packages/my-plugin/local-conformance-rule/local-conformance-rule-example/ The generated rule definition file should look like this: ```ts {% fileName="packages/my-plugin/local-conformance-rule/index.ts" %} -import { createConformanceRule, ProjectViolation } from '@nx/conformance'; +import { createConformanceRule, ConformanceViolation } from '@nx/conformance'; export default createConformanceRule({ name: 'local-conformance-rule-example', category: 'security', description: 'an example of a conformance rule', - reporter: 'project-reporter', implementation: async (context) => { - const violations: ProjectViolation[] = []; + const violations: ConformanceViolation[] = []; return { severity: 'low', @@ -64,28 +62,27 @@ Note that the severity of the error is defined by the rule author and can be adj ## Conformance Rule Examples -There are three types of reporters that a rule can use. +Rules should report on the most specific thing that is in violation of the rule. They can report on one or more of the following things within a workspace: -- `project-reporter` - The rule evaluates an entire project at a time. -- `project-files-reporter` - The rule evaluates a single project file at a time. -- `non-project-files-reporter` - The rule evaluates files that don't belong to any project. +- file - The rule reports on a particular file being in violation of the rule. +- project - The rule reports on a particular project being in violation of the rule, because no one file within it would be applicable to flag up. +- the workspace itself - Sometimes there is no specific file or project that is most applicable to flag up, so the rule can report on the workspace itself. {% tabs %} -{% tab label="project-reporter" %} +{% tab label="project violation" %} -The `@nx/conformance:ensure-owners` rule provides us an example of how to write a `project-reporter` rule. The `@nx/owners` plugin adds an `owners` metadata property to every project node that has an owner in the project graph. This rule checks each project node metadata to make sure that each project has some owner defined. +The `@nx/conformance:ensure-owners` rule provides us an example of how to write a rule that reports on a project being in violation of the rule. The `@nx/owners` plugin adds an `owners` metadata property to every project node that has an owner in the project graph. This rule checks each project node metadata to make sure that each project has some owner defined. ```ts import { ProjectGraphProjectNode } from '@nx/devkit'; -import { createConformanceRule, ProjectViolation } from '@nx/conformance'; +import { createConformanceRule, ConformanceViolation } from '@nx/conformance'; export default createConformanceRule({ name: 'ensure-owners', category: 'consistency', description: 'Ensure that all projects have owners defined via Nx Owners.', - reporter: 'project-reporter', implementation: async (context) => { - const violations: ProjectViolation[] = []; + const violations: ConformanceViolation[] = []; for (const node of Object.values( context.projectGraph.nodes @@ -110,12 +107,12 @@ export default createConformanceRule({ ``` {% /tab %} -{% tab label="project-files-reporter" %} +{% tab label="file violation" %} This rule uses TypeScript AST processing to ensure that `index.ts` files use a client-side style of export syntax and `server.ts` files use a server-side style of export syntax. ```ts -import { createConformanceRule, ProjectFilesViolation } from '@nx/conformance'; +import { createConformanceRule, ConformanceViolation } from '@nx/conformance'; import { existsSync, readFileSync } from 'node:fs'; import { join } from 'node:path'; import { @@ -131,9 +128,8 @@ export default createConformanceRule({ name: 'server-client-public-api', category: 'consistency', description: 'Ensure server-only and client-only public APIs are not mixed', - reporter: 'project-files-reporter', implementation: async ({ projectGraph }) => { - const violations: ProjectFilesViolation[] = []; + const violations: ConformanceViolation[] = []; for (const nodeId in projectGraph.nodes) { const node = projectGraph.nodes[nodeId]; @@ -171,7 +167,7 @@ export function processEntryPoint( project: string, style: 'server' | 'client' ) { - const violations: ProjectFilesViolation[] = []; + const violations: ConformanceViolation[] = []; const sf = createSourceFile( entryPoint, @@ -246,42 +242,30 @@ function isModuleSpecifierViolated( ``` {% /tab %} -{% tab label="non-project-files-reporter" %} +{% tab label="workspace violation" %} -This rule checks the root `package.json` file and ensures that if the `tmp` package is included as a dependency, it has a minimum version of 0.2.3. +This rule checks to see if there is a root README.md file in the workspace, and if there is not, it reports on the workspace itself. ```ts -import { readJsonFile, workspaceRoot } from '@nx/devkit'; -import { - createConformanceRule, - NonProjectFilesViolation, -} from '@nx/conformance'; +import { workspaceRoot } from '@nx/devkit'; +import { createConformanceRule, ConformanceViolation } from '@nx/conformance'; import { join } from 'node:path'; -import { satisfies } from 'semver'; +import { existsSync } from 'node:fs'; export default createConformanceRule({ - name: 'package-tmp-0.2.3', + name: 'readme-file', category: 'maintainability', - description: 'The tmp dependency should be a minimum version of 0.2.3', - reporter: 'non-project-files-reporter', + description: 'The workspace should have a root README.md file', implementation: async () => { - const violations: NonProjectFilesViolation[] = []; - const applyViolationIfApplicable = (version: string | undefined) => { - if (version && !satisfies(version, '>=0.2.3')) { - violations.push({ - message: 'The "tmp" package must be version "0.2.3" or higher', - file: 'package.json', - }); - } - }; + const violations: ConformanceViolation[] = []; - const workspaceRootPackageJson = await readJsonFile( - join(workspaceRoot, 'package.json') - ); - applyViolationIfApplicable(workspaceRootPackageJson.dependencies?.['tmp']); - applyViolationIfApplicable( - workspaceRootPackageJson.devDependencies?.['tmp'] - ); + const readmePath = join(workspaceRoot, 'README.md'); + if (!existsSync(readmePath)) { + violations.push({ + message: 'The workspace should have a root README.md file', + workspaceViolation: true, + }); + } return { severity: 'low', diff --git a/docs/external-generated/packages/conformance/documents/overview.md b/docs/external-generated/packages/conformance/documents/overview.md index c2fb4e43d7..3bc0b205f8 100644 --- a/docs/external-generated/packages/conformance/documents/overview.md +++ b/docs/external-generated/packages/conformance/documents/overview.md @@ -3,6 +3,8 @@ title: Overview of the Nx powerpack-conformance Plugin description: The Nx Powerpack Conformance plugin provides the ability to write and apply rules for your workspace --- +# @nx/conformance + The `@nx/conformance` plugin allows [Nx Powerpack](/powerpack) users to write and apply rules for your entire workspace that help with **consistency**, **maintainability**, **reliability** and **security**. The conformance plugin allows you to encode your own organization's standards so that they can be enforced automatically. Conformance rules can also complement linting tools by enforcing that those tools are configured in the recommended way. The rules are written in TypeScript but can be applied to any language in the codebase or focus entirely on configuration files. diff --git a/docs/external-generated/packages/conformance/generators/create-rule.json b/docs/external-generated/packages/conformance/generators/create-rule.json index 2669192c4d..59c6922c5b 100644 --- a/docs/external-generated/packages/conformance/generators/create-rule.json +++ b/docs/external-generated/packages/conformance/generators/create-rule.json @@ -28,17 +28,6 @@ "x-prompt": "What category does this rule belong to?", "x-priority": "important" }, - "reporter": { - "type": "string", - "enum": [ - "project-reporter", - "project-files-reporter", - "non-project-files-reporter" - ], - "description": "The reporter of the rule.", - "x-prompt": "What reporter do you want to use for this rule?", - "x-priority": "important" - }, "description": { "type": "string", "description": "The description of the rule.", @@ -47,7 +36,7 @@ } }, "additionalProperties": false, - "required": ["name", "directory", "category", "reporter"], + "required": ["name", "directory", "category"], "presets": [] }, "description": "Create a new conformance rule", diff --git a/docs/external-generated/packages/conformance/generators/preset.json b/docs/external-generated/packages/conformance/generators/preset.json new file mode 100644 index 0000000000..1dd28ccc3e --- /dev/null +++ b/docs/external-generated/packages/conformance/generators/preset.json @@ -0,0 +1,19 @@ +{ + "name": "preset", + "factory": "./src/generators/preset/preset", + "schema": { + "$schema": "http://json-schema.org/schema", + "id": "NxPowerpackConformancePreset", + "title": "Nx workspace preset which includes a working conformance rule", + "type": "object", + "properties": {}, + "required": [], + "presets": [] + }, + "description": "Nx workspace preset which includes a working conformance rule", + "implementation": "/libs/nx-packages/conformance/src/generators/preset/preset.ts", + "aliases": [], + "hidden": false, + "path": "/libs/nx-packages/conformance/src/generators/preset/schema.json", + "type": "generator" +} diff --git a/docs/external-generated/packages/gcs-cache/documents/overview.md b/docs/external-generated/packages/gcs-cache/documents/overview.md index bd39e88874..1db60fc379 100644 --- a/docs/external-generated/packages/gcs-cache/documents/overview.md +++ b/docs/external-generated/packages/gcs-cache/documents/overview.md @@ -3,6 +3,8 @@ title: Overview of the Nx GCS Cache Plugin description: The @nx/gcs-cache plugin enables you to use Google Cloud Storage to host your remote cache for efficient build caching across your team. --- +# @nx/gcs-cache + The `@nx/gcs-cache` plugin enables you to self-host your remote cache on [Google Cloud Storage](https://cloud.google.com/storage). {% callout type="deepdive" title="Free managed remote cache with Nx Cloud" %} @@ -15,9 +17,9 @@ If you are an enterprise and **data privacy and security is a concern**, [reach {% /callout %} -{% callout type="info" title="Self-hosted caching is now free" %} +{% callout type="warning" title="Bucket-based caches are vulnerable to poisoning and often prohibited in organizations" %} -Self-hosted caching is **now free for everyone** to use. +CREEP (CVE-2025-36852) is a critical vulnerability in bucket-based self-hosted remote caches. It lets attackers with PR access poison production builds via a race condition during artifact creation—before security checks can catch it. [Learn more](/blog/cve-2025-36852-critical-cache-poisoning-vulnerability-creep) {% /callout %} diff --git a/docs/external-generated/packages/owners/documents/overview.md b/docs/external-generated/packages/owners/documents/overview.md index 3542553d14..1e95033ead 100644 --- a/docs/external-generated/packages/owners/documents/overview.md +++ b/docs/external-generated/packages/owners/documents/overview.md @@ -3,6 +3,8 @@ title: Overview of the Nx powerpack-owners Plugin description: The Nx Powerpack Owners plugin provides the ability to define code ownership based on projects in addition to files --- +# @nx/owners + The `@nx/owners` plugin extends the CODEOWNERS functionality to allow you to define code ownership based on projects in addition to the standard file-based definitions. It leverages the [`nx sync`](/concepts/sync-generators) command to compile `owners` configuration settings from `nx.json` and project configuration files into valid CODEOWNERS files for [GitHub](https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-code-owners), [Bitbucket](https://support.atlassian.com/bitbucket-cloud/docs/set-up-and-use-code-owners/) or [GitLab](https://docs.gitlab.com/ee/user/project/codeowners/). With this plugin, you can specify code ownership using the same project matcher syntax as [`nx run-many`](/reference/core-api/nx/documents/run-many#examples). This allows you to easily define rules for multiple projects that may not be located in the same directory. Also, the CODEOWNERS rules will not need to be revisited if a project location is changed or a new project is added. diff --git a/docs/external-generated/packages/s3-cache/documents/overview.md b/docs/external-generated/packages/s3-cache/documents/overview.md index d669510042..9833e70403 100644 --- a/docs/external-generated/packages/s3-cache/documents/overview.md +++ b/docs/external-generated/packages/s3-cache/documents/overview.md @@ -3,6 +3,8 @@ title: Overview of the Nx S3 Cache Plugin description: The @nx/s3-cache plugin enables you to use an Amazon S3 bucket to host your remote cache for efficient build caching across your team. --- +# @nx/s3-cache + The `@nx/s3-cache` plugin enables you to self-host your remote cache on an [Amazon S3](https://aws.amazon.com/s3) bucket. {% callout type="deepdive" title="Free managed remote cache with Nx Cloud" %} @@ -14,9 +16,9 @@ If you are an enterprise and **data privacy and security is a concern**, [reach **Are you an OSS project?** Nx Cloud is free for OSS. [Reach out here](/pricing#oss). {% /callout %} -{% callout type="info" title="Self-hosted caching is now free" %} +{% callout type="warning" title="Bucket-based caches are vulnerable to poisoning and often prohibited in organizations" %} -Self-hosted caching is **now free for everyone** to use. +CREEP (CVE-2025-36852) is a critical vulnerability in bucket-based self-hosted remote caches. It lets attackers with PR access poison production builds via a race condition during artifact creation—before security checks can catch it. [Learn more](/blog/cve-2025-36852-critical-cache-poisoning-vulnerability-creep) {% /callout %} diff --git a/docs/external-generated/packages/shared-fs-cache/documents/overview.md b/docs/external-generated/packages/shared-fs-cache/documents/overview.md index f5b7ef6cd8..2ec5f993d5 100644 --- a/docs/external-generated/packages/shared-fs-cache/documents/overview.md +++ b/docs/external-generated/packages/shared-fs-cache/documents/overview.md @@ -3,11 +3,9 @@ title: Overview of the Nx Shared File System Cache Plugin description: The @nx/shared-fs-cache plugin enables you to use a shared file system directory to host your remote cache for efficient build caching across your team. --- -The `@nx/shared-fs-cache` plugin enables you to host your remote cache on a shared file system directory. While you're responsible for implementing the actual directory sharing mechanism, the plugin configures Nx to read from both your local cache and the shared directory. +# @nx/shared-fs-cache -{% callout type="warning" title="Potential Cache Poisoning" %} -Using a shared file system folder for remote caching introduces the risk of [cache poisoning](/troubleshooting/unknown-local-cache). To mitigate this risk, consider using [Nx Replay](/ci/features/remote-cache) instead. -{% /callout %} +The `@nx/shared-fs-cache` plugin enables you to host your remote cache on a shared file system directory. While you're responsible for implementing the actual directory sharing mechanism, the plugin configures Nx to read from both your local cache and the shared directory. {% callout type="deepdive" title="Free managed remote cache with Nx Cloud" %} @@ -19,9 +17,9 @@ If you are an enterprise and **data privacy and security is a concern**, [reach {% /callout %} -{% callout type="info" title="Self-hosted caching is now free" %} +{% callout type="warning" title="Bucket-based caches are vulnerable to poisoning and often prohibited in organizations" %} -Self-hosted caching is **now free for everyone** to use. +CREEP (CVE-2025-36852) is a critical vulnerability in bucket-based self-hosted remote caches. It lets attackers with PR access poison production builds via a race condition during artifact creation—before security checks can catch it. [Learn more](/blog/cve-2025-36852-critical-cache-poisoning-vulnerability-creep) {% /callout %} diff --git a/docs/generated/manifests/menus.json b/docs/generated/manifests/menus.json index 5aae8ec520..f765e4092f 100644 --- a/docs/generated/manifests/menus.json +++ b/docs/generated/manifests/menus.json @@ -5944,6 +5944,14 @@ "children": [], "isExternal": false, "disableCollapsible": false + }, + { + "id": "preset", + "path": "/reference/core-api/conformance/generators/preset", + "name": "preset", + "children": [], + "isExternal": false, + "disableCollapsible": false } ], "isExternal": false, diff --git a/docs/generated/manifests/new-nx-api.json b/docs/generated/manifests/new-nx-api.json index 6e622f49b9..f162831bf9 100644 --- a/docs/generated/manifests/new-nx-api.json +++ b/docs/generated/manifests/new-nx-api.json @@ -5577,6 +5577,15 @@ "originalFilePath": "/libs/nx-packages/conformance/src/generators/create-rule/schema.json", "path": "/reference/core-api/conformance/generators/create-rule", "type": "generator" + }, + "/reference/core-api/conformance/generators/preset": { + "description": "Nx workspace preset which includes a working conformance rule", + "file": "external-generated/packages/conformance/generators/preset.json", + "hidden": false, + "name": "preset", + "originalFilePath": "/libs/nx-packages/conformance/src/generators/preset/schema.json", + "path": "/reference/core-api/conformance/generators/preset", + "type": "generator" } }, "migrations": {}, diff --git a/docs/shared/packages/conformance/create-conformance-rule.md b/docs/shared/packages/conformance/create-conformance-rule.md index 3ac33a858a..f8833024a0 100644 --- a/docs/shared/packages/conformance/create-conformance-rule.md +++ b/docs/shared/packages/conformance/create-conformance-rule.md @@ -17,7 +17,6 @@ To write your own conformance rule, run the `@nx/conformance:create-rule` genera ✔ What is the name of the rule? · local-conformance-rule-example ✔ Which directory do you want to create the rule directory in? · packages/my-plugin/local-conformance-rule ✔ What category does this rule belong to? · security -✔ What reporter do you want to use for this rule? · project-reporter ✔ What is the description of the rule? · an example of a conformance rule CREATE packages/my-plugin/local-conformance-rule/local-conformance-rule-example/index.ts CREATE packages/my-plugin/local-conformance-rule/local-conformance-rule-example/schema.json @@ -26,15 +25,14 @@ CREATE packages/my-plugin/local-conformance-rule/local-conformance-rule-example/ The generated rule definition file should look like this: ```ts {% fileName="packages/my-plugin/local-conformance-rule/index.ts" %} -import { createConformanceRule, ProjectViolation } from '@nx/conformance'; +import { createConformanceRule, ConformanceViolation } from '@nx/conformance'; export default createConformanceRule({ name: 'local-conformance-rule-example', category: 'security', description: 'an example of a conformance rule', - reporter: 'project-reporter', implementation: async (context) => { - const violations: ProjectViolation[] = []; + const violations: ConformanceViolation[] = []; return { severity: 'low', @@ -64,28 +62,27 @@ Note that the severity of the error is defined by the rule author and can be adj ## Conformance Rule Examples -There are three types of reporters that a rule can use. +Rules should report on the most specific thing that is in violation of the rule. They can report on one or more of the following things within a workspace: -- `project-reporter` - The rule evaluates an entire project at a time. -- `project-files-reporter` - The rule evaluates a single project file at a time. -- `non-project-files-reporter` - The rule evaluates files that don't belong to any project. +- file - The rule reports on a particular file being in violation of the rule. +- project - The rule reports on a particular project being in violation of the rule, because no one file within it would be applicable to flag up. +- the workspace itself - Sometimes there is no specific file or project that is most applicable to flag up, so the rule can report on the workspace itself. {% tabs %} -{% tab label="project-reporter" %} +{% tab label="project violation" %} -The `@nx/conformance:ensure-owners` rule provides us an example of how to write a `project-reporter` rule. The `@nx/owners` plugin adds an `owners` metadata property to every project node that has an owner in the project graph. This rule checks each project node metadata to make sure that each project has some owner defined. +The `@nx/conformance:ensure-owners` rule provides us an example of how to write a rule that reports on a project being in violation of the rule. The `@nx/owners` plugin adds an `owners` metadata property to every project node that has an owner in the project graph. This rule checks each project node metadata to make sure that each project has some owner defined. ```ts import { ProjectGraphProjectNode } from '@nx/devkit'; -import { createConformanceRule, ProjectViolation } from '@nx/conformance'; +import { createConformanceRule, ConformanceViolation } from '@nx/conformance'; export default createConformanceRule({ name: 'ensure-owners', category: 'consistency', description: 'Ensure that all projects have owners defined via Nx Owners.', - reporter: 'project-reporter', implementation: async (context) => { - const violations: ProjectViolation[] = []; + const violations: ConformanceViolation[] = []; for (const node of Object.values( context.projectGraph.nodes @@ -110,12 +107,12 @@ export default createConformanceRule({ ``` {% /tab %} -{% tab label="project-files-reporter" %} +{% tab label="file violation" %} This rule uses TypeScript AST processing to ensure that `index.ts` files use a client-side style of export syntax and `server.ts` files use a server-side style of export syntax. ```ts -import { createConformanceRule, ProjectFilesViolation } from '@nx/conformance'; +import { createConformanceRule, ConformanceViolation } from '@nx/conformance'; import { existsSync, readFileSync } from 'node:fs'; import { join } from 'node:path'; import { @@ -131,9 +128,8 @@ export default createConformanceRule({ name: 'server-client-public-api', category: 'consistency', description: 'Ensure server-only and client-only public APIs are not mixed', - reporter: 'project-files-reporter', implementation: async ({ projectGraph }) => { - const violations: ProjectFilesViolation[] = []; + const violations: ConformanceViolation[] = []; for (const nodeId in projectGraph.nodes) { const node = projectGraph.nodes[nodeId]; @@ -171,7 +167,7 @@ export function processEntryPoint( project: string, style: 'server' | 'client' ) { - const violations: ProjectFilesViolation[] = []; + const violations: ConformanceViolation[] = []; const sf = createSourceFile( entryPoint, @@ -246,42 +242,30 @@ function isModuleSpecifierViolated( ``` {% /tab %} -{% tab label="non-project-files-reporter" %} +{% tab label="workspace violation" %} -This rule checks the root `package.json` file and ensures that if the `tmp` package is included as a dependency, it has a minimum version of 0.2.3. +This rule checks to see if there is a root README.md file in the workspace, and if there is not, it reports on the workspace itself. ```ts -import { readJsonFile, workspaceRoot } from '@nx/devkit'; -import { - createConformanceRule, - NonProjectFilesViolation, -} from '@nx/conformance'; +import { workspaceRoot } from '@nx/devkit'; +import { createConformanceRule, ConformanceViolation } from '@nx/conformance'; import { join } from 'node:path'; -import { satisfies } from 'semver'; +import { existsSync } from 'node:fs'; export default createConformanceRule({ - name: 'package-tmp-0.2.3', + name: 'readme-file', category: 'maintainability', - description: 'The tmp dependency should be a minimum version of 0.2.3', - reporter: 'non-project-files-reporter', + description: 'The workspace should have a root README.md file', implementation: async () => { - const violations: NonProjectFilesViolation[] = []; - const applyViolationIfApplicable = (version: string | undefined) => { - if (version && !satisfies(version, '>=0.2.3')) { - violations.push({ - message: 'The "tmp" package must be version "0.2.3" or higher', - file: 'package.json', - }); - } - }; + const violations: ConformanceViolation[] = []; - const workspaceRootPackageJson = await readJsonFile( - join(workspaceRoot, 'package.json') - ); - applyViolationIfApplicable(workspaceRootPackageJson.dependencies?.['tmp']); - applyViolationIfApplicable( - workspaceRootPackageJson.devDependencies?.['tmp'] - ); + const readmePath = join(workspaceRoot, 'README.md'); + if (!existsSync(readmePath)) { + violations.push({ + message: 'The workspace should have a root README.md file', + workspaceViolation: true, + }); + } return { severity: 'low', diff --git a/docs/shared/packages/s3-cache/s3-cache-plugin.md b/docs/shared/packages/s3-cache/s3-cache-plugin.md index 6232fe8964..9833e70403 100644 --- a/docs/shared/packages/s3-cache/s3-cache-plugin.md +++ b/docs/shared/packages/s3-cache/s3-cache-plugin.md @@ -158,7 +158,7 @@ Below is an example on how to connect to MinIO: "forcePathStyle": true, "accessKeyId": "abc1234", "secretAccessKey": "4321cba", - "disableChecksum: true + "disableChecksum": true } } ``` diff --git a/docs/shared/reference/sitemap.md b/docs/shared/reference/sitemap.md index 6ec7c02d25..c8fefe25f6 100644 --- a/docs/shared/reference/sitemap.md +++ b/docs/shared/reference/sitemap.md @@ -719,6 +719,7 @@ - [bundle-rules](/reference/core-api/conformance/executors/bundle-rules) - [generators](/reference/core-api/conformance/generators) - [create-rule](/reference/core-api/conformance/generators/create-rule) + - [preset](/reference/core-api/conformance/generators/preset) - [azure-cache](/reference/core-api/azure-cache) - [Overview](/reference/core-api/azure-cache/overview) - [gcs-cache](/reference/core-api/gcs-cache) diff --git a/package.json b/package.json index 511b148c78..142aca8a3a 100644 --- a/package.json +++ b/package.json @@ -80,20 +80,20 @@ "@nuxt/kit": "^3.10.0", "@nuxt/schema": "^3.10.0", "@nx/angular": "21.2.0-beta.4", - "@nx/conformance": "2.0.1", + "@nx/conformance": "3.0.0", "@nx/cypress": "21.2.0-beta.4", "@nx/devkit": "21.2.0-beta.4", - "@nx/enterprise-cloud": "2.0.1", + "@nx/enterprise-cloud": "3.0.0", "@nx/esbuild": "21.2.0-beta.4", "@nx/eslint": "21.2.0-beta.4", "@nx/eslint-plugin": "21.2.0-beta.4", "@nx/gradle": "21.2.0-beta.4", "@nx/jest": "21.2.0-beta.4", "@nx/js": "21.2.0-beta.4", - "@nx/key": "2.0.1", + "@nx/key": "3.0.0", "@nx/next": "21.2.0-beta.4", "@nx/playwright": "21.2.0-beta.4", - "@nx/powerpack-license": "2.0.1", + "@nx/powerpack-license": "3.0.0", "@nx/react": "21.2.0-beta.4", "@nx/rsbuild": "21.2.0-beta.4", "@nx/rspack": "21.2.0-beta.4", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 29c605c89f..79c69fdcf4 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -328,8 +328,8 @@ importers: specifier: 21.2.0-beta.4 version: 21.2.0-beta.4(42a8a72230adc94556bc5d96e7eba89b) '@nx/conformance': - specifier: 2.0.1 - version: 2.0.1(@nx/js@21.2.0-beta.4(@babel/traverse@7.27.1)(@swc-node/register@1.9.1(@swc/core@1.5.7(@swc/helpers@0.5.11))(@swc/types@0.1.21)(typescript@5.8.3))(@swc/core@1.5.7(@swc/helpers@0.5.11))(nx@21.2.0-beta.4(@swc-node/register@1.9.1(@swc/core@1.5.7(@swc/helpers@0.5.11))(@swc/types@0.1.21)(typescript@5.8.3))(@swc/core@1.5.7(@swc/helpers@0.5.11)))(verdaccio@6.0.5(encoding@0.1.13)(typanion@3.14.0)))(nx@21.2.0-beta.4(@swc-node/register@1.9.1(@swc/core@1.5.7(@swc/helpers@0.5.11))(@swc/types@0.1.21)(typescript@5.8.3))(@swc/core@1.5.7(@swc/helpers@0.5.11))) + specifier: 3.0.0 + version: 3.0.0(@nx/js@21.2.0-beta.4(@babel/traverse@7.27.1)(@swc-node/register@1.9.1(@swc/core@1.5.7(@swc/helpers@0.5.11))(@swc/types@0.1.21)(typescript@5.8.3))(@swc/core@1.5.7(@swc/helpers@0.5.11))(nx@21.2.0-beta.4(@swc-node/register@1.9.1(@swc/core@1.5.7(@swc/helpers@0.5.11))(@swc/types@0.1.21)(typescript@5.8.3))(@swc/core@1.5.7(@swc/helpers@0.5.11)))(verdaccio@6.0.5(encoding@0.1.13)(typanion@3.14.0)))(nx@21.2.0-beta.4(@swc-node/register@1.9.1(@swc/core@1.5.7(@swc/helpers@0.5.11))(@swc/types@0.1.21)(typescript@5.8.3))(@swc/core@1.5.7(@swc/helpers@0.5.11))) '@nx/cypress': specifier: 21.2.0-beta.4 version: 21.2.0-beta.4(@babel/traverse@7.27.1)(@swc-node/register@1.9.1(@swc/core@1.5.7(@swc/helpers@0.5.11))(@swc/types@0.1.21)(typescript@5.8.3))(@swc/core@1.5.7(@swc/helpers@0.5.11))(@zkochan/js-yaml@0.0.7)(cypress@14.3.0)(eslint@8.57.0)(nx@21.2.0-beta.4(@swc-node/register@1.9.1(@swc/core@1.5.7(@swc/helpers@0.5.11))(@swc/types@0.1.21)(typescript@5.8.3))(@swc/core@1.5.7(@swc/helpers@0.5.11)))(typescript@5.8.3)(verdaccio@6.0.5(encoding@0.1.13)(typanion@3.14.0)) @@ -337,8 +337,8 @@ importers: specifier: 21.2.0-beta.4 version: 21.2.0-beta.4(nx@21.2.0-beta.4(@swc-node/register@1.9.1(@swc/core@1.5.7(@swc/helpers@0.5.11))(@swc/types@0.1.21)(typescript@5.8.3))(@swc/core@1.5.7(@swc/helpers@0.5.11))) '@nx/enterprise-cloud': - specifier: 2.0.1 - version: 2.0.1(nx@21.2.0-beta.4(@swc-node/register@1.9.1(@swc/core@1.5.7(@swc/helpers@0.5.11))(@swc/types@0.1.21)(typescript@5.8.3))(@swc/core@1.5.7(@swc/helpers@0.5.11))) + specifier: 3.0.0 + version: 3.0.0(nx@21.2.0-beta.4(@swc-node/register@1.9.1(@swc/core@1.5.7(@swc/helpers@0.5.11))(@swc/types@0.1.21)(typescript@5.8.3))(@swc/core@1.5.7(@swc/helpers@0.5.11))) '@nx/esbuild': specifier: 21.2.0-beta.4 version: 21.2.0-beta.4(@babel/traverse@7.27.1)(@swc-node/register@1.9.1(@swc/core@1.5.7(@swc/helpers@0.5.11))(@swc/types@0.1.21)(typescript@5.8.3))(@swc/core@1.5.7(@swc/helpers@0.5.11))(esbuild@0.25.0)(nx@21.2.0-beta.4(@swc-node/register@1.9.1(@swc/core@1.5.7(@swc/helpers@0.5.11))(@swc/types@0.1.21)(typescript@5.8.3))(@swc/core@1.5.7(@swc/helpers@0.5.11)))(verdaccio@6.0.5(encoding@0.1.13)(typanion@3.14.0)) @@ -358,8 +358,8 @@ importers: specifier: 21.2.0-beta.4 version: 21.2.0-beta.4(@babel/traverse@7.27.1)(@swc-node/register@1.9.1(@swc/core@1.5.7(@swc/helpers@0.5.11))(@swc/types@0.1.21)(typescript@5.8.3))(@swc/core@1.5.7(@swc/helpers@0.5.11))(nx@21.2.0-beta.4(@swc-node/register@1.9.1(@swc/core@1.5.7(@swc/helpers@0.5.11))(@swc/types@0.1.21)(typescript@5.8.3))(@swc/core@1.5.7(@swc/helpers@0.5.11)))(verdaccio@6.0.5(encoding@0.1.13)(typanion@3.14.0)) '@nx/key': - specifier: 2.0.1 - version: 2.0.1 + specifier: 3.0.0 + version: 3.0.0 '@nx/next': specifier: 21.2.0-beta.4 version: 21.2.0-beta.4(@babel/core@7.25.2)(@babel/traverse@7.27.1)(@rspack/core@1.3.9(@swc/helpers@0.5.11))(@swc-node/register@1.9.1(@swc/core@1.5.7(@swc/helpers@0.5.11))(@swc/types@0.1.21)(typescript@5.8.3))(@swc/core@1.5.7(@swc/helpers@0.5.11))(@swc/helpers@0.5.11)(@zkochan/js-yaml@0.0.7)(bufferutil@4.0.7)(esbuild@0.25.0)(eslint@8.57.0)(html-webpack-plugin@5.5.0(webpack@5.99.8))(next@14.2.28(@babel/core@7.25.2)(@opentelemetry/api@1.9.0)(@playwright/test@1.47.1)(babel-plugin-macros@3.1.0)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(sass@1.55.0))(nx@21.2.0-beta.4(@swc-node/register@1.9.1(@swc/core@1.5.7(@swc/helpers@0.5.11))(@swc/types@0.1.21)(typescript@5.8.3))(@swc/core@1.5.7(@swc/helpers@0.5.11)))(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(typescript@5.8.3)(verdaccio@6.0.5(encoding@0.1.13)(typanion@3.14.0))(webpack-cli@5.1.4)(webpack@5.99.8) @@ -367,8 +367,8 @@ importers: specifier: 21.2.0-beta.4 version: 21.2.0-beta.4(@babel/traverse@7.27.1)(@playwright/test@1.47.1)(@swc-node/register@1.9.1(@swc/core@1.5.7(@swc/helpers@0.5.11))(@swc/types@0.1.21)(typescript@5.8.3))(@swc/core@1.5.7(@swc/helpers@0.5.11))(@zkochan/js-yaml@0.0.7)(eslint@8.57.0)(nx@21.2.0-beta.4(@swc-node/register@1.9.1(@swc/core@1.5.7(@swc/helpers@0.5.11))(@swc/types@0.1.21)(typescript@5.8.3))(@swc/core@1.5.7(@swc/helpers@0.5.11)))(typescript@5.8.3)(verdaccio@6.0.5(encoding@0.1.13)(typanion@3.14.0)) '@nx/powerpack-license': - specifier: 2.0.1 - version: 2.0.1 + specifier: 3.0.0 + version: 3.0.0 '@nx/react': specifier: 21.2.0-beta.4 version: 21.2.0-beta.4(@babel/traverse@7.27.1)(@swc-node/register@1.9.1(@swc/core@1.5.7(@swc/helpers@0.5.11))(@swc/types@0.1.21)(typescript@5.8.3))(@swc/core@1.5.7(@swc/helpers@0.5.11))(@swc/helpers@0.5.11)(@zkochan/js-yaml@0.0.7)(bufferutil@4.0.7)(esbuild@0.25.0)(eslint@8.57.0)(next@14.2.28(@babel/core@7.25.2)(@opentelemetry/api@1.9.0)(@playwright/test@1.47.1)(babel-plugin-macros@3.1.0)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(sass@1.55.0))(nx@21.2.0-beta.4(@swc-node/register@1.9.1(@swc/core@1.5.7(@swc/helpers@0.5.11))(@swc/types@0.1.21)(typescript@5.8.3))(@swc/core@1.5.7(@swc/helpers@0.5.11)))(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(typescript@5.8.3)(verdaccio@6.0.5(encoding@0.1.13)(typanion@3.14.0))(webpack-cli@5.1.4)(webpack@5.99.8) @@ -5725,8 +5725,8 @@ packages: ng-packagr: optional: true - '@nx/conformance@2.0.1': - resolution: {integrity: sha512-4yx/mz2+YEe6Clh8E3g3Y0+DJ6h1kpC9h0ZQPY3u3JRnAVlOvUWjr203aeYgJ4bL4c8xYC4LsTBC98Wj6spQhg==} + '@nx/conformance@3.0.0': + resolution: {integrity: sha512-GojZtOwWjojqIM9oAmvsPRhbprtlOFgY0/fbjdjymuJJ3SBl5eY9LGFHavGoIvyCPOsQeG3mGo+qxw3rlaXZQg==} hasBin: true peerDependencies: '@nx/js': '>= 18 < 22' @@ -5755,8 +5755,8 @@ packages: peerDependencies: nx: 21.2.0-beta.4 - '@nx/enterprise-cloud@2.0.1': - resolution: {integrity: sha512-w5N/IoQ/AZquN7Q/hMt7b05z3wwQGys6QqO8BjyegW9wL8DTvtHwfMNSQRnX9UXjWk2PlRg/MfSjwflssAgS0g==} + '@nx/enterprise-cloud@3.0.0': + resolution: {integrity: sha512-e28NeMB6UPrYjdgTZqtaVkB9edt/OL7OAPnrs343ZOmJQCIVax39xR+bPFiymuTIDdWqm8mbYPbiCo6xlW+PCg==} peerDependencies: nx: '>= 18 < 22' @@ -5809,62 +5809,62 @@ packages: verdaccio: optional: true - '@nx/key-darwin-arm64@2.0.1': - resolution: {integrity: sha512-yf+0nT+TggktJ5sfMXmWR5hFX+aC9sFO12Wbv/7dxCqQESWjpXIOdN0Z+F0c3RH77X7zivK4kfiwGXslOas6hA==} + '@nx/key-darwin-arm64@3.0.0': + resolution: {integrity: sha512-oVb9RqCqtrUXmPxKrum8FwW5GHv/DgxE1MXOBQUt8eEsO9NOBN3t80SyIvrlUPrd5hNIxXPz4IRA9Fl5+9ZMAA==} engines: {node: '>= 10'} cpu: [arm64] os: [darwin] - '@nx/key-darwin-x64@2.0.1': - resolution: {integrity: sha512-LvhVx7CQkDOssvnE1Zq20gq5gXjuzL4SjRr24tv/AssAlOiNAyeGxos+2Maaxhm2DyXv+2p3+YUWEJDXEYeWmQ==} + '@nx/key-darwin-x64@3.0.0': + resolution: {integrity: sha512-eMV1Nkb4+/k7/qjPuLFjgQriSyupphWHrf+Wc5nD41G8j+Nf7SVYliiQ8Bl4/pgxr7TxCXw0vFa5FsYcIHdOzQ==} engines: {node: '>= 10'} cpu: [x64] os: [darwin] - '@nx/key-linux-arm-gnueabihf@2.0.1': - resolution: {integrity: sha512-Xnl3RHz0Wf/oRwem2T4svnpvz74om7Dfv2hYHJv7Bddb00xCBKWZjNhUCKaTZk7cqgzOVGb30dsagb1LmLHZhA==} + '@nx/key-linux-arm-gnueabihf@3.0.0': + resolution: {integrity: sha512-Ra8dsogoCyxM8W/QrLuRR4O4gU/bcFPnnzhIeQ6mTfnEtGQlqZFBDVWSjjJKVoRzwtAnruJX1liDtnUaNUg5yQ==} engines: {node: '>= 10'} cpu: [arm] os: [linux] - '@nx/key-linux-arm64-gnu@2.0.1': - resolution: {integrity: sha512-PEYGlTupf1SU6s9XSNgJCtWClS6V8iG8KtNtgWU4mk/7mu4VYrAnBlwX0i4OyLY89cAiR0rIV0dvQd0UgLSwFw==} + '@nx/key-linux-arm64-gnu@3.0.0': + resolution: {integrity: sha512-Wrg4CYfLIQB8wmfX15lDVNeg1ivrh9B+m0eEHq1BjXAVwKuT74B5l8kquKa0GihMY0SdkGCrNCttC3Dgtm/vaQ==} engines: {node: '>= 10'} cpu: [arm64] os: [linux] - '@nx/key-linux-arm64-musl@2.0.1': - resolution: {integrity: sha512-OOLDzCgMaVLiJ7Cw937ClrvRUAMe1Ce3G1GQr7Wvqhd7Z0ylsDfYyjnvbBhmW5HLsDlQg7GHs8reyBZ2s2hrWw==} + '@nx/key-linux-arm64-musl@3.0.0': + resolution: {integrity: sha512-vAlICrMMY5LjzoAN6elAKbkqhfKVki2uqjTF9IPULBX4BZGH8qY0VAhXjwprKkrA4044ND5TI2MIWs3OWQetMA==} engines: {node: '>= 10'} cpu: [arm64] os: [linux] - '@nx/key-linux-x64-gnu@2.0.1': - resolution: {integrity: sha512-HDUCWIJMSxAXpvzf0sJ6wWLe740nhETzq4HfHMxVOmMDL/8YttxLPYcF403RYWH8msXsg7wR9lFreOfMbjgE1w==} + '@nx/key-linux-x64-gnu@3.0.0': + resolution: {integrity: sha512-51gwUYJP3SzTMwVioIXSERs63gaKg7Avlhr84dHPLcM7sABHzHaDfpiD7xl5dlKLn1+2cGETdiShUllBdC/Xvg==} engines: {node: '>= 10'} cpu: [x64] os: [linux] - '@nx/key-linux-x64-musl@2.0.1': - resolution: {integrity: sha512-bUJRmplEp/ukUaUXitcceGltGNafBzXb0tWMTw9DbJlynZK5u5oN6/ByTPLLK175Lu0K9KIyRcoqcPfpb4KCig==} + '@nx/key-linux-x64-musl@3.0.0': + resolution: {integrity: sha512-DG3ecD1gNzEQmE0kSRZcLE7SFY0hFVKgtuNBxuui/OJRgk0HG0yNTqxoNBEfEFKbHIZvKY0Ga2xq3+ELq7tAcQ==} engines: {node: '>= 10'} cpu: [x64] os: [linux] - '@nx/key-win32-arm64-msvc@2.0.1': - resolution: {integrity: sha512-vdwTmHGY3wTBLD2OJiz13rSgs4fgesribLqKahwBltHUZ/i6ZqHgLn3//6Qcu0V/ab++8O79qwj4Zxehr2wRCg==} + '@nx/key-win32-arm64-msvc@3.0.0': + resolution: {integrity: sha512-4KHAnabcyyewMpXEp+SfV/Lwn4pmHZu1idg6vipIpI+wiUHPNS2tEx8cLloVEM08/Bf6O+WW8bqveyz6uNhvNw==} engines: {node: '>= 10'} cpu: [arm64] os: [win32] - '@nx/key-win32-x64-msvc@2.0.1': - resolution: {integrity: sha512-QrCJi6fhvjy6cBwXrhBrzuYtYGTP59WitNATGDytNjgbfrKalCDX3B+tHJPbFbk+GLNgTmtJ4nT5XoMBNwzkfg==} + '@nx/key-win32-x64-msvc@3.0.0': + resolution: {integrity: sha512-Ym5ZEphBiYyDnESgMfAG99jYWqXghPTeOxAp6+FhZ5IB00+sAkIbGqOEx6sMxa+BOyDst8XlUoFsn8+14csi5w==} engines: {node: '>= 10'} cpu: [x64] os: [win32] - '@nx/key@2.0.1': - resolution: {integrity: sha512-Z4odswr+V3ZsW0sGpSzEn8mxPmX0baPcBmKo0QVlhDkaI/fDoHED1NSi80wc41WKk1/l2SILQvXi99eUASkxRA==} + '@nx/key@3.0.0': + resolution: {integrity: sha512-Lz1oDkih4bXVnuXp2vzL4MM5Ep6m+5yyftvB5qD9IAS2cCpqVEDLDwnTkqdOpdz681jtXUCJ5UlZy9yRuGPaww==} engines: {node: '>= 10'} '@nx/module-federation@21.2.0-beta.4': @@ -5933,8 +5933,8 @@ packages: '@playwright/test': optional: true - '@nx/powerpack-license@2.0.1': - resolution: {integrity: sha512-RpZ6geFvmWTb8aHMaDJ/HN6Uf1vpm84iEA8DhF5vmp3S4SbCD4eBk/5vmd4DTqyj+ROPMalRrUwaJDd+/O95dQ==} + '@nx/powerpack-license@3.0.0': + resolution: {integrity: sha512-3/VnpG4RWe8Pw7EDIxPMuMUuiZXYcTjMa4YYtm21NQ8owWlHarJZ9psHjVCshVjkLSq7Z5LjPUDZJbpw+OqHXw==} engines: {node: '>= 10'} '@nx/react@21.2.0-beta.4': @@ -25781,11 +25781,11 @@ snapshots: - vue-tsc - webpack-cli - '@nx/conformance@2.0.1(@nx/js@21.2.0-beta.4(@babel/traverse@7.27.1)(@swc-node/register@1.9.1(@swc/core@1.5.7(@swc/helpers@0.5.11))(@swc/types@0.1.21)(typescript@5.8.3))(@swc/core@1.5.7(@swc/helpers@0.5.11))(nx@21.2.0-beta.4(@swc-node/register@1.9.1(@swc/core@1.5.7(@swc/helpers@0.5.11))(@swc/types@0.1.21)(typescript@5.8.3))(@swc/core@1.5.7(@swc/helpers@0.5.11)))(verdaccio@6.0.5(encoding@0.1.13)(typanion@3.14.0)))(nx@21.2.0-beta.4(@swc-node/register@1.9.1(@swc/core@1.5.7(@swc/helpers@0.5.11))(@swc/types@0.1.21)(typescript@5.8.3))(@swc/core@1.5.7(@swc/helpers@0.5.11)))': + '@nx/conformance@3.0.0(@nx/js@21.2.0-beta.4(@babel/traverse@7.27.1)(@swc-node/register@1.9.1(@swc/core@1.5.7(@swc/helpers@0.5.11))(@swc/types@0.1.21)(typescript@5.8.3))(@swc/core@1.5.7(@swc/helpers@0.5.11))(nx@21.2.0-beta.4(@swc-node/register@1.9.1(@swc/core@1.5.7(@swc/helpers@0.5.11))(@swc/types@0.1.21)(typescript@5.8.3))(@swc/core@1.5.7(@swc/helpers@0.5.11)))(verdaccio@6.0.5(encoding@0.1.13)(typanion@3.14.0)))(nx@21.2.0-beta.4(@swc-node/register@1.9.1(@swc/core@1.5.7(@swc/helpers@0.5.11))(@swc/types@0.1.21)(typescript@5.8.3))(@swc/core@1.5.7(@swc/helpers@0.5.11)))': dependencies: '@nx/devkit': 21.0.0(nx@21.2.0-beta.4(@swc-node/register@1.9.1(@swc/core@1.5.7(@swc/helpers@0.5.11))(@swc/types@0.1.21)(typescript@5.8.3))(@swc/core@1.5.7(@swc/helpers@0.5.11))) '@nx/js': 21.2.0-beta.4(@babel/traverse@7.27.1)(@swc-node/register@1.9.1(@swc/core@1.5.7(@swc/helpers@0.5.11))(@swc/types@0.1.21)(typescript@5.8.3))(@swc/core@1.5.7(@swc/helpers@0.5.11))(nx@21.2.0-beta.4(@swc-node/register@1.9.1(@swc/core@1.5.7(@swc/helpers@0.5.11))(@swc/types@0.1.21)(typescript@5.8.3))(@swc/core@1.5.7(@swc/helpers@0.5.11)))(verdaccio@6.0.5(encoding@0.1.13)(typanion@3.14.0)) - '@nx/key': 2.0.1 + '@nx/key': 3.0.0 ajv: 8.17.1 esbuild: 0.21.5 nx: 21.2.0-beta.4(@swc-node/register@1.9.1(@swc/core@1.5.7(@swc/helpers@0.5.11))(@swc/types@0.1.21)(typescript@5.8.3))(@swc/core@1.5.7(@swc/helpers@0.5.11)) @@ -25855,10 +25855,10 @@ snapshots: tslib: 2.8.1 yargs-parser: 21.1.1 - '@nx/enterprise-cloud@2.0.1(nx@21.2.0-beta.4(@swc-node/register@1.9.1(@swc/core@1.5.7(@swc/helpers@0.5.11))(@swc/types@0.1.21)(typescript@5.8.3))(@swc/core@1.5.7(@swc/helpers@0.5.11)))': + '@nx/enterprise-cloud@3.0.0(nx@21.2.0-beta.4(@swc-node/register@1.9.1(@swc/core@1.5.7(@swc/helpers@0.5.11))(@swc/types@0.1.21)(typescript@5.8.3))(@swc/core@1.5.7(@swc/helpers@0.5.11)))': dependencies: '@nx/devkit': 21.0.0(nx@21.2.0-beta.4(@swc-node/register@1.9.1(@swc/core@1.5.7(@swc/helpers@0.5.11))(@swc/types@0.1.21)(typescript@5.8.3))(@swc/core@1.5.7(@swc/helpers@0.5.11))) - '@nx/key': 2.0.1 + '@nx/key': 3.0.0 nx: 21.2.0-beta.4(@swc-node/register@1.9.1(@swc/core@1.5.7(@swc/helpers@0.5.11))(@swc/types@0.1.21)(typescript@5.8.3))(@swc/core@1.5.7(@swc/helpers@0.5.11)) semver: 7.5.4 transitivePeerDependencies: @@ -26014,34 +26014,34 @@ snapshots: - nx - supports-color - '@nx/key-darwin-arm64@2.0.1': + '@nx/key-darwin-arm64@3.0.0': optional: true - '@nx/key-darwin-x64@2.0.1': + '@nx/key-darwin-x64@3.0.0': optional: true - '@nx/key-linux-arm-gnueabihf@2.0.1': + '@nx/key-linux-arm-gnueabihf@3.0.0': optional: true - '@nx/key-linux-arm64-gnu@2.0.1': + '@nx/key-linux-arm64-gnu@3.0.0': optional: true - '@nx/key-linux-arm64-musl@2.0.1': + '@nx/key-linux-arm64-musl@3.0.0': optional: true - '@nx/key-linux-x64-gnu@2.0.1': + '@nx/key-linux-x64-gnu@3.0.0': optional: true - '@nx/key-linux-x64-musl@2.0.1': + '@nx/key-linux-x64-musl@3.0.0': optional: true - '@nx/key-win32-arm64-msvc@2.0.1': + '@nx/key-win32-arm64-msvc@3.0.0': optional: true - '@nx/key-win32-x64-msvc@2.0.1': + '@nx/key-win32-x64-msvc@3.0.0': optional: true - '@nx/key@2.0.1': + '@nx/key@3.0.0': dependencies: '@napi-rs/wasm-runtime': 0.2.4 axios: 1.8.3 @@ -26050,15 +26050,15 @@ snapshots: enquirer: 2.4.1 ora: 5.4.1 optionalDependencies: - '@nx/key-darwin-arm64': 2.0.1 - '@nx/key-darwin-x64': 2.0.1 - '@nx/key-linux-arm-gnueabihf': 2.0.1 - '@nx/key-linux-arm64-gnu': 2.0.1 - '@nx/key-linux-arm64-musl': 2.0.1 - '@nx/key-linux-x64-gnu': 2.0.1 - '@nx/key-linux-x64-musl': 2.0.1 - '@nx/key-win32-arm64-msvc': 2.0.1 - '@nx/key-win32-x64-msvc': 2.0.1 + '@nx/key-darwin-arm64': 3.0.0 + '@nx/key-darwin-x64': 3.0.0 + '@nx/key-linux-arm-gnueabihf': 3.0.0 + '@nx/key-linux-arm64-gnu': 3.0.0 + '@nx/key-linux-arm64-musl': 3.0.0 + '@nx/key-linux-x64-gnu': 3.0.0 + '@nx/key-linux-x64-musl': 3.0.0 + '@nx/key-win32-arm64-msvc': 3.0.0 + '@nx/key-win32-x64-msvc': 3.0.0 transitivePeerDependencies: - debug @@ -26198,9 +26198,9 @@ snapshots: - typescript - verdaccio - '@nx/powerpack-license@2.0.1': + '@nx/powerpack-license@3.0.0': dependencies: - '@nx/key': 2.0.1 + '@nx/key': 3.0.0 transitivePeerDependencies: - debug diff --git a/tools/workspace-plugin/src/conformance-rules/blog-cover-image/index.ts b/tools/workspace-plugin/src/conformance-rules/blog-cover-image/index.ts index a1080eca9c..68d3b0a686 100644 --- a/tools/workspace-plugin/src/conformance-rules/blog-cover-image/index.ts +++ b/tools/workspace-plugin/src/conformance-rules/blog-cover-image/index.ts @@ -1,22 +1,21 @@ -import { readFileSync, existsSync } from 'node:fs'; -import { join, dirname, basename, extname } from 'node:path'; -import { load as yamlLoad } from 'js-yaml'; -import { workspaceRoot } from '@nx/devkit'; -import { sync as globSync } from 'glob'; import { createConformanceRule, - type ProjectFilesViolation, + type ConformanceViolation, } from '@nx/conformance'; +import { workspaceRoot } from '@nx/devkit'; +import { sync as globSync } from 'glob'; +import { load as yamlLoad } from 'js-yaml'; +import { existsSync, readFileSync } from 'node:fs'; +import { extname, join } from 'node:path'; export default createConformanceRule<{ mdGlobPattern: string }>({ name: 'blog-cover-image', category: 'consistency', description: 'Ensures that blog posts have a cover_image defined in avif or jpg format with appropriate fallbacks', - reporter: 'project-files-reporter', implementation: async ({ projectGraph, ruleOptions }) => { - const violations: ProjectFilesViolation[] = []; - const webinarWarnings: ProjectFilesViolation[] = []; + const violations: ConformanceViolation[] = []; + const webinarWarnings: ConformanceViolation[] = []; const { mdGlobPattern } = ruleOptions; // Look for the docs project diff --git a/tools/workspace-plugin/src/conformance-rules/blog-description/index.ts b/tools/workspace-plugin/src/conformance-rules/blog-description/index.ts index 6e60548671..4250cca19a 100644 --- a/tools/workspace-plugin/src/conformance-rules/blog-description/index.ts +++ b/tools/workspace-plugin/src/conformance-rules/blog-description/index.ts @@ -1,21 +1,20 @@ -import { readFileSync, existsSync } from 'node:fs'; -import { join } from 'node:path'; -import { load as yamlLoad } from 'js-yaml'; -import { workspaceRoot } from '@nx/devkit'; -import { sync as globSync } from 'glob'; import { createConformanceRule, - type ProjectFilesViolation, + type ConformanceViolation, } from '@nx/conformance'; +import { workspaceRoot } from '@nx/devkit'; +import { sync as globSync } from 'glob'; +import { load as yamlLoad } from 'js-yaml'; +import { readFileSync } from 'node:fs'; +import { join } from 'node:path'; export default createConformanceRule<{ mdGlobPattern: string }>({ name: 'blog-description', category: 'consistency', description: 'Ensures that markdown documentation files have a description in their frontmatter', - reporter: 'project-files-reporter', implementation: async ({ projectGraph, ruleOptions }) => { - const violations: ProjectFilesViolation[] = []; + const violations: ConformanceViolation[] = []; const { mdGlobPattern } = ruleOptions; // Look for the docs project diff --git a/tools/workspace-plugin/src/conformance-rules/migration-groups/index.ts b/tools/workspace-plugin/src/conformance-rules/migration-groups/index.ts index e9b6da2192..83c23ac87c 100644 --- a/tools/workspace-plugin/src/conformance-rules/migration-groups/index.ts +++ b/tools/workspace-plugin/src/conformance-rules/migration-groups/index.ts @@ -1,8 +1,8 @@ -import { readJsonFile, workspaceRoot } from '@nx/devkit'; import { createConformanceRule, - type ProjectFilesViolation, + type ConformanceViolation, } from '@nx/conformance'; +import { readJsonFile, workspaceRoot } from '@nx/devkit'; import { existsSync } from 'node:fs'; import { join } from 'node:path'; import { satisfies } from 'semver'; @@ -17,9 +17,8 @@ export default createConformanceRule({ category: 'consistency', description: 'Ensures that packageJsonUpdates in migrations.json have all packages included from groups. e.g. @typescript-eslint/* packages must be in sync', - reporter: 'project-files-reporter', implementation: async ({ projectGraph, ruleOptions }) => { - const violations: ProjectFilesViolation[] = []; + const violations: ConformanceViolation[] = []; for (const project of Object.values(projectGraph.nodes)) { if ( @@ -60,10 +59,10 @@ export function validateMigrations( sourceProject: string, migrationsPath: string, options: Options -): ProjectFilesViolation[] { +): ConformanceViolation[] { if (!migrations.packageJsonUpdates) return []; - const violations: ProjectFilesViolation[] = []; + const violations: ConformanceViolation[] = []; // Check that if package updates include one package in the group, then: // 1. They all have the same version diff --git a/tools/workspace-plugin/src/conformance-rules/project-package-json/index.ts b/tools/workspace-plugin/src/conformance-rules/project-package-json/index.ts index 1bcd7b56b1..b398a4297c 100644 --- a/tools/workspace-plugin/src/conformance-rules/project-package-json/index.ts +++ b/tools/workspace-plugin/src/conformance-rules/project-package-json/index.ts @@ -1,8 +1,8 @@ -import { readJsonFile, workspaceRoot } from '@nx/devkit'; import { createConformanceRule, - type ProjectFilesViolation, + type ConformanceViolation, } from '@nx/conformance'; +import { readJsonFile, workspaceRoot } from '@nx/devkit'; import { existsSync } from 'node:fs'; import { join } from 'node:path'; @@ -11,9 +11,8 @@ export default createConformanceRule({ category: 'consistency', description: 'Ensures consistency across our project package.json files within the Nx repo', - reporter: 'project-files-reporter', implementation: async ({ projectGraph }) => { - const violations: ProjectFilesViolation[] = []; + const violations: ConformanceViolation[] = []; for (const project of Object.values(projectGraph.nodes)) { const projectPackageJsonPath = join( @@ -48,8 +47,8 @@ export function validateProjectPackageJson( sourceProject: string, sourceProjectRoot: string, projectPackageJsonPath: string -): ProjectFilesViolation[] { - const violations: ProjectFilesViolation[] = []; +): ConformanceViolation[] { + const violations: ConformanceViolation[] = []; // Private packages are exempt from this rule if (projectPackageJson.private === true) {