~/talk

The Complete Guide to packaging Libraries

Talkat Vuejs Amsterdam 2023 · 2023-02-09..02-10· [web-platform, developer-experience]
slides:none on file

Starts with a simple ESM math library then shows exactly how package.json exports, types and files must look to publish an open-source npm package, how to add CJS builds and node/browser conditions, and when to use specialized builders like TSUP or Rollup versus raw JS with JSDoc for types. Covers multiple entry points, sideEffects, npm pack to verify what publishes, common pitfalls (wrong extensions, types order), and a linting tool that checks packages before publish.

AI-written summary · about

  1. 0:00Intro
  2. 1:29Overview
  3. 3:48A math library
  4. 4:56Add type safety
  5. 6:42ESM vs CJS
  6. 7:13Export both ESM and CJS
  7. 8:43Multiple entries
  8. 10:54Build tools
  9. 11:39Specialized build tool (tsup)
  10. 12:17Handle special files
  11. 13:33Simplify type safety
  12. 15:06Simplify ESM and CJS
  13. 15:45Export raw for private packages
  14. 19:06Many little rules
  15. 21:03publint.dev
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.