Skip to content
This repository has been archived by the owner on Aug 19, 2022. It is now read-only.

Commit

Permalink
Merge pull request #562 from ckiss/master
Browse files Browse the repository at this point in the history
export plugin name
  • Loading branch information
ckiss authored Mar 13, 2019
2 parents 2cca0bc + 243fdb2 commit e930e96
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 17 deletions.
4 changes: 4 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 5.3.0 - Mar 13, 2019
Enhancement:
- Hapi plugins export a `name` property whose value is `udaru-hapi-plugin`. This is useful when loading specific plugin options on registration, based on this newly exported plugin name [commit](https://github.com/nearform/udaru/pull/562)

## 5.2.3 - Feb 5, 2019
Fixes:
- Fix organization and teams create callback handling [commit](https://github.com/nearform/udaru/pull/560)
Expand Down
27 changes: 14 additions & 13 deletions docs/contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,26 +22,27 @@ Be mindful of these dependencies when publishing, i.e. if you publish a new vers
We are currently supporting node 6, 8 and 10.

1. Review github issues, triage, close and merge issues related to the release.
2. Update the CHANGES.md file.
3. Navigate to the [Test Rig][Test] and ensure all tests are passing.
4. Pull down the repository locally on the master branch.
5. Ensure there are no outstanding commits and the branch is clean.
6. From root, run `npm run test:commit-check` and sanity check testing and linting passes, and that there are no dependency issues.
7. From root, run `npm run outdated:all` and review all dependencies. For each outdated dependency, make a call whether to update or not.
1. Update the CHANGES.md file.
1. Navigate to the [Test Rig][Test] and ensure all tests are passing.
1. Pull down the repository locally on the master branch.
1. Ensure there are no outstanding commits and the branch is clean.
1. For the next step you need to have postgres running locally. From root, run `docker-compose up -d`
1. From root, run `npm run test:commit-check` and sanity check testing and linting passes, and that there are no dependency issues.
1. From root, run `npm run outdated:all` and review all dependencies. For each outdated dependency, make a call whether to update or not.
- Run `npm run update:all` to get all non breaking updates. We have a policy of using '^' for all dependencies in the package.json and using npm shrinkwrap for each release.
- Run `npm run outdated:all` again to review possible breaking and major revision updates.
- Create a github issue for any major update where appropriate.
8. In the order of dependencies above, for each package:
1. In the order of dependencies above, for each package:
- Run `npm install` and verify that root level and package dependencies correctly install.
- Run `npm test` to verify the tests run locally within their own context (something that's not done by CI)
9. Run `npm run swagger-gen` to regenerate the Swagger documentation for the Udaru [documentation site][docs-site].
1. Run `npm run swagger-gen` to regenerate the Swagger documentation for the Udaru [documentation site][docs-site].
- Run `git add` and `git commit` to commit any version and documentation changes if there are any.
10. Finally, from root, log in to npm using `npm login`, run `lerna publish` and choose the approriate version change type. This will update each package.json of modified packages as appropriate, create a new git commit and tag, and publish updated packages to npm.
1. Finally, from root, log in to npm using `npm login`, run `lerna publish` and choose the approriate version change type. This will update each package.json of modified packages as appropriate, create a new git commit and tag, and publish updated packages to npm.
- Update root package.json to the correct version number and commit
11. Go to the [Github release page][Releases] and hit 'Draft a new release'.
12. Paste the Changelog content for this release and add additional release notes.
13. Choose the tag version and a title matching the release and publish.
14. Notify the #udaru slack channel
1. Go to the [Github release page][Releases] and hit 'Draft a new release'.
1. Paste the Changelog content for this release and add additional release notes.
1. Choose the tag version and a title matching the release and publish.
1. Notify the #udaru slack channel

[Test]: https://travis-ci.org/nearform/udaru
[Releases]: https://github.com/nearform/udaru/releases
Expand Down
2 changes: 1 addition & 1 deletion docs/swagger/swagger-json.js

Large diffs are not rendered by default.

6 changes: 4 additions & 2 deletions packages/udaru-hapi-16-plugin/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ const buildUdaru = require('@nearform/udaru-core')
const buildAuthorization = require('./authentication/authorization')
const buildHapiAuthService = require('./authentication/hapi-auth-service')
const buildAuthValidation = require('./authentication/hapi-auth-validation')

const buildConfig = require('./config')

function register (server, options, next) {
Expand Down Expand Up @@ -73,7 +72,10 @@ function register (server, options, next) {
)
}

module.exports.register = register
module.exports = {
name: 'udaru-hapi-plugin',
register
}

module.exports.register.attributes = {
pkg: require('./package')
Expand Down
2 changes: 1 addition & 1 deletion packages/udaru-hapi-plugin/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const HapiAuthService = require('./lib/authentication')

module.exports = {
pkg: require('./package'),

name: 'udaru-hapi-plugin',
async register (server, options) {
const config = buildConfig(options.config)
const udaru = buildUdaru(options.dbPool, config)
Expand Down

0 comments on commit e930e96

Please sign in to comment.