np icon indicating copy to clipboard operation
np copied to clipboard

Standardizing package.json "np.contents" publish dir

Open guybedford opened this issue 5 years ago • 4 comments

Following on from the discussion at Node.js core from https://github.com/nodejs/node/issues/14970#issuecomment-482996427, I'm wondering if it's worth trying to standardize this publishing feature to apply to other publish tools as well.

How about a standard package.json field for directories.publish:

{
  "directories": {
    "publish": "dist"
  }
}

@sindresorhus would you be open to supporting something like this?

Would be interesting to see if we could get buy-in from package managers too.

guybedford avatar Apr 14 '19 15:04 guybedford

Sounds like a good idea if you get buy-in from other tools. Personally, I'm not using the --contents flag though, so would be better to involve some people that do use it: @willmendesneto @MarcusNoble @Jaid

sindresorhus avatar Apr 19 '19 11:04 sindresorhus

If installing a dependency from a git repository, would the "publish": "dist" option install the dist folder after running the prepare step, rather than installing the root folder?

trusktr avatar Jan 01 '20 08:01 trusktr

And how would npm link workflow work? Would running npm link at the root of the project do the right thing, and cause NPM to link to the dist folder, not the root (and handle node_modules properly too)?

trusktr avatar Jan 01 '20 08:01 trusktr

Oh, I just realized this was in np repo. I'd like for this to be baked into NPM.

trusktr avatar Jan 01 '20 09:01 trusktr

Closing due to age and lack of interest

fregante avatar Feb 03 '23 10:02 fregante