UNPKG

neondb

Version:

create a claimable Neon database in seconds!

67 lines (57 loc) 2.83 kB
import { DEFAULTS } from './utils/args.js'; const INTRO_ART = ` \u259F\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2599 \u2588\u2588 \u2588\u2588 \u2588\u2588 \u2597\u2585\u2596 \u2588\u2588 https://neon.com \u2588\u2588 \u2588\u2588\u2588\u2588\u2599 \u2588\u2588 \u251C\u2500\u2500 /docs \u2588\u2588 \u2588\u2588 \u259C\u2588\u2588\u2588\u2588 \u2514\u2500\u2500 /discord \u2588\u2588 \u2588\u2588 \u259C\u2588\u259B \u259C\u2588\u2588\u2588\u2588\u2588\u2588\u259B `; const messages = { /** * these messages must be short and concise * exceeding 2 lines trigger a rendering issue * in @clack/prompts * * @see https://github.com/bombshell-dev/clack/issues/132 */ welcome: "Welcome! Let's get you set with a Postgres database on Neon. \n", generating: "Generating your database... ", envKeyExistsExit: "Please try again or select a different key for your connection string.", connectionString: (s) => `Connection string: ${s}`, poolerString: (s) => `Pooler string: ${s}`, botCheck: (url) => `A tab will open in your browser just to check your're not a bot. Paste the link below in your browser if it doesn't open automatically: ${url} `, envSuccess: (dotEnvFile, dotEnvKey) => `Saved it to ${dotEnvFile} as ${dotEnvKey} `, happyCoding: "Happy coding! \u{1F680}", databaseGenerated: (url) => `Claim your Database at: ${url}`, questions: { dotEnvFilePath: `Enter the path to your environment file (default: ${DEFAULTS.dotEnvPath})`, dotEnvKey: `Enter the key for the database connection string (default: ${DEFAULTS.dotEnvKey})`, seedPath: `Enter the path to your seed (.sql) file (default: ${DEFAULTS.seed?.path || "none"})` }, info: { dotEnvFileNotFound: "No .env file found, creating one.", userCancelled: "Prompt cancelled by user.", defaultEnvKey: (dotEnvKey) => `using ${dotEnvKey} as the environment variable key`, defaultEnvFilePath: (dotEnvPath) => `using ${dotEnvPath} as the .env file` }, errors: { invalidEnvFile: "Invalid .env file format \n", envKeyExists: (dotEnvKey, dotEnvFile) => `${dotEnvKey} already exists in ${dotEnvFile}`, failedToParseEnvFile: "Failed to parse .env file", failedToWriteEnvFile: "Failed to write .env file", failedToGenerateDatabase: "Failed to generate database", failedToOpenBrowser: "Failed to open browser", failedToCreateClaimableDatabase: "Failed to create claimable database", failedToCreatePoolerString: "Failed to create pooler string", failedToSaveConnectionString: "Failed to save connection string", failedToSavePoolerString: "Failed to save pooler string", failedToSaveEnvFile: "Failed to save .env file" } }; export { INTRO_ART, messages };