Skip to content

Improve the npm package metadata#379

Open
stof wants to merge 1 commit intowilldurand:masterfrom
stof:patch-1
Open

Improve the npm package metadata#379
stof wants to merge 1 commit intowilldurand:masterfrom
stof:patch-1

Conversation

@stof
Copy link
Copy Markdown
Contributor

@stof stof commented Apr 9, 2026

  • add metadata that allows npmjs.com to link back to the repository
  • add an optional peer dependency on intl-messageformat so that tools being strict about dependency access (pnpm, Yarn PnP mode) can be supported (relates to intl-messageformat dependency missing #336)

To make the package even better, it might make sense to create a README.md, as npmjs.com will render it.

Regarding the intl-messageformat, I'm actually wondering whether it should be defined as a required dependency instead (and then probably a normal dependency, not a peer one) as the way the UMD wrapper is defined does not make it optional when using CommonJS or RequireJS (the require() is always done):

(function (root, factory) {
if (typeof module === 'object' && module.exports) {
// Node. Does not work with strict CommonJS, but
// only CommonJS-like environments that support module.exports,
// like Node.
module.exports = factory(require('intl-messageformat'));
}
else if (typeof define === 'function' && define.amd) {
define(['intl-messageformat'], factory);
}
else {
root.Translator = factory(root.IntlMessageFormat);
}
}(typeof self !== 'undefined' ? self : this, function (IntlMessageFormat) {

@stof
Copy link
Copy Markdown
Contributor Author

stof commented Apr 9, 2026

I used the existing dev dependency on intl-messageformat 10.x for the peer dependency constraint. The latest version of the package is version 11, which is now shipping in ESM format.

- add metadata that allows npmjs.com to link back to the repository
- add an optional peer dependency on intl-messageformat so that tools being strict about dependency access (pnpm, Yarn PnP mode) can be supported
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