-
Notifications
You must be signed in to change notification settings - Fork 5
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
Explore usage tracking #52
base: master
Are you sure you want to change the base?
Conversation
* look for hs config
if (firstFile) { | ||
trackUsage(); | ||
firstFile = false; | ||
} |
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 code is executed for each file so this prevents trackUsage
from being called multiple times
import { resolveConfigFile } from "prettier"; | ||
|
||
export const trackUsage = () => { | ||
const rootPath = resolveConfigFile.sync(); |
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 looks up the prettier config and we use that to try to find the HubSpot config.
It's not guaranteed to be in the a child directly alongside a hubspot.config.yml
or even exist.
|
||
if (!validateConfig()) { | ||
return; | ||
} |
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.
TODO:
- More logic to check
isTrackingAllowed
- Log message to user to let them know that tracking is enabled and how they can disable it (hubspot config)
- Actually implement tracking. My current thought is that we'd spawn a detached child process to make the actual request
No description provided.