fix: errors in mock oauth2 app export from test folder#5386
fix: errors in mock oauth2 app export from test folder#5386deepakrkris merged 1 commit intomasterfrom
Conversation
| @@ -21,7 +21,7 @@ import bodyParser from 'body-parser'; | |||
| import express from 'express'; | |||
There was a problem hiding this comment.
It might be better to have it under src/fixtures/.
|
Maybe we should find a better way to share the mock application, such as its package. Exporting a mock app from the |
@raymondfeng |
The extension packages follow the same convention as core ones for consistency. @bajtos What do you think? |
bad904b to
6df16be
Compare
|
I agree with Raymond that it's a bad practice for packages to export test fixtures. Ideally, we should be excluding the entire What are you @deepakrkris trying to achieve here? Why is If you are trying to share test setup between multiple packages, then please follow the approach we are using for our
In your case, perhaps you should create a new (internal/private?) package providing the mock application, and then add it to dev-dependencies of your projects. Thoughts? |
|
Having wrote the above, maybe it's ok to land the changes in this PR as a short-term fix and then follow up with a refactoring to remove the mock app from exports. |
I like the idea. Let's add a Or simply use |
|
@deepakrkris Let me know if you need some help to set it up. |
|
I am going to implement comments from @bajtos and @raymondfeng , then submit this PR for review again. |
6df16be to
00ae5cc
Compare
0643e9e to
201a806
Compare
|
@bajtos @raymondfeng please review |
| "include": [ | ||
| "src" | ||
| "src", | ||
| "../../fixtures/mock-oauth2-provider/src/mock-oauth2-social-app.ts" |
There was a problem hiding this comment.
This is wrong. We should list @loopback/mock-oauth2-provider as devDependency.
| @@ -0,0 +1,25 @@ | |||
| Copyright (c) IBM Corp. 2017,2019. | |||
There was a problem hiding this comment.
Please fix the header - I believe the year should be 2020.
| { | ||
| "name": "@loopback/mock-oauth2-provider", | ||
| "version": "0.0.1", | ||
| "description": "", |
| "dependencies": { | ||
| "passport": "^0.4.1", | ||
| "tslib": "^1.11.2", | ||
| "util-promisifyall": "^1.0.6" |
There was a problem hiding this comment.
Is it used somewhere in the code?
There was a problem hiding this comment.
agreed, will remove
| "devDependencies": { | ||
| "@loopback/build": "^5.3.1", | ||
| "@loopback/eslint-config": "^6.0.6", | ||
| "tslib": "^1.11.2", |
There was a problem hiding this comment.
This is a duplicate of regular dep.
| "jsonwebtoken": "^8.5.1", | ||
| "lodash": "^4.17.15", | ||
| "passport-http": "^0.3.0", | ||
| "passport-oauth2": "^1.5.0" |
There was a problem hiding this comment.
I believe some of the devDependencies should be moved into dependencies if they are used in the code of the mock app (not tests).
| "devDependencies": { | ||
| "@loopback/build": "^5.3.1", | ||
| "@loopback/eslint-config": "^6.0.6", | ||
| "tslib": "^1.11.2", |
There was a problem hiding this comment.
This needs to be in dependencies only.
| @@ -33,12 +33,7 @@ | |||
| "dependencies": { | |||
| "passport": "^0.4.1", | |||
| "tslib": "^1.11.2", | |||
There was a problem hiding this comment.
The latest version should be 2.0.0 now.
There was a problem hiding this comment.
@raymondfeng all loopback packages refer only tslib 1.12.0 as of now
There was a problem hiding this comment.
No, you need to rebase to master. It's all 2.0.0 now.
| "dependencies": { | ||
| "passport": "^0.4.1", | ||
| "tslib": "^1.11.2", | ||
| "tslib": "^1.12.0", |
There was a problem hiding this comment.
The version should be 2.0.0.
f7c4b7e to
b8862b2
Compare
|
@deepakrkris Please squash the commits into one before landing it. |
b8862b2 to
d47ca2c
Compare
bajtos
left a comment
There was a problem hiding this comment.
Great, this new version looks much better now!
Please register the new package in the following places, as described in https://github.com/strongloop/loopback-next/blob/master/docs/site/DEVELOPING.md#adding-a-new-package:
- Update MONOREPO.md - insert a new table row to describe the new package, please keep the rows sorted by package name.
- Update CODEOWNERS - add a new entry listing the primary maintainers (owners) of the new package.
d47ca2c to
14ecc13
Compare
0aa798b to
1083430
Compare
bajtos
left a comment
There was a problem hiding this comment.
Almost there! Please move the new row in MONOREPO.md in such place that the table stays sorted.
docs/site/MONOREPO.md
Outdated
| | [service-proxy](https://github.com/strongloop/loopback-next/tree/master/packages/service-proxy) | @loopback/service-proxy | A common set of interfaces for interacting with service oriented backends such as REST APIs, SOAP Web Services, and gRPC microservices | | ||
| | [testlab](https://github.com/strongloop/loopback-next/tree/master/packages/testlab) | @loopback/testlab | A collection of test utilities we use to write LoopBack tests | | ||
| | [tsdocs](https://github.com/strongloop/loopback-next/tree/master/packages/tsdocs) | @loopback/tsdocs | An internal package to generate api docs using Microsoft api-extractor and api-documenter | | ||
| | [fixtures/mock-oauth2-provider](https://github.com/strongloop/loopback-next/tree/master/fixtures/mock-oauth2-provider) | _(private)_ | An internal app to mock the OAuth2 authorization flow login with a social app like facebook, google etc | |
There was a problem hiding this comment.
<!-- PLEASE KEEP THE TABLE ROWS SORTED ALPHABETICALLY BY PACKAGE NAME-->
dc5196c to
525a594
Compare
fixes: #5380
Checklist
👉 Read and sign the CLA (Contributor License Agreement) 👈
npm testpasses on your machinepackages/cliwere updatedexamples/*were updated👉 Check out how to submit a PR 👈