@platformatic/metaconfig
Advanced tools
Comparing version 0.33.1 to 0.34.0
{ | ||
"name": "@platformatic/metaconfig", | ||
"version": "0.33.1", | ||
"version": "0.34.0", | ||
"main": "metaconfig.js", | ||
@@ -16,2 +16,3 @@ "description": "Manage mulitple configuration versions at the same time", | ||
"devDependencies": { | ||
"proxyquire": "^2.1.3", | ||
"snazzy": "^9.0.0", | ||
@@ -18,0 +19,0 @@ "standard": "^17.1.0", |
@@ -7,2 +7,3 @@ 'use strict' | ||
const pkg = require('../package.json') | ||
const proxyquire = require('proxyquire') | ||
@@ -115,1 +116,15 @@ test('specified version is bigger than the current version (minor)', async (t) => { | ||
}) | ||
test('upgrade patch versions', async (t) => { | ||
const FromZeroEighteenToWillSee = proxyquire('../versions/from-zero-eighteen-to-will-see', { | ||
'../package.json': { | ||
version: '0.33.1' | ||
} | ||
}) | ||
const version = '0.33.0' | ||
const meta = new FromZeroEighteenToWillSee({ version, config: { } }) | ||
const upped = meta.up() | ||
t.match(upped, { | ||
version: '0.33.1' | ||
}) | ||
}) |
@@ -13,3 +13,10 @@ 'use strict' | ||
if (semver.satisfies(version, '~' + this.version) || semver.gt(this.version, version)) { | ||
let increment = 'minor' | ||
if (semver.satisfies(version, '~' + this.version)) { | ||
if (!semver.eq(version, this.version)) { | ||
increment = 'patch' | ||
} else { | ||
return | ||
} | ||
} else if (semver.gt(this.version, version)) { | ||
return | ||
@@ -21,3 +28,3 @@ } | ||
const config = rfdc(original) | ||
const version = semver.inc(this.version, 'minor') | ||
const version = semver.inc(this.version, increment) | ||
config.$schema = `https://platformatic.dev/schemas/v${version}/${this.kind}` | ||
@@ -24,0 +31,0 @@ |
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
69430
1923
4