Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
cee8aac
config revamp WIP
camden11 Jan 31, 2025
b252721
finish getConfig
camden11 Jan 31, 2025
4595dc5
more config WIP
camden11 Feb 3, 2025
29d26ba
more config WIP
camden11 Feb 3, 2025
63b55fa
config wip
camden11 Feb 4, 2025
9ab3c88
-wip
camden11 Feb 5, 2025
7404320
update handling of env config
camden11 Feb 5, 2025
93c27be
Update accounts
camden11 Feb 5, 2025
d521932
config account adding/updating
camden11 Feb 6, 2025
fc6ca45
finish config exportable first pass
camden11 Feb 6, 2025
c715602
add back missing methods we might need
camden11 Feb 6, 2025
06669df
handle new environment variables
camden11 Feb 7, 2025
2492289
Add config source options to environment
camden11 Feb 7, 2025
258be5e
Cleanup wip
camden11 Feb 7, 2025
05699b3
Fix TS build
camden11 Feb 10, 2025
930ac75
remove unneeded types
camden11 Feb 10, 2025
b541617
configUtils tests
camden11 Feb 10, 2025
e415848
Config WIP
camden11 Feb 10, 2025
5cb2fa0
Finish tests for config
camden11 Feb 11, 2025
e85f998
Delete old tests
camden11 Feb 11, 2025
6ec40b3
update PAK tests
camden11 Feb 11, 2025
59152d2
Fix existing tests
camden11 Feb 11, 2025
c0cdc17
Add error and debug copy to new config methods
camden11 Feb 11, 2025
63bc4a2
Handle named default accounts
camden11 Feb 12, 2025
267b483
Add defaultAccountOverride functionality
camden11 Feb 12, 2025
2533194
return default account if exists
camden11 Feb 12, 2025
a236fa8
Fix tests
camden11 Feb 12, 2025
1a686ed
Update tests for getDefaultAccount
camden11 Feb 12, 2025
48cff29
Add tests for default account override
camden11 Feb 12, 2025
1b99a2b
Add tests for default account override
camden11 Feb 12, 2025
c413242
Clean some things up
camden11 Feb 12, 2025
6b5dd10
make sandboxAccountType deprecated
camden11 Feb 13, 2025
46f0b30
Fix casing bug
camden11 Feb 14, 2025
fec1d99
add getConfigAccountIfExists
camden11 Mar 13, 2025
fb7d46c
Update a lot of lib files
camden11 Mar 14, 2025
8e68f43
v0.2.0-experimental.0
camden11 Mar 21, 2025
78d8a03
Merge branch 'main' into dynamic-config
camden11 Mar 21, 2025
32433cd
add http use localhost config flag
camden11 Mar 21, 2025
61e2a1e
add getConfigDefaultAccountIfExists
camden11 Mar 21, 2025
a8c86af
Merge branch 'main' into dynamic-config
camden11 Apr 4, 2025
7eb31fc
Updateconfig migrate for revamped config
camden11 Apr 4, 2025
d8eab5f
remove unused copy
camden11 Apr 4, 2025
bcacccd
export getConfigAtPath
camden11 Apr 4, 2025
bbef362
Updateconfig merging logic
camden11 Apr 10, 2025
1b6e75b
Add tests for migrations
camden11 Apr 10, 2025
e17b8b2
Merge pull request #254 from HubSpot/dynamic-config-migrations
camden11 Apr 11, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
693 changes: 0 additions & 693 deletions config/CLIConfiguration.ts

This file was deleted.

19 changes: 9 additions & 10 deletions config/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
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 updated the existing content of the readme to reflect the changes I made, but it may make sense to rethink it completely

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah good call. That could always be done as a follow up


Expand All @@ -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.
150 changes: 0 additions & 150 deletions config/__tests__/CLIConfiguration.test.ts

This file was deleted.

Loading