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

Publish JavaScript modules (ESM) #43

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Conversation

bnf
Copy link

@bnf bnf commented Sep 11, 2023

ESM module are published unminified by convention.
Therefore they can simply be build by tsc.

Also the TypeScript declaration files are linked via package.json now. TypeScript needs the types (with node10 module resolution) or exports.types (with node16 module resolution) to be defined in order for declarations to actually be picked up, otherwise the following error would be emitted:

Cannot find module 'shortcut-buttons-flatpickr' or its corresponding type declarations.

Additionally declaration mappings are published so Language Services can understand these map files and use them to map declaration-file based definition locations to their original source, when available.
See https://www.typescriptlang.org/docs/handbook/release-notes/typescript-2-9.html#new---declarationmap

bnf added 3 commits September 11, 2023 05:28
Language Services can understand these map files,
and use them to map declaration-file based definition
locations to their original source, when available.
TypeScript needs the `types` (with node10 module resolution)
or `export.types` (with node16 module resolution) to be
defined in order for declarations to actually be picked up,
otherwise the following error would be emitted:

> Cannot find module 'shortcut-buttons-flatpickr' or
> its corresponding type declarations.
ESM module are published unminified by convention.
Therefore they can simply be build by `tsc`.

We target ES6 for now to comply with the
browser level that flatpickr itself supports.
See flatpickr/flatpickr#2468
for more information.
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.

1 participant