Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 41 additions & 0 deletions .github/workflows/build-docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: build docs
on:
push:
branches:
- main
jobs:
build-api-docs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Setup Node.js environment
uses: actions/setup-node@v3
with:
node-version: 'lts/*'

- name: Install dependencies
run: npm ci

- name: Build API docs
run: npm run docs:build

- name: Checkout documentation repository
uses: actions/checkout@v3
with:
token: ${{ secrets.DOCS_DEPLOY_GHP }}
repository: 'dice-roller/documentation'
path: './documentation'

- name: Copy API docs to documentation repository
run: |
rm -rf ./documentation/docs/api
mv ./docs/api ./documentation/docs/api

- name: Commit and push API doc changes
uses: EndBug/add-and-commit@v9
with:
cwd: './documentation'
add: './docs/api'
message: 'Auto API update from github workflow'
6 changes: 3 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
node-version: 'lts/*'

- name: Install dependencies
run: npm install
run: npm ci

- name: Run tests
run: npm run test:coverage
Expand All @@ -44,7 +44,7 @@ jobs:
node-version: 'lts/*'

- name: Install dependencies
run: npm install
run: npm ci

- name: Build Typescript
run: npm run build:declaration
Expand All @@ -61,7 +61,7 @@ jobs:
node-version: 'lts/*'

- name: Install dependencies
run: npm install
run: npm ci

- name: Build API docs
run: npm run docs:build
Expand Down
6 changes: 6 additions & 0 deletions docs/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Introduction

The technical API is for people wanting to delve a bit deeper into the classes that make up the library.

* If you want to get set up quickly, you should start with the [guide](../guide/readme.md).
* If you just want to roll some dice, check out the [notations](../guide/notation/readme.md).
164 changes: 59 additions & 105 deletions package-lock.json

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

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
"rollup-plugin-banner": "^0.2.1",
"rollup-plugin-terser": "^7.0.2",
"typescript": "^4.8.4",
"vuepress-jsdoc": "^4.3.0"
"vuepress-jsdoc": "^5.0.0"
},
"dependencies": {
"mathjs": "^11.2.1",
Expand All @@ -86,7 +86,7 @@
"build:dev": "npm run build:prepare && rollup --c --environment BUILD:dev",
"build:grammars": "peggy -c ./peggy.config.cjs ./src/parser/grammars/grammar.pegjs",
"build:prod": "npm run build:prepare && rollup --c --environment BUILD:prod",
"docs:build": "vuepress-jsdoc --dist ./docs --folder api --exclude=\"index.js,**/index.js,**/parser/grammars/*\" --partials=\"./docs/partials/**/*.hbs\"",
"docs:build": "vuepress-jsdoc --dist ./docs --folder api --exclude=\"index.js,**/index.js,**/parser/grammars/*\" --partials=\"./docs/partials/**/*.hbs\" --readme=\"./docs/readme.md\"",
"docs:watch": "npm run docs:build -- --watch",
"watch": "npm run build:dev -- -w",
"lint": "eslint src/** tests/**",
Expand Down