fix(nx-dev): cross site link checks working as expected#34685
fix(nx-dev): cross site link checks working as expected#34685barbados-clemens wants to merge 5 commits intomasterfrom
Conversation
✅ Deploy Preview for nx-docs ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
✅ Deploy Preview for nx-dev ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
View your CI Pipeline Execution ↗ for commit 849006f
☁️ Nx Cloud last updated this comment at |
00461f4 to
4b6f2be
Compare
| import fs from 'node:fs'; | ||
| import path from 'node:path'; | ||
| import { workspaceRoot } from '@nx/devkit'; | ||
| import glob from 'glob'; |
There was a problem hiding this comment.
The glob import is incompatible with glob v8+. The code imports the default export but uses glob.sync() on line 248, which will fail in modern versions of glob.
In glob v8+, the API changed to ESM and no longer exports a default object with a .sync method. This will cause a runtime error: "glob.sync is not a function".
Fix:
import { globSync } from 'glob';Then on line 248, change to:
const mdFiles = globSync('**/*.md', { cwd: docsDir });Spotted by Graphite
Is this helpful? React 👍 or 👎 to let us know.
8aee18f to
dca7963
Compare
- Break docs/ → astro link (reference-style): /docs/guides/adopting-nx/import-project-BROKEN-TEST - Break astro → nx-dev link: /blog/setup-tailwind-4-angular-nx-workspace-BROKEN-TEST This commit should fail validate-links in CI. Revert after confirming. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-authored-by: barbados-clemens <barbados-clemens@users.noreply.github.com>
670f622 to
422793b
Compare
Co-authored-by: barbados-clemens <barbados-clemens@users.noreply.github.com> [Self-Healing CI Rerun]
There was a problem hiding this comment.
Nx Cloud is proposing a fix for your failed CI:
We fix two failures exposed by this PR's expanded link validation coverage. The broken /docs/nx-api/devkit link in nx-vs-turborepo.mdoc is corrected to /docs/reference/devkit, which is the actual route in the astro-docs sitemap. The e2e theme-switching tests are updated to use waitUntil: 'domcontentloaded' to prevent the YouTube iframe on the intro page from blocking the Chromium load event in CI environments where YouTube is unreachable.
Tip
✅ We verified this fix by re-running astro-docs:validate-links, astro-docs:e2e-ci--e2e/theme-switching.spec.ts.
Suggested Fix changes
diff --git a/astro-docs/e2e/theme-switching.spec.ts b/astro-docs/e2e/theme-switching.spec.ts
index ce6dce175c..a5c1d0f44a 100644
--- a/astro-docs/e2e/theme-switching.spec.ts
+++ b/astro-docs/e2e/theme-switching.spec.ts
@@ -1,7 +1,9 @@
import { test, expect } from '@playwright/test';
test('should apply system theme by default', async ({ page }) => {
- await page.goto('/docs/getting-started/intro');
+ await page.goto('/docs/getting-started/intro', {
+ waitUntil: 'domcontentloaded',
+ });
await expect(
page.getByRole('heading', { name: 'What is Nx?' })
@@ -24,7 +26,9 @@ test('should apply system theme by default', async ({ page }) => {
});
test('should switch to between light and dark theme', async ({ page }) => {
- await page.goto('/docs/getting-started/intro');
+ await page.goto('/docs/getting-started/intro', {
+ waitUntil: 'domcontentloaded',
+ });
await expect(
page.getByRole('heading', { name: 'What is Nx?' })
diff --git a/astro-docs/src/content/docs/guides/Adopting Nx/nx-vs-turborepo.mdoc b/astro-docs/src/content/docs/guides/Adopting Nx/nx-vs-turborepo.mdoc
index c3b549c7b5..03e13e9e82 100644
--- a/astro-docs/src/content/docs/guides/Adopting Nx/nx-vs-turborepo.mdoc
+++ b/astro-docs/src/content/docs/guides/Adopting Nx/nx-vs-turborepo.mdoc
@@ -225,7 +225,7 @@ Both tools offer code generation, but the depth differs significantly.
Turborepo provides `turbo gen`, a thin wrapper around [Plop.js](https://plopjs.com/). It can scaffold new workspaces and create files from Handlebars templates, but it's limited to template-based file creation and simple string append/prepend operations. There's no AST-level code modification, no awareness of the project graph, and no migration/codemod system.
-Nx generators are built on top of [Nx Devkit](/docs/nx-api/devkit), a full programmatic API for workspace manipulation. Generators can read and modify the project graph, perform AST-level TypeScript transforms, and compose with other generators. You can create [local workspace generators](/docs/features/generate-code#creating-custom-generators) that encode your team's specific patterns.
+Nx generators are built on top of [Nx Devkit](/docs/reference/devkit), a full programmatic API for workspace manipulation. Generators can read and modify the project graph, perform AST-level TypeScript transforms, and compose with other generators. You can create [local workspace generators](/docs/features/generate-code#creating-custom-generators) that encode your team's specific patterns.
The real value isn't raw scaffolding, AI can do that too. It's deterministic, convention-aware generation. **AI agents can invoke your generators to produce code matching your patterns from the start.** This is faster and more token-efficient than generating everything from scratch.
🔔 Heads up, your workspace has pending recommendations ↗ to auto-apply fixes for similar failures.
Or Apply changes locally with:
npx nx-cloud apply-locally HKqW-8lu7
Apply fix locally with your editor ↗ View interactive diff ↗
🎓 Learn more about Self-Healing CI on nx.dev
No description provided.