alchemy 0.75.0 → 0.75.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.
Files changed (201) hide show
  1. package/bin/alchemy.js +25 -25
  2. package/bin/commands/util.ts +3 -1
  3. package/bin/services/execute-alchemy.ts +4 -2
  4. package/bin/services/github-workflow.ts +2 -3
  5. package/bin/services/package-manager.ts +1 -5
  6. package/lib/alchemy.d.ts +1 -1
  7. package/lib/alchemy.d.ts.map +1 -1
  8. package/lib/alchemy.js +1 -1
  9. package/lib/alchemy.js.map +1 -1
  10. package/lib/apply.js +10 -0
  11. package/lib/apply.js.map +1 -1
  12. package/lib/aws/control/types.d.ts.map +1 -1
  13. package/lib/aws/control/types.js.map +1 -1
  14. package/lib/clickhouse/api/sdk.gen.d.ts.map +1 -1
  15. package/lib/clickhouse/api/sdk.gen.js.map +1 -1
  16. package/lib/cloudflare/account-api-token.d.ts.map +1 -1
  17. package/lib/cloudflare/account-api-token.js.map +1 -1
  18. package/lib/cloudflare/bound.d.ts.map +1 -1
  19. package/lib/cloudflare/bucket.d.ts +1 -1
  20. package/lib/cloudflare/bucket.d.ts.map +1 -1
  21. package/lib/cloudflare/bucket.js +1 -1
  22. package/lib/cloudflare/bucket.js.map +1 -1
  23. package/lib/cloudflare/cloudflare-env-proxy.d.ts.map +1 -1
  24. package/lib/cloudflare/cloudflare-env-proxy.js +3 -3
  25. package/lib/cloudflare/cloudflare-env-proxy.js.map +1 -1
  26. package/lib/cloudflare/dns-records.js.map +1 -1
  27. package/lib/cloudflare/miniflare/delete.d.ts.map +1 -1
  28. package/lib/cloudflare/miniflare/delete.js +3 -0
  29. package/lib/cloudflare/miniflare/delete.js.map +1 -1
  30. package/lib/cloudflare/miniflare/paths.d.ts +0 -1
  31. package/lib/cloudflare/miniflare/paths.d.ts.map +1 -1
  32. package/lib/cloudflare/miniflare/paths.js +4 -17
  33. package/lib/cloudflare/miniflare/paths.js.map +1 -1
  34. package/lib/cloudflare/nuxt/plugin.d.ts.map +1 -1
  35. package/lib/cloudflare/nuxt/plugin.js +2 -2
  36. package/lib/cloudflare/nuxt/plugin.js.map +1 -1
  37. package/lib/cloudflare/react-router/plugin.d.ts.map +1 -1
  38. package/lib/cloudflare/react-router/plugin.js +0 -1
  39. package/lib/cloudflare/react-router/plugin.js.map +1 -1
  40. package/lib/cloudflare/vite/plugin.d.ts.map +1 -1
  41. package/lib/cloudflare/vite/plugin.js +3 -3
  42. package/lib/cloudflare/vite/plugin.js.map +1 -1
  43. package/lib/cloudflare/website.d.ts.map +1 -1
  44. package/lib/cloudflare/website.js +0 -4
  45. package/lib/cloudflare/website.js.map +1 -1
  46. package/lib/cloudflare/worker-assets.d.ts +1 -1
  47. package/lib/cloudflare/worker-assets.d.ts.map +1 -1
  48. package/lib/cloudflare/worker-assets.js +1 -1
  49. package/lib/cloudflare/worker-assets.js.map +1 -1
  50. package/lib/cloudflare/worker-metadata.d.ts.map +1 -1
  51. package/lib/cloudflare/worker-metadata.js.map +1 -1
  52. package/lib/cloudflare/worker-tail.d.ts.map +1 -1
  53. package/lib/cloudflare/worker-tail.js.map +1 -1
  54. package/lib/cloudflare/wrangler.json.js +0 -1
  55. package/lib/cloudflare/wrangler.json.js.map +1 -1
  56. package/lib/coinbase/evm-account.d.ts.map +1 -1
  57. package/lib/coinbase/evm-account.js.map +1 -1
  58. package/lib/coinbase/evm-smart-account.d.ts.map +1 -1
  59. package/lib/coinbase/evm-smart-account.js.map +1 -1
  60. package/lib/docker/api.d.ts.map +1 -1
  61. package/lib/docker/api.js.map +1 -1
  62. package/lib/github/secret.d.ts.map +1 -1
  63. package/lib/github/secret.js.map +1 -1
  64. package/lib/neon/api/sdk.gen.d.ts.map +1 -1
  65. package/lib/neon/api/sdk.gen.js.map +1 -1
  66. package/lib/os/exec.d.ts.map +1 -1
  67. package/lib/os/exec.js.map +1 -1
  68. package/lib/planetscale/api/sdk.gen.d.ts.map +1 -1
  69. package/lib/planetscale/api/sdk.gen.js.map +1 -1
  70. package/lib/prisma-postgres/api/sdk.gen.d.ts.map +1 -1
  71. package/lib/prisma-postgres/api/sdk.gen.js.map +1 -1
  72. package/lib/scope.d.ts.map +1 -1
  73. package/lib/scope.js +2 -2
  74. package/lib/scope.js.map +1 -1
  75. package/lib/sentry/client-key.js +1 -1
  76. package/lib/sentry/client-key.js.map +1 -1
  77. package/lib/test/bun.d.ts.map +1 -1
  78. package/lib/test/bun.js.map +1 -1
  79. package/lib/test/vitest.d.ts.map +1 -1
  80. package/lib/test/vitest.js.map +1 -1
  81. package/lib/util/api/client/client.gen.d.ts +1 -1
  82. package/lib/util/api/client/client.gen.js +45 -45
  83. package/lib/util/api/client/types.gen.d.ts +22 -22
  84. package/lib/util/api/client/utils.gen.d.ts +3 -3
  85. package/lib/util/api/client/utils.gen.d.ts.map +1 -1
  86. package/lib/util/api/client/utils.gen.js +34 -34
  87. package/lib/util/api/client/utils.gen.js.map +1 -1
  88. package/lib/util/api/core/auth.gen.d.ts +3 -3
  89. package/lib/util/api/core/auth.gen.js +3 -3
  90. package/lib/util/api/core/bodySerializer.gen.d.ts +1 -1
  91. package/lib/util/api/core/bodySerializer.gen.js +3 -3
  92. package/lib/util/api/core/params.gen.d.ts +3 -3
  93. package/lib/util/api/core/params.gen.js +7 -7
  94. package/lib/util/api/core/pathSerializer.gen.d.ts +3 -3
  95. package/lib/util/api/core/pathSerializer.gen.js +36 -36
  96. package/lib/util/api/core/serverSentEvents.gen.d.ts +3 -3
  97. package/lib/util/api/core/serverSentEvents.gen.js +18 -18
  98. package/lib/util/api/core/types.gen.d.ts +4 -4
  99. package/lib/util/api/core/utils.gen.d.ts +1 -1
  100. package/lib/util/api/core/utils.gen.js +17 -17
  101. package/lib/util/camel-to-snake.d.ts.map +1 -1
  102. package/lib/util/find-workspace-root.d.ts +3 -0
  103. package/lib/util/find-workspace-root.d.ts.map +1 -0
  104. package/lib/util/find-workspace-root.js +64 -0
  105. package/lib/util/find-workspace-root.js.map +1 -0
  106. package/lib/util/idempotent-spawn.d.ts.map +1 -1
  107. package/lib/util/idempotent-spawn.js +1 -1
  108. package/lib/util/idempotent-spawn.js.map +1 -1
  109. package/lib/util/peer.d.ts.map +1 -1
  110. package/lib/util/peer.js.map +1 -1
  111. package/package.json +1 -1
  112. package/src/alchemy.ts +4 -3
  113. package/src/apply.ts +16 -1
  114. package/src/aws/control/types.ts +87107 -85281
  115. package/src/clickhouse/api/sdk.gen.ts +1 -3
  116. package/src/cloudflare/account-api-token.ts +3 -1
  117. package/src/cloudflare/bound.ts +64 -65
  118. package/src/cloudflare/bucket.ts +4 -7
  119. package/src/cloudflare/cloudflare-env-proxy.ts +2 -4
  120. package/src/cloudflare/dns-records.ts +3 -1
  121. package/src/cloudflare/miniflare/delete.ts +3 -0
  122. package/src/cloudflare/miniflare/paths.ts +4 -25
  123. package/src/cloudflare/nuxt/plugin.ts +1 -4
  124. package/src/cloudflare/react-router/plugin.ts +0 -1
  125. package/src/cloudflare/vite/plugin.ts +1 -3
  126. package/src/cloudflare/website.ts +0 -5
  127. package/src/cloudflare/worker-assets.ts +1 -6
  128. package/src/cloudflare/worker-metadata.ts +5 -3
  129. package/src/cloudflare/worker-tail.ts +3 -1
  130. package/src/cloudflare/wrangler.json.ts +0 -1
  131. package/src/coinbase/evm-account.ts +3 -1
  132. package/src/coinbase/evm-smart-account.ts +3 -1
  133. package/src/docker/api.ts +3 -1
  134. package/src/github/secret.ts +5 -1
  135. package/src/neon/api/sdk.gen.ts +1 -3
  136. package/src/os/exec.ts +3 -1
  137. package/src/planetscale/api/sdk.gen.ts +1 -3
  138. package/src/prisma-postgres/api/sdk.gen.ts +1 -3
  139. package/src/scope.ts +2 -2
  140. package/src/sentry/client-key.ts +1 -5
  141. package/src/test/bun.ts +3 -1
  142. package/src/test/vitest.ts +3 -1
  143. package/src/util/api/client/client.gen.ts +49 -49
  144. package/src/util/api/client/types.gen.ts +43 -43
  145. package/src/util/api/client/utils.gen.ts +47 -42
  146. package/src/util/api/core/auth.gen.ts +6 -6
  147. package/src/util/api/core/bodySerializer.gen.ts +4 -4
  148. package/src/util/api/core/params.gen.ts +10 -10
  149. package/src/util/api/core/pathSerializer.gen.ts +39 -39
  150. package/src/util/api/core/serverSentEvents.gen.ts +22 -22
  151. package/src/util/api/core/types.gen.ts +12 -12
  152. package/src/util/api/core/utils.gen.ts +18 -18
  153. package/src/util/camel-to-snake.ts +12 -10
  154. package/{bin/services → src/util}/find-workspace-root.ts +26 -4
  155. package/src/util/idempotent-spawn.ts +1 -5
  156. package/src/util/peer.ts +3 -1
  157. package/templates/astro/astro.config.mjs +3 -3
  158. package/templates/astro/src/pages/api/hello.ts +16 -13
  159. package/templates/bun-spa/bun-env.d.ts +0 -1
  160. package/templates/bun-spa/eslint.config.js +11 -12
  161. package/templates/bun-spa/src/App.tsx +0 -1
  162. package/templates/bun-spa/src/frontend.tsx +0 -1
  163. package/templates/hono/src/index.ts +13 -13
  164. package/templates/nextjs/alchemy.run.ts +1 -1
  165. package/templates/nextjs/eslint.config.mjs +1 -1
  166. package/templates/nextjs/next-env.d.ts +1 -1
  167. package/templates/nextjs/next.config.ts +1 -1
  168. package/templates/nextjs/open-next.config.ts +1 -1
  169. package/templates/nextjs/src/app/api/hello/route.ts +2 -2
  170. package/templates/nextjs/src/app/layout.tsx +1 -1
  171. package/templates/nextjs/src/app/page.tsx +14 -15
  172. package/templates/nextjs/types/env.d.ts +4 -4
  173. package/templates/nuxt/server/middleware/auth.ts +1 -1
  174. package/templates/nuxt/server/middleware/hello.ts +2 -2
  175. package/templates/react-router/app/entry.server.tsx +2 -2
  176. package/templates/react-router/vite.config.ts +1 -1
  177. package/templates/react-router/workers/app.ts +2 -2
  178. package/templates/rwsdk/alchemy.run.ts +6 -3
  179. package/templates/sveltekit/src/app.d.ts +7 -7
  180. package/templates/sveltekit/svelte.config.js +4 -4
  181. package/templates/sveltekit/vite.config.ts +3 -3
  182. package/templates/tanstack-start/src/components/Header.tsx +2 -2
  183. package/templates/tanstack-start/src/router.tsx +4 -4
  184. package/templates/tanstack-start/src/routes/__root.tsx +10 -10
  185. package/templates/tanstack-start/src/routes/api.demo-names.ts +6 -6
  186. package/templates/tanstack-start/src/routes/demo.start.api-request.tsx +11 -11
  187. package/templates/tanstack-start/src/routes/demo.start.server-funcs.tsx +30 -30
  188. package/templates/tanstack-start/src/routes/index.tsx +5 -5
  189. package/templates/tanstack-start/vite.config.ts +9 -9
  190. package/templates/typescript/src/worker.ts +5 -1
  191. package/templates/vite/eslint.config.js +12 -12
  192. package/templates/vite/src/App.tsx +7 -7
  193. package/templates/vite/src/main.tsx +6 -6
  194. package/templates/vite/src/worker.ts +11 -12
  195. package/templates/vite/vite.config.ts +2 -2
  196. package/workers/tunnel-proxy.js +1 -1
  197. package/lib/cloudflare/miniflare/symlink-miniflare-state.d.ts +0 -2
  198. package/lib/cloudflare/miniflare/symlink-miniflare-state.d.ts.map +0 -1
  199. package/lib/cloudflare/miniflare/symlink-miniflare-state.js +0 -18
  200. package/lib/cloudflare/miniflare/symlink-miniflare-state.js.map +0 -1
  201. package/src/cloudflare/miniflare/symlink-miniflare-state.ts +0 -18
