-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: setup vitepress docs * feat: add FedimintWallet docs * chore: change precommit hook to lint:fix * chore: updated typedoc command * feat: add github pages job for docs site * chore: add changeset * fix: base url
- Loading branch information
1 parent
451b025
commit 20a2783
Showing
45 changed files
with
3,305 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'@fedimint/core-web': patch | ||
--- | ||
|
||
Added a docs website powered by vitepress |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
name: Deploy Docs site to Pages | ||
|
||
on: | ||
# Runs on pushes targeting the `main` branch. Change this to `master` if you're | ||
# using the `master` branch as the default branch. | ||
push: | ||
branches: [main] | ||
paths: ['docs/**'] | ||
|
||
# Allows you to run this workflow manually from the Actions tab | ||
workflow_dispatch: | ||
|
||
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages | ||
permissions: | ||
contents: read | ||
pages: write | ||
id-token: write | ||
|
||
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued. | ||
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete. | ||
concurrency: | ||
group: pages | ||
cancel-in-progress: false | ||
|
||
jobs: | ||
# Build job | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Clone repository | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 # Not needed if lastUpdated is not enabled | ||
|
||
- name: Install dependencies | ||
uses: ./.github/actions/install-deps | ||
|
||
- name: Setup Pages | ||
uses: actions/configure-pages@v4 | ||
- name: Install dependencies | ||
run: pnpm i | ||
- name: Build with VitePress | ||
run: pnpm run docs:build | ||
- name: Upload artifact | ||
uses: actions/upload-pages-artifact@v3 | ||
with: | ||
path: docs/.vitepress/dist | ||
|
||
# Deployment job | ||
deploy: | ||
environment: | ||
name: github-pages | ||
url: ${{ steps.deployment.outputs.page_url }} | ||
needs: build | ||
runs-on: ubuntu-latest | ||
name: Deploy | ||
steps: | ||
- name: Deploy to GitHub Pages | ||
id: deployment | ||
uses: actions/deploy-pages@v4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
import { getSidebar } from './sidebar' | ||
import { withMermaid } from 'vitepress-plugin-mermaid' | ||
|
||
// https://vitepress.dev/reference/site-config | ||
export default withMermaid({ | ||
title: 'Fedimint Web Sdk', | ||
description: 'Building Fedimint Ecash into the web', | ||
ignoreDeadLinks: false, | ||
lang: 'en-US', | ||
lastUpdated: true, | ||
base: '/fedimint-web-sdk/', | ||
themeConfig: { | ||
// https://vitepress.dev/reference/default-theme-config | ||
editLink: { | ||
pattern: | ||
'https://github.com/fedimint/fedimint-web-sdk/edit/main/docs/:path', | ||
text: 'Suggest changes to this page', | ||
}, | ||
footer: { | ||
message: | ||
'Released under the <a href="https://github.com/fedimint/fedimint-web-sdk/blob/main/LICENSE">MIT License</a>.', | ||
}, | ||
nav: [ | ||
{ text: 'Home', link: '/' }, | ||
{ text: 'Core', link: '/core/getting-started' }, | ||
{ text: 'Packages', link: '/packages' }, | ||
{ text: 'Examples', link: '/examples' }, | ||
{ | ||
text: 'More', | ||
items: [ | ||
{ | ||
text: 'Contributing', | ||
link: '/dev/contributing', | ||
}, | ||
{ | ||
text: 'Discussions ', | ||
link: 'https://chat.fedimint.org', | ||
}, | ||
{ | ||
text: 'Release Notes ', | ||
link: 'https://github.com/fedimint/fedimint-web-sdk/releases', | ||
}, | ||
], | ||
}, | ||
], | ||
logo: { | ||
light: '/icon.png', | ||
dark: '/icon.png', | ||
alt: 'Fedimint Logo', | ||
}, | ||
sidebar: getSidebar(), | ||
|
||
socialLinks: [ | ||
{ | ||
icon: 'github', | ||
link: 'https://github.com/fedimint/fedimint-web-sdk', | ||
}, | ||
{ | ||
icon: 'discord', | ||
link: 'https://chat.fedimint.org', | ||
}, | ||
{ | ||
icon: 'twitter', | ||
link: 'https://twitter.com/fedimint', | ||
}, | ||
], | ||
|
||
outline: [2, 3], | ||
search: { | ||
provider: 'local', | ||
options: { | ||
_render(src, env, md) { | ||
const html = md.render(src, env) | ||
if (env.frontmatter?.search === false) return '' | ||
if (env.relativePath.startsWith('shared')) return '' | ||
return html | ||
}, | ||
}, | ||
}, | ||
}, | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
import type { DefaultTheme } from 'vitepress' | ||
import typedocSidebar from '../core/api/typedoc-sidebar.json' | ||
|
||
export function getSidebar() { | ||
return { | ||
'/core/': [ | ||
{ | ||
text: 'Getting Started', | ||
items: [ | ||
{ text: 'Overview', link: '/core/getting-started' }, | ||
{ text: 'Installation', link: '/core/installation' }, | ||
{ text: 'Architecture', link: '/core/architecture' }, | ||
], | ||
}, | ||
{ | ||
text: 'API', | ||
link: '/core/api/index.md', | ||
items: typedocSidebar, | ||
}, | ||
{ | ||
text: 'TEMP', | ||
items: [ | ||
{ text: 'Markdown Examples', link: '/temp/markdown-examples' }, | ||
{ text: 'Runtime API Examples', link: '/temp/api-examples' }, | ||
], | ||
}, | ||
], | ||
'/dev/': [ | ||
{ | ||
text: 'Dev', | ||
items: [ | ||
{ text: 'Contributing', link: '/dev/contributing' }, | ||
{ text: 'Testing', link: '/dev/testing' }, | ||
], | ||
}, | ||
], | ||
} satisfies DefaultTheme.Sidebar | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
# Constructor: FedimintWallet | ||
|
||
Creates a new instance of FedimintWallet. | ||
|
||
### new FedimintWallet() | ||
|
||
> **new FedimintWallet**(`lazy`): [`FedimintWallet`]() | ||
This constructor initializes a FedimintWallet instance, which manages communication | ||
with a Web Worker. The Web Worker is responsible for running WebAssembly code that | ||
handles the core Fedimint Client operations. | ||
|
||
(default) When not in lazy mode, the constructor immediately initializes the | ||
Web Worker and begins loading the WebAssembly module in the background. This | ||
allows for faster subsequent operations but may increase initial load time. | ||
|
||
In lazy mode, the Web Worker and WebAssembly initialization are deferred until | ||
the first operation that requires them, reducing initial overhead at the cost | ||
of a slight delay on the first operation. | ||
|
||
#### Parameters | ||
|
||
• **lazy**: `boolean` = `false` | ||
|
||
If true, delays Web Worker and WebAssembly initialization | ||
until needed. Default is false. | ||
|
||
#### Returns | ||
|
||
[`FedimintWallet`](constructor.md) | ||
|
||
#### Example | ||
|
||
```ts | ||
// Create a wallet with immediate initialization | ||
const wallet = new FedimintWallet() | ||
wallet.open() | ||
|
||
// Create a wallet with lazy initialization | ||
const lazyWallet = new FedimintWallet(true) | ||
// Some time later... | ||
lazyWallet.initialize() | ||
lazyWallet.open() | ||
``` | ||
|
||
#### Defined in | ||
|
||
[FedimintWallet.ts:63](https://github.com/fedimint/fedimint-web-sdk/blob/451b02527305a23fec3a269d39bde9a3ec377df2/packages/core-web/src/FedimintWallet.ts#L63) |
Oops, something went wrong.