Skip to content

feat: add NewExpression parser#2346

Merged
domoritz merged 3 commits intovega:nextfrom
jamesbvaughan:james/new-expression
Sep 5, 2025
Merged

feat: add NewExpression parser#2346
domoritz merged 3 commits intovega:nextfrom
jamesbvaughan:james/new-expression

Conversation

@jamesbvaughan
Copy link
Copy Markdown
Contributor

@jamesbvaughan jamesbvaughan commented Sep 4, 2025

This adds support for types that depend on the ability to parse NewExpressions, as in:

const foo = new Foo()
type FooType = typeof foo

This should close #2054

Version

Published prerelease version: v2.5.0-next.6

Changelog

🎉 This release contains work from new contributors! 🎉

Thanks for all your work!

❤️ James Vaughan (@jamesbvaughan)

❤️ Alex (@alexchexes)

❤️ Cal (@CalLavicka)

❤️ Valentyne Stigloher (@pixunil)

🚀 Enhancement

🐛 Bug Fix

  • chore: update deps #2306 (@domoritz)
  • Fix: crashes and incomplete schema generation when mapped/intersection helpers are used with --additional-properties option #2305 (@alexchexes)
  • Fix promise with generic type arguments #2291 (@CalLavicka)
  • Fix: prune unreachable definitions when --type "*" is used with multiple exports #2284 (@alexchexes @arthurfiorette)
  • Fix: crash when a union includes symbol #2282 (@alexchexes)
  • fix: correctly generate anyOf on unions with string and boolean constant #2208 (@pixunil)
  • fix: fully unwrap union aliases in mapped keys to avoid generating incorrect additionalProperties #2232 (@alexchexes)
  • fix: avoid incorrect additionalProperties for Pick<..., AliasLiteralUnion> #2230 (@alexchexes)

🔩 Dependency Updates

Authors: 7

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I mostly copied this from the existing class-single test case.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this can be much simpler and focused on just the new.

@jamesbvaughan jamesbvaughan changed the title Add support for NewExpression feat: add NewExpression parser Sep 4, 2025
Copy link
Copy Markdown
Member

@domoritz domoritz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you. Let's simplify the test case but it's great.

@github-actions
Copy link
Copy Markdown

github-actions bot commented Feb 4, 2026

🚀 PR was released in v2.5.0 🚀

@github-actions github-actions bot added released This issue/pull request has been released. and removed prerelease labels Feb 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

released This issue/pull request has been released.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Unknown node of kind "NewExpression" - When using Set values as union

2 participants