cronus-ui 0.6.15 → 0.6.16

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.15` here), not
52
+ - The default registry is pinned to the CLI package version (`v0.6.16` 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.15/registry"
83
+ "registry": "https://raw.githubusercontent.com/pedrogbraz/cronus-ui/v0.6.16/registry"
84
84
  }
85
85
  ```
86
86
 
@@ -20,7 +20,7 @@
20
20
  */
21
21
  import { existsSync } from "node:fs";
22
22
  import { rm } from "node:fs/promises";
23
- import { isGoldPathTemplate, patchChromeSource } from "../compose/gold-path.js";
23
+ import { goldPatchAppShellChrome, isGoldPathTemplate } from "../compose/gold-path.js";
24
24
  import { blockRefParts } from "../compose/manifest.js";
25
25
  import { buildComposePlan, ComposePlanError, } from "../compose/plan.js";
26
26
  import { baseSnapshotDir, reloadManifest } from "../compose/reload.js";
@@ -283,7 +283,7 @@ export async function addPage(options) {
283
283
  // restore Mara + WORKSPACES. Re-apply the same idempotent patch so --nav
284
284
  // grows the sidebar without undoing the authenticated shell.
285
285
  if (isGoldPathTemplate(appName) && slug === "app-shell-chrome") {
286
- const patched = patchChromeSource(content, "@/components/workspace-menu", "@/components/invite-member", "@/components/session-user");
286
+ const patched = goldPatchAppShellChrome(content);
287
287
  if (patched !== undefined)
288
288
  content = patched;
289
289
  }
@@ -5,6 +5,7 @@ import { tmpdir } from "node:os";
5
5
  import { join } from "node:path";
6
6
  import { createInterface } from "node:readline/promises";
7
7
  import pc from "picocolors";
8
+ import { goldPatchAppShellChrome, isGoldPathTemplate } from "../compose/gold-path.js";
8
9
  import { buildComposePlan } from "../compose/plan.js";
9
10
  import { baseSnapshotDest, filterManifestToComposedPages, listBaseSnapshotRels, readBaseSnapshot, reloadManifest, } from "../compose/reload.js";
10
11
  import { renderPlan } from "../compose/render.js";
@@ -420,6 +421,33 @@ function statusLabel(plan) {
420
421
  return plan.status;
421
422
  }
422
423
  }
424
+ /**
425
+ * saas/admin: upgrade 3-ways app-shell-chrome against the catalog item (Mara).
426
+ * After any write (or a catalog file already on disk), re-apply the gold-path
427
+ * chrome identity. Idempotent; skipped when conflict markers are present.
428
+ */
429
+ async function repatchGoldPathChrome(cwd, config, composed) {
430
+ if (!Object.keys(composed).some((key) => isGoldPathTemplate(key)))
431
+ return;
432
+ const rel = join(config.paths.blocks, "app-shell-chrome.tsx");
433
+ let dest;
434
+ try {
435
+ dest = resolveSafeDest(cwd, ".", rel);
436
+ }
437
+ catch {
438
+ return;
439
+ }
440
+ if (!existsSync(dest))
441
+ return;
442
+ const current = await readFile(dest, "utf8");
443
+ if (current.includes("<<<<<<<"))
444
+ return;
445
+ const patched = goldPatchAppShellChrome(current);
446
+ if (patched === undefined || patched === current)
447
+ return;
448
+ await writeFileEnsured(dest, patched);
449
+ log.ok(`gold-path ${rel}: re-applied WorkspaceMenu / InviteMember / SessionUser`);
450
+ }
423
451
  /** Statuses that write the planned content to disk unconditionally. */
424
452
  const WRITE_STATUSES = new Set(["fast-forward", "new-file", "merged"]);
425
453
  function fileWasWritten(plan) {
@@ -772,6 +800,7 @@ export async function upgrade(names, options) {
772
800
  const newlyInstalled = await installPendingBlocks(itemPlans, config, cwd, targetVersion);
773
801
  Object.assign(installed, newlyInstalled);
774
802
  const written = await applyPlans(itemPlans, options, confirm);
803
+ await repatchGoldPathChrome(cwd, config, composed);
775
804
  await refreshComposeSnapshots(itemPlans);
776
805
  // Manifest: record every item that now fully embodies the target release.
777
806
  // Compose items update `composed{}` (never `installed{}`) and never drop
@@ -5,6 +5,11 @@
5
5
  import type { CronusUIConfig } from "../config.js";
6
6
  export declare const GOLD_PATH_TEMPLATES: Set<string>;
7
7
  export declare function isGoldPathTemplate(name: string): boolean;
8
+ /**
9
+ * Re-apply WorkspaceMenu / InviteMember / SessionUser onto catalog app-shell-chrome.
10
+ * Idempotent. Used by add-page --nav and upgrade so neither restores Mara.
11
+ */
12
+ export declare function goldPatchAppShellChrome(source: string): string | undefined;
8
13
  /** Production npm specs installed with the gold path (devDeps are merged into package.json). */
9
14
  export declare const GOLD_PATH_DEPENDENCIES: readonly ["drizzle-orm@^0.45.2", "better-sqlite3@^12.0.0", "better-auth@^1.7.2"];
10
15
  export interface GoldPathLayout {
@@ -11,6 +11,17 @@ export const GOLD_PATH_TEMPLATES = new Set(["saas", "admin"]);
11
11
  export function isGoldPathTemplate(name) {
12
12
  return GOLD_PATH_TEMPLATES.has(name);
13
13
  }
14
+ /** Gold-path chrome identity — same strings compose writes into app-shell-chrome. */
15
+ const GOLD_WORKSPACE_IMPORT = "@/components/workspace-menu";
16
+ const GOLD_INVITE_IMPORT = "@/components/invite-member";
17
+ const GOLD_SESSION_IMPORT = "@/components/session-user";
18
+ /**
19
+ * Re-apply WorkspaceMenu / InviteMember / SessionUser onto catalog app-shell-chrome.
20
+ * Idempotent. Used by add-page --nav and upgrade so neither restores Mara.
21
+ */
22
+ export function goldPatchAppShellChrome(source) {
23
+ return patchChromeSource(source, GOLD_WORKSPACE_IMPORT, GOLD_INVITE_IMPORT, GOLD_SESSION_IMPORT);
24
+ }
14
25
  /** Production npm specs installed with the gold path (devDeps are merged into package.json). */
15
26
  export const GOLD_PATH_DEPENDENCIES = [
16
27
  "drizzle-orm@^0.45.2",
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.15";
3
- export declare const DEFAULT_REGISTRY = "https://raw.githubusercontent.com/pedrogbraz/cronus-ui/v0.6.15/registry";
2
+ export declare const CLI_VERSION = "0.6.16";
3
+ export declare const DEFAULT_REGISTRY = "https://raw.githubusercontent.com/pedrogbraz/cronus-ui/v0.6.16/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.15";
5
+ export const CLI_VERSION = "0.6.16";
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.15",
3
+ "version": "0.6.16",
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.15",
57
+ "@cronus-ui/ai-kit": "0.6.16",
58
58
  "commander": "^15.0.0",
59
59
  "picocolors": "^1.1.1"
60
60
  },