-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
feat: add booter-lb3app package #2682
Conversation
f21ec34
to
a697d00
Compare
c69ed7d
to
86e416b
Compare
packages/booter-lb3app/src/__tests__/acceptance/booter-lb3app.acceptance.ts
Show resolved
Hide resolved
8951de5
to
4d2dd1e
Compare
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.
The implementations looks pretty good. I see that you have followed the checklist for adding new packages, kudos for that 👏
Let's improve the test suite now. I find the current test suite as too difficult to reason about. There are many fixture files adding lot of functionality on top of default LB3 & LB4 applications, it's not clear what is relevant for the LB3 booter and what's just "random stuff copied from elsewhere".
Ideally, I'd like the test suite to be more focused. Start with a minimal LB3 application with a single model, place this e.g. to /fixtures/minimal-app
. In your test code, create a minimal LB4 application. I think you don't even need to create any new class, just call new RestApplication
. Configure this LB4 app with the new booter and start it. Then verify that the endpoints from LB3 were exposed as expected. I think that's good enough for the first version of this feature. We can add more tests later to verify more complex configuration, if we ever discover any problems there.
packages/booter-lb3app/src/__tests__/acceptance/booter-lb3app.acceptance.ts
Outdated
Show resolved
Hide resolved
packages/booter-lb3app/src/__tests__/fixtures/legacy/common/models/coffee-shop.js
Outdated
Show resolved
Hide resolved
packages/booter-lb3app/src/__tests__/fixtures/src/application.ts
Outdated
Show resolved
Hide resolved
packages/booter-lb3app/src/__tests__/fixtures/src/coffee.controller.ts
Outdated
Show resolved
Hide resolved
packages/booter-lb3app/src/__tests__/fixtures/src/datasources/ds.datasource.json
Outdated
Show resolved
Hide resolved
a28a88f
to
465743e
Compare
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've went through most of the commit (minus some updating deps), and overall the patch looks great 👍.
packages/booter-lb3app/src/__tests__/acceptance/booter-lb3app.acceptance.ts
Outdated
Show resolved
Hide resolved
@@ -59,6 +59,28 @@ describe('booter-lb3app', () => { | |||
}); | |||
}); | |||
|
|||
context('open API spec endpoints', () => { |
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.
👏
@@ -79,12 +68,55 @@ describe('booter-lb3app', () => { | |||
'/api/CoffeeShops/count', | |||
]); | |||
}); | |||
|
|||
context('LoopBack 3 authentication', () => { |
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.
Nice test coverage 👍
444b49a
to
70de24c
Compare
packages/booter-lb3app/fixtures/legacy/common/models/coffee-shop.js
Outdated
Show resolved
Hide resolved
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.
LGTM
c122fd5
to
694daf8
Compare
Co-authored-by: Miroslav Bajtoš <[email protected]>
Closes #2391.
This PR adds the
booter-lb3app
package that assists in booting and mounting a LoopBack 3 application and exposing its REST API through LoopBack 4.Checklist
👉 Read and sign the CLA (Contributor License Agreement) 👈
npm test
passes on your machinepackages/cli
were updatedexamples/*
were updated