Remove versions feature flag code (#15793)
* remove FEATURE_NEW_VERSIONS from feature-flags.json * remove process.env.FEATURE_NEW_VERSIONS from include files * remove process.env.FEATURE_NEW_VERSIONS from lib files * remove process.env.FEATURE_NEW_VERSIONS from middleware files * remove process.env.FEATURE_NEW_VERSIONS from script files * remove process.env.FEATURE_NEW_VERSIONS from test files * update test fixtures to use new versions as canonical fixtures
This commit is contained in:
@@ -5,7 +5,6 @@ const semverRange = {
|
||||
conform: require('semver').validRange,
|
||||
message: 'Must be a valid SemVer range'
|
||||
}
|
||||
const productIds = Object.keys(require('./all-products'))
|
||||
const versionIds = Object.keys(require('./all-versions'))
|
||||
|
||||
const schema = {
|
||||
@@ -68,30 +67,13 @@ const schema = {
|
||||
}
|
||||
}
|
||||
|
||||
if (process.env.FEATURE_NEW_VERSIONS) {
|
||||
schema.properties.versions = {
|
||||
type: ['object', 'string'], // allow a '*' string to indicate all versions
|
||||
required: true,
|
||||
properties: versionIds.reduce((acc, versionId) => {
|
||||
acc[versionId] = semverRange
|
||||
return acc
|
||||
}, {})
|
||||
}
|
||||
}
|
||||
|
||||
if (!process.env.FEATURE_NEW_VERSIONS) {
|
||||
schema.properties.productVersions = {
|
||||
type: 'object',
|
||||
required: true,
|
||||
properties: productIds.reduce((acc, productId) => {
|
||||
// github used to be called dotcom
|
||||
// TODO: rename `dotcom` to `github` in all the markdown files' frontmatter
|
||||
if (productId === 'github') productId = 'dotcom'
|
||||
|
||||
acc[productId] = semverRange
|
||||
return acc
|
||||
}, {})
|
||||
}
|
||||
schema.properties.versions = {
|
||||
type: ['object', 'string'], // allow a '*' string to indicate all versions
|
||||
required: true,
|
||||
properties: versionIds.reduce((acc, versionId) => {
|
||||
acc[versionId] = semverRange
|
||||
return acc
|
||||
}, {})
|
||||
}
|
||||
|
||||
function frontmatter (markdown, opts = {}) {
|
||||
|
||||
Reference in New Issue
Block a user