@@ -200,9 +200,7 @@ export type Options<
200
200
  class _HeyApiClient {
201
201
  protected _client: Client = client;
202
202
 
203
- constructor(args?: {
204
- client?: Client;
205
- }) {
203
+ constructor(args?: { client?: Client }) {
206
204
  if (args?.client) {
207
205
  this._client = args.client;
208
206
  }
@@ -360,7 +360,9 @@ export const AccountApiToken = Resource(
360
360
  }));
361
361
 
362
362
  throw new Error(
363
- `Error ${this.phase === "update" ? "updating" : "creating"} token '${tokenName}': ${
363
+ `Error ${
364
+ this.phase === "update" ? "updating" : "creating"
365
+ } token '${tokenName}': ${
364
366
  errorData.errors?.[0]?.message || response.statusText
365
367
  }`,
366
368
  );
@@ -37,69 +37,68 @@ type BoundWorker<
37
37
  >]: Rpc.Provider<RPC, "fetch" | "connect">[property];
38
38
  };
39
39
 
40
- export type Bound<T extends Binding> = T extends _DurableObjectNamespace<
41
- infer O
42
- >
43
- ? DurableObjectNamespace<O & Rpc.DurableObjectBranded>
44
- : T extends { type: "kv_namespace" }
45
- ? KVNamespace
46
- : T extends WorkerStub<infer RPC>
47
- ? BoundWorker<RPC>
48
- : T extends _Worker<any, infer RPC> | WorkerRef<infer RPC>
40
+ export type Bound<T extends Binding> =
41
+ T extends _DurableObjectNamespace<infer O>
42
+ ? DurableObjectNamespace<O & Rpc.DurableObjectBranded>
43
+ : T extends { type: "kv_namespace" }
44
+ ? KVNamespace
45
+ : T extends WorkerStub<infer RPC>
49
46
  ? BoundWorker<RPC>
50
- : T extends { type: "service" }
51
- ? Service
52
- : T extends _R2Bucket
53
- ? R2Bucket
54
- : T extends _Hyperdrive | HyperdriveRef
55
- ? Hyperdrive
56
- : T extends Secret
57
- ? string
58
- : T extends CloudflareSecret | CloudflareSecretRef
59
- ? SecretsStoreSecret
60
- : T extends SecretKey
61
- ? CryptoKey
62
- : T extends Assets
63
- ? Service
64
- : T extends _Workflow<infer P>
65
- ? Workflow<P>
66
- : T extends _D1Database
67
- ? D1Database
68
- : T extends DispatchNamespace
69
- ? DispatchNamespace
70
- : T extends _WorkerLoader
71
- ? WorkerLoader
72
- : T extends _VectorizeIndex
73
- ? VectorizeIndex
74
- : T extends _Queue<infer Body>
75
- ? Queue<Body>
76
- : T extends _AnalyticsEngineDataset
77
- ? AnalyticsEngineDataset
78
- : T extends _Pipeline<infer R>
79
- ? Pipeline<R>
80
- : T extends _RateLimit
81
- ? RateLimit
82
- : T extends string
83
- ? T
84
- : T extends BrowserRendering
85
- ? Fetcher
86
- : T extends _Ai<infer M>
87
- ? Ai<M>
88
- : T extends _Images
89
- ? ImagesBinding
90
- : T extends _VersionMetadata
91
- ? WorkerVersionMetadata
92
- : T extends Self
93
- ? Service
94
- : T extends Json<infer T>
95
- ? T
96
- : T extends _Container<
97
- infer Obj
98
- >
99
- ? DurableObjectNamespace<
100
- Obj &
101
- Rpc.DurableObjectBranded
102
- >
103
- : T extends undefined
104
- ? undefined
105
- : Service;
47
+ : T extends _Worker<any, infer RPC> | WorkerRef<infer RPC>
48
+ ? BoundWorker<RPC>
49
+ : T extends { type: "service" }
50
+ ? Service
51
+ : T extends _R2Bucket
52
+ ? R2Bucket
53
+ : T extends _Hyperdrive | HyperdriveRef
54
+ ? Hyperdrive
55
+ : T extends Secret
56
+ ? string
57
+ : T extends CloudflareSecret | CloudflareSecretRef
58
+ ? SecretsStoreSecret
59
+ : T extends SecretKey
60
+ ? CryptoKey
61
+ : T extends Assets
62
+ ? Service
63
+ : T extends _Workflow<infer P>
64
+ ? Workflow<P>
65
+ : T extends _D1Database
66
+ ? D1Database
67
+ : T extends DispatchNamespace
68
+ ? DispatchNamespace
69
+ : T extends _WorkerLoader
70
+ ? WorkerLoader
71
+ : T extends _VectorizeIndex
72
+ ? VectorizeIndex
73
+ : T extends _Queue<infer Body>
74
+ ? Queue<Body>
75
+ : T extends _AnalyticsEngineDataset
76
+ ? AnalyticsEngineDataset
77
+ : T extends _Pipeline<infer R>
78
+ ? Pipeline<R>
79
+ : T extends _RateLimit
80
+ ? RateLimit
81
+ : T extends string
82
+ ? T
83
+ : T extends BrowserRendering
84
+ ? Fetcher
85
+ : T extends _Ai<infer M>
86
+ ? Ai<M>
87
+ : T extends _Images
88
+ ? ImagesBinding
89
+ : T extends _VersionMetadata
90
+ ? WorkerVersionMetadata
91
+ : T extends Self
92
+ ? Service
93
+ : T extends Json<infer T>
94
+ ? T
95
+ : T extends _Container<
96
+ infer Obj
97
+ >
98
+ ? DurableObjectNamespace<
99
+ Obj &
100
+ Rpc.DurableObjectBranded
101
+ >
102
+ : T extends undefined
103
+ ? undefined
104
+ : Service;
@@ -1007,7 +1007,9 @@ export async function listBuckets(
1007
1007
  }
1008
1008
 
1009
1009
  // Build URL with query parameters
1010
- const path = `/accounts/${api.accountId}/r2/buckets${params.toString() ? `?${params.toString()}` : ""}`;
1010
+ const path = `/accounts/${api.accountId}/r2/buckets${
1011
+ params.toString() ? `?${params.toString()}` : ""
1012
+ }`;
1011
1013
 
1012
1014
  // Make the API request
1013
1015
  const result = await extractCloudflareResult<{
@@ -1262,12 +1264,7 @@ function mapHeadersToHttpMetadata(headers: Headers): R2HTTPMetadata {
1262
1264
 
1263
1265
  export async function putObject(
1264
1266
  api: CloudflareApi,
1265
- {
1266
- bucketName,
1267
- key,
1268
- object,
1269
- options,
1270
- }: {
1267
+ { bucketName, key, object, options }: {
1271
1268
  bucketName: string;
1272
1269
  key: string;
1273
1270
  object: PutObjectObject;
@@ -3,7 +3,6 @@ import {
3
3
  getDefaultConfigPath,
4
4
  getDefaultPersistPath,
5
5
  validateConfigPath,
6
- validatePersistPath,
7
6
  } from "./miniflare/paths.ts";
8
7
 
9
8
  export const getCloudflareEnvProxy = async <E>(
@@ -22,12 +21,11 @@ export const getPlatformProxyOptions = (
22
21
  input.persist === false
23
22
  ? false
24
23
  : {
25
- path: validatePersistPath(
24
+ path:
26
25
  typeof input.persist === "object" &&
27
- typeof input.persist.path === "string"
26
+ typeof input.persist.path === "string"
28
27
  ? input.persist.path
29
28
  : getDefaultPersistPath(),
30
- ),
31
29
  };
32
30
  if (!persist) {
33
31
  const message =
@@ -314,7 +314,9 @@ async function createOrUpdateRecord(
314
314
  }
315
315
 
316
316
  throw new Error(
317
- `Failed to ${existingId ? "update" : "create"} DNS record ${record.name}: ${response.statusText}\nResponse: ${errorBody}`,
317
+ `Failed to ${
318
+ existingId ? "update" : "create"
319
+ } DNS record ${record.name}: ${response.statusText}\nResponse: ${errorBody}`,
318
320
  );
319
321
  }
320
322
 
@@ -38,6 +38,9 @@ export async function deleteMiniflareBinding(
38
38
  .catch(() => []);
39
39
  await Promise.all(files.map((file) => fs.rm(path.join(bindingPath, file))));
40
40
 
41
+ // if running E2E tests, do not delete the data directory to prevent race conditions in smoke tests
42
+ if (process.env.ALCHEMY_E2E) return;
43
+
41
44
  // delete data directory, if present
42
45
  await removeDirectory(path.join(persistRoot, type, id), {
43
46
  recursive: true,
@@ -1,7 +1,8 @@
1
1
  import { AsyncLocalStorage } from "node:async_hooks";
2
2
  // biome-ignore lint/style/noRestrictedImports: I/O is acceptable here
3
- import { existsSync, readlinkSync, statSync } from "node:fs";
3
+ import { existsSync } from "node:fs";
4
4
  import path from "pathe";
5
+ import { findWorkspaceRootSync } from "../../util/find-workspace-root.ts";
5
6
  import { ALCHEMY_ROOT } from "../../util/root-dir.ts";
6
7
 
7
8
  const dynamicImportContext = new AsyncLocalStorage<boolean>();
@@ -18,7 +19,8 @@ export const getDefaultConfigPath = (rootDir: string = process.cwd()) => {
18
19
  };
19
20
 
20
21
  export const getDefaultPersistPath = (rootDir: string = ALCHEMY_ROOT) => {
21
- return path.join(rootDir, ".alchemy", "miniflare", "v3");
22
+ const workspaceRoot = findWorkspaceRootSync(rootDir);
23
+ return path.join(workspaceRoot, ".alchemy", "miniflare", "v3");
22
24
  };
23
25
 
24
26
  export const validateConfigPath = (path: string, throws = true) => {
@@ -31,29 +33,6 @@ export const validateConfigPath = (path: string, throws = true) => {
31
33
  return path;
32
34
  };
33
35
 
34
- const DEFAULT_VALIDATE_PERSIST =
35
- process.env.NODE_ENV === "development" ||
36
- !process.argv.some((arg) => ["build", "prepare", "typegen"].includes(arg));
37
-
38
- export const validatePersistPath = (
39
- path: string,
40
- throws = DEFAULT_VALIDATE_PERSIST,
41
- ) => {
42
- try {
43
- const stat = statSync(path);
44
- if (stat.isSymbolicLink()) {
45
- return readlinkSync(path);
46
- }
47
- return path;
48
- } catch {
49
- warnOrThrow(
50
- `The Alchemy data path, "${path}", could not be resolved. This is required for Cloudflare bindings during development. Please run \`alchemy dev\` to create it.`,
51
- throws,
52
- );
53
- return path;
54
- }
55
- };
56
-
57
36
  const warned = new Set<string>();
