@artus/core
Advanced tools
Comparing version 2.0.0 to 2.0.1-alpha.0
@@ -17,3 +17,2 @@ import { ManifestItem } from '../loader'; | ||
getMergedConfig(): ConfigObject; | ||
getAllConfig(): ConfigObject; | ||
clearStore(): void; | ||
@@ -20,0 +19,0 @@ setConfig(env: string, config: ConfigObject): void; |
@@ -30,8 +30,2 @@ "use strict"; | ||
} | ||
getAllConfig() { | ||
var _a; | ||
const defaultConfig = (_a = this.configStore.get(constant_1.ARTUS_DEFAULT_CONFIG_ENV.DEFAULT)) !== null && _a !== void 0 ? _a : {}; | ||
const keys = Array.from(this.configStore.keys()).filter(key => key !== constant_1.ARTUS_DEFAULT_CONFIG_ENV.DEFAULT); | ||
return (0, merge_1.mergeConfig)(defaultConfig, ...keys.map(key => { var _a; return (_a = this.configStore.get(key)) !== null && _a !== void 0 ? _a : {}; })); | ||
} | ||
clearStore() { | ||
@@ -38,0 +32,0 @@ this.configStore.clear(); |
@@ -226,4 +226,2 @@ "use strict"; | ||
} | ||
// Clean up | ||
this.app.configurationHandler.clearStore(); | ||
} | ||
@@ -230,0 +228,0 @@ dump() { |
@@ -6,2 +6,3 @@ import 'reflect-metadata'; | ||
import { ManifestItem } from '../loader'; | ||
import { ConfigObject } from '../configuration'; | ||
export declare const getPackageVersion: (basePath: string) => Promise<string | undefined>; | ||
@@ -11,3 +12,3 @@ export declare const existsAsync: (filePath: string) => Promise<boolean>; | ||
export declare const isPluginAsync: (basePath: string) => Promise<boolean>; | ||
export declare const loadConfigItemList: <T = Record<string, any>>(configItemList: ManifestItem[], app: Application) => Promise<Record<string, T>>; | ||
export declare const loadConfigItemList: <T = ConfigObject>(configItemList: ManifestItem[], app: Application) => Promise<Record<string, T>>; | ||
export declare const resolvePluginConfigItemRef: (pluginConfigItem: PluginConfigItem, baseDir: string, root: string) => Promise<{ | ||
@@ -14,0 +15,0 @@ name: string; |
@@ -53,2 +53,7 @@ "use strict"; | ||
} | ||
// Use temp Map to store config | ||
const configEnvMap = new Map(); | ||
const stashedConfigStore = app.configurationHandler.configStore; | ||
app.configurationHandler.configStore = configEnvMap; | ||
// Load all config items without hook | ||
const enabledLifecycleManager = app.lifecycleManager.enable; | ||
@@ -58,3 +63,5 @@ app.lifecycleManager.enable = false; | ||
app.lifecycleManager.enable = enabledLifecycleManager; | ||
return Object.fromEntries(app.configurationHandler.configStore.entries()); | ||
// Restore config store | ||
app.configurationHandler.configStore = stashedConfigStore; | ||
return Object.fromEntries(configEnvMap.entries()); | ||
}; | ||
@@ -61,0 +68,0 @@ exports.loadConfigItemList = loadConfigItemList; |
{ | ||
"name": "@artus/core", | ||
"version": "2.0.0", | ||
"version": "2.0.1-alpha.0", | ||
"description": "Core package of Artus", | ||
@@ -5,0 +5,0 @@ "main": "./lib/index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
120888
117
2909
1
11