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

Explain npm link #624

Merged
merged 3 commits into from
Mar 28, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@ tmp/
lerna-debug.log
axeReports/
public/
packages/**/package-lock.json
*.zip
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ Internal:
- Fix date-input default example
(PR [#623](https://github.com/alphagov/govuk-frontend/pull/623))

- Explain npm link
(PR [#624](https://github.com/alphagov/govuk-frontend/pull/624))

## 0.0.26-alpha (Breaking release)

Breaking changes:
Expand Down
42 changes: 28 additions & 14 deletions docs/publishing.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,41 +39,55 @@ Note: If a previously unreleased component is found, then you will be prompted t

Once you publish changes, all files are automatically pushed to the remote origin branch.

8. Create a pull request and copy the changelog text.
When reviewing the PR, check that the version numbers have been updated and that the compiled assets use this verson number.
8. (Optional) Test in [GOV.UK Design System]([email protected]:alphagov/govuk-design-system.git)

9. Once the pull request is approved, merge to **master**.
If you want to test your changes work correctly when used in the GOV.UK Design System you can use [npm link](https://docs.npmjs.com/cli/link) to test before publishing.

10. Checkout **master** and pull the latest changes.
```bash
cd ../govuk-design-system
npm link ../govuk-frontend/packages/all
```

11. Log into npm, using team [credentials](https://github.com/alphagov/design-system-team-credentials/tree/master/npm/govuk-patterns-and-tools).
When you have finished you need to unlink the package

12. Run `npm run release`.
```bash
npm unlink ../govuk-frontend/packages/all
```

9. Create a pull request and copy the changelog text.
When reviewing the PR, check that the version numbers have been updated and that the compiled assets use this version number.

10. Once the pull request is approved, merge to **master**.

11. Checkout **master** and pull the latest changes.

12. Log into npm, using team [credentials](https://github.com/alphagov/design-system-team-credentials/tree/master/npm/govuk-patterns-and-tools).

13. Run `npm run release`.

This will:
- check that you're logged in to npm as the correct user.
- publish each package if the package has not been published yet
- create a new tag if the current git tag does not match the latest published tag
- create a new tag if the current git tag does not match the latest published tag
- push the tag to remote origin
- create a zip file of the `dist` directory

13. Create a release in the [Github interface](https://github.com/alphagov/govuk-frontend/releases/new)
14. Create a release in the [Github interface](https://github.com/alphagov/govuk-frontend/releases/new)
- select the latest tag version
- set "GOV.UK Frontend release v[version-number]" as the title
- add release notes from changelog
- attach the generated ZIP that is located at the root of the project
- attach the generated ZIP that is located at the root of the project
- publish release

14. (Required for private beta) Grant "test" user access to any newly published package(s).
15. (Required for private beta) Grant "test" user access to any newly published package(s).
```bash
npm access grant read-only govuk-frontend:test @govuk-frontend/[component-name]
```
15. Log out from npm
16. Log out from npm
```bash
npm logout
```

16. Add Trello cards to "This Sprint" column for
17. Add Trello cards to "This Sprint" column for
- Update the GOV.UK Design System to use the latest release
- Update the GOV.UK Prototype Kit to use the latest release

- Update the GOV.UK Prototype Kit to use the latest release