From 27dc7954592cb5662b71c5f4c8314dce577d4972 Mon Sep 17 00:00:00 2001 From: Josh Soref Date: Sun, 26 Dec 2021 19:33:08 -0500 Subject: [PATCH 01/16] spelling: accordingly Signed-off-by: Josh Soref --- cli/internal/core/scheduler.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cli/internal/core/scheduler.go b/cli/internal/core/scheduler.go index 797e94809f6fa..a1f14bb55d063 100644 --- a/cli/internal/core/scheduler.go +++ b/cli/internal/core/scheduler.go @@ -2,8 +2,8 @@ package core import ( "fmt" - "strings" "github.com/vercel/turborepo/cli/internal/util" + "strings" "github.com/pyr-sh/dag" ) @@ -86,7 +86,7 @@ func (p *scheduler) Prepare(options *SchedulerExecutionOptions) error { return nil } -// Execute executes the pipeline, constructing an internal task graph and walking it accordlingly. +// Execute executes the pipeline, constructing an internal task graph and walking it accordingly. func (p *scheduler) Execute() []error { var sema = util.NewSemaphore(p.Concurrency) return p.TaskGraph.Walk(func(v dag.Vertex) error { From 4968ac403a2f04c163df514479d3000982fad02f Mon Sep 17 00:00:00 2001 From: Josh Soref Date: Sun, 26 Dec 2021 19:33:09 -0500 Subject: [PATCH 02/16] spelling: backend Signed-off-by: Josh Soref --- cli/internal/context/context.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cli/internal/context/context.go b/cli/internal/context/context.go index bcc1843ca36e3..28acaa272f177 100644 --- a/cli/internal/context/context.go +++ b/cli/internal/context/context.go @@ -136,7 +136,7 @@ func WithGraph(rootpath string, config *config.Config) Option { c.Backend = backend } - // this should go into the bacend abstraction + // this should go into the backend abstraction if util.IsYarn(c.Backend.Name) { lockfile, err := fs.ReadLockfile(c.Backend.Name, config.Cache.Dir) if err != nil { From df65daa6b7e5f2bf7afeaa6fa1ddeb5e0b894999 Mon Sep 17 00:00:00 2001 From: Josh Soref Date: Sun, 26 Dec 2021 19:33:09 -0500 Subject: [PATCH 03/16] spelling: delimiter Signed-off-by: Josh Soref --- cli/internal/run/run.go | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/cli/internal/run/run.go b/cli/internal/run/run.go index 45449a11c18e0..0e57f3a9875fa 100644 --- a/cli/internal/run/run.go +++ b/cli/internal/run/run.go @@ -40,8 +40,8 @@ import ( "github.com/pkg/errors" ) -const TOPOLOGICAL_PIPELINE_DELMITER = "^" -const ENV_PIPELINE_DELMITER = "$" +const TOPOLOGICAL_PIPELINE_DELIMITER = "^" +const ENV_PIPELINE_DELIMITER = "$" // RunCommand is a Command implementation that tells Turbo to run a task type RunCommand struct { @@ -408,13 +408,13 @@ func (c *RunCommand) runOperation(g *completeGraph, rs *runSpec, backend *api.La deps := make(util.Set) if util.IsPackageTask(taskName) { for _, from := range value.DependsOn { - if strings.HasPrefix(from, ENV_PIPELINE_DELMITER) { + if strings.HasPrefix(from, ENV_PIPELINE_DELIMITER) { continue } if util.IsPackageTask(from) { engine.AddDep(from, taskName) continue - } else if strings.Contains(from, TOPOLOGICAL_PIPELINE_DELMITER) { + } else if strings.Contains(from, TOPOLOGICAL_PIPELINE_DELIMITER) { topoDeps.Add(from[1:]) } else { deps.Add(from) @@ -424,10 +424,10 @@ func (c *RunCommand) runOperation(g *completeGraph, rs *runSpec, backend *api.La taskName = id } else { for _, from := range value.DependsOn { - if strings.HasPrefix(from, ENV_PIPELINE_DELMITER) { + if strings.HasPrefix(from, ENV_PIPELINE_DELIMITER) { continue } - if strings.Contains(from, TOPOLOGICAL_PIPELINE_DELMITER) { + if strings.Contains(from, TOPOLOGICAL_PIPELINE_DELIMITER) { topoDeps.Add(from[1:]) } else { deps.Add(from) @@ -503,8 +503,8 @@ func (c *RunCommand) runOperation(g *completeGraph, rs *runSpec, backend *api.La var hashabledEnvPairs []string if len(pipeline.DependsOn) > 0 { for _, v := range pipeline.DependsOn { - if strings.Contains(v, ENV_PIPELINE_DELMITER) { - trimmed := strings.TrimPrefix(v, ENV_PIPELINE_DELMITER) + if strings.Contains(v, ENV_PIPELINE_DELIMITER) { + trimmed := strings.TrimPrefix(v, ENV_PIPELINE_DELIMITER) hashabledEnvPairs = append(hashabledEnvPairs, fmt.Sprintf("%v=%v", trimmed, os.Getenv(trimmed))) hashabledEnvVars = append(hashabledEnvVars, trimmed) } From 66af92159ee98802f30b16fc803d2310e8db981d Mon Sep 17 00:00:00 2001 From: Josh Soref Date: Fri, 25 Feb 2022 16:16:05 -0500 Subject: [PATCH 04/16] spelling: escaped Signed-off-by: Josh Soref --- docs/nextra-theme-docs/flexsearch.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/nextra-theme-docs/flexsearch.js b/docs/nextra-theme-docs/flexsearch.js index d89ce17983b42..2a13225610e0a 100644 --- a/docs/nextra-theme-docs/flexsearch.js +++ b/docs/nextra-theme-docs/flexsearch.js @@ -44,9 +44,9 @@ const Item = ({ page, first, title, active, href, onHover, excerpt }) => { const MemoedStringWithMatchHighlights = memo( function StringWithMatchHighlights({ content, search }) { const splittedText = content.split(""); - const escappedSearch = search.trim().replace(/[|\\{}()[\]^$+*?.]/g, "\\$&"); + const escapedSearch = search.trim().replace(/[|\\{}()[\]^$+*?.]/g, "\\$&"); const regexp = RegExp( - "(" + escappedSearch.split(" ").join("|") + ")", + "(" + escapedSearch.split(" ").join("|") + ")", "ig" ); let match; From c11d7ad7572d8c1f91bdb551978d4fc4f8545841 Mon Sep 17 00:00:00 2001 From: Josh Soref Date: Sun, 26 Dec 2021 19:33:10 -0500 Subject: [PATCH 05/16] spelling: exclude Signed-off-by: Josh Soref --- cli/internal/run/run.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cli/internal/run/run.go b/cli/internal/run/run.go index 0e57f3a9875fa..f4f9bee6b473b 100644 --- a/cli/internal/run/run.go +++ b/cli/internal/run/run.go @@ -269,7 +269,7 @@ func (c *RunCommand) Run(args []string) int { } c.Config.Logger.Debug("dependents", "pkg", pkg, "value", descenders.List()) for _, d := range descenders { - // we need to exlcude the fake root node + // we need to exclude the fake root node // since it is not a real package if d != ctx.RootNode { filteredPkgs.Add(d) @@ -288,7 +288,7 @@ func (c *RunCommand) Run(args []string) int { } c.Config.Logger.Debug("dependencies", "pkg", pkg, "value", ancestors.List()) for _, d := range ancestors { - // we need to exlcude the fake root node + // we need to exclude the fake root node // since it is not a real package if d != ctx.RootNode { filteredPkgs.Add(d) From a98ec75ebf9d217f73ef2805ec6a5dca7f3ed228 Mon Sep 17 00:00:00 2001 From: Josh Soref Date: Sun, 26 Dec 2021 19:33:10 -0500 Subject: [PATCH 06/16] spelling: execution Signed-off-by: Josh Soref --- cli/internal/run/run.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cli/internal/run/run.go b/cli/internal/run/run.go index f4f9bee6b473b..96e1a7c5dc10e 100644 --- a/cli/internal/run/run.go +++ b/cli/internal/run/run.go @@ -766,7 +766,7 @@ type RunOptions struct { includeDependents bool // Whether to include includeDependencies (pkg.dependencies) in execution (defaults to false) includeDependencies bool - // List of globs of file paths to ignore from exection scope calculation + // List of globs of file paths to ignore from execution scope calculation ignore []string // Whether to stream log outputs stream bool From 27a5055ec0fa1611673c0ee1878225b7d91c2345 Mon Sep 17 00:00:00 2001 From: Josh Soref Date: Fri, 25 Feb 2022 16:21:03 -0500 Subject: [PATCH 07/16] spelling: hashable Signed-off-by: Josh Soref --- cli/internal/run/run.go | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/cli/internal/run/run.go b/cli/internal/run/run.go index 96e1a7c5dc10e..6f94a7f12fd04 100644 --- a/cli/internal/run/run.go +++ b/cli/internal/run/run.go @@ -499,19 +499,19 @@ func (c *RunCommand) runOperation(g *completeGraph, rs *runSpec, backend *api.La } // Hash the task-specific environment variables found in the dependsOnKey in the pipeline - var hashabledEnvVars []string - var hashabledEnvPairs []string + var hashableEnvVars []string + var hashableEnvPairs []string if len(pipeline.DependsOn) > 0 { for _, v := range pipeline.DependsOn { if strings.Contains(v, ENV_PIPELINE_DELIMITER) { trimmed := strings.TrimPrefix(v, ENV_PIPELINE_DELIMITER) - hashabledEnvPairs = append(hashabledEnvPairs, fmt.Sprintf("%v=%v", trimmed, os.Getenv(trimmed))) - hashabledEnvVars = append(hashabledEnvVars, trimmed) + hashableEnvPairs = append(hashableEnvPairs, fmt.Sprintf("%v=%v", trimmed, os.Getenv(trimmed))) + hashableEnvVars = append(hashableEnvVars, trimmed) } } - sort.Strings(hashabledEnvVars) // always sort them + sort.Strings(hashableEnvVars) // always sort them } - targetLogger.Debug("hashable env vars", "vars", hashabledEnvVars) + targetLogger.Debug("hashable env vars", "vars", hashableEnvVars) hashable := struct { Hash string Task string @@ -523,7 +523,7 @@ func (c *RunCommand) runOperation(g *completeGraph, rs *runSpec, backend *api.La Task: task, Outputs: outputs, PassThruArgs: passThroughArgs, - HashableEnvPairs: hashabledEnvPairs, + HashableEnvPairs: hashableEnvPairs, } hash, err := fs.HashObject(hashable) targetLogger.Debug("task hash", "value", hash) From fd55909b0616db97ed168a832fac788de2185d1e Mon Sep 17 00:00:00 2001 From: Josh Soref Date: Sun, 26 Dec 2021 19:33:10 -0500 Subject: [PATCH 08/16] spelling: manager Signed-off-by: Josh Soref --- packages/create-turbo/__tests__/cli.test.ts | 4 ++-- packages/create-turbo/src/index.ts | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/create-turbo/__tests__/cli.test.ts b/packages/create-turbo/__tests__/cli.test.ts index a337eb0bf88e4..dfdf17af7492b 100644 --- a/packages/create-turbo/__tests__/cli.test.ts +++ b/packages/create-turbo/__tests__/cli.test.ts @@ -129,7 +129,7 @@ describe("create-turbo cli", () => { Flags: --use-npm Explicitly tell the CLI to bootstrap the app using npm --use-pnpm Explicitly tell the CLI to bootstrap the app using pnpm - --no-install Explicitly do not run the package mananger's install command + --no-install Explicitly do not run the package manager's install command --help, -h Show this help message --version, -v Show the version of this script @@ -153,7 +153,7 @@ describe("create-turbo cli", () => { Flags: --use-npm Explicitly tell the CLI to bootstrap the app using npm --use-pnpm Explicitly tell the CLI to bootstrap the app using pnpm - --no-install Explicitly do not run the package mananger's install command + --no-install Explicitly do not run the package manager's install command --help, -h Show this help message --version, -v Show the version of this script diff --git a/packages/create-turbo/src/index.ts b/packages/create-turbo/src/index.ts index 3332cab9e4e30..805876713c577 100644 --- a/packages/create-turbo/src/index.ts +++ b/packages/create-turbo/src/index.ts @@ -32,7 +32,7 @@ const help = ` Flags: --use-npm Explicitly tell the CLI to bootstrap the app using npm --use-pnpm Explicitly tell the CLI to bootstrap the app using pnpm - --no-install Explicitly do not run the package mananger's install command + --no-install Explicitly do not run the package manager's install command --help, -h Show this help message --version, -v Show the version of this script `; From 9db0455c0874ac8c2af0330a71e7991bda3962a2 Mon Sep 17 00:00:00 2001 From: Josh Soref Date: Fri, 25 Feb 2022 16:16:32 -0500 Subject: [PATCH 09/16] spelling: marshal Signed-off-by: Josh Soref --- cli/internal/cache/cache_fs.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/cli/internal/cache/cache_fs.go b/cli/internal/cache/cache_fs.go index fac3ff67814d1..89573c657dc61 100644 --- a/cli/internal/cache/cache_fs.go +++ b/cli/internal/cache/cache_fs.go @@ -119,9 +119,9 @@ type CacheMetadata struct { // WriteCacheMetaFile writes cache metadata file at a path func WriteCacheMetaFile(path string, config *CacheMetadata) error { - jsonBytes, marhsallError := json.Marshal(config) - if marhsallError != nil { - return marhsallError + jsonBytes, marshalErr := json.Marshal(config) + if marshalErr != nil { + return marshalErr } writeFilErr := ioutil.WriteFile(path, jsonBytes, 0644) if writeFilErr != nil { @@ -137,9 +137,9 @@ func ReadCacheMetaFile(path string) (*CacheMetadata, error) { return nil, readFileErr } var config CacheMetadata - unmarshallErr := json.Unmarshal(jsonBytes, &config) - if unmarshallErr != nil { - return nil, unmarshallErr + marshalErr := json.Unmarshal(jsonBytes, &config) + if marshalErr != nil { + return nil, marshalErr } return &config, nil } From e85bf4f071d16c46175413f955d0224f3b32e94a Mon Sep 17 00:00:00 2001 From: Josh Soref Date: Sun, 26 Dec 2021 19:33:11 -0500 Subject: [PATCH 10/16] spelling: marshall Signed-off-by: Josh Soref --- cli/internal/config/config_file.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cli/internal/config/config_file.go b/cli/internal/config/config_file.go index f3d9fd00b041b..f2448ad734cb3 100644 --- a/cli/internal/config/config_file.go +++ b/cli/internal/config/config_file.go @@ -24,9 +24,9 @@ type TurborepoConfig struct { // WriteUserConfigFile writes config file at a path func WriteConfigFile(path string, config *TurborepoConfig) error { - jsonBytes, marhsallError := json.Marshal(config) - if marhsallError != nil { - return marhsallError + jsonBytes, marshallError := json.Marshal(config) + if marshallError != nil { + return marshallError } writeFilErr := ioutil.WriteFile(path, jsonBytes, 0644) if writeFilErr != nil { From d5d5b3cbc950fbdf697e934a95ba8a8bd2b5f7e1 Mon Sep 17 00:00:00 2001 From: Josh Soref Date: Fri, 25 Feb 2022 16:21:46 -0500 Subject: [PATCH 11/16] spelling: meta framework Signed-off-by: Josh Soref --- docs/pages/docs/troubleshooting.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/pages/docs/troubleshooting.mdx b/docs/pages/docs/troubleshooting.mdx index 35a2c1c9493d7..822304f171a97 100644 --- a/docs/pages/docs/troubleshooting.mdx +++ b/docs/pages/docs/troubleshooting.mdx @@ -19,7 +19,7 @@ This guide aims to help you debug issues with your Turborepo builds and configur - Did you specify `types` or `typing` inside the dependency's `package.json` to point to the `.d.ts` file? - Have you altered or set custom `tsconfig.json` `paths`? - Do they have the correct folder structure for your application? - - Are they properly configured for the metaframework, bundler, or transpilation tool? + - Are they properly configured for the meta framework, bundler, or transpilation tool? ## I'm not seeing any cache hits From 29039cfcd7ef44a0fb2ac94f15b560b648e3605f Mon Sep 17 00:00:00 2001 From: Josh Soref Date: Sun, 26 Dec 2021 19:33:12 -0500 Subject: [PATCH 12/16] spelling: precedence Signed-off-by: Josh Soref --- cli/internal/config/config.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cli/internal/config/config.go b/cli/internal/config/config.go index 36cdeaf35df97..49ee6b696f6b8 100644 --- a/cli/internal/config/config.go +++ b/cli/internal/config/config.go @@ -85,7 +85,7 @@ func ParseAndValidate(args []string, ui cli.Ui, turboVersion string) (c *Config, if len(inputFlags) == 1 && (inputFlags[0] == "help" || inputFlags[0] == "--help" || inputFlags[0] == "-help") { return nil, nil } - // Precendence is flags > env > config > default + // Precedence is flags > env > config > default userConfig, _ := ReadUserConfigFile() partialConfig, _ := ReadConfigFile(filepath.Join(".turbo", "config.json")) partialConfig.Token = userConfig.Token From 7a4c3ae740a89ea6b2131542f2a137c306ee116b Mon Sep 17 00:00:00 2001 From: Josh Soref Date: Sun, 26 Dec 2021 19:33:13 -0500 Subject: [PATCH 13/16] spelling: temporary Signed-off-by: Josh Soref --- cli/internal/prune/prune.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cli/internal/prune/prune.go b/cli/internal/prune/prune.go index 1271b67b10fb7..bbc2bbef73aa3 100644 --- a/cli/internal/prune/prune.go +++ b/cli/internal/prune/prune.go @@ -10,6 +10,7 @@ import ( "path/filepath" "strings" "sync" + "github.com/vercel/turborepo/cli/internal/config" "github.com/vercel/turborepo/cli/internal/context" "github.com/vercel/turborepo/cli/internal/fs" @@ -268,7 +269,7 @@ func (c *PruneCommand) Run(args []string) int { tmpGeneratedLockfile, err := os.Create(filepath.Join(pruneOptions.cwd, "out", "yarn-tmp.lock")) tmpGeneratedLockfileWriter := bufio.NewWriter(tmpGeneratedLockfile) if err != nil { - c.logError(c.Config.Logger, "", fmt.Errorf("failed create tempory lockfile: %w", err)) + c.logError(c.Config.Logger, "", fmt.Errorf("failed create temporary lockfile: %w", err)) return 1 } From 56e419c4b0b54845ca5a76b4a5369b2a435eb660 Mon Sep 17 00:00:00 2001 From: Josh Soref Date: Sun, 26 Dec 2021 19:33:13 -0500 Subject: [PATCH 14/16] spelling: useful Signed-off-by: Josh Soref --- .devcontainer/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index 328916afd961f..987e62011780e 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -19,6 +19,6 @@ RUN if [ "${NODE_VERSION}" != "none" ]; then su vscode -c "umask 0002 && . /usr/ # [Optional] Uncomment this line to install global node packages. RUN su vscode -c "source /usr/local/share/nvm/nvm.sh && npm install -g vercel yarn yalc pnpm nodemon" 2>&1 -# Add hyperfine, a usefule benchmarking tool +# Add hyperfine, a useful benchmarking tool RUN dpkgArch="$(dpkg --print-architecture)"; \ wget "https://github.com/sharkdp/hyperfine/releases/download/v1.12.0/hyperfine_1.12.0_${dpkgArch}.deb" && dpkg -i "hyperfine_1.12.0_${dpkgArch}.deb" From fbeb793abff661e1a9e5a1c1aeb2a8714e0f863b Mon Sep 17 00:00:00 2001 From: Josh Soref Date: Fri, 25 Feb 2022 16:22:44 -0500 Subject: [PATCH 15/16] spelling: wait group Signed-off-by: Josh Soref --- cli/internal/context/context.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cli/internal/context/context.go b/cli/internal/context/context.go index 28acaa272f177..c5c1d9f37da01 100644 --- a/cli/internal/context/context.go +++ b/cli/internal/context/context.go @@ -221,7 +221,7 @@ func WithGraph(rootpath string, config *config.Config) Option { } c.Targets = targets // We will parse all package.json's simultaneously. We use a - // waitgroup because we cannot fully populate the graph (the next step) + // wait group because we cannot fully populate the graph (the next step) // until all parsing is complete parseJSONWaitGroup := new(errgroup.Group) justJsons := make([]string, 0, len(spaces)) From 3cdd0ea388375d9f2d2c9a12116ed0729fb64572 Mon Sep 17 00:00:00 2001 From: Josh Soref Date: Sun, 26 Dec 2021 19:33:13 -0500 Subject: [PATCH 16/16] spelling: workspaces Signed-off-by: Josh Soref --- cli/internal/prune/prune.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cli/internal/prune/prune.go b/cli/internal/prune/prune.go index bbc2bbef73aa3..899fc038362fd 100644 --- a/cli/internal/prune/prune.go +++ b/cli/internal/prune/prune.go @@ -205,7 +205,7 @@ func (c *PruneCommand) Run(args []string) int { logger.Printf(" - Added %v", ctx.PackageInfos[internalDep].Name) } - c.Config.Logger.Trace("new worksapces", "value", workspaces) + c.Config.Logger.Trace("new workspaces", "value", workspaces) if pruneOptions.docker { if fs.FileExists(".gitignore") { if err := fs.CopyFile(".gitignore", filepath.Join(pruneOptions.cwd, "out", "full", ".gitignore"), fs.DirPermissions); err != nil {