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

build: switch to vite, vitest and api-extractor; add esm output #90

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

fnlctrl
Copy link

@fnlctrl fnlctrl commented Jul 3, 2023

Build tools simpification

  • Use vite for bundling cjs and esm ouput
  • Use vitest for testing & coverage report
    • TS is supported out of the box so ts-node is no longer necessary
    • Native v8 instrumentation is used for coverage, so nyc is no longer necessary
  • Use api-extractor for .d.ts rollup

Minor changes

  • Replace TS namespace as plain object
    TS it self is migrating away from namespaces. Since it's considered a legacy feature and not part of ES spec, it's better to migrate away too.
  • Change require to import

@fnlctrl
Copy link
Author

fnlctrl commented Jul 3, 2023

@luin I added esm output despite potential dual package hazard because there're no instanceof checks, and Delta is small enough to not cause perf issues even if loaded twice.

The only issue now is usage in node would become

const Delta = require('quill-delta').default

I was wondering if it would be better to remove the default export, so it's simply

const { Delta } = require('quill-delta')

which would mirror normal esm import

import { Delta } from 'quill-delta'

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.

None yet

1 participant