Skip to content

Commit

Permalink
Docusaurus (#93)
Browse files Browse the repository at this point in the history
* feat: setup docasaurus

* chore: docusaurus needs this static folder to run correctly

* chore: change port

* chore: decent condition

* chore: set gitRevision to always be main to reduce changes in docs

* chore: init adding version param

* Revert "chore: init adding version param"

This reverts commit 25fba47.

* Release  sdk 2.15.0 🚀 (#84)

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* Release  sdk-react-provider 0.3.0 🚀 (#83)

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* Release  customer 0.1.0 🚀 (#81)

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* feat: setup docasaurus

* chore: decent condition

* docs: add pre-push generate docs

* docs: add pre-push generate docs

* docs: adjust links in READMEs

* docs: adjust index

* docs: adjust landing page, add gh page deploy

* docs: rename to developer

* docs: rename tools to packages

* docs: update lockfile

* docs: update gitignore

* docs: add static

* docs: skip commit if there is nothing to commit

* docs: skip commit if there is nothing to commit

* docs: trigger change

* docs: add correct out

* docs: set correct docusaurus build folder

* docs: add baseUrl for project

* docs: switch illustrations

* docs: only run the doc deploy step on main

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
  • Loading branch information
einaralex and github-actions[bot] authored Aug 23, 2024
1 parent a64fff5 commit 3ff670c
Show file tree
Hide file tree
Showing 176 changed files with 8,494 additions and 1,815 deletions.
24 changes: 24 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,30 @@ jobs:
- name: Build
run: pnpm build

- name: Generate Documentation
if: github.ref == 'refs/heads/main'
run: pnpm run generate-docs

- name: Commit and Push Documentation
if: github.ref == 'refs/heads/main'
run: |
git config --global user.name "GitHub Actions"
git config --global user.email "[email protected]"
git add ./apps/developer/docs/packages/
if [ -n "$(git status --porcelain)" ]; then
git commit -m "docs: update generated documentation"
git push
else
echo "No changes to commit"
fi
- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v4
if: github.ref == 'refs/heads/main'
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./apps/developer/build

- name: Test
run: pnpm test

Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ out/
build
dist
static
!apps/developer/static

# Debug
npm-debug.log*
Expand Down
1 change: 1 addition & 0 deletions .husky/pre-push
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
pnpm run generate-docs
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,8 @@ The pipeline will automatically publish the following packages if there are chan

#### Useful links

[Release please - Github action](https://github.com/marketplace/actions/release-please-action)</br>
[Release please - Github action](https://github.com/marketplace/actions/release-please-action)

[Release please - Config file options](https://github.com/googleapis/release-please/blob/main/docs/manifest-releaser.md#configfile)

### Remote Caching
Expand Down
20 changes: 20 additions & 0 deletions apps/developer/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Dependencies
/node_modules

# Production
/build

# Generated files
.docusaurus
.cache-loader

# Misc
.DS_Store
.env.local
.env.development.local
.env.test.local
.env.production.local

npm-debug.log*
yarn-debug.log*
yarn-error.log*
41 changes: 41 additions & 0 deletions apps/developer/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Website

This website is built using [Docusaurus](https://docusaurus.io/), a modern static website generator.

### Installation

```
$ yarn
```

### Local Development

```
$ yarn start
```

This command starts a local development server and opens up a browser window. Most changes are reflected live without having to restart the server.

### Build

```
$ yarn build
```

This command generates static content into the `build` directory and can be served using any static contents hosting service.

### Deployment

Using SSH:

```
$ USE_SSH=true yarn deploy
```

Not using SSH:

```
$ GIT_USER=<Your GitHub username> yarn deploy
```

If you are using GitHub pages for hosting, this command is a convenient way to build the website and push to the `gh-pages` branch.
3 changes: 3 additions & 0 deletions apps/developer/babel.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = {
presets: [require.resolve('@docusaurus/core/lib/babel/preset')],
};
1 change: 1 addition & 0 deletions apps/developer/docs/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Welcome
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# Function: MoneriumProvider()

> **MoneriumProvider**(`params`): `Element`
## Parameters

**params**

**params.children**: `ReactNode`

Rest of the application.

**params.clientId**: `string`

Monerium auth flow client id.

**params.environment?**: `"sandbox"` \| `"production"` = `'sandbox'`

Monerium environment.

**params.redirectUri**: `string`

Monerium auth flow redirect url.

**params.redirectUrl?**: `string`

**Deprecated**

use redirectUri

## Returns

`Element`

## Defined in

[provider.tsx:19](https://github.com/monerium/js-monorepo/blob/main/packages/sdk-react-provider/src/lib/provider.tsx#L19)
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
[Monerium SDK React Provider](../README.md) / useAuth

# Function: useAuth()

> **useAuth**(): [`UseAuthReturn`](../type-aliases/UseAuthReturn.md)
> **useAuth**(): [`UseAuthReturn`](/docs/packages/SDK%20React%20Provider/type-aliases/UseAuthReturn.md)
# Redirect to the Monerium auth flow.

## Returns

[`UseAuthReturn`](../type-aliases/UseAuthReturn.md)
[`UseAuthReturn`](/docs/packages/SDK%20React%20Provider/type-aliases/UseAuthReturn.md)

- `authorize` - Redirects to the Monerium auth flow.
- `authorize` - Redirects to the Monerium auth flow.
- `isAuthorized` - Whether the user is authorized.
- `isLoading` - Whether the auth flow is loading.
- `error` - Error message if the auth flow fails.
Expand All @@ -30,4 +28,4 @@ authorize({ address, signature, chain }).

## Defined in

[sdk-react-provider/src/lib/hooks.tsx:85](https://github.com/monerium/js-monorepo/blob/main/packages/sdk-react-provider/src/lib/hooks.tsx#L85)
[hooks.tsx:85](https://github.com/monerium/js-monorepo/blob/main/packages/sdk-react-provider/src/lib/hooks.tsx#L85)
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# Function: useAuthContext()

> **useAuthContext**(`params`?): [`QueryResult`](/docs/packages/SDK%20React%20Provider/type-aliases/QueryResult.md)\<`"authContext"`, `AuthContext`\>
# Get the authentication context.

## Parameters

**params?** = `{}`

No required parameters.

**params.query?**: [`QueryOptions`](/docs/packages/SDK%20React%20Provider/type-aliases/QueryOptions.md)\<`AuthContext`\>

See [Tanstack Query - useQuery](https://tanstack.com/query/latest/docs/framework/react/reference/useQuery) options.

## Returns

[`QueryResult`](/docs/packages/SDK%20React%20Provider/type-aliases/QueryResult.md)\<`"authContext"`, `AuthContext`\>

## Example

```ts
const {
authContext, // useQuery's `data` property
isLoading,
isError,
error,
refetch,
...moreUseQueryResults
} = useAuthContext();
```

## See

[API Documentation](https://monerium.dev/api-docs#operation/auth-context)

[AuthContext interface](/docs/packages/SDK/interfaces/AuthContext.md)

## Defined in

[hooks.tsx:125](https://github.com/monerium/js-monorepo/blob/main/packages/sdk-react-provider/src/lib/hooks.tsx#L125)
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# Function: useBalances()

> **useBalances**(`params`?): [`QueryResult`](/docs/packages/SDK%20React%20Provider/type-aliases/QueryResult.md)\<`"balances"`, `Balances`[]\>
# Get balances

## Parameters

**params?** = `{}`

No required parameters.

**params.profileId?**: `string`

Fetch balances for a specific profile.

**params.query?**: [`QueryOptions`](/docs/packages/SDK%20React%20Provider/type-aliases/QueryOptions.md)\<`Balances`[]\>

See [Tanstack Query - useQuery](https://tanstack.com/query/latest/docs/framework/react/reference/useQuery) options.

## Returns

[`QueryResult`](/docs/packages/SDK%20React%20Provider/type-aliases/QueryResult.md)\<`"balances"`, `Balances`[]\>

## Example

```ts
const {
balances, // useQuery's `data` property
isLoading,
isError,
error,
refetch,
...moreUseQueryResults
} = useBalances();
```

## See

[API Documentation](https://monerium.dev/api-docs#operation/profile-balances)

[Balances interface](/docs/packages/SDK/interfaces/Balances.md)

## Defined in

[hooks.tsx:337](https://github.com/monerium/js-monorepo/blob/main/packages/sdk-react-provider/src/lib/hooks.tsx#L337)
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# Function: useLinkAddress()

> **useLinkAddress**(`param`): [`MutationResult`](/docs/packages/SDK%20React%20Provider/type-aliases/MutationResult.md)\<`"linkAddress"`, `LinkedAddress`, `Error`, `LinkAddress`\>
# Add address to profile.
When the address has been linked, the relevant profile query will be invalidated and re-fetched.

## Parameters

**param**

**param.mutation?**: [`MutationOptions`](/docs/packages/SDK%20React%20Provider/type-aliases/MutationOptions.md)\<`LinkedAddress`, `Error`, `LinkAddress`\>

See [Tanstack Query - useMutation](https://tanstack.com/query/latest/docs/framework/react/reference/useMutation) options.

**param.profileId**: `string`

Which profile to link the address.

## Returns

[`MutationResult`](/docs/packages/SDK%20React%20Provider/type-aliases/MutationResult.md)\<`"linkAddress"`, `LinkedAddress`, `Error`, `LinkAddress`\>

## Example

```ts
const {
linkAddress, // useMutation's `mutateAsync` property
isPending,
isError,
error,
status,
...moreUseMutationResults
} = useLinkAddress();
```

## See

[API Documentation](https://monerium.dev/api-docs#operation/profile-addresses)

[LinkAddress interface](/docs/packages/SDK/interfaces/LinkAddress.md)

## Defined in

[hooks.tsx:594](https://github.com/monerium/js-monorepo/blob/main/packages/sdk-react-provider/src/lib/hooks.tsx#L594)
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# Function: useOrder()

> **useOrder**(`params`): [`QueryResult`](/docs/packages/SDK%20React%20Provider/type-aliases/QueryResult.md)\<`"order"`, `Order`\>
# Get single order

## Parameters

**params**

**params.orderId**: `string`

The id of the order.

**params.query?**: [`QueryOptions`](/docs/packages/SDK%20React%20Provider/type-aliases/QueryOptions.md)\<`Order`\> = `{}`

See [Tanstack Query - useQuery](https://tanstack.com/query/latest/docs/framework/react/reference/useQuery) options.

## Returns

[`QueryResult`](/docs/packages/SDK%20React%20Provider/type-aliases/QueryResult.md)\<`"order"`, `Order`\>

## Example

```ts
const {
order, // useQuery's `data` property
isLoading,
isError,
error,
refetch,
...moreUseQueryResults
} = useOrder();
```

## See

[API Documentation](https://monerium.dev/api-docs#operation/order)

[Order interface](/docs/packages/SDK/interfaces/Order.md)

## Defined in

[hooks.tsx:389](https://github.com/monerium/js-monorepo/blob/main/packages/sdk-react-provider/src/lib/hooks.tsx#L389)
Loading

0 comments on commit 3ff670c

Please sign in to comment.