| 5 | import { logger } from "./logger.js"; |
| 6 | |
| 7 | export const renderVersionWarning = (npmVersion: string) => { |
| 8 | const currentVersion = getVersion(); |
| 9 | |
| 10 | // console.log("current", currentVersion); |
| 11 | // console.log("npm", npmVersion); |
| 12 | |
| 13 | if (currentVersion.includes("beta")) { |
| 14 | logger.warn(" You are using a beta version of create-t3-app."); |
| 15 | logger.warn(" Please report any bugs you encounter."); |
| 16 | } else if (currentVersion.includes("next")) { |
| 17 | logger.warn( |
| 18 | " You are running create-t3-app with the @next tag which is no longer maintained." |
| 19 | ); |
| 20 | logger.warn(" Please run the CLI with @latest instead."); |
| 21 | } else if (currentVersion !== npmVersion) { |
| 22 | logger.warn(" You are using an outdated version of create-t3-app."); |
| 23 | logger.warn( |
| 24 | " Your version:", |
| 25 | currentVersion + ".", |
| 26 | "Latest version in the npm registry:", |
| 27 | npmVersion |
| 28 | ); |
| 29 | logger.warn(" Please run the CLI with @latest to get the latest updates."); |
| 30 | } |
| 31 | console.log(""); |
| 32 | }; |
| 33 | |
| 34 | /** |
| 35 | * Copyright (c) 2015-present, Facebook, Inc. |