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
3,980 changes: 1,718 additions & 2,262 deletions bun.lock

Large diffs are not rendered by default.

7 changes: 3 additions & 4 deletions cli/helpers.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import * as fs from "node:fs";
import * as path from "node:path";
import _ from "lodash";
import type { Sablier } from "sablier";
import type { CliOptions } from "./types";

Expand All @@ -11,9 +10,9 @@ if (!fs.existsSync(path.join(ROOT_DIR, "package.json"))) {

export const autogenFilePaths = {
deployments: (release: Sablier.Release) =>
path.join(ROOT_DIR, "src", "autogen", release.protocol, `TableDeployments${_.capitalize(release.version)}.mdx`),
envio: (protocol: Sablier.Protocol) => path.join(ROOT_DIR, "src", "autogen", protocol, "TableEnvio.mdx"),
graph: (protocol: Sablier.Protocol) => path.join(ROOT_DIR, "src", "autogen", protocol, "TableTheGraph.mdx"),
path.join(ROOT_DIR, "src", "autogen", release.protocol, `_table-deployments-${release.version}.mdx`),
envio: (protocol: Sablier.Protocol) => path.join(ROOT_DIR, "src", "autogen", protocol, "_table-envio.mdx"),
graph: (protocol: Sablier.Protocol) => path.join(ROOT_DIR, "src", "autogen", protocol, "_table-graph.mdx"),
};

type FileWriteParams = {
Expand Down
103 changes: 102 additions & 1 deletion config/plugins.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import type { Options as ClientRedirectsOptions } from "@docusaurus/plugin-clien
import type { Options as VercelAnalyticsOptions } from "@docusaurus/plugin-vercel-analytics";
import type { DocusaurusConfig, PluginOptions } from "@docusaurus/types";
import type { ConfigOptions, GraphQLMarkdownCliOptions, LoaderOption } from "@graphql-markdown/types";
import type { PluginOptions as LlmPluginOptions } from "docusaurus-plugin-llms";
import { createRedirects, redirects } from "./redirects";

/* -------------------------------------------------------------------------- */
Expand Down Expand Up @@ -47,6 +48,106 @@ const graphqlMarkdown: [string, GraphQLMarkdownOptions] = [
} satisfies ConfigOptions,
];

/* -------------------------------------------------------------------------- */
/* LLM PLUGIN */
/* -------------------------------------------------------------------------- */

/**
* The plugin follows llmstxt.org standards and generates the following files during the build process:
* - llms.txt: Contains links to the markdown files of all sections.
* - llms-airdrops.txt: Contains full content relevant to the Merkle Airdrops protocol.
* - llms-flow.txt: Contains full content relevant to the Flow protocol.
* - llms-lockup.txt: Contains full content relevant to the Lockup protocol.
* - llms-training-data.txt: Contains full content of all markdown files.
*
* @see https://llmstxt.org
* @see https://github.com/rachfop/docusaurus-plugin-llms
*/
const llmPlugin: [string, LlmPluginOptions & { [key: string]: unknown }] = [
"docusaurus-plugin-llms",
{
// Protocol specific LLM files.
customLLMFiles: [
{
description: "Merkle Airdrops is useful to distribute tokens to a large number of users efficiently.",
filename: "llms-airdrops.txt",
// Create a single markdown file with the full content of the section.
fullContent: true,
includePatterns: [
"**/airdrops/**/*.md",
"**/airdrops/**/*.mdx",
"apps/features/01-airdrops.mdx",
"apps/guides/*.md",
"apps/guides/*.mdx",
"concepts/05-merkle-airdrops.mdx",
"support/*.md",
"support/*.mdx",
],
title: "Sablier Merkle Airdrops Documentation",
},
{
description: "Sablier Flow is useful for payroll, grants, insurance premiums, loans interest and ESOPs.",
filename: "llms-flow.txt",
// Create a single markdown file with the full content of the section.
fullContent: true,
includePatterns: [
"**/flow/**/*.md",
"**/flow/**/*.mdx",
"apps/features/03-payments.mdx",
"apps/guides/*.md",
"apps/guides/*.mdx",
"support/*.md",
"support/*.mdx",
],
title: "Sablier Flow Documentation",
},
{
description: "Sablier Lockup is useful for token vesting and airdrops.",
filename: "llms-lockup.txt",
// Create a single markdown file with the full content of the section.
fullContent: true,
includePatterns: [
"**/lockup/**/*.md",
"**/lockup/**/*.mdx",
"apps/features/02-vesting.mdx",
"apps/guides/*.md",
"apps/guides/*.mdx",
"support/*.md",
"support/*.mdx",
],
title: "Sablier Lockup Documentation",
},
{
// Useful to train or fine-tune an LLM on Sablier docs.
filename: "llms-training-data.txt",
fullContent: true,
includePatterns: ["**/*.md", "**/*.mdx"],
},
],
docsDir: "docs",
// Remove imports from mdx files.
excludeImports: true,
generateLLMsFullTxt: false,
// Generate index file linking to markdown files.
generateLLMsTxt: true,
// Generates individual markdown files and adds them to llms.txt.
generateMarkdownFiles: true,
// Ignore snippet files since they're already included via imports.
ignoreFiles: ["snippets/**/*"],
// Section ordering in the index file.
includeOrder: ["concepts/*", "guides/*", "reference/*", "api/*", "apps/*", "support/*"],
// Remove duplicate content matching headings.
removeDuplicateHeadings: true,
rootContent: `Sablier docs is optimized for LLMs and AI assistants. Navigation tips:
- For subgraph APIs or Merkle APIs, use the "API" section.
- For deployment addresses and examples on using the contracts, use the "Guides" section.
- For contracts, use the "References" section.
- For FAQs, use the "Support" section.
`,
title: "Sablier Docs",
},
];

/* -------------------------------------------------------------------------- */
/* VERCEL ANALYTICS */
/* -------------------------------------------------------------------------- */
Expand All @@ -58,4 +159,4 @@ const vercelAnalytics: [string, VercelAnalyticsOptions] = [
},
];

