alchemy 2.0.0-beta.78 → 2.0.0-beta.79

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 (106) hide show
  1. package/bin/cli.js +25 -65
  2. package/bin/exec.js +1 -1
  3. package/bin/tsconfig.json +5 -0
  4. package/lib/Cloudflare/Workers/InferEnv.d.ts +3 -1
  5. package/lib/Cloudflare/Workers/InferEnv.d.ts.map +1 -1
  6. package/lib/Cloudflare/Workers/Worker.d.ts +5 -2
  7. package/lib/Cloudflare/Workers/Worker.d.ts.map +1 -1
  8. package/lib/Cloudflare/Workers/Worker.js.map +1 -1
  9. package/lib/Prisma/Providers.d.ts +4 -1
  10. package/lib/Prisma/Providers.d.ts.map +1 -1
  11. package/lib/Prisma/Providers.js +7 -2
  12. package/lib/Prisma/Providers.js.map +1 -1
  13. package/lib/Prisma/Website/Artifact.d.ts +52 -0
  14. package/lib/Prisma/Website/Artifact.d.ts.map +1 -0
  15. package/lib/Prisma/Website/Artifact.js +285 -0
  16. package/lib/Prisma/Website/Artifact.js.map +1 -0
  17. package/lib/Prisma/Website/Astro.d.ts +62 -0
  18. package/lib/Prisma/Website/Astro.d.ts.map +1 -0
  19. package/lib/Prisma/Website/Astro.js +50 -0
  20. package/lib/Prisma/Website/Astro.js.map +1 -0
  21. package/lib/Prisma/Website/Foldkit.d.ts +30 -0
  22. package/lib/Prisma/Website/Foldkit.d.ts.map +1 -0
  23. package/lib/Prisma/Website/Foldkit.js +30 -0
  24. package/lib/Prisma/Website/Foldkit.js.map +1 -0
  25. package/lib/Prisma/Website/FrameworkSite.d.ts +82 -0
  26. package/lib/Prisma/Website/FrameworkSite.d.ts.map +1 -0
  27. package/lib/Prisma/Website/FrameworkSite.js +96 -0
  28. package/lib/Prisma/Website/FrameworkSite.js.map +1 -0
  29. package/lib/Prisma/Website/Nextjs.d.ts +35 -0
  30. package/lib/Prisma/Website/Nextjs.d.ts.map +1 -0
  31. package/lib/Prisma/Website/Nextjs.js +37 -0
  32. package/lib/Prisma/Website/Nextjs.js.map +1 -0
  33. package/lib/Prisma/Website/Nuxt.d.ts +37 -0
  34. package/lib/Prisma/Website/Nuxt.d.ts.map +1 -0
  35. package/lib/Prisma/Website/Nuxt.js +37 -0
  36. package/lib/Prisma/Website/Nuxt.js.map +1 -0
  37. package/lib/Prisma/Website/Octane.d.ts +35 -0
  38. package/lib/Prisma/Website/Octane.d.ts.map +1 -0
  39. package/lib/Prisma/Website/Octane.js +36 -0
  40. package/lib/Prisma/Website/Octane.js.map +1 -0
  41. package/lib/Prisma/Website/ReactRouter.d.ts +35 -0
  42. package/lib/Prisma/Website/ReactRouter.d.ts.map +1 -0
  43. package/lib/Prisma/Website/ReactRouter.js +36 -0
  44. package/lib/Prisma/Website/ReactRouter.js.map +1 -0
  45. package/lib/Prisma/Website/SolidStart.d.ts +37 -0
  46. package/lib/Prisma/Website/SolidStart.d.ts.map +1 -0
  47. package/lib/Prisma/Website/SolidStart.js +37 -0
  48. package/lib/Prisma/Website/SolidStart.js.map +1 -0
  49. package/lib/Prisma/Website/StaticSite.d.ts +57 -0
  50. package/lib/Prisma/Website/StaticSite.d.ts.map +1 -0
  51. package/lib/Prisma/Website/StaticSite.js +118 -0
  52. package/lib/Prisma/Website/StaticSite.js.map +1 -0
  53. package/lib/Prisma/Website/SvelteKit.d.ts +37 -0
  54. package/lib/Prisma/Website/SvelteKit.d.ts.map +1 -0
  55. package/lib/Prisma/Website/SvelteKit.js +37 -0
  56. package/lib/Prisma/Website/SvelteKit.js.map +1 -0
  57. package/lib/Prisma/Website/TanStackStart.d.ts +35 -0
  58. package/lib/Prisma/Website/TanStackStart.d.ts.map +1 -0
  59. package/lib/Prisma/Website/TanStackStart.js +36 -0
  60. package/lib/Prisma/Website/TanStackStart.js.map +1 -0
  61. package/lib/Prisma/Website/Vite.d.ts +42 -0
  62. package/lib/Prisma/Website/Vite.d.ts.map +1 -0
  63. package/lib/Prisma/Website/Vite.js +38 -0
  64. package/lib/Prisma/Website/Vite.js.map +1 -0
  65. package/lib/Prisma/Website/Vocs.d.ts +37 -0
  66. package/lib/Prisma/Website/Vocs.d.ts.map +1 -0
  67. package/lib/Prisma/Website/Vocs.js +38 -0
  68. package/lib/Prisma/Website/Vocs.js.map +1 -0
  69. package/lib/Prisma/Website/Waku.d.ts +44 -0
  70. package/lib/Prisma/Website/Waku.d.ts.map +1 -0
  71. package/lib/Prisma/Website/Waku.js +38 -0
  72. package/lib/Prisma/Website/Waku.js.map +1 -0
  73. package/lib/Prisma/Website/index.d.ts +15 -0
  74. package/lib/Prisma/Website/index.d.ts.map +1 -0
  75. package/lib/Prisma/Website/index.js +14 -0
  76. package/lib/Prisma/Website/index.js.map +1 -0
  77. package/lib/Prisma/index.d.ts +1 -0
  78. package/lib/Prisma/index.d.ts.map +1 -1
  79. package/lib/Prisma/index.js +1 -0
  80. package/lib/Prisma/index.js.map +1 -1
  81. package/lib/State/HttpStateApi.d.ts +11 -11
  82. package/lib/Website/Server.d.ts.map +1 -1
  83. package/lib/Website/Server.js +18 -8
  84. package/lib/Website/Server.js.map +1 -1
  85. package/package.json +6 -6
  86. package/src/Cloudflare/Workers/InferEnv.ts +5 -3
  87. package/src/Cloudflare/Workers/Worker.ts +25 -5
  88. package/src/Prisma/Providers.ts +11 -0
  89. package/src/Prisma/Website/Artifact.ts +429 -0
  90. package/src/Prisma/Website/Astro.ts +72 -0
  91. package/src/Prisma/Website/Foldkit.ts +34 -0
  92. package/src/Prisma/Website/FrameworkSite.ts +204 -0
  93. package/src/Prisma/Website/Nextjs.ts +41 -0
  94. package/src/Prisma/Website/Nuxt.ts +44 -0
  95. package/src/Prisma/Website/Octane.ts +40 -0
  96. package/src/Prisma/Website/ReactRouter.ts +40 -0
  97. package/src/Prisma/Website/SolidStart.ts +44 -0
  98. package/src/Prisma/Website/StaticSite.ts +149 -0
  99. package/src/Prisma/Website/SvelteKit.ts +44 -0
  100. package/src/Prisma/Website/TanStackStart.ts +40 -0
  101. package/src/Prisma/Website/Vite.ts +50 -0
  102. package/src/Prisma/Website/Vocs.ts +45 -0
  103. package/src/Prisma/Website/Waku.ts +52 -0
  104. package/src/Prisma/Website/index.ts +19 -0
  105. package/src/Prisma/index.ts +1 -0
  106. package/src/Website/Server.ts +21 -8
