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

Swap deps to local dev lib part 3 #955

Merged
merged 13 commits into from
Nov 30, 2023
Merged

Swap deps to local dev lib part 3 #955

merged 13 commits into from
Nov 30, 2023

Conversation

camden11
Copy link
Contributor

@camden11 camden11 commented Nov 13, 2023

Description and Context

This switches the following cli-lib deps to local-dev-lib

  • urls
  • table
  • walk
  • sandboxes
  • trackUsage

Who to Notify

@brandenrodgers

@camden11 camden11 changed the title Use local-dev-lib for urls module Swap deps to local dev lib part 3 Nov 13, 2023
@camden11 camden11 marked this pull request as ready for review November 13, 2023 21:44
@camden11 camden11 marked this pull request as draft November 14, 2023 18:56
@camden11 camden11 marked this pull request as ready for review November 15, 2023 20:00
@@ -3,7 +3,7 @@ const fs = require('fs');
const { createIgnoreFilter } = require('@hubspot/local-dev-lib/ignoreRules');
const { isAllowedExtension, getCwd } = require('@hubspot/cli-lib/path');
const { logger } = require('@hubspot/cli-lib/logger');
const { walk } = require('@hubspot/cli-lib/lib/walk');
const { walk } = require('@hubspot/local-dev-lib/fs');
Copy link
Contributor

@brandenrodgers brandenrodgers Nov 28, 2023

Choose a reason for hiding this comment

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

There's a small change in the behavior of walk. It used to log a debug log and then return an empty array. Now it throws on errors in the catch block. We may need to update all of the usages of walk to catch the thrown error and default to an empty array so we have parity in the behavior.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ooh good catch!

@@ -1,4 +1,4 @@
const { trackUsage } = require('@hubspot/cli-lib/api/fileMapper');
const { trackUsage } = require('@hubspot/local-dev-lib/trackUsage');
Copy link
Contributor

Choose a reason for hiding this comment

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

I realized that our trackUsage in local-dev-lib never returns anything. There are areas in the CLI that rely on a response being returned (like here).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It looks like trackAuthAction is the only place the return value is used, and nothing uses the return value of trackAuthAction so I think we're safe to just remove it in the example you linked

@camden11
Copy link
Contributor Author

@brandenrodgers Fixed both of those things. I have a bit more work on this coming in my following PR, but it looks like the existing logErrorInstance should be able to handle most errors thrown by local-dev-lib

@camden11 camden11 merged commit 9adec5f into master Nov 30, 2023
1 check passed
@camden11 camden11 deleted the swap-cli-lib-deps-3 branch November 30, 2023 16:03
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