@supacloud/cli 0.94.0 → 0.95.1

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
@@ -476,7 +476,7 @@ Example configuration write file:
476
476
  "configuration_id": "01234567-89ab-4def-8123-456789abcdef",
477
477
  "expected_configuration_id": null,
478
478
  "configuration": {
479
- "bun_version": "1.4.2",
479
+ "bun_version": "1.4.3",
480
480
  "targets": [
481
481
  {
482
482
  "name": "api",
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.44.1"
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 installed by default. Ordinary queries and business commands still use
21141
- async/await. Use RxJS for ongoing events and timing/composition, not as a new
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. The host owns cancellation through an explicit signal.
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 library.
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.
@@ -21446,7 +21451,7 @@ function baseFiles(name, sdkDependencies) {
21446
21451
  version: "0.0.0",
21447
21452
  private: true,
21448
21453
  type: "module",
21449
- engines: { bun: ">=1.4.2" },
21454
+ engines: { bun: ">=1.4.3" },
21450
21455
  scripts: {
21451
21456
  compile: "bun --no-env-file node_modules/@supacloud/compiler/dist/cli.js compile",
21452
21457
  "check:generated": "bun --no-env-file node_modules/@supacloud/compiler/dist/cli.js check",
@@ -21470,7 +21475,7 @@ function baseFiles(name, sdkDependencies) {
21470
21475
  },
21471
21476
  devDependencies: {
21472
21477
  "@supacloud/compiler": `^${compilerMetadata.version}`,
21473
- "@types/bun": "^1.4.2",
21478
+ "@types/bun": "^1.4.3",
21474
21479
  typescript: "^7.0.2"
21475
21480
  }
21476
21481
  }),
@@ -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.
@@ -23065,7 +23076,7 @@ function appStarterFiles(name) {
23065
23076
  version: "0.0.0",
23066
23077
  private: true,
23067
23078
  type: "module",
23068
- engines: { bun: ">=1.4.2" },
23079
+ engines: { bun: ">=1.4.3" },
23069
23080
  scripts: {
23070
23081
  compile: "bun --no-env-file node_modules/@supacloud/compiler/dist/cli.js compile",
23071
23082
  "check:generated": "bun --no-env-file node_modules/@supacloud/compiler/dist/cli.js check",
@@ -23101,7 +23112,7 @@ function appStarterFiles(name) {
23101
23112
  devDependencies: {
23102
23113
  "@supacloud/compiler": `^${compilerMetadata2.version}`,
23103
23114
  "drizzle-kit": dbMetadata.devDependencies["drizzle-kit"],
23104
- "@types/bun": "^1.4.2",
23115
+ "@types/bun": "^1.4.3",
23105
23116
  typescript: "^7.0.2"
23106
23117
  }
23107
23118
  }),
@@ -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.94.0",
29213
+ version: "0.95.1",
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.44.1",
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"
@@ -29262,7 +29274,7 @@ var package_default = {
29262
29274
  },
29263
29275
  devDependencies: {
29264
29276
  "@supacloud/elysia": "^0.24.1",
29265
- "@types/bun": "^1.4.2",
29277
+ "@types/bun": "^1.4.3",
29266
29278
  effect: "4.0.2",
29267
29279
  elysia: "2.0.0-beta.21",
29268
29280
  typescript: "^7.0.2"
@@ -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 installed by default. Ordinary queries and business commands still use\nasync/await. Use RxJS for ongoing 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. The host owns cancellation through 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 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.94.0",
3
+ "version": "0.95.1",
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.44.1",
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"
@@ -64,7 +64,7 @@
64
64
  },
65
65
  "devDependencies": {
66
66
  "@supacloud/elysia": "^0.24.1",
67
- "@types/bun": "^1.4.2",
67
+ "@types/bun": "^1.4.3",
68
68
  "effect": "4.0.2",
69
69
  "elysia": "2.0.0-beta.21",
70
70
  "typescript": "^7.0.2"