code: async function upgradePackageJson(dirPath) {
    const newJsonPath = path.join(templateProject, 'package.json')
    const oldJsonPath = path.join(dirPath, 'package.json')
  
    // eslint-disable-next-line import/no-dynamic-require
    const newJson = require(newJsonPath)
    // eslint-disable-next-line import/no-dynamic-require
    const oldJson = require(oldJsonPath)
  
    // 只覆盖 scripts、jest、devDependencies 三个字段
    oldJson.scripts = newJson.scripts
    oldJson.jest = newJson.jest
    oldJson.devDependencies = newJson.devDependencies
  
    await _.writeFile(oldJsonPath, JSON.stringify(oldJson, null, '\t'))
  }
docs: 升级 package.json