Skip to content

Commit 87fdca7

Browse files
committed
Merge branch 'main' of https://github.com/vercel/turborepo into paul/site-analytics-optional-dependency
2 parents 9c86728 + e4f9b1e commit 87fdca7

File tree

268 files changed

+7265
-5649
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

268 files changed

+7265
-5649
lines changed

.github/turborepo-release.yml .github/release.yml

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ changelog:
55
labels:
66
- "area: ci"
77
- "release: turborepo"
8+
- "release-notes-ignore"
89
categories:
910
- title: Docs
1011
labels:

.github/turbo-orchestrator.yml

+4
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,10 @@ labeler:
3434
- label: "needs: triage"
3535
when:
3636
isNotPRAuthorMatch: "^(padmaia|anthonyshew|dimitropoulos|tknickman|chris-olszewski|NicholasLYang)$"
37+
# Removes the PR from release notes when its chore or ci
38+
- label: "release-notes-ignore"
39+
when:
40+
isPrTitleMatch: "(\bchore\b|\bci\b).*?:"
3741

3842
# areas
3943
- label: "area: ci"

.github/workflows/update-examples-on-release.yml

+1
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ jobs:
3737
- name: Commit and push
3838
run: |
3939
git commit -am "release(turborepo): update examples to latest"
40+
git pull origin main
4041
git push origin ${{ steps.branch.outputs.STAGE_BRANCH }}
4142
4243
- name: Create pull request

CONTRIBUTING.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ Key characteristics of a great example include:
224224
- One technology added to the `basic` example
225225
- An updated README at the root of the example directory. Make sure to include any steps required to run the example
226226
- All tasks in `turbo.json` in the example run successfully without any code changes needed
227-
- Works with every package manager listed in our [Support Policy](https://turbo.build/repo/docs/getting-started/support-policy#package-managers)
227+
- Works with every package manager listed in our [Support Policy](https://turbo.build/docs/getting-started/support-policy#package-managers)
228228

229229
Once you've created your example (with prior approval, as discussed above), you can submit a pull request to the repository.
230230

crates/turborepo-env/src/platform.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ impl PlatformEnv {
6464
let docs_message = color!(
6565
color_config,
6666
UNDERLINE,
67-
"https://turbo.build/repo/docs/platform-environment-variables"
67+
"https://turbo.build/docs/platform-environment-variables"
6868
);
6969

7070
match ci {

crates/turborepo-lib/src/cli/mod.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -653,7 +653,7 @@ pub enum Command {
653653
/// Use the given selector to specify package(s) to act as
654654
/// entry points. The syntax mirrors pnpm's syntax, and
655655
/// additional documentation and examples can be found in
656-
/// turbo's documentation https://turbo.build/repo/docs/reference/command-line-reference/run#--filter
656+
/// turbo's documentation https://turbo.build/docs/reference/command-line-reference/run#--filter
657657
#[clap(short = 'F', long, group = "scope-filter-group")]
658658
filter: Vec<String>,
659659
/// Get insight into a specific package, such as
@@ -895,7 +895,7 @@ pub struct ExecutionArgs {
895895
/// Use the given selector to specify package(s) to act as
896896
/// entry points. The syntax mirrors pnpm's syntax, and
897897
/// additional documentation and examples can be found in
898-
/// turbo's documentation https://turbo.build/repo/docs/reference/command-line-reference/run#--filter
898+
/// turbo's documentation https://turbo.build/docs/reference/command-line-reference/run#--filter
899899
#[clap(short = 'F', long, group = "scope-filter-group")]
900900
pub filter: Vec<String>,
901901

crates/turborepo-lib/src/commands/link.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,7 @@ pub(crate) enum SelectedTeam<'a> {
7575
pub(crate) const REMOTE_CACHING_INFO: &str =
7676
"Remote Caching makes your caching multiplayer,\nsharing build outputs and logs between \
7777
developers and CI/CD systems.\n\nBuild and deploy faster.";
78-
pub(crate) const REMOTE_CACHING_URL: &str =
79-
"https://turbo.build/repo/docs/core-concepts/remote-caching";
78+
pub(crate) const REMOTE_CACHING_URL: &str = "https://turbo.build/docs/core-concepts/remote-caching";
8079

8180
/// Verifies that caching status for a team is enabled, or prompts the user to
8281
/// enable it.

crates/turborepo-lib/src/commands/telemetry.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ fn log_status(config: TelemetryConfig, base: &CommandBase) {
2525
);
2626
}
2727
}
28-
println!("Learn more: https://turbo.build/repo/docs/telemetry");
28+
println!("Learn more: https://turbo.build/docs/telemetry");
2929
}
3030

3131
fn log_error(message: &str, error: &str, base: &CommandBase) {

crates/turborepo-lib/src/config/mod.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,8 @@ pub enum Error {
7474
#[error(transparent)]
7575
PackageJson(#[from] turborepo_repository::package_json::Error),
7676
#[error(
77-
"Could not find turbo.json or turbo.jsonc.\nFollow directions at https://turbo.build/repo/docs to create \
78-
one."
77+
"Could not find turbo.json or turbo.jsonc.\nFollow directions at https://turbo.build/docs \
78+
to create one."
7979
)]
8080
NoTurboJSON,
8181
#[error(

crates/turborepo-lib/src/diagnostics.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ impl Diagnostic for GitDaemonDiagnostic {
221221
if fsmonitor.trim() != "true" || untrackedcache.trim() != "true" {
222222
chan.log_line("Git FS Monitor not configured".to_string())
223223
.await;
224-
chan.log_line( "For more information, see https://turbo.build/repo/docs/reference/command-line-reference/scan#fs-monitor".to_string()).await;
224+
chan.log_line( "For more information, see https://turbo.build/docs/reference/command-line-reference/scan#fs-monitor".to_string()).await;
225225
let Some(resp) = chan
226226
.request(
227227
"Configure it for this repo now?".to_string(),
@@ -372,7 +372,7 @@ impl Diagnostic for LSPDiagnostic {
372372
Ok(None) => {
373373
chan.log_line("Unable to find LSP instance".to_string())
374374
.await;
375-
chan.log_line( "For more information, see https://turbo.build/repo/docs/reference/command-line-reference/scan#lsp".to_string()).await;
375+
chan.log_line( "For more information, see https://turbo.build/docs/reference/command-line-reference/scan#lsp".to_string()).await;
376376
chan.failed("Turborepo Extension is not running".to_string())
377377
.await;
378378
}

crates/turborepo-lib/src/turbo_json/mod.rs

+1
Original file line numberDiff line numberDiff line change
@@ -679,6 +679,7 @@ impl TurboJson {
679679
)))])
680680
}),
681681
persistent: Some(Spanned::new(true)),
682+
env_mode: Some(EnvMode::Loose),
682683
..Default::default()
683684
}),
684685
);

