这是indexloc提供的服务,不要输入任何密码
Skip to content

Spelling #441

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 19 commits into from
Mar 2, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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"
12 changes: 6 additions & 6 deletions cli/internal/cache/cache_fs.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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
}
2 changes: 1 addition & 1 deletion cli/internal/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions cli/internal/config/config_file.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
4 changes: 2 additions & 2 deletions cli/internal/context/context.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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))
Expand Down
4 changes: 2 additions & 2 deletions cli/internal/core/scheduler.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ package core

import (
"fmt"
"strings"
"github.com/vercel/turborepo/cli/internal/util"
"strings"

"github.com/pyr-sh/dag"
)
Expand Down Expand Up @@ -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 {
Expand Down
4 changes: 2 additions & 2 deletions cli/internal/prune/prune.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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
}

Expand Down
36 changes: 18 additions & 18 deletions cli/internal/run/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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)
Expand All @@ -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)
Expand Down Expand Up @@ -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)
Expand All @@ -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)
Expand Down Expand Up @@ -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
Expand All @@ -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)
Expand Down Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions docs/nextra-theme-docs/flexsearch.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion docs/pages/docs/troubleshooting.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 2 additions & 2 deletions packages/create-turbo/__tests__/cli.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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

Expand Down
2 changes: 1 addition & 1 deletion packages/create-turbo/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
`;
Expand Down