Skip to content

Commit 84ec2f1

Browse files
committed
chore(jsdoc): update jsdoc configuration
1 parent c8b6a53 commit 84ec2f1

File tree

5 files changed

+50
-37
lines changed

5 files changed

+50
-37
lines changed

.github/workflows/gh-pages.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,24 +4,24 @@ on:
44
workflow_dispatch:
55
push:
66
tags:
7-
- '*'
7+
- '*'
88

99
jobs:
1010
deploy:
1111
runs-on: ubuntu-latest
1212
steps:
13-
- uses: actions/checkout@v2
13+
- uses: actions/checkout@v4
1414
with:
1515
submodules: true
1616
fetch-depth: 0
1717

1818
- name: Setup Node
19-
uses: actions/setup-node@v2.1.2
19+
uses: actions/setup-node@v4
2020
with:
21-
node-version: '18.x'
21+
node-version: '20.x'
2222

2323
- name: Cache dependencies
24-
uses: actions/cache@v2
24+
uses: actions/cache@v4
2525
with:
2626
path: ~/.npm
2727
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}

.jsdoc.js

Lines changed: 0 additions & 31 deletions
This file was deleted.

.jsdoc.json

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
{
2+
"plugins": ["plugins/markdown"],
3+
"markdown": {
4+
"idInHeadings": true
5+
},
6+
"tags": {
7+
"allowUnknownTags": true,
8+
"dictionaries": ["jsdoc", "closure"]
9+
},
10+
"source": {
11+
"include": [
12+
"src",
13+
"src/parser"
14+
]
15+
},
16+
"opts": {
17+
"destination": "./docs/0.2/",
18+
"encoding": "utf8",
19+
"readme": "./README.md"
20+
},
21+
"templates": {
22+
"default": {
23+
"includeDate": true
24+
},
25+
"cleverLinks": false,
26+
"monospaceLinks": false
27+
}
28+
}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"lint": "standard",
1010
"test": "mocha --throw-deprecation test/spec.js",
1111
"changelog": "conventional-changelog -p angular -i CHANGELOG.md -s -r 0 && git add CHANGELOG.md",
12-
"docs": "jsdoc -c .jsdoc.cjs",
12+
"docs": "node scripts/update-jsdoc-config.js && jsdoc -c .jsdoc.json",
1313
"preversion": "npm run lint && npm test",
1414
"version": "npm run changelog"
1515
},

scripts/update-jsdoc-config.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import path from 'node:path'
2+
import url from 'node:url'
3+
import fs from 'node:fs'
4+
5+
const __dirname = path.dirname(url.fileURLToPath(import.meta.url))
6+
const packageRoot = path.dirname(__dirname)
7+
8+
const packageFile = path.join(packageRoot, 'package.json')
9+
const packageConfig = JSON.parse(fs.readFileSync(packageFile, 'utf8'))
10+
const version = packageConfig.version.match(/(0\.)*\d+/)[0]
11+
12+
const jsdocFile = path.join(packageRoot, '.jsdoc.json')
13+
const jsdocConfig = fs.readFileSync(jsdocFile, 'utf8')
14+
const updatedJsdocConfig = jsdocConfig.replace(/"\.\/docs\/.+?\/"/, '"./docs/' + version + '/"')
15+
16+
fs.writeFileSync(jsdocFile, updatedJsdocConfig)

0 commit comments

Comments
 (0)