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

fix(tsconfig): apply @vue/tsconfig #729

Merged
merged 1 commit into from
Aug 22, 2023
Merged

fix(tsconfig): apply @vue/tsconfig #729

merged 1 commit into from
Aug 22, 2023

Conversation

nekolab
Copy link
Contributor

@nekolab nekolab commented Aug 22, 2023

Use an exported const enum in vite is forbidden due to the compiler limitation. To fix this, some const enum exports need to be reshape to enum.

Besides the const enum, we also need to use the Type-Only Imports and Export syntax to avoid potential problems like type-only imports being incorrectly bundled. See https://vitejs.dev/guide/features.html#transpile-only

These restrictions are all included in @vue/tsconfig, so we applied it to the root tsconfig.json to prevent further issues.

Summary

PR Checklist

  • Naming & Structure: the files and package structure use the conventions outlined in the Creating a Package docs.
  • Tests pass: check the output of all package unit and/or component tests.
    • If this PR is the result of a bug, test coverage was added accordingly.
  • Functional: all changes do not break existing APIs, but if so, a BREAKING CHANGE commit is in place to bump the major version.
  • Conventional Commits all commits follow the conventional commit standards outlined in the main README.
  • Docs: includes a technically accurate README, and the docs have been updated accordingly based on the changes in this PR.

@nekolab nekolab force-pushed the chore/vue-tsconfig branch from fde1022 to 8e2b465 Compare August 22, 2023 08:22
@nekolab nekolab marked this pull request as ready for review August 22, 2023 10:03
Copy link
Member

@adamdehaven adamdehaven left a comment

Choose a reason for hiding this comment

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

Blocking merge until I have time to dig into what is being proposed in this PR

Use an exported `const enum` in vite is forbidden due to the
[compiler limitation](https://vitejs.dev/guide/features.html#isolatedmodules).
To fix this, some `const enum` exports need to be reshape to `enum`.

Besides the `const enum`, we also need to use the Type-Only Imports
and Export syntax to avoid potential problems like type-only imports
being incorrectly bundled. See https://vitejs.dev/guide/features.html#transpile-only

These restrictions are all included in `@vue/tsconfig`, so we applied
it to the root `tsconfig.json` to prevent further issues.
@nekolab nekolab force-pushed the chore/vue-tsconfig branch from 8e2b465 to 5940fe0 Compare August 22, 2023 13:08
@nekolab nekolab changed the title chore(tsconfig): apply @vue/tsconfig fix(tsconfig): apply @vue/tsconfig Aug 22, 2023
Copy link
Member

@adamdehaven adamdehaven left a comment

Choose a reason for hiding this comment

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

lgtm

Copy link
Member

@sumimakito sumimakito left a comment

Choose a reason for hiding this comment

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

LGTM

@adamdehaven adamdehaven merged commit c8aeca7 into main Aug 22, 2023
@adamdehaven adamdehaven deleted the chore/vue-tsconfig branch August 22, 2023 14:37
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.

3 participants