Skip to content

Commit

Permalink
Merge branch 'main' into add-ons
Browse files Browse the repository at this point in the history
  • Loading branch information
thedriftofwords authored Dec 19, 2024
2 parents be8fe36 + ca7d013 commit dd6e163
Show file tree
Hide file tree
Showing 426 changed files with 69,025 additions and 22,726 deletions.
2 changes: 2 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,5 @@ public/samples

/src/pages/chainlink-functions/resources/example-source.js
/src/env.d.ts

src/graphql/generated.ts
90 changes: 76 additions & 14 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,89 @@ name: Test
on: [push, pull_request]

jobs:
test:
name: Test
# Job 1: Check Solidity Compilation and Solhint
solidity:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./
steps:
- name: Checkout Repo
uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4
uses: actions/checkout@v4

- name: Cache NPM dependencies
uses: actions/cache@v3
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Install Dependencies
run: npm i
run: npm ci

- name: Check Solidity Compilation
run: npm run sol:compile

- name: Check Solidity Solhint
run: npm run lint-solc
- name: Check Eslint

# Job 2: Check ESLint
eslint:
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v4

- name: Cache NPM dependencies
uses: actions/cache@v3
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Install Dependencies
run: npm ci

- name: Check ESLint
run: npm run lint
- name: Build
run: npm run build
# TODO: fix css files throwing 404 errors
- name: Check internal links

# Job 3: Check Internal Links
linkcheck-internal:
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v4

- name: Cache NPM dependencies
uses: actions/cache@v3
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Install Dependencies
run: npm ci

- name: Check Internal Links
run: npm run linkcheck-internal
- name: Check types
run: npm run typecheck

# Job 4: Check Types
typecheck:
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v4

- name: Cache NPM dependencies
uses: actions/cache@v3
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Install Dependencies
run: npm ci

- name: Check Types
run: npm run typecheck
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# build output
dist/
.astro/
.vercel/

# dependencies
node_modules/
Expand Down Expand Up @@ -37,3 +38,4 @@ typechain-types/

.cache
.idea
.vercel
3 changes: 3 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
dist
.cache
.test
.vercel
.astro
temp
node_modules
.github
.changeset
Expand Down
1 change: 1 addition & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
"NUON",
"offchain",
"offramp",
"permissionally",
"preact",
"preconfigured",
"quickstarts",
Expand Down
19 changes: 19 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,22 @@ This repo is configured to automatically create a preview environment on Vercel
## Deploying to Production

This repo is configured to automatically update the production (`https://docs.chain.link`) site when commits are pushed to the `main` branch.

## Referencing Chainlink documentation

If you want to reference Chainlink documentation in your documentation, please include direct links to the page(s) you're referencing, so that your users can easily access the latest information. We also recommend keeping the amount of content that you quote to a minimum, in order to reduce the maintenance burden on your side.

For example:

```
Ethereum is integrated with the following Chainlink services:
- [Data Feeds](https://docs.chain.link/data-feeds/price-feeds/addresses?network=ethereum)
- [CCIP](https://docs.chain.link/ccip/directory/mainnet/chain/mainnet)
- [Functions](https://docs.chain.link/chainlink-functions/supported-networks#ethereum)
- [Automation](https://docs.chain.link/chainlink-automation/overview/supported-networks#ethereum)
- [VRF](https://docs.chain.link/vrf/v2-5/supported-networks#ethereum-mainnet)
Additionally, you may need to refer to the [LINK Token Contracts for Ethereum](https://docs.chain.link/resources/link-token-contracts#ethereum).
```

The most relevant documentation links for each supported chain and for each product are available in [this table](https://docs.chain.link/builders-quick-links).
15 changes: 15 additions & 0 deletions astro.config.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { defineConfig } from "astro/config"
import vercel from "@astrojs/vercel/serverless"
import preact from "@astrojs/preact"
import react from "@astrojs/react"
import mdx from "@astrojs/mdx"
Expand All @@ -7,10 +8,19 @@ import rehypeAutolinkHeadings from "rehype-autolink-headings"
import rehypeWrapAll from "rehype-wrap-all"
import sitemap from "@astrojs/sitemap"
import { RehypePlugins } from "@astrojs/markdown-remark"
import yaml from "@rollup/plugin-yaml"
import { ccipRedirects } from "./src/config/redirects/ccip"

// https://astro.build/config
export default defineConfig({
site: "https://docs.chain.link",
redirects: {
"/ccip/directory": "/ccip/directory/mainnet",
"/ccip/supported-networks": "/ccip/directory/mainnet",
"/getting-started": "/getting-started/conceptual-overview",
"/resources": "/resources/link-token-contracts",
...ccipRedirects,
},
integrations: [
preact({
include: ["**/preact/*"],
Expand All @@ -36,4 +46,9 @@ export default defineConfig({
syntaxHighlight: "prism",
smartypants: false,
},
output: "hybrid",
adapter: vercel(),
vite: {
plugins: [yaml()],
},
})
35 changes: 35 additions & 0 deletions codegen.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
import { CodegenConfig } from "@graphql-codegen/cli"
import dotenv from "dotenv"

dotenv.config()

const requiredEnvVars = ["GRAPHQL_SERVER_URL", "GRAPHQL_API_TOKEN"] as const

requiredEnvVars.forEach((envVar) => {
if (!process.env[envVar]) {
throw new Error(`Environment variable ${envVar} is not set. Please check your .env file.`)
}
})

const config: CodegenConfig = {
schema: [
{
[process.env.GRAPHQL_SERVER_URL as string]: {
headers: {
Authorization: `${process.env.GRAPHQL_API_TOKEN}`,
},
},
},
],
documents: "src/graphql/queries/**/*.gql",
generates: {
"src/graphql/generated.ts": {
plugins: ["typescript", "typescript-operations", "typescript-graphql-request"],
config: {
avoidOptionals: true,
},
},
},
}

export default config
Loading

0 comments on commit dd6e163

Please sign in to comment.