Skip to content

Conversation

@mdmower-csnw
Copy link

  • Support consuming package directly from GitHub by adding npm prepare script.

- Support consuming package directly from GitHub by adding npm prepare script.
Copy link

@tvharris tvharris left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mdmower-csnw: The prepare script looks good. Can you try it out by consuming from this branch?

Does this prepare run every time we npm install in a project that is consuming this? I'm just learning how it works.

I don't know for sure if this is relevant, but I came across this SO post that made it sound like files might need to be defined in package.json.

@mdmower-csnw
Copy link
Author

@tvharris

Can you try it out by consuming from this branch?

Yes, you can do that.

Does this prepare run every time we npm install in a project that is consuming this? I'm just learning how it works.

Yes, it runs after npm install. See here for the full list of triggers. There are two options to make a package consumable from GitHub: 1) distribute build output, or 2) run build on npm install by defining npm prepare.

I don't know for sure if this is relevant, but I came across this SO post that made it sound like files might need to be defined in package.json.

Either files or .npmignore. The package maintainer chose .npmignore for this repo. If you install this package from GitHub, you'll find that the output compares well relative to installing from npm.

@mdmower-csnw mdmower-csnw merged commit 1e27de6 into csnw Oct 23, 2023
@mdmower-csnw mdmower-csnw deleted the mdm-prepare branch October 23, 2023 20:17
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