@@ -0,0 +1,50 @@
1
+ import * as Namespace from "../../Namespace.ts";
2
+ import { makeFrameworkSite, type FrameworkSiteProps } from "./FrameworkSite.ts";
3
+
4
+ /** Configuration for a Prisma Vite website. */
5
+ export interface ViteProps extends FrameworkSiteProps {
6
+ /** Serializable overrides merged over vite.config.*. */
7
+ vite?: {
8
+ /** Build output directory. @default "dist" */
9
+ outDir?: string;
10
+ /** Public base path. @default "/" */
11
+ base?: string;
12
+ };
13
+ }
14
+
15
+ /**
16
+ * Static Vite assets served on Prisma Compute. The project’s Vite plugins and configuration drive the build; native Vite HMR runs during development.
17
+ *
18
+ * Native framework development and HMR run without Prisma cloud resources.
19
+ * Apply `Alchemy.remote()` to use the live Compute deployment during dev.
20
+ * Packaging requires the optional `@vercel/nft` peer dependency.
21
+ *
22
+ * ### Creating a Website
23
+ * **Example:** Vite application
24
+ * ```typescript
25
+ * const site = yield* Prisma.Website.Vite("Web", {
26
+ * rootDir: "./app",
27
+ * });
28
+ * ```
29
+ *
30
+ * ### Deployment Configuration
31
+ * **Example:** Existing project and custom hostname
32
+ * ```typescript
33
+ * const site = yield* Prisma.Website.Vite("Web", {
34
+ * project,
35
+ * domain: "www.example.com",
36
+ * env: { API_BASE: "https://api.example.com" },
37
+ * compute: { destroyOldDeployment: true },
38
+ * });
39
+ * ```
40
+ *
41
+ * @resource
42
+ * @product Website
43
+ */
44
+ export const Vite = (id: string, props: ViteProps = {}) =>
45
+ makeFrameworkSite(id, props, {
46
+ framework: "@alchemy.run/frontend-frameworks/vite",
47
+ target: "@alchemy.run/frontend-frameworks/vite/node",
48
+ options: { vite: props.vite },
49
+ notFoundHandling: "spa",
50
+ }).pipe(Namespace.push(id));
@@ -0,0 +1,45 @@
1
+ import * as Namespace from "../../Namespace.ts";
2
+ import { makeFrameworkSite, type FrameworkSiteProps } from "./FrameworkSite.ts";
3
+
4
+ /** Configuration for a Prisma Vocs website. */
5
+ export interface VocsProps extends FrameworkSiteProps {
6
+ /** Production output directory relative to rootDir, matching vocs.config.*. @default "dist" */
7
+ outDir?: string;
8
+ }
9
+
10
+ /**
11
+ * Vocs documentation and its Waku RSC handler on Prisma Compute. Install Vocs and its Waku peers alongside the framework integration.
12
+ *
13
+ * Native framework development and HMR run without Prisma cloud resources.
14
+ * Apply `Alchemy.remote()` to use the live Compute deployment during dev.
15
+ * Packaging requires the optional `@vercel/nft` peer dependency.
16
+ *
17
+ * ### Creating a Website
18
+ * **Example:** Vocs application
19
+ * ```typescript
20
+ * const site = yield* Prisma.Website.Vocs("Web", {
21
+ * rootDir: "./app",
22
+ * });
23
+ * ```
24
+ *
25
+ * ### Deployment Configuration
26
+ * **Example:** Existing project and custom hostname
27
+ * ```typescript
28
+ * const site = yield* Prisma.Website.Vocs("Web", {
29
+ * project,
30
+ * domain: "www.example.com",
31
+ * env: { API_BASE: "https://api.example.com" },
32
+ * compute: { destroyOldDeployment: true },
33
+ * });
34
+ * ```
35
+ *
36
+ * @resource
37
+ * @product Website
38
+ */
39
+ export const Vocs = (id: string, props: VocsProps = {}) =>
40
+ makeFrameworkSite(id, props, {
41
+ framework: "@alchemy.run/frontend-frameworks/vocs/node",
42
+ target: "@alchemy.run/frontend-frameworks/vocs/node",
43
+ options: { outDir: props.outDir },
44
+ htmlHandling: "drop-trailing-slash",
45
+ }).pipe(Namespace.push(id));
@@ -0,0 +1,52 @@
1
+ import * as Namespace from "../../Namespace.ts";
2
+ import { makeFrameworkSite, type FrameworkSiteProps } from "./FrameworkSite.ts";
3
+
4
+ /** Configuration for a Prisma Waku website. */
5
+ export interface WakuProps extends FrameworkSiteProps {
6
+ /** Serializable overrides merged over waku.config.*. */
7
+ waku?: {
8
+ /** Application source directory. */
9
+ srcDir?: string;
10
+ /** Production output directory. */
11
+ distDir?: string;
12
+ /** Public URL base path. */
13
+ basePath?: string;
14
+ };
15
+ }
16
+
17
+ /**
18
+ * Waku RSC and static pages on Prisma Compute. The Node target selects Waku’s node adapter; do not set unstable_adapter.
19
+ *
20
+ * Native framework development and HMR run without Prisma cloud resources.
21
+ * Apply `Alchemy.remote()` to use the live Compute deployment during dev.
22
+ * Packaging requires the optional `@vercel/nft` peer dependency.
23
+ *
24
+ * ### Creating a Website
25
+ * **Example:** Waku application
26
+ * ```typescript
27
+ * const site = yield* Prisma.Website.Waku("Web", {
28
+ * rootDir: "./app",
29
+ * });
30
+ * ```
31
+ *
32
+ * ### Deployment Configuration
33
+ * **Example:** Existing project and custom hostname
34
+ * ```typescript
35
+ * const site = yield* Prisma.Website.Waku("Web", {
36
+ * project,
37
+ * domain: "www.example.com",
38
+ * env: { API_BASE: "https://api.example.com" },
39
+ * compute: { destroyOldDeployment: true },
40
+ * });
41
+ * ```
42
+ *
43
+ * @resource
44
+ * @product Website
45
+ */
46
+ export const Waku = (id: string, props: WakuProps = {}) =>
47
+ makeFrameworkSite(id, props, {
48
+ framework: "@alchemy.run/frontend-frameworks/waku",
49
+ target: "@alchemy.run/frontend-frameworks/waku/node",
50
+ options: { waku: props.waku },
51
+ htmlHandling: "drop-trailing-slash",
52
+ }).pipe(Namespace.push(id));
@@ -0,0 +1,19 @@
1
+ export * from "./Astro.ts";
2
+ export * from "./Foldkit.ts";
3
+ export * from "./Nextjs.ts";
4
+ export * from "./Nuxt.ts";
5
+ export * from "./Octane.ts";
6
+ export * from "./ReactRouter.ts";
7
+ export * from "./SolidStart.ts";
8
+ export * from "./StaticSite.ts";
9
+ export * from "./SvelteKit.ts";
10
+ export * from "./TanStackStart.ts";
11
+ export * from "./Vite.ts";
12
+ export * from "./Vocs.ts";
13
+ export * from "./Waku.ts";
14
+ export type {
15
+ FrameworkSiteProps,
16
+ Website,
17
+ WebsiteComputeOptions,
18
+ WebsiteProjectReference,
19
+ } from "./FrameworkSite.ts";
@@ -26,5 +26,6 @@ export * from "./ReadWriteBucket.ts";
26
26
  export * from "./Providers.ts";
