@supacloud/cli 0.94.0 → 0.95.0
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/index.js
CHANGED
|
@@ -21099,7 +21099,7 @@ var starter_metadata_default = {
|
|
|
21099
21099
|
generatedBy: "supacloud/starter-metadata-v1",
|
|
21100
21100
|
packages: {
|
|
21101
21101
|
compiler: {
|
|
21102
|
-
version: "0.
|
|
21102
|
+
version: "0.45.0"
|
|
21103
21103
|
},
|
|
21104
21104
|
app: {
|
|
21105
21105
|
version: "0.26.1",
|
|
@@ -21137,15 +21137,18 @@ var starter_metadata_default = {
|
|
|
21137
21137
|
// src/shared/tools/app-starter-reactive.ts
|
|
21138
21138
|
var STARTER_REACTIVE_GUIDE = `# Reactive development / 响应式开发
|
|
21139
21139
|
|
|
21140
|
-
RxJS is
|
|
21141
|
-
|
|
21140
|
+
RxJS is the default and only reactive event library in the starter ecosystem.
|
|
21141
|
+
Ordinary queries and business commands still use async/await. Use RxJS for
|
|
21142
|
+
ongoing events and timing/composition, not as a new
|
|
21142
21143
|
transaction, retry or durable-delivery system.
|
|
21143
21144
|
|
|
21144
21145
|
Host defaults:
|
|
21145
21146
|
- In a native Angular host, use signal/resource APIs from @supacloud/app/angular
|
|
21146
21147
|
and Angular's scheduler. Do not mix them with the legacy root signal graph.
|
|
21147
21148
|
- In framework-neutral code, use async/await for one result and RxJS for event
|
|
21148
|
-
composition.
|
|
21149
|
+
composition. Raw continuous protocols use AsyncIterable unless an existing
|
|
21150
|
+
RxJS/Angular boundary is the better fit. The host owns cancellation through
|
|
21151
|
+
an explicit signal.
|
|
21149
21152
|
|
|
21150
21153
|
- Import native operators from rxjs; do not invent another event/operator library.
|
|
21151
21154
|
- Import takeUntilAborted / toReadableStream from @supacloud/app/reactive.
|
|
@@ -21194,7 +21197,9 @@ Read README.md and REACTIVE.md before adding asynchronous features. If the
|
|
|
21194
21197
|
application is hosted by Angular, read the @supacloud/app/angular guidance
|
|
21195
21198
|
before choosing a signal API.
|
|
21196
21199
|
Prefer the generated contracts and existing project-bound @supacloud/js client.
|
|
21197
|
-
Use async/await for a single result; RxJS is the default event-composition
|
|
21200
|
+
Use async/await for a single result; RxJS is the default event-composition
|
|
21201
|
+
library. Do not introduce another reactive library without a documented special
|
|
21202
|
+
requirement and equivalent lifecycle tests.
|
|
21198
21203
|
Bind subscriptions to an explicit owner and propagate cancellation to native I/O.
|
|
21199
21204
|
Never automatically retry a write or turn observable delivery into durable ack.
|
|
21200
21205
|
Do not bypass authorization, transactions, idempotency or audit to simplify code.
|
|
@@ -23008,6 +23013,12 @@ After installing dependencies, run \`bun run db:generate\` once and commit db/co
|
|
|
23008
23013
|
The default \`bun run check\` and build fail on stale database contracts before any
|
|
23009
23014
|
compiler regeneration. After an intentional source change, run db:generate again,
|
|
23010
23015
|
review the diff, then run check. Ordinary checks are offline.
|
|
23016
|
+
The compiler also runs this source-contract gate on compile/check/dev through
|
|
23017
|
+
databaseGovernance.mode = "check", including incremental cache hits. Missing
|
|
23018
|
+
adoption files or stale contracts fail closed; no contracts are silently regenerated.
|
|
23019
|
+
This is not SQL lint or live Catalog reconciliation. Before promotion, declare
|
|
23020
|
+
the real database modules, their SQL and tests, then explicitly use mode "enforce"
|
|
23021
|
+
with a separately selected read-only local/test database connection.
|
|
23011
23022
|
|
|
23012
23023
|
- Maintain one schema-qualified function with explicit grants per db/functions/*.sql.
|
|
23013
23024
|
- Preserve migrations/ and its existing executor/ledger. Add forward migrations only.
|
|
@@ -23157,6 +23168,7 @@ export default defineSupacloudConfig({
|
|
|
23157
23168
|
outDir: "generated",
|
|
23158
23169
|
strict: true,
|
|
23159
23170
|
moduleBoundaryPreset: "modular-monolith",
|
|
23171
|
+
databaseGovernance: { mode: "check" },
|
|
23160
23172
|
effect: {
|
|
23161
23173
|
requireRouteEffects: true,
|
|
23162
23174
|
requireErrorMappings: true,
|
|
@@ -29198,7 +29210,7 @@ function registerDeveloperExperienceTools(server, options = {}) {
|
|
|
29198
29210
|
// package.json
|
|
29199
29211
|
var package_default = {
|
|
29200
29212
|
name: "@supacloud/cli",
|
|
29201
|
-
version: "0.
|
|
29213
|
+
version: "0.95.0",
|
|
29202
29214
|
description: "Project-scoped CLI for SupaCloud users",
|
|
29203
29215
|
type: "module",
|
|
29204
29216
|
main: "./dist/index.js",
|
|
@@ -29250,7 +29262,7 @@ var package_default = {
|
|
|
29250
29262
|
directory: "packages/cli"
|
|
29251
29263
|
},
|
|
29252
29264
|
dependencies: {
|
|
29253
|
-
"@supacloud/compiler": "^0.
|
|
29265
|
+
"@supacloud/compiler": "^0.45.0",
|
|
29254
29266
|
"@supacloud/delivery": "0.16.0",
|
|
29255
29267
|
"@supacloud/db": "0.16.2",
|
|
29256
29268
|
typebox: "1.3.36"
|
|
@@ -10,5 +10,5 @@ export declare const STARTER_DATABASE_CONFIG: {
|
|
|
10
10
|
role: string;
|
|
11
11
|
};
|
|
12
12
|
export declare const STARTER_DATABASE_SCHEMA = "import { sql } from \"drizzle-orm\";\nimport { boolean, check, integer, jsonb, pgTable, primaryKey, text, uuid } from \"drizzle-orm/pg-core\";\n\n// Structure for the reviewed starter migrations. Grants/policies stay in those migrations.\nexport const application = pgTable.withRLS(\"starter_application\", {\n singleton: boolean().default(true).primaryKey(),\n projectId: text(\"project_id\").notNull(),\n tenantId: text(\"tenant_id\").notNull(),\n}, table => [\n check(\"starter_application_singleton_check\", sql`${table.singleton}`),\n check(\"starter_application_project_id_check\", sql`length(${table.projectId}) > 0`),\n check(\"starter_application_tenant_id_check\", sql`length(${table.tenantId}) > 0`),\n]);\n\nexport const reviews = pgTable.withRLS(\"starter_reviews\", {\n id: text().primaryKey(),\n ownerId: text(\"owner_id\").notNull(),\n state: text({ enum: [\"draft\", \"approved\"] }).notNull(),\n version: integer().notNull(),\n}, table => [\n check(\"starter_reviews_state_check\", sql`${table.state} IN ('draft', 'approved')`),\n check(\"starter_reviews_version_check\", sql`${table.version} > 0`),\n]);\n\nexport const members = pgTable.withRLS(\"starter_members\", {\n subject: text().primaryKey(),\n enabled: boolean().default(true).notNull(),\n canApprove: boolean(\"can_approve\").default(false).notNull(),\n storageSubject: uuid(\"storage_subject\").unique(),\n});\n\nexport const attachments = pgTable.withRLS(\"starter_attachments\", {\n reviewId: text(\"review_id\").primaryKey().references(() => reviews.id),\n artifactId: uuid(\"artifact_id\").notNull().unique(),\n ownerId: text(\"owner_id\").notNull(),\n runId: uuid(\"run_id\").notNull().unique(),\n objectPath: text(\"object_path\").notNull().unique(),\n});\n\nexport const attachmentResults = pgTable.withRLS(\"starter_attachment_results\", {\n reviewId: text(\"review_id\").notNull().references(() => reviews.id),\n version: integer().notNull(),\n artifactId: uuid(\"artifact_id\").notNull(),\n result: jsonb().$type<unknown>().notNull(),\n}, table => [\n primaryKey({ columns: [table.reviewId, table.version, table.artifactId] }),\n check(\"starter_attachment_results_version_check\", sql`${table.version} >= 2`),\n]);\n\nexport type ReviewRow = typeof reviews.$inferSelect;\nexport type NewReview = typeof reviews.$inferInsert;\n";
|
|
13
|
-
export declare const STARTER_DATABASE_GUIDE = "\n## Database Source Workflow\n\nDrizzle owns table declarations and inferred row types in db/schema.ts.\nUse the existing @supacloud/db/drizzle-bun adapters for typed queries and governed\ntransactions; never replace permission, idempotency or audit checks with plain CRUD.\nOpaque JSON still needs runtime decoding.\n\nAfter installing dependencies, run `bun run db:generate` once and commit db/contracts/.\nThe default `bun run check` and build fail on stale database contracts before any\ncompiler regeneration. After an intentional source change, run db:generate again,\nreview the diff, then run check. Ordinary checks are offline.\n\n- Maintain one schema-qualified function with explicit grants per db/functions/*.sql.\n- Preserve migrations/ and its existing executor/ledger. Add forward migrations only.\n- `bun run db:diff` generates Drizzle drafts under db/migration-candidates/, never\n into the deployment directory. The starter has existing SQL history, so establish\n and review a matching Drizzle baseline before promoting any draft; the first\n draft is not automatically an incremental production migration.\n- `bun run db:pull` requires an explicitly selected DATABASE_URL and writes only\n output/database-audit/drizzle-candidate/. Review candidates; never overwrite source blindly.\n- Full SQL dumps belong under the ignored output/database-audit/ directory. They are\n audit/recovery artifacts, never ordinary type, application or test inputs.\n- `bun run db:assess` explains adoption/findings without writing or connecting.\n- GraphQL/PostgREST exports remain legitimate protocol contracts. This check is not\n proof of deployed schema, effective role permissions or complete RLS equivalence.\n\nDo not introduce any/@ts-ignore to bypass a contract. Use Drizzle-inferred types,\npreserve bigint/numeric precision and decode unknown results at the boundary.\n";
|
|
13
|
+
export declare const STARTER_DATABASE_GUIDE = "\n## Database Source Workflow\n\nDrizzle owns table declarations and inferred row types in db/schema.ts.\nUse the existing @supacloud/db/drizzle-bun adapters for typed queries and governed\ntransactions; never replace permission, idempotency or audit checks with plain CRUD.\nOpaque JSON still needs runtime decoding.\n\nAfter installing dependencies, run `bun run db:generate` once and commit db/contracts/.\nThe default `bun run check` and build fail on stale database contracts before any\ncompiler regeneration. After an intentional source change, run db:generate again,\nreview the diff, then run check. Ordinary checks are offline.\nThe compiler also runs this source-contract gate on compile/check/dev through\ndatabaseGovernance.mode = \"check\", including incremental cache hits. Missing\nadoption files or stale contracts fail closed; no contracts are silently regenerated.\nThis is not SQL lint or live Catalog reconciliation. Before promotion, declare\nthe real database modules, their SQL and tests, then explicitly use mode \"enforce\"\nwith a separately selected read-only local/test database connection.\n\n- Maintain one schema-qualified function with explicit grants per db/functions/*.sql.\n- Preserve migrations/ and its existing executor/ledger. Add forward migrations only.\n- `bun run db:diff` generates Drizzle drafts under db/migration-candidates/, never\n into the deployment directory. The starter has existing SQL history, so establish\n and review a matching Drizzle baseline before promoting any draft; the first\n draft is not automatically an incremental production migration.\n- `bun run db:pull` requires an explicitly selected DATABASE_URL and writes only\n output/database-audit/drizzle-candidate/. Review candidates; never overwrite source blindly.\n- Full SQL dumps belong under the ignored output/database-audit/ directory. They are\n audit/recovery artifacts, never ordinary type, application or test inputs.\n- `bun run db:assess` explains adoption/findings without writing or connecting.\n- GraphQL/PostgREST exports remain legitimate protocol contracts. This check is not\n proof of deployed schema, effective role permissions or complete RLS equivalence.\n\nDo not introduce any/@ts-ignore to bypass a contract. Use Drizzle-inferred types,\npreserve bigint/numeric precision and decode unknown results at the boundary.\n";
|
|
14
14
|
export declare function starterDatabaseFiles(): Record<string, string>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/** Shared reactive conventions for command, HTTP and edge starters. */
|
|
2
|
-
export declare const STARTER_REACTIVE_GUIDE = "# Reactive development / \u54CD\u5E94\u5F0F\u5F00\u53D1\n\nRxJS is
|
|
3
|
-
export declare const STARTER_REACTIVE_AGENTS = "# Application development rules\n\nRead README.md and REACTIVE.md before adding asynchronous features. If the\napplication is hosted by Angular, read the @supacloud/app/angular guidance\nbefore choosing a signal API.\nPrefer the generated contracts and existing project-bound @supacloud/js client.\nUse async/await for a single result; RxJS is the default event-composition library.\nBind subscriptions to an explicit owner and propagate cancellation to native I/O.\nNever automatically retry a write or turn observable delivery into durable ack.\nDo not bypass authorization, transactions, idempotency or audit to simplify code.\nRun bun run check; include negative and cleanup tests. Never store live credentials.\n";
|
|
2
|
+
export declare const STARTER_REACTIVE_GUIDE = "# Reactive development / \u54CD\u5E94\u5F0F\u5F00\u53D1\n\nRxJS is the default and only reactive event library in the starter ecosystem.\nOrdinary queries and business commands still use async/await. Use RxJS for\nongoing events and timing/composition, not as a new\ntransaction, retry or durable-delivery system.\n\nHost defaults:\n- In a native Angular host, use signal/resource APIs from @supacloud/app/angular\n and Angular's scheduler. Do not mix them with the legacy root signal graph.\n- In framework-neutral code, use async/await for one result and RxJS for event\n composition. Raw continuous protocols use AsyncIterable unless an existing\n RxJS/Angular boundary is the better fit. The host owns cancellation through\n an explicit signal.\n\n- Import native operators from rxjs; do not invent another event/operator library.\n- Import takeUntilAborted / toReadableStream from @supacloud/app/reactive.\n- Every subscription belongs to a request, connection, task or application owner.\n Bind the owner's AbortSignal before starting work; release it on exit.\n- toReadableStream has a bounded item buffer and fails on overflow. It is not\n an event journal. Do not silently drop durable business events or audit records.\n- Never wrap command submission in defer/retry/repeat or submit from subscribe.\n Await the existing governed command and then observe its existing receipt.\n- Do not shareReplay authenticated values globally across projects or sessions.\n- subscribe(async ...) does not await processing. Keep acknowledged task-output\n consumers on the SDK's for-await watch path; do not advance onCursor via next().\n\n## SupaCloud JS\n\nThe platform SDK is @supacloud/js, not a replacement Supabase client. Keep the\nclient from createSupaCloudClient. Database/Auth/Storage calls use client.supabase;\nplatform commands/tasks use the existing client.commands / client.tasks APIs.\nFor applications using this SDK, import observeQuery and observeTask from\n@supacloud/js/reactive. Pass the request signal to the native query builder:\n\n observeQuery(signal => client.supabase.from(\"widgets\").select(\"id\").abortSignal(signal), { signal: owner.signal })\n\nThe query result keeps data/error/count/status; non-null errors enter error().\nThe query factory runs once per subscriber. This is intended for reads, not\nreplaying writes. A PromiseLike is supported; an already-started Promise is not\nan appropriate factory. Unsubscribe aborts cooperative I/O, not committed work.\n\nSubmit a background task ONCE with the existing SDK, then observe the receipt:\n\n const task = await client.functions.invokeBackground(\"render\", { body: input });\n const progress = observeTask(task, { signal: owner.signal });\n\nUnsubscribing progress does not cancel the server task. Task read/decoder errors\nterminate observation; there is no automatic business retry. Realtime-to-polling\nfallback and project validation remain the SDK's responsibilities. Do not invent\na public.tasks table or copy service credentials into browser code.\n\nRun bun run check. Add cancellation, error, overflow and cross-owner isolation\ncoverage whenever adding streaming behavior. These APIs require the matching\nframework/SDK release or the packed candidate packages used by repository CI.\n";
|
|
3
|
+
export declare const STARTER_REACTIVE_AGENTS = "# Application development rules\n\nRead README.md and REACTIVE.md before adding asynchronous features. If the\napplication is hosted by Angular, read the @supacloud/app/angular guidance\nbefore choosing a signal API.\nPrefer the generated contracts and existing project-bound @supacloud/js client.\nUse async/await for a single result; RxJS is the default event-composition\nlibrary. Do not introduce another reactive library without a documented special\nrequirement and equivalent lifecycle tests.\nBind subscriptions to an explicit owner and propagate cancellation to native I/O.\nNever automatically retry a write or turn observable delivery into durable ack.\nDo not bypass authorization, transactions, idempotency or audit to simplify code.\nRun bun run check; include negative and cleanup tests. Never store live credentials.\n";
|
|
4
4
|
export declare const STARTER_REACTIVE_TEST = "import { expect, test } from \"bun:test\";\nimport { Observable } from \"rxjs\";\nimport { takeUntilAborted, toReadableStream } from \"@supacloud/app/reactive\";\n\ntest(\"the owner's signal releases reactive work exactly once\", () => {\n const owner = new AbortController();\n let starts = 0, stops = 0;\n const source = new Observable<number>(() => { starts++; return () => { stops++; }; });\n source.pipe(takeUntilAborted(owner.signal)).subscribe();\n owner.abort();\n source.pipe(takeUntilAborted(owner.signal)).subscribe();\n expect(starts).toBe(1);\n expect(stops).toBe(1);\n});\n\ntest(\"cancelled stream consumers release their subscription\", async () => {\n let stops = 0;\n const source = new Observable<number>(() => () => { stops++; });\n const stream = toReadableStream(source);\n await stream.cancel();\n expect(stops).toBe(1);\n});\n";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@supacloud/cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.95.0",
|
|
4
4
|
"description": "Project-scoped CLI for SupaCloud users",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
"directory": "packages/cli"
|
|
53
53
|
},
|
|
54
54
|
"dependencies": {
|
|
55
|
-
"@supacloud/compiler": "^0.
|
|
55
|
+
"@supacloud/compiler": "^0.45.0",
|
|
56
56
|
"@supacloud/delivery": "0.16.0",
|
|
57
57
|
"@supacloud/db": "0.16.2",
|
|
58
58
|
"typebox": "1.3.36"
|