src/boilerplate/index.js
async function mergePackageJsons () {
    // transform our package.json incase we need to replace variables
    const rawJson = await template.generate({
      directory: `${ignite.ignitePluginPath()}/boilerplate`,
      template: 'package.json.ejs',
      props: props
    })
    const newPackageJson = JSON.parse(rawJson)

    // read in the react-native created package.json
    const currentPackage = filesystem.read('package.json', 'json')

    // deep merge, lol
    const newPackage = pipe(
      assoc(
        'dependencies',
        merge(currentPackage.dependencies, newPackageJson.dependencies)
      ),
      assoc(
        'devDependencies',
        merge(currentPackage.devDependencies, newPackageJson.devDependencies)
      ),
      assoc('scripts', merge(currentPackage.scripts, newPackageJson.scripts)),
      merge(
        __,
        omit(['dependencies', 'devDependencies', 'scripts'], newPackageJson)
      )
    )(currentPackage)

    // write this out
    filesystem.write('package.json', newPackage, { jsonIndent: 2 })
  }
async function mergePackageJsons () {
    // transform our package.json incase we need to replace variables
    const rawJson = await template.generate({
      directory: `${ignite.ignitePluginPath()}/boilerplate`,
      template: 'package.json.ejs',
      props: props
    })
    const newPackageJson = JSON.parse(rawJson)

    // read in the react-native created package.json
    const currentPackage = filesystem.read('package.json', 'json')

    // deep merge, lol
    const newPackage = pipe(
      assoc(
        'dependencies',
        merge(currentPackage.dependencies, newPackageJson.dependencies)
      ),
      assoc(
        'devDependencies',
        merge(currentPackage.devDependencies, newPackageJson.devDependencies)
      ),
      assoc('scripts', merge(currentPackage.scripts, newPackageJson.scripts)),
      merge(
        __,
        omit(['dependencies', 'devDependencies', 'scripts'], newPackageJson)
      )
    )(currentPackage)

    // write this out
    filesystem.write('package.json', newPackage, { jsonIndent: 2 })
  }
async function mergePackageJsons ( ) { // transform our package.json incase we need to replace variables const rawJson = await template . generate ( { directory : ` ${ ignite . ignitePluginPath ( ) } ` , template : 'package.json.ejs' , props : props } ) const newPackageJson = JSON . parse ( rawJson ) // read in the react-native created package.json const currentPackage = filesystem . read ( 'package.json' , 'json' ) // deep merge, lol const newPackage = pipe ( assoc ( 'dependencies' , merge ( currentPackage . dependencies , newPackageJson . dependencies ) ) , assoc ( 'devDependencies' , merge ( currentPackage . devDependencies , newPackageJson . devDependencies ) ) , assoc ( 'scripts' , merge ( currentPackage . scripts , newPackageJson . scripts ) ) , merge ( __ , omit ( [ 'dependencies' , 'devDependencies' , 'scripts' ] , newPackageJson ) ) ) ( currentPackage ) // write this out filesystem . write ( 'package.json' , newPackage , { jsonIndent : 2 } ) }
Merge the package.json from our template into the one provided from react-native init.
Merge the package . json from our template into the one provided from react - native init .