Skip to content

Commit

Permalink
Generate docs with typedoc
Browse files Browse the repository at this point in the history
  • Loading branch information
fwcd committed Aug 15, 2022
1 parent 894388a commit c284ea9
Show file tree
Hide file tree
Showing 8 changed files with 240 additions and 3 deletions.
50 changes: 50 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: Docs

on:
push:
branches:
- main
workflow_dispatch:

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

# Allow one concurrent deployment
concurrency:
group: "pages"
cancel-in-progress: true

jobs:
docs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Set up Pages
uses: actions/configure-pages@v1
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: 17
- name: Install dependencies
run: npm install
- name: Generate Docs
run: npm run generate-docs
- name: Upload artifact
uses: actions/upload-pages-artifact@v1
with:
path: ./docs

deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: docs

steps:
- name: Deploy Docs
uses: actions/deploy-pages@v1
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ out
lib
*.tsbuildinfo
.env
docs
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Nighthouse

[![Build](https://github.com/fwcd/nighthouse/actions/workflows/build.yml/badge.svg)](https://github.com/fwcd/nighthouse/actions/workflows/build.yml)
[![Docs](https://github.com/fwcd/nighthouse/actions/workflows/docs.yml/badge.svg)](https://fwcd.github.io/nighthouse)

A lightweight, asynchronous Project Lighthouse client for JavaScript that runs both in the browser and Node.js environments.

Expand Down
168 changes: 167 additions & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 9 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,22 @@
"version": "0.0.1",
"description": "Lightweight Project Lighthouse client for JavaScript",
"private": true,
"workspaces": ["packages/*", "examples/*"],
"workspaces": [
"packages/*",
"examples/*"
],
"scripts": {
"build": "tsc -b tsconfig.json",
"watch": "tsc -b tsconfig.json -w",
"prepare": "npm run build"
"prepare": "npm run build",
"generate-docs": "typedoc --entryPointStrategy packages packages/browser packages/common packages/node --tsconfig ./tsconfig.json"
},
"author": "fwcd",
"license": "MIT",
"dependencies": {
"@msgpack/msgpack": "^2.7.2"
},
"devDependencies": {
"typedoc": "^0.23.10"
}
}
4 changes: 4 additions & 0 deletions packages/browser/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@
"description": "Lightweight Project Lighthouse client for the browser",
"main": "lib/index.js",
"types": "lib/index.d.ts",
"typedoc": {
"entryPoint": "src/index.ts",
"displayName": "Nighthouse Browser"
},
"scripts": {
"build": "tsc -b tsconfig.json",
"watch": "tsc -b tsconfig.json -w",
Expand Down
4 changes: 4 additions & 0 deletions packages/common/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@
"description": "Shared Project Lighthouse client structures",
"main": "lib/index.js",
"types": "lib/index.d.ts",
"typedoc": {
"entryPoint": "src/index.ts",
"displayName": "Nighthouse Common"
},
"scripts": {
"build": "tsc -b tsconfig.json",
"watch": "tsc -b tsconfig.json -w",
Expand Down
4 changes: 4 additions & 0 deletions packages/node/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@
"description": "Lightweight Project Lighthouse client for Node.js",
"main": "lib/index.js",
"types": "lib/index.d.ts",
"typedoc": {
"entryPoint": "src/index.ts",
"displayName": "Nighthouse Node"
},
"scripts": {
"build": "tsc -b tsconfig.json",
"watch": "tsc -b tsconfig.json -w",
Expand Down

0 comments on commit c284ea9

Please sign in to comment.