alchemy 0.4.1 → 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 (47) 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.js +3 -1
  7. package/lib/cloudflare/bound.d.ts +2 -1
  8. package/lib/cloudflare/custom-domain.d.ts +1 -15
  9. package/lib/cloudflare/custom-domain.js +1 -15
  10. package/lib/cloudflare/index.d.ts +0 -1
  11. package/lib/cloudflare/index.js +0 -1
  12. package/lib/cloudflare/worker.d.ts +4 -0
  13. package/lib/cloudflare/worker.js +3 -1
  14. package/lib/internal/docs/providers.js +2 -1
  15. package/lib/os/exec.d.ts +103 -0
  16. package/lib/os/exec.js +103 -0
  17. package/lib/os/index.d.ts +1 -0
  18. package/lib/os/index.js +1 -0
  19. package/lib/secret.d.ts +2 -2
  20. package/lib/secret.js +2 -2
  21. package/lib/web/vitepress/vitepress.js +1 -1
  22. package/package.json +2 -1
  23. package/src/ai/data.ts +10 -0
  24. package/src/alchemy.ts +97 -100
  25. package/src/cloudflare/assets.ts +3 -0
  26. package/src/cloudflare/bound.ts +4 -1
  27. package/src/cloudflare/custom-domain.ts +1 -15
  28. package/src/cloudflare/index.ts +0 -1
  29. package/src/cloudflare/worker.ts +8 -1
  30. package/src/internal/docs/providers.ts +2 -1
  31. package/src/os/exec.ts +190 -0
  32. package/src/os/index.ts +1 -0
  33. package/src/secret.ts +2 -2
  34. package/src/web/vitepress/vitepress.ts +1 -1
  35. package/lib/cloudflare/generate-asset-manifest.d.ts +0 -2
  36. package/lib/cloudflare/generate-asset-manifest.js +0 -68
  37. package/lib/cloudflare/static-site-router.d.ts +0 -18
  38. package/lib/cloudflare/static-site-router.js +0 -115
  39. package/lib/cloudflare/static-site.d.ts +0 -211
  40. package/lib/cloudflare/static-site.js +0 -213
  41. package/lib/cloudflare/upload-asset-manifest.d.ts +0 -11
  42. package/lib/cloudflare/upload-asset-manifest.js +0 -56
  43. package/src/cloudflare/generate-asset-manifest.ts +0 -93
  44. package/src/cloudflare/static-site-router.ts +0 -157
  45. package/src/cloudflare/static-site.ts +0 -416
  46. package/src/cloudflare/upload-asset-manifest.ts +0 -85
  47. 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
- ```