@sap/cds-dk
Version:
Command line client and development toolkit for the SAP Cloud Application Programming Model
21 lines (16 loc) • 571 B
JavaScript
const { readProject } = require('../../projectReader')
const { merge, sort } = require('../../merge')
module.exports = class TogglesTemplate extends require('../../plugin') {
static help() {
return 'allow dynamically toggled features'
}
static hasInProduction(env) {
return !!env.requires?.toggles
}
async run() {
const project = readProject()
const { isNodejs, configFile } = project
await merge(__dirname, 'files/package.json.hbs').into(configFile, { with: project })
if (isNodejs) await sort('package.json', 'dependencies')
}
}