crates/turborepo-telemetry/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ Any changes made here should also be made to that package as well.
77
## Overview
88

99
This crate provides a way to optionally record anonymous usage data.
10-
This information is used to shape the Turborepo roadmap and prioritize features. You can learn more, including how to opt-out if you'd not like to participate in this anonymous program, by visiting the [documentation](https://turbo.build/repo/docs/telemetry):
10+
This information is used to shape the Turborepo roadmap and prioritize features. You can learn more, including how to opt-out if you'd not like to participate in this anonymous program, by visiting the [documentation](https://turbo.build/docs/telemetry):
1111

1212
## Events
1313

crates/turborepo-telemetry/src/config.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ impl TelemetryConfig {
167167
color_config,
168168
GREY,
169169
"{}",
170-
"https://turbo.build/repo/docs/telemetry"
170+
"https://turbo.build/docs/telemetry"
171171
)
172172
),
173173
);

crates/turborepo-telemetry/src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//! Turborepo's telemetry library. Handles sending anonymous telemetry events to
22
//! the Vercel API in the background.
33
//!
4-
//! More detail is available at https://turbo.build/repo/docs/telemetry.
4+
//! More detail is available at https://turbo.build/docs/telemetry.
55
66
#![feature(error_generic_member_access)]
77

crates/turborepo-ui/src/tui/app.rs

+37
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,15 @@ impl<W> App<W> {
201201
Ok(())
202202
}
203203

