SimonAlling / userscripter

Create userscripts in a breeze!
https://www.npmjs.com/package/userscripter
MIT License
100 stars 10 forks source link

refactor: Declare exports in package.json #105

Closed SimonAlling closed 3 months ago

SimonAlling commented 3 months ago

This PR makes the public API explicit using exports and typesVersions in package.json. This should enable us to reorganize internal modules, compile to a dist directory etc without having to release (or consider releasing) a new major version.

I haven't been able to figure out any way to make TypeScript find the index module (when our consumer does import … from "userscripter"), except keeping the main field as is.

This is a backward compatible change as long as our consumer doesn't import anything from bootstrap/ or build/internal/. That has never been intended to work, and it seems unlikely to me that anyone will have done that and expected it to be stable.