diff --git a/.changeset/thirty-shirts-battle.md b/.changeset/thirty-shirts-battle.md new file mode 100644 index 00000000..8e561d8e --- /dev/null +++ b/.changeset/thirty-shirts-battle.md @@ -0,0 +1,5 @@ +--- +'pockethost': minor +--- + +logSettings now exported from core diff --git a/packages/pockethost/src/constants.ts b/packages/pockethost/src/constants.ts index aa7a0b34..302398a7 100644 --- a/packages/pockethost/src/constants.ts +++ b/packages/pockethost/src/constants.ts @@ -1,4 +1,3 @@ -import { forEach } from '@s-libs/micro-dash' import { config } from 'dotenv' import envPaths from 'env-paths' import { dirname, join } from 'path' @@ -8,6 +7,7 @@ import { mkBoolean, mkCsvString, mkNumber, mkPath, mkString } from '../core' import { InstanceId } from './common' import { DEBUG, IS_DEV } from './common/debug' import { Settings } from './core/Settings' +import { logSettings } from './core/logSettings' const __dirname = dirname(fileURLToPath(import.meta.url)) @@ -58,12 +58,6 @@ export const NODE_ENV = () => process.env.NODE_ENV export const INSTANCE_DATA_DIR = (id: InstanceId, ...paths: string[]) => join(DATA_DIR(), id, ...paths) -export const logConstants = () => { - forEach(settings, (v, k) => { - console.log(`${k}: ${v}`) - }) -} - if (DEBUG()) { - logConstants() + logSettings(settings) } diff --git a/packages/pockethost/src/core/index.ts b/packages/pockethost/src/core/index.ts index c915fda8..0e954e98 100644 --- a/packages/pockethost/src/core/index.ts +++ b/packages/pockethost/src/core/index.ts @@ -3,5 +3,6 @@ export * from './Settings' export * from './asyncExecutionGuard' export * from './exit' export * from './internal' +export * from './logSettings' export * from './smartFetch' export * from './tryFetch' diff --git a/packages/pockethost/src/core/logSettings.ts b/packages/pockethost/src/core/logSettings.ts new file mode 100644 index 00000000..0f9f4efa --- /dev/null +++ b/packages/pockethost/src/core/logSettings.ts @@ -0,0 +1,7 @@ +import { forEach } from '@s-libs/micro-dash' + +export const logSettings = (settings: { [_: string]: any }) => { + forEach(settings, (v, k) => { + console.log(`${k}: ${v}`) + }) +}