@superhero/core 4.7.4 → 4.7.5

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 ADDED
@@ -0,0 +1,5 @@
1
+ ---
2
+ #### v4.7.5
3
+ ---
4
+
5
+ altered to support options at bootstrap to freeze the config, and added support for configuring util.inspect.defaultOptions
package/index.js CHANGED
@@ -3,6 +3,7 @@ import cluster from 'node:cluster'
3
3
  import EventEmitter from 'node:events'
4
4
  import path from 'node:path'
5
5
  import url from 'node:url'
6
+ import util from 'node:util'
6
7
  import bootstrap from '@superhero/bootstrap'
7
8
  import Locate from '@superhero/locator'
8
9
  import Log from '@superhero/log'
@@ -280,8 +281,10 @@ export default class Core
280
281
 
281
282
  /**
282
283
  * Bootstrap the core instance, or the core cluster workers - if the core is clustered.
284
+ * @param {object} [options] - Options to pass to the bootstrap process.
285
+ * @param {boolean} [options.freeze] - If true, then freezes the config.
283
286
  */
284
- async bootstrap(freeze = true)
287
+ async bootstrap(options)
285
288
  {
286
289
  Object.assign(Log.config, this.config.find('log'))
287
290
 
@@ -289,11 +292,13 @@ export default class Core
289
292
  {
290
293
  // If the core is forked, then forward the bootstrap event to all workers
291
294
  // instead of applying the bootstrap process in the primary core instance.
292
- this.#eventlog.push({ type: 'bootstrap', freeze })
295
+ this.#eventlog.push({ type: 'bootstrap', options })
293
296
  }
294
297
  else if(false === this.#isBooted)
295
298
  {
296
- freeze && this.config.freeze()
299
+ options?.freeze && this.config.freeze()
300
+
301
+ util.inspect.defaultOptions = this.config.find('util/inspect', util.inspect.defaultOptions)
297
302
 
298
303
  const locatorMap = this.config.find('locator')
299
304
  locatorMap && await this.locate.eagerload(locatorMap)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@superhero/core",
3
- "version": "4.7.4",
3
+ "version": "4.7.5",
4
4
  "description": "Core functionalities for the superhero framework.",
5
5
  "main": "index.js",
6
6
  "license": "MIT",
@@ -13,12 +13,12 @@
13
13
  "test": "syntax-check; node --test --test-reporter=@superhero/audit/reporter --experimental-test-coverage"
14
14
  },
15
15
  "dependencies": {
16
- "@superhero/locator": "4.7.4",
17
- "@superhero/bootstrap": "4.7.4",
18
- "@superhero/log": "4.7.4"
16
+ "@superhero/locator": "4.7.5",
17
+ "@superhero/bootstrap": "4.7.5",
18
+ "@superhero/log": "4.7.5"
19
19
  },
20
20
  "devDependencies": {
21
- "@superhero/audit": "4.7.4",
21
+ "@superhero/audit": "4.7.5",
22
22
  "@superhero/syntax-check": "0.0.2"
23
23
  },
24
24
  "author": {