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

Errors due to raw TypeScript distribution, instead of a .js + .d.ts combo #16

Closed
platosha opened this issue Apr 6, 2023 · 1 comment

Comments

@platosha
Copy link
Contributor

platosha commented Apr 6, 2023

This package distributes raw TypeScript and lacks JS entrypoints. This has several disadvantages over shipping .js + .d.ts:

  • Requires TypeScript and compiling from the user.
  • Affected by the user's TypeScript compiler settings. The result is prone to breaking. Errors like this one might occur due to misaligned TypeScript settings:
    ERROR(TypeScript)  An import path can only end with a '.ts' extension when 'allowImportingTsExtensions' is enabled.
    FILE  node_modules/@vaadin-component-factory/vcf-nav/vcf-nav.ts:1:8
     > 1 | import './src/vcf-nav.ts';
         |        ^^^^^^^^^^^^^^^^^^
       2 | import './src/vcf-nav-item.ts';
       3 |
    
  • Missing TypeScript compilation as a validation step when publishing the package. The source here might not be a valid TypeScript after all, and we only know it when the usage breaks elsewhere.

Let us introduce its own tsconfig.json in this repo, add compilation as a publishing step, and distribute compiled .js + .d.ts.

@ugur-vaadin
Copy link
Collaborator

This change is included in the initial version of the official component.

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

No branches or pull requests

2 participants