0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-01-20 22:42:53 -05:00

Refactore theme engine resolution module

refs 0f59537b96
refs https://github.com/TryGhost/Team/issues/221

- Makes it one less place to update the default api-engine version in the future
This commit is contained in:
Naz 2021-02-24 19:05:25 +13:00
parent 30fcf8de2e
commit 48d36d1e33

View file

@ -7,15 +7,12 @@ const allowedKeys = ['ghost-api'];
/** /**
* Valid definitions for "ghost-api": * Valid definitions for "ghost-api":
* *
* ^0.1
* ^2 * ^2
* ^0.1.0
* ^2.0.0 * ^2.0.0
* 2.0.0 * 2.0.0
* v4 * v4
* v3 * v3
* v2 * v2
* v0.1
* canary * canary
* *
* Goal: Extract major version from input. * Goal: Extract major version from input.
@ -44,7 +41,7 @@ module.exports = (packageJson) => {
if (availableApiVersions[apiVersionMajor]) { if (availableApiVersions[apiVersionMajor]) {
packageJson.engines['ghost-api'] = availableApiVersions[apiVersionMajor]; packageJson.engines['ghost-api'] = availableApiVersions[apiVersionMajor];
} else { } else {
packageJson.engines['ghost-api'] = 'v4'; packageJson.engines['ghost-api'] = DEFAULTS['ghost-api'];
} }
} }