Skip to content

Commit

Permalink
Add typedoc
Browse files Browse the repository at this point in the history
  • Loading branch information
olegbl committed Jun 10, 2024
1 parent 93af6f7 commit f8cc90f
Show file tree
Hide file tree
Showing 6 changed files with 140 additions and 14 deletions.
32 changes: 32 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Generate Docs

on:
push:
branches:
- main

jobs:
build:
runs-on: windows-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Install Node
uses: actions/setup-node@v3
with:
node-version: 16
architecture: 'x64'

- name: Install dependencies
run: npm install

- name: Generate documentation
run: npm run docs

- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./docs
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Releases
release/*.zip
CHANGELOG.md
/docs/

# Logs
logs
Expand Down
7 changes: 5 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@
"start:main": "cross-env NODE_ENV=development electron -r ts-node/register/transpile-only ./src/main/main.ts",
"start:renderer": "cross-env NODE_ENV=development TS_NODE_TRANSPILE_ONLY=true webpack serve --config ./.erb/configs/webpack.config.renderer.dev.ts",
"test": "jest",
"prepare": "husky install"
"prepare": "husky install",
"docs": "typedoc"
},
"lint-staged": {
"*.{js,jsx,ts,tsx}": [
Expand Down Expand Up @@ -192,7 +193,9 @@
"react-beautiful-dnd": "^13.1.0",
"react-dom": "^17.0.2",
"react-router-dom": "^6.2.1",
"regenerator-runtime": "^0.13.9"
"regenerator-runtime": "^0.13.9",
"typedoc": "^0.25.13",
"typedoc-plugin-markdown": "^4.0.3"
},
"devEngines": {
"node": ">=14.x",
Expand Down
36 changes: 24 additions & 12 deletions src/renderer/ModConfigTypes.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,57 +74,69 @@ export type ModConfigValue = Readonly<{
type BindingLiteralValue<T> = T;

type BindingConfigValue<_T extends ModConfigSingleValue> = [
'value',
operator: 'value',
id: string
];

type BindingConditional<T> = [
'if',
operator: 'if',
condition: Binding<boolean>,
thenBinding: Binding<T>,
elseBinding: Binding<T>
];

type BindingNot = ['not', binding: Binding<boolean>];
type BindingNot = [operator: 'not', binding: Binding<boolean>];

type BindingAnd = [
'and',
operator: 'and',
binding1: Binding<boolean>,
binding2: Binding<boolean>
];

type BindingOr = ['or', binding1: Binding<boolean>, binding2: Binding<boolean>];
type BindingOr = [
operator: 'or',
binding1: Binding<boolean>,
binding2: Binding<boolean>
];

type BindingEquals<T> = ['eq', binding1: Binding<T>, binding2: Binding<T>];
type BindingEquals<T> = [
operator: 'eq',
binding1: Binding<T>,
binding2: Binding<T>
];

type BindingNotEquals<T> = ['neq', binding1: Binding<T>, binding2: Binding<T>];
type BindingNotEquals<T> = [
operator: 'neq',
binding1: Binding<T>,
binding2: Binding<T>
];

type BindingLessThan = [
'lt',
operator: 'lt',
binding1: Binding<number>,
binding2: Binding<number>
];

type BindingLessThanOrEqual = [
'lte',
operator: 'lte',
binding1: Binding<number>,
binding2: Binding<number>
];

type BindingGreaterThan = [
'gt',
operator: 'gt',
binding1: Binding<number>,
binding2: Binding<number>
];

type BindingGreaterThanOrEqual = [
'gte',
operator: 'gte',
binding1: Binding<number>,
binding2: Binding<number>
];

type BindingIncludes<T> = [
'in',
operator: 'in',
binding1: Binding<T>,
binding2: T extends string
? Binding<string[]>
Expand Down
9 changes: 9 additions & 0 deletions typedoc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"entryPoints": [
"src/renderer/ConsoleAPITypes.d.ts",
"src/renderer/ModAPITypes.d.ts",
"src/renderer/ModConfigTypes.d.ts",
],
"out": "docs",
"plugin": ["typedoc-plugin-markdown"]
}
69 changes: 69 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1973,6 +1973,11 @@ ansi-regex@^6.0.1:
resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-6.0.1.tgz#3183e38fae9a65d7cb5e53945cd5897d0260a06a"
integrity sha512-n5M855fKb2SsfMIiFFoVrABHJC8QtHwVx+mHWP3QcEqBHYienj5dHSgjbxtC0WEZXYt4wcD6zrQElDPhFuZgfA==

ansi-sequence-parser@^1.1.0:
version "1.1.1"
resolved "https://registry.yarnpkg.com/ansi-sequence-parser/-/ansi-sequence-parser-1.1.1.tgz#e0aa1cdcbc8f8bb0b5bca625aac41f5f056973cf"
integrity sha512-vJXt3yiaUL4UU546s3rPXlsry/RnM730G1+HkpKE012AN0sx1eOrxSu95oKDIonskeLTijMgqWZ3uDEe3NFvyg==

ansi-styles@^3.2.1:
version "3.2.1"
resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-3.2.1.tgz#41fbb20243e50b12be0f04b8dedbf07520ce841d"
Expand Down Expand Up @@ -2384,6 +2389,13 @@ brace-expansion@^1.1.7:
balanced-match "^1.0.0"
concat-map "0.0.1"

brace-expansion@^2.0.1:
version "2.0.1"
resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-2.0.1.tgz#1edc459e0f0c548486ecf9fc99f2221364b9a0ae"
integrity sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==
dependencies:
balanced-match "^1.0.0"

braces@^3.0.1, braces@~3.0.2:
version "3.0.2"
resolved "https://registry.yarnpkg.com/braces/-/braces-3.0.2.tgz#3454e1a462ee8d599e236df336cd9ea4f8afe107"
Expand Down Expand Up @@ -6083,6 +6095,11 @@ json5@^1.0.1:
dependencies:
minimist "^1.2.0"

jsonc-parser@^3.2.0:
version "3.2.1"
resolved "https://registry.yarnpkg.com/jsonc-parser/-/jsonc-parser-3.2.1.tgz#031904571ccf929d7670ee8c547545081cb37f1a"
integrity sha512-AilxAyFOAcK5wA1+LeaySVBrHsGQvUFCDWXKpZjzaL0PqW+xfBOttn8GNtWKFWqneyMZj41MWF9Kl6iPWLwgOA==

jsonfile@^4.0.0:
version "4.0.0"
resolved "https://registry.yarnpkg.com/jsonfile/-/jsonfile-4.0.0.tgz#8771aae0799b64076b76640fca058f9c10e33ecb"
Expand Down Expand Up @@ -6375,6 +6392,11 @@ lru-cache@^6.0.0:
dependencies:
yallist "^4.0.0"

lunr@^2.3.9:
version "2.3.9"
resolved "https://registry.yarnpkg.com/lunr/-/lunr-2.3.9.tgz#18b123142832337dd6e964df1a5a7707b25d35e1"
integrity sha512-zTU3DaZaF3Rt9rhN3uBMGQD3dD2/vFQqnvZCDv4dl5iOzq2IZQqTxu90r4E5J+nP70J3ilqVCrbho2eWaeW8Ow==

lz-string@^1.4.4:
version "1.4.4"
resolved "https://registry.yarnpkg.com/lz-string/-/lz-string-1.4.4.tgz#c0d8eaf36059f705796e1e344811cf4c498d3a26"
Expand Down Expand Up @@ -6430,6 +6452,11 @@ [email protected]:
dependencies:
tmpl "1.0.5"

marked@^4.3.0:
version "4.3.0"
resolved "https://registry.yarnpkg.com/marked/-/marked-4.3.0.tgz#796362821b019f734054582038b116481b456cf3"
integrity sha512-PRsaiG84bK+AMvxziE/lCFss8juXjNaWzVbN5tXAm4XjeaS9NAHhop+PjQxz2A9h8Q4M/xGmzP8vqNwy6JeK0A==

matcher@^3.0.0:
version "3.0.0"
resolved "https://registry.yarnpkg.com/matcher/-/matcher-3.0.0.tgz#bd9060f4c5b70aa8041ccc6f80368760994f30ca"
Expand Down Expand Up @@ -6560,6 +6587,13 @@ [email protected], minimatch@^3.0.4:
dependencies:
brace-expansion "^1.1.7"

minimatch@^9.0.3:
version "9.0.4"
resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-9.0.4.tgz#8e49c731d1749cbec05050ee5145147b32496a51"
integrity sha512-KqWh+VchfxcMNRAJjj2tnsSJdNbHsVgnkBhTNrW7AjVo6OvLtxw8zfT9oLw1JSohlFzJ8jCoTgaoXvJ+kHt6fw==
dependencies:
brace-expansion "^2.0.1"

minimist@^0.1.0:
version "0.1.0"
resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.1.0.tgz#99df657a52574c21c9057497df742790b2b4c0de"
Expand Down Expand Up @@ -8218,6 +8252,16 @@ shebang-regex@^3.0.0:
resolved "https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-3.0.0.tgz#ae16f1644d873ecad843b0307b143362d4c42172"
integrity sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==

shiki@^0.14.7:
version "0.14.7"
resolved "https://registry.yarnpkg.com/shiki/-/shiki-0.14.7.tgz#c3c9e1853e9737845f1d2ef81b31bcfb07056d4e"
integrity sha512-dNPAPrxSc87ua2sKJ3H5dQ/6ZaY8RNnaAqK+t0eG7p0Soi2ydiqbGOTaZCqaYvA/uZYfS1LJnemt3Q+mSfcPCg==
dependencies:
ansi-sequence-parser "^1.1.0"
jsonc-parser "^3.2.0"
vscode-oniguruma "^1.7.0"
vscode-textmate "^8.0.0"

side-channel@^1.0.4:
version "1.0.4"
resolved "https://registry.yarnpkg.com/side-channel/-/side-channel-1.0.4.tgz#efce5c8fdc104ee751b25c58d4290011fa5ea2cf"
Expand Down Expand Up @@ -8918,6 +8962,21 @@ typedarray@^0.0.6:
resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777"
integrity sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=

typedoc-plugin-markdown@^4.0.3:
version "4.0.3"
resolved "https://registry.yarnpkg.com/typedoc-plugin-markdown/-/typedoc-plugin-markdown-4.0.3.tgz#c452a654f6e66ea911eb80a6a03ebe85a32a3065"
integrity sha512-0tZbeVGGCd4+lpoIX+yHWgUfyaLZCQCgJOpuVdTtOtD3+jKaedJ4sl/tkNaYBPeWVKiyDkSHfGuHkq53jlzIFg==

typedoc@^0.25.13:
version "0.25.13"
resolved "https://registry.yarnpkg.com/typedoc/-/typedoc-0.25.13.tgz#9a98819e3b2d155a6d78589b46fa4c03768f0922"
integrity sha512-pQqiwiJ+Z4pigfOnnysObszLiU3mVLWAExSPf+Mu06G/qsc3wzbuM56SZQvONhHLncLUhYzOVkjFFpFfL5AzhQ==
dependencies:
lunr "^2.3.9"
marked "^4.3.0"
minimatch "^9.0.3"
shiki "^0.14.7"

typescript@^4.5.4:
version "4.5.5"
resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.5.5.tgz#d8c953832d28924a9e3d37c73d729c846c5896f3"
Expand Down Expand Up @@ -9079,6 +9138,16 @@ verror@^1.10.0:
core-util-is "1.0.2"
extsprintf "^1.2.0"

vscode-oniguruma@^1.7.0:
version "1.7.0"
resolved "https://registry.yarnpkg.com/vscode-oniguruma/-/vscode-oniguruma-1.7.0.tgz#439bfad8fe71abd7798338d1cd3dc53a8beea94b"
integrity sha512-L9WMGRfrjOhgHSdOYgCt/yRMsXzLDJSL7BPrOZt73gU0iWO4mpqzqQzOz5srxqTvMBaR0XZTSrVWo4j55Rc6cA==

vscode-textmate@^8.0.0:
version "8.0.0"
resolved "https://registry.yarnpkg.com/vscode-textmate/-/vscode-textmate-8.0.0.tgz#2c7a3b1163ef0441097e0b5d6389cd5504b59e5d"
integrity sha512-AFbieoL7a5LMqcnOF04ji+rpXadgOXnZsxQr//r83kLPr7biP7am3g9zbaZIaBGwBRWeSvoMD4mgPdX3e4NWBg==

w3c-hr-time@^1.0.2:
version "1.0.2"
resolved "https://registry.yarnpkg.com/w3c-hr-time/-/w3c-hr-time-1.0.2.tgz#0a89cdf5cc15822df9c360543676963e0cc308cd"
Expand Down

0 comments on commit f8cc90f

Please sign in to comment.