-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Bring in loopback4-example-log-extension #908
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
Conversation
8e1c215 to
f4dd44e
Compare
|
I've noticed that this repo doesn't use |
virkt25
left a comment
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.
Looks great! Just have some minor nits.
| "build:dist6": "lb-tsc es2015", | ||
| "build:apidocs": "lb-apidocs", | ||
| "clean": "lb-clean loopback-getting-started*.tgz dist dist6 package api-docs", | ||
| "clean": "lb-clean *example-getting-started*.tgz dist dist6 package api-docs", |
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.
Is the * before the word example necessary?
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.
Yes. Here is the full tarball name as produced by npm pack:
loopback-example-getting-started-1.0.1-alpha.0.tgz
| @@ -0,0 +1,21 @@ | |||
| MIT License | |||
|
|
|||
| Copyright (c) 2017 StrongLoop and IBM API Connect | |||
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 believe all the other packages use a slightly different header for LICENSE. I think this should use the same.
Copyright (c) IBM Corp. 2017,2018. All Rights Reserved.
Node module: @loopback/example-log-extension
This project is licensed under the MIT License, full text below.
--------
MIT license
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.
Good catch, I'll use LICENSE from getting-started example.
| @@ -0,0 +1,364 @@ | |||
| # loopback4-example-log-extension | |||
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.
Should we change this to example-log-extension?
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'll use @loopback/example-log-extension for consistency with getting-started example (I'll fix package.json too).
| @@ -0,0 +1,6 @@ | |||
| // Copyright IBM Corp. 2017. All Rights Reserved. | |||
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.
2017, 2018.
(All files -- since others in loopback-next were already updated).
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.
Let's use slt license because that's the tool we will use in the future.
SLT_OWNER="IBM Corp." slt copyright
Unfortunately this tool sets the copyright year to 2018 because it uses git commit history to find out the date of the first commit. Do you think this is a problem?
| @@ -0,0 +1,6 @@ | |||
| // Copyright IBM Corp. 2017. All Rights Reserved. | |||
| // Node module: loopback4-example-log-extension | |||
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.
Node module: @loopback/example-log-extension.
| @@ -0,0 +1,55 @@ | |||
| { | |||
| "name": "loopback4-example-log-extension", | |||
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.
@loopback/example-log-extension.
| @@ -0,0 +1,55 @@ | |||
| { | |||
| "name": "loopback4-example-log-extension", | |||
| "version": "1.0.0", | |||
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.
example getting started is version as 4.0.0-alpha.0. Should we use the same here?
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.
Sure.
| }, | ||
| "repository": { | ||
| "type": "git", | ||
| "url": "git+https://github.com/strongloop/loopback4-example-log-extension.git" |
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.
Point to loopback-next repo.
| @@ -0,0 +1,2 @@ | |||
| --recursive | |||
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.
This can be dropped since package.json uses mocha.opts from @loopback/build.
| // This file is licensed under the MIT License. | ||
| // License text available at https://opensource.org/licenses/MIT | ||
|
|
||
| import {expect} from '@loopback/testlab'; |
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 think it's safe to drop this file as well.
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.
Left few comments about some things to think about, but aside from that LGTM on top of what @virkt25 has already mentioned
| "build:current": "lb-tsc", | ||
| "build:dist": "lb-tsc es2017", | ||
| "build:dist6": "lb-tsc es2015", | ||
| "build:apidocs": "lb-apidocs", |
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.
Should we be creating apidocs for this repo?
| @@ -0,0 +1,21 @@ | |||
| MIT License | |||
|
|
|||
| Copyright (c) 2017 StrongLoop and IBM API Connect | |||
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.
|
@shimks I agree. It's probably best to create a issue to follow up on the refactor but this PR's scope should be migration only. |
d255e8c to
e80ddc1
Compare
e80ddc1 to
324e81a
Compare
packages/rest/index.js
Outdated
|
|
||
| const nodeMajorVersion = +process.versions.node.split('.')[0]; | ||
| module.exports = nodeMajorVersion >= 7 ? require('./dist') : require('./dist6'); | ||
| module.exports = nodeMajorVersion >= 7 ? |
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.
Please revert the changes to this file.
virkt25
left a comment
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.
Please revert changes to packages/rest/index.js.
LGTM. No further review needed from me.
Copy the contents of loopback4-example-log-extension, leave out dot files like gitignore
324e81a to
fec2122
Compare
The first commit 76558a6 brings in an exact copy of https://github.com/strongloop/loopback4-example-log-extension.
The second commit f4dd44e contains changes necessary to integrate the example with the rest of the monorepo.
See #836
Checklist
npm testpasses on your machinepackages/cliwere updatedpackages/example-*were updated