Skip to content

Commit c20cd26

Browse files
committed
[feature] TypeDoc setup should be at package level
1 parent 1af8a6f commit c20cd26

File tree

8 files changed

+40
-8
lines changed

8 files changed

+40
-8
lines changed

.circleci/config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ jobs:
8282
command: yarn build
8383
- run:
8484
name: Generate Docs
85-
command: yarn docs:all
85+
command: yarn generate-docs
8686

8787
run-example:
8888
docker:

package.json

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,7 @@
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",
22+
"generate-docs": "yarn workspaces foreach --parallel --recursive --from '@evolvedbinary/lwdita-*' run docs",
2523
"lint": "eslint",
2624
"coverage": "rimraf coverage && nyc yarn mocha",
2725
"coveralls": "nyc --reporter=text-lcov report | coveralls"
@@ -65,7 +63,6 @@
6563
"nodemon": "^3.1.10",
6664
"nyc": "^17.1.0",
6765
"rimraf": "^6.1.0",
68-
"typedoc": "^0.28.14",
6966
"typescript": "5.9.3",
7067
"typescript-eslint": "^8.46.2"
7168
},

packages/lwdita-ast/package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@
1010
"scripts": {
1111
"build": "tsc",
1212
"clean": "rimraf dist",
13-
"prepack": "yarn run build"
13+
"prepack": "yarn run build",
14+
"docs": "typedoc --options typedoc.config.mjs --entryPoints src/index.ts --out dist/doc"
1415
},
1516
"keywords": [
1617
"LwDITA",
@@ -30,6 +31,7 @@
3031
},
3132
"devDependencies": {
3233
"rimraf": "^6.1.0",
34+
"typedoc": "^0.28.14",
3335
"typescript": "5.9.3"
3436
},
3537
"packageManager": "[email protected]"
File renamed without changes.

packages/lwdita-xdita/package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
"build": "tsc",
1212
"clean": "rimraf dist",
1313
"prepack": "yarn run build",
14+
"docs": "typedoc --options typedoc.config.mjs --entryPoints src/index.ts --out dist/doc",
1415
"example": "ts-node ./example.ts"
1516
},
1617
"keywords": [
@@ -40,6 +41,7 @@
4041
"@types/node": "^24.9.2",
4142
"rimraf": "^6.1.0",
4243
"ts-node": "^10.9.2",
44+
"typedoc": "^0.28.14",
4345
"typescript": "5.9.3"
4446
},
4547
"packageManager": "[email protected]"
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;

tsconfig.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"extends": "@tsconfig/recommended/tsconfig.json",
3-
"exclude": ["**/test/**", "**/dist/**", "node_modules", "eslint.config.mts"],
3+
44
// overrides recommended
55
"compilerOptions": {
66
"skipLibCheck": false, /* Do NOT skip type checking of declaration files. */
@@ -9,6 +9,7 @@
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",
1213
"outDir": "dist", /* Redirect output structure to the `dist/` directory. */
1314
},
1415
}

yarn.lock

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -378,6 +378,7 @@ __metadata:
378378
resolution: "@evolvedbinary/lwdita-ast@workspace:packages/lwdita-ast"
379379
dependencies:
380380
rimraf: "npm:^6.1.0"
381+
typedoc: "npm:^0.28.14"
381382
typescript: "npm:5.9.3"
382383
languageName: unknown
383384
linkType: soft
@@ -391,6 +392,7 @@ __metadata:
391392
"@types/node": "npm:^24.9.2"
392393
rimraf: "npm:^6.1.0"
393394
ts-node: "npm:^10.9.2"
395+
typedoc: "npm:^0.28.14"
394396
typescript: "npm:5.9.3"
395397
languageName: unknown
396398
linkType: soft
@@ -414,7 +416,6 @@ __metadata:
414416
nodemon: "npm:^3.1.10"
415417
nyc: "npm:^17.1.0"
416418
rimraf: "npm:^6.1.0"
417-
typedoc: "npm:^0.28.14"
418419
typescript: "npm:5.9.3"
419420
typescript-eslint: "npm:^8.46.2"
420421
languageName: unknown

0 commit comments

Comments
 (0)