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

Port logging UI utils back from local-dev-lib #1004

Merged
merged 11 commits into from
Mar 11, 2024

Conversation

brandenrodgers
Copy link
Contributor

Description and Context

Relies on: HubSpot/hubspot-local-dev-lib#108

Porting all of the deleted logging UI utils from local-dev-lib into the CLI. The idea is to keep the UI utils here in the CLI, which is effectively the UI of our local dev tooling. I reorganized things in the lib/ folder because the file structure in that folder is so flat that it's tough to find things in there. Now we have lib/ui/ which can be a place for all of our UI utils. We're planning to eventually expand on the ui utils at some point this year so this sets us up for that.

I mentioned it in the LDL PR, but there is a little bit of duplicated code in here because of the other two packages that live in this repo. My opinion is that we should work towards breaking those two packages out into their own repos. There isn't a ton of maintenance that goes into supporting them, so it wouldn't be a big lift.

Screenshots

TODO

Who to Notify

@brandenrodgers brandenrodgers marked this pull request as ready for review March 7, 2024 16:28
@@ -1036,6 +1036,17 @@ en:
linkText: "HubSpot's sample projects"
url: "https://developers.hubspot.com/docs/platform/sample-projects?utm_source=cli&utm_content=project_create_whats_next"
message: "See {{ link }}"
git:
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I ported some of the git-related logging utils back into here, so I had to also add the lang keys for them

@@ -0,0 +1,103 @@
const moment = require('moment');
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This serverless logging functionality is duplicated in here and in the serverless-dev-runtime package. It's a little gross, but ideally we can deprecate that package soon in favor of the developer projects version of local dev for serverless functions.

Copy link
Contributor

@camden11 camden11 left a comment

Choose a reason for hiding this comment

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

One very minor comment, otherwise this looks good to me!

@@ -9,15 +9,12 @@ const {
} = require('../../lib/commonOpts');
const { trackCommandUsage } = require('../../lib/usageTracking');
const { logger } = require('@hubspot/local-dev-lib/logger');
// const { outputLogs } = require('@hubspot/cli-lib/lib/logs');
// const { outputLogs } = require('../lib/ui/serverlessFunctionLogs');
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we still need this comment? If so, looks like the import path is wrong - needs another ../

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I guess we could delete all of them. I think they were kept around because we plan to bring the functionality back sometime soon hopefully.

@@ -17,7 +17,6 @@
"test": "echo \"Error: run tests from root\" && exit 1"
},
"dependencies": {
"@hubspot/cli-lib": "^9.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.

just beautiful

@brandenrodgers brandenrodgers changed the title [WIP] Port logging UI utils back from local-dev-lib Port logging UI utils back from local-dev-lib Mar 11, 2024
@brandenrodgers brandenrodgers merged commit 19febdc into master Mar 11, 2024
1 check passed
@brandenrodgers brandenrodgers deleted the br-add-logging-utils-from-cli-lib branch March 11, 2024 18:24
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.

2 participants