@platformatic/config
Advanced tools
Comparing version 0.41.1 to 0.41.2
@@ -14,2 +14,3 @@ 'use strict' | ||
#require | ||
#currentVersion | ||
@@ -23,2 +24,4 @@ constructor (opts) { | ||
this.#require = createRequire(join(this.#cwd, 'noop.js')) | ||
this.#currentVersion = null | ||
} | ||
@@ -50,2 +53,3 @@ | ||
this.#currentVersion = this.getVersionFromSchema(app.schema.$id) | ||
this.#map.set(app.schema.$id, app) | ||
@@ -75,3 +79,5 @@ } | ||
if (app === undefined) { | ||
throw new Error(`no application found for ${$schema}`) | ||
const attemptedToRunVersion = this.getVersionFromSchema($schema) | ||
throw new Error(`Version mismatch. You are running Platformatic ${this.#currentVersion} but your app requires ${attemptedToRunVersion}`) | ||
} | ||
@@ -82,2 +88,10 @@ | ||
getVersionFromSchema (schema) { | ||
const match = schema.match(/\/schemas\/(.*)\//) | ||
if (match) { | ||
return match[1] | ||
} | ||
return null | ||
} | ||
listTypes () { | ||
@@ -84,0 +98,0 @@ const knownTypes = Array.from(this.#map.entries()).map(([id, app]) => { |
{ | ||
"name": "@platformatic/config", | ||
"version": "0.41.1", | ||
"version": "0.41.2", | ||
"description": "Platformatic DB Config Manager", | ||
@@ -33,4 +33,4 @@ "main": "index.js", | ||
"undici": "^5.22.1", | ||
"@platformatic/metaconfig": "0.41.1", | ||
"@platformatic/utils": "0.41.1" | ||
"@platformatic/metaconfig": "0.41.2", | ||
"@platformatic/utils": "0.41.2" | ||
}, | ||
@@ -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
72718
2132
+ Added@platformatic/metaconfig@0.41.2(transitive)
+ Added@platformatic/utils@0.41.2(transitive)
- Removed@platformatic/metaconfig@0.41.1(transitive)
- Removed@platformatic/utils@0.41.1(transitive)
Updated@platformatic/utils@0.41.2