diff --git a/.github/workflows/validate.yml b/.github/workflows/validate.yml index 904b1f5..0038b57 100644 --- a/.github/workflows/validate.yml +++ b/.github/workflows/validate.yml @@ -21,7 +21,7 @@ jobs: - name: Install Mise uses: caido/action-mise-action@v3.2.0 with: - version: ${{ vars.CI__MISE_VERSION }} + version: ${{ vars.CI__MISE_VERSION }} - name: Install dependencies run: pnpm install @@ -39,10 +39,25 @@ jobs: - name: Install Mise uses: caido/action-mise-action@v3.2.0 with: - version: ${{ vars.CI__MISE_VERSION }} + version: ${{ vars.CI__MISE_VERSION }} - name: Install dependencies run: pnpm install - name: Run build run: pnpm build + + check-links: + runs-on: ubuntu-latest + + steps: + - name: Checkout Repo + uses: actions/checkout@v4 + + - name: Install Mise + uses: caido/action-mise-action@v3.2.0 + with: + version: ${{ vars.CI__MISE_VERSION }} + + - name: Check links + run: mise run check-links diff --git a/.lychee.toml b/.lychee.toml new file mode 100644 index 0000000..9fe7d1f --- /dev/null +++ b/.lychee.toml @@ -0,0 +1,20 @@ +exclude_path = ["node_modules", ".vitepress/cache", ".vitepress/dist"] + +exclude = [ + "localhost", + "127\\.0\\.0\\.1", + "172\\.22\\.0\\.1", + "lvh\\.me", + "example\\.com", + "plausible\\.io", + "npmjs\\.com", + "github\\.com/username/", + "^file://", + "https://develop/$", + "\\|" +] + +timeout = 30 +max_retries = 2 + +accept = [200, 201, 202, 203, 204, 205, 206, 207, 208, 226, 403, 429] diff --git a/.mise/config.toml b/.mise/config.toml index d46156c..3435b60 100644 --- a/.mise/config.toml +++ b/.mise/config.toml @@ -1,6 +1,7 @@ [tools] node = "22" pnpm = "10.17" +lychee = "0.23.0" [settings] idiomatic_version_file_enable_tools = [] diff --git a/.mise/tasks/build b/.mise/tasks/build new file mode 100755 index 0000000..9232f52 --- /dev/null +++ b/.mise/tasks/build @@ -0,0 +1,3 @@ +#!/usr/bin/env bash +set -euo pipefail +make build-release diff --git a/.mise/tasks/check-links b/.mise/tasks/check-links new file mode 100755 index 0000000..ee2c6ae --- /dev/null +++ b/.mise/tasks/check-links @@ -0,0 +1,3 @@ +#!/usr/bin/env bash +set -euo pipefail +make check-links diff --git a/Makefile b/Makefile index bdde2be..518c3c0 100644 --- a/Makefile +++ b/Makefile @@ -7,5 +7,8 @@ install: build-release: install pnpm build +check-links: + lychee --config .lychee.toml --root-dir "$(shell pwd)/src" 'src/**/*.md' + download-linter: npm install markdownlint-cli2 --global diff --git a/render.yaml b/render.yaml index 0e81ad0..86e0ebc 100644 --- a/render.yaml +++ b/render.yaml @@ -4,7 +4,7 @@ services: runtime: static repo: https://github.com/caido/doc-developer.git branch: main - buildCommand: make build-release + buildCommand: curl -fsSL https://mise.run | sh && ~/.local/bin/mise trust && ~/.local/bin/mise install && ~/.local/bin/mise run build staticPublishPath: ./.vitepress/dist pullRequestPreviewsEnabled: true routes: diff --git a/src/concepts/package.md b/src/concepts/package.md index dfd9555..4a8c8b4 100644 --- a/src/concepts/package.md +++ b/src/concepts/package.md @@ -59,7 +59,7 @@ For more information on the `manifest.json` file, refer to the [manifest.json re ### Frontend Plugin -A "_page_" in Caido simply refers to a user interface. For example, the [Replay](https://docs.caido.io/reference/features/testing/replay.html) and [Automate](https://docs.caido.io/reference/features/testing/automate.html) side menu tabs each produce their own page. +A "_page_" in Caido simply refers to a user interface. For example, the [Replay](https://docs.caido.io/app/quickstart/replay) and [Automate](https://docs.caido.io/app/quickstart/automate) side menu tabs each produce their own page. Within these pages are components and elements specific to the feature, such as option menus and buttons. It is through these components and elements that the appearance is customized or communication with the backend occurs. diff --git a/src/concepts/tooling.md b/src/concepts/tooling.md index 16263fa..7dd695f 100644 --- a/src/concepts/tooling.md +++ b/src/concepts/tooling.md @@ -15,7 +15,7 @@ The files related to package management within the starterkit repository are: ## TypeScript -Externally, [TypeScript](https://docs.caido.io/concepts/essentials/workflows/js_in_caido.html#typing) is used by Caido for the starterkit package. +Externally, [TypeScript](https://docs.caido.io/app/concepts/workflows_js#typing) is used by Caido for the starterkit package. The file related to TypeScript within the starterkit repository is: diff --git a/src/guides/backend_events.md b/src/guides/backend_events.md index 41a329e..09e70ff 100644 --- a/src/guides/backend_events.md +++ b/src/guides/backend_events.md @@ -6,7 +6,7 @@ This can be accomplished using the three event handlers provided by the SDK: ## Listening for Project Changes -An event will be triggered when the active [Project](https://docs.caido.io/quickstart/beginner_guide/first_steps_with_caido/project.html) changes. +An event will be triggered when the active [Project](https://docs.caido.io/app/quickstart/workspace) changes. ### /packages/backend/src/index.ts diff --git a/src/guides/fetch.md b/src/guides/fetch.md index 26f157c..c1cbdf4 100644 --- a/src/guides/fetch.md +++ b/src/guides/fetch.md @@ -31,7 +31,7 @@ To send a request, you will also need to import the `Request` class and the `fet import { Request as FetchRequest, fetch } from "caido:http"; ``` -Next, let's define an asynchronous function, specify request elements, and output the details to the [backend logs](https://docs.caido.io/reference/internal_files.html). In this example we define two URL query parameters, the `Accept` header, and the `User-Agent` header. +Next, let's define an asynchronous function, specify request elements, and output the details to the [backend logs](https://docs.caido.io/app/reference/data_storage). In this example we define two URL query parameters, the `Accept` header, and the `User-Agent` header. ``` ts export async function callApi(sdk: SDK) { diff --git a/src/guides/findings.md b/src/guides/findings.md index d085886..5a84c3b 100644 --- a/src/guides/findings.md +++ b/src/guides/findings.md @@ -1,6 +1,6 @@ # Use Findings -Any requests or responses can be parsed for notable characteristics based on conditional statements using [Findings](https://docs.caido.io/guides/findings.html). As Caido proxies traffic, if it detects what you are looking for, an alert will be generated to draw your attention. +Any requests or responses can be parsed for notable characteristics based on conditional statements using [Findings](https://docs.caido.io/app/quickstart/findings). As Caido proxies traffic, if it detects what you are looking for, an alert will be generated to draw your attention. ## Creating Findings diff --git a/src/guides/index.md b/src/guides/index.md index 37790f2..499ec5a 100644 --- a/src/guides/index.md +++ b/src/guides/index.md @@ -52,7 +52,7 @@ Instead of uninstalling, rebuilding, and installing your plugin to view the chan To use the Devtools plugin: -1. First navigate to the [Plugins](https://docs.caido.io/guides/plugins.html) interface, select Community Store, and click `+ Install`. +1. First navigate to the [Plugins](https://docs.caido.io/app/quickstart/plugins) interface, select Community Store, and click `+ Install`. 2. Next, run the following command from the root directory of the plugin to both build and watch for file changes: diff --git a/src/guides/querying_requests.md b/src/guides/querying_requests.md index 52d010c..d7f7096 100644 --- a/src/guides/querying_requests.md +++ b/src/guides/querying_requests.md @@ -4,7 +4,7 @@ In this guide, we'll cover how to fetch proxied requests in a backend plugin. ## Querying Requests -The `query()` method queries proxied requests belonging to the current [Project](https://docs.caido.io/guides/projects.html). +The `query()` method queries proxied requests belonging to the current [Project](https://docs.caido.io/app/guides/projects_backups). ```ts let query = sdk.requests.query(); diff --git a/src/reference/manifest.md b/src/reference/manifest.md index e95ff04..bcfd8b3 100644 --- a/src/reference/manifest.md +++ b/src/reference/manifest.md @@ -95,7 +95,7 @@ You can define multiple plugins of the same type. For example, you can define 3 | kind | Yes | Must be of type `frontend` | | id | Yes | Must be **unique** and must only consist of **lowercase** letters, **numbers**, **hyphens** and **underscores** (_the order of which must satisfy the regex: `^[a-z][a-z0-9]+(?:[_-][a-z0-9]+)\*$`). | | entrypoint | Yes | Specifies the location of the primary script to be executed when the plugin is launched. | -| name | No | The cosmetic plugin package name displayed in the [Plugins](https://docs.caido.io/reference/features/workspace/plugins.html) table. If not supplied, the `id` will be used as the `name`. | +| name | No | The cosmetic plugin package name displayed in the [Plugins](https://docs.caido.io/app/quickstart/plugins) table. If not supplied, the `id` will be used as the `name`. | | style | No | Specifies the location of the CSS file to be used to stylize elements of your plugin. | | backend | No | This object contains the `id` of the associated backend plugin. Specifying this field will allow the frontend plugin to communicate with the backend plugin via [sdk.backend](/reference/sdks/frontend/#backend). | | assets | No | Extra assets to be bundled with the plugin and loadable at runtime. | diff --git a/src/reference/modules/llrt/buffer.md b/src/reference/modules/llrt/buffer.md index bb857d6..17c2eb6 100644 --- a/src/reference/modules/llrt/buffer.md +++ b/src/reference/modules/llrt/buffer.md @@ -1657,9 +1657,7 @@ console.log(`${str}: ${str.length} characters, ` + ``` When `string` is a -`Buffer`/[`DataView`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView)/[`TypedArray`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/- -Reference/Global_Objects/TypedArray)/[`ArrayBuffer`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer)/[`SharedArrayBuffer`](https://develop- -er.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/SharedArrayBuffer), the byte length as reported by `.byteLength`is returned. +`Buffer`/[`DataView`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView)/[`TypedArray`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray)/[`ArrayBuffer`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer)/[`SharedArrayBuffer`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/SharedArrayBuffer), the byte length as reported by `.byteLength`is returned. ###### Parameters diff --git a/src/tutorials/notebook.md b/src/tutorials/notebook.md index f8a466d..2fd69c5 100644 --- a/src/tutorials/notebook.md +++ b/src/tutorials/notebook.md @@ -197,7 +197,7 @@ const addNoteMenu = async (caido: Caido) => { - The editor panes are accessed using the `caido.window.getActiveEditor()?.getSelectedText();` method. - If no selection is made, a prompt window will appear asking the user to supply input. -- Once the value is received, if the note was taken while within a specific Caido [Project](https://docs.caido.io/reference/features/workspace/projects.html) then the API call to get the current Project name is made via the `caido.graphql.currentProject()` method. +- Once the value is received, if the note was taken while within a specific Caido [Project](https://docs.caido.io/app/quickstart/workspace) then the API call to get the current Project name is made via the `caido.graphql.currentProject()` method. - If you are currently within a Project, then the Project's name will be included in the `datetimeCell` of the table. - If you are not currently within a project, "No Project Selected" will be included instead. - The note will also be added to storage by calling the `addNoteStorage` function. @@ -287,7 +287,7 @@ The `addNoteButton` has an async handler function and is responsible for awaitin ``` - The function will execute upon the `addNoteButton` being clicked. -- Once the value is received, if the note was taken while within a specific Caido [Project](https://docs.caido.io/reference/features/workspace/projects.html) then the API call to get the current Project name is made via the `caido.graphql.currentProject()` method. +- Once the value is received, if the note was taken while within a specific Caido [Project](https://docs.caido.io/app/quickstart/workspace) then the API call to get the current Project name is made via the `caido.graphql.currentProject()` method. - If you are currently within a Project, then the Project's name will be included in the `datetimeCell` of the table. - If you are not currently within a project, "No Project Selected" will be included instead. - The note will also be added to storage by calling the `addNoteStorage` function.