alchemy 2.0.0-beta.2 → 2.0.0-beta.test-export-fix-3
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/bin/{alchemy-effect.js → alchemy.js} +173 -173
- package/bin/alchemy.js.map +1 -0
- package/bin/{alchemy-effect.sh → alchemy.sh} +2 -2
- package/lib/cli/index.js +169 -169
- package/lib/cli/index.js.map +1 -1
- package/package.json +75 -67
- package/src/AWS/AGENTS.md +10 -10
- package/src/AWS/Assets.ts +1 -1
- package/src/AWS/Credentials.ts +0 -1
- package/src/AWS/DynamoDB/Table.ts +63 -10
- package/src/AWS/EC2/hosted.ts +1 -1
- package/src/AWS/ECS/Task.ts +1 -1
- package/src/AWS/Kinesis/Stream.ts +44 -8
- package/src/AWS/Lambda/Function.ts +218 -10
- package/src/AWS/S3/Bucket.ts +26 -19
- package/src/AWS/S3/BucketNotifications.ts +1 -1
- package/src/AWS/SNS/Topic.ts +47 -10
- package/src/AWS/SQS/Queue.ts +66 -0
- package/src/Cloudflare/Container/Container.ts +122 -0
- package/src/Cloudflare/Container/ContainerApplication.ts +6 -3
- package/src/Cloudflare/Container/ContainerBinding.ts +2 -4
- package/src/Cloudflare/Container/StartContainer.ts +1 -1
- package/src/Cloudflare/D1/D1Database.ts +23 -4
- package/src/Cloudflare/KV/KVNamespace.ts +25 -0
- package/src/Cloudflare/Providers.ts +1 -6
- package/src/Cloudflare/R2/R2Bucket.ts +45 -2
- package/src/Cloudflare/Website/StaticSite.ts +79 -6
- package/src/Cloudflare/Website/Vite.ts +67 -13
- package/src/Cloudflare/Workers/Assets.ts +170 -207
- package/src/Cloudflare/Workers/DurableObjectNamespace.ts +629 -0
- package/src/Cloudflare/Workers/DurableObjectState.ts +63 -0
- package/src/Cloudflare/Workers/DurableObjectStorage.ts +256 -0
- package/src/Cloudflare/Workers/DynamicWorkerLoader.ts +66 -7
- package/src/Cloudflare/Workers/InferEnv.ts +11 -7
- package/src/Cloudflare/Workers/Rpc.ts +13 -2
- package/src/Cloudflare/Workers/ScheduledEvents.ts +185 -0
- package/src/Cloudflare/Workers/WebSocket.ts +1 -1
- package/src/Cloudflare/Workers/Worker.ts +406 -49
- package/src/Cloudflare/Workers/Workflow.ts +53 -11
- package/src/Cloudflare/Workers/index.ts +4 -1
- package/src/Construct.ts +2 -2
- package/src/GitHub/Comment.ts +224 -0
- package/src/GitHub/Secret.ts +257 -0
- package/src/GitHub/Variable.ts +166 -0
- package/src/GitHub/index.ts +3 -0
- package/src/Kubernetes/client.ts +2 -2
- package/src/Output.ts +1 -1
- package/src/Platform.ts +1 -1
- package/src/Provider.ts +1 -1
- package/src/Test/Vitest.ts +4 -3
- package/src/Util/PlatformServices.ts +21 -0
- package/src/Util/dedent.ts +59 -0
- package/src/Util/index.ts +1 -0
- package/bin/alchemy-effect.js.map +0 -1
- package/src/Cloudflare/Workers/DurableObject.ts +0 -527
- package/src/Daemon/Client.ts +0 -116
- package/src/Daemon/Config.ts +0 -28
- package/src/Daemon/Errors.ts +0 -48
- package/src/Daemon/Lock.ts +0 -162
- package/src/Daemon/ProcessRegistry.ts +0 -284
- package/src/Daemon/RpcSchema.ts +0 -43
- package/src/Daemon/RpcServer.ts +0 -231
- package/src/Daemon/index.ts +0 -27
- package/src/Spawn.ts +0 -23
- /package/bin/{alchemy-effect.ts → alchemy.ts} +0 -0
package/src/Test/Vitest.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type * as aws from "@distilled.cloud/aws";
|
|
2
2
|
import * as cf from "@distilled.cloud/cloudflare";
|
|
3
|
-
import { NodeServices } from "@effect/platform-node";
|
|
3
|
+
// import { NodeServices } from "@effect/platform-node";
|
|
4
4
|
import { expect, it } from "@effect/vitest";
|
|
5
5
|
import { Logger } from "effect";
|
|
6
6
|
import * as Config from "effect/Config";
|
|
@@ -44,6 +44,7 @@ import * as Serverless from "../Serverless/index.ts";
|
|
|
44
44
|
import * as Stack from "../Stack.ts";
|
|
45
45
|
import * as Stage from "../Stage.ts";
|
|
46
46
|
import * as State from "../State/index.ts";
|
|
47
|
+
import { PlatformServices } from "../Util/PlatformServices.ts";
|
|
47
48
|
import { TestCli } from "./TestCli.ts";
|
|
48
49
|
|
|
49
50
|
export const expectEmptyObject = () =>
|
|
@@ -90,7 +91,7 @@ const quietLogger = Logger.make(() => {
|
|
|
90
91
|
});
|
|
91
92
|
|
|
92
93
|
const platform = Layer.mergeAll(
|
|
93
|
-
|
|
94
|
+
PlatformServices,
|
|
94
95
|
FetchHttpClient.layer,
|
|
95
96
|
Logger.layer([process.env.VERBOSE ? Logger.consolePretty() : quietLogger]),
|
|
96
97
|
);
|
|
@@ -212,7 +213,7 @@ const runWithContext = <A, Err>(
|
|
|
212
213
|
MinimumLogLevel,
|
|
213
214
|
process.env.DEBUG ? "Debug" : "Info",
|
|
214
215
|
),
|
|
215
|
-
Effect.provide(
|
|
216
|
+
Effect.provide(PlatformServices),
|
|
216
217
|
);
|
|
217
218
|
};
|
|
218
219
|
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { BunServices } from "@effect/platform-bun/BunServices";
|
|
2
|
+
import type { NodeServices } from "@effect/platform-node/NodeServices";
|
|
3
|
+
import * as Effect from "effect/Effect";
|
|
4
|
+
import * as Layer from "effect/Layer";
|
|
5
|
+
|
|
6
|
+
const isBun = typeof Bun !== "undefined";
|
|
7
|
+
|
|
8
|
+
export const PlatformServices: Layer.Layer<
|
|
9
|
+
NodeServices | BunServices,
|
|
10
|
+
never,
|
|
11
|
+
never
|
|
12
|
+
> = Effect.promise(() => {
|
|
13
|
+
if (isBun) {
|
|
14
|
+
return import("@effect/platform-bun").then(
|
|
15
|
+
(platform) => platform.BunServices.layer,
|
|
16
|
+
);
|
|
17
|
+
}
|
|
18
|
+
return import("@effect/platform-node").then(
|
|
19
|
+
(platform) => platform.NodeServices.layer,
|
|
20
|
+
);
|
|
21
|
+
}).pipe(Layer.unwrap);
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tagged template literal for removing indentation from a block of text.
|
|
3
|
+
*
|
|
4
|
+
* If the first line is empty, it will be ignored.
|
|
5
|
+
*/
|
|
6
|
+
export function dedent(
|
|
7
|
+
strings: TemplateStringsArray,
|
|
8
|
+
...values: unknown[]
|
|
9
|
+
): string;
|
|
10
|
+
export function dedent(text: string): string;
|
|
11
|
+
export function dedent(
|
|
12
|
+
stringsOrText: TemplateStringsArray | string,
|
|
13
|
+
...values: unknown[]
|
|
14
|
+
): string {
|
|
15
|
+
const raw =
|
|
16
|
+
typeof stringsOrText === "string"
|
|
17
|
+
? stringsOrText
|
|
18
|
+
: String.raw({ raw: stringsOrText }, ...values);
|
|
19
|
+
|
|
20
|
+
let lines = raw.split("\n");
|
|
21
|
+
|
|
22
|
+
while (lines.length > 0 && lines[0].trim() === "") {
|
|
23
|
+
lines = lines.slice(1);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
while (lines.length > 0 && lines[lines.length - 1].trim() === "") {
|
|
27
|
+
lines = lines.slice(0, lines.length - 1);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
if (lines.length === 0) {
|
|
31
|
+
return "";
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
let minIndentLength = Number.POSITIVE_INFINITY;
|
|
35
|
+
for (const line of lines) {
|
|
36
|
+
if (line.trim() !== "") {
|
|
37
|
+
const indent = line.match(/^[ \t]*/)?.[0];
|
|
38
|
+
if (indent != null && indent.length < minIndentLength) {
|
|
39
|
+
minIndentLength = indent.length;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
if (minIndentLength === Number.POSITIVE_INFINITY) {
|
|
45
|
+
return lines.join("\n");
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
lines = lines.map((line) => {
|
|
49
|
+
if (line.trim() === "") {
|
|
50
|
+
return line;
|
|
51
|
+
}
|
|
52
|
+
return line.startsWith(" ".repeat(minIndentLength)) ||
|
|
53
|
+
line.startsWith("\t".repeat(minIndentLength))
|
|
54
|
+
? line.substring(minIndentLength)
|
|
55
|
+
: line;
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
return lines.join("\n");
|
|
59
|
+
}
|
package/src/Util/index.ts
CHANGED