-
Notifications
You must be signed in to change notification settings - Fork 28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(dts-generator): huge update to the currently used generator, plus update dependencies #438
Conversation
This updates the dts-generator in this repository from the vastly outdated version from years ago to the one developed and used internally over the past years in the build-up to officially releasing production-ready type definitions for UI5. The new dts-generator is based on the old version developed here, but has undergone huge changes and extensions. Changes to the dts-generator package itself include: - Conversion of the implementation to TypeScript - Creation of type definitions declaring ES modules instead of globals (globals still supported as alternative output, though) - Completely new API - Loads of adaptations to generate better type definitions, partly depending on changes in the UI5 codebase, so this new version might not run with older versions of UI5 like 1.90 or even before - MUCH more... in general you are better off considering this a new project, although at the core of it quite some parts of the old implementation and overall structure are still there Other changes to the repository include: - Upgrade TypeScript and Prettier and sync the versions across the repository - Update other dependencies like husky - Update documentation to the new reality - Update test code to work with the new dts-generator API - Update test content/snapshots - Delete all demos, as they are outdated (using types with globals) Changes to the ts-interface-generator are NOT done in this commit to not cause a major version increase. Those changes are basically just dependency updates and handled in a separate commit. This may mean that both commits should be regarded as parts of ONE change and may not work without each other (as e.g. both affect yarn.lock, but this file is only touched in this commit). BREAKING CHANGE: the API and behavior and generation results of the dts-generator have completely changed. To migrate, basically re-write the usage of it.
This is a pure dependency update, but also an adaptation to the overall repo dependency update, where a new major version of prettier was applied, which causes lots of formatting changes (mostly adding trailing commas) in this change. Also, TypeScript was brought in sync to the other parts of the repo.
|
||
// Matches the end of error messages where a large number of mismatching properties are enumerated. | ||
// These are likely to change for independent reasons and we still want the ignore check to find the match. | ||
const LIST_REGEX = /: ([\w0-9_]+, )+and \d+ more.$/; |
Check warning
Code scanning / CodeQL
Overly permissive regular expression range Medium
const NAMESPACE_PATTERN = /^\s+namespace ([^\s]+) {/; | ||
const CLASS_PATTERN = | ||
/^\s*(?:export(?: default)?)?\s+class ([^\s]+)( [\{\w].*)?$/; | ||
const FUNCTION_PATTERN = /^\s+[\w0-9]+\(/; |
Check warning
Code scanning / CodeQL
Overly permissive regular expression range Medium
const CLASS_PATTERN = | ||
/^\s*(?:export(?: default)?)?\s+class ([^\s]+)( [\{\w].*)?$/; | ||
const FUNCTION_PATTERN = /^\s+[\w0-9]+\(/; | ||
const OBJECT_PATTERN = /^\s+[\w0-9]+: \{/; |
Check warning
Code scanning / CodeQL
Overly permissive regular expression range Medium
const NAMESPACE_PATTERN = /^\s+namespace ([^\s]+) {/; | ||
const CLASS_PATTERN = | ||
/^\s*(?:export(?: default)?)?\s+class ([^\s]+)( [\{\w].*)?$/; | ||
const FUNCTION_PATTERN = /^\s+[\w0-9]+\(/; |
Check warning
Code scanning / CodeQL
Overly permissive regular expression range Medium
const CLASS_PATTERN = | ||
/^\s*(?:export(?: default)?)?\s+class ([^\s]+)( [\{\w].*)?$/; | ||
const FUNCTION_PATTERN = /^\s+[\w0-9]+\(/; | ||
const OBJECT_PATTERN = /^\s+[\w0-9]+: \{/; |
Check warning
Code scanning / CodeQL
Overly permissive regular expression range Medium
No description provided.