cronus-ui 0.6.19 → 0.6.20

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/README.md CHANGED
@@ -49,7 +49,7 @@ Notes that match the commander surface:
49
49
  `packages/cli/scripts/build-registry.ts` — each item carries its source, its npm
50
50
  `dependencies`, and its `registryDependencies` (other components it imports),
51
51
  derived by parsing imports.
52
- - The default registry is pinned to the CLI package version (`v0.6.19` here), not
52
+ - The default registry is pinned to the CLI package version (`v0.6.20` here), not
53
53
  mutable `main`, so a published CLI reads the registry snapshot it was released
54
54
  with. Use `-r, --registry ./registry` when testing local registry changes before
55
55
  a release tag exists.
@@ -80,7 +80,7 @@ Notes that match the commander surface:
80
80
  "lib": "lib",
81
81
  "blocks": "components/blocks"
82
82
  },
83
- "registry": "https://raw.githubusercontent.com/pedrogbraz/cronus-ui/v0.6.19/registry"
83
+ "registry": "https://raw.githubusercontent.com/pedrogbraz/cronus-ui/v0.6.20/registry"
84
84
  }
85
85
  ```
86
86
 
@@ -2,6 +2,7 @@
2
2
  * Authenticated gold path for saas/admin compose: SQLite + Drizzle + Better-Auth.
3
3
  * Always sqlite — postgres/mysql live in create-cronus-stack.
4
4
  */
5
+ import { randomBytes } from "node:crypto";
5
6
  import { existsSync } from "node:fs";
6
7
  import { readFile } from "node:fs/promises";
7
8
  import { join } from "node:path";
@@ -66,12 +67,13 @@ const GOLD_PATH_SCRIPTS = {
66
67
  "db:generate": "drizzle-kit generate",
67
68
  "db:studio": "drizzle-kit studio",
68
69
  };
70
+ const ENV_EXAMPLE_SECRET = "change-me-to-a-32-character-secret";
69
71
  const ENV_VARS = {
70
72
  DATABASE_URL: "file:./data/app.db",
71
- BETTER_AUTH_SECRET: "change-me-to-a-32-character-secret",
73
+ BETTER_AUTH_SECRET: ENV_EXAMPLE_SECRET,
72
74
  BETTER_AUTH_URL: "http://localhost:3000",
73
75
  };
74
- const GITIGNORE_ENTRIES = ["*.db", "data/", "drizzle/"];
76
+ const GITIGNORE_ENTRIES = ["*.db", "data/", "drizzle/", ".env"];
75
77
  const DATABASE_URL_FALLBACK = "file:./data/app.db";
76
78
  const TITLE_MAX = 200;
77
79
  export function goldPathLayout(config) {
@@ -1251,6 +1253,21 @@ function mergeNextConfig(raw) {
1251
1253
  }
1252
1254
  return `${raw.trimEnd()}\n`;
1253
1255
  }
1256
+ function envFileBody(secret) {
1257
+ return `${Object.entries({ ...ENV_VARS, BETTER_AUTH_SECRET: secret })
1258
+ .map(([key, value]) => `${key}=${value}`)
1259
+ .join("\n")}\n`;
1260
+ }
1261
+ function newAuthSecret() {
1262
+ return randomBytes(32).toString("hex");
1263
+ }
1264
+ /** Write `.env` once so first `bun dev` has a real Better Auth secret. Never overwrite. */
1265
+ async function writeDotEnvIfMissing(targetDir) {
1266
+ const dest = resolveSafeDest(targetDir, ".", ".env");
1267
+ if (existsSync(dest))
1268
+ return;
1269
+ await writeFileEnsured(dest, envFileBody(newAuthSecret()));
1270
+ }
1254
1271
  function mergeEnvExample(raw) {
1255
1272
  const lines = raw.split(/\r?\n/);
1256
1273
  const keys = new Set(lines.map((line) => {
@@ -1463,9 +1480,8 @@ export async function applyGoldPath(options) {
1463
1480
  }
1464
1481
  await mergeTextFile(targetDir, "package.json", mergePackageJson);
1465
1482
  await mergeOrCreate(targetDir, "next.config.mjs", nextConfigSource(), mergeNextConfig);
1466
- await mergeOrCreate(targetDir, ".env.example", `${Object.entries(ENV_VARS)
1467
- .map(([k, v]) => `${k}=${v}`)
1468
- .join("\n")}\n`, mergeEnvExample);
1483
+ await mergeOrCreate(targetDir, ".env.example", envFileBody(ENV_EXAMPLE_SECRET), mergeEnvExample);
1484
+ await writeDotEnvIfMissing(targetDir);
1469
1485
  await mergeOrCreate(targetDir, ".gitignore", `${GITIGNORE_ENTRIES.join("\n")}\n`, mergeGitignore);
1470
1486
  return { written, skipped };
1471
1487
  }
package/dist/config.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  export declare const CONFIG_FILE = "cronus-ui.json";
2
- export declare const CLI_VERSION = "0.6.19";
3
- export declare const DEFAULT_REGISTRY = "https://raw.githubusercontent.com/pedrogbraz/cronus-ui/v0.6.19/registry";
2
+ export declare const CLI_VERSION = "0.6.20";
3
+ export declare const DEFAULT_REGISTRY = "https://raw.githubusercontent.com/pedrogbraz/cronus-ui/v0.6.20/registry";
4
4
  /** Manifest entry `add`/`upgrade` record per installed registry item. */
5
5
  export interface InstalledRecord {
6
6
  /** Registry release the files came from (git tag without the leading "v"). */
package/dist/config.js CHANGED
@@ -2,7 +2,7 @@ import { existsSync } from "node:fs";
2
2
  import { readFile, writeFile } from "node:fs/promises";
3
3
  import { join } from "node:path";
4
4
  export const CONFIG_FILE = "cronus-ui.json";
5
- export const CLI_VERSION = "0.6.19";
5
+ export const CLI_VERSION = "0.6.20";
6
6
  export const DEFAULT_REGISTRY = `https://raw.githubusercontent.com/pedrogbraz/cronus-ui/v${CLI_VERSION}/registry`;
7
7
  export const DEFAULT_CONFIG = {
8
8
  aliases: { ui: "@/components/ui", lib: "@/lib", blocks: "@/components/blocks" },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cronus-ui",
3
- "version": "0.6.19",
3
+ "version": "0.6.20",
4
4
  "description": "cronus-ui — add Cronus UI components to your project, shadcn-style (copy-paste registry).",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -54,7 +54,7 @@
54
54
  "registry:check": "bun run scripts/check-registry.ts"
55
55
  },
56
56
  "dependencies": {
57
- "@cronus-ui/ai-kit": "0.6.19",
57
+ "@cronus-ui/ai-kit": "0.6.20",
58
58
  "commander": "^15.0.0",
59
59
  "picocolors": "^1.1.1"
60
60
  },