getBaseProjectEnvironment = (
  projectPath: string,
  currentEnvironment: Object = window.process.env
) => {
  const pathKey = isWin ? 'Path' : 'PATH';

  return {
    ...currentEnvironment,
    // NOTE: `FORCE_COLOR` adds control characters to the output.
    // If at some point we need "raw" output with no control characters, we
    // should move this out into a "wrapping" function, and update current
    // callsites to use it.
    FORCE_COLOR: true,
    [pathKey]:
      currentEnvironment[pathKey] +
      path.join(projectPath, 'node_modules', '.bin', path.delimiter),
  };
}
For running tasks in a cross-platform manner, this helper does a few things:
 - Forward the host environment
 - Append the project's .bin directory to PATH to allow package scripts to
   function properly.
 - Add `FORCE_COLOR: true`, so that terminal output includes color codes.