Skip to content

Commit

Permalink
chore: update docs with create-fedimint-app script information (#108)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexlwn123 authored Dec 17, 2024
1 parent 014ea79 commit 62e9ad2
Show file tree
Hide file tree
Showing 6 changed files with 194 additions and 13 deletions.
4 changes: 3 additions & 1 deletion .github/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
| [`@fedimint/react`](https://web.fedimint.org/docs/core/getting-started) | ![NPM Version (latest)](<https://img.shields.io/npm/v/%40fedimint%2Freact?style=plastic&logo=npm&logoColor=rgb(187%2C%2054%2C%2057)&label=%40fedimint%2Freact>) | React components and hooks for interacting with the Fedimint client |
| [`@fedimint/wasm-web`](../packages/wasm-web/README.md) | ![NPM Version (latest)](<https://img.shields.io/npm/v/%40fedimint%2Ffedimint-client-wasm-web?style=plastic&logo=npm&logoColor=rgb(187%2C%2054%2C%2057)&label=%40fedimint%2Fwasm-web&link=https%3A%2F%2Fwww.npmjs.com%2Fpackage%2F%40fedimint%2Ffedimint-client-wasm-web>) | Not intended for direct use. Contains the wasm pack output (target web) for the Fedimint client wasm. |
| [`@fedimint/wasm-bundler`](../packages/wasm-bundler/README.md) | ![NPM Version (latest)](<https://img.shields.io/npm/v/%40fedimint%2Ffedimint-client-wasm-bundler?style=plastic&logo=npm&logoColor=rgb(187%2C%2054%2C%2057)&label=%40fedimint%2Fwasm-bundler&link=https%3A%2F%2Fwww.npmjs.com%2Fpackage%2F%40fedimint%2Ffedimint-client-wasm-bundler>) | Not intended for direct use. Contains the wasm pack output (target bundler) for the Fedimint client wasm. |
| [`create-fedimint-app`](../packages/create-fedimint-app/README.md) | ![NPM Version (latest)](<https://img.shields.io/npm/v/create-fedimint-app?style=plastic&logo=npm&logoColor=rgb(187%2C%2054%2C%2057)&label=create-fedimint-app&link=https%3A%2F%2Fwww.npmjs.com%2Fpackage%2Fcreate-fedimint-app>) | Scaffold a new Fedimint app with Vite, React, and TypeScript. |

## Structure 🛠️

Expand All @@ -42,7 +43,8 @@ fedimint-web-sdk
├── core-web
├── react
├── wasm-web
└── wasm-bundler
├── wasm-bundler
└── create-fedimint-app
```

### Examples
Expand Down
11 changes: 11 additions & 0 deletions docs/.vitepress/config.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
import { getSidebar } from './sidebar'
import { transformerTwoslash } from '@shikijs/vitepress-twoslash'
import {
groupIconMdPlugin,
groupIconVitePlugin,
} from 'vitepress-plugin-group-icons'
import { defineConfig } from 'vitepress'

// https://vitepress.dev/reference/site-config
Expand All @@ -13,6 +17,13 @@ export default defineConfig({
// TODO: Fix version conflicts
// @ts-ignore
codeTransformers: [transformerTwoslash()],
config: (md) => {
// @ts-ignore
md.use(groupIconMdPlugin)
},
},
vite: {
plugins: [groupIconVitePlugin()],
},
/* prettier-ignore */
head: [
Expand Down
1 change: 1 addition & 0 deletions docs/.vitepress/theme/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import TwoslashFloatingVue from '@shikijs/vitepress-twoslash/client'
import type { EnhanceAppContext } from 'vitepress'

import './custom.css'
import 'virtual:group-icons.css'

import '@shikijs/vitepress-twoslash/style.css'

Expand Down
76 changes: 65 additions & 11 deletions docs/core/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,66 @@ This is very new. Use with caution. [Report bugs](https://github.com/fedimint/fe
APIs may change.
:::

## Installation
## Scaffolding your first project

To add @fedimint/core-web to your project, install the package using your preferred package manager:
::: tip Compatibility Note
Most `create-fedimint-app` templates require [Node.js](https://nodejs.org/en/) version 18+ or 20+.
:::

::: code-group

```bash [npm]
npm create fedimint-app
```

```bash [yarn]
yarn create fedimint-app
```

```bash [pnpm]
pnpm add @fedimint/core-web
pnpm create fedimint-app
```

```bash [bun]
bun create fedimint-app
```

:::

Then follow the prompts!

You can also directly specify the project name and the template you want to use via additional command line options. For example, to scaffold a Fedimint + React project, run:

::: code-group

```bash [npm]
npm create fedimint-app@latest my-fedimint-app -- --template vite-react-ts
```

```bash [yarn]
yarn create fedimint-app my-fedimint-app --template vite-react-ts
```

```bash [pnpm]
pnpm create fedimint-app my-fedimint-app --template vite-react-ts
```

```bash [bun]
bun create fedimint-app my-fedimint-app --template vite-react-ts
```

:::

See [create-fedimint-app](https://github.com/fedimint/fedimint-web-sdk/tree/main/packages/create-fedimint-app) for more details on each supported template.

You can use `.` for the project name to scaffold in the current directory.

## Manual Installation

To add @fedimint/core-web to your project, install the package using your preferred package manager:

::: code-group

```bash [npm]
npm install @fedimint/core-web
```
Expand All @@ -24,6 +74,10 @@ npm install @fedimint/core-web
yarn add @fedimint/core-web
```

```bash [pnpm]
pnpm add @fedimint/core-web
```

```bash [bun]
bun add @fedimint/core-web
```
Expand Down Expand Up @@ -119,14 +173,6 @@ If you you see errors with top level await, you may need to install the `vite-pl

::: code-group

```bash [pnpm]
# Required
pnpm add vite-plugin-wasm

# Typically not needed, but may be required in some projects.
pnpm add vite-plugin-top-level-await
```

```bash [npm]
# Required
npm i vite-plugin-wasm
Expand All @@ -143,6 +189,14 @@ yarn add vite-plugin-wasm
yarn add vite-plugin-top-level-await
```

```bash [pnpm]
# Required
pnpm add vite-plugin-wasm

# Typically not needed, but may be required in some projects.
pnpm add vite-plugin-top-level-await
```

```bash [bun]
# Required
bun add vite-plugin-wasm
Expand Down
3 changes: 2 additions & 1 deletion docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"devDependencies": {
"@fedimint/core-web": "workspace:*",
"@shikijs/vitepress-twoslash": "1.4.0",
"vitepress": "1.1.4"
"vitepress": "1.1.4",
"vitepress-plugin-group-icons": "^1.3.1"
}
}
Loading

0 comments on commit 62e9ad2

Please sign in to comment.