@samebase/alchemy-convex 0.10.0 → 0.12.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/README.md CHANGED
@@ -12,19 +12,22 @@ This is a community provider, maintained by [Samebase](https://samebase.com). Th
12
12
  follows the "Convex Plain" mode of [rjdellecese/confect#408](https://github.com/rjdellecese/confect/issues/408).
13
13
  [docs/design/convex-plane.md](docs/design/convex-plane.md) records the decisions.
14
14
 
15
- Status: pinned to `alchemy@2.0.0-beta.83` and Effect 4. Alchemy ships breaking changes between
15
+ Status: pinned to `alchemy@2.0.0-beta.84` and Effect 4. Alchemy ships breaking changes between
16
16
  betas; upgrade this package and Alchemy together. A live test runs the full sequence with the real
17
17
  Convex CLI: create, push, no-op, change, preview, deploy keys alone, and destroy.
18
18
 
19
19
  ## Install
20
20
 
21
21
  ```sh
22
- pnpm add -D @samebase/alchemy-convex alchemy@2.0.0-beta.83 effect@^4.0.0 @effect/platform-node@^4.0.0 convex
22
+ pnpm add -D @samebase/alchemy-convex alchemy@2.0.0-beta.84 effect@^4.0.5 @effect/platform-node@^4.0.5 convex
23
23
  ```
24
24
 
25
25
  Use one version for `effect` and for each `@effect/*` package. A mix fails at load time, such as
26
26
  `@effect/platform-node-shared` 4.0.5 next to `effect` 4.0.3.
27
27
 
28
+ Alchemy providers are separate packages. The example below also needs
29
+ `@alchemy.run/cloudflare@2.0.0-beta.84`, the same version as `alchemy`.
30
+
28
31
  ## Example
29
32
 
30
33
  ```ts
@@ -60,7 +63,7 @@ export default Alchemy.Stack(
60
63
  );
61
64
  ```
62
65
 
63
- The imports are `alchemy`, `alchemy/Cloudflare`, `alchemy/RemovalPolicy`, `effect/Config`,
66
+ The imports are `alchemy`, `@alchemy.run/cloudflare`, `alchemy/RemovalPolicy`, `effect/Config`,
64
67
  `effect/Effect`, `effect/Layer`, and `@samebase/alchemy-convex` as `Convex`. Order follows the
65
68
  outputs: the project exists before its deployment, and the push finishes before the site build. The
66
69
  first `alchemy deploy --stage prod` takes over the existing project, and its production
@@ -187,7 +190,8 @@ production deployment with the Convex CLI of the app; a later version of this pa
187
190
  newer store when it finds an older one. A store that is newer than the package fails the run with
188
191
  both versions, so the repositories of a team upgrade the package together. Each run makes a
189
192
  deploy key of that deployment that can only run the store's internal functions, and deletes it at
190
- the end. Rows are in the tables `resources` and `outputs` in the dashboard, under the stack name.
193
+ the end. Rows are in the tables `resources` and `outputs` of the component `alchemyState` in the
194
+ dashboard, under the stack name.
191
195
  The store has no lock: run one deploy of a stage at a time, such as with a CI concurrency group.
192
196
  The store and its readers (Samebase) are released and upgraded together.
193
197
 
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","names":[],"sources":["../src/Credentials.ts","../src/ManagementApi.ts","../src/Providers.ts","../src/Push.ts","../src/Deployment.ts","../src/Component.ts","../src/Project.ts","../src/RunRecord.ts","../src/State.ts"],"mappings":";;;;;;;;;;;;;;;;UA6BiB;;WAEN,aAAa,SAAS;;WAEtB;;UAGM;;WAEN,aAAa,OAAO,OAAO;;WAE3B,gBAAgB,OAAO;;WAEvB,WAAW,OAAO,OAAO,SAAS;;;qBAGhC,oBAAoB;;qBAKpB;;qBAGA;;;;qBAOA,yBAAyB;;;;;;;;;qBAiCzB,kBAAiB,MAAM,MAAM;;qBA0B7B,aAAc;WAChB,cAAc,SAAS;WACvB,YAAY,SAAS;MAC5B,MAAM,MAAM;;;KC3GJ,mBAAmB,kBAAkB;KACrC,mBAAmB,kBAAkB;;UAGhC,YAAY;WAClB,OAAO;WACP;WACA,UAAU;;;;;;;;;;;;;qBAQR,uBAAuB;UAuBnB;;WAEN,UAAU,GACjB,mBACA,MAAM,QAAQ,qBAAqB,QAAQ,YAAY,QACpD,OAAO,OAAO,GAAG;;WAEb,cACP,mBACA,MAAM,QAAQ,qBAAqB,QAAQ,0BACxC,OAAO,aAAa;;WAEhB,oBAAoB,GAC3B,mBACA,6BACA,WAAW,SAAS,kBACpB,MAAM,QAAQ,qBA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mB;KAEnB;;WAGG;;WAEA;;WAEA,mBAAmB;;WAEnB;;;WAIA;;WAEA;;UAGE;WACN;WACA;WACA;WACA;WACA;WACA;;YAGC,UAAU,2BAA2B,cAAc,0BAA0B;qBAC5E,2BAAO,cAAA;;;;;;;qBAGP,0BAA0B;MAIxB;;;;;;;;;;;;qBASF,gCAAgC;MAS9B;;;;;;;;qBAOF,yBAAyB;MAKvB;;;;;;qBAMF,+BAA+B;MAI7B;;;;;;;qBAMF,wBAAwB;MAItB;;;;;qBC5GF;;UAMI;WACN;;WAEA;;WAEA;;WAEA;;WAEA;;WAEA;;WAEA;WACA;;WAEA;;;;;qBAGE,uBAAuB;MAGrB;;;UAME;WACN;WACA,KAAK,SAAS;;;;;;;;qBAuIZ,YAAa,OAAO,mBAAiB,OAAO,OAAO,WAAW;;;;;;;qBAgB9D,gBAAiB,iBAAiB,QAAQ;;;;qBCzH1C;;;;;;;;;qBA+WA,QACX;WAAoB;MACnB,MAAM,MAAM,cAAc,oBAAoB"}
1
+ {"version":3,"file":"index.d.ts","names":[],"sources":["../src/Credentials.ts","../src/ManagementApi.ts","../src/Providers.ts","../src/Push.ts","../src/Deployment.ts","../src/Component.ts","../src/Project.ts","../src/RunRecord.ts","../src/State.ts"],"mappings":";;;;;;;;;;;;;;;;UA6BiB;;WAEN,aAAa,SAAS;;WAEtB;;UAGM;;WAEN,aAAa,OAAO,OAAO;;WAE3B,gBAAgB,OAAO;;WAEvB,WAAW,OAAO,OAAO,SAAS;;;qBAGhC,oBAAoB;;qBAKpB;;qBAGA;;;;qBAOA,yBAAyB;;;;;;;;;qBAiCzB,kBAAiB,MAAM,MAAM;;qBA0B7B,aAAc;WAChB,cAAc,SAAS;WACvB,YAAY,SAAS;MAC5B,MAAM,MAAM;;;KC3GJ,mBAAmB,kBAAkB;KACrC,mBAAmB,kBAAkB;;UAGhC,YAAY;WAClB,OAAO;WACP;WACA,UAAU;;;;;;;;;;;;;qBAQR,uBAAuB;UAuBnB;;WAEN,UA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A;;;;;;;;;;qBAMrD,iCAAiC;MAU/B;;;;;;qBAMF,qCAAqC;MAInC;;;;;;;;;qBAMF,4BAA4B;MAS1B;;;;;UC1OE;WACN;WACA;WACA;;;;;;;;;qBAUE,gBAAiB;EAC5B,YAAY;EACZ;EACA,WAAW;MACZ,OAAA,yBAAA;;;;KCWW,mBAAmB;KAEnB;;WAGG;;WAEA;;WAEA,mBAAmB;;WAEnB;;;WAIA;;WAEA;;UAGE;WACN;WACA;WACA;WACA;WACA;WACA;;YAGC,UAAU,2BAA2B,cAAc,0BAA0B;qBAC5E,2BAAO,cAAA;;;;;;;qBAGP,0BAA0B;MAIxB;;;;;;;;;;;;qBASF,gCAAgC;MAS9B;;;;;;;;qBAOF,yBAAyB;MAKvB;;;;;;qBAMF,+BAA+B;MAI7B;;;;;;;qBAMF,wBAAwB;MAItB;;;;;qBC5GF;;UAMI;WACN;;WAEA;;WAEA;;WAEA;;WAEA;;WAEA;;WAEA;WACA;;WAEA;;;;;qBAGE,uBAAuB;MAGrB;;;UAME;WACN;WACA,KAAK,SAAS;;;;;;;;qBAuIZ,YAAa,OAAO,mBAAiB,OAAO,OAAO,WAAW;;;;;;;qBAgB9D,gBAAiB,iBAAiB,QAAQ;;;;qBCxH1C;;;;;;;;;qBAgXA,QACX;WAAoB;MACnB,MAAM,MAAM,cAAc,oBAAoB"}
package/lib/index.js CHANGED
@@ -1663,7 +1663,8 @@ const storeVersion = (api) => api.call("state:version", {}).pipe(Effect.flatMap(
1663
1663
  * The functions directory of the store app, `src/store/convex` of this
1664
1664
  * package. This file is `src/State.ts` in a checkout and a chunk in `lib/`
1665
1665
  * in the installed package, which ships `src` too, so the directory is
1666
- * `../src/store/convex` from either place.
1666
+ * `../src/store/convex` from either place. Its `convex.config.ts` mounts the
1667
+ * alchemyState component of `src/store/component`, inside the same push root.
1667
1668
  */
1668
1669
  const storeDirectory = () => join(dirname(fileURLToPath(import.meta.url)), "..", "src", "store", "convex");
1669
1670
  /**
@@ -1673,7 +1674,7 @@ const storeDirectory = () => join(dirname(fileURLToPath(import.meta.url)), "..",
1673
1674
  */
1674
1675
  const pushStore = (options, deployment) => Effect.gen(function* () {
1675
1676
  const cli = yield* installedCli(join(options.store, ".."));
1676
- yield* Effect.logInfo(`Convex state: pushing the store version 3 to ${deployment.name}`);
1677
+ yield* Effect.logInfo(`Convex state: pushing the store version 4 to ${deployment.name}`);
1677
1678
  yield* withPushKey(options.api, deployment.name, PUSH_KEY_ACTIONS, (key) => push(options.spawner, key, {
1678
1679
  deployment: deployment.name,
1679
1680
  url: deployment.deploymentUrl,
@@ -1737,15 +1738,15 @@ const makeConvexState = (options) => Effect.gen(function* () {
1737
1738
  return next.call(path, args);
1738
1739
  })))) };
1739
1740
  let version = yield* storeVersion(functions);
1740
- if (version === void 0 || version < 3) {
1741
+ if (version === void 0 || version < 4) {
1741
1742
  if (version === void 0 && deployment.lastDeployTime) return yield* failure(`project ${STORE_PROJECT_NAME} (${project.id}) of team ${team} has code that is not the state store, and Convex.state does not push over it. Rename that project in the Convex dashboard.`);
1742
1743
  version = yield* storeVersion(functions);
1743
- if (version === void 0 || version < 3) {
1744
+ if (version === void 0 || version < 4) {
1744
1745
  yield* pushStore(options, deployment);
1745
1746
  version = yield* storeVersion(functions);
1746
1747
  }
1747
1748
  }
1748
- if (version !== 3) return yield* failure(`${deployment.name} answers store version ${version ?? "none"}, and this package needs store version 3.`);
1749
+ if (version !== 4) return yield* failure(`${deployment.name} answers store version ${version ?? "none"}, and this package needs store version 4.`);
1749
1750
  const remote = remoteOf(functions, options.run);
1750
1751
  /** The stack's output plus the record, when the run has one and the output has a place for it. */
1751
1752
  const documentOf = (request) => Effect.gen(function* () {