packages/mutate-loader/src/index.js
function loadMutations(enclosingFolder) {
  const here = jetpack.cwd(pathToMutations(enclosingFolder));

  const pkg = here.read(PACKAGE_JSON, "json");
  errorIf(
    !pkg,
    `There doesn't seem to be a package.json file. 
Did you create one at the enclosing folder? 
FYI: installMutations creates one for you if you don't have one. `
  );

  const node_modules_path = here.dir(NODE_MODULES).cwd();

  return new Promise((resolve, reject) => {
    // Load in mutations from dependencies
    const mutations = loadMutationsFromDependencies(
      pkg.dependencies,
      node_modules_path
    );
    resolve(mutations);
  });
}
function loadMutations(enclosingFolder) {
  const here = jetpack.cwd(pathToMutations(enclosingFolder));

  const pkg = here.read(PACKAGE_JSON, "json");
  errorIf(
    !pkg,
    `There doesn't seem to be a package.json file. 
Did you create one at the enclosing folder? 
FYI: installMutations creates one for you if you don't have one. `
  );

  const node_modules_path = here.dir(NODE_MODULES).cwd();

  return new Promise((resolve, reject) => {
    // Load in mutations from dependencies
    const mutations = loadMutationsFromDependencies(
      pkg.dependencies,
      node_modules_path
    );
    resolve(mutations);
  });
}
function loadMutations ( enclosingFolder ) { const here = jetpack . cwd ( pathToMutations ( enclosingFolder ) ) ; const pkg = here . read ( PACKAGE_JSON , "json" ) ; errorIf ( ! pkg , ` ` ) ; const node_modules_path = here . dir ( NODE_MODULES ) . cwd ( ) ; return new Promise ( ( resolve , reject ) => { // Load in mutations from dependencies const mutations = loadMutationsFromDependencies ( pkg . dependencies , node_modules_path ) ; resolve ( mutations ) ; } ) ; }
Loads mutations from a folder inside the `enclosingFolder` called "mutations".
@param {String} enclosingFolder
@return {JSON} a map of the mutation name to the mutation's export.
Loads mutations from a folder inside the enclosingFolder called mutations .