cronus-ui 0.7.1 → 0.7.3
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 +2 -2
- package/dist/commands/upgrade.js +3 -1
- package/dist/compose/gold-path.d.ts +8 -1
- package/dist/compose/gold-path.js +30 -2
- package/dist/config.d.ts +2 -2
- package/dist/config.js +1 -1
- package/package.json +2 -2
- package/templates/apps/saas.json +1 -1
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.7.
|
|
52
|
+
- The default registry is pinned to the CLI package version (`v0.7.3` 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.7.
|
|
83
|
+
"registry": "https://raw.githubusercontent.com/pedrogbraz/cronus-ui/v0.7.3/registry"
|
|
84
84
|
}
|
|
85
85
|
```
|
|
86
86
|
|
package/dist/commands/upgrade.js
CHANGED
|
@@ -5,7 +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 { GOLD_PATH_AUTH_SPLIT_FILES, goldPatchAppShellChrome, goldPatchHomePage, goldPatchShellLayout, goldPatchTeamPage, isGoldPathTemplate, patchGoldPathAuthSplit, reemitGoldPathOwned, } from "../compose/gold-path.js";
|
|
8
|
+
import { GOLD_PATH_AUTH_SPLIT_FILES, goldPatchAppShellChrome, goldPatchHomePage, goldPatchShellLayout, goldPatchTeamPage, goldPathLayout, isGoldPathTemplate, patchGoldPathAccountIssuer, patchGoldPathAuthSplit, reemitGoldPathOwned, } from "../compose/gold-path.js";
|
|
9
9
|
import { buildComposePlan } from "../compose/plan.js";
|
|
10
10
|
import { baseSnapshotDest, filterManifestToComposedPages, listBaseSnapshotRels, readBaseSnapshot, reloadManifest, } from "../compose/reload.js";
|
|
11
11
|
import { renderPlan } from "../compose/render.js";
|
|
@@ -484,6 +484,8 @@ async function repatchGoldPathSurfaces(cwd, config, composed) {
|
|
|
484
484
|
if (!Object.keys(composed).some((key) => isGoldPathTemplate(key)))
|
|
485
485
|
return;
|
|
486
486
|
const authImport = `${config.aliases.lib}/auth`;
|
|
487
|
+
const layout = goldPathLayout(config);
|
|
488
|
+
await repatchGoldPathFile(cwd, `${layout.dbDir}/schema.ts`, patchGoldPathAccountIssuer, "account.issuer nullable");
|
|
487
489
|
await repatchGoldPathFile(cwd, join(config.paths.blocks, "app-shell-chrome.tsx"), goldPatchAppShellChrome, "WorkspaceMenu / InviteMember / SessionUser / nav / notifications");
|
|
488
490
|
for (const file of GOLD_PATH_AUTH_SPLIT_FILES) {
|
|
489
491
|
await repatchGoldPathFile(cwd, join(config.paths.blocks, file), patchGoldPathAuthSplit, "auth split without Dana Reyes");
|
|
@@ -13,7 +13,7 @@ export declare function isGoldPathTemplate(name: string): boolean;
|
|
|
13
13
|
*/
|
|
14
14
|
export declare function goldPatchAppShellChrome(source: string): string | undefined;
|
|
15
15
|
/** Installed split-auth copies compose writes for saas/admin. */
|
|
16
|
-
export declare const GOLD_PATH_AUTH_SPLIT_FILES: readonly ["login-split.tsx", "signup-split.tsx", "forgot-password-split.tsx"];
|
|
16
|
+
export declare const GOLD_PATH_AUTH_SPLIT_FILES: readonly ["login-split.tsx", "signup-split.tsx", "forgot-password-split.tsx", "otp-split.tsx"];
|
|
17
17
|
/**
|
|
18
18
|
* Re-apply the session gate onto a catalog shell layout.
|
|
19
19
|
* Idempotent. Used by add-page (new shell group) and upgrade.
|
|
@@ -58,6 +58,13 @@ export declare function goldPathLayout(config: CronusUIConfig): GoldPathLayout;
|
|
|
58
58
|
* is not an already-stripped gold-path split.
|
|
59
59
|
*/
|
|
60
60
|
export declare function patchGoldPathAuthSplit(source: string): string | undefined;
|
|
61
|
+
/**
|
|
62
|
+
* Drop `.notNull()` on `account.issuer`. Better Auth 1.7.3 never writes the
|
|
63
|
+
* column and refuses a required one (`SCHEMA_MISMATCH`). Idempotent. Does not
|
|
64
|
+
* rewrite the rest of a user-owned schema — used by compose and `upgrade --all`
|
|
65
|
+
* so 0.7.1 apps pick up the fix without losing hand edits.
|
|
66
|
+
*/
|
|
67
|
+
export declare function patchGoldPathAccountIssuer(source: string): string | undefined;
|
|
61
68
|
/** Remove the no-op Notifications Bell from gold-path chrome. Idempotent. */
|
|
62
69
|
export declare function patchGoldPathChromeNotifications(source: string): string | undefined;
|
|
63
70
|
/**
|
|
@@ -33,6 +33,7 @@ export const GOLD_PATH_AUTH_SPLIT_FILES = [
|
|
|
33
33
|
"login-split.tsx",
|
|
34
34
|
"signup-split.tsx",
|
|
35
35
|
"forgot-password-split.tsx",
|
|
36
|
+
"otp-split.tsx",
|
|
36
37
|
];
|
|
37
38
|
/**
|
|
38
39
|
* Re-apply the session gate onto a catalog shell layout.
|
|
@@ -187,7 +188,7 @@ export const session = sqliteTable("session", {
|
|
|
187
188
|
|
|
188
189
|
export const account = sqliteTable("account", {
|
|
189
190
|
id: text("id").primaryKey(),
|
|
190
|
-
issuer: text("issuer")
|
|
191
|
+
issuer: text("issuer"),
|
|
191
192
|
accountId: text("account_id").notNull(),
|
|
192
193
|
providerId: text("provider_id").notNull(),
|
|
193
194
|
userId: text("user_id")
|
|
@@ -1145,7 +1146,8 @@ export function patchGoldPathAuthSplit(source) {
|
|
|
1145
1146
|
if (source.includes("Sign in to your Cronus workspace") ||
|
|
1146
1147
|
source.includes("Create your Cronus workspace") ||
|
|
1147
1148
|
source.includes("Join the workspace") ||
|
|
1148
|
-
source.includes("Check your inbox")
|
|
1149
|
+
source.includes("Check your inbox") ||
|
|
1150
|
+
source.includes("Enter the code to continue in your Cronus workspace")) {
|
|
1149
1151
|
return source;
|
|
1150
1152
|
}
|
|
1151
1153
|
return undefined;
|
|
@@ -1161,6 +1163,18 @@ export function patchGoldPathAuthSplit(source) {
|
|
|
1161
1163
|
out = dropUnusedFromImport(out, "@cronus-ui/ui");
|
|
1162
1164
|
return out;
|
|
1163
1165
|
}
|
|
1166
|
+
/**
|
|
1167
|
+
* Drop `.notNull()` on `account.issuer`. Better Auth 1.7.3 never writes the
|
|
1168
|
+
* column and refuses a required one (`SCHEMA_MISMATCH`). Idempotent. Does not
|
|
1169
|
+
* rewrite the rest of a user-owned schema — used by compose and `upgrade --all`
|
|
1170
|
+
* so 0.7.1 apps pick up the fix without losing hand edits.
|
|
1171
|
+
*/
|
|
1172
|
+
export function patchGoldPathAccountIssuer(source) {
|
|
1173
|
+
const next = source.replace(/(issuer:\s*(?:text|varchar)\([^)]*\))\s*\.notNull\(\)/g, "$1");
|
|
1174
|
+
if (next === source)
|
|
1175
|
+
return undefined;
|
|
1176
|
+
return next;
|
|
1177
|
+
}
|
|
1164
1178
|
/** Remove the no-op Notifications Bell from gold-path chrome. Idempotent. */
|
|
1165
1179
|
export function patchGoldPathChromeNotifications(source) {
|
|
1166
1180
|
if (!source.includes('aria-label="Notifications"'))
|
|
@@ -1553,6 +1567,20 @@ export async function applyGoldPath(options) {
|
|
|
1553
1567
|
for (const file of files) {
|
|
1554
1568
|
await writeRel(targetDir, file.rel, file.content, overwrite, file.always === true, written, skipped);
|
|
1555
1569
|
}
|
|
1570
|
+
const schemaRel = `${layout.dbDir}/schema.ts`;
|
|
1571
|
+
const schemaDest = resolveSafeDest(targetDir, ".", schemaRel);
|
|
1572
|
+
if (existsSync(schemaDest)) {
|
|
1573
|
+
const current = await readFile(schemaDest, "utf8");
|
|
1574
|
+
const patched = patchGoldPathAccountIssuer(current);
|
|
1575
|
+
if (patched !== undefined && patched !== current) {
|
|
1576
|
+
await writeFileEnsured(schemaDest, patched);
|
|
1577
|
+
if (!written.includes(schemaRel))
|
|
1578
|
+
written.push(schemaRel);
|
|
1579
|
+
const skipAt = skipped.indexOf(schemaRel);
|
|
1580
|
+
if (skipAt >= 0)
|
|
1581
|
+
skipped.splice(skipAt, 1);
|
|
1582
|
+
}
|
|
1583
|
+
}
|
|
1556
1584
|
const chromeDest = resolveSafeDest(targetDir, ".", chromeRel);
|
|
1557
1585
|
if (existsSync(chromeDest)) {
|
|
1558
1586
|
const current = await readFile(chromeDest, "utf8");
|
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.7.
|
|
3
|
-
export declare const DEFAULT_REGISTRY = "https://raw.githubusercontent.com/pedrogbraz/cronus-ui/v0.7.
|
|
2
|
+
export declare const CLI_VERSION = "0.7.3";
|
|
3
|
+
export declare const DEFAULT_REGISTRY = "https://raw.githubusercontent.com/pedrogbraz/cronus-ui/v0.7.3/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.7.
|
|
5
|
+
export const CLI_VERSION = "0.7.3";
|
|
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.7.
|
|
3
|
+
"version": "0.7.3",
|
|
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.7.
|
|
57
|
+
"@cronus-ui/ai-kit": "0.7.3",
|
|
58
58
|
"commander": "^15.0.0",
|
|
59
59
|
"picocolors": "^1.1.1"
|
|
60
60
|
},
|
package/templates/apps/saas.json
CHANGED