diff --git a/.editorconfig b/.editorconfig index 83b7b34b8a8ae..dcc85a977a161 100644 --- a/.editorconfig +++ b/.editorconfig @@ -1,11 +1,31 @@ +# http://editorconfig.org +root = true + [*] -indent_style = space +charset = utf-8 +end_of_line = lf indent_size = 2 - -[*.{js,ts}] indent_style = space -indent_size = 2 +insert_final_newline = true +trim_trailing_whitespace = true [Makefile] indent_style = tab -indent_size = 2 \ No newline at end of file + +[{go.mod,go.sum,*.go}] +indent_style = tab + +[*.{md,mdx}] +insert_final_newline = true + +[*.html] +insert_final_newline = false + +[nginx.conf] +indent_size = 8 + +[*.svg] +insert_final_newline = false + +[LICENSE] +insert_final_newline = false diff --git a/.eslintignore b/.eslintignore index c5497e8ee59a4..6c6f5444de79f 100644 --- a/.eslintignore +++ b/.eslintignore @@ -7,4 +7,4 @@ dist *.svg *.lock *.npmignore -examples/** \ No newline at end of file +examples/** diff --git a/.git-blame-ignore-revs b/.git-blame-ignore-revs new file mode 100644 index 0000000000000..bb1a9c72989a5 --- /dev/null +++ b/.git-blame-ignore-revs @@ -0,0 +1,2 @@ +# Apply EditorConfig to all files +e9a9249db781d6498a7c2ad057149ac1cb432302 diff --git a/.gitignore b/.gitignore index 065ed71f3ea10..c2d61f8f630e8 100644 --- a/.gitignore +++ b/.gitignore @@ -58,4 +58,4 @@ store todos.md examples/*/*.lock examples/*/*-lock.yaml -.store \ No newline at end of file +.store diff --git a/.prettierignore b/.prettierignore index 926d0600cbfb7..5f803fb36ea4f 100644 --- a/.prettierignore +++ b/.prettierignore @@ -24,4 +24,4 @@ LICENSE .dockerignore *.patch *.toml -*.prisma \ No newline at end of file +*.prisma diff --git a/cli/Makefile b/cli/Makefile index efccaf3d59502..537dfb0b722b4 100644 --- a/cli/Makefile +++ b/cli/Makefile @@ -40,7 +40,7 @@ fmt-go: install: | ./package.json pnpm i --filter=cli... -e2e: install +e2e: install pnpm e2e cmd/turbo/version.go: version.txt @@ -148,10 +148,10 @@ platform-neutral: | turbo cd npm/turbo-install && npm version "$(TURBO_VERSION)" --allow-same-version node ./scripts/bump-version.js -platform-create-turbo: +platform-create-turbo: cd ../packages/create-turbo && npm version "$(TURBO_VERSION)" --allow-same-version && npm run build -platform-turbo-codemod: +platform-turbo-codemod: cd ../packages/turbo-codemod && npm version "$(TURBO_VERSION)" --allow-same-version && npm run build test-prepublish: @@ -263,7 +263,7 @@ bench/nx: demo/nx cd demo/nx && node_modules/.bin/nx run-many --target=build --all bench/turbo: demo/turbo turbo - cd demo/turbo && ../../turbo run test + cd demo/turbo && ../../turbo run test bench/turbo-new: demo/turbo cd demo/turbo && ../../turbo-new run build test diff --git a/cli/internal/fs/copy_file.go b/cli/internal/fs/copy_file.go index 559b3cc4fb230..bcd5bf33a7e8e 100644 --- a/cli/internal/fs/copy_file.go +++ b/cli/internal/fs/copy_file.go @@ -75,17 +75,17 @@ func WalkMode(rootPath string, callback func(name string, isDir bool, mode os.Fi return godirwalk.Walk(rootPath, &godirwalk.Options{ Callback: func(name string, info *godirwalk.Dirent) error { // currently we support symlinked files, but not symlinked directories: - // For copying, we Mkdir and bail if we encounter a symlink to a directoy - // For finding packages, we enumerate the symlink, but don't follow inside - isDir, err := info.IsDirOrSymlinkToDir() - if err != nil { - pathErr := &os.PathError{} - if errors.As(err, &pathErr) { - // If we have a broken link, skip this entry - return godirwalk.SkipThis - } - return err - } + // For copying, we Mkdir and bail if we encounter a symlink to a directoy + // For finding packages, we enumerate the symlink, but don't follow inside + isDir, err := info.IsDirOrSymlinkToDir() + if err != nil { + pathErr := &os.PathError{} + if errors.As(err, &pathErr) { + // If we have a broken link, skip this entry + return godirwalk.SkipThis + } + return err + } return callback(name, isDir, info.ModeType()) }, ErrorCallback: func(pathname string, err error) godirwalk.ErrorAction { diff --git a/cli/internal/prune/prune.go b/cli/internal/prune/prune.go index 3611c081d5504..d48fff99d1360 100644 --- a/cli/internal/prune/prune.go +++ b/cli/internal/prune/prune.go @@ -45,8 +45,8 @@ Options: --help Show this screen. --scope Specify package to act as entry point for pruned monorepo (required). - --docker Output pruned workspace into 'full' - and 'json' directories optimized for + --docker Output pruned workspace into 'full' + and 'json' directories optimized for Docker layer caching. (default false) ` return strings.TrimSpace(helpText) diff --git a/cli/internal/run/run.go b/cli/internal/run/run.go index 307b8ca4aa1b4..72cf60a5cde28 100644 --- a/cli/internal/run/run.go +++ b/cli/internal/run/run.go @@ -135,8 +135,8 @@ Options: mergebase. This uses the git diff ${target_branch}... mechanism to identify which packages have changed. --team The slug or team ID of the remote cache team. - --token A bearer token for remote caching. You can also set - the value of the current token by setting an + --token A bearer token for remote caching. You can also set + the value of the current token by setting an environment variable named TURBO_TOKEN. --ignore Files to ignore when calculating changed files (i.e. --since). Supports globs. diff --git a/cli/internal/scope/filter/filter.go b/cli/internal/scope/filter/filter.go index 57c791928bf4b..dde5373951c65 100644 --- a/cli/internal/scope/filter/filter.go +++ b/cli/internal/scope/filter/filter.go @@ -293,10 +293,10 @@ func (r *Resolver) filterSubtreesWithSelector(selector *TargetSelector) (util.Se } for changedPkg := range changedPkgs { if !selector.excludeSelf && pkg == changedPkg { - roots.Add(pkg) - break - } - if deps.Include(changedPkg) { + roots.Add(pkg) + break + } + if deps.Include(changedPkg) { roots.Add(pkg) matched.Add(changedPkg) break diff --git a/cli/internal/scope/scope.go b/cli/internal/scope/scope.go index e90d04188ceda..a4a6fb5ae0d44 100644 --- a/cli/internal/scope/scope.go +++ b/cli/internal/scope/scope.go @@ -45,8 +45,8 @@ func (o *Opts) asFilterPatterns() []string { if len(o.Patterns) > 0 { // --scope implies our tweaked syntax to see if any dependency matches if since != "" { - since = "..." + since - } + since = "..." + since + } for _, pattern := range o.Patterns { if strings.HasPrefix(pattern, "!") { patterns = append(patterns, pattern) diff --git a/cli/internal/ui/colors.go b/cli/internal/ui/colors.go index 545d463fe00f4..b1e7bd66b1f19 100644 --- a/cli/internal/ui/colors.go +++ b/cli/internal/ui/colors.go @@ -21,7 +21,7 @@ func GetColorModeFromEnv() ColorMode { // We don't currently use the level for anything specific, and just treat things as on and off. // // Note: while "false" and "true" aren't documented, the library coerces these values to 0 and 1 - // respectively, so that behavior is reproduced here as well. + // respectively, so that behavior is reproduced here as well. // https://www.npmjs.com/package/supports-color switch forceColor := os.Getenv("FORCE_COLOR"); { diff --git a/cli/internal/ui/ui.go b/cli/internal/ui/ui.go index b90f25ee26b59..4eabb386ca938 100644 --- a/cli/internal/ui/ui.go +++ b/cli/internal/ui/ui.go @@ -66,7 +66,7 @@ func (into *stripAnsiWriter) Write(p []byte) (int, error) { // not failing under typical operation as well. return n, err } - + // Write must return a non-nil error if it returns n < len(p). Consequently, if the // wrappedWrite.Write call succeeded we will return len(p) as the number of bytes // written. @@ -80,7 +80,7 @@ func Default() *cli.ColoredUi { func BuildColoredUi(colorMode ColorMode) *cli.ColoredUi { colorMode = applyColorMode(colorMode); - + var outWriter, errWriter io.Writer if colorMode == ColorModeSuppressed { diff --git a/cli/npm/turbo-android-arm64/LICENSE b/cli/npm/turbo-android-arm64/LICENSE index a612ad9813b00..fa0086a952236 100644 --- a/cli/npm/turbo-android-arm64/LICENSE +++ b/cli/npm/turbo-android-arm64/LICENSE @@ -370,4 +370,4 @@ Exhibit B - "Incompatible With Secondary Licenses" Notice --------------------------------------------------------- This Source Code Form is "Incompatible With Secondary Licenses", as - defined by the Mozilla Public License, v. 2.0. + defined by the Mozilla Public License, v. 2.0. \ No newline at end of file diff --git a/cli/npm/turbo-install/README.md b/cli/npm/turbo-install/README.md index da2cf4901df53..bafb371703a9e 100644 --- a/cli/npm/turbo-install/README.md +++ b/cli/npm/turbo-install/README.md @@ -1,8 +1,8 @@
- +
-+
diff --git a/cli/npm/turbo-install/package.json b/cli/npm/turbo-install/package.json
index c87de217bd4e4..ca621bebe1bef 100644
--- a/cli/npm/turbo-install/package.json
+++ b/cli/npm/turbo-install/package.json
@@ -31,4 +31,4 @@
"turbo-windows-32": "1.2.2-canary.0",
"turbo-windows-64": "1.2.2-canary.0"
}
-}
\ No newline at end of file
+}
diff --git a/cli/scripts/monorepo.ts b/cli/scripts/monorepo.ts
index 739f820e30e23..bf7405489c24f 100644
--- a/cli/scripts/monorepo.ts
+++ b/cli/scripts/monorepo.ts
@@ -40,9 +40,9 @@ export class Monorepo {
[user]
name = GitHub Actions
email = actions@users.noreply.github.com
-
+
[init]
- defaultBranch = main
+ defaultBranch = main
`
);
execa.sync("git", ["init", "-q"], { cwd: this.root });
@@ -93,7 +93,7 @@ export class Monorepo {
"pnpm-workspace.yaml": `packages:
- packages/*`,
"pnpm-lock.yaml": `lockfileVersion: 5.3
-
+
importers:
.:
@@ -110,7 +110,7 @@ importers:
packages/c:
specifiers: {}
-
+
`,
});
execa.sync("pnpm", ["install", "--recursive"], {
@@ -199,7 +199,7 @@ const path = require('path');
console.log('building ${name}');
if (!fs.existsSync(path.join(__dirname, 'dist'))){
- fs.mkdirSync(path.join(__dirname, 'dist'));
+ fs.mkdirSync(path.join(__dirname, 'dist'));
}
fs.copyFileSync(
diff --git a/cli/scripts/nginx/.dockerignore b/cli/scripts/nginx/.dockerignore
index 10bf76692974d..4c8fbef048e39 100644
--- a/cli/scripts/nginx/.dockerignore
+++ b/cli/scripts/nginx/.dockerignore
@@ -1 +1 @@
-cacher_root
\ No newline at end of file
+cacher_root
diff --git a/cli/scripts/nginx/nginx.conf b/cli/scripts/nginx/nginx.conf
index 8e1ff342afa10..d56b5c08d895e 100644
--- a/cli/scripts/nginx/nginx.conf
+++ b/cli/scripts/nginx/nginx.conf
@@ -36,4 +36,4 @@ http {
client_max_body_size 512M;
}
}
-}
\ No newline at end of file
+}
diff --git a/docs/components/Window.js b/docs/components/Window.js
index 1324d7d6da223..2920cbeae930f 100644
--- a/docs/components/Window.js
+++ b/docs/components/Window.js
@@ -63,7 +63,7 @@ export class Window extends React.PureComponent {
height: 100%;
background: #050b13;
position: relative;
- border-radius: 8px;
+ border-radius: 8px;
}
.window.white {
border: 0;
@@ -104,9 +104,9 @@ export class Window extends React.PureComponent {
display: inline-block;
white-space: nowrap;
min-width: 28px;
- border-radius: 8px;
+ border-radius: 8px;
}
-
+
.terminal-special:after {
content: '';
display: block;
diff --git a/docs/components/safelist.txt b/docs/components/safelist.txt
index bfde8af6ac7d1..b38d9bb820272 100644
--- a/docs/components/safelist.txt
+++ b/docs/components/safelist.txt
@@ -1 +1 @@
-dark:prose-dark
\ No newline at end of file
+dark:prose-dark
diff --git a/docs/pages/blog/saml-sso-now-available.mdx b/docs/pages/blog/saml-sso-now-available.mdx
index d51d752dbba3b..e5bf1a8fbf5c2 100644
--- a/docs/pages/blog/saml-sso-now-available.mdx
+++ b/docs/pages/blog/saml-sso-now-available.mdx
@@ -1,7 +1,7 @@
---
title: SAML SSO is now available
date: 2021/08/03
-description: SAML Single Sign-on (SSO) is now available to Enterprise customers thanks to our friends over at WorkOS.
+description: SAML Single Sign-on (SSO) is now available to Enterprise customers thanks to our friends over at WorkOS.
tag: web development
ogImage: /images/blog/og-saml.png
---
diff --git a/docs/pages/blog/turbo-0-4-0.mdx b/docs/pages/blog/turbo-0-4-0.mdx
index 182ec376b8873..35307b6dfc60a 100644
--- a/docs/pages/blog/turbo-0-4-0.mdx
+++ b/docs/pages/blog/turbo-0-4-0.mdx
@@ -135,7 +135,7 @@ Here's how it works:
"turbo": {
"pipeline": {
"build": {
- // This `^` tells turbo that this pipeline target relies on a topological target being completed.
+ // This `^` tells turbo that this pipeline target relies on a topological target being completed.
// In english, this reads as: "this package's `build` command depends on its dependencies' or
// devDependencies' `build` command being completed"
"dependsOn": ["^build"]
@@ -145,8 +145,8 @@ Here's how it works:
// In English, this reads as: "this package's `test` command depends on its `lint` and `build` command first being completed"
"dependsOn": ["lint", "build"]
},
- "lint": {},
- "dev": {},
+ "lint": {},
+ "dev": {},
}
}
@@ -180,11 +180,11 @@ Building on the example from above, you can now set cache output conventions acr
"outputs": ["coverage/**"],
"dependsOn": ["lint", "build"]
},
- "dev": {
+ "dev": {
// Never cache the `dev` command
"cache": false
- },
- "lint": {},
+ },
+ "lint": {},
}
}
}
diff --git a/docs/pages/blog/you-might-not-need-typescript-project-references.mdx b/docs/pages/blog/you-might-not-need-typescript-project-references.mdx
index 4fdf4fb2e4251..bbdf64fd7ca41 100644
--- a/docs/pages/blog/you-might-not-need-typescript-project-references.mdx
+++ b/docs/pages/blog/you-might-not-need-typescript-project-references.mdx
@@ -37,10 +37,10 @@ As it turns out, you might not even need references or even an interim TypeScrip
"main": "./src/index.ts"
"types": "./src/index.ts", // yes, this works!
"dependencies": {
- ...
+ ...
},
"devDependencies": {
- ...
+ ...
}
}
```
diff --git a/docs/pages/docs/features/filtering.mdx b/docs/pages/docs/features/filtering.mdx
index a514a7529bc64..c10fc5eaa63b8 100644
--- a/docs/pages/docs/features/filtering.mdx
+++ b/docs/pages/docs/features/filtering.mdx
@@ -116,6 +116,5 @@ turbo run build --filter=./apps/* --filter=!admin
```
}>
-Turborepo's Filter API design and docs were/are inspired by
-[pnpm](https://pnpm.io/filtering)
+Turborepo's Filter API design and docs were/are inspired by [pnpm](https://pnpm.io/filtering)
diff --git a/docs/pages/docs/guides/continuous-integration.mdx b/docs/pages/docs/guides/continuous-integration.mdx
index ee9ee56dd0d34..8603d26172221 100644
--- a/docs/pages/docs/guides/continuous-integration.mdx
+++ b/docs/pages/docs/guides/continuous-integration.mdx
@@ -68,13 +68,11 @@ To use Vercel Remote Caching, you can get the value of these variables in a few
1. Create a Scoped Access Token to your account in the [Vercel Dashboard](https://vercel.com/account/tokens)
![Vercel Access Tokens](/images/docs/vercel-tokens.png)
-
![Vercel Access Tokens](/images/docs/vercel-create-token.png)
Copy the value to a safe place. You'll need it in a moment.
-2. Go to your GitHub repository settings and click on the **Secrets** and then **Actions** tab.
- Create a new secret called `TURBO_TOKEN` and enter the value of your Scoped Access Token.
+2. Go to your GitHub repository settings and click on the **Secrets** and then **Actions** tab. Create a new secret called `TURBO_TOKEN` and enter the value of your Scoped Access Token.
![GitHub Secrets](/images/docs/github-actions-secrets.png)
![GitHub Secrets Create](/images/docs/github-actions-create-secret.png)
diff --git a/docs/public/images/logos/lattice.svg b/docs/public/images/logos/lattice.svg
index 0cddf038f295a..3baf3c0f41f64 100644
--- a/docs/public/images/logos/lattice.svg
+++ b/docs/public/images/logos/lattice.svg
@@ -17,4 +17,4 @@