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" diff --git a/cli/internal/cache/cache_fs.go b/cli/internal/cache/cache_fs.go index a8c69d3ffc857..90187e907e870 100644 --- a/cli/internal/cache/cache_fs.go +++ b/cli/internal/cache/cache_fs.go @@ -127,9 +127,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 { @@ -145,9 +145,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 } 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 diff --git a/cli/internal/config/config_file.go b/cli/internal/config/config_file.go index 1fafeba56c05a..d5472afb97498 100644 --- a/cli/internal/config/config_file.go +++ b/cli/internal/config/config_file.go @@ -24,9 +24,9 @@ type TurborepoConfig struct { // writeConfigFile 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 { diff --git a/cli/internal/context/context.go b/cli/internal/context/context.go index 026f801719eac..cc29d3349e234 100644 --- a/cli/internal/context/context.go +++ b/cli/internal/context/context.go @@ -99,7 +99,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(rootpath, c.Backend.Name, config.Cache.Dir) if err != nil { @@ -121,7 +121,7 @@ func WithGraph(rootpath string, config *config.Config) Option { globalHash, err := calculateGlobalHash(rootpath, rootPackageJSON, c.TurboConfig.GlobalDependencies, c.Backend, config.Logger, os.Environ()) c.GlobalHash = globalHash // 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)) 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 { diff --git a/cli/internal/prune/prune.go b/cli/internal/prune/prune.go index b1e79b8cc6e07..4c8941c21ee5d 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 { @@ -269,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 } diff --git a/cli/internal/run/run.go b/cli/internal/run/run.go index 0e42876b2c52d..9a6e16ee246ca 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 { @@ -268,7 +268,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) @@ -287,7 +287,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) @@ -407,13 +407,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) @@ -423,10 +423,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) @@ -498,19 +498,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_DELMITER) { - trimmed := strings.TrimPrefix(v, ENV_PIPELINE_DELMITER) - hashabledEnvPairs = append(hashabledEnvPairs, fmt.Sprintf("%v=%v", trimmed, os.Getenv(trimmed))) - hashabledEnvVars = append(hashabledEnvVars, trimmed) + if strings.Contains(v, ENV_PIPELINE_DELIMITER) { + trimmed := strings.TrimPrefix(v, ENV_PIPELINE_DELIMITER) + 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 @@ -522,7 +522,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) @@ -765,7 +765,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 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; 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 diff --git a/packages/create-turbo/__tests__/cli.test.ts b/packages/create-turbo/__tests__/cli.test.ts index 9ff11f43a6036..3061a22ec1b1d 100644 --- a/packages/create-turbo/__tests__/cli.test.ts +++ b/packages/create-turbo/__tests__/cli.test.ts @@ -134,7 +134,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 @@ -158,7 +158,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 `;