Closed colinhacks closed 5 months ago
Yeah, but if you publish it with those fields there, it won't do what you're implying. It won't be useable when it's installed from the registry. publishConfig
only overrides npm config values at publish time, not package.json fields.
Ah, disappointing. I read the pnpm docs which explicitly supports all these fields: https://pnpm.io/package_json#publishconfig, then saw that same field in the npm docs and assumed the behavior was generally compatible. Alas, a publishConfig
mode is pretty useless then - sorry for the noise.
New proposal: https://github.com/isaacs/tshy/issues/66
In my TypeScript monorepos like to point each package's
"exports"
field at raw.ts
source files so VS Code will reflect "live" types even across package boundaries: https://colinhacks.com/essays/live-types-typescript-monorepoI'd love a
tshy
mode that writesmain
,exports
, etc into"publishConfig"
instead of the top-level fields: https://docs.npmjs.com/cli/v10/configuring-npm/package-json#publishconfigIf you're amenable, I'm happy to put in the PR for this but just wanted a sign-off first.