Omorphia
The Modrinth component library, in Svelte
Read the documentation at omorphia.modrinth.com.
Developing
The library lives in the src/ folder, and the documentation lives in the docs/ folder.
Getting started
Install Node (16.5+) and PNPM prior to developing.
To start the dev server, install dependencies and run pnpm dev:
pnpm install # Install dependencies
pnpm dev # Run dev server
To use the git hooks in the repo, which will save you waiting for CI to tell you that you forgot to lint, run this:
git config core.hookspath .githooks
Adding new components
Replace
ComponentNamewith your component name in the steps below
-
Create a
ComponentName.sveltefile insrc/components -
Add an export for your component in ./src/index.ts
export { default as ComponentName } from './components/ComponentName.svelte' -
Create a
ComponentName.mdfile for documentation indocs/routes/components -
Add an example of your component in your
ComponentName.mdfile, like so:```svelte example raised <script lang="ts"> import { ComponentName } from 'omorphia' </script> <ComponentName /> ```
Building
To build the documentation site, run:
pnpm build