Skip to content

Commit c66b7e0

Browse files
authored
fix!: add named exports for global-config utils (#359)
* use explicity exports for global-config * removed default export from global-config * Fixed import in api-token
1 parent 0fa1f1e commit c66b7e0

File tree

3 files changed

+3
-5
lines changed

3 files changed

+3
-5
lines changed

packages/dev-utils/src/lib/api-token.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import getGlobalConfigStore from './global-config.js'
1+
import { getGlobalConfigStore } from './global-config.js'
22

33
export const getAPIToken = async () => {
44
const globalConfig = await getGlobalConfigStore()

packages/dev-utils/src/lib/global-config.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ const globalConfigDefaults = {
7676
// Memoise config result so that we only load it once
7777
let configStore: GlobalConfigStore | undefined
7878

79-
const getGlobalConfigStore = async (): Promise<GlobalConfigStore> => {
79+
export const getGlobalConfigStore = async (): Promise<GlobalConfigStore> => {
8080
if (!configStore) {
8181
// Legacy config file in home ~/.netlify/config.json
8282
const legacyPath = getLegacyPathInHome(['config.json'])
@@ -96,8 +96,6 @@ const getGlobalConfigStore = async (): Promise<GlobalConfigStore> => {
9696
return configStore
9797
}
9898

99-
export default getGlobalConfigStore
100-
10199
export const resetConfigCache = () => {
102100
configStore = undefined
103101
}

packages/dev-utils/src/main.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ export { DevEvent, DevEventHandler } from './lib/event.js'
55
export { type Geolocation, mockLocation } from './lib/geo-location.js'
66
export { ensureNetlifyIgnore } from './lib/gitignore.js'
77
export { headers, toMultiValueHeaders } from './lib/headers.js'
8-
export * as globalConfig from './lib/global-config.js'
8+
export { getGlobalConfigStore, GlobalConfigStore, resetConfigCache } from './lib/global-config.js'
99
export { Handler } from './lib/handler.js'
1010
export { LocalState } from './lib/local-state.js'
1111
export { type Logger, netlifyCommand, netlifyCyan, netlifyBanner } from './lib/logger.js'

0 commit comments

Comments
 (0)