smoodly 0.0.44 → 0.0.45
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/cli/main.d.ts +3 -1
- package/dist/cli/main.js +8 -1
- package/dist/fields.js +2 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
package/dist/cli/main.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { type MigrateArgs } from "./migrate.ts";
|
|
|
2
2
|
import { type ExportArgs } from "./export.ts";
|
|
3
3
|
import { type ImportArgs } from "./import.ts";
|
|
4
4
|
import { type AddAdminArgs } from "./add-admin.ts";
|
|
5
|
-
export declare const USAGE = "usage: smoodly <command
|
|
5
|
+
export declare const USAGE = "usage: smoodly <command> (smoodly --version prints the version)\n\n migrate [--check] [--collections <file>] [--migrations <dir>]\n Copies the core schema files this package ships that supabase/migrations/\n lacks, and writes one views file for the collections whose view is new or\n changed. Prints the push or reset command; never runs it.\n\n --check write nothing; exit 1 when anything is pending, or when\n SMOODLY_SECRET_KEY (if set) cannot read the database\n --collections <file> the module exporting `collections` (default smoodly/collections.ts)\n --migrations <dir> the app's migration folder (default supabase/migrations)\n\n export [--out <dir>]\n Writes the space SMOODLY_SECRET_KEY names \u2014 every content row, history\n included, and the media files \u2014 into a folder (default\n smoodly-export-<date>). Reads only.\n\n import <dir>\n Writes an export folder into the key's space, which must be empty or hold\n only this export's rows (an earlier run to continue). Never deletes.\n\n add-admin <email> [--admin-url <url>]\n Makes <email> an admin of the key's space: with SMOODLY_ADMIN_PASSWORD\n set, creates the account with that password; without, mails an invite\n whose link lands on --admin-url (default: SITE_URL + /admin).";
|
|
6
6
|
export type Parsed = {
|
|
7
7
|
command: "migrate";
|
|
8
8
|
args: MigrateArgs;
|
|
@@ -17,6 +17,8 @@ export type Parsed = {
|
|
|
17
17
|
args: AddAdminArgs;
|
|
18
18
|
} | {
|
|
19
19
|
command: "help";
|
|
20
|
+
} | {
|
|
21
|
+
command: "version";
|
|
20
22
|
} | {
|
|
21
23
|
command: "error";
|
|
22
24
|
message: string;
|
package/dist/cli/main.js
CHANGED
|
@@ -9,7 +9,8 @@ import { runMigrate } from "./migrate.js";
|
|
|
9
9
|
import { runExport } from "./export.js";
|
|
10
10
|
import { runImport } from "./import.js";
|
|
11
11
|
import { runAddAdmin } from "./add-admin.js";
|
|
12
|
-
|
|
12
|
+
import { SMOODLY_VERSION } from "../version.js";
|
|
13
|
+
export const USAGE = `usage: smoodly <command> (smoodly --version prints the version)
|
|
13
14
|
|
|
14
15
|
migrate [--check] [--collections <file>] [--migrations <dir>]
|
|
15
16
|
Copies the core schema files this package ships that supabase/migrations/
|
|
@@ -38,6 +39,8 @@ export function parseArgs(argv) {
|
|
|
38
39
|
const [command, ...rest] = argv;
|
|
39
40
|
if (!command || command === "help" || argv.some((a) => a === "--help" || a === "-h"))
|
|
40
41
|
return { command: "help" };
|
|
42
|
+
if (command === "--version" || command === "-v")
|
|
43
|
+
return { command: "version" };
|
|
41
44
|
if (command === "export") {
|
|
42
45
|
const args = { out: null };
|
|
43
46
|
for (let i = 0; i < rest.length; i++) {
|
|
@@ -87,6 +90,10 @@ export async function main(argv, out = console.log) {
|
|
|
87
90
|
out(USAGE);
|
|
88
91
|
return 0;
|
|
89
92
|
}
|
|
93
|
+
if (parsed.command === "version") {
|
|
94
|
+
out(SMOODLY_VERSION);
|
|
95
|
+
return 0;
|
|
96
|
+
}
|
|
90
97
|
if (parsed.command === "error") {
|
|
91
98
|
out(`smoodly: ${parsed.message}\n\n${USAGE}`);
|
|
92
99
|
return 2;
|
package/dist/fields.js
CHANGED
|
@@ -73,7 +73,8 @@ function assertContainerItem(kind, d, path = "") {
|
|
|
73
73
|
throw new Error(`smoodly: ${kind} cannot hold a ref (at ${describePath(ref)}) — refs live at the top level of fields.`);
|
|
74
74
|
const loc = findMatch(d, (sub) => sub.localized === true, path);
|
|
75
75
|
if (loc !== null) {
|
|
76
|
-
|
|
76
|
+
// An inner container throws first and cannot see the one around it, so name the rule, not "the object" (2026-10-02).
|
|
77
|
+
throw new Error(`smoodly: .localized() inside ${kind} (at ${describePath(loc)}) — only a top-level field can be localized: put .localized() on the field in \`fields\` that holds it, such as the list.`);
|
|
77
78
|
}
|
|
78
79
|
}
|
|
79
80
|
export const f = {
|
package/dist/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SMOODLY_VERSION = "0.0.
|
|
1
|
+
export declare const SMOODLY_VERSION = "0.0.45";
|
package/dist/version.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// Generated by scripts/write-version.mjs from package.json — do not edit.
|
|
2
|
-
export const SMOODLY_VERSION = "0.0.
|
|
2
|
+
export const SMOODLY_VERSION = "0.0.45";
|
package/package.json
CHANGED