-
Notifications
You must be signed in to change notification settings - Fork 982
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Documentation on how to create a Yarn package #29
Conversation
JoelMarcey
commented
Sep 27, 2016
|
||
## Create Your Yarn Package | ||
|
||
Now that your package code is written, it is time to start creating your yarn package. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Capitalise "Y" in "Yarn".
|
||
You can modify your `package.json` file by hand to expand on the default created by `init` by as little or as much as necessary. Examples of custom fields include: | ||
|
||
```bash |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this should be json
, not bash
?
$ yarn install | ||
``` | ||
|
||
### Testing in production |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What does "production" mean here?
You can modify your `package.json` file by hand to expand on the default created by `init` by as little or as much as necessary. Examples of custom fields include: | ||
|
||
```bash | ||
dependencies {} # package dependencies required in production |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"production" is misleading here as it normally refers to a particular environment, whereas dependencies aren't environment-specific. Saying "required at runtime" would be clearer.
The difference between the two is that dependencies
are required to run the package as an end-user of the package, whereas devDepedencies
are required if you want to build the package from source (for example, if you are modifying it). It would have been clearer if npm called this "buildDependencies" instead (this is what they're called in Debian packages for example) but we're stuck with "devDependencies" to maintain npm compatibility.
I believe I have addressed all of @Daniel15's feedback in my latest commit this morning. |
> I will need to add links to our docs on `package.json`, `yarn install`, etc. when those are actually written.
Just added a section to be more explicit on how to add dependencies. |
I pulled this in and made a lot of changes separately |