Skip to content

Commit

Permalink
docs: add documentation generation
Browse files Browse the repository at this point in the history
  • Loading branch information
joeskeen committed Feb 8, 2024
1 parent 2b82e8f commit 6acd207
Show file tree
Hide file tree
Showing 5 changed files with 210 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
node_modules/
dist/
docs/
coverage/
lib/**/*.d.ts
.idea/
Expand Down
180 changes: 180 additions & 0 deletions package-lock.json

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

4 changes: 4 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@
"generate-types": "run-s generate-types:*",
"generate-types:generate": "del-cli \"lib/**/*.d.ts\" && npx bio-dts -r lib",
"generate-types:test": "tsc --noEmit --noImplicitAny",
"generate-docs": "typedoc",
"pregenerate-docs": "run-s generate-types",
"publish-docs": "scripts/publish-docs.sh",
"test": "karma start",
"prepublishOnly": "run-s generate-types"
},
Expand Down Expand Up @@ -77,6 +80,7 @@
"puppeteer": "^22.0.0",
"sinon": "^17.0.0",
"sinon-chai": "^3.7.0",
"typedoc": "^0.25.7",
"typescript": "^5.0.0",
"webpack": "^5.74.0"
},
Expand Down
20 changes: 20 additions & 0 deletions scripts/publish-docs.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/bin/bash

# use provided repository or default to bpmn-io/diagram-js
REPO="${1:-bpmn-io/diagram-js}"
GIT_REMOTE="[email protected]:$REPO.git"

parent_path=$( cd "$(dirname "${BASH_SOURCE[0]}")" ; pwd -P )
cd "$parent_path"
cd ..

npm run generate-docs

cd docs
git init
git add .
git commit -m "Deployed to Github Pages"
git checkout -b gh-pages

git remote add origin $GIT_REMOTE
git push --force $GIT_REMOTE gh-pages
5 changes: 5 additions & 0 deletions typedoc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"entryPoints": ["lib/**/*.d.ts"],
"out": "./docs",
"cleanOutputDir": true
}

0 comments on commit 6acd207

Please sign in to comment.