@platformatic/config
Advanced tools
Comparing version 0.36.0 to 0.37.0
@@ -32,4 +32,2 @@ import { type InstanceOptions } from 'ajv' | ||
fullPath: string | ||
startWatching(): void | ||
stopWatching(): Promise<void> | ||
getSerializer(): ISerializer | ||
@@ -36,0 +34,0 @@ purgeEnv(): IEnv |
@@ -41,11 +41,7 @@ 'use strict' | ||
try { | ||
const parsingResult = await configManager.parse() | ||
if (!parsingResult) { | ||
const err = new Error('The configuration does not validate against the configuration schema') | ||
err.validationErrors = configManager.validationErrors | ||
throw err | ||
} | ||
} finally { | ||
configManager.stopWatching() | ||
const parsingResult = await configManager.parse() | ||
if (!parsingResult) { | ||
const err = new Error('The configuration does not validate against the configuration schema') | ||
err.validationErrors = configManager.validationErrors | ||
throw err | ||
} | ||
@@ -52,0 +48,0 @@ |
@@ -10,3 +10,2 @@ 'use strict' | ||
const { request } = require('undici') | ||
const { FileWatcher } = require('@platformatic/utils') | ||
const { getParser, analyze, upgrade } = require('@platformatic/metaconfig') | ||
@@ -30,12 +29,2 @@ const { isFileAccessible } = require('./utils') | ||
this._parser = getParser(this.fullPath) | ||
this.fileWatcher = new FileWatcher({ | ||
path: dirname(this.fullPath), | ||
allowToWatch | ||
}) | ||
/* c8 ignore next 3 */ | ||
if (opts.watch) { | ||
this.startWatching() | ||
} | ||
this.dirname = dirname(this.fullPath) | ||
@@ -67,20 +56,2 @@ } else { | ||
async stopWatching () { | ||
await this.fileWatcher.stopWatching() | ||
} | ||
startWatching () { | ||
if (this.fileWatcher.isWatching) return | ||
this.fileWatcher.on('update', async () => { | ||
try { | ||
await this.parseAndValidate() | ||
this.emit('update', this.current) | ||
} catch (err) { | ||
this.emit('error', err) | ||
} | ||
}) | ||
this.fileWatcher.startWatching() | ||
} | ||
purgeEnv (providedEnvironment) { | ||
@@ -101,2 +72,3 @@ const env = { | ||
async replaceEnv (configString) { | ||
/* istanbul ignore next */ | ||
if (this.pupa === null) { | ||
@@ -232,2 +204,3 @@ this.pupa = (await import('pupa')).default | ||
/* istanbul ignore next */ | ||
async parseAndValidate () { | ||
@@ -234,0 +207,0 @@ const validationResult = await this.parse() |
{ | ||
"name": "@platformatic/config", | ||
"version": "0.36.0", | ||
"version": "0.37.0", | ||
"description": "Platformatic DB Config Manager", | ||
@@ -33,4 +33,4 @@ "main": "index.js", | ||
"undici": "^5.22.1", | ||
"@platformatic/metaconfig": "0.36.0", | ||
"@platformatic/utils": "0.36.0" | ||
"@platformatic/metaconfig": "0.37.0", | ||
"@platformatic/utils": "0.37.0" | ||
}, | ||
@@ -37,0 +37,0 @@ "scripts": { |
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
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
21
72766
40
2134
+ Added@platformatic/metaconfig@0.37.0(transitive)
+ Added@platformatic/utils@0.37.0(transitive)
- Removed@platformatic/metaconfig@0.36.0(transitive)
- Removed@platformatic/utils@0.36.0(transitive)
Updated@platformatic/utils@0.37.0