export const plugins: DocusaurusConfig["plugins"] = [clientRedirects, graphqlMarkdown, vercelAnalytics];
export const plugins: DocusaurusConfig["plugins"] = [clientRedirects, graphqlMarkdown, llmPlugin, vercelAnalytics];
2 changes: 1 addition & 1 deletion docs/api/07-legacy.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ sidebar_position: 7
title: "Legacy"
---

import ExplainerTheGraph from "@site/src/snippets/ExplainerTheGraph.mdx";
import ExplainerTheGraph from "../../src/snippets/_explainer-graph.mdx";

# Sablier Legacy

Expand Down
8 changes: 4 additions & 4 deletions docs/api/airdrops/01-indexers.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ sidebar_position: 1
title: "Indexers"
---

import TableEnvio from "@site/src/autogen/airdrops/TableEnvio.mdx";
import TableTheGraph from "@site/src/autogen/airdrops/TableTheGraph.mdx";
import LinkPreviewIndexers from "@site/src/components/molecules/link-previews/Indexers";
import ExplainerEnvio from "@site/src/snippets/ExplainerEnvio.mdx";
import ExplainerTheGraph from "@site/src/snippets/ExplainerTheGraph.mdx";
import TableEnvio from "../../../src/autogen/airdrops/_table-envio.mdx";
import TableTheGraph from "../../../src/autogen/airdrops/_table-graph.mdx";
import ExplainerEnvio from "../../../src/snippets/_explainer-envio.mdx";
import ExplainerTheGraph from "../../../src/snippets/_explainer-graph.mdx";

# Sablier Airdrops

Expand Down
2 changes: 1 addition & 1 deletion docs/api/airdrops/05-previous-indexers.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ sidebar_position: 5
title: "Previous Indexers"
---

import DeprecatedIndexers from "@site/src/snippets/DeprecatedIndexers.mdx";
import DeprecatedIndexers from "../../../src/snippets/_deprecated-indexers.mdx";

<DeprecatedIndexers />

Expand Down
8 changes: 4 additions & 4 deletions docs/api/flow/01-indexers.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ sidebar_position: 1
title: "Indexers"
---

