isaacs/tshy

Proposal: support `publishConfig`

Closed this issue · 3 comments

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-monorepo

I'd love a tshy mode that writes main, exports, etc into "publishConfig" instead of the top-level fields: https://docs.npmjs.com/cli/v10/configuring-npm/package-json#publishconfig

If you're amenable, I'm happy to put in the PR for this but just wanted a sign-off first.

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: #66