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
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ packages/frontend/src/generated.ts

# Typedoc generated api reference.
# Ignored to discourage manual editing
packages/docs/docs/pages/*/api
packages/docs/docs/pages/**/api

# Cloned Repositories
packages/bundler/alto
Expand Down
23 changes: 18 additions & 5 deletions packages/docs/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,16 @@ dev: ## Serves the docs in watch mode
--names "doc-js,doc-react,vocs" \
'make typedoc-js.watch'\
'make typedoc-react.watch'\
'make typedoc-txm.watch'\
'make vocs.watch';
.PHONY: dev

# precompile API reference docs, then build full vocs output
build: typedoc vocs ## Generates the latest docs from source code
.PHONY: build

clean: ## Removes build artifacts
clean: typedoc.clean ## Removes build artifacts
rm -rf docs/dist
rm -rf docs/pages/{js,react}/api
rm -rf vocs.config.ts.timestamp-*
rm -rf node_modules/.tmp
.PHONY: clean
Expand All @@ -45,13 +45,15 @@ vocs.watch:

# generate all markdown API reference
typedoc: ## Generates the markdown files from package source code
concurrently --names "js,react"\
concurrently --names "js,react,txm"\
'make typedoc-js'\
'make typedoc-react';
'make typedoc-react'\
'make typedoc-txm';
Comment thread
norswap marked this conversation as resolved.
.PHONY: typedoc

typedoc.clean:
rm -rf docs/pages/{js,react}/api
rm -rf docs/pages/sdk/{js,react}/api
rm -rf docs/pages/transaction-manager/api
.PHONY: typedoc

# generate JS markdown API reference
Expand All @@ -78,3 +80,14 @@ typedoc-react.watch:
--options ./typedoc.react.js;
.PHONY: typedoc-react.watch

# generate Transaction Manager markdown API reference
typedoc-txm:
typedoc --options ./typedoc.txm.js;
.PHONY: typedoc-txm

# generate Transaction Manager markdown API reference in watch mode
typedoc-txm.watch:
typedoc\
--watch\
--options ./typedoc.txm.js;
.PHONY: typedoc-txm.watch
69 changes: 1 addition & 68 deletions packages/docs/docs/pages/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,72 +2,5 @@
layout: doc
---

import { HomePage } from 'vocs/components'

# HappyChain SDK

## JavaScript & TypeScript

<div style={{display: 'flex', alignItems: 'center', gap: '1rem'}}>
<HomePage.Description>
Integrate the Happy Wallet without a web framework or with an unsupported framework.
</HomePage.Description>
</div>

:::code-group

```bash [npm]
npm install @happychain/js
```

```bash [pnpm]
pnpm add @happychain/js
```

```bash [yarn]
yarn add @happychain/js
```

```bash [bun]
bun add @happychain/js
```

:::

<HomePage.Buttons>
<HomePage.Button href="/js/getting-started" variant="accent">Get Started</HomePage.Button>
<HomePage.Button href="/js/api" variant="accent">Full API Reference</HomePage.Button>
</HomePage.Buttons>

## React

<div style={{display: 'flex', alignItems: 'center', gap: '1rem'}}>
<HomePage.Description>Integrate the Happy Wallet with React</HomePage.Description>
</div>

:::code-group

```bash [npm]
npm install @happychain/react
```

```bash [pnpm]
pnpm add @happychain/react
```

```bash [yarn]
yarn add @happychain/react
```

```bash [bun]
bun add @happychain/react
```

:::

<HomePage.Buttons>
<HomePage.Button href="/react/getting-started" variant="accent">Get Started</HomePage.Button>
<HomePage.Button href="/react/api" variant="accent">Full API Reference</HomePage.Button>
</HomePage.Buttons>

# HappyChain Docs

73 changes: 73 additions & 0 deletions packages/docs/docs/pages/sdk/index.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
---
layout: doc
---

import { HomePage } from 'vocs/components'

# HappyChain SDK

## JavaScript & TypeScript

<div style={{display: 'flex', alignItems: 'center', gap: '1rem'}}>
<HomePage.Description>
Integrate the Happy Wallet without a web framework or with an unsupported framework.
</HomePage.Description>
</div>

:::code-group

```bash [npm]
npm install @happychain/js
```

```bash [pnpm]
pnpm add @happychain/js
```

```bash [yarn]
yarn add @happychain/js
```

```bash [bun]
bun add @happychain/js
```

:::

<HomePage.Buttons>
<HomePage.Button href="/sdk/js/getting-started" variant="accent">Get Started</HomePage.Button>
<HomePage.Button href="/sdk/js/api" variant="accent">Full API Reference</HomePage.Button>
</HomePage.Buttons>

## React

<div style={{display: 'flex', alignItems: 'center', gap: '1rem'}}>
<HomePage.Description>Integrate the Happy Wallet with React</HomePage.Description>
</div>

:::code-group

```bash [npm]
npm install @happychain/react
```

```bash [pnpm]
pnpm add @happychain/react
```

```bash [yarn]
yarn add @happychain/react
```

```bash [bun]
bun add @happychain/react
```

:::

<HomePage.Buttons>
<HomePage.Button href="/sdk/react/getting-started" variant="accent">Get Started</HomePage.Button>
<HomePage.Button href="/sdk/react/api" variant="accent">Full API Reference</HomePage.Button>
</HomePage.Buttons>


Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ import { happyProvider } from '@happychain/js'

User changes, such as when a user logs in or out, can be subscribed to the `onUserUpdate` listener.
If the `user` is undefined, then they are not currently logged in have or have logged out.
If the `user` is a [HappyUser](/js/api/type-aliases/HappyUser) then it will be populated with all their
If the `user` is a [HappyUser](/sdk/js/api/type-aliases/HappyUser) then it will be populated with all their
shared info, such as wallet address and name.

```ts twoslash
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ import { happyProvider } from '@happychain/react'

### Getting the Active User

The `useHappyChain` hook returns the current user as a [HappyUser](/react/api/type-aliases/HappyUser)
The `useHappyChain` hook returns the current user as a [HappyUser](/sdk/react/api/type-aliases/HappyUser)
if the user is connected, otherwise it returns undefined.

```tsx twoslash
Expand All @@ -90,7 +90,7 @@ function UserAddressComponent() {

User changes, such as when a user logs in or out, can be subscribed to the `onUserUpdate` listener.
If the `user` is undefined, then they are not currently logged in have or have logged out.
If the `user` is a [HappyUser](/react/api/type-aliases/HappyUser) then it will be populated with all their
If the `user` is a [HappyUser](/sdk/react/api/type-aliases/HappyUser) then it will be populated with all their
shared info, such as wallet address and name.

```ts twoslash
Expand Down
Loading