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

Update dependencies (including the Joi package rename) #56

Merged
merged 2 commits into from
Nov 20, 2020

Conversation

abeluck
Copy link
Contributor

@abeluck abeluck commented Nov 20, 2020

This commit:

  • updates Joi following the package rename
  • fixes the breaking Joi API changes from 15 -> 16 so the tests pass
  • updates all other dependencies

Fixes #41

❯ npm run test

> blipp@4.0.1 test /home/user/src/blipp
> lab -a @hapi/code -v -t 100 -L -I queueMicrotask

routes
  ✔ 1) print route information (66 ms and 4 assertions)
  ✔ 2) gets route information (28 ms and 3 assertions)
  ✔ 3) gets route information with auth (35 ms and 5 assertions)
  ✔ 4) gets route information with all scope (20 ms and 5 assertions)
  ✔ 5) gets route information with required scope (26 ms and 5 assertions)
  ✔ 6) gets route information with selection scope (26 ms and 5 assertions)
  ✔ 7) gets route information with forbidden scope (26 ms and 5 assertions)
  ✔ 8) gets route information with default (16 ms and 4 assertions)
  ✔ 9) fails with invalid options (22 ms and 2 assertions)


9 tests complete
Test duration: 295 ms
Assertions count: 38 (verbosity: 4.22)
Leaks: No issues
Coverage: 100.00%
Lint: No issues

* switches to the new package name
* updates to the latest stable version

ref danielb2#41
@abeluck abeluck changed the title Update dependencies (inlcuding the Joi package rename) Update dependencies (including the Joi package rename) Nov 20, 2020
@danielb2 danielb2 merged commit f9f94ce into danielb2:master Nov 20, 2020
@danielb2
Copy link
Owner

thanks!

@danielb2
Copy link
Owner

published

@abeluck
Copy link
Contributor Author

abeluck commented Nov 23, 2020

@danielb2 thanks!

Any chance you could tag the releases in the github repo?

Cruikshanks added a commit to DEFRA/sroc-charging-module-api that referenced this pull request Nov 23, 2020
This dependabot PR was failing when running unit tests

```
Error requiring file: /vagrant/sroc-charging-module-api/test/controllers/admin/health/airbrake.controller.test.js
Cannot find module '@hapi/joi'
Require stack:
- /vagrant/sroc-charging-module-api/node_modules/@now-ims/hapi-now-auth/lib/index.js
- /vagrant/sroc-charging-module-api/app/plugins/hapi_now_auth.plugin.js
- /vagrant/sroc-charging-module-api/app/plugins/index.js
- /vagrant/sroc-charging-module-api/server.js
- /vagrant/sroc-charging-module-api/test/controllers/admin/health/airbrake.controller.test.js
- /vagrant/sroc-charging-module-api/node_modules/@hapi/lab/lib/cli.js
- /vagrant/sroc-charging-module-api/node_modules/@hapi/lab/bin/lab
```

After checking the main change in Blipp 4.0.2 was [updating the Joi dependency from `@hapi/joi` to just `joi`](danielb2/blipp#56). Understandable as Joi is no longer part of Hapi so that version of the package is no longer being maintained.

However, it looks like Blipp was the one package bringing in @hapi/joi and that @now-ims/hapi-now-auth has an undeclared dependency on it.

If you check their codebase [package.json](https://github.com/now-ims/hapi-now-auth/blob/master/package.json) does not declare anything regards Joi. But their [lib/index.js](https://github.com/now-ims/hapi-now-auth/blob/master/lib/index.js) `require()` it right at the top of the file 🤦.

So there is only really 2 solutions (if we ignore forking)

- lock the version of Blipp to the previous
- manually include @hapi/joi as a dependency
Cruikshanks added a commit to DEFRA/sroc-charging-module-api that referenced this pull request Nov 23, 2020
Bumps [blipp](https://github.com/danielb2/blipp) from 4.0.1 to 4.0.2.
- [Release notes](https://github.com/danielb2/blipp/releases)
- [Commits](https://github.com/danielb2/blipp/commits)

Signed-off-by: dependabot[bot] <support@github.com>

* Add hapi/joi dependency manually

This dependabot PR was failing when running unit tests

```
Error requiring file: /vagrant/sroc-charging-module-api/test/controllers/admin/health/airbrake.controller.test.js
Cannot find module '@hapi/joi'
Require stack:
- /vagrant/sroc-charging-module-api/node_modules/@now-ims/hapi-now-auth/lib/index.js
- /vagrant/sroc-charging-module-api/app/plugins/hapi_now_auth.plugin.js
- /vagrant/sroc-charging-module-api/app/plugins/index.js
- /vagrant/sroc-charging-module-api/server.js
- /vagrant/sroc-charging-module-api/test/controllers/admin/health/airbrake.controller.test.js
- /vagrant/sroc-charging-module-api/node_modules/@hapi/lab/lib/cli.js
- /vagrant/sroc-charging-module-api/node_modules/@hapi/lab/bin/lab
```

After checking the main change in Blipp 4.0.2 was [updating the Joi dependency from `@hapi/joi` to just `joi`](danielb2/blipp#56). Understandable as Joi is no longer part of Hapi so that version of the package is no longer being maintained.

However, it looks like Blipp was the one package bringing in @hapi/joi and that @now-ims/hapi-now-auth has an undeclared dependency on it.

If you check their codebase [package.json](https://github.com/now-ims/hapi-now-auth/blob/master/package.json) does not declare anything regards Joi. But their [lib/index.js](https://github.com/now-ims/hapi-now-auth/blob/master/lib/index.js) `require()` it right at the top of the file.

So there are only really 2 solutions (if we ignore forking)

- lock the version of Blipp to the previous
- manually include @hapi/joi as a dependency

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Alan Cruikshanks <alan.cruikshanks@gmail.com>
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.

Update hapi and joi dependencies to download from @hapi org
2 participants