0ba945ae5f
## What Two broken documentation links in runtime warning messages, fixed in one PR. ### 1. `packages/angular/tailwind.ts` (fixes #36108) The deprecation warning for `@nx/angular/tailwind` pointed to: ``` https://nx.dev/docs/technologies/angular/guides/using-tailwind-css-with-angular ``` which returns a 404. The correct URL is: ``` https://nx.dev/docs/technologies/angular/guides/using-tailwind-css-with-angular-projects ``` (the page was renamed to include the `-projects` suffix) ### 2. `packages/nx/bin/nx.ts` (fixes #36072) The global version mismatch warning pointed to: ``` https://nx.dev/more-concepts/global-nx ``` which returns a 404. The docs were moved to: ``` https://nx.dev/docs/getting-started/installation#global-installation ``` ## Checklist - [x] Verified both replacement URLs return 200
40 lines
1.6 KiB
TypeScript
40 lines
1.6 KiB
TypeScript
import { createGlobPatternsForDependencies as jsGenerateGlobs } from '@nx/js/internal';
|
|
|
|
let hasWarned = false;
|
|
|
|
/**
|
|
* @deprecated `@nx/angular/tailwind` will be removed in Nx 24. Migrate to Tailwind CSS v4 which no longer needs glob patterns.
|
|
* See: https://nx.dev/docs/technologies/angular/guides/using-tailwind-css-with-angular-projects
|
|
*/
|
|
export function createGlobPatternsForDependencies(
|
|
dirPath: string,
|
|
fileGlobPattern: string = '/**/!(*.stories|*.spec).{ts,html}'
|
|
) {
|
|
if (!hasWarned) {
|
|
hasWarned = true;
|
|
console.warn(
|
|
`\nWARNING: "@nx/angular/tailwind" is deprecated and will be removed in Nx 24.\n` +
|
|
`Migrate to Tailwind CSS v4 which no longer needs glob patterns for content detection.\n` +
|
|
`See: https://nx.dev/docs/technologies/angular/guides/using-tailwind-css-with-angular-projects\n`
|
|
);
|
|
}
|
|
try {
|
|
return jsGenerateGlobs(dirPath, fileGlobPattern);
|
|
} catch (e) {
|
|
/**
|
|
* It should not be possible to reach this point when the utility is invoked as part of the normal
|
|
* lifecycle of Nx executors. However, other tooling, such as the VSCode Tailwind IntelliSense plugin
|
|
* or JetBrains editors such as WebStorm, may execute the tailwind.config.js file in order to provide
|
|
* autocomplete features, for example.
|
|
*
|
|
* In order to best support that use-case, we therefore do not hard error when the ProjectGraph is
|
|
* fundamentally unavailable in this tailwind-specific context.
|
|
*/
|
|
console.warn(
|
|
'\nWARNING: There was an error creating glob patterns, returning an empty array\n' +
|
|
`${e.message}\n`
|
|
);
|
|
return [];
|
|
}
|
|
}
|