alchemy 0.4.0 → 0.5.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.
Files changed (53) hide show
  1. package/README.md +3 -463
  2. package/lib/ai/data.d.ts +5 -0
  3. package/lib/ai/data.js +3 -0
  4. package/lib/alchemy.d.ts +3 -3
  5. package/lib/alchemy.js +82 -85
  6. package/lib/cloudflare/assets.d.ts +74 -0
  7. package/lib/cloudflare/assets.js +75 -0
  8. package/lib/cloudflare/bindings.d.ts +6 -1
  9. package/lib/cloudflare/bindings.js +6 -0
  10. package/lib/cloudflare/bound.d.ts +2 -1
  11. package/lib/cloudflare/custom-domain.d.ts +1 -15
  12. package/lib/cloudflare/custom-domain.js +1 -15
  13. package/lib/cloudflare/index.d.ts +1 -1
  14. package/lib/cloudflare/index.js +1 -1
  15. package/lib/cloudflare/r2-rest-state-store.js +52 -22
  16. package/lib/cloudflare/worker.d.ts +18 -0
  17. package/lib/cloudflare/worker.js +153 -4
  18. package/lib/internal/docs/providers.js +2 -1
  19. package/lib/os/exec.d.ts +103 -0
  20. package/lib/os/exec.js +103 -0
  21. package/lib/os/index.d.ts +1 -0
  22. package/lib/os/index.js +1 -0
  23. package/lib/secret.d.ts +2 -2
  24. package/lib/secret.js +2 -2
  25. package/lib/web/vitepress/vitepress.js +1 -1
  26. package/package.json +2 -1
  27. package/src/ai/data.ts +10 -0
  28. package/src/alchemy.ts +97 -100
  29. package/src/cloudflare/assets.ts +158 -0
  30. package/src/cloudflare/bindings.ts +11 -2
  31. package/src/cloudflare/bound.ts +4 -1
  32. package/src/cloudflare/custom-domain.ts +1 -15
  33. package/src/cloudflare/index.ts +1 -1
  34. package/src/cloudflare/r2-rest-state-store.ts +78 -34
  35. package/src/cloudflare/worker.ts +261 -6
  36. package/src/internal/docs/providers.ts +2 -1
  37. package/src/os/exec.ts +190 -0
  38. package/src/os/index.ts +1 -0
  39. package/src/secret.ts +2 -2
  40. package/src/web/vitepress/vitepress.ts +1 -1
  41. package/lib/cloudflare/generate-asset-manifest.d.ts +0 -2
  42. package/lib/cloudflare/generate-asset-manifest.js +0 -68
  43. package/lib/cloudflare/static-site-router.d.ts +0 -18
  44. package/lib/cloudflare/static-site-router.js +0 -115
  45. package/lib/cloudflare/static-site.d.ts +0 -211
  46. package/lib/cloudflare/static-site.js +0 -213
  47. package/lib/cloudflare/upload-asset-manifest.d.ts +0 -11
  48. package/lib/cloudflare/upload-asset-manifest.js +0 -56
  49. package/src/cloudflare/generate-asset-manifest.ts +0 -93
  50. package/src/cloudflare/static-site-router.ts +0 -157
  51. package/src/cloudflare/static-site.ts +0 -416
  52. package/src/cloudflare/upload-asset-manifest.ts +0 -85
  53. package/src/web/vitepress/index.md +0 -75
@@ -1,75 +0,0 @@
1
- # Docs Index
2
-
3
- ```ts twoslash
4
- // @noErrors
5
- import path from "path";
6
-
7
- import alchemy, { Resource, Context } from "alchemy";
8
-
9
- import { Zone } from "alchemy/cloudflare";
10
-
11
- type alchemy = any;
12
-
13
- await using app = alchemy("github:alchemy", {
14
- // ^?
15
- stage: "prod",
16
- phase: process.argv.includes("--destroy") ? "destroy" : "up",
17
- // pass the password in (you can get it from anywhere, e.g. stdin)
18
- password: process.env.SECRET_PASSPHRASE,
19
- quiet: process.argv.includes("--verbose") ? false : true,
20
- });
21
-
22
- export interface Product {}
23
-
24
- export const Product = Resource(
25
- "stripe::Product",
26
- async function (
27
- this: Context<any>,
28
- id: string,
29
- props: any,
30
- ): Promise<Product> {
31
- this.
32
- // ^|
33
- }
34
- );
35
- ```
36
-
37
- ```ts twoslash
38
- // @noErrors
39
- // @esModuleInterop
40
- import express from "express"
41
- const app = {
42
- get(path: string, fn: (req: any, res: { send(): void }))
43
- }
44
- app.get("/", function (req, res) {
45
- res.sen
46
- // ^|
47
- })
48
- app.listen(3000)
49
- ```
50
-
51
- ```ts twoslash
52
- // @module: esnext
53
- // @filename: maths.ts
54
- export function absolute(num: number) {
55
- if (num < 0) return num * -1;
56
- return num;
57
- }
58
- // @filename: index.ts
59
- import { absolute } from "./maths";
60
- const value = absolute(-1);
61
- ```
62
-
63
- ```ts twoslash
64
- // @module: esnext
65
- // @filename: maths.ts
66
- export function absolute(num: number) {
67
- if (num < 0) return num * -1;
68
- return num;
69
- }
70
- // @filename: index.ts
71
- // ---cut---
72
- import { absolute } from "./maths";
73
- const value = absolute(-1);
74
- // ^?
75
- ```