@supacloud/js 0.34.1 → 0.36.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/COMPATIBILITY.md +84 -0
- package/LICENSE +202 -661
- package/NOTICE +8 -13
- package/REACTIVE.md +93 -0
- package/README.md +6 -0
- package/dist/api-error.d.mts +6 -0
- package/dist/{artifact-fetch.d.ts → artifact-fetch.d.cts} +1 -1
- package/dist/artifact-fetch.d.mts +6 -0
- package/dist/{artifact-link.d.ts → artifact-link.d.cts} +2 -2
- package/dist/artifact-link.d.mts +8 -0
- package/dist/{artifact-read.d.ts → artifact-read.d.cts} +2 -2
- package/dist/artifact-read.d.mts +13 -0
- package/dist/{artifact-register.d.ts → artifact-register.d.cts} +2 -2
- package/dist/artifact-register.d.mts +14 -0
- package/dist/{artifact-rpc.d.ts → artifact-rpc.d.cts} +1 -1
- package/dist/artifact-rpc.d.mts +2 -0
- package/dist/{artifacts.d.ts → artifacts.d.cts} +4 -4
- package/dist/artifacts.d.mts +53 -0
- package/dist/auth-fetch.d.mts +27 -0
- package/dist/bounded-rpc-fetch.d.mts +2 -0
- package/dist/{command-fetch.d.ts → command-fetch.d.cts} +1 -1
- package/dist/command-fetch.d.mts +6 -0
- package/dist/{commands.d.ts → commands.d.cts} +1 -1
- package/dist/commands.d.mts +44 -0
- package/dist/contracts.cjs +48 -0
- package/dist/contracts.d.mts +1 -0
- package/dist/index.cjs +3732 -0
- package/dist/{index.d.ts → index.d.cts} +20 -20
- package/dist/index.d.mts +360 -0
- package/dist/{oauth-clients.d.ts → oauth-clients.d.cts} +1 -1
- package/dist/oauth-clients.d.mts +95 -0
- package/dist/{oauth-server.d.ts → oauth-server.d.cts} +1 -1
- package/dist/oauth-server.d.mts +104 -0
- package/dist/{queue-rpc.d.ts → queue-rpc.d.cts} +1 -1
- package/dist/queue-rpc.d.mts +54 -0
- package/dist/reactive.cjs +119 -0
- package/dist/reactive.d.cts +26 -0
- package/dist/reactive.d.mts +26 -0
- package/dist/reactive.mjs +79 -0
- package/dist/{service-role-rpc.d.ts → service-role-rpc.d.cts} +1 -1
- package/dist/service-role-rpc.d.mts +2 -0
- package/dist/supabase-types.d.cts +9 -0
- package/dist/supabase-types.d.mts +9 -0
- package/dist/task-events.cjs +352 -0
- package/dist/task-events.d.mts +66 -0
- package/dist/{workflow-advance.d.ts → workflow-advance.d.cts} +2 -2
- package/dist/workflow-advance.d.mts +8 -0
- package/dist/{workflow-attempt.d.ts → workflow-attempt.d.cts} +1 -1
- package/dist/workflow-attempt.d.mts +4 -0
- package/dist/{workflow-cancel.d.ts → workflow-cancel.d.cts} +2 -2
- package/dist/workflow-cancel.d.mts +14 -0
- package/dist/{workflow-claim.d.ts → workflow-claim.d.cts} +2 -2
- package/dist/workflow-claim.d.mts +12 -0
- package/dist/{workflow-complete.d.ts → workflow-complete.d.cts} +2 -2
- package/dist/workflow-complete.d.mts +8 -0
- package/dist/{workflow-events.d.ts → workflow-events.d.cts} +2 -2
- package/dist/workflow-events.d.mts +14 -0
- package/dist/{workflow-fail.d.ts → workflow-fail.d.cts} +2 -2
- package/dist/workflow-fail.d.mts +8 -0
- package/dist/{workflow-fetch.d.ts → workflow-fetch.d.cts} +1 -1
- package/dist/workflow-fetch.d.mts +9 -0
- package/dist/workflow-json.d.mts +2 -0
- package/dist/{workflow-retry.d.ts → workflow-retry.d.cts} +2 -2
- package/dist/workflow-retry.d.mts +8 -0
- package/dist/{workflow-rpc.d.ts → workflow-rpc.d.cts} +1 -1
- package/dist/workflow-rpc.d.mts +6 -0
- package/dist/{workflow-run.d.ts → workflow-run.d.cts} +2 -2
- package/dist/workflow-run.d.mts +8 -0
- package/dist/{workflow-start.d.ts → workflow-start.d.cts} +2 -2
- package/dist/workflow-start.d.mts +8 -0
- package/dist/workflow-timestamp.d.mts +1 -0
- package/dist/{workflows.d.ts → workflows.d.cts} +10 -10
- package/dist/workflows.d.mts +141 -0
- package/package.json +54 -20
- /package/dist/{api-error.d.ts → api-error.d.cts} +0 -0
- /package/dist/{auth-fetch.d.ts → auth-fetch.d.cts} +0 -0
- /package/dist/{bounded-rpc-fetch.d.ts → bounded-rpc-fetch.d.cts} +0 -0
- /package/dist/{contracts.d.ts → contracts.d.cts} +0 -0
- /package/dist/{contracts.js → contracts.mjs} +0 -0
- /package/dist/{index.js → index.mjs} +0 -0
- /package/dist/{task-events.d.ts → task-events.d.cts} +0 -0
- /package/dist/{task-events.js → task-events.mjs} +0 -0
- /package/dist/{workflow-json.d.ts → workflow-json.d.cts} +0 -0
- /package/dist/{workflow-timestamp.d.ts → workflow-timestamp.d.cts} +0 -0
package/COMPATIBILITY.md
ADDED
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
# SDK module compatibility
|
|
2
|
+
|
|
3
|
+
## Supported loading contract
|
|
4
|
+
|
|
5
|
+
`@supacloud/js` publishes native ESM (`.mjs`) and CommonJS (`.cjs`) builds for
|
|
6
|
+
its root, `/task-events`, `/contracts` and `/reactive` entrypoints.
|
|
7
|
+
`@supacloud/contracts` publishes both formats for its root, `/client` and
|
|
8
|
+
`/browser` entrypoints. Both builds come from the same TypeScript source.
|
|
9
|
+
|
|
10
|
+
Each export selects `.mjs` with `.d.mts` declarations under `import`, and `.cjs`
|
|
11
|
+
with `.d.cts` declarations under `require`. Legacy `main`, `module` and `types`
|
|
12
|
+
fields point to CJS, MJS and ESM declarations respectively. Consumers should
|
|
13
|
+
use public package specifiers instead of internal `dist` paths.
|
|
14
|
+
|
|
15
|
+
```js
|
|
16
|
+
// ESM
|
|
17
|
+
import { createClient } from '@supabase/supabase-js';
|
|
18
|
+
import { createSupaCloudClient } from '@supacloud/js';
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
```js
|
|
22
|
+
// CommonJS: synchronous, without an ESM loader bridge.
|
|
23
|
+
const { createClient } = require('@supabase/supabase-js');
|
|
24
|
+
const { createSupaCloudClient } = require('@supacloud/js');
|
|
25
|
+
const { TaskEventError } = require('@supacloud/js/task-events');
|
|
26
|
+
const { createCommandScope } = require('@supacloud/js/contracts');
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
The supported SDK Node floor remains **22.12.0**; native CJS output does not
|
|
30
|
+
lower dependency runtime requirements. CI also covers Node 24, Node 26 and
|
|
31
|
+
Bun 1.4.2. These checks do not certify older Node, Electron, React Native/Hermes
|
|
32
|
+
or every browser/bundler combination.
|
|
33
|
+
|
|
34
|
+
Client creation remains synchronous. Network methods retain their Promise
|
|
35
|
+
contracts, transport behavior and caller-owned authentication configuration.
|
|
36
|
+
Module loading does not create another client or introduce retries.
|
|
37
|
+
Service-role workflow and command operations remain server-only.
|
|
38
|
+
|
|
39
|
+
## Module identity
|
|
40
|
+
|
|
41
|
+
The formats have equivalent public APIs but distinct function and class
|
|
42
|
+
identities. Do not rely on cross-format `instanceof` or reference equality.
|
|
43
|
+
Repeated loading of the same entrypoint in the same format preserves identity.
|
|
44
|
+
The SDK contracts facade externalizes `@supacloud/contracts/client`, preserving
|
|
45
|
+
shared protocol identity within each format. Mixed-format applications should
|
|
46
|
+
exchange data or caller-owned clients rather than rely on class identity.
|
|
47
|
+
Independently installed package copies and separate JavaScript realms also
|
|
48
|
+
have independent identities.
|
|
49
|
+
|
|
50
|
+
## Type compatibility
|
|
51
|
+
|
|
52
|
+
The type-only Supabase bridge explicitly selects both upstream declaration
|
|
53
|
+
graphs with `resolution-mode: import` and `resolution-mode: require`.
|
|
54
|
+
Both SDK declaration formats accept either upstream client and preserve the
|
|
55
|
+
caller's exact client/database type without casts or type erasure.
|
|
56
|
+
|
|
57
|
+
Installed `.mts` and `.cts` NodeNext consumers check normal and opposite-format
|
|
58
|
+
Supabase clients, task generics, table-name inference and reactive query types.
|
|
59
|
+
TypeScript 5.8.3 checks the complete declaration graph with `skipLibCheck: false`.
|
|
60
|
+
TypeScript 7 checks the consumers and ESNext/bundler surface with
|
|
61
|
+
`skipLibCheck: true`: upstream auth-js `PublicKeyCredentialFuture<T>` currently
|
|
62
|
+
conflicts with the newer DOM WebAuthn declarations (TS2430). This is not a
|
|
63
|
+
successful TS7 full-library declaration audit.
|
|
64
|
+
|
|
65
|
+
Framework packages such as `@supacloud/app` and `@supacloud/compiler` remain
|
|
66
|
+
ESM-only. The dual-format policy exception is restricted to SDK and Contracts.
|
|
67
|
+
|
|
68
|
+
## Verification
|
|
69
|
+
|
|
70
|
+
Build Contracts before the SDK, then run:
|
|
71
|
+
|
|
72
|
+
```sh
|
|
73
|
+
bun run --cwd packages/supacloud-js check:package
|
|
74
|
+
node .github/scripts/esm-package.acceptance.mjs --sdk-only
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
Acceptance installs actual candidate tarballs outside the checkout, with no
|
|
78
|
+
workspace links. It checks cold require-first/import-first processes under
|
|
79
|
+
Node and Bun, all seven public entries, API parity, per-format identity,
|
|
80
|
+
Supabase HTTP error/Response preservation and one-attempt transport behavior.
|
|
81
|
+
The minimum peer is installed with strict engine enforcement. TypeScript runs
|
|
82
|
+
against the installed declarations, and a browser-target bundle includes all
|
|
83
|
+
SDK public entries. The full acceptance job additionally checks app/compiler
|
|
84
|
+
integration. CI must pass on the candidate commit before merging.
|