Skip to content

[FEAT] Explicit error message when using too old TypeScript versions #2272

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

Merged
merged 4 commits into from
Oct 3, 2022

Conversation

tbouffard
Copy link
Member

@tbouffard tbouffard commented Sep 30, 2022

TypeScript projects integrating bpmn-visualization but using an unsupported TypeScript version now get an explicit error message instead of a list of type errors.

For instance, when using TypeScript Version 4.4.4

node_modules/bpmn-visualization/dist/not-supported-ts-versions.d.ts:1:74 - error TS1003: Identifier expected.

1 "Package 'bpmn-visualization' support only TS versions that are >=4.5.0".

Related changes

  • The documentation provide general guidelines to contributors about the supported TypeScript versions and how changed them.
  • As types are now generated in several steps, Rollup is no more in charge of generating the types. Rollup was previously generating the files several times (each time it generated a bundle so 3x2=6 times), so this was a lost of time.
  • Rename the tsconfig.json file used to prepare the npm package. It now has a clearer name.
  • Do not generate package-lock.json in the typescript-support tests and remove it from git. The version of bpmn-visualization should be updated in this file after each release. We don't want to do it, so avoid to generate the lock file

closes #2246

Possible tests for reviewers

To get the error message

  • update the test/typescript-support/package.json and use TS 4.3 for instance
  • npm install
  • npm test should fail and display the expected error message

TypeScript projects integrating `bpmn-visualization` but using an unsupported TypeScript version now get an explicit
error message instead of a list of type errors.

Related changes
  - The documentation provide general guidelines to contributors about the supported TypeScript versions and how
  changed them.
  - As types are now generated in several steps, Rollup is no more in charge of generating the types. Rollup was
  previously generating the files several times (each time it generated a bundle so 3*2=6 times), so this was a lost of
  time.
  - Rename the tsconfig.json file used to prepare the npm package. It now has a clearer name.
  - Do not generate package-lock.json in the typescript-support tests and remove it from git. The version of
  bpmn-visualization should be updated in this file after each release. We don't want to do it, so avoid to generate the
  lock file
@tbouffard tbouffard added enhancement New feature or request lib integration Something about how an app can integrate the library labels Sep 30, 2022
@github-actions
Copy link

github-actions bot commented Sep 30, 2022

♻️ PR Preview 1135a3e has been successfully destroyed since this PR has been closed.

🤖 By surge-preview

@github-actions
Copy link

github-actions bot commented Sep 30, 2022

♻️ PR Preview 1135a3e has been successfully destroyed since this PR has been closed.

🤖 By surge-preview

@tbouffard tbouffard marked this pull request as draft September 30, 2022 16:21
@tbouffard tbouffard marked this pull request as ready for review September 30, 2022 16:42
@tbouffard tbouffard requested a review from csouchet September 30, 2022 16:42
Co-authored-by: Souchet Céline <[email protected]>
@sonarqubecloud
Copy link

sonarqubecloud bot commented Oct 3, 2022

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@tbouffard tbouffard merged commit e44224d into master Oct 3, 2022
@tbouffard tbouffard deleted the 2246-minimal_ts_version_in_package.json branch October 3, 2022 09:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request lib integration Something about how an app can integrate the library
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[DOC] Document the lowest TypeScript version supported by bpmn-visualization
2 participants