feat: add TypeScript type declarations for all packages#650
Open
Rahul-R79 wants to merge 1 commit intoaccordproject:mainfrom
Open
feat: add TypeScript type declarations for all packages#650Rahul-R79 wants to merge 1 commit intoaccordproject:mainfrom
Rahul-R79 wants to merge 1 commit intoaccordproject:mainfrom
Conversation
There was a problem hiding this comment.
Pull request overview
This PR implements TypeScript type declarations for all packages in the markdown-transform monorepo, addressing issue #648. The approach uses tsc --allowJs --emitDeclarationOnly to auto-generate .d.ts files from existing JSDoc annotations. The typescript package is added as a workspace-level devDependency, and a build:types script is added to each package. The types/ directory is committed to the repository and included in published package files.
Changes:
- Adds
"typescript": "^5.4.5"to the root workspacedevDependenciesand updatespackage-lock.json - Adds
types/directories with auto-generated.d.tsfiles andbuild:typesscripts to all 8 packages - Makes minor JSDoc updates in
markdown-template(changing@returns {ClassDeclaration}to@returns {object})
Reviewed changes
Copilot reviewed 13 out of 76 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
package.json |
Adds typescript as workspace devDependency |
package-lock.json |
Installs typescript (resolves to 5.9.3), but also causes significant unintended churn (jsdoc downgrade, peer flag removals) |
packages/markdown-common/package.json |
Adds types/ to files, "types" field, and build:types script |
packages/markdown-cicero/package.json |
Same pattern as markdown-common |
packages/markdown-html/package.json |
Same pattern as markdown-common |
packages/markdown-template/package.json |
Same pattern as markdown-common |
packages/markdown-transform/package.json |
Same pattern as markdown-common |
packages/markdown-it-cicero/package.json |
Same pattern as markdown-common |
packages/markdown-it-template/package.json |
Same pattern as markdown-common |
packages/markdown-cli/package.json |
Same pattern as markdown-common |
packages/markdown-html/types/lib/ToCiceroMarkVisitor.d.ts |
Type declaration with a Any (capital A, invalid TypeScript) return type bug |
packages/markdown-transform/types/index.d.ts |
Top-level type declarations for markdown-transform package |
packages/markdown-template/types/lib/templatemarkutil.d.ts |
Type declarations with a stale JSDoc description (copy-paste from adjacent function) |
All other types/**/*.d.ts files |
Auto-generated type declarations for each package's exports |
packages/markdown-common/index.js |
Adds @type {Record<string, Function>} JSDoc annotation to improve type inference |
packages/markdown-common/lib/FromCommonMarkVisitor.js / packages/markdown-template/lib/templatemarkutil.js / packages/markdown-template/src/templatemarkutil.js |
Minor JSDoc fixes |
Signed-off-by: Rahul-R79 <rahul.devworks@gmail.com>
f8687ed to
8ce2fbd
Compare
Contributor
Author
|
resolved the copilot suggestion :) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
closes #648
This PR adds TypeScript type declaration