Skip to content

Commit e1a0e6d

Browse files
committed
[feature] introduce TypeDoc to the project again
1 parent 5c1e0c6 commit e1a0e6d

File tree

7 files changed

+300
-2
lines changed

7 files changed

+300
-2
lines changed

.circleci/config.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,21 @@ jobs:
6969
name: Build
7070
command: yarn build
7171

72+
generate-docs:
73+
docker:
74+
- image: cimg/node:<< pipeline.parameters.node-image-tag >>
75+
resource_class: << pipeline.parameters.resource-class >>
76+
steps:
77+
- checkout
78+
- install-yarn
79+
- install-dependencies
80+
- run:
81+
name: Build
82+
command: yarn build
83+
- run:
84+
name: Generate Docs
85+
command: yarn docs:all
86+
7287
run-example:
7388
docker:
7489
- image: cimg/node:<< pipeline.parameters.node-image-tag >>
@@ -90,4 +105,5 @@ workflows:
90105
- lint
91106
- build
92107
- coverage
108+
- generate-docs
93109
- run-example

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,3 +27,6 @@ package-lock.json
2727
!.yarn/versions
2828
#!.yarn/cache
2929
.pnp.*
30+
31+
# Typedoc output
32+
doc/

changes

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
diff --git a/.circleci/config.yml b/.circleci/config.yml
2+
index 0f9cbca..aec2d6b 100644
3+
--- a/.circleci/config.yml
4+
+++ b/.circleci/config.yml
5+
@@ -69,6 +69,21 @@ jobs:
6+
name: Build
7+
command: yarn build
8+
9+
+ generate-docs:
10+
+ docker:
11+
+ - image: cimg/node:<< pipeline.parameters.node-image-tag >>
12+
+ resource_class: << pipeline.parameters.resource-class >>
13+
+ steps:
14+
+ - checkout
15+
+ - install-yarn
16+
+ - install-dependencies
17+
+ - run:
18+
+ name: Build
19+
+ command: yarn build
20+
+ - run:
21+
+ name: Generate Docs
22+
+ command: yarn docs:all
23+
+
24+
run-example:
25+
docker:
26+
- image: cimg/node:<< pipeline.parameters.node-image-tag >>
27+
@@ -90,4 +105,5 @@ workflows:
28+
- lint
29+
- build
30+
- coverage
31+
+ - generate-docs
32+
- run-example
33+
diff --git a/.gitignore b/.gitignore
34+
index 2680f21..50804b0 100644
35+
--- a/.gitignore
36+
+++ b/.gitignore
37+
@@ -27,3 +27,6 @@ package-lock.json
38+
!.yarn/versions
39+
#!.yarn/cache
40+
.pnp.*
41+
+
42+
+# Typedoc output
43+
+doc/
44+
\ No newline at end of file
45+
diff --git a/package.json b/package.json
46+
index c9a8d1c..a986c3c 100644
47+
--- a/package.json
48+
+++ b/package.json
49+
@@ -19,6 +19,9 @@
50+
"example": "yarn workspace @evolvedbinary/lwdita-xdita run example",
51+
"test": "mocha",
52+
"test:watch": "mocha -w",
53+
+ "docs:ast": "typedoc --options typedoc.config.mjs --entryPoints packages/lwdita-ast/src/index.ts --out doc/ast",
54+
+ "docs:xdita": "typedoc --options typedoc.config.mjs --entryPoints packages/lwdita-xdita/src/index.ts --out doc/xdita",
55+
+ "docs:all": "rimraf doc && yarn docs:ast && yarn docs:xdita",
56+
"lint": "eslint",
57+
"coverage": "rimraf coverage && nyc yarn mocha",
58+
"coveralls": "nyc --reporter=text-lcov report | coveralls"
59+
@@ -62,6 +65,7 @@
60+
"nodemon": "^3.1.10",
61+
"nyc": "^17.1.0",
62+
"rimraf": "^6.1.0",
63+
+ "typedoc": "^0.28.14",
64+
"typescript": "5.9.3",
65+
"typescript-eslint": "^8.46.2"
66+
},
67+
diff --git a/tsconfig.json b/tsconfig.json
68+
index 2614f00..50d46b6 100644
69+
--- a/tsconfig.json
70+
+++ b/tsconfig.json
71+
@@ -1,6 +1,6 @@
72+
{
73+
"extends": "@tsconfig/recommended/tsconfig.json",
74+
-
75+
+ "exclude": ["**/test/**", "**/dist/**", "node_modules", "eslint.config.mts"],
76+
// overrides recommended
77+
"compilerOptions": {
78+
"skipLibCheck": false, /* Do NOT skip type checking of declaration files. */
79+
@@ -9,7 +9,6 @@
80+
"sourceMap": true, /* Generates corresponding '.map' file. */
81+
"noEmit": false, /* NOTE(AR) just making it explicit that we are using tsc (and not another tool) to emit compiled JavaScript */
82+
"moduleResolution": "node10", /* NOTE(AR) just making it explicit that this is the tsc compilation strategy for module resolution that we are currently using */
83+
- "rootDir": "src",
84+
"outDir": "dist", /* Redirect output structure to the `dist/` directory. */
85+
},
86+
}