import TableEnvio from "@site/src/autogen/flow/TableEnvio.mdx";
import TableTheGraph from "@site/src/autogen/flow/TableTheGraph.mdx";
import LinkPreviewIndexers from "@site/src/components/molecules/link-previews/Indexers";
import ExplainerEnvio from "@site/src/snippets/ExplainerEnvio.mdx";
import ExplainerTheGraph from "@site/src/snippets/ExplainerTheGraph.mdx";
import TableEnvio from "../../../src/autogen/flow/_table-envio.mdx";
import TableTheGraph from "../../../src/autogen/flow/_table-graph.mdx";
import ExplainerEnvio from "../../../src/snippets/_explainer-envio.mdx";
import ExplainerTheGraph from "../../../src/snippets/_explainer-graph.mdx";

# Sablier Flow

Expand Down
2 changes: 1 addition & 1 deletion docs/api/flow/03-previous-indexers.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ sidebar_position: 3
title: "Previous Indexers"
---

import DeprecatedIndexers from "@site/src/snippets/DeprecatedIndexers.mdx";
import DeprecatedIndexers from "../../../src/snippets/_deprecated-indexers.mdx";

<DeprecatedIndexers />

Expand Down
8 changes: 4 additions & 4 deletions docs/api/lockup/01-indexers.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ sidebar_position: 1
title: "Indexers"
---

import TableEnvio from "@site/src/autogen/lockup/TableEnvio.mdx";
import TableTheGraph from "@site/src/autogen/lockup/TableTheGraph.mdx";
import LinkPreviewIndexers from "@site/src/components/molecules/link-previews/Indexers";
import ExplainerEnvio from "@site/src/snippets/ExplainerEnvio.mdx";
import ExplainerTheGraph from "@site/src/snippets/ExplainerTheGraph.mdx";
import TableEnvio from "../../../src/autogen/lockup/_table-envio.mdx";
import TableTheGraph from "../../../src/autogen/lockup/_table-graph.mdx";
import ExplainerEnvio from "../../../src/snippets/_explainer-envio.mdx";
import ExplainerTheGraph from "../../../src/snippets/_explainer-graph.mdx";

# Sablier Lockup

Expand Down
2 changes: 1 addition & 1 deletion docs/api/lockup/03-previous-indexers.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ sidebar_position: 3
title: "Previous Indexers"
---

import DeprecatedIndexers from "@site/src/snippets/DeprecatedIndexers.mdx";
import DeprecatedIndexers from "../../../src/snippets/_deprecated-indexers.mdx";

<DeprecatedIndexers />

Expand Down
8 changes: 4 additions & 4 deletions docs/concepts/01-what-is-sablier.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ sidebar_position: 1
title: "What Is Sablier?"
---

import ReleaseHistoryAirdrops from "@site/src/snippets/ReleaseHistoryAirdrops.mdx";
import ReleaseHistoryFlow from "@site/src/snippets/ReleaseHistoryFlow.mdx";
import ReleaseHistoryLegacy from "@site/src/snippets/ReleaseHistoryLegacy.mdx";
import ReleaseHistoryLockup from "@site/src/snippets/ReleaseHistoryLockup.mdx";
import ReleaseHistoryAirdrops from "../../src/snippets/_release-history-airdrops.mdx";
import ReleaseHistoryFlow from "../../src/snippets/_release-history-flow.mdx";
import ReleaseHistoryLegacy from "../../src/snippets/_release-history-legacy.mdx";
import ReleaseHistoryLockup from "../../src/snippets/_release-history-lockup.mdx";

Sablier is a powerful onchain token distribution protocol. Here are some key definitions:

Expand Down
6 changes: 3 additions & 3 deletions docs/guides/04-custom-deployments.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ bun install --frozen-lockfile
```

```bash
just build-optimized
bun run build-optimized
```

#### Step 4: Run the following deployment command
Expand Down Expand Up @@ -161,7 +161,7 @@ bun install --frozen-lockfile
```

```bash
just build-optimized
bun run build-optimized
```

