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

- Turborepo logo + Turborepo logo

-

+

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 ``` 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 @@ - + \ No newline at end of file diff --git a/docs/public/images/logos/makeswift.svg b/docs/public/images/logos/makeswift.svg index 47a08a019a77b..408c6d8568d9d 100644 --- a/docs/public/images/logos/makeswift.svg +++ b/docs/public/images/logos/makeswift.svg @@ -7,4 +7,4 @@ - + \ No newline at end of file diff --git a/docs/public/images/logos/ondeck.svg b/docs/public/images/logos/ondeck.svg index 6001318c801c5..74b48913de9c2 100644 --- a/docs/public/images/logos/ondeck.svg +++ b/docs/public/images/logos/ondeck.svg @@ -17,4 +17,4 @@ - + \ No newline at end of file diff --git a/docs/public/images/logos/paypal.svg b/docs/public/images/logos/paypal.svg index f587524b3bde3..1e4bfc4e704a1 100644 --- a/docs/public/images/logos/paypal.svg +++ b/docs/public/images/logos/paypal.svg @@ -12,4 +12,4 @@ - + \ No newline at end of file diff --git a/docs/public/images/logos/shopify.svg b/docs/public/images/logos/shopify.svg index 9e0559f3418ab..f1ddb876f4fa8 100644 --- a/docs/public/images/logos/shopify.svg +++ b/docs/public/images/logos/shopify.svg @@ -17,4 +17,4 @@ - + \ No newline at end of file diff --git a/docs/public/images/logos/teespring.svg b/docs/public/images/logos/teespring.svg index 101a839f9e0c2..2a8605a99f930 100644 --- a/docs/public/images/logos/teespring.svg +++ b/docs/public/images/logos/teespring.svg @@ -16,4 +16,4 @@ - + \ No newline at end of file diff --git a/docs/public/images/logos/twilio.svg b/docs/public/images/logos/twilio.svg index 53a7b65e6beea..97af516427b4f 100644 --- a/docs/public/images/logos/twilio.svg +++ b/docs/public/images/logos/twilio.svg @@ -7,4 +7,4 @@ - + \ No newline at end of file diff --git a/docs/public/images/logos/vercel.svg b/docs/public/images/logos/vercel.svg index 8e65fe2fe905a..45a7c348406f9 100644 --- a/docs/public/images/logos/vercel.svg +++ b/docs/public/images/logos/vercel.svg @@ -1,3 +1,3 @@ - + \ No newline at end of file diff --git a/docs/public/images/logos/washingtonpost.svg b/docs/public/images/logos/washingtonpost.svg index 09d9132926471..21995a05d2fd5 100644 --- a/docs/public/images/logos/washingtonpost.svg +++ b/docs/public/images/logos/washingtonpost.svg @@ -7,4 +7,4 @@ - + \ No newline at end of file diff --git a/docs/public/logo-dark.svg b/docs/public/logo-dark.svg index 6fa1032b469f4..753fb853a7ddc 100644 --- a/docs/public/logo-dark.svg +++ b/docs/public/logo-dark.svg @@ -32,4 +32,4 @@ - + \ No newline at end of file diff --git a/docs/public/logo-light.svg b/docs/public/logo-light.svg index 5ba14d68fa0f7..3605e57fb5597 100644 --- a/docs/public/logo-light.svg +++ b/docs/public/logo-light.svg @@ -32,4 +32,4 @@ - + \ No newline at end of file diff --git a/docs/public/logo.svg b/docs/public/logo.svg index 6fa1032b469f4..753fb853a7ddc 100644 --- a/docs/public/logo.svg +++ b/docs/public/logo.svg @@ -32,4 +32,4 @@ - + \ No newline at end of file diff --git a/examples/basic/.gitignore b/examples/basic/.gitignore index 998a0e08b4a05..f44f57fff9519 100644 --- a/examples/basic/.gitignore +++ b/examples/basic/.gitignore @@ -29,4 +29,4 @@ yarn-error.log* .env.production.local # turbo -.turbo \ No newline at end of file +.turbo diff --git a/examples/design-system/.gitignore b/examples/design-system/.gitignore index e741956869dcb..1554c1c53a127 100644 --- a/examples/design-system/.gitignore +++ b/examples/design-system/.gitignore @@ -10,4 +10,4 @@ dist-ssr .cache server/dist public/dist -.turbo \ No newline at end of file +.turbo diff --git a/examples/kitchen-sink/.gitignore b/examples/kitchen-sink/.gitignore index e741956869dcb..1554c1c53a127 100644 --- a/examples/kitchen-sink/.gitignore +++ b/examples/kitchen-sink/.gitignore @@ -10,4 +10,4 @@ dist-ssr .cache server/dist public/dist -.turbo \ No newline at end of file +.turbo diff --git a/examples/kitchen-sink/apps/admin/index.html b/examples/kitchen-sink/apps/admin/index.html index ec41bbddb0108..ddd3727a1632a 100644 --- a/examples/kitchen-sink/apps/admin/index.html +++ b/examples/kitchen-sink/apps/admin/index.html @@ -9,4 +9,4 @@

- + \ No newline at end of file diff --git a/examples/kitchen-sink/apps/admin/src/logo.svg b/examples/kitchen-sink/apps/admin/src/logo.svg index 6b60c1042f58d..63a2ad5f34865 100644 --- a/examples/kitchen-sink/apps/admin/src/logo.svg +++ b/examples/kitchen-sink/apps/admin/src/logo.svg @@ -4,4 +4,4 @@ - + \ No newline at end of file diff --git a/examples/with-pnpm/.gitignore b/examples/with-pnpm/.gitignore index 998a0e08b4a05..f44f57fff9519 100644 --- a/examples/with-pnpm/.gitignore +++ b/examples/with-pnpm/.gitignore @@ -29,4 +29,4 @@ yarn-error.log* .env.production.local # turbo -.turbo \ No newline at end of file +.turbo diff --git a/packages/create-turbo/templates/_shared_ts/.npmrc b/packages/create-turbo/templates/_shared_ts/.npmrc index 4fd021952d5a1..b6f27f1359546 100644 --- a/packages/create-turbo/templates/_shared_ts/.npmrc +++ b/packages/create-turbo/templates/_shared_ts/.npmrc @@ -1 +1 @@ -engine-strict=true \ No newline at end of file +engine-strict=true diff --git a/packages/create-turbo/templates/_shared_ts/gitignore b/packages/create-turbo/templates/_shared_ts/gitignore index c13d0087a06b8..849425fe81f86 100644 --- a/packages/create-turbo/templates/_shared_ts/gitignore +++ b/packages/create-turbo/templates/_shared_ts/gitignore @@ -30,4 +30,4 @@ yarn-error.log* .env.production.local # turbo -.turbo \ No newline at end of file +.turbo diff --git a/packages/turbo-codemod/src/index.ts b/packages/turbo-codemod/src/index.ts index cc370b949afad..ff0ce1e2d72c2 100644 --- a/packages/turbo-codemod/src/index.ts +++ b/packages/turbo-codemod/src/index.ts @@ -16,7 +16,7 @@ const help = ` If is not provided up front you will be prompted for it. - Options: + Options: --force Bypass Git safety checks and forcibly run codemods --dry Dry run (no changes are made to files) --print Print transformed files to your terminal diff --git a/scripts/check-examples.sh b/scripts/check-examples.sh index 3e235ef3f6373..a5097deb26b64 100755 --- a/scripts/check-examples.sh +++ b/scripts/check-examples.sh @@ -13,4 +13,4 @@ if [[ ! -z $(git status -s) ]];then echo "Detected changes" git status exit 1 -fi \ No newline at end of file +fi diff --git a/scripts/run-examples.sh b/scripts/run-examples.sh index 28ea86b1de16b..97040b4ce5f5b 100755 --- a/scripts/run-examples.sh +++ b/scripts/run-examples.sh @@ -19,97 +19,97 @@ if [ -f ".eslintrc.js" ]; then fi function cleanup { - rm -rf node_modules - rm -rf apps/*/node_modules - rm -rf apps/*/.next - rm -rf apps/*/.turbo - rm -rf packages/*/node_modules - rm -rf packages/*/.next - rm -rf packages/*/.turbo - rm -rf *.log - rm -rf yarn.lock - rm -rf package-lock.json - rm -rf pnpm-lock.yaml + rm -rf node_modules + rm -rf apps/*/node_modules + rm -rf apps/*/.next + rm -rf apps/*/.turbo + rm -rf packages/*/node_modules + rm -rf packages/*/.next + rm -rf packages/*/.turbo + rm -rf *.log + rm -rf yarn.lock + rm -rf package-lock.json + rm -rf pnpm-lock.yaml } -function setup_git { - echo "=> Setting up git..." - rm -rf .git - mkdir .git - touch .git/config - echo "[user]" >> .git/config - echo " name = GitHub Actions" >> .git/config - echo " email = actions@users.noreply.github.com" >> .git/config - echo "" >> .git/config - echo "[init]" >> .git/config - echo " defaultBranch = main" >> .git/config - git init . -q - git add . - git commit -m "Initial commit" +function setup_git { + echo "=> Setting up git..." + rm -rf .git + mkdir .git + touch .git/config + echo "[user]" >> .git/config + echo " name = GitHub Actions" >> .git/config + echo " email = actions@users.noreply.github.com" >> .git/config + echo "" >> .git/config + echo "[init]" >> .git/config + echo " defaultBranch = main" >> .git/config + git init . -q + git add . + git commit -m "Initial commit" } for folder in examples/* ; do if [ -f "$folder/package.json" ]; then - cd $folder + cd $folder echo "=======================================================" echo "=> checking $folder " echo "=======================================================" - + if [ "$folder" != "examples/with-pnpm" ]; then - + cleanup setup_git - - cat package.json | jq '.packageManager = "npm@8.1.2"' | sponge package.json + + cat package.json | jq '.packageManager = "npm@8.1.2"' | sponge package.json if [ "$TURBO_TAG" == "canary" ]; then - cat package.json | jq '.devDependencies.turbo = "canary"' | sponge package.json + cat package.json | jq '.devDependencies.turbo = "canary"' | sponge package.json fi - + echo "=======================================================" echo "=> $folder: npm install" echo "=======================================================" npm install --force - + echo "=======================================================" echo "=> $folder: npm build lint" echo "=======================================================" npm run build lint - + echo "=======================================================" echo "=> $folder: npm build lint again" echo "=======================================================" npm run build lint - - echo "=======================================================" + + echo "=======================================================" echo "=> $folder: npm SUCCESSFUL" - echo "=======================================================" + echo "=======================================================" cleanup setup_git - - cat package.json | jq '.packageManager = "yarn@1.22.17"' | sponge package.json + + cat package.json | jq '.packageManager = "yarn@1.22.17"' | sponge package.json if [ "$TURBO_TAG" == "canary" ]; then - cat package.json | jq '.devDependencies.turbo = "canary"' | sponge package.json + cat package.json | jq '.devDependencies.turbo = "canary"' | sponge package.json fi - + echo "=======================================================" echo "=> $folder: yarn install" echo "=======================================================" yarn install - + echo "=======================================================" echo "=> $folder: yarn build lint" echo "=======================================================" yarn build lint - + echo "=======================================================" echo "=> $folder: yarn build again" echo "=======================================================" yarn build lint - - echo "=======================================================" + + echo "=======================================================" echo "=> $folder: yarn SUCCESSFUL" - echo "=======================================================" + echo "=======================================================" fi if [ "$folder" == "examples/with-pnpm" ]; then @@ -118,32 +118,32 @@ for folder in examples/* ; do cat package.json | jq '.packageManager = "pnpm@6.26.1"' | sponge package.json if [ "$TURBO_TAG" == "canary" ]; then - cat package.json | jq '.devDependencies.turbo = "canary"' | sponge package.json + cat package.json | jq '.devDependencies.turbo = "canary"' | sponge package.json fi - + echo "=======================================================" echo "=> $folder: pnpm install" echo "=======================================================" pnpm install - + echo "=======================================================" echo "=> $folder: pnpm build lint" echo "=======================================================" pnpm run build lint - + echo "=======================================================" echo "=> $folder: pnpm build lint again" echo "=======================================================" pnpm run build lint - - echo "=======================================================" + + echo "=======================================================" echo "=> $folder: pnpm SUCCESSFUL" - echo "=======================================================" + echo "=======================================================" fi - + cat package.json | jq 'del(.packageManager)' | sponge package.json if [ "$TURBO_TAG" == "canary" ]; then - cat package.json | jq '.devDependencies.turbo = "latest"' | sponge package.json + cat package.json | jq '.devDependencies.turbo = "latest"' | sponge package.json fi cleanup @@ -154,7 +154,7 @@ done; if [ -f ".eslintrc.js.bak" ]; then - mv .eslintrc.js.bak .eslintrc.js + mv .eslintrc.js.bak .eslintrc.js fi if [[ ! -z $(git status -s) ]];then diff --git a/turbow.sh b/turbow.sh index 99fa9a369c289..8196b9e41f11a 100755 --- a/turbow.sh +++ b/turbow.sh @@ -5,9 +5,9 @@ cd cli && CGO_ENABLED=0 go build ./cmd/turbo/... && cd ..; UNAME=$(uname) if [ "$UNAME" == "Linux" ] ; then - ./cli/turbo $@ + ./cli/turbo $@ elif [ "$UNAME" == "Darwin" ] ; then - ./cli/turbo $@ + ./cli/turbo $@ else - ./cli/turbo.exe $@ + ./cli/turbo.exe $@ fi