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

Import types instead of import and prepare update to TS5.0 #1018

Merged
merged 6 commits into from
May 4, 2023

Conversation

gfontorbe
Copy link
Contributor

Closes #960

  • Prepare upgrade to TypeScript 5.0.x
  • Adds new linter rule to use import type instead of import for imports that are only used for types and not values
  • Fixed linter issues for the new rule
  • Adapted langium-cli and generators to reflect those changes
  • Some styling here and there

Copy link
Contributor

@dhuebner dhuebner left a comment

Choose a reason for hiding this comment

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

Please remove the test project from the package-lock. Also check that clean-up step is inside a finally block

package-lock.json Outdated Show resolved Hide resolved
@gfontorbe
Copy link
Contributor Author

Please remove the test project from the package-lock. Also check that clean-up step is inside a finally block

The clean-up step is already in a finally block, not sure why this was added to the package-lock...

@dhuebner
Copy link
Contributor

Please remove the test project from the package-lock. Also check that clean-up step is inside a finally block

The clean-up step is already in a finally block, not sure why this was added to the package-lock...

Do you have this folder locally? Maybe it is there since you was adding new CLI tests?

@dhuebner dhuebner self-requested a review April 11, 2023 14:05
@dhuebner
Copy link
Contributor

@gfontorbe
It is really difficult to track all the changes.
Just hope we have enough tests and enough time to find potential bugs :)
Would be nice if someone else could also look through.

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.

It isn't noticeable since the ast.ts files get generated with an eslint-disable instruction, but these files aren't using the import type statements correctly:

import type { AstNode, Reference, ReferenceInfo, TypeMetaData } from 'langium';
import { AbstractAstReflection } from 'langium';

We currently only generate

import { AstNode, AbstractAstReflection, Reference, ReferenceInfo, TypeMetaData } from 'langium';

@gfontorbe gfontorbe force-pushed the gfontorbe/import-types-and-upgradeTS5.0 branch 2 times, most recently from 3d52cf4 to b426458 Compare April 13, 2023 07:16
@gfontorbe gfontorbe requested a review from msujew April 13, 2023 07:17
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.

Looks good, please rebase on top of the latest main and merge at the end of the week as discussed 👍

@gfontorbe gfontorbe force-pushed the gfontorbe/import-types-and-upgradeTS5.0 branch from b426458 to 4b94d27 Compare May 4, 2023 08:53
@gfontorbe gfontorbe merged commit 9dcd241 into main May 4, 2023
@gfontorbe gfontorbe deleted the gfontorbe/import-types-and-upgradeTS5.0 branch May 4, 2023 08:58
emilkrebs added a commit that referenced this pull request May 15, 2023
* added missing arithmetics validations and potences and modulo operations

* added essential steps

* Fixed validation and the arithmetics language server

* fixed the arithmetics examples

* resolved the issues mentioned in 1013

* Normalize line endings for yeoman generator (#1005)

* Fix document highlighting for non-local references (#1000)

* [utils/streams] replicated signature overloads to 'StreamImpl'

this way they're also applied to vars of the ...Impl types
(TypeScript apparently doesn't apply interface overloads to implementing classes)

* Fixed invalid grammar validation error (#1020)

* Add validation for cross-reference to union type (#1017)

* Add validation for cross-reference to union type

* Update packages/langium/src/grammar/validation/validator.ts

Co-authored-by: Mark Sujew <mark.sujew@typefox.io>

* Update packages/langium/src/grammar/validation/validator.ts

Co-authored-by: Mark Sujew <mark.sujew@typefox.io>

* Return only one error for multiple non AST nodes

---------

Co-authored-by: Mark Sujew <mark.sujew@typefox.io>

* Fix build error (#1023)

Fixed build error

* Add IPA for 'Langium' (#1024)

* resolved the issues mentioned by @sailingfox

* Improve completion behavior for cross references (#1004)

* Automate release process (#1031)

* Publish version 1.2.0 (#1035)

* Add publishing permissions (#1036)

* fixed the language server

* Fix missing files in yeoman generator (#1038)

* Another fix for the broken `generator-langium` (#1040)

* Import types instead of import and prepare update to TS5.0 (#1018)

* Import types instead of import and prepare update to TS5.0

* Update yeoman generator test

* Remove hello-world from package-lock

* Fix import type in ast-generator.ts

* Fix rebase errors

* Rebase

* a small fix

* changed "default" to "case"

* improved arithmetics example

* throws an error when using a unsupported operator

* added comments and fixed some small issues

* added missing arithmetics validations and potences and modulo operations

* added essential steps

* Fixed validation and the arithmetics language server

* fixed the arithmetics examples

* resolved the issues mentioned in 1013

* resolved the issues mentioned by @sailingfox

* fixed the language server

* a small fix

* changed "default" to "case"

* improved arithmetics example

* throws an error when using a unsupported operator

* added comments and fixed some small issues

* fixed some rebasing issues

* added a $ to the evaluations array

---------

Co-authored-by: Mark Sujew <mark.sujew@typefox.io>
Co-authored-by: Christian Schneider <christian.schneider@typefox.io>
Co-authored-by: Guillaume Fontorbe <guillaume.fontorbe@typefox.io>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Langium TypeScript output should use type imports for non-value imports
3 participants