diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml new file mode 100644 index 0000000..8641474 --- /dev/null +++ b/.github/workflows/docs.yml @@ -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 diff --git a/apps/docs/README.md b/apps/docs/README.md new file mode 100644 index 0000000..3bb11a4 --- /dev/null +++ b/apps/docs/README.md @@ -0,0 +1 @@ +This is a [Vocs](https://vocs.dev) project bootstrapped with the Vocs CLI. diff --git a/apps/docs/docs/footer.tsx b/apps/docs/docs/footer.tsx new file mode 100644 index 0000000..170f033 --- /dev/null +++ b/apps/docs/docs/footer.tsx @@ -0,0 +1,18 @@ +const Footer = () => { + return ( +

+ Maintained by{" "} + + Palladians + + . +

+ ); +}; + +export default Footer; diff --git a/apps/docs/docs/pages/example.mdx b/apps/docs/docs/pages/example.mdx new file mode 100644 index 0000000..e7bd19c --- /dev/null +++ b/apps/docs/docs/pages/example.mdx @@ -0,0 +1,3 @@ +# Example + +This is an example page. \ No newline at end of file diff --git a/apps/docs/docs/pages/getting-started.mdx b/apps/docs/docs/pages/getting-started.mdx new file mode 100644 index 0000000..99b8616 --- /dev/null +++ b/apps/docs/docs/pages/getting-started.mdx @@ -0,0 +1,3 @@ +# Get started + +Hello world! \ No newline at end of file diff --git a/apps/docs/docs/pages/index.mdx b/apps/docs/docs/pages/index.mdx new file mode 100644 index 0000000..6b156dc --- /dev/null +++ b/apps/docs/docs/pages/index.mdx @@ -0,0 +1,15 @@ +--- +layout: landing +--- + +import { HomePage } from 'vocs/components' + + + + The TypeScript interface for Mina Protocol. + MinaJS is the missing piece for your smooth zkApp development on Mina. + + Get started + GitHub + + diff --git a/apps/docs/docs/public/logo.svg b/apps/docs/docs/public/logo.svg new file mode 100644 index 0000000..c605c78 --- /dev/null +++ b/apps/docs/docs/public/logo.svg @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + + + diff --git a/apps/docs/docs/styles.css b/apps/docs/docs/styles.css new file mode 100644 index 0000000..98a3263 --- /dev/null +++ b/apps/docs/docs/styles.css @@ -0,0 +1,3 @@ +@layer vocs_preflight { @tailwind base; } +@tailwind components; +@tailwind utilities; diff --git a/apps/docs/package.json b/apps/docs/package.json new file mode 100644 index 0000000..6e2a656 --- /dev/null +++ b/apps/docs/package.json @@ -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" + } +} diff --git a/apps/docs/tailwind.config.cjs b/apps/docs/tailwind.config.cjs new file mode 100644 index 0000000..7ebabac --- /dev/null +++ b/apps/docs/tailwind.config.cjs @@ -0,0 +1,8 @@ +/** @type {import('tailwindcss').Config} */ +module.exports = { + content: ["./docs/**/*.{html,md,mdx,tsx,js,jsx}"], + theme: { + extend: {}, + }, + plugins: [], +}; diff --git a/apps/docs/tsconfig.json b/apps/docs/tsconfig.json new file mode 100644 index 0000000..679dbe6 --- /dev/null +++ b/apps/docs/tsconfig.json @@ -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"] +} diff --git a/apps/docs/vocs.config.ts b/apps/docs/vocs.config.ts new file mode 100644 index 0000000..0a64453 --- /dev/null +++ b/apps/docs/vocs.config.ts @@ -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" }, + ], + }, + ], +}); diff --git a/apps/klesia/src/index.ts b/apps/klesia/src/index.ts index 5acc3a3..f631abe 100644 --- a/apps/klesia/src/index.ts +++ b/apps/klesia/src/index.ts @@ -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"; @@ -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", diff --git a/bun.lockb b/bun.lockb index 423e4fb..7c14377 100755 Binary files a/bun.lockb and b/bun.lockb differ diff --git a/packages/klesia-sdk/src/client.ts b/packages/klesia-sdk/src/client.ts index 5e5e969..3014aa1 100644 --- a/packages/klesia-sdk/src/client.ts +++ b/packages/klesia-sdk/src/client.ts @@ -9,9 +9,7 @@ export const createClient = ({ network, }: { network: "mainnet" | "devnet" }) => { return match(NetworkMatcher.parse(network)) - .with("devnet", () => - hc("https://devnet.klesia.palladians.xyz"), - ) + .with("devnet", () => hc("https://devnet.klesia.palladians.xyz")) .with("mainnet", () => hc("https://mainnet.klesia.palladians.xyz"), )