Skip to content

Commit

Permalink
Support installing tip-of-canary next for benchmarks (vercel/turborep…
Browse files Browse the repository at this point in the history
…o#5156)

### Description

A small change to support installing a local
`next@file:path/to/next.js/packages/next` next package. This fixes an
issue where we run tip-of-canary `next-dev` vs the last published `next`
package, and allows us to benchmark breaking changes.

The
[`--install-links`](https://docs.npmjs.com/cli/v8/commands/npm-install#install-links)
option is a little oxymoronic. When set to true, it **doesn't** use
symlinks, so we need to set it to false to avoid copying a bunch of
files.

### Testing Instructions

<!--
  Give a quick description of steps to test your changes.
-->
  • Loading branch information
jridgewell authored May 31, 2023
1 parent 7953d66 commit ae1505d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
7 changes: 6 additions & 1 deletion crates/turbopack-bench/src/util/npm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,12 @@ pub fn install(install_dir: &Path, packages: &[NpmPackage<'_>]) -> Result<()> {
.write_all(format!("{:#}", package_json).as_bytes())?;
}

let mut args = vec!["install".to_owned(), "--force".to_owned()];
let mut args = vec![
"install".to_owned(),
"--force".to_owned(),
"--install-links".to_owned(),
"false".to_owned(),
];
args.append(
&mut packages
.iter()
Expand Down
2 changes: 1 addition & 1 deletion crates/turbopack-node/src/evaluate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ enum EvalJavaScriptOutgoingMessage<'a> {
Evaluate { args: Vec<&'a JsonValue> },
}

#[derive(Deserialize)]
#[derive(Deserialize, Debug)]
#[serde(tag = "type", rename_all = "camelCase")]
enum EvalJavaScriptIncomingMessage {
FileDependency {
Expand Down

0 comments on commit ae1505d

Please sign in to comment.