-
Notifications
You must be signed in to change notification settings - Fork 4
Config Revamp #231
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
Config Revamp #231
Changes from 58 commits
cee8aac
b252721
4595dc5
29d26ba
63b55fa
9ab3c88
7404320
93c27be
d521932
fc6ca45
c715602
06669df
2492289
258be5e
05699b3
930ac75
b541617
e415848
5cb2fa0
e85f998
6ec40b3
59152d2
c0cdc17
63bc4a2
267b483
2533194
a236fa8
1a686ed
48cff29
1b99a2b
c413242
6b5dd10
46f0b30
fec1d99
fb7d46c
8e68f43
78d8a03
32433cd
61e2a1e
a8c86af
7eb31fc
d8eab5f
bcacccd
bbef362
1b6e75b
e17b8b2
75437a4
b45cc91
cd8cfbe
59d5a52
fbf468d
6e2de23
91cf951
3eef14b
0dd62db
3dced33
8c5ef25
f8aae4d
221ff2b
acfee0f
062aa9a
eaf7883
26b0b69
5f8df4e
56ace63
c1e6e04
0eb86da
ff10935
2eacdae
fd5c85e
67d7630
5f50750
f9c7313
6166648
d1c303e
0306b9d
0e17f07
4785230
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -10,17 +10,20 @@ The config file is named `huspot.config.yml`. | |
|
|
||
| There are a handful of standard config utils that anyone working in this library should be familiar with. | ||
|
|
||
| #### getAndLoadConfigIfNeeded() | ||
| #### getConfig() | ||
|
|
||
| Locates, parses, and stores the `hubspot.config.yml` file in memory. This should be the first thing that you do if you plan to access any of the config file values. If the config has already been loaded, this function will simply return the already-parsed config values. | ||
| Locates and parses the hubspot config file. This function will automatically find the correct config file. Typically, it defaults to the nearest config file by working up the direcotry tree. Custom config locations can be set using the following environment variables | ||
|
|
||
| #### updateAccountConfig() | ||
| - `USE_ENVIRONTMENT_CONFIG` - load config account from environment variables | ||
| - `HUBSPOT_CONFIG_PATH` - specify a path to a specific config file | ||
|
|
||
| Safely writes updated values to the `hubspot.config.yml` file. This will also refresh the in-memory values that have been stored for the targeted account. | ||
| #### updateConfigAccount() | ||
|
|
||
| #### getAccountConfig() | ||
| Safely writes updated values to the `hubspot.config.yml` file. | ||
|
|
||
| Returns config data for a specific account, given the account's ID. | ||
| #### getConfigAccountById() and getConfigAccountByName() | ||
|
|
||
| Returns config data for a specific account, given the account's ID or name. | ||
|
|
||
| ## Example config | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I updated the existing content of the readme to reflect the changes I made, but it may make sense to rethink it completely
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah good call. That could always be done as a follow up |
||
|
|
||
|
|
@@ -39,7 +42,3 @@ portals: | |
| accountType: STANDARD | ||
| personalAccessKey: 'my-personal-access-key' | ||
| ``` | ||
|
|
||
| ## config_DEPRECATED.ts explained | ||
|
|
||
| You may notice that we have a few configuration files in our `config/` folder. This is because we are in the middle of exploring a new method for storing account information. Despite its naming, config_DEPRECATED.ts is still the configuration file that handles all of our config logic. We have a proxy file named `config/index.ts` that will always choose to use the soon-to-be deprecated configuration file. This proxy file will enable us to slowly port config functionality over to the new pattern (i.e. `config/CLIConfiguration.ts`). For now, it is recommended to use config_DEPRECATED.ts and the utils it provides. We ask that any updates made to config_DEPRECATED.ts are also made to the newer CLIConfiguration.ts file whenever applicable. | ||
This file was deleted.
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 part "Typically, it defaults to the nearest config file by working up the direcotry tree." is only true if the user doesn't also have a global config file. If they have a global config, we'll prioritize using that one.
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, will update that