204+
pub fn scroll_terminal_output_by_page(&mut self, direction: Direction) -> Result<(), Error> {
205+
let pane_rows = self.size.pane_rows();
206+
let task = self.get_full_task_mut()?;
207+
// Scroll by the height of the terminal pane
208+
task.scroll_by(direction, usize::from(pane_rows))?;
209+
210+
Ok(())
211+
}
212+
204213
pub fn enter_search(&mut self) -> Result<(), Error> {
205214
self.section_focus = LayoutSections::Search {
206215
previous_selection: self.active_task()?.to_string(),
@@ -550,6 +559,18 @@ impl<W> App<W> {
550559
term.resize(pane_rows, pane_cols);
551560
})
552561
}
562+
563+
pub fn jump_to_logs_top(&mut self) -> Result<(), Error> {
564+
let task = self.get_full_task_mut()?;
565+
task.parser.screen_mut().set_scrollback(usize::MAX);
566+
Ok(())
567+
}
568+
569+
pub fn jump_to_logs_bottom(&mut self) -> Result<(), Error> {
570+
let task = self.get_full_task_mut()?;
571+
task.parser.screen_mut().set_scrollback(0);
572+
Ok(())
573+
}
553574
}
554575

555576
impl<W: Write> App<W> {
@@ -817,6 +838,22 @@ fn update(
817838
app.is_task_selection_pinned = true;
818839
app.scroll_terminal_output(Direction::Down)?;
819840
}
841+
Event::PageUp => {
842+
app.is_task_selection_pinned = true;
843+
app.scroll_terminal_output_by_page(Direction::Up)?;
844+
}
845+
Event::PageDown => {
846+
app.is_task_selection_pinned = true;
847+
app.scroll_terminal_output_by_page(Direction::Down)?;
848+
}
849+
Event::JumpToLogsTop => {
850+
app.is_task_selection_pinned = true;
851+
app.jump_to_logs_top()?;
852+
}
853+
Event::JumpToLogsBottom => {
854+
app.is_task_selection_pinned = true;
855+
app.jump_to_logs_bottom()?;
856+
}
820857
Event::EnterInteractive => {
821858
app.is_task_selection_pinned = true;
822859
app.interact()?;

crates/turborepo-ui/src/tui/event.rs

+5
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,10 @@ pub enum Event {
2929
Down,
3030
ScrollUp,
3131
ScrollDown,
32+
PageUp,
33+
PageDown,
34+
JumpToLogsTop,
35+
JumpToLogsBottom,
3236
SetStdin {
3337
task: String,
3438
stdin: Box<dyn std::io::Write + Send>,
@@ -64,6 +68,7 @@ pub enum Event {
6468
SearchBackspace,
6569
}
6670

71+
#[derive(Copy, Clone)]
6772
pub enum Direction {
6873
Up,
6974
Down,

crates/turborepo-ui/src/tui/input.rs

+4
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,10 @@ fn translate_key_event(options: InputOptions, key_event: KeyEvent) -> Option<Eve
112112
KeyCode::Char('h') => Some(Event::ToggleSidebar),
113113
KeyCode::Char('u') => Some(Event::ScrollUp),
114114
KeyCode::Char('d') => Some(Event::ScrollDown),
115+
KeyCode::PageUp | KeyCode::Char('U') => Some(Event::PageUp),
116+
KeyCode::PageDown | KeyCode::Char('D') => Some(Event::PageDown),
117+
KeyCode::Char('t') => Some(Event::JumpToLogsTop),
118+
KeyCode::Char('b') => Some(Event::JumpToLogsBottom),
115119
KeyCode::Char('m') => Some(Event::ToggleHelpPopup),
116120
KeyCode::Char('p') => Some(Event::TogglePinnedTask),
117121
KeyCode::Up | KeyCode::Char('k') => Some(Event::Up),

crates/turborepo-ui/src/tui/pane.rs

+9-4
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ const EXIT_INTERACTIVE_HINT: &str = "Ctrl-z - Stop interacting";
1111
const ENTER_INTERACTIVE_HINT: &str = "i - Interact";
1212
const HAS_SELECTION: &str = "c - Copy selection";
1313
const SCROLL_LOGS: &str = "u/d - Scroll logs";
14+
const PAGE_LOGS: &str = "U/D - Page logs";
15+
const JUMP_IN_LOGS: &str = "t/b - Jump to top/buttom";
1416
const TASK_LIST_HIDDEN: &str = "h - Show task list";
1517

1618
pub struct TerminalPane<'a, W> {
@@ -65,9 +67,9 @@ impl<'a, W> TerminalPane<'a, W> {
6567
match self.section {
6668
LayoutSections::Pane => build_message_vec(&[EXIT_INTERACTIVE_HINT]),
6769
LayoutSections::TaskList if self.has_stdin() => {
68-
build_message_vec(&[ENTER_INTERACTIVE_HINT, SCROLL_LOGS])
70+
build_message_vec(&[ENTER_INTERACTIVE_HINT, SCROLL_LOGS, PAGE_LOGS, JUMP_IN_LOGS])
6971
}
70-
LayoutSections::TaskList => build_message_vec(&[SCROLL_LOGS]),
72+
LayoutSections::TaskList => build_message_vec(&[SCROLL_LOGS, PAGE_LOGS, JUMP_IN_LOGS]),
7173
LayoutSections::Search { results, .. } => {
7274
Line::from(format!("/ {}", results.query())).left_aligned()
7375
}
@@ -104,14 +106,17 @@ mod test {
104106
let pane = TerminalPane::new(&term, "foo", &LayoutSections::TaskList, true);
105107
assert_eq!(
106108
String::from(pane.footer()),
107-
" i - Interact u/d - Scroll logs"
109+
" i - Interact u/d - Scroll logs U/D - Page logs t/b - Jump to top/buttom"
108110
);
109111
}
110112

111113
#[test]
112114
fn test_footer_non_interactive() {
113115
let term: TerminalOutput<Vec<u8>> = TerminalOutput::new(16, 16, None);
114116
let pane = TerminalPane::new(&term, "foo", &LayoutSections::TaskList, true);
115-
assert_eq!(String::from(pane.footer()), " u/d - Scroll logs");
117+
assert_eq!(
118+
String::from(pane.footer()),
119+
" u/d - Scroll logs U/D - Page logs t/b - Jump to top/buttom"
120+
);
116121
}
117122
}

crates/turborepo-ui/src/tui/popup.rs

+19-14
Original file line numberDiff line numberDiff line change
@@ -6,20 +6,25 @@ use ratatui::{
66
widgets::{Block, List, ListItem, Padding},
77
};
88

9-
const BIND_LIST: [&str; 12] = [
10-
"m - Toggle this help popup",
11-
"↑ or j - Select previous task",
12-
"↓ or k - Select next task",
13-
"h - Toggle task list",
14-
"p - Toggle pinned task selection",
15-
"/ - Filter tasks to search term",
16-
"ESC - Clear filter",
17-
"i - Interact with task",
18-
"Ctrl+z - Stop interacting with task",
19-
"c - Copy logs selection (Only when logs are selected)",
20-
"u - Scroll logs up",
21-
"d - Scroll logs down",
22-
];
9+
const BIND_LIST: &[&str] = [
10+
"m - Toggle this help popup",
11+
"↑ or j - Select previous task",
12+
"↓ or k - Select next task",
13+
"h - Toggle task list",
14+
"p - Toggle pinned task selection",
15+
"/ - Filter tasks to search term",
16+
"ESC - Clear filter",
17+
"i - Interact with task",
18+
"Ctrl+z - Stop interacting with task",
19+
"c - Copy logs selection (Only when logs are selected)",
20+
"u - Scroll logs up",
21+
"d - Scroll logs down",
22+
"Shift+u - Page logs up",
23+
"Shift+d - Page logs down",
24+
"t - Jump to top of logs",
25+
"b - Jump to bottom of logs",
26+
]
27+
.as_slice();
2328

2429
pub fn popup_area(area: Rect) -> Rect {
2530
let screen_width = area.width;

crates/turborepo-ui/src/tui/term_output.rs

+6-2
Original file line numberDiff line numberDiff line change
@@ -67,10 +67,14 @@ impl<W> TerminalOutput<W> {
6767
}
6868

6969
pub fn scroll(&mut self, direction: Direction) -> Result<(), Error> {
70+
self.scroll_by(direction, 1)
71+
}
72+
73+
pub fn scroll_by(&mut self, direction: Direction, magnitude: usize) -> Result<(), Error> {
7074
let scrollback = self.parser.screen().scrollback();
7175
let new_scrollback = match direction {
72-
Direction::Up => scrollback + 1,
73-
Direction::Down => scrollback.saturating_sub(1),
76+
Direction::Up => scrollback.saturating_add(magnitude),
77+
Direction::Down => scrollback.saturating_sub(magnitude),
7478
};
7579
self.parser.screen_mut().set_scrollback(new_scrollback);
7680
Ok(())

docs/link-checker/src/markdown.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ const markdownProcessor = unified()
8686
});
8787

8888
const filePathToUrl = (filePath: string): string =>
89-
filePath.replace("repo-docs", "/repo/docs").replace(".mdx", "");
89+
filePath.replace("repo-docs", "/docs").replace(".mdx", "");
9090

9191
const validateFrontmatter = (path: string, data: Record<string, unknown>) => {
9292
if (!data.title) {

docs/site/app/(no-sidebar)/blog/[...slug]/page.tsx

+2-5
Original file line numberDiff line numberDiff line change
@@ -48,21 +48,18 @@ export default async function Page(props: {
4848
const Mdx = page.data.body;
4949

5050
return (
51-
<article className="prose mx-auto mt-14 mb-10 w-full min-w-0 max-w-4xl px-6 pt-4 md:px-12">
51+
<article className="prose mx-auto mb-10 w-full min-w-0 max-w-4xl px-6 pt-4 md:px-12">
5252
<FaviconHandler />
5353
<div className="my-4">
5454
<Link
55-
className="hover:text-foreground flex flex-row gap-2 text-sm text-gray-900 transition-all dark:text-gray-900"
55+
className="hover:text-foreground mb-16 flex flex-row gap-2 text-sm text-gray-900 no-underline transition-all dark:text-gray-900"
5656
href="/blog"
5757
>
5858
<ArrowLeftIcon width=".75rem" />
5959
Back to blog
6060
</Link>
6161
</div>
6262

63-
{/* TODO: Currently, the content is controlling the <h1 className="text-center"> to get the heading centered.
64-
/* Needs to be controlled here so we can just write the markdown and it will do the right thing.
65-
* */}
6663
<Mdx components={mdxComponents} />
6764
</article>
6865
);

docs/site/app/(no-sidebar)/blog/page.tsx

+4-4
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,11 @@ export function generateMetadata(): Metadata {
2424
}
2525

2626
function Page(): JSX.Element {
27-
const posts = [...blog.getPages(), ...externalBlog.getPages()]
28-
.filter((post) => post.data.title !== "Turbopack Performance Benchmarks")
29-
.sort((a, b) => {
27+
const posts = [...blog.getPages(), ...externalBlog.getPages()].sort(
28+
(a, b) => {
3029
return Number(new Date(b.data.date)) - Number(new Date(a.data.date));
31-
});
30+
}
31+
);
3232

3333
return (
3434
<main className="mx-auto mt-8 flex w-full min-w-0 max-w-6xl flex-col gap-4 px-6 pt-14 md:px-12">

docs/site/app/(openapi)/repo/source.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { loader } from "fumadocs-core/source";
44
import { openapiDocs, openapiMeta } from "@/.source";
55

66
export const openapiPages = loader({
7-
baseUrl: "/repo/docs/openapi",
7+
baseUrl: "/docs/openapi",
88
source: createMDXSource(openapiDocs, openapiMeta),
99
pageTree: {
1010
attachFile,

docs/site/app/(sidebar)/repo/docs/[[...slug]]/system-environment-variables-hash-highlighter.tsx docs/site/app/(sidebar)/docs/[[...slug]]/system-environment-variables-hash-highlighter.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ export function SystemEnvironmentVariablesHashHighlighter(): JSX.Element {
1010

1111
useEffect(() => {
1212
const hash = window.location.hash.substring(1);
13-
if (path === "/repo/docs/reference/system-environment-variables" && hash) {
13+
if (path === "/docs/reference/system-environment-variables" && hash) {
1414
const element = document.getElementById(hash);
1515
if (!element) return;
1616
element.classList.add("focus");

0 commit comments

Comments
 (0)