Skip to content

Update package.json for publishing to npm#2239

Merged
ErisDS merged 1 commit intoTryGhost:masterfrom
hswolff:package-json-updates
Feb 24, 2014
Merged

Update package.json for publishing to npm#2239
ErisDS merged 1 commit intoTryGhost:masterfrom
hswolff:package-json-updates

Conversation

@hswolff
Copy link
Contributor

@hswolff hswolff commented Feb 22, 2014

address #2078

  • removes private: true flag from package.json
  • created .npmignore file to exclude files
    from being included in the npm package

So as I currently understand it, npm publish will take all contents in the folder (excluding those specified in the .npmignore file) and pack that to be included in the npm package.

This means that it'll include the compiled assets by default, addressing item 1 in #2078. However before publishing we need to ensure grunt prod is run so the assets are up to date.

I previously tried doing that with the prepublish script (docs here) however that is also ran on npm install, something we cannot do.

The publish process looks like this:

grunt prod
npm publish

Which we could turn into a grunt task however that seems necessary.

That part is up to you @ErisDS, as you'll be the one doing the publishing ;).

@hswolff hswolff mentioned this pull request Feb 22, 2014
9 tasks
@ErisDS ErisDS self-assigned this Feb 22, 2014
@ErisDS
Copy link
Member

ErisDS commented Feb 22, 2014

2 commands instead of 1? That's 100% more work for me! 😱
I'm j/k of course 😈 this is totally fine

I was thinking about this t'other day actually. I think the .npmignore script essentially needs to be the same as the buildGlob that is in the Gruntfile.js. I was wondering if we couldn't put that into .npmignore and then get Grunt to read that instead of having it's own list?

@hswolff
Copy link
Contributor Author

hswolff commented Feb 22, 2014

Aha, nice improvement. Definitely can-do.

Will update with that change.

@hswolff
Copy link
Contributor Author

hswolff commented Feb 23, 2014

Updated! =D. That was a fun trick :D

@ErisDS
Copy link
Member

ErisDS commented Feb 23, 2014

Neat 👍

address TryGhost#2078

- removes private: true flag from package.json
- created .npmignore file and moved all of buildGlob
 file patterns into here, negating all patterns as
 the npmignore file defines what is to be excluded
 and not included.
- gruntfile now uses the inverse of the .npmignore file
 to define what files to include in a release
ErisDS added a commit that referenced this pull request Feb 24, 2014
Update package.json for publishing to npm
@ErisDS ErisDS merged commit eec07a5 into TryGhost:master Feb 24, 2014
@hswolff hswolff deleted the package-json-updates branch February 25, 2014 02:06
@ErisDS ErisDS removed their assignment Jun 22, 2021
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.

3 participants