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.
- package/README.md +3 -463
- package/lib/ai/data.d.ts +5 -0
- package/lib/ai/data.js +3 -0
- package/lib/alchemy.d.ts +3 -3
- package/lib/alchemy.js +82 -85
- package/lib/cloudflare/assets.d.ts +74 -0
- package/lib/cloudflare/assets.js +75 -0
- package/lib/cloudflare/bindings.d.ts +6 -1
- package/lib/cloudflare/bindings.js +6 -0
- package/lib/cloudflare/bound.d.ts +2 -1
- package/lib/cloudflare/custom-domain.d.ts +1 -15
- package/lib/cloudflare/custom-domain.js +1 -15
- package/lib/cloudflare/index.d.ts +1 -1
- package/lib/cloudflare/index.js +1 -1
- package/lib/cloudflare/r2-rest-state-store.js +52 -22
- package/lib/cloudflare/worker.d.ts +18 -0
- package/lib/cloudflare/worker.js +153 -4
- package/lib/internal/docs/providers.js +2 -1
- package/lib/os/exec.d.ts +103 -0
- package/lib/os/exec.js +103 -0
- package/lib/os/index.d.ts +1 -0
- package/lib/os/index.js +1 -0
- package/lib/secret.d.ts +2 -2
- package/lib/secret.js +2 -2
- package/lib/web/vitepress/vitepress.js +1 -1
- package/package.json +2 -1
- package/src/ai/data.ts +10 -0
- package/src/alchemy.ts +97 -100
- package/src/cloudflare/assets.ts +158 -0
- package/src/cloudflare/bindings.ts +11 -2
- package/src/cloudflare/bound.ts +4 -1
- package/src/cloudflare/custom-domain.ts +1 -15
- package/src/cloudflare/index.ts +1 -1
- package/src/cloudflare/r2-rest-state-store.ts +78 -34
- package/src/cloudflare/worker.ts +261 -6
- package/src/internal/docs/providers.ts +2 -1
- package/src/os/exec.ts +190 -0
- package/src/os/index.ts +1 -0
- package/src/secret.ts +2 -2
- package/src/web/vitepress/vitepress.ts +1 -1
- package/lib/cloudflare/generate-asset-manifest.d.ts +0 -2
- package/lib/cloudflare/generate-asset-manifest.js +0 -68
- package/lib/cloudflare/static-site-router.d.ts +0 -18
- package/lib/cloudflare/static-site-router.js +0 -115
- package/lib/cloudflare/static-site.d.ts +0 -211
- package/lib/cloudflare/static-site.js +0 -213
- package/lib/cloudflare/upload-asset-manifest.d.ts +0 -11
- package/lib/cloudflare/upload-asset-manifest.js +0 -56
- package/src/cloudflare/generate-asset-manifest.ts +0 -93
- package/src/cloudflare/static-site-router.ts +0 -157
- package/src/cloudflare/static-site.ts +0 -416
- package/src/cloudflare/upload-asset-manifest.ts +0 -85
- 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
|
-
```
|