hunk.code_window: import * as path from "path";
   export async function installMagicExports(
     sourceDir: string,
     dependencies: { [name: string]: string }
   ): Promise<void> {
     let remixDir = path.dirname(require.resolve("remix"));
     let packageJsonFile = path.resolve(remixDir, "package.json");
  
hunk.labels: keep keep keep replace replace keep keep keep
hunk.after_edit:   dependencies: { [name: string]: string },
     filesDir: string
  
hunk.file_path: packages/remix/magic.ts
hunk.type: replace
file: import * as path from "path";
  
  async function run() {
    let packageJson = require("../package.json");
  
    try {
      await require("remix/magic").installMagicExports(
        path.resolve(__dirname, "..", "magicExports"),
        { [packageJson.name]: packageJson.version }
      );
    } catch (error) {
      if (error.code === "MODULE_NOT_FOUND") {
        // ignore missing "remix" package
      } else {
        throw error;
      }
    }
  }
  
  run().then(
    () => {
      process.exit(0);
    },
    error => {
      console.error(error);
      process.exit(1);
    }
  );
  