Skip to content

Commit

Permalink
docs: set up vitepress
Browse files Browse the repository at this point in the history
Signed-off-by: Till Sanders <[email protected]>
  • Loading branch information
tillsanders committed Mar 22, 2024
1 parent db1157f commit 7872dba
Show file tree
Hide file tree
Showing 7 changed files with 913 additions and 2 deletions.
56 changes: 56 additions & 0 deletions .github/workflows/pages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: Deploy Documentation

on:
push:
branches: [main]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write

# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: pages
cancel-in-progress: false

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0 # Not needed if lastUpdated is not enabled
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 20
cache: npm
- name: Setup Pages
uses: actions/configure-pages@v4
- name: Install dependencies
run: npm ci
- name: Build with VitePress
run: npm run docs:build
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: docs/.vitepress/dist

deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
needs: build
runs-on: ubuntu-latest
name: Deploy
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
node_modules/
coverage/
dist/
docs/.vitepress/dist
docs/.vitepress/cache
30 changes: 30 additions & 0 deletions docs/.vitepress/config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import { defineConfig } from 'vitepress'

// https://vitepress.dev/reference/site-config
export default defineConfig({
title: "ESMitter",
description: "ESMitter is a rewrite of the popular EventEmitter3 with a focus on modern tooling, TypeScript, and EcmaScript module syntax.",
themeConfig: {
// https://vitepress.dev/reference/default-theme-config
nav: [
{ text: 'Home', link: '/' },
{ text: 'Guide', link: '/guide' },
{ text: 'API Reference', link: '/api' }
],

sidebar: [
{
text: 'Examples',
items: [
{ text: 'Markdown Examples', link: '/markdown-examples' },
{ text: 'Runtime API Examples', link: '/api-examples' }
]
}
],

socialLinks: [
{ icon: 'npm', link: 'https://www.npmjs.com/package/esm-itter' },
{ icon: 'github', link: 'https://github.com/tillsanders/esm-itter' }
]
}
})
1 change: 1 addition & 0 deletions docs/guide.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Guide
29 changes: 29 additions & 0 deletions docs/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
---
# https://vitepress.dev/reference/default-theme-home-page
layout: home

hero:
name: "ESMitter"
text: "Modern, ESM-only, natively TypeScript event emitter for the browser and Node.js"
tagline: ESMitter is a rewrite of the popular EventEmitter3 with a focus on modern tooling, TypeScript, and EcmaScript module syntax.
actions:
- theme: brand
text: Get Started
link: /get-started
- theme: alt
text: API Reference
link: /api

features:
- title: Natively TypeScript
details: Rewritten in TypeScript, ESMitter offers strongly typed event context and listeners.
- title: ESM-only
details: No CommonJS/UMD/AMD, just a pure EcmaScript module with modern ES6+ syntax.
- title: Great Developer Experience
details: The latest tooling, Unit Tests, Code Coverage, Benchmarks and decent documentation.
---

::: warning
This project is currently in alpha stage.
:::

Loading

0 comments on commit 7872dba

Please sign in to comment.