@dsmrt/axiom-config 1.1.0 → 1.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # @dsmrt/axiom-config
2
2
 
3
+ ## 1.2.1
4
+
5
+ ### Patch Changes
6
+
7
+ - c941d5d: fix init cli command; fix loadConfigByEnv to allow undefined env
8
+
9
+ ## 1.2.0
10
+
11
+ ### Minor Changes
12
+
13
+ - 5edaee0: load config by env
14
+
3
15
  ## 1.1.0
4
16
 
5
17
  ### Minor Changes
package/dist/index.d.mts CHANGED
@@ -39,6 +39,7 @@ interface LoadConfigInput {
39
39
  cwd?: string;
40
40
  }
41
41
  declare const importConfigFromPath: (path: string) => Promise<Config>;
42
+ declare const loadConfigByEnv: <T extends object>(env?: string, options?: Omit<LoadConfigInput, "env">) => Promise<ConfigContainer & T>;
42
43
  declare const loadConfig: <T extends object>(input?: LoadConfigInput) => Promise<ConfigContainer & T>;
43
44
  /**
44
45
  * Simple object check.
@@ -50,4 +51,4 @@ declare function isObject(item: unknown): unknown;
50
51
  declare function mergeDeep(target: any, ...sources: any[]): any;
51
52
  declare const configPath: (input?: LoadConfigInput) => string;
52
53
 
53
- export { type AwsConfigs, type BaseConfig, type Config, ConfigContainer, type LoadConfigInput, configPath, importConfigFromPath, isObject, loadConfig, mergeDeep };
54
+ export { type AwsConfigs, type BaseConfig, type Config, ConfigContainer, type LoadConfigInput, configPath, importConfigFromPath, isObject, loadConfig, loadConfigByEnv, mergeDeep };
package/dist/index.d.ts CHANGED
@@ -39,6 +39,7 @@ interface LoadConfigInput {
39
39
  cwd?: string;
40
40
  }
41
41
  declare const importConfigFromPath: (path: string) => Promise<Config>;
42
+ declare const loadConfigByEnv: <T extends object>(env?: string, options?: Omit<LoadConfigInput, "env">) => Promise<ConfigContainer & T>;
42
43
  declare const loadConfig: <T extends object>(input?: LoadConfigInput) => Promise<ConfigContainer & T>;
43
44
  /**
44
45
  * Simple object check.
@@ -50,4 +51,4 @@ declare function isObject(item: unknown): unknown;
50
51
  declare function mergeDeep(target: any, ...sources: any[]): any;
51
52
  declare const configPath: (input?: LoadConfigInput) => string;
52
53
 
53
- export { type AwsConfigs, type BaseConfig, type Config, ConfigContainer, type LoadConfigInput, configPath, importConfigFromPath, isObject, loadConfig, mergeDeep };
54
+ export { type AwsConfigs, type BaseConfig, type Config, ConfigContainer, type LoadConfigInput, configPath, importConfigFromPath, isObject, loadConfig, loadConfigByEnv, mergeDeep };
package/dist/index.js CHANGED
@@ -25,6 +25,7 @@ __export(index_exports, {
25
25
  importConfigFromPath: () => importConfigFromPath,
26
26
  isObject: () => isObject,
27
27
  loadConfig: () => loadConfig,
28
+ loadConfigByEnv: () => loadConfigByEnv,
28
29
  mergeDeep: () => mergeDeep
29
30
  });
30
31
  module.exports = __toCommonJS(index_exports);
@@ -97,6 +98,9 @@ var importConfigFromPath = async (path) => {
97
98
  debug(`Unsupported file type: ${path}`);
98
99
  throw new Error(`Unsupported file type or path not found: ${path}`);
99
100
  };
101
+ var loadConfigByEnv = async (env, options) => {
102
+ return await loadConfig({ env, ...options });
103
+ };
100
104
  var loadConfig = async (input) => {
101
105
  debug(
102
106
  `Loading config with options:`,
@@ -191,5 +195,6 @@ var configPath = (input) => {
191
195
  importConfigFromPath,
192
196
  isObject,
193
197
  loadConfig,
198
+ loadConfigByEnv,
194
199
  mergeDeep
195
200
  });
package/dist/index.mjs CHANGED
@@ -75,6 +75,9 @@ var importConfigFromPath = async (path) => {
75
75
  debug(`Unsupported file type: ${path}`);
76
76
  throw new Error(`Unsupported file type or path not found: ${path}`);
77
77
  };
78
+ var loadConfigByEnv = async (env, options) => {
79
+ return await loadConfig({ env, ...options });
80
+ };
78
81
  var loadConfig = async (input) => {
79
82
  debug(
80
83
  `Loading config with options:`,
@@ -168,5 +171,6 @@ export {
168
171
  importConfigFromPath,
169
172
  isObject,
170
173
  loadConfig,
174
+ loadConfigByEnv,
171
175
  mergeDeep
172
176
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dsmrt/axiom-config",
3
- "version": "1.1.0",
3
+ "version": "1.2.1",
4
4
  "description": "Config library for axiom cli",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",