Skip to content

Commit

Permalink
Merge branch 'main' into sokra/no-isolated-directories
Browse files Browse the repository at this point in the history
  • Loading branch information
sokra committed Mar 6, 2023
2 parents cfcb10d + bbaaccb commit 3568120
Show file tree
Hide file tree
Showing 8 changed files with 20 additions and 6 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -478,6 +478,8 @@ jobs:
cargo check -p next-binding --features __swc_core_binding_napi,__swc_core_binding_napi_plugin,__turbo_next_dev_server,__turbo_node_file_trace,__feature_mdx_rs,__turbo_rustls_tls
# next-swc/wasm
cargo check -p next-binding --features __swc_core_binding_wasm,__swc_core_binding_wasm_plugin,__feature_mdx_rs --target wasm32-unknown-unknown
# This is for next.js integration test
cargo check -p next-dev --no-default-features --features cli,custom_allocator,rustls-tls,__internal_nextjs_integration_test
- name: Run cargo check release
run: |
Expand Down
2 changes: 1 addition & 1 deletion crates/next-core/js/src/entry/router.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ async function getResolveRoute(
);

return await makeResolver(dir, nextConfig, {
files: middlewareChunkGroup,
files: middlewareChunkGroup.filter((f) => /\.[mc]?js$/.test(f)),
matcher: middlewareConfig.matcher,
});
}
Expand Down
1 change: 1 addition & 0 deletions crates/next-core/src/app_source.rs
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,7 @@ fn next_route_transition(
NextEdgeTransition {
edge_compile_time_info,
edge_chunking_context,
edge_module_options_context: None,
edge_resolve_options_context,
output_path,
base_path: app_dir,
Expand Down
3 changes: 2 additions & 1 deletion crates/next-core/src/next_edge/transition.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ use turbopack_ecmascript::{
pub struct NextEdgeTransition {
pub edge_compile_time_info: CompileTimeInfoVc,
pub edge_chunking_context: ChunkingContextVc,
pub edge_module_options_context: Option<ModuleOptionsContextVc>,
pub edge_resolve_options_context: ResolveOptionsContextVc,
pub output_path: FileSystemPathVc,
pub base_path: FileSystemPathVc,
Expand All @@ -46,7 +47,7 @@ impl Transition for NextEdgeTransition {
&self,
context: ModuleOptionsContextVc,
) -> ModuleOptionsContextVc {
context
self.edge_module_options_context.unwrap_or(context)
}

#[turbo_tasks::function]
Expand Down
4 changes: 2 additions & 2 deletions crates/next-core/src/next_font_google/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -448,10 +448,10 @@ async fn get_mock_stylesheet(

let ExecutionContext {
env,
project_root: _,
project_path,
intermediate_output_path,
} = *execution_context.await?;
let context = node_evaluate_asset_context(None, None);
let context = node_evaluate_asset_context(project_path, None, None);
let loader_path = mock_fs.root().join("loader.js");
let mocked_response_asset = EcmascriptModuleAssetVc::new(
VirtualAssetVc::new(
Expand Down
1 change: 1 addition & 0 deletions crates/next-core/src/page_source.rs
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@ pub async fn create_page_source(
let next_edge_transition = NextEdgeTransition {
edge_compile_time_info,
edge_chunking_context,
edge_module_options_context: None,
edge_resolve_options_context,
output_path,
base_path: project_path,
Expand Down
10 changes: 9 additions & 1 deletion crates/next-core/src/router.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ use crate::{
transition::NextEdgeTransition,
},
next_import_map::get_next_build_import_map,
next_server::context::ServerContextType,
next_server::context::{get_server_module_options_context, ServerContextType},
util::{parse_config_from_source, NextSourceConfigVc},
};

Expand Down Expand Up @@ -282,9 +282,17 @@ fn edge_transition_map(
execution_context,
);

let server_module_options_context = get_server_module_options_context(
project_path,
execution_context,
Value::new(ServerContextType::Middleware),
next_config,
);

let next_edge_transition = NextEdgeTransition {
edge_compile_time_info,
edge_chunking_context,
edge_module_options_context: Some(server_module_options_context),
edge_resolve_options_context,
output_path: output_path.root(),
base_path: project_path,
Expand Down
3 changes: 2 additions & 1 deletion crates/turborepo/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use std::{

use anyhow::Result;
use dunce::canonicalize as fs_canonicalize;
use log::{debug, error};
use log::{debug, error, trace};
use turborepo_lib::{Args, Payload};

fn run_go_binary(args: Args) -> Result<i32> {
Expand Down Expand Up @@ -42,6 +42,7 @@ fn run_go_binary(args: Args) -> Result<i32> {
}

let serialized_args = serde_json::to_string(&args)?;
trace!("Invoking go binary with {}", serialized_args);
let mut command = process::Command::new(go_binary_path)
.arg(serialized_args)
.stdout(Stdio::inherit())
Expand Down

0 comments on commit 3568120

Please sign in to comment.