diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml new file mode 100644 index 0000000..8780557 --- /dev/null +++ b/.github/workflows/docs.yml @@ -0,0 +1,63 @@ +name: Docs + +on: + push: + branches: [main] + paths: + - "docs/**" + - ".github/workflows/docs.yml" + workflow_dispatch: + +permissions: + contents: read + pages: write + id-token: write + +concurrency: + group: pages + cancel-in-progress: false + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: "20" + + - name: Setup pnpm + uses: pnpm/action-setup@v4 + with: + version: 9 + + - name: Install root dependencies + run: pnpm install + + - name: Install docs dependencies + run: pnpm --dir docs install + + - name: Build docs + run: pnpm --dir docs docs:build + + - name: Setup Pages + uses: actions/configure-pages@v5 + + - name: Upload Pages artifact + uses: actions/upload-pages-artifact@v3 + with: + path: docs/.vitepress/dist + + deploy: + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + runs-on: ubuntu-latest + needs: build + steps: + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v4 diff --git a/docs-site/README.md b/docs-site/README.md new file mode 100644 index 0000000..52af8d5 --- /dev/null +++ b/docs-site/README.md @@ -0,0 +1,25 @@ +# docs-site + +This directory tracks the documentation site setup for GitHub Pages deployment. + +## Source of truth + +- Documentation content lives in `/docs`. +- VitePress configuration lives in `/docs/.vitepress/config.mjs`. +- CI/CD deployment is handled by `/.github/workflows/docs.yml`. + +## Local commands + +From repository root: + +```bash +pnpm --dir docs install +pnpm --dir docs docs:dev +pnpm --dir docs docs:build +``` + +The production build output is generated at: + +```text +docs/.vitepress/dist +``` diff --git a/docs-site/package.json b/docs-site/package.json new file mode 100644 index 0000000..c0308ab --- /dev/null +++ b/docs-site/package.json @@ -0,0 +1,9 @@ +{ + "name": "sorosave-docs-site", + "private": true, + "scripts": { + "dev": "pnpm --dir ../docs docs:dev", + "build": "pnpm --dir ../docs docs:build", + "preview": "pnpm --dir ../docs docs:preview" + } +} diff --git a/docs/.vitepress/config.mjs b/docs/.vitepress/config.mjs index fe6adae..505f858 100644 --- a/docs/.vitepress/config.mjs +++ b/docs/.vitepress/config.mjs @@ -2,7 +2,11 @@ export default { title: 'SoroSave SDK', description: 'TypeScript SDK for SoroSave - Decentralized Group Savings Protocol on Soroban', base: '/sdk/', + ignoreDeadLinks: true, themeConfig: { + search: { + provider: 'local', + }, nav: [ { text: 'Home', link: '/' }, { text: 'Guide', link: '/guide/getting-started' }, @@ -41,4 +45,4 @@ export default { copyright: 'Copyright © 2026 SoroSave Protocol' } } -} \ No newline at end of file +} diff --git a/docs/en/API.md b/docs/en/API.md index 7ba5e6a..10fe163 100644 --- a/docs/en/API.md +++ b/docs/en/API.md @@ -45,7 +45,7 @@ Manages savings groups. ### Methods -#### create(options: CreateGroupOptions): Promise +#### `create(options: CreateGroupOptions): Promise` Creates a new savings group. @@ -77,7 +77,7 @@ const group = await sdk.groups.create({ }); ``` -#### join(groupId: string): Promise +#### `join(groupId: string): Promise` Joins an existing group. @@ -90,7 +90,7 @@ Joins an existing group. await sdk.groups.join("group-123"); ``` -#### contribute(groupId: string, amount: number): Promise +#### `contribute(groupId: string, amount: number): Promise` Makes a contribution to a group. @@ -107,7 +107,7 @@ const tx = await sdk.groups.contribute("group-123", 100); console.log('Transaction:', tx.hash); ``` -#### get(groupId: string): Promise +#### `get(groupId: string): Promise` Gets detailed information about a group. @@ -123,7 +123,7 @@ const group = await sdk.groups.get("group-123"); console.log(group.name, group.totalSaved); ``` -#### list(options?: ListOptions): Promise +#### `list(options?: ListOptions): Promise` Lists available groups. @@ -146,7 +146,7 @@ const groups = await sdk.groups.list({ }); ``` -#### leave(groupId: string): Promise +#### `leave(groupId: string): Promise` Leaves a group. @@ -165,7 +165,7 @@ Manages user account operations. ### Methods -#### getAccount(): Promise +#### `getAccount(): Promise` Gets the current user's account information. @@ -178,7 +178,7 @@ const account = await sdk.user.getAccount(); console.log(account.address, account.balance); ``` -#### getGroups(): Promise +#### `getGroups(): Promise` Gets all groups the user is a member of. @@ -191,7 +191,7 @@ const myGroups = await sdk.user.getGroups(); myGroups.forEach(g => console.log(g.name)); ``` -#### getContributions(options?: ContributionOptions): Promise +#### `getContributions(options?: ContributionOptions): Promise` Gets the user's contribution history.