diff --git a/nx-dev/nx-dev/project.json b/nx-dev/nx-dev/project.json index 3da429313b..5c6685b8c6 100644 --- a/nx-dev/nx-dev/project.json +++ b/nx-dev/nx-dev/project.json @@ -18,6 +18,12 @@ ], "parallel": false }, + "inputs": [ + "production", + "^production", + "{workspaceRoot}/scripts/tsconfig.scripts.json", + "{workspaceRoot}/scripts/documentation/internal-link-checker.ts" + ], "outputs": ["{workspaceRoot}/dist/nx-dev/nx-dev"] }, "sitemap": { diff --git a/scripts/documentation/internal-link-checker.ts b/scripts/documentation/internal-link-checker.ts index 3571a6713c..9e2dc6fd19 100644 --- a/scripts/documentation/internal-link-checker.ts +++ b/scripts/documentation/internal-link-checker.ts @@ -83,38 +83,6 @@ function readSiteMapLinks(filePath: string): string[] { return sitemap.urlset.url.map((obj) => obj.loc); } -/** - * This function checks if a link is for a private package. - * When link is for a private package, it is not included in the sitemap. - * However, some shared docs might be written for this private package during development. - * @param link e.g. /nx-api/vite/generators/configuration - * @returns true if the link is for a private package or NODE_ENV is not development, false otherwise. - */ -function checkLinkIsForPrivatePackage(link: string) { - // skip this check in dev mode - if (process.env.NODE_ENV === 'development') { - return false; - } - const pathSegments = link.split('/').filter(Boolean); - if (pathSegments[0] === 'nx-api') { - // TODO(v17): Remove this once vue is public or once this logic is fixed - if (pathSegments[1] === 'vue') { - return true; - } - - const packageJsonPath = join( - workspaceRoot, - 'packages', - pathSegments[1], - 'package.json' - ); - if (existsSync(packageJsonPath)) { - return readJSONSync(packageJsonPath).private ?? false; - } - } - return false; -} - // Main const documentLinks = extractAllLinks(join(workspaceRoot, 'docs')); const sitemapLinks = readSiteMapIndex( @@ -124,11 +92,7 @@ const sitemapLinks = readSiteMapIndex( const errors: Array<{ file: string; link: string }> = []; for (let file in documentLinks) { for (let link of documentLinks[file]) { - // TODO(@isaacplmann): This ignores errors which are links TO private packages. It allows links FROM public packages (public docs) TO private packages (404 links) - if ( - !sitemapLinks.includes(['https://nx.dev', link].join('')) && - !checkLinkIsForPrivatePackage(link) - ) { + if (!sitemapLinks.includes(['https://nx.dev', link].join(''))) { errors.push({ file, link }); } }