58
37
 
59
38
  const warnOrThrow = (message: string, throws: boolean) => {
@@ -3,7 +3,6 @@ import {
3
3
  getDefaultConfigPath,
4
4
  getDefaultPersistPath,
5
5
  validateConfigPath,
6
- validatePersistPath,
7
6
  } from "../miniflare/paths.ts";
8
7
 
9
8
  const alchemy = (
@@ -15,9 +14,7 @@ const alchemy = (
15
14
  configPath: validateConfigPath(
16
15
  options.dev?.configPath ?? getDefaultConfigPath(),
17
16
  ),
18
- persistDir: validatePersistPath(
19
- options.dev?.persistDir ?? getDefaultPersistPath(),
20
- ),
17
+ persistDir: options.dev?.persistDir ?? getDefaultPersistPath(),
21
18
  ...options.dev,
22
19
  },
23
20
  ...options,
@@ -1,5 +1,4 @@
1
1
  import type { PluginConfig } from "@cloudflare/vite-plugin";
2
- // biome-ignore lint/style/noRestrictedImports: I/O is acceptable here
3
2
  import { existsSync, mkdirSync, writeFileSync } from "node:fs";
4
3
  import { dirname } from "pathe";
5
4
  import { getDefaultConfigPath } from "../miniflare/paths.ts";
@@ -5,17 +5,15 @@ import {
5
5
  getDefaultConfigPath,
6
6
  getDefaultPersistPath,
7
7
  validateConfigPath,
8
- validatePersistPath,
9
8
  } from "../miniflare/paths.ts";
10
9
 
11
10
  const alchemy = (config?: PluginConfig): PluginOption => {
12
11
  const persistState = config?.persistState ?? {
13
- path: validatePersistPath(
12
+ path:
14
13
  typeof config?.persistState === "object"
15
14
  ? config.persistState.path
16
15
  : // persist path should default to the /.alchemy/miniflare/v3
17
16
  getDefaultPersistPath(),
18
- ),
19
17
  };
20
18
  if (typeof persistState === "object" && persistState.path.endsWith("v3")) {
21
19
  persistState.path = path.dirname(persistState.path);
@@ -9,7 +9,6 @@ import { Assets } from "./assets.ts";
9
9
  import type { Bindings } from "./bindings.ts";
10
10
  import { DEFAULT_COMPATIBILITY_DATE } from "./compatibility-date.gen.ts";
11
11
  import { unionCompatibilityFlags } from "./compatibility-presets.ts";
12
- import { writeMiniflareSymlink } from "./miniflare/symlink-miniflare-state.ts";
13
12
  import {
14
13
  extractStringAndSecretBindings,
15
14
  unencryptSecrets,
@@ -263,10 +262,6 @@ export async function Website<B extends Bindings>(
263
262
  await fs.writeFile(paths.entrypoint, content);
264
263
  }
265
264
 
266
- if (Scope.current.local) {
267
- await writeMiniflareSymlink(Scope.current.rootDir, paths.cwd);
268
- }
269
-
270
265
  await WranglerJson({
271
266
  path: path.relative(paths.cwd, paths.wrangler.path),
272
267
  worker,
@@ -30,12 +30,7 @@ interface FileMetadata {
30
30
  */
31
31
  export async function uploadAssets(
32
32
  api: CloudflareApi,
33
- {
34
- workerName,
35
- assets,
36
- assetConfig,
37
- namespace,
38
- }: {
33
+ { workerName, assets, assetConfig, namespace }: {
39
34
  workerName: string;
40
35
  assets: Assets;
41
36
  assetConfig?: WorkerProps["assets"];
@@ -239,9 +239,11 @@ export async function prepareWorkerMetadata(
239
239
  };
240
240
  },
241
241
  ): Promise<WorkerMetadata> {
242
- const oldSettings = await (props.unstable_cacheWorkerSettings
243
- ? getWorkerSettingsWithCache
244
- : getWorkerSettings)(api, props.workerName);
242
+ const oldSettings = await (
243
+ props.unstable_cacheWorkerSettings
244
+ ? getWorkerSettingsWithCache
245
+ : getWorkerSettings
246
+ )(api, props.workerName);
245
247
  const oldTags: string[] | undefined = Array.from(
246
248
  new Set([
247
249
  ...(oldSettings?.default_environment?.script?.tags ?? []),
@@ -110,7 +110,9 @@ class TailClient {
110
110
  const status = event.response?.status ?? 500;
111
111
  // TODO: make this look nicer
112
112
  logger.log(
113
- `${prefix} ${pc.gray(event.request.method)} ${url.pathname} ${pc.dim(">")} ${status >= 200 && status < 300 ? pc.green(status) : pc.red(status)} ${pc.gray(`(cpu: ${Math.round(data.cpuTime)}ms, wall: ${Math.round(data.wallTime)}ms)`)}`,
113
+ `${prefix} ${pc.gray(event.request.method)} ${url.pathname} ${pc.dim(">")} ${
114
+ status >= 200 && status < 300 ? pc.green(status) : pc.red(status)
115
+ } ${pc.gray(`(cpu: ${Math.round(data.cpuTime)}ms, wall: ${Math.round(data.wallTime)}ms)`)}`,
114
116
  );
115
117
  }
116
118
  for (const log of data.logs) {
@@ -861,7 +861,6 @@ function processBindings(
861
861
  });
862
862
  } else {
863
863
  console.log("binding", binding);
864
- // biome-ignore lint/correctness/noVoidTypeReturn: it returns never
865
864
  return assertNever(binding);
866
865
  }
867
866
  }
@@ -207,7 +207,9 @@ export const EvmAccount = Resource(
207
207
  );
208
208
 
209
209
  console.log(
210
- `💧 Requested ${toFund.length} new faucet fund${toFund.length === 1 ? "" : "s"} for ${this.output.address}`,
210
+ `💧 Requested ${toFund.length} new faucet fund${
211
+ toFund.length === 1 ? "" : "s"
212
+ } for ${this.output.address}`,
211
213
  );
212
214
  }
213
215
  } catch (error: any) {
@@ -234,7 +234,9 @@ export const EvmSmartAccount = Resource(
234
234
  );
235
235
 
236
236
  console.log(
237
- `💧 Requested ${toFund.length} new faucet fund${toFund.length === 1 ? "" : "s"} for smart account ${this.output.address}`,
237
+ `💧 Requested ${toFund.length} new faucet fund${
238
+ toFund.length === 1 ? "" : "s"
239
+ } for smart account ${this.output.address}`,
238
240
  );
239
241
  }
240
242
  } catch (error: any) {
package/src/docker/api.ts CHANGED
@@ -159,7 +159,9 @@ export class DockerApi {
159
159
  return true;
160
160
  } catch (error) {
161
161
  console.log(
162
- `Docker daemon not running: ${error instanceof Error ? error.message : String(error)}`,
162
+ `Docker daemon not running: ${
163
+ error instanceof Error ? error.message : String(error)
164
+ }`,
163
165
  );
164
166
  return false;
165
167
  }
@@ -190,7 +190,11 @@ export const GitHubSecret = Resource(
190
190
  // If secret type changed, we need to delete the old one first
191
191
  if (secretTypeChanged) {
192
192
  logger.log(
193
- `Secret type changed from ${wasEnvironmentSecret ? "environment" : "repository"} to ${isEnvironmentSecret ? "environment" : "repository"} secret. Deleting the old secret first.`,
193
+ `Secret type changed from ${
194
+ wasEnvironmentSecret ? "environment" : "repository"
195
+ } to ${
196
+ isEnvironmentSecret ? "environment" : "repository"
197
+ } secret. Deleting the old secret first.`,
194
198
  );
195
199
 
196
200
  try {
@@ -338,9 +338,7 @@ export type Options<
338
338
  class _HeyApiClient {
339
339
  protected _client: Client = client;
340
340
 
341
- constructor(args?: {
342
- client?: Client;
343
- }) {
341
+ constructor(args?: { client?: Client }) {
344
342
  if (args?.client) {
345
343
  this._client = args.client;
346
344
  }
package/src/os/exec.ts CHANGED
@@ -356,7 +356,9 @@ export async function exec(
356
356
  } else {
357
357
  reject(
358
358
  new Error(
359
- `Command failed with exit code ${code}${stderr ? `: ${stderr}` : ""}`,
359
+ `Command failed with exit code ${code}${
360
+ stderr ? `: ${stderr}` : ""
361
+ }`,
360
362
  ),
361
363
  );
362
364
  }
@@ -355,9 +355,7 @@ export type Options<
355
355
  class _HeyApiClient {
356
356
  protected _client: Client = client;
357
357
 
358
- constructor(args?: {
359
- client?: Client;
360
- }) {
358
+ constructor(args?: { client?: Client }) {
361
359
  if (args?.client) {
362
360
  this._client = args.client;
363
361
  }
@@ -86,9 +86,7 @@ export type Options<
86
86
  class _HeyApiClient {
87
87
  protected _client: Client = client;
88
88
 
89
- constructor(args?: {
90
- client?: Client;
91
- }) {
89
+ constructor(args?: { client?: Client }) {
92
90
  if (args?.client) {
93
91
  this._client = args.client;
94
92
  }
package/src/scope.ts CHANGED
@@ -173,8 +173,8 @@ export class Scope {
173
173
 
174
174
  public static readonly KIND = "alchemy::Scope" as const;
175
175
 
176
- public static storage = (globalThis.__ALCHEMY_STORAGE__ ??=
177
- new AsyncLocalStorage<Scope>());
176
+ public static storage = globalThis.__ALCHEMY_STORAGE__ ??=
177
+ new AsyncLocalStorage<Scope>();
178
178
 
179
179
  public static getScope(): Scope | undefined {
180
180
  return Scope.storage.getStore();
@@ -340,11 +340,7 @@ async function findClientKeyByName(
340
340
  */
341
341
  async function getClientKeyName(
342
342
  api: SentryApi,
343
- {
344
- organization,
345
- project,
346
- keyId,
347
- }: {
343
+ { organization, project, keyId }: {
348
344
  organization: string;
349
345
  project: string;
350
346
  keyId: string;
package/src/test/bun.ts CHANGED
@@ -98,7 +98,9 @@ export function test(meta: ImportMeta, defaultOptions?: TestOptions): test {
98
98
  // Create local test scope based on filename
99
99
  const scope = new Scope({
100
100
  parent: undefined,
101
- scopeName: `${defaultOptions.prefix ? `${defaultOptions.prefix}-` : ""}${path.basename(meta.filename)}`,
101
+ scopeName: `${
102
+ defaultOptions.prefix ? `${defaultOptions.prefix}-` : ""
103
+ }${path.basename(meta.filename)}`,
102
104
  // parent: globalTestScope,
103
105
  stateStore: defaultOptions?.stateStore,
104
106
  phase: "up",
@@ -128,7 +128,9 @@ export function test(
128
128
 
129
129
  const scope = new Scope({
130
130
  parent: undefined,
131
- scopeName: `${defaultOptions.prefix ? `${defaultOptions.prefix}-` : ""}${path.basename(meta.filename)}`,
131
+ scopeName: `${
132
+ defaultOptions.prefix ? `${defaultOptions.prefix}-` : ""
133
+ }${path.basename(meta.filename)}`,
132
134
  stateStore: defaultOptions?.stateStore,
133
135
  phase: "up",
134
136
  noTrack: true,