Skip to content
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

Closed
wants to merge 4 commits into from
Closed

Documentation on how to create a Yarn package #29

wants to merge 4 commits into from

Conversation

JoelMarcey
Copy link
Contributor

I will need to add links to our docs on package.json, yarn install, the section on preparing for publishing, etc. when those are actually written.


## Create Your Yarn Package

Now that your package code is written, it is time to start creating your yarn package.
Copy link
Member

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
Copy link
Member

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
Copy link
Member

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
Copy link
Member

@Daniel15 Daniel15 Sep 28, 2016

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.

@JoelMarcey
Copy link
Contributor Author

I believe I have addressed all of @Daniel15's feedback in my latest commit this morning.

@JoelMarcey
Copy link
Contributor Author

Just added a section to be more explicit on how to add dependencies.

@jamiebuilds jamiebuilds mentioned this pull request Sep 28, 2016
46 tasks
@jamiebuilds
Copy link
Contributor

I pulled this in and made a lot of changes separately

@jamiebuilds jamiebuilds closed this Oct 4, 2016
@jamiebuilds jamiebuilds deleted the create-a-package branch October 4, 2016 17:21
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