smoodly 0.0.43 → 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/cli/migrate.d.ts +1 -1
- package/dist/cli/migrate.js +2 -2
- 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/cli/migrate.d.ts
CHANGED
|
@@ -8,7 +8,7 @@ export type MigrateArgs = {
|
|
|
8
8
|
};
|
|
9
9
|
/** The folder shipped in the package: `../../migrations/` from dist/cli/ and from src/cli/ alike. */
|
|
10
10
|
export declare const PACKAGE_MIGRATIONS_DIR: string;
|
|
11
|
-
export declare const NO_FOLDER
|
|
11
|
+
export declare const NO_FOLDER: (dir: string) => string;
|
|
12
12
|
export declare const NEXT_STEP = "Next: apply it \u2014 `supabase db push` (hosted) or `supabase migration up` (local).";
|
|
13
13
|
export declare const upToDate: (version: number, n: number) => string;
|
|
14
14
|
export declare const KEY_NOT_CHECKED = "Key not checked: SMOODLY_URL and SMOODLY_SECRET_KEY are not both set here.";
|
package/dist/cli/migrate.js
CHANGED
|
@@ -17,7 +17,7 @@ import { planIsEmpty, planMigrate } from "../migrations.js";
|
|
|
17
17
|
import { loadCollections } from "./load-collections.js";
|
|
18
18
|
/** The folder shipped in the package: `../../migrations/` from dist/cli/ and from src/cli/ alike. */
|
|
19
19
|
export const PACKAGE_MIGRATIONS_DIR = fileURLToPath(new URL("../../migrations/", import.meta.url));
|
|
20
|
-
export const NO_FOLDER =
|
|
20
|
+
export const NO_FOLDER = (dir) => `No supabase/migrations folder here (${dir}) — nothing to do. Run it in your app's folder, or pass --migrations. (Smoodly Cloud keeps the schema current; a self-host app gets the folder from \`supabase init\`.)`;
|
|
21
21
|
export const NEXT_STEP = "Next: apply it — `supabase db push` (hosted) or `supabase migration up` (local).";
|
|
22
22
|
export const upToDate = (version, n) => `Up to date: core schema v${version}, every collection's view is current (${n} ${n === 1 ? "collection" : "collections"}).`;
|
|
23
23
|
export const KEY_NOT_CHECKED = "Key not checked: SMOODLY_URL and SMOODLY_SECRET_KEY are not both set here.";
|
|
@@ -84,7 +84,7 @@ export async function runMigrate(args, out, deps = {}) {
|
|
|
84
84
|
out(`smoodly: no supabase/migrations here (${appDir}) — run the check in the app's folder, or pass --migrations.`);
|
|
85
85
|
return 1;
|
|
86
86
|
}
|
|
87
|
-
out(NO_FOLDER);
|
|
87
|
+
out(NO_FOLDER(appDir));
|
|
88
88
|
return 0;
|
|
89
89
|
}
|
|
90
90
|
const collections = await (deps.load ?? loadCollections)(resolve(cwd, args.collections), cwd);
|
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