Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 12 additions & 3 deletions packages/code-infra/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@
"./stylelint": {
"types": "./build/stylelint/index.d.mts",
"default": "./src/stylelint/index.mjs"
},
"./brokenLinksChecker": {
"types": "./build/brokenLinksChecker/index.d.mts",
"default": "./src/brokenLinksChecker/index.mjs"
}
},
"bin": {
Expand Down Expand Up @@ -79,6 +83,7 @@
"babel-plugin-transform-remove-imports": "^1.8.1",
"chalk": "^5.6.2",
"clipboardy": "^5.0.0",
"content-type": "^1.0.5",
"env-ci": "^11.2.0",
"eslint-config-prettier": "^10.1.8",
"eslint-import-resolver-typescript": "^4.4.4",
Expand All @@ -96,6 +101,7 @@
"globals": "^16.4.0",
"globby": "^15.0.0",
"minimatch": "^10.0.3",
"node-html-parser": "^7.0.1",
"open": "^10.2.0",
"postcss-styled-syntax": "^0.7.1",
"regexp.escape": "^2.0.1",
Expand All @@ -106,14 +112,16 @@
"yargs": "^18.0.0"
},
"peerDependencies": {
"@next/eslint-plugin-next": "*",
"eslint": "^9.0.0",
"prettier": "^3.5.3",
"typescript": "^5.0.0",
"@next/eslint-plugin-next": "*"
"typescript": "^5.0.0"
},
"devDependencies": {
"@octokit/types": "^15.0.1",
"@types/babel__core": "^7.20.5",
"@types/babel__preset-env": "^7.10.0",
"@types/content-type": "^1.1.9",
"@types/env-ci": "^3.1.4",
"@types/eslint-plugin-jsx-a11y": "^6.10.1",
"@types/estree": "^1.0.8",
Expand All @@ -123,8 +131,9 @@
"@typescript-eslint/parser": "^8.46.2",
"@typescript-eslint/rule-tester": "^8.46.2",
"eslint": "^9.38.0",
"@octokit/types": "^15.0.1",
"get-port": "^7.1.0",
"prettier": "^3.6.2",
"serve": "^14.2.5",
"typescript-eslint": "^8.46.2"
},
"files": [
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Page with Broken Links</title>
</head>
<body>
<h1>Page with Broken Links</h1>
<p>This page contains links to non-existent pages.</p>
<nav>
<ul>
<li><a href="/">Home (valid)</a></li>
<li><a href="/does-not-exist.html">This page does not exist</a></li>
<li><a href="/another-missing-page.html">Another missing page</a></li>
<li><a href="/valid.html">Valid link</a></li>
</ul>
</nav>
</body>
</html>
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Page with Broken Targets</title>
</head>
<body>
<h1>Page with Broken Targets</h1>
<p>This page contains links to valid pages but with invalid hash targets.</p>
<nav>
<ul>
<li><a href="/">Home (valid)</a></li>
<li><a href="/with-anchors.html#section1">Valid anchor</a></li>
<li><a href="/with-anchors.html#nonexistent">Non-existent anchor</a></li>
<li><a href="/valid.html#missing-target">Valid page, missing target</a></li>
<li><a href="/with-anchors.html#section2">Another valid anchor</a></li>
<li><a href="/with-anchors.html#also-missing">Also missing</a></li>
</ul>
</nav>
</body>
</html>
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Example Markdown File

This is a markdown file with an HTML code snippet:

```html
<a href="/this-should-not-be-checked.html">This link is in a code snippet</a>
```

This link should not be crawled because this is a markdown file, not HTML.
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Page with External Links</title>
</head>
<body>
<h1>Page with External Links</h1>
<p>This page contains external links that should be ignored.</p>
<nav>
<ul>
<li><a href="/">Home (valid internal)</a></li>
<li><a href="https://example.com">External link 1</a></li>
<li><a href="https://github.com/mui">External link 2</a></li>
<li><a href="http://localhost:9999/fake">External localhost</a></li>
<li><a href="/valid.html">Valid internal link</a></li>
</ul>
</nav>
</body>
</html>
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Ignored Page</title>
</head>
<body>
<h1>Ignored Page</h1>
<p>This page should be ignored by the crawler.</p>
<nav>
<ul>
<li><a href="/this-link-should-not-be-checked.html">Should not be checked</a></li>
</ul>
</nav>
</body>
</html>
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Test Site Home</title>
</head>
<body>
<h1>Test Site Home</h1>
<nav>
<ul>
<li><a href="/valid.html">Valid Page</a></li>
<li><a href="/with-anchors.html">Page with Anchors</a></li>
<li><a href="/broken-links.html">Page with Broken Links</a></li>
<li><a href="/broken-targets.html">Page with Broken Targets</a></li>
<li><a href="/external-links.html">Page with External Links</a></li>
<li><a href="/nested/page.html">Nested Page</a></li>
<li><a href="/ignored-page.html">Ignored Page</a></li>
<li><a href="/page-with-ignored-content.html">Page with Ignored Content</a></li>
<li><a href="/page-with-custom-targets.html">Page with Custom Targets</a></li>
<li><a href="/page-with-known-target-links.html">Page with Known Target Links</a></li>
<li><a href="/page-with-api-links.html">Page with API Links</a></li>
</ul>
</nav>
</body>
</html>
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"targets": {
"/api-page.html": ["#method1", "#method2", "#method3"]
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Nested Page</title>
</head>
<body>
<h1>Nested Page</h1>
<p>This is a page in a nested directory.</p>
<nav>
<ul>
<li><a href="/">Home</a></li>
<li><a href="/valid.html">Valid page</a></li>
<li><a href="/with-anchors.html#section1">Link to anchor</a></li>
</ul>
</nav>
</body>
</html>
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Orphaned Page</title>
</head>
<body>
<h1>Orphaned Page</h1>
<p>This page is not linked from anywhere and can only be discovered via seedUrls.</p>
<nav>
<ul>
<li><a href="/valid.html">Valid Page</a></li>
<li><a href="/valid.html/">Valid Page with trailing slash</a></li>
<li><a href="/orphaned-broken-link.html">Broken link from orphaned page</a></li>
<li><a href="/example.md">Markdown file with HTML snippet</a></li>
</ul>
</nav>
</body>
</html>
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Page with API Links</title>
</head>
<body>
<h1>Page with API Links</h1>
<p>This page links to API documentation with known targets.</p>
<nav>
<ul>
<li><a href="/">Home</a></li>
<li><a href="/api-page.html#method1">API Method 1 (known)</a></li>
<li><a href="/api-page.html#method2">API Method 2 (known)</a></li>
<li><a href="/api-page.html#unknown-method">Unknown API method</a></li>
</ul>
</nav>
</body>
</html>
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Page with Custom Targets</title>
</head>
<body>
<h1>Page with Custom Targets</h1>
<nav>
<ul>
<li><a href="/">Home</a></li>
<li><a href="#custom-id">Link to custom ID</a></li>
<li><a href="#__should-be-ignored">Link to ignored ID</a></li>
</ul>
</nav>
<section id="custom-id">
<h2>Custom ID Section</h2>
</section>
<section id="__should-be-ignored">
<h2>This target should be ignored</h2>
</section>
</body>
</html>
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Page with Ignored Content</title>
</head>
<body>
<h1>Page with Ignored Content</h1>
<nav>
<ul>
<li><a href="/">Home</a></li>
</ul>
</nav>
<aside class="sidebar">
<h2>Sidebar (should be ignored)</h2>
<ul>
<li><a href="/sidebar-broken-link.html">Broken link in sidebar</a></li>
</ul>
</aside>
<main>
<p>Main content</p>
<p>
<a href="/broken-link-with-sidebar-class.html" class="sidebar">Link with sidebar class directly</a>
</p>
</main>
</body>
</html>
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Page with Known Target Links</title>
</head>
<body>
<h1>Page with Known Target Links</h1>
<p>This page links to external pages with known targets.</p>
<nav>
<ul>
<li><a href="/">Home</a></li>
<li><a href="/external-page.html#valid-target">Valid external target</a></li>
<li><a href="/external-page.html#invalid-target">Invalid external target</a></li>
</ul>
</nav>
</body>
</html>
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Valid Page</title>
</head>
<body>
<h1>Valid Page</h1>
<p>This page has only valid internal links.</p>
<nav>
<ul>
<li><a href="/">Home</a></li>
<li><a href="/with-anchors.html#section1">Link to section 1</a></li>
<li><a href="/with-anchors.html#section2">Link to section 2</a></li>
<li><a href="/nested/page.html">Nested page</a></li>
</ul>
</nav>
</body>
</html>
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Page with Anchors</title>
</head>
<body>
<h1>Page with Anchors</h1>
<nav>
<ul>
<li><a href="/">Home</a></li>
<li><a href="#section1">Jump to section 1</a></li>
<li><a href="#section2">Jump to section 2</a></li>
<li><a href="#section3">Jump to section 3</a></li>
</ul>
</nav>
<section id="section1">
<h2>Section 1</h2>
<p>Content for section 1</p>
</section>
<section id="section2">
<h2>Section 2</h2>
<p>Content for section 2</p>
</section>
<section id="section3">
<h2>Section 3</h2>
<p>Content for section 3</p>
</section>
</body>
</html>
Loading
Loading