fix(*): align remaining types and publish runtime follow-up - #671
Merged
mttrbrts merged 1 commit intoMay 10, 2026
Conversation
Signed-off-by: Rishabh Jain <rishabhj2005@gmail.com>
mttrbrts
approved these changes
May 10, 2026
mttrbrts
merged commit May 10, 2026
7af1052
into
accordproject:feat/tighten-typescript-types
2 checks passed
mttrbrts
added a commit
that referenced
this pull request
Jun 2, 2026
…ete types (#669) * feat: tighten TypeScript type declarations — replace `any` with concrete types Update JSDoc @PARAM and @returns annotations on the priority public API methods across four packages so that generated .d.ts files no longer use `any` where a more specific type is known: - CommonMarkTransformer: toMarkdown, removeFormatting (object input), toTokens (object[] return), fromTokens (object[] param, object return), getSerializer (Serializer return) - CiceroMarkTransformer: getClauseText, fromCiceroEdit, fromCommonMark, toMarkdown, toCommonMark, toCiceroMarkUnwrapped (object I/O), toTokens/fromTokens (object[]/object), getSerializer (Serializer) - HtmlTransformer: toHtml (object input), toCiceroMark (object return) - TemplateMarkTransformer: getSerializer (object return) Regenerated .d.ts files in each package with `tsc`. Closes #668 Signed-off-by: Matt Roberts <matt@rbrts.uk> Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Signed-off-by: Matt Roberts <code@rbrts.uk> * feat: tighten types for ToMarkdownVisitor and TransformEngine - ToMarkdownVisitor.toMarkdown: {*} input → {object} - TransformEngine.transformToDestination/transform: source {*} → {object|string}, returns {*}/{Promise} → {Promise<object|string>} - TransformEngine.registerTransformation: transform {*} → {Function} - TransformEngine.registerExtension: extension {*} → {object} - transform.js module exports: add JSDoc to formatDescriptor, transform, generateTransformationDiagram, and builtinEngine so tsc can emit typed declarations rather than any Regenerated .d.ts files in markdown-common and markdown-transform. Signed-off-by: Matt Roberts <matt@rbrts.uk> Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Signed-off-by: Matt Roberts <code@rbrts.uk> * feat(markdown-common): generate TypeScript model interfaces from CTO schemas Add a codegen script that runs TypescriptVisitor over all four CTO models (CommonMark, CiceroMark, ConcertoMeta, TemplateMark) and writes clean .d.ts files to types/model/. The build:types script now runs codegen before tsc so model types are always up to date. Update JSDoc @typedef annotations in CommonMarkTransformer and CiceroMarkTransformer to reference the generated interfaces (IDocument, INode, IClause) via package-qualified paths, so tsc emits non-relative imports that resolve correctly from any consumer package. Result: all public API methods now carry specific model types in their generated .d.ts signatures rather than plain object. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Signed-off-by: Matt Roberts <code@rbrts.uk> * fix(markdown-common): remove unnecessary strict option from ModelManager in codegen script strict mode is the default in concerto-core v4. Signed-off-by: Matt Roberts <code@rbrts.uk> Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Signed-off-by: Matt Roberts <code@rbrts.uk> * fix: make parameters optional in JSDoc and bump minimum Node to 22 - Mark `parameters` as `[parameters]` (optional) in JSDoc for `transform.js` and `transformEngine.js` (src/ and lib/) so generated `.d.ts` files emit `parameters?: object` instead of `parameters: object` - Update minimum Node version from >=18/>=15 to >=22 in all package.json engines fields - Remove Node 20.x from CI build matrix (minimum is now 22) - Regenerate `types/` declarations to reflect optional parameters Signed-off-by: Copilot <copilot@github.com> Agent-Logs-Url: https://github.com/accordproject/markdown-transform/sessions/b58c7539-b316-4d97-b13c-bde57770d0b7 Co-authored-by: mttrbrts <7544022+mttrbrts@users.noreply.github.com> * fix(*): align remaining types and publish runtime (#668) (#671) Signed-off-by: Rishabh Jain <rishabhj2005@gmail.com> --------- Signed-off-by: Matt Roberts <matt@rbrts.uk> Signed-off-by: Matt Roberts <code@rbrts.uk> Signed-off-by: Rishabh Jain <rishabhj2005@gmail.com> Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com> Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: Rishabh060105 <160598562+Rishabh060105@users.noreply.github.com>
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.
Follow-up to #669
This PR is a focused follow-up on top of #669 to address the remaining gaps found during review.
Changes
.github/workflows/publish.ymlto use Node 22 so the release workflow matches the newengines.node >=22requirement introduced in feat: tighten TypeScript type declarations — replaceanywith concrete types #669HtmlTransformerto emitHtmlInput/IDocumentandTemplateMarkTransformer.getSerializer()to emitSerializerFlags
feat/tighten-typescript-typesso the diff stays limited to the follow-up fixes instead of duplicating feat: tighten TypeScript type declarations — replaceanywith concrete types #669packages/markdown-templatestill has the existingno-consolelint warnings in its source, but this follow-up does not introduce any new lint errorsScreenshots or Video
Related Issues
anywith Concerto model types #668anywith concrete types #669Author Checklist
--signoffoption of git commit.feat/tighten-typescript-typesfromRishabh060105/pr669-followup-fixesValidation
npm run build --workspace packages/markdown-templatenpm run build --workspace packages/markdown-htmlnpm run lint --workspace packages/markdown-templatenpm run lint --workspace packages/markdown-htmlnpm test --workspace packages/markdown-templatenpm test --workspace packages/markdown-html