Skip to content

Commit

Permalink
feat(minajs): add docs
Browse files Browse the repository at this point in the history
  • Loading branch information
mrcnk committed Sep 3, 2024
1 parent 14e740e commit 6c652b0
Show file tree
Hide file tree
Showing 15 changed files with 213 additions and 5 deletions.
34 changes: 34 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Deploy to GitHub Pages
on:
push:
branches: [main]
workflow_dispatch:
permissions:
contents: read
pages: write
id-token: write
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout your repository using git
uses: actions/checkout@v4
- uses: oven-sh/setup-bun@v2
- run: bun i --no-save
- run: bun run build
- uses: actions/upload-artifact@v4
with:
name: docs
path: apps/docs/docs/dist
deploy:
needs: build
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
with:
artifact_name: docs
1 change: 1 addition & 0 deletions apps/docs/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
This is a [Vocs](https://vocs.dev) project bootstrapped with the Vocs CLI.
18 changes: 18 additions & 0 deletions apps/docs/docs/footer.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
const Footer = () => {
return (
<p>
Maintained by{" "}
<a
href="https://palladians.xyz"
target="_blank"
rel="noopener noreferrer"
className="vocs_HomePage_packageManager underline"
>
Palladians
</a>
.
</p>
);
};

export default Footer;
3 changes: 3 additions & 0 deletions apps/docs/docs/pages/example.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Example

This is an example page.
3 changes: 3 additions & 0 deletions apps/docs/docs/pages/getting-started.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Get started

Hello world!
15 changes: 15 additions & 0 deletions apps/docs/docs/pages/index.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
layout: landing
---

import { HomePage } from 'vocs/components'

<HomePage.Root>
<img src="/logo.svg" className="w-24" />
<HomePage.Tagline>The TypeScript interface for Mina Protocol.</HomePage.Tagline>
<HomePage.Description>MinaJS is the missing piece for your smooth zkApp development on Mina.</HomePage.Description>
<HomePage.Buttons>
<HomePage.Button href="/getting-started" variant="accent">Get started</HomePage.Button>
<HomePage.Button href="https://github.com/palladians/mina-js">GitHub</HomePage.Button>
</HomePage.Buttons>
</HomePage.Root>
18 changes: 18 additions & 0 deletions apps/docs/docs/public/logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions apps/docs/docs/styles.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
@layer vocs_preflight { @tailwind base; }
@tailwind components;
@tailwind utilities;
17 changes: 17 additions & 0 deletions apps/docs/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"name": "@mina-js/docs",
"version": "0.0.1",
"type": "module",
"scripts": {
"dev": "bunx vocs dev",
"build": "bunx vocs build",
"preview": "bunx vocs preview"
},
"dependencies": {
"@types/react": "latest",
"react": "latest",
"react-dom": "latest",
"typescript": "latest",
"vocs": "latest"
}
}
8 changes: 8 additions & 0 deletions apps/docs/tailwind.config.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/** @type {import('tailwindcss').Config} */
module.exports = {
content: ["./docs/**/*.{html,md,mdx,tsx,js,jsx}"],
theme: {
extend: {},
},
plugins: [],
};
24 changes: 24 additions & 0 deletions apps/docs/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"compilerOptions": {
"target": "ES2020",
"useDefineForClassFields": true,
"lib": ["ES2020", "DOM", "DOM.Iterable"],
"module": "ESNext",
"skipLibCheck": true,

/* Bundler mode */
"moduleResolution": "bundler",
"allowImportingTsExtensions": true,
"resolveJsonModule": true,
"isolatedModules": true,
"noEmit": true,
"jsx": "react-jsx",

/* Linting */
"strict": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"noFallthroughCasesInSwitch": true
},
"include": ["**/*.ts", "**/*.tsx"]
}
66 changes: 66 additions & 0 deletions apps/docs/vocs.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
import { defineConfig } from "vocs";

export default defineConfig({
title: "MinaJS",
description: "The TypeScript interface for Mina Protocol.",
logoUrl: "/logo.svg",
theme: {
accentColor: {
light: "#907aa9",
dark: "#c4a7e7",
},
variables: {
color: {
background: {
light: "#fffaf3",
dark: "#1f1d2e",
},
backgroundDark: {
light: "#faf4ed",
dark: "#191724",
},
codeBlockBackground: {
light: "#faf4ed",
dark: "#191724",
},
codeTitleBackground: {
light: "#f2e9e1",
dark: "#26233a",
},
codeInlineBorder: {
light: "#9893a5",
dark: "#6e6a86",
},
},
},
},
socials: [
{ icon: "github", link: "https://github.com/palladians/mina-js" },
{ icon: "discord", link: "https://get.pallad.co/discord" },
],
sidebar: [
{
text: "Getting Started",
link: "/getting-started",
},
{
text: "MinaJS Connect",
link: "/connect",
items: [{ text: "Introduction", link: "/connect" }],
},
{
text: "MinaJS Accounts",
link: "/accounts",
items: [{ text: "Introduction", link: "/accounts" }],
},
{
text: "Klesia",
link: "/klesia",
items: [
{ text: "Introduction", link: "/klesia" },
{ text: "JSON-RPC", link: "/klesia/rpc" },
{ text: "TypeScript SDK", link: "/klesia/sdk" },
],
},
],
});
4 changes: 2 additions & 2 deletions apps/klesia/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { OpenAPIHono, createRoute } from "@hono/zod-openapi";
import { PublicKeySchema } from "@mina-js/shared";
import { apiReference } from "@scalar/hono-api-reference";
import { rateLimiter } from "hono-rate-limiter";
import { cors } from 'hono/cors'
import { cors } from "hono/cors";
import { logger } from "hono/logger";
import { nanoid } from "nanoid";
import { match } from "ts-pattern";
Expand All @@ -28,7 +28,7 @@ api.use(
limit: 10,
}),
);
api.use('/api', cors({ origin: '*' }))
api.use("/api", cors({ origin: "*" }));

api.doc("/api/openapi", {
openapi: "3.0.0",
Expand Down
Binary file modified bun.lockb
Binary file not shown.
4 changes: 1 addition & 3 deletions packages/klesia-sdk/src/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,7 @@ export const createClient = ({
network,
}: { network: "mainnet" | "devnet" }) => {
return match(NetworkMatcher.parse(network))
.with("devnet", () =>
hc<KlesiaRpc>("https://devnet.klesia.palladians.xyz"),
)
.with("devnet", () => hc<KlesiaRpc>("https://devnet.klesia.palladians.xyz"))
.with("mainnet", () =>
hc<KlesiaRpc>("https://mainnet.klesia.palladians.xyz"),
)
Expand Down

0 comments on commit 6c652b0

Please sign in to comment.