27
27
  export * from "./SourceRepository.ts";
28
28
  export * from "./WriteBucket.ts";
29
+ export * as Website from "./Website/index.ts";
29
30
  export { KNOWN_REGION_IDS, REGIONS } from "./Types.ts";
30
31
  export type * as Types from "./Types.ts";
@@ -327,6 +327,25 @@ export const ServerProviderLive = () =>
327
327
  ),
328
328
  );
329
329
 
330
+ const hashOutput = (props: ServerProps, distDir: string) =>
331
+ hashDirectory({
332
+ cwd: distDir,
333
+ memo: {
334
+ // Next.js serves from its project root, not a dedicated output directory.
335
+ exclude:
336
+ path.resolve(distDir) ===
337
+ path.resolve(initialCwd, props.root ?? ".")
338
+ ? [
339
+ "**/node_modules/**",
340
+ "**/.git/**",
341
+ "**/.alchemy/**",
342
+ ".next/cache/**",
343
+ ]
344
+ : [],
345
+ lockfile: false,
346
+ },
347
+ });
348
+
330
349
  const makeOutput = Effect.fn(function* (
331
350
  props: ServerProps,
332
351
  built: FrameworkBuildOutputSlice,
@@ -359,10 +378,7 @@ export const ServerProviderLive = () =>
359
378
  : yield* Effect.all(
360
379
  {
361
380
  input: hashInput(props, root),
362
- output: hashDirectory({
363
- cwd: distDir,
364
- memo: { exclude: [], lockfile: false },
365
- }),
381
+ output: hashOutput(props, distDir),
366
382
  },
367
383
  { concurrency: "unbounded" },
368
384
  ),
@@ -384,10 +400,7 @@ export const ServerProviderLive = () =>
384
400
  if (output.distDir === undefined) return { action: "update" };
385
401
  const distDir = path.resolve(initialCwd, output.distDir);
386
402
  if (!(yield* fs.exists(distDir))) return { action: "update" };
387
- const outHash = yield* hashDirectory({
388
- cwd: distDir,
389
- memo: { exclude: [], lockfile: false },
390
- });
403
+ const outHash = yield* hashOutput(news, distDir);
391
404
  return {
392
405
  action: Equal.equals(outHash, output.hash.output)
393
406
  ? "noop"