JSDocs can't parse some njs-types
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 30/100
- Issue type
- Bug
- Clarity
- Needs clarification
- Activity status
- Stale
- Tech stack
- javascript, typescript
- Domain
- documentation, tooling
Research direction
Start by running npm run docs with the reported jsdoc.json configuration and inspect node_modules/njs-types/ngx_core.d.ts around line 60 and njs_core.d.ts around line 154. Determine why these declarations produce the reported parsing errors, then verify that documentation generation completes without those errors.
Written by the indexing model from the issue text.
Description
We were experimenting with adding JSDocs for nginx-s3-gateway project in this PR https://github.com/nginxinc/nginx-s3-gateway/issues/165. After adding a such configuration:
package.json:
{
"scripts": {
"prettier": "prettier --check --write common/etc/nginx/include",
"eslint": "npx eslint .",
"docs": "jsdoc -c 'jsdoc.json'"
},
"devDependencies": {
"better-docs": "^2.7.2",
"jsdoc": "^4.0.2",
"njs-types": "^0.8",
"taffydb": "^2.7.3",
"eslint": "^7.32.0",
"eslint-config-prettier": "^8.8.0",
"eslint-plugin-prettier": "^4.2.1",
"prettier": "^2.8.8"
}
}
jsdocs.json looks like:
{
"plugins": [
"node_modules/better-docs/typescript"
],
"source": {
"include": ["./common/etc/nginx/include", "./node_modules/njs-types"],
"includePattern": "\\.(jsx|js|ts|tsx)$",
"excludePattern": "(^|\\/|\\\\)_"
},
"opts": {
"template": "./node_modules/better-docs",
"readme": "README.md",
"verbose": true
}
}
npm run docs
> docs
> jsdoc -c 'jsdoc.json'
Parsing /Users/ivanitskiy/go/src/github.com/nginxinc/nginx-s3-gateway/common/etc/nginx/include/awscredentials.js ...
Parsing /Users/ivanitskiy/go/src/github.com/nginxinc/nginx-s3-gateway/common/etc/nginx/include/awssig2.js ...
Parsing /Users/ivanitskiy/go/src/github.com/nginxinc/nginx-s3-gateway/common/etc/nginx/include/awssig4.js ...
Parsing /Users/ivanitskiy/go/src/github.com/nginxinc/nginx-s3-gateway/common/etc/nginx/include/s3gateway.js ...
Parsing /Users/ivanitskiy/go/src/github.com/nginxinc/nginx-s3-gateway/common/etc/nginx/include/utils.js ...
Parsing /Users/ivanitskiy/go/src/github.com/nginxinc/nginx-s3-gateway/node_modules/njs-types/index.d.ts ...
Parsing /Users/ivanitskiy/go/src/github.com/nginxinc/nginx-s3-gateway/node_modules/njs-types/ngx_core.d.ts ...
ERROR: Unable to parse a tag's type expression for source file /Users/ivanitskiy/go/src/github.com/nginxinc/nginx-s3-gateway/node_modules/njs-types/ngx_core.d.ts in line 60 with tag title "type" and text "{V extends number, ? (key: string, delta: V, init?: number) => number, : never}": Invalid type expression "V extends number, ? (key: string, delta: V, init?: number) => number, : never": Expected "|" but "e" found.
Parsing /Users/ivanitskiy/go/src/github.com/nginxinc/nginx-s3-gateway/node_modules/njs-types/ngx_http_js_module.d.ts ...
Parsing /Users/ivanitskiy/go/src/github.com/nginxinc/nginx-s3-gateway/node_modules/njs-types/ngx_stream_js_module.d.ts ...
Parsing /Users/ivanitskiy/go/src/github.com/nginxinc/nginx-s3-gateway/node_modules/njs-types/njs_core.d.ts ...
ERROR: Unable to parse /Users/ivanitskiy/go/src/github.com/nginxinc/nginx-s3-gateway/node_modules/njs-types/njs_core.d.ts: Missing semicolon. (154:22)
Parsing /Users/ivanitskiy/go/src/github.com/nginxinc/nginx-s3-gateway/node_modules/njs-types/njs_shell.d.ts ...
Parsing /Users/ivanitskiy/go/src/github.com/nginxinc/nginx-s3-gateway/node_modules/njs-types/njs_webapi.d.ts ...
Parsing /Users/ivanitskiy/go/src/github.com/nginxinc/nginx-s3-gateway/node_modules/njs-types/njs_webcrypto.d.ts ...
Generating output files...
Finished running in 1.07 seconds.
Not sure where the issue is, but creating a topic here to track it.
- Dominant language
- C
- Stars
- 1.6k
- Forks
- 245
- Avg merge
- 2d 5h
- Merged PRs (30d)
- 6
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from nginx/njs
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
Difficulty 4/5 3-5 days Newbie friendliness 55/100
-
Modules: CR/LF in njs-produced nginx variablesMay be free again @xeioex claimed this 46 days ago, and no pull request is open. Opennjs
Difficulty 4/5 3-5 days Newbie friendliness 45/100
-
Potential memory leak in njs_fs_fd_read error pathsPossibly taken @Shubham-Padkonde claimed this 41 days ago. Opennjs
Difficulty 3/5 1-2 days Newbie friendliness 67/100
Similar issues
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
sk3llo/ffmpeg_kit_flutter#176 ·
-
Synth suite fails unless run from the repo root: signal_flow's default machine path is cwd-relativeOpenbug
Difficulty 2/5 1-3 hours Newbie friendliness 80/100
Nimblesite/osprey#370 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day