Skip to content
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!: export and import interfaces as types when using named imports and ESM Module Syntax #1873

Open
wants to merge 2 commits into
base: next
Choose a base branch
from

Conversation

moritzkalwa
Copy link
Contributor

Description

When using modelType 'interface', exportType 'named' and moduleSystem 'ESM' export and import interfaces as types to support verbatimModuleSyntax.
This should not be a breaking change, interfaces are types even when not using verbatimModuleSyntax, explicitly marking them as types is optional in that case though.

Related Issue

fixes #1793

Checklist

  • The code follows the project's coding standards and is properly linted (npm run lint).
  • Tests have been added or updated to cover the changes.
  • Documentation has been updated to reflect the changes.
  • All tests pass successfully locally.(npm run test).

Additional Notes

This PR also includes a change that makes sure only interfaces are imported/exported as types, as the previous version of this PR also exported enums as types.

Copy link

netlify bot commented Mar 9, 2024

Deploy Preview for modelina canceled.

Name Link
🔨 Latest commit 8dff936
🔍 Latest deploy log https://app.netlify.com/sites/modelina/deploys/65ecf7b7e594030008a0904c

Copy link

sonarcloud bot commented Mar 9, 2024

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
No data about Duplication

See analysis details on SonarCloud

@coveralls
Copy link

Pull Request Test Coverage Report for Build 8218001195

Details

  • 8 of 9 (88.89%) changed or added relevant lines in 2 files are covered.
  • 1 unchanged line in 1 file lost coverage.
  • Overall coverage increased (+0.02%) to 92.323%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/generators/typescript/TypeScriptDependencyManager.ts 5 6 83.33%
Files with Coverage Reduction New Missed Lines %
src/generators/typescript/TypeScriptDependencyManager.ts 1 94.87%
Totals Coverage Status
Change from base Build 8203318802: 0.02%
Covered Lines: 6000
Relevant Lines: 6331

💛 - Coveralls

@jonaslagoni jonaslagoni changed the title feat: export and import interfaces as types when using named imports and ESM Module Syntax feat!: export and import interfaces as types when using named imports and ESM Module Syntax Mar 10, 2024
@jonaslagoni jonaslagoni changed the base branch from master to next March 10, 2024 09:59
@jonaslagoni jonaslagoni changed the base branch from next to master March 10, 2024 09:59
Copy link
Member

@jonaslagoni jonaslagoni left a comment

Choose a reason for hiding this comment

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

Gonna have to re-target to next because of the breaking changes to the dependency manager (it's exposed to users). Just need to make a quick update #1876 before I can do it.

Do you mind adding those changes to the migration docs: https://github.com/asyncapi/modelina/blob/next/docs/migrations/version-3-to-4.md

You should be able to easily merge next into your branch 🙂

@jonaslagoni jonaslagoni changed the base branch from master to next March 10, 2024 10:06
Samridhi-98
Samridhi-98 previously approved these changes Mar 18, 2024
@moritzkalwa moritzkalwa dismissed Samridhi-98’s stale review March 18, 2024 16:29

The merge-base changed after approval.

@moritzkalwa
Copy link
Contributor Author

Gonna have to re-target to next because of the breaking changes to the dependency manager (it's exposed to users). Just need to make a quick update #1876 before I can do it.

Do you mind adding those changes to the migration docs: https://github.com/asyncapi/modelina/blob/next/docs/migrations/version-3-to-4.md

You should be able to easily merge next into your branch 🙂

Are you sure this needs to go into the migration guide? This should not break anything afaik, environments that haven't used verbatim module Syntax before should still work with interfaces now exported/imported as types and environments that do will now work without causing errors. 🤔 I could certainly add this into the migration guide, it feels wrong there though as there is no action required.

@jonaslagoni
Copy link
Member

Are you sure this needs to go into the migration guide? This should not break anything afaik, environments that haven't used verbatim module Syntax before should still work with interfaces now exported/imported as types and environments that do will now work without causing errors.

Its not the new feature that is breaking, but the syntax of the dependency manager functions, which are public interface for people to use 🙂

Copy link
Contributor

github-actions bot commented Sep 4, 2024

This pull request has been automatically marked as stale because it has not had recent activity 😴

It will be closed in 120 days if no further activity occurs. To unstale this pull request, add a comment with detailed explanation.

There can be many reasons why some specific pull request has no activity. The most probable cause is lack of time, not lack of interest. AsyncAPI Initiative is a Linux Foundation project not owned by a single for-profit company. It is a community-driven initiative ruled under open governance model.

Let us figure out together how to push this pull request forward. Connect with us through one of many communication channels we established here.

Thank you for your patience ❤️

@github-actions github-actions bot added the stale label Sep 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support verbatimModuleSyntax in TypeScript Generator
4 participants