chore(nx-dev): block linking to preview urls (#31081)

Catch links to preview urls
This commit is contained in:
Isaac Mann 2025-05-06 18:43:57 -04:00 committed by GitHub
parent a944c8cd54
commit 30a7709d71
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 8 additions and 3 deletions

View File

@ -130,7 +130,7 @@ Read all about how to [configure Codeowners for your project in our docs](/nx-en
We're releasing the `@nx/conformance` plugin in an early preview. This new package focuses specifically on the maintainability of your monorepo. It allows you to encode your organization's standards so they can be enforced automatically. In this first version, the workspace conformance package ships with:
- [Enforce Module Boundaries](/nx-api/conformance#enforce-module-boundaries): Similar to the Nx ESLint [Enforce Module Boundaries rule](https://nx-dev-git-docs-powerpack-nrwl.vercel.app/features/enforce-module-boundaries), but enforces boundaries on every project dependency, not just those created from TypeScript imports or `package.json` dependencies.
- [Enforce Module Boundaries](/nx-api/conformance#enforce-module-boundaries): Similar to the Nx ESLint [Enforce Module Boundaries rule](/features/enforce-module-boundaries), but enforces boundaries on every project dependency, not just those created from TypeScript imports or `package.json` dependencies.
- [Ensure Owners](/nx-api/conformance#ensure-owners): Requires every project to have an owner defined for the `@nx/owners` plugin.
To get started, install the following package:

View File

@ -16,7 +16,9 @@ function readFileContents(path: string): string {
function isLinkInternal(linkPath: string): boolean {
return (
(linkPath.startsWith('/') || linkPath.startsWith('https://nx.dev')) &&
(linkPath.startsWith('/') ||
linkPath.startsWith('https://nx.dev') ||
linkPath.startsWith('https://nx-dev')) &&
!linkPath.startsWith('/tutorials')
);
}
@ -178,7 +180,10 @@ for (let file in documentLinks) {
) {
continue;
}
if (link.startsWith('https://nx.dev')) {
if (
link.startsWith('https://nx.dev') ||
link.startsWith('https://nx-dev')
) {
localLinkErrors.push({ file, link });
} else if (
link.includes('#') &&