@rebasepro/cli 0.12.1-canary.g5f403cf → 0.12.1-canary.g7f1150f

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.es.js CHANGED
@@ -355,8 +355,9 @@ function requireProjectRoot() {
355
355
  const root = findProjectRoot();
356
356
  if (!root) {
357
357
  console.error(chalk.red("✗ Could not find a Rebase project root."));
358
- console.error(chalk.gray(" Make sure you are inside a Rebase project directory"));
359
- console.error(chalk.gray(" (one with backend/, frontend/, and config/ directories)."));
358
+ console.error(chalk.gray(` Looked in this directory and every parent for a ${MANIFEST_FILENAME},`));
359
+ console.error(chalk.gray(" a package.json with a \"backend\" workspace, or a backend/ next to a config/."));
360
+ console.error(chalk.gray(" Run this from inside a project, or create one with `rebase init`."));
360
361
  process.exit(1);
361
362
  }
362
363
  return root;
@@ -1561,6 +1562,11 @@ async function configureEnvFile(targetDirectory, databaseUrl) {
1561
1562
  const dbPassword = crypto.randomBytes(16).toString("hex");
1562
1563
  const serviceKey = crypto.randomBytes(48).toString("base64");
1563
1564
  let envContent = fs.readFileSync(envPath, "utf-8");
1565
+ envContent = envContent.replace(/^(# ║ {2})(Copy this file to \.env and fill in the values)( +║)$/m, (_match, open, old, close) => {
1566
+ const replacement = "Generated by `rebase init` — the secrets below are already set";
1567
+ const width = old.length + close.length - 1;
1568
+ return open + replacement.slice(0, width).padEnd(width, " ") + "║";
1569
+ });
1564
1570
  envContent = envContent.replace(/^JWT_SECRET=.*$/m, `JWT_SECRET=${jwtSecret}`);
1565
1571
  envContent = envContent.replace(/^#\s*REBASE_SERVICE_KEY=.*$/m, `REBASE_SERVICE_KEY=${serviceKey}`);
1566
1572
  const runtimeVersion = readCliVersion();