Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f84e9ea
commit c2855f2
Showing
11 changed files
with
144 additions
and
6 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
[package] | ||
name = "next-build" | ||
version = "0.1.0" | ||
description = "TBD" | ||
license = "MPL-2.0" | ||
edition = "2021" | ||
autobenches = false | ||
|
||
[features] | ||
next-font-local = ["next-core/next-font-local"] | ||
native-tls = ["next-core/native-tls"] | ||
rustls-tls = ["next-core/rustls-tls"] | ||
custom_allocator = ["turbo-malloc/custom_allocator"] | ||
|
||
[dependencies] | ||
anyhow = "1.0.47" | ||
clap = { version = "4.0.18", features = ["derive", "env"], optional = true } | ||
mime = "0.3.16" | ||
next-core = { workspace = true } | ||
owo-colors = "3" | ||
serde = "1.0.136" | ||
tokio = { version = "1.21.2", features = ["full"] } | ||
turbo-malloc = { workspace = true, default-features = false } | ||
turbo-tasks = { workspace = true } | ||
turbo-tasks-fs = { workspace = true } | ||
turbo-tasks-memory = { workspace = true } | ||
turbopack-cli-utils = { workspace = true } | ||
turbopack-core = { workspace = true } | ||
turbopack-dev-server = { workspace = true } | ||
turbopack-node = { workspace = true } | ||
|
||
[build-dependencies] | ||
turbo-tasks-build = { workspace = true } | ||
vergen = { version = "7.3.2", default-features = false, features = [ | ||
"cargo", | ||
"build", | ||
] } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
use turbo_tasks_build::{generate_register, rerun_if_glob}; | ||
|
||
use vergen::{vergen, Config}; | ||
|
||
fn main() { | ||
generate_register(); | ||
|
||
rerun_if_glob("tests/integration/*/*", "tests/integration"); | ||
|
||
// Attempt to collect some build time env values but will skip if there are any | ||
// errors. | ||
let _ = vergen(Config::default()); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
#![feature(future_join)] | ||
#![feature(min_specialization)] | ||
|
||
use turbo_tasks::{NothingVc, StatsType, TurboTasks, TurboTasksBackendApi}; | ||
use turbo_tasks_memory::MemoryBackend; | ||
|
||
#[derive(Clone)] | ||
pub enum EntryRequest { | ||
Relative(String), | ||
Module(String, String), | ||
} | ||
|
||
pub fn register() { | ||
next_core::register(); | ||
include!(concat!(env!("OUT_DIR"), "/register.rs")); | ||
} | ||
|
||
pub struct NextBuildOptions { | ||
pub dir: Option<String>, | ||
pub app_dir: Option<String>, | ||
pub memory_limit: Option<usize>, | ||
pub full_stats: Option<bool>, | ||
} | ||
|
||
pub async fn next_build(options: NextBuildOptions) -> anyhow::Result<()> { | ||
register(); | ||
let tt = TurboTasks::new(MemoryBackend::new( | ||
options.memory_limit.map_or(usize::MAX, |l| l * 1024 * 1024), | ||
)); | ||
let stats_type = match options.full_stats { | ||
Some(true) => StatsType::Full, | ||
_ => StatsType::Essential, | ||
}; | ||
tt.set_stats_type(stats_type); | ||
let task = tt.spawn_root_task(move || { | ||
Box::pin(async move { | ||
// run next build here | ||
Ok(NothingVc::new().into()) | ||
}) | ||
}); | ||
tt.wait_task_completion(task, true).await?; | ||
Ok(()) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters