Skip to content
This repository was archived by the owner on May 20, 2025. It is now read-only.

Commit 6335a41

Browse files
jyecuschdavemooreuwsraksiv
authored
docs: add links from reference docs back to build docs (#715)
Co-authored-by: David Moore <[email protected]> Co-authored-by: Rak Siva <[email protected]>
1 parent ee0a91a commit 6335a41

File tree

201 files changed

+1033
-7
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

201 files changed

+1033
-7
lines changed

cypress.config.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,6 @@ export default defineConfig({
1717
},
1818
})
1919
},
20+
experimentalMemoryManagement: true,
2021
},
2122
})

cypress/e2e/broken-links.cy.ts

Lines changed: 31 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,14 @@ const IGNORED_URLS = [
3333
'https://portal.azure.com',
3434
]
3535

36+
const rootBaseUrl = Cypress.config('baseUrl')
37+
38+
const isInternalUrl = (url: string) => {
39+
// check against the base url
40+
// and check if the url does not contain a file extension
41+
return url.startsWith(rootBaseUrl) && !url.includes('.')
42+
}
43+
3644
const isExternalUrl = (url: string) => {
3745
return !url.includes('localhost')
3846
}
@@ -69,14 +77,11 @@ describe('Broken links test suite', () => {
6977

7078
links
7179
.filter((_i, link) => {
80+
const href = link.getAttribute('href')
81+
const src = link.getAttribute('src')
82+
7283
return !IGNORED_URLS.some(
73-
(l) =>
74-
//@ts-ignore
75-
(link.getAttribute('href') &&
76-
link.getAttribute('href')?.includes(l)) ||
77-
//@ts-ignore
78-
(link.getAttribute('src') &&
79-
link.getAttribute('src').includes(l)),
84+
(l) => href?.includes(l) || src?.includes(l),
8085
)
8186
})
8287
.each((link) => {
@@ -89,6 +94,25 @@ describe('Broken links test suite', () => {
8994
cy.log(`link already checked`)
9095
expect(VISITED_SUCCESSFUL_LINKS[url]).to.be.true
9196
} else {
97+
// if the link is internal then check the link against the pages fixture (sitemap)
98+
if (isInternalUrl(url)) {
99+
// clean the url by removing the base url and query params
100+
const rootBaseUrlRegex = new RegExp(`^${rootBaseUrl}`)
101+
let cleanUrl = url.replace(rootBaseUrlRegex, '')
102+
const queryIndex = cleanUrl.indexOf('?')
103+
cleanUrl =
104+
queryIndex !== -1 ? cleanUrl.slice(0, queryIndex) : cleanUrl
105+
106+
cy.log(`checking internal link: ${cleanUrl}`)
107+
if (!pages.includes(cleanUrl)) {
108+
assert.fail(`${cleanUrl} is not part of the pages fixture`)
109+
} else {
110+
VISITED_SUCCESSFUL_LINKS[url] = true
111+
}
112+
113+
return
114+
}
115+
92116
cy.wait(25)
93117

94118
req(url).then((res: Cypress.Response<any>) => {

docs/reference/dart/api/api-all.mdx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@ description: "Reference for Nitric's Dart library - Register a single handler fo
44

55
# Dart - api.all()
66

7+
<Note>
8+
This is reference documentation for the Nitric Dart SDK. To learn about APIs
9+
in Nitric start with the [API docs](/apis).
10+
</Note>
11+
712
Register a single handler for all HTTP Methods (GET, POST, PUT, DELETE, PATCH) on a route.
813

914
<Note>

docs/reference/dart/api/api-delete.mdx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@ description: "Reference for Nitric's Dart library - Register an API route and se
44

55
# Dart - api.delete()
66

7+
<Note>
8+
This is reference documentation for the Nitric Dart SDK. To learn about APIs
9+
in Nitric start with the [API docs](/apis).
10+
</Note>
11+
712
Register an API route and set a specific HTTP DELETE handler on that route.
813

914
<Note>

docs/reference/dart/api/api-get.mdx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@ description: "Reference for Nitric's Dart library - Register an API route and se
44

55
# Dart - api.get()
66

7+
<Note>
8+
This is reference documentation for the Nitric Dart SDK. To learn about APIs
9+
in Nitric start with the [API docs](/apis).
10+
</Note>
11+
712
Register an API route and set a specific HTTP GET handler on that route.
813

914
<Note>

docs/reference/dart/api/api-patch.mdx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@ description: "Reference for Nitric's Dart library - Register an API route and se
44

55
# Dart - api.patch()
66

7+
<Note>
8+
This is reference documentation for the Nitric Dart SDK. To learn about APIs
9+
in Nitric start with the [API docs](/apis).
10+
</Note>
11+
712
Register an API route and set a specific HTTP PATCH handler on that route.
813

914
<Note>

docs/reference/dart/api/api-post.mdx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@ description: "Reference for Nitric's Dart library - Register an API route and se
44

55
# Dart - api.post()
66

7+
<Note>
8+
This is reference documentation for the Nitric Dart SDK. To learn about APIs
9+
in Nitric start with the [API docs](/apis).
10+
</Note>
11+
712
Register an API route and set a specific HTTP POST handler on that route.
813

914
<Note>

docs/reference/dart/api/api-put.mdx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@ description: "Reference for Nitric's Dart library - Register an API route and se
44

55
# Dart - api.put()
66

7+
<Note>
8+
This is reference documentation for the Nitric Dart SDK. To learn about APIs
9+
in Nitric start with the [API docs](/apis).
10+
</Note>
11+
712
Register an API route and set a specific HTTP PUT handler on that route.
813

914
<Note>

docs/reference/dart/api/api-route-all.mdx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@ description: "Reference for Nitric's Dart library - Register a single handler fo
44

55
# Dart - api.route.all()
66

7+
<Note>
8+
This is reference documentation for the Nitric Dart SDK. To learn about APIs
9+
in Nitric start with the [API docs](/apis).
10+
</Note>
11+
712
Register a single handler for all HTTP Methods (GET, POST, PUT, DELETE, PATCH) on the route.
813

914
```dart

docs/reference/dart/api/api-route-delete.mdx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@ description: "Reference for Nitric's Dart library - Register a handler for HTTP
44

55
# Dart - api.route.delete()
66

7+
<Note>
8+
This is reference documentation for the Nitric Dart SDK. To learn about APIs
9+
in Nitric start with the [API docs](/apis).
10+
</Note>
11+
712
Register a handler for HTTP DELETE requests to the route.
813

914
```dart

0 commit comments

Comments
 (0)