#### Step 4: Run the following command to deploy all merkle airdrop contracts
Expand Down Expand Up @@ -236,7 +236,7 @@ bun install --frozen-lockfile
```

```bash
just build-optimized
bun run build-optimized
```

#### Step 4: Run the following deployment command
Expand Down
2 changes: 1 addition & 1 deletion docs/guides/airdrops/02-deployments.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ sidebar_position: 2
title: "Deployment Addresses"
---

import DeploymentsV1_3 from "@site/src/autogen/airdrops/TableDeploymentsV1.3.mdx";
import DeploymentsV1_3 from "../../../src/autogen/airdrops/_table-deployments-v1.3.mdx";

# Merkle Airdrops Deployments

Expand Down
2 changes: 1 addition & 1 deletion docs/guides/airdrops/04-campaign-verification.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ Clone the [sablier-labs/airdrops](https://github.com/sablier-labs/airdrops) repo
git clone [email protected]:sablier-labs/airdrops.git
git checkout v1.3.0
bun install --frozen-lockfile
just build-optimized
bun run build-optimized
```

## Step 6: Run the verification command
Expand Down
47 changes: 2 additions & 45 deletions docs/guides/airdrops/examples/01-local-environment.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,49 +4,6 @@ sidebar_position: 1
title: "Configure Your Local Environment"
---

import {
Introduction,
Prerequisite,
SetupWithFoundry,
InstallNpm,
FinalSteps,
} from "@site/src/snippets/LocalEnvironment.mdx";
import LocalEnvironmentAirdrops from "../../../../src/snippets/_local-environment-airdrops.mdx";

<Introduction protocol="Airdrops" />

## Pre-requisites

<Prerequisite />

## Set up using Foundry template

:::tip

Make sure you are using the latest version of Foundry by running `foundryup`.

:::

<SetupWithFoundry protocol="Airdrops" />

:::note

You might notice that the CLI is `forge` rather than `foundry`. This is because Foundry is a toolkit, and `forge` is
just one of the tools that comes with it.

:::

## Install Merkle Airdrops npm packages

:::tip

If you are integrating with `MerkleLL` or `MerkleLT`, you will also have to install
[Lockup npm package](/guides/lockup/examples/local-environment#install-lockup-npm-packages). Both `MerkleLL` and
`MerkleLT` contracts interact with Lockup protocol to setup up vesting for airdropped tokens.

:::

<InstallNpm protocol="Airdrops" />

## Next steps

<FinalSteps protocol="Airdrops" />
<LocalEnvironmentAirdrops protocol="Airdrops" />
11 changes: 6 additions & 5 deletions docs/guides/airdrops/examples/02-create-campaign.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@ sidebar_position: 2
title: "Create Campaigns"
---

import HardcodedDemonstration from "@site/src/components/atoms/HardcodedDemonstration";
import CautionNonProduction from "@site/src/snippets/CautionNonProduction.mdx";
import CodeBlock from "@theme/CodeBlock";
import HardcodedDemonstration from "../../../../src/snippets/_hardcoded-demonstration.mdx";
import CautionNonProduction from "../../../../src/snippets/_caution-non-production.mdx";

# Create Airdrop Campaigns

Expand Down Expand Up @@ -227,6 +228,6 @@ merkleLL = FACTORY.createMerkleLL({
Below you can see the full code. You can also access the code on GitHub through
[this link](https://github.com/sablier-labs/examples/blob/main/airdrops/MerkleCreator.sol).

```solidity reference title="Merkle Campaign Creator"
https://github.com/sablier-labs/examples/blob/main/airdrops/MerkleCreator.sol
```
<CodeBlock language="solidity" showLineNumbers metastring={`reference title="Merkle Campaign Creator"`}>
{`https://github.com/sablier-labs/examples/blob/main/airdrops/MerkleCreator.sol`}
</CodeBlock>
4 changes: 2 additions & 2 deletions docs/guides/flow/02-deployments.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ sidebar_position: 2
title: "Deployment Addresses"
---

import DeploymentsV1_1 from "@site/src/autogen/flow/TableDeploymentsV1.1.mdx";
import ReleaseHistoryFlow from "@site/src/snippets/ReleaseHistoryFlow.mdx";
import DeploymentsV1_1 from "../../../src/autogen/flow/_table-deployments-v1.1.mdx";
import ReleaseHistoryFlow from "../../../src/snippets/_release-history-flow.mdx";

# Flow Deployments

Expand Down
Loading