Skip to content

Commit

Permalink
chore: setup references generation
Browse files Browse the repository at this point in the history
  • Loading branch information
ice-chillios committed Feb 20, 2025
1 parent 5d3e437 commit 0d3913a
Show file tree
Hide file tree
Showing 12 changed files with 93 additions and 133 deletions.
18 changes: 8 additions & 10 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,17 +1,15 @@
node_modules/

.DS_Store
.aider*
.astro/
.idea/
dist/
build/
cache/
*.tsbuildinfo

.env
*.mjs
!*.config.mjs
coverage/
.DS_Store
dist/
node_modules/
references/

*.log
*.tsbuildinfo
.env
.npmrc
.aider*
121 changes: 40 additions & 81 deletions bun.lock

Large diffs are not rendered by default.

26 changes: 23 additions & 3 deletions docs/astro.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@ import react from "@astrojs/react";
import starlight from "@astrojs/starlight";
import { rendererRich, transformerTwoslash } from "@shikijs/twoslash";
import { defineConfig } from "astro/config";
import { createStarlightTypeDocPlugin } from "starlight-typedoc";

const [helpersTypeDoc, helpersSidebarGroup] = createStarlightTypeDocPlugin();
const [apiTypeDoc, apiSidebarGroup] = createStarlightTypeDocPlugin();

// https://astro.build/config
export default defineConfig({
Expand All @@ -18,11 +22,25 @@ export default defineConfig({
starlight({
expressiveCode: false,
title: "SwapKit Docs",
customCss: ["./src/styles/global.css", "@shikijs/twoslash/style-rich.css"],
social: {
github: "https://github.com/thorswap/swapkit",
"x.com": "https://x.com/SwapKitPowered",
},
customCss: ["./src/styles/global.css", "@shikijs/twoslash/style-rich.css"],
plugins: [
helpersTypeDoc({
sidebar: { label: "@swapkit/helpers", collapsed: true },
entryPoints: ["../packages/helpers/src/index.ts"],
output: "references/helpers",
tsconfig: "./tsconfig.json",
}),
apiTypeDoc({
sidebar: { label: "@swapkit/helpers/api", collapsed: true },
entryPoints: ["../packages/helpers/src/api/index.ts"],
output: "references/api",
tsconfig: "./tsconfig.json",
}),
],
sidebar: [
{
label: "Guides",
Expand All @@ -31,9 +49,11 @@ export default defineConfig({
{ label: "Example Guide", slug: "guides/example" },
],
},
{ label: "Others", autogenerate: { directory: "others" } },
{
label: "Reference",
autogenerate: { directory: "reference" },
label: "References",
collapsed: true,
items: [apiSidebarGroup, helpersSidebarGroup],
},
],
}),
Expand Down
5 changes: 4 additions & 1 deletion docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@
"@swapkit/wallets": "workspace:*",
"astro": "5.3.0",
"expressive-code-twoslash": "0.4.0",
"sharp": "0.32.6"
"sharp": "0.33.5",
"starlight-typedoc": "0.19.0",
"typedoc": "0.27.7",
"typedoc-plugin-markdown": "4.4.2"
}
}
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -2,41 +2,11 @@
title: Migrate to v4
description: A guide to migrate to v4 and update your codebase.
---
import '@shikijs/twoslash/style-rich.css'

```ts twoslash
import { createSwapKit, SwapKitApi } from "@swapkit/sdk"

const s = SwapKitApi.getSwapQuote
const client = createSwapKit()

client.chainflip
// ^|
























import { EVMToolbox } from "@swapkit/toolboxes/evm"

const evm = EVMToolbox



Expand Down
8 changes: 8 additions & 0 deletions docs/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"extends": ["../node_modules/astro/tsconfigs/base.json", "../tools/typescript/base.json"],
"compilerOptions": {
"types": ["bun-types"]
},
"exclude": ["node_modules", "dist"],
"include": [".astro/types.d.ts", "./src", "../packages/**/*"]
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"devDependencies": {
"@biomejs/biome": "1.9.4",
"@changesets/changelog-github": "0.5.1",
"@changesets/cli": "2.28.0",
"@changesets/cli": "2.28.1",
"@types/node": "22.13.4",
"@types/react": "19.0.10",
"@types/react-dom": "19.0.4",
Expand Down
2 changes: 1 addition & 1 deletion packages/wallets/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"@cosmjs/crypto": "0.33.0",
"@cosmjs/proto-signing": "0.33.0",
"@keepkey/keepkey-sdk": "0.2.62",
"@keplr-wallet/types": "0.12.189",
"@keplr-wallet/types": "0.12.190",
"@ledgerhq/devices": "8.4.4",
"@ledgerhq/errors": "6.19.1",
"@ledgerhq/hw-app-btc": "10.5.0",
Expand Down
2 changes: 1 addition & 1 deletion playgrounds/nextjs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
"react": "19.0.0",
"react-dom": "19.0.0",
"react-hook-form": "7.54.2",
"sonner": "2.0.0",
"sonner": "2.0.1",
"stream-browserify": "3.0.0",
"stream-http": "3.2.0",
"tailwind-merge": "3.0.1",
Expand Down
6 changes: 4 additions & 2 deletions tools/typescript/base.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
"esModuleInterop": true,
"forceConsistentCasingInFileNames": true,
"incremental": true,
"isolatedModules": true,
"isolatedDeclarations": false,
"isolatedModules": true,
"jsx": "react-jsx",
"lib": ["dom", "dom.iterable", "ES2022"],
"module": "esnext",
Expand All @@ -26,6 +26,7 @@
"noUnusedLocals": true,
"noUnusedParameters": true,
"preserveSymlinks": false,
"pretty": true,
"resolveJsonModule": true,
"skipLibCheck": true,
"sourceMap": true,
Expand All @@ -34,8 +35,9 @@
"strictNullChecks": true,
"strictPropertyInitialization": true,
"target": "ES2022",
"types": ["bun-types"],
"useDefineForClassFields": true,
"types": ["bun-types"]
"verbatimModuleSyntax": true
},
"exclude": ["node_modules"]
}
2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@
"types": ["bun-types"]
},
"exclude": ["node_modules", "dist"],
"include": ["**/*"]
"include": ["./scripts"]
}

0 comments on commit 0d3913a

Please sign in to comment.