package.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@
1919
"example": "yarn workspace @evolvedbinary/lwdita-xdita run example",
2020
"test": "mocha",
2121
"test:watch": "mocha -w",
22+
"docs:ast": "typedoc --options typedoc.config.mjs --entryPoints packages/lwdita-ast/src/index.ts --out doc/ast",
23+
"docs:xdita": "typedoc --options typedoc.config.mjs --entryPoints packages/lwdita-xdita/src/index.ts --out doc/xdita",
24+
"docs:all": "rimraf doc && yarn docs:ast && yarn docs:xdita",
2225
"lint": "eslint",
2326
"coverage": "rimraf coverage && nyc yarn mocha",
2427
"coveralls": "nyc --reporter=text-lcov report | coveralls"
@@ -62,6 +65,7 @@
6265
"nodemon": "^3.1.10",
6366
"nyc": "^17.1.0",
6467
"rimraf": "^6.1.0",
68+
"typedoc": "^0.28.14",
6569
"typescript": "5.9.3",
6670
"typescript-eslint": "^8.46.2"
6771
},

tsconfig.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"extends": "@tsconfig/recommended/tsconfig.json",
3-
3+
"exclude": ["**/test/**", "**/dist/**", "node_modules", "eslint.config.mts"],
44
// overrides recommended
55
"compilerOptions": {
66
"skipLibCheck": false, /* Do NOT skip type checking of declaration files. */
@@ -9,7 +9,6 @@
99
"sourceMap": true, /* Generates corresponding '.map' file. */
1010
"noEmit": false, /* NOTE(AR) just making it explicit that we are using tsc (and not another tool) to emit compiled JavaScript */
1111
"moduleResolution": "node10", /* NOTE(AR) just making it explicit that this is the tsc compilation strategy for module resolution that we are currently using */
12-
"rootDir": "src",
1312
"outDir": "dist", /* Redirect output structure to the `dist/` directory. */
1413
},
1514
}

typedoc.config.mjs

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
/*!
2+
Copyright (C) 2020 Evolved Binary
3+
4+
This program is free software: you can redistribute it and/or modify
5+
it under the terms of the GNU Affero General Public License as
6+
published by the Free Software Foundation, either version 3 of the
7+
License, or (at your option) any later version.
8+
9+
This program is distributed in the hope that it will be useful,
10+
but WITHOUT ANY WARRANTY; without even the implied warranty of
11+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12+
GNU Affero General Public License for more details.
13+
14+
You should have received a copy of the GNU Affero General Public License
15+
along with this program. If not, see <https://www.gnu.org/licenses/>.
16+
*/
17+
18+
import { OptionDefaults } from "typedoc";
19+
20+
/** @type {Partial<import('typedoc').TypeDocOptions>} */
21+
const config = {
22+
tsconfig: "./tsconfig.json",
23+
modifierTags: [...OptionDefaults.modifierTags, "@decorator"],
24+
highlightLanguages: ["ts", "js", "xml", "json", "bash"],
25+
treatWarningsAsErrors: true,
26+
treatValidationWarningsAsErrors: true,
27+
};
28+
29+
export default config;

0 commit comments

Comments
 (0)