Skip to content

Conversation

@bajtos
Copy link
Member

@bajtos bajtos commented Jan 25, 2018

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 test passes on your machine
  • New tests added or existing tests modified to cover all changes
  • Code conforms with the style guide
  • Related API Documentation was updated
  • Affected artifact templates in packages/cli were updated
  • Affected example projects in packages/example-* were updated

@bajtos bajtos added this to the Sprint 54 milestone Jan 25, 2018
@bajtos bajtos self-assigned this Jan 25, 2018
@bajtos bajtos requested review from kjdelisle and virkt25 January 25, 2018 13:47
@bajtos bajtos requested a review from raymondfeng as a code owner January 25, 2018 13:47
@virkt25 virkt25 mentioned this pull request Jan 25, 2018
12 tasks
@bajtos bajtos force-pushed the example/log-extension branch from 8e1c215 to f4dd44e Compare January 25, 2018 14:03
@shimks
Copy link
Contributor

shimks commented Jan 25, 2018

I've noticed that this repo doesn't use MetadataInspector from @loopback/metadata. Should we migrate this first and then look to refactor the repo?

Copy link
Contributor

@virkt25 virkt25 left a 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",
Copy link
Contributor

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?

Copy link
Member Author

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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. 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

Copy link
Member Author

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
Copy link
Contributor

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?

Copy link
Member Author

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.
Copy link
Contributor

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).

Copy link
Member Author

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
Copy link
Contributor

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",
Copy link
Contributor

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",
Copy link
Contributor

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?

Copy link
Member Author

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"
Copy link
Contributor

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
Copy link
Contributor

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';
Copy link
Contributor

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.

Copy link
Contributor

@shimks shimks left a 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",
Copy link
Contributor

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
Copy link
Contributor

@shimks shimks Jan 25, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@virkt25
Copy link
Contributor

virkt25 commented Jan 25, 2018

@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.

@bajtos bajtos force-pushed the example/log-extension branch from d255e8c to e80ddc1 Compare January 26, 2018 12:26
@bajtos
Copy link
Member Author

bajtos commented Jan 26, 2018

@virkt25 @shimks I think I have addressed all your review comments in e80ddc1 324e81a, LGTY now?

@bajtos bajtos requested a review from virkt25 January 26, 2018 12:27
@bajtos bajtos force-pushed the example/log-extension branch from e80ddc1 to 324e81a Compare January 26, 2018 13:43

const nodeMajorVersion = +process.versions.node.split('.')[0];
module.exports = nodeMajorVersion >= 7 ? require('./dist') : require('./dist6');
module.exports = nodeMajorVersion >= 7 ?
Copy link
Contributor

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.

Copy link
Contributor

@virkt25 virkt25 left a 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
@bajtos bajtos force-pushed the example/log-extension branch from 324e81a to fec2122 Compare January 26, 2018 16:21
@bajtos bajtos merged commit b9883ec into master Jan 26, 2018
@bajtos bajtos deleted the example/log-extension branch January 26, 2018 16:59
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.

5 participants