diff --git a/examples/basic/README.md b/examples/basic/README.md index 1574369ee275d..4b760734cdec1 100644 --- a/examples/basic/README.md +++ b/examples/basic/README.md @@ -1,6 +1,6 @@ # Turborepo starter -This is an official starter Turborepo. +This Turborepo starter is maintained by the Turborepo core team. ## Using this example diff --git a/examples/basic/meta.json b/examples/basic/meta.json new file mode 100644 index 0000000000000..6fe74c6154b4f --- /dev/null +++ b/examples/basic/meta.json @@ -0,0 +1,3 @@ +{ + "maintainedByCoreTeam": true +} diff --git a/examples/design-system/README.md b/examples/design-system/README.md index e998f547c4552..cc3647d2147ac 100644 --- a/examples/design-system/README.md +++ b/examples/design-system/README.md @@ -1,5 +1,7 @@ # Turborepo Design System Starter +This is a community-maintained example. If you experience a problem, please submit a pull request with a fix. GitHub Issues will be closed. + This guide explains how to use a React design system starter powered by: - 🏎 [Turborepo](https://turbo.build/repo) — High-performance build system for Monorepos diff --git a/examples/kitchen-sink/README.md b/examples/kitchen-sink/README.md index 86b80b2e30c69..a64ed9673729e 100644 --- a/examples/kitchen-sink/README.md +++ b/examples/kitchen-sink/README.md @@ -1,6 +1,6 @@ # Turborepo kitchen sink starter -This is an official starter Turborepo with multiple meta-frameworks all working in harmony and sharing packages. +This Turborepo starter is maintained by the Turborepo core team. This example also shows how to use [Workspace Configurations](https://turbo.build/repo/docs/core-concepts/monorepos/configuring-workspaces). diff --git a/examples/kitchen-sink/meta.json b/examples/kitchen-sink/meta.json index c22c4add8982a..e37d37aadf75c 100644 --- a/examples/kitchen-sink/meta.json +++ b/examples/kitchen-sink/meta.json @@ -2,5 +2,6 @@ "name": "Kitchen Sink", "description": "Want to see a more in-depth example? Includes multiple frameworks, both frontend and backend.", "template": "https://vercel.com/templates/remix/turborepo-kitchensink", - "featured": true + "featured": true, + "maintainedByCoreTeam": true } diff --git a/examples/non-monorepo/README.md b/examples/non-monorepo/README.md index ba2ecaf3decc6..660ebc9a4b802 100644 --- a/examples/non-monorepo/README.md +++ b/examples/non-monorepo/README.md @@ -1,6 +1,6 @@ # Turborepo non-monorepo starter -This is an official starter Turborepo. +This Turborepo starter is maintained by the Turborepo core team. ## Using this example diff --git a/examples/non-monorepo/meta.json b/examples/non-monorepo/meta.json index 1f86ba8f43391..15e7bd8ed1051 100644 --- a/examples/non-monorepo/meta.json +++ b/examples/non-monorepo/meta.json @@ -1,4 +1,5 @@ { "name": "Non-Monorepo", - "description": "Example of using Turborepo in a single project without workspaces" + "description": "Example of using Turborepo in a single project without workspaces", + "maintainedByCoreTeam": true } diff --git a/examples/with-angular/README.md b/examples/with-angular/README.md index d9e0240e2c804..5f6621fa36f68 100644 --- a/examples/with-angular/README.md +++ b/examples/with-angular/README.md @@ -1,6 +1,6 @@ # Turborepo starter -This is an official starter Turborepo. +This is a community-maintained example. If you experience a problem, please submit a pull request with a fix. GitHub Issues will be closed. ## Using this example diff --git a/examples/with-berry/README.md b/examples/with-berry/README.md index a673472d05cbb..3ff531c164ce3 100644 --- a/examples/with-berry/README.md +++ b/examples/with-berry/README.md @@ -1,6 +1,6 @@ # Turborepo starter with berry (yarn v2+) -This is an official starter Turborepo. +This is a community-maintained example. If you experience a problem, please submit a pull request with a fix. GitHub Issues will be closed. ## Using this example diff --git a/examples/with-changesets/README.md b/examples/with-changesets/README.md index 054de28193503..f81d8d11f75ac 100644 --- a/examples/with-changesets/README.md +++ b/examples/with-changesets/README.md @@ -1,6 +1,6 @@ # Turborepo Design System starter with Changesets -This is an official React design system starter powered by Turborepo. Versioning and package publishing is handled by [Changesets](https://github.com/changesets/changesets) and fully automated with GitHub Actions. +This is a community-maintained example. If you experience a problem, please submit a pull request with a fix. GitHub Issues will be closed. ## Using this example diff --git a/examples/with-docker/README.md b/examples/with-docker/README.md index 30af65ee28f8c..7e95361cac609 100644 --- a/examples/with-docker/README.md +++ b/examples/with-docker/README.md @@ -1,6 +1,6 @@ # Turborepo Docker starter -This is an official Docker starter Turborepo. +This is a community-maintained example. If you experience a problem, please submit a pull request with a fix. GitHub Issues will be closed. ## Using this example diff --git a/examples/with-gatsby/README.md b/examples/with-gatsby/README.md index 2c21e9164e190..0a3b196152f4e 100644 --- a/examples/with-gatsby/README.md +++ b/examples/with-gatsby/README.md @@ -1,6 +1,6 @@ # Turborepo Gatsby.js starter -This is an official starter turborepo. +This is a community-maintained example. If you experience a problem, please submit a pull request with a fix. GitHub Issues will be closed. ## Using this example diff --git a/examples/with-nestjs/README.md b/examples/with-nestjs/README.md index 1b784eb4bddce..9f25bd8f8ec43 100644 --- a/examples/with-nestjs/README.md +++ b/examples/with-nestjs/README.md @@ -1,6 +1,6 @@ # Turborepo starter -This is an official starter Turborepo. +This is a community-maintained example. If you experience a problem, please submit a pull request with a fix. GitHub Issues will be closed. ## Using this example diff --git a/examples/with-npm/README.md b/examples/with-npm/README.md index 767ace78589d6..9657655014c45 100644 --- a/examples/with-npm/README.md +++ b/examples/with-npm/README.md @@ -1,6 +1,6 @@ # Turborepo starter -This is an official starter Turborepo. +This is a community-maintained example. If you experience a problem, please submit a pull request with a fix. GitHub Issues will be closed. ## Using this example diff --git a/examples/with-prisma/README.md b/examples/with-prisma/README.md index b7a2231ec1f06..8c3f5a899ae38 100644 --- a/examples/with-prisma/README.md +++ b/examples/with-prisma/README.md @@ -1,6 +1,6 @@ # Turborepo starter -This is an official starter turborepo. +This is a community-maintained example. If you experience a problem, please submit a pull request with a fix. GitHub Issues will be closed. ## Using this example diff --git a/examples/with-react-native-web/README.md b/examples/with-react-native-web/README.md index e558499100534..b9dcd63e331d6 100644 --- a/examples/with-react-native-web/README.md +++ b/examples/with-react-native-web/README.md @@ -1,6 +1,6 @@ # Turborepo react-native starter -This is an official starter Turborepo. +This is a community-maintained example. If you experience a problem, please submit a pull request with a fix. GitHub Issues will be closed. ## Using this example diff --git a/examples/with-rollup/README.md b/examples/with-rollup/README.md index 869aeb88efa25..f12727c201d15 100644 --- a/examples/with-rollup/README.md +++ b/examples/with-rollup/README.md @@ -1,6 +1,6 @@ # Turborepo starter with Rollup -This is an official starter Turborepo, showing how Turborepo can be used with Rollup for bundling a `ui` package. +This is a community-maintained example. If you experience a problem, please submit a pull request with a fix. GitHub Issues will be closed. ## Using this example diff --git a/examples/with-shell-commands/README.md b/examples/with-shell-commands/README.md index ccb6e778c7304..3083e486d051c 100644 --- a/examples/with-shell-commands/README.md +++ b/examples/with-shell-commands/README.md @@ -1,6 +1,6 @@ # Turborepo starter with shell commands -This is an official starter Turborepo meant for debugging, learning, and exploring. +This Turborepo starter is maintained by the Turborepo core team. This template is great for issue reproductions and exploring building task graphs without frameworks. ## Using this example diff --git a/examples/with-shell-commands/meta.json b/examples/with-shell-commands/meta.json new file mode 100644 index 0000000000000..6fe74c6154b4f --- /dev/null +++ b/examples/with-shell-commands/meta.json @@ -0,0 +1,3 @@ +{ + "maintainedByCoreTeam": true +} diff --git a/examples/with-svelte/README.md b/examples/with-svelte/README.md index 8b8478b2529f8..016d2adf01ffb 100644 --- a/examples/with-svelte/README.md +++ b/examples/with-svelte/README.md @@ -1,6 +1,6 @@ # Turborepo Svelte starter -This is an official starter Turborepo. +This Turborepo starter is maintained by the Turborepo core team. ## Using this example diff --git a/examples/with-svelte/meta.json b/examples/with-svelte/meta.json index 65006670716f2..883164b3d7623 100644 --- a/examples/with-svelte/meta.json +++ b/examples/with-svelte/meta.json @@ -3,5 +3,6 @@ "description": "Monorepo with multiple SvelteKit apps sharing a UI Library", "featured": true, "template": "https://vercel.com/templates/svelte/turborepo-sveltekit-starter", - "boost": true + "boost": true, + "maintainedByCoreTeam": true } diff --git a/examples/with-tailwind/README.md b/examples/with-tailwind/README.md index d37ac23897c6d..aaeb2865901c7 100644 --- a/examples/with-tailwind/README.md +++ b/examples/with-tailwind/README.md @@ -1,6 +1,6 @@ # Turborepo Tailwind CSS starter -This is an official starter Turborepo. +This Turborepo starter is maintained by the Turborepo core team. ## Using this example diff --git a/examples/with-tailwind/meta.json b/examples/with-tailwind/meta.json index d1ce579e73a53..6a40dcd63abba 100644 --- a/examples/with-tailwind/meta.json +++ b/examples/with-tailwind/meta.json @@ -1,5 +1,6 @@ { "name": "Tailwind CSS", "description": "Monorepo with multiple Next.js apps sharing a UI Library all using Tailwind CSS with a shared config", - "featured": true + "featured": true, + "maintainedByCoreTeam": true } diff --git a/examples/with-typeorm/README.md b/examples/with-typeorm/README.md index a5615401e7232..be0242a6ab93c 100644 --- a/examples/with-typeorm/README.md +++ b/examples/with-typeorm/README.md @@ -1,6 +1,6 @@ # Turborepo with TypeORM -This is an official starter Turborepo configured with TypeORM to manage the service layer in a monorepo setup. +This is a community-maintained example. If you experience a problem, please submit a pull request with a fix. GitHub Issues will be closed. ## What's inside? diff --git a/examples/with-vite/README.md b/examples/with-vite/README.md index 88e40c4a31294..df10b9b43fc56 100644 --- a/examples/with-vite/README.md +++ b/examples/with-vite/README.md @@ -1,6 +1,6 @@ # `Turborepo` Vite starter -This is an official starter Turborepo. +This is a community-maintained example. If you experience a problem, please submit a pull request with a fix. GitHub Issues will be closed. ## Using this example diff --git a/examples/with-vue-nuxt/README.md b/examples/with-vue-nuxt/README.md index 74beeb1742c66..11a4349e057f2 100644 --- a/examples/with-vue-nuxt/README.md +++ b/examples/with-vue-nuxt/README.md @@ -1,6 +1,6 @@ # Turborepo VueJS/NuxtJS starter -This is an official starter Turborepo. +This is a community-maintained example. If you experience a problem, please submit a pull request with a fix. GitHub Issues will be closed. ## Using this example diff --git a/examples/with-yarn/README.md b/examples/with-yarn/README.md index 5d057a7c2438b..2f223eb5e5938 100644 --- a/examples/with-yarn/README.md +++ b/examples/with-yarn/README.md @@ -1,6 +1,6 @@ # Turborepo starter -This is an official starter Turborepo. +This is a community-maintained example. If you experience a problem, please submit a pull request with a fix. GitHub Issues will be closed. ## Using this example diff --git a/packages/create-turbo/src/commands/create/index.ts b/packages/create-turbo/src/commands/create/index.ts index 592cd21d00968..b1a1afab6ea13 100644 --- a/packages/create-turbo/src/commands/create/index.ts +++ b/packages/create-turbo/src/commands/create/index.ts @@ -1,5 +1,5 @@ import path from "node:path"; -import { bold, red, cyan, green } from "picocolors"; +import { bold, red, cyan, green, dim } from "picocolors"; import type { Project } from "@turbo/workspaces"; import { getWorkspaceDetails, @@ -76,6 +76,8 @@ export async function create( opts.telemetry?.trackArgumentDirectory(Boolean(directory)); trackOptions(opts); + let isMaintainedByCoreTeam = false; + const { packageManager, skipInstall, skipTransforms } = opts; const [online, availablePackageManagers] = await Promise.all([ @@ -159,6 +161,10 @@ export async function create( `feat(create-turbo): apply ${transformResult.name} transform` ); } + + if (transformResult.metaJson?.maintainedByCoreTeam) { + isMaintainedByCoreTeam = true; + } } catch (err) { handleErrors(err, opts.telemetry); } @@ -256,6 +262,15 @@ export async function create( ); } + if (!isMaintainedByCoreTeam) { + logger.log(); + logger.log( + dim( + "Note: This is a community-maintained example. If you experience a problem, please submit a pull request with a fix. GitHub Issues will be closed." + ) + ); + } + // get the package manager details so we display the right commands to the user in log messages const packageManagerMeta = getPackageManagerMeta(projectPackageManager); if (packageManagerMeta && hasPackageJson) { @@ -285,5 +300,6 @@ export async function create( }); logger.log("- Run a command twice to hit cache"); } + opts.telemetry?.trackCommandStatus({ command: "create", status: "end" }); } diff --git a/packages/create-turbo/src/transforms/official-starter.ts b/packages/create-turbo/src/transforms/official-starter.ts index ea31aa4033700..e5af370453c5c 100644 --- a/packages/create-turbo/src/transforms/official-starter.ts +++ b/packages/create-turbo/src/transforms/official-starter.ts @@ -2,7 +2,7 @@ import path from "node:path"; import { readJsonSync, writeJsonSync, rmSync, existsSync } from "fs-extra"; import type { PackageJson } from "@turbo/utils"; import { isDefaultExample } from "../utils/isDefaultExample"; -import type { TransformInput, TransformResult } from "./types"; +import type { TransformInput, TransformResult, MetaJson } from "./types"; import { TransformError } from "./errors"; const meta = { @@ -18,9 +18,10 @@ export async function transform(args: TransformInput): TransformResult { const { prompts, example, opts } = args; const defaultExample = isDefaultExample(example.name); - const isOfficialStarter = - !example.repo || - (example.repo.username === "vercel" && example.repo.name === "turbo"); + const isThisRepo = + example.repo && + (example.repo.name === "turborepo" || example.repo.name === "turbo"); + const isOfficialStarter = example.repo?.username === "vercel" && isThisRepo; if (!isOfficialStarter) { return { result: "not-applicable", ...meta }; @@ -31,8 +32,11 @@ export async function transform(args: TransformInput): TransformResult { const rootMetaJsonPath = path.join(prompts.root, "meta.json"); const hasPackageJson = existsSync(rootPackageJsonPath); + let metaJson: MetaJson | undefined; + // 1. remove meta file (used for generating the examples page on turbo.build) try { + metaJson = readJsonSync(rootMetaJsonPath) as MetaJson; rmSync(rootMetaJsonPath, { force: true }); } catch (_err) { // do nothing @@ -83,5 +87,5 @@ export async function transform(args: TransformInput): TransformResult { } } - return { result: "success", ...meta }; + return { result: "success", metaJson, ...meta }; } diff --git a/packages/create-turbo/src/transforms/types.ts b/packages/create-turbo/src/transforms/types.ts index cb28c10c20972..233c97190de1d 100644 --- a/packages/create-turbo/src/transforms/types.ts +++ b/packages/create-turbo/src/transforms/types.ts @@ -21,10 +21,20 @@ export interface TransformInput { opts: CreateCommandOptions; } +export interface MetaJson { + maintainedByCoreTeam?: string; + name?: string; + description?: string; + featured?: boolean; + boost?: boolean; + template?: boolean; +} + export interface TransformResponse { // errors should be thrown as instances of TransformError result: "not-applicable" | "success"; name: string; + metaJson?: MetaJson; } export type TransformResult = Promise;