From 0b3ea0e080b45d28846c855d53f66d1fffc38d33 Mon Sep 17 00:00:00 2001 From: John Vandenberg Date: Thu, 26 Sep 2024 08:49:28 +0800 Subject: [PATCH] docs: Fix typos --- crates/turborepo-auth/src/lib.rs | 2 +- crates/turborepo-filewatch/src/fsevent.rs | 2 +- crates/turborepo-globwalk/src/lib.rs | 6 ++--- crates/turborepo-globwatch/src/lib.rs | 22 +++++++++---------- crates/turborepo-lib/src/child.rs | 2 +- crates/turborepo-lib/src/process/mod.rs | 2 +- .../src/shim/local_turbo_config.rs | 2 +- .../src/shim/local_turbo_state.rs | 2 +- crates/turborepo-lib/src/tracing.rs | 2 +- crates/turborepo-lockfiles/src/berry/ser.rs | 4 ++-- crates/turborepo-lockfiles/src/pnpm/data.rs | 2 +- .../src/package_graph/dep_splitter.rs | 10 ++++----- crates/turborepo-ui/src/tui/spinner.rs | 2 +- crates/turborepo-wax/README.md | 4 ++-- crates/turborepo-wax/src/walk/filter.rs | 2 +- .../using-environment-variables.mdx | 2 +- docs/repo-docs/guides/tools/typescript.mdx | 2 +- packages/turbo-vsc/ARCHITECTURE.md | 4 ++-- scripts/version.js | 2 +- 19 files changed, 38 insertions(+), 38 deletions(-) diff --git a/crates/turborepo-auth/src/lib.rs b/crates/turborepo-auth/src/lib.rs index 9d0000476da5b..81cdb896706f7 100644 --- a/crates/turborepo-auth/src/lib.rs +++ b/crates/turborepo-auth/src/lib.rs @@ -84,7 +84,7 @@ impl Token { /// * `valid_message_fn` - An optional callback that gets called if the /// token is valid. It will be passed the user's email. // TODO(voz): This should do a `get_user` or `get_teams` instead of the caller - // doing it. The reason we don't do it here is becuase the caller + // doing it. The reason we don't do it here is because the caller // needs to do printing and requires the user struct, which we don't want to // return here. pub async fn is_valid( diff --git a/crates/turborepo-filewatch/src/fsevent.rs b/crates/turborepo-filewatch/src/fsevent.rs index 477fb44c7e44c..55cfb245092ba 100644 --- a/crates/turborepo-filewatch/src/fsevent.rs +++ b/crates/turborepo-filewatch/src/fsevent.rs @@ -428,7 +428,7 @@ impl FsEventWatcher { // We need to associate the stream context with our callback in order to // propagate events to the rest of the system. This will be owned by the // stream, and will be freed when the stream is closed. This means we - // will leak the context if we panic before reacing + // will leak the context if we panic before reaching // `FSEventStreamRelease`. let stream_context_info = Box::into_raw(Box::new(StreamContextInfo { event_handler: self.event_handler.clone(), diff --git a/crates/turborepo-globwalk/src/lib.rs b/crates/turborepo-globwalk/src/lib.rs index d43648a6f9091..f986b9059664c 100644 --- a/crates/turborepo-globwalk/src/lib.rs +++ b/crates/turborepo-globwalk/src/lib.rs @@ -407,7 +407,7 @@ fn visit_file( Err(e) => { let io_err = std::io::Error::from(e); match io_err.kind() { - // Ignore DNE and permission errors + // Ignore missing file and permission errors std::io::ErrorKind::NotFound | std::io::ErrorKind::PermissionDenied => None, _ => Some(Err(io_err.into())), } @@ -463,10 +463,10 @@ mod test { #[test_case("/a/b/.", "/a/b", 2 ; "test path with leading / and ending with dot segment")] #[test_case("/a/.././b", "/b", 0 ; "test path with leading / and mixed and consecutive dot and dotdot segments")] #[test_case("/a/b/c/../../d/e/f/g/h/i/../j", "/a/d/e/f/g/h/j", 1 ; "leading collapse followed by shorter one")] - fn test_collapse_path(glob: &str, expected: &str, earliest_collapsed_segement: usize) { + fn test_collapse_path(glob: &str, expected: &str, earliest_collapsed_segment: usize) { let (glob, segment) = collapse_path(glob).unwrap(); assert_eq!(glob, expected); - assert_eq!(segment, earliest_collapsed_segement); + assert_eq!(segment, earliest_collapsed_segment); } #[test_case("../a/b" ; "test path starting with ../ segment should return None")] diff --git a/crates/turborepo-globwatch/src/lib.rs b/crates/turborepo-globwatch/src/lib.rs index e4151c5fde34e..3048a8c2bdce6 100644 --- a/crates/turborepo-globwatch/src/lib.rs +++ b/crates/turborepo-globwatch/src/lib.rs @@ -211,7 +211,7 @@ impl GlobWatcher { Either::Left(mut e) => { // if we receive an event for a file in the flush dir, we need to // remove it from the events list, and send a signal to the flush - // requestor. flushes should not be considered as events. + // requester. flushes should not be considered as events. for flush_id in e .paths .extract_if(|p| p.starts_with(flush_dir.as_path())) @@ -228,7 +228,7 @@ impl GlobWatcher { .expect("only fails if holder panics") .remove(&flush_id) { - // if this fails, it just means the requestor has gone away + // if this fails, it just means the requester has gone away // and we can ignore it tx.send(()).ok(); } @@ -363,7 +363,7 @@ impl WatchConfig { // we watch the parent directory instead. // More information at https://github.com/notify-rs/notify/issues/403 #[cfg(windows)] - let watched_path = path.parent().expect("turbo is unusable at filesytem root"); + let watched_path = path.parent().expect("turbo is unusable at filesystem root"); #[cfg(not(windows))] let watched_path = path; @@ -424,7 +424,7 @@ enum GlobSymbol<'a> { DoubleStar, Question, Negation, - PathSeperator, + PathSeparator, } /// Gets the minimum set of paths that can be watched for a given glob, @@ -456,8 +456,8 @@ enum GlobSymbol<'a> { /// note: it is currently extremely conservative, handling only `**`, braces, /// and `?`. any other case watches the entire directory. fn glob_to_paths(glob: &str) -> Vec { - // get all the symbols and chunk them by path seperator - let chunks = glob_to_symbols(glob).group_by(|s| s != &GlobSymbol::PathSeperator); + // get all the symbols and chunk them by path separator + let chunks = glob_to_symbols(glob).group_by(|s| s != &GlobSymbol::PathSeparator); let chunks = chunks .into_iter() .filter_map(|(not_sep, chunk)| (not_sep).then_some(chunk)); @@ -508,7 +508,7 @@ fn symbols_to_combinations<'a, T: Iterator>>( GlobSymbol::DoubleStar => return None, GlobSymbol::Question => return None, GlobSymbol::Negation => return None, - GlobSymbol::PathSeperator => return None, + GlobSymbol::PathSeparator => return None, } } @@ -570,7 +570,7 @@ fn glob_to_symbols(glob: &str) -> impl Iterator { } b'?' => Some(GlobSymbol::Question), b'!' => Some(GlobSymbol::Negation), - b'/' => Some(GlobSymbol::PathSeperator), + b'/' => Some(GlobSymbol::PathSeparator), _ => Some(GlobSymbol::Char(&glob_bytes[start..end])), } } else { @@ -611,9 +611,9 @@ mod test { ); } - #[test_case("🇳🇴/🇳🇴", vec![Char("🇳🇴".as_bytes()), PathSeperator, Char("🇳🇴".as_bytes())])] - #[test_case("foo/**", vec![Char(b"f"), Char(b"o"), Char(b"o"), PathSeperator, DoubleStar])] - #[test_case("foo/{a,b}", vec![Char(b"f"), Char(b"o"), Char(b"o"), PathSeperator, OpenBrace, Char(b"a"), Char(b","), Char(b"b"), CloseBrace])] + #[test_case("🇳🇴/🇳🇴", vec![Char("🇳🇴".as_bytes()), PathSeparator, Char("🇳🇴".as_bytes())])] + #[test_case("foo/**", vec![Char(b"f"), Char(b"o"), Char(b"o"), PathSeparator, DoubleStar])] + #[test_case("foo/{a,b}", vec![Char(b"f"), Char(b"o"), Char(b"o"), PathSeparator, OpenBrace, Char(b"a"), Char(b","), Char(b"b"), CloseBrace])] #[test_case("\\f", vec![Char(b"f")])] #[test_case("\\\\f", vec![Char(b"\\"), Char(b"f")])] #[test_case("\\🇳🇴", vec![Char("🇳🇴".as_bytes())])] diff --git a/crates/turborepo-lib/src/child.rs b/crates/turborepo-lib/src/child.rs index db783afc78c17..6eb6ece576484 100644 --- a/crates/turborepo-lib/src/child.rs +++ b/crates/turborepo-lib/src/child.rs @@ -9,7 +9,7 @@ pub fn spawn_child(mut command: Command) -> Result, io::Error> ctrlc::set_handler(move || { // on windows, we can't send signals so just kill - // we are quiting anyways so just ignore + // we are quitting anyways so just ignore #[cfg(target_os = "windows")] handler_shared_child.kill().ok(); diff --git a/crates/turborepo-lib/src/process/mod.rs b/crates/turborepo-lib/src/process/mod.rs index 32cfcc39dd7ac..5e1751a2be007 100644 --- a/crates/turborepo-lib/src/process/mod.rs +++ b/crates/turborepo-lib/src/process/mod.rs @@ -371,7 +371,7 @@ mod test { match strategy { "stop" => manager.stop().await, "wait" => manager.wait().await, - _ => panic!("unknown strat"), + _ => panic!("unknown strategy"), } // tasks return proper exit code diff --git a/crates/turborepo-lib/src/shim/local_turbo_config.rs b/crates/turborepo-lib/src/shim/local_turbo_config.rs index 735559d2a19ac..04764b2f3b5ef 100644 --- a/crates/turborepo-lib/src/shim/local_turbo_config.rs +++ b/crates/turborepo-lib/src/shim/local_turbo_config.rs @@ -51,7 +51,7 @@ impl LocalTurboConfig { } // If there isn't a package manager, just try to parse all known lockfiles - // This isn't the most effecient, but since we'll be hitting network to download + // This isn't the most efficient, but since we'll be hitting network to download // the correct binary the unnecessary file reads aren't costly relative to the // download. PackageManager::supported_managers().iter().find_map(|pm| { diff --git a/crates/turborepo-lib/src/shim/local_turbo_state.rs b/crates/turborepo-lib/src/shim/local_turbo_state.rs index 945b8e879ad54..760986fb212bf 100644 --- a/crates/turborepo-lib/src/shim/local_turbo_state.rs +++ b/crates/turborepo-lib/src/shim/local_turbo_state.rs @@ -193,7 +193,7 @@ pub fn turbo_version_has_shim(version: &str) -> bool { version.major > 1 } else { // In the case that we don't get passed a valid semver we should avoid a panic. - // We shouldn't hit this we introduce back infering package version from schema + // We shouldn't hit this we introduce back inferring package version from schema // or package.json. true } diff --git a/crates/turborepo-lib/src/tracing.rs b/crates/turborepo-lib/src/tracing.rs index 28b54768e1f91..a20ef9cfc7f78 100644 --- a/crates/turborepo-lib/src/tracing.rs +++ b/crates/turborepo-lib/src/tracing.rs @@ -93,7 +93,7 @@ impl TurboSubscriber { /// - If the `TURBO_LOG_VERBOSITY` env var is set, it will be used to set /// the verbosity level. Otherwise, the default is `WARN`. See the /// documentation on the RUST_LOG env var for syntax. - /// - If the verbosity argument (usually detemined by a flag) is provided, + /// - If the verbosity argument (usually determined by a flag) is provided, /// it overrides the default global log level. This means it overrides the /// `TURBO_LOG_VERBOSITY` global setting, but not per-module settings. /// diff --git a/crates/turborepo-lockfiles/src/berry/ser.rs b/crates/turborepo-lockfiles/src/berry/ser.rs index 20a15c6ecb545..e76c208c07321 100644 --- a/crates/turborepo-lockfiles/src/berry/ser.rs +++ b/crates/turborepo-lockfiles/src/berry/ser.rs @@ -237,7 +237,7 @@ mod test { .cloned() .collect(), }; - let serailized = lockfile.to_string(); - assert!(serailized.contains(&format!("? {long_key}\n"))); + let serialized = lockfile.to_string(); + assert!(serialized.contains(&format!("? {long_key}\n"))); } } diff --git a/crates/turborepo-lockfiles/src/pnpm/data.rs b/crates/turborepo-lockfiles/src/pnpm/data.rs index dd83afb632711..7ce68449251b0 100644 --- a/crates/turborepo-lockfiles/src/pnpm/data.rs +++ b/crates/turborepo-lockfiles/src/pnpm/data.rs @@ -102,7 +102,7 @@ pub struct PackageSnapshot { version: Option, // In lockfile v7, this portion of package is stored in the top level - // `shapshots` map as opposed to being stored inline. + // `snapshots` map as opposed to being stored inline. #[serde(flatten)] snapshot: PackageSnapshotV7, diff --git a/crates/turborepo-repository/src/package_graph/dep_splitter.rs b/crates/turborepo-repository/src/package_graph/dep_splitter.rs index bd8ff52311a0c..453b4f4d56bfa 100644 --- a/crates/turborepo-repository/src/package_graph/dep_splitter.rs +++ b/crates/turborepo-repository/src/package_graph/dep_splitter.rs @@ -34,7 +34,7 @@ impl<'a> DependencySplitter<'a> { } pub fn is_internal(&self, name: &str, version: &str) -> Option { - // If link_workspace_packages isn't set any version wihtout workspace protocol + // If link_workspace_packages isn't set any version without workspace protocol // is considered external. if !self.link_workspace_packages && !version.starts_with("workspace:") { return None; @@ -174,7 +174,7 @@ impl<'a> DependencyVersion<'a> { _ if self.version == "*" => true, _ => { // If we got this far, then we need to check the workspace package version to - // see it satisfies the dependencies range to determin whether + // see it satisfies the dependencies range to determine whether // or not it's an internal or external dependency. let constraint = node_semver::Range::parse(self.version); let version = node_semver::Version::parse(package_version); @@ -222,9 +222,9 @@ mod test { #[test_case("1.2.3", None, "npm:^1.2.3", Some("@scope/foo"), true ; "handles npm protocol with satisfied semver range")] #[test_case("2.3.4", None, "npm:^1.2.3", None, true ; "handles npm protocol with not satisfied semver range")] #[test_case("1.2.3", None, "1.2.2-alpha-123abcd.0", None, true ; "handles pre-release versions")] - // for backwards compatability with the code before versions were verified + // for backwards compatibility with the code before versions were verified #[test_case("sometag", None, "1.2.3", Some("@scope/foo"), true ; "handles non-semver package version")] - // for backwards compatability with the code before versions were verified + // for backwards compatibility with the code before versions were verified #[test_case("1.2.3", None, "sometag", Some("@scope/foo"), true ; "handles non-semver dependency version")] #[test_case("1.2.3", None, "file:../libB", Some("@scope/foo"), true ; "handles file:.. inside repo")] #[test_case("1.2.3", None, "file:../../../otherproject", None, true ; "handles file:.. outside repo")] @@ -232,7 +232,7 @@ mod test { #[test_case("1.2.3", None, "link:../../../otherproject", None, true ; "handles link:.. outside repo")] #[test_case("0.0.0-development", None, "*", Some("@scope/foo"), true ; "handles development versions")] #[test_case("1.2.3", Some("foo"), "workspace:@scope/foo@*", Some("@scope/foo"), true ; "handles pnpm alias star")] - #[test_case("1.2.3", Some("foo"), "workspace:@scope/foo@~", Some("@scope/foo"), true ; "handles pnpm alias tilda")] + #[test_case("1.2.3", Some("foo"), "workspace:@scope/foo@~", Some("@scope/foo"), true ; "handles pnpm alias tilde")] #[test_case("1.2.3", Some("foo"), "workspace:@scope/foo@^", Some("@scope/foo"), true ; "handles pnpm alias caret")] #[test_case("1.2.3", None, "1.2.3", None, false ; "no workspace linking")] #[test_case("1.2.3", None, "workspace:1.2.3", Some("@scope/foo"), false ; "no workspace linking with protocol")] diff --git a/crates/turborepo-ui/src/tui/spinner.rs b/crates/turborepo-ui/src/tui/spinner.rs index 60397483d1401..c7549414c075d 100644 --- a/crates/turborepo-ui/src/tui/spinner.rs +++ b/crates/turborepo-ui/src/tui/spinner.rs @@ -47,7 +47,7 @@ impl Default for SpinnerState { // use super::*; // // #[test] -// fn test_inital_update() { +// fn test_initial_update() { // let mut spinner = SpinnerState::new(); // assert!(spinner.last_render.is_none()); // assert_eq!(spinner.frame, 0); diff --git a/crates/turborepo-wax/README.md b/crates/turborepo-wax/README.md index 898e686792035..9881b261c8787 100644 --- a/crates/turborepo-wax/README.md +++ b/crates/turborepo-wax/README.md @@ -148,7 +148,7 @@ within a component (**never path separators**). Zero-or-more wildcards cannot be adjacent to other zero-or-more wildcards. The `*` wildcard is eager and will match the longest possible text while the `$` wildcard is lazy and will match the shortest possible text. When followed by a literal, `*` stops at the last -occurrence of that literal while `$` stops at the first occurence. +occurrence of that literal while `$` stops at the first occurrence. The exactly-one wildcard `?` matches any single character within a component (**never path separators**). Exactly-one wildcards do not group automatically, @@ -449,7 +449,7 @@ Globs are strictly nominal and do not support any non-nominal constraints. It is not possible to directly filter or otherwise select paths or files based on additional metadata (such as a modification timestamp) in a glob expression. However, it is possible for user code to query any such metadata for a matching -path or effeciently apply such filtering when matching directory trees using +path or efficiently apply such filtering when matching directory trees using `FileIterator::filter_tree`. For such additional features, including metadata filters and transformations diff --git a/crates/turborepo-wax/src/walk/filter.rs b/crates/turborepo-wax/src/walk/filter.rs index 0998116737f0a..32544a4ac49b2 100644 --- a/crates/turborepo-wax/src/walk/filter.rs +++ b/crates/turborepo-wax/src/walk/filter.rs @@ -415,7 +415,7 @@ where /// /// **This trait provides the only API for implementing a /// [`SeparatingFilter`].** [`Iterator`]s can implement this trait for a -/// transitive [`SeparatingFilter`] implemention that provides all items +/// transitive [`SeparatingFilter`] implementation that provides all items /// as filtrate. This bridges [`Iterator`]s into the input of a separating /// filter. See the [`filtrate`] function for the output analog. /// diff --git a/docs/repo-docs/crafting-your-repository/using-environment-variables.mdx b/docs/repo-docs/crafting-your-repository/using-environment-variables.mdx index a3f8c6f82fbce..fec308e2430bd 100644 --- a/docs/repo-docs/crafting-your-repository/using-environment-variables.mdx +++ b/docs/repo-docs/crafting-your-repository/using-environment-variables.mdx @@ -107,7 +107,7 @@ This means that tasks that do not account for all of the environment variables t While Strict Mode makes it much more likely for your task to fail when you haven't accounted for all of your environment variables, it doesn't guarantee - task failure. If your applicaton is able to gracefully handle a missing + task failure. If your application is able to gracefully handle a missing environment variable, you could still successfully complete tasks and get unintended cache hits. diff --git a/docs/repo-docs/guides/tools/typescript.mdx b/docs/repo-docs/guides/tools/typescript.mdx index 5ee6d8206b134..c9e7918ac13dc 100644 --- a/docs/repo-docs/guides/tools/typescript.mdx +++ b/docs/repo-docs/guides/tools/typescript.mdx @@ -254,7 +254,7 @@ export const Button = () => { #### Compiled packages -In [Compiled packages](https://turbo.build/repo/docs/core-concepts/internal-packages#compiled-packages), `imports` target the built ouptuts for the package. +In [Compiled packages](https://turbo.build/repo/docs/core-concepts/internal-packages#compiled-packages), `imports` target the built outputs for the package. diff --git a/packages/turbo-vsc/ARCHITECTURE.md b/packages/turbo-vsc/ARCHITECTURE.md index df9c4ec183d54..428f23e7ae064 100644 --- a/packages/turbo-vsc/ARCHITECTURE.md +++ b/packages/turbo-vsc/ARCHITECTURE.md @@ -7,13 +7,13 @@ which APIs it uses to achieve its feature set, and how it is structured. You're here! The client is the side that runs in VSCode. It is essentially an entry point into the LSP but there are a few other things it manages -mostly for convience sake. +mostly for convenience sake. - basic syntax highlighting for the pipeline gradient - discovery and installation of global / local turbo - toolbar item to enable / disable the daemon - some editor commands - - start deamon + - start daemon - stop daemon - restart daemon - run turbo command diff --git a/scripts/version.js b/scripts/version.js index e8674e50416c5..5a31b89156a9b 100755 --- a/scripts/version.js +++ b/scripts/version.js @@ -17,7 +17,7 @@ const [currentVersion] = versionFileContents.split("\n"); const identifier = increment.startsWith("pre") ? "canary" : "latest"; const newVersion = semver.inc(currentVersion, increment, identifier); -// Parse the output semver identifer to identify which npm tag to publish to. +// Parse the output semver identifier to identify which npm tag to publish to. const parsed = semver.parse(newVersion); const tag = parsed?.prerelease[0] || "latest";