1
0
mirror of synced 2025-12-21 19:06:49 -05:00
Files
docs/lib/remove-deprecated-frontmatter.js
Sarah Schneider 0b1c7ad466 Update Enterprise Liquid deprecation handling to use new versions (#15818)
* update Liquid deprecation fixtures to use new versions

* update module that removes deprecated GHES frontmatter for new versions

* update module that removes deprecated GHES conditionals for new versions

* update script to use new versions and also remove internal-developer checkout option

* update deprecated Liquid tests to use new versions

* remove unnecessary leading slash in getEnterpriseServerNumber pattern

* include a step that runs script/remove-unused-assets.js

* Update script/remove-deprecated-enterprise-version-markup.js

Co-authored-by: Jason Etcovitch <jasonetco@github.com>

* require script instead of execSync

Co-authored-by: Jason Etcovitch <jasonetco@github.com>
2020-09-30 19:29:08 -04:00

23 lines
1.0 KiB
JavaScript

const { getEnterpriseServerNumber } = require('./patterns')
module.exports = function removeDeprecatedFrontmatter (file, frontmatterVersions, versionToDeprecate, nextOldestVersion) {
// skip files with no versions or Enterprise Server versions frontmatter
if (!frontmatterVersions) return
if (!frontmatterVersions['enterprise-server']) return
const enterpriseRange = frontmatterVersions['enterprise-server']
// skip files with versions frontmatter that applies to all enterprise-server releases
if (enterpriseRange === '*') return
// get the release numbers alone
const releaseToDeprecate = versionToDeprecate.match(getEnterpriseServerNumber)[1]
const nextOldestRelease = nextOldestVersion.match(getEnterpriseServerNumber)[1]
// if the release to deprecate is 2.13, and the FM is either '>=2.13' or '>=2.14',
// we can safely change the FM to enterprise-server: '*'
if (enterpriseRange === `>=${releaseToDeprecate}` || enterpriseRange === `>=${nextOldestRelease}`) {
frontmatterVersions['enterprise-server'] = '*'
}
}