@vercel/remix-builder 2.0.12 → 2.0.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/index.js +35 -11
  2. package/package.json +3 -3
package/dist/index.js CHANGED
@@ -3170,13 +3170,14 @@ var build = async ({
3170
3170
  config,
3171
3171
  meta
3172
3172
  );
3173
- const { cliType, packageJsonPath, lockfileVersion } = await (0, import_build_utils3.scanParentDirs)(
3174
- entrypointFsDirname
3175
- );
3173
+ const { cliType, packageJsonPath, lockfileVersion, lockfilePath } = await (0, import_build_utils3.scanParentDirs)(entrypointFsDirname);
3176
3174
  if (!packageJsonPath) {
3177
3175
  throw new Error("Failed to locate `package.json` file in your project");
3178
3176
  }
3179
- const pkgRaw = await import_fs2.promises.readFile(packageJsonPath, "utf8");
3177
+ const [lockfileRaw, pkgRaw] = await Promise.all([
3178
+ lockfilePath ? import_fs2.promises.readFile(lockfilePath) : null,
3179
+ import_fs2.promises.readFile(packageJsonPath, "utf8")
3180
+ ]);
3180
3181
  const pkg = JSON.parse(pkgRaw);
3181
3182
  const spawnOpts = (0, import_build_utils3.getSpawnOptions)(meta, nodeVersion);
3182
3183
  if (!spawnOpts.env) {
@@ -3418,17 +3419,23 @@ module.exports = config;`;
3418
3419
  const cleanupOps = [];
3419
3420
  if (remixConfigWrapped && remixConfigPath && renamedRemixConfigPath) {
3420
3421
  cleanupOps.push(
3421
- import_fs2.promises.rename(renamedRemixConfigPath, remixConfigPath).then(
3422
- () => (0, import_build_utils3.debug)(`Restored original "${(0, import_path3.basename)(remixConfigPath)}" file`)
3423
- )
3422
+ import_fs2.promises.rename(renamedRemixConfigPath, remixConfigPath).then(() => (0, import_build_utils3.debug)(`Restored original "${remixConfigPath}" file`))
3424
3423
  );
3425
3424
  }
3426
3425
  if (serverEntryPointAbs && originalServerEntryPoint) {
3427
3426
  cleanupOps.push(
3428
- import_fs2.promises.writeFile(serverEntryPointAbs, originalServerEntryPoint).then(
3429
- () => (0, import_build_utils3.debug)(`Restored original "${(0, import_path3.basename)(serverEntryPointAbs)}" file`)
3430
- )
3427
+ import_fs2.promises.writeFile(serverEntryPointAbs, originalServerEntryPoint).then(() => (0, import_build_utils3.debug)(`Restored original "${serverEntryPointAbs}" file`))
3428
+ );
3429
+ }
3430
+ if (depsModified) {
3431
+ cleanupOps.push(
3432
+ import_fs2.promises.writeFile(packageJsonPath, pkgRaw).then(() => (0, import_build_utils3.debug)(`Restored original "${packageJsonPath}" file`))
3431
3433
  );
3434
+ if (lockfilePath && lockfileRaw) {
3435
+ cleanupOps.push(
3436
+ import_fs2.promises.writeFile(lockfilePath, lockfileRaw).then(() => (0, import_build_utils3.debug)(`Restored original "${lockfilePath}" file`))
3437
+ );
3438
+ }
3432
3439
  }
3433
3440
  await Promise.all(cleanupOps);
3434
3441
  }
@@ -3696,11 +3703,28 @@ var import_path4 = require("path");
3696
3703
  var prepareCache = async ({
3697
3704
  entrypoint,
3698
3705
  repoRootPath,
3699
- workPath
3706
+ workPath,
3707
+ config
3700
3708
  }) => {
3701
3709
  const root = repoRootPath || workPath;
3702
3710
  const mountpoint = (0, import_path4.dirname)(entrypoint);
3703
3711
  const entrypointFsDirname = (0, import_path4.join)(workPath, mountpoint);
3712
+ const nodeVersion = await (0, import_build_utils4.getNodeVersion)(
3713
+ entrypointFsDirname,
3714
+ void 0,
3715
+ config
3716
+ );
3717
+ const spawnOpts = (0, import_build_utils4.getSpawnOptions)({}, nodeVersion);
3718
+ await (0, import_build_utils4.runNpmInstall)(
3719
+ entrypointFsDirname,
3720
+ [],
3721
+ {
3722
+ ...spawnOpts,
3723
+ stdio: "ignore"
3724
+ },
3725
+ void 0,
3726
+ nodeVersion
3727
+ );
3704
3728
  const packageJsonPath = (0, import_path4.join)(entrypointFsDirname, "package.json");
3705
3729
  const remixRunDevPath = (0, import_path4.dirname)(
3706
3730
  require_.resolve("@remix-run/dev/package.json", {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vercel/remix-builder",
3
- "version": "2.0.12",
3
+ "version": "2.0.14",
4
4
  "license": "Apache-2.0",
5
5
  "main": "./dist/index.js",
6
6
  "homepage": "https://vercel.com/docs",
@@ -19,11 +19,11 @@
19
19
  "ts-morph": "12.0.0"
20
20
  },
21
21
  "devDependencies": {
22
- "@remix-run/dev": "npm:@vercel/remix-run-dev@2.2.0",
22
+ "@remix-run/dev": "npm:@vercel/remix-run-dev@2.3.1",
23
23
  "@types/jest": "27.5.1",
24
24
  "@types/node": "14.18.33",
25
25
  "@types/semver": "7.3.13",
26
- "@vercel/build-utils": "7.2.5",
26
+ "@vercel/build-utils": "7.3.0",
27
27
  "jest-junit": "16.0.0",
28
28
  "path-to-regexp": "6.2.1",
29
29
  "semver": "7.5.2"