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: Add jsExtension to LangiumConfig #1072

Merged
merged 4 commits into from
Jun 5, 2023

Conversation

sidharthv96
Copy link
Contributor

@sidharthv96 sidharthv96 commented Jun 5, 2023

When downstream projects are using nodenext module resolution, file extensions are mandatory.
So if jsExtension is true, a .js extension will be added to the ast and grammar imports.

PS: I don't really like the jsExtension name for the config, should we use something else? Nothing comes to mind.

Context: mermaid-js/mermaid#4450 (comment)

sidharthv96 and others added 4 commits June 5, 2023 12:11
When downstream projects are using `nodenext` module resolution, file extensions are mandatory.
So if `jsExtension` is true, a `.js` extension will be added to the ast and grammar imports.
Copy link
Member

@msujew msujew left a comment

Choose a reason for hiding this comment

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

@sidharthv96 Thanks for the contribution. I took the freedom to update the jsExtension to a more general importExtension field, in case someone wants to use .cjs or .mjs style imports.

Is this change blocking for mermaid-js/mermaid#4450? I can create a bugfix release for this for the langium-cli package once this is merged, if you need it.

@msujew msujew added the cli CLI related issue label Jun 5, 2023
@sidharthv96
Copy link
Contributor Author

Yup, the value being configurable is better, thank you.

I can create a bugfix release for this for the langium-cli package once this is merged, if you need it.

That would be wonderful @msujew, I guess it'll make @Yokozuna59's life a lot easier. 😇

@msujew msujew merged commit 17f4ab6 into eclipse-langium:main Jun 5, 2023
@msujew msujew mentioned this pull request Jun 5, 2023
@spoenemann spoenemann added this to the v2.0.0 milestone Jul 19, 2023
spoenemann pushed a commit that referenced this pull request Aug 15, 2023
When downstream projects are using `nodenext` module resolution, file extensions are mandatory.
Developers can use `importExtension` to specify the extension used in generated import statements.

---------

Co-authored-by: Mark Sujew <mark.sujew@typefox.io>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cli CLI related issue
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants