alchemy-effect 0.7.0 → 0.8.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/bin/alchemy-effect.js +9 -7
- package/bin/alchemy-effect.js.map +1 -1
- package/bin/alchemy-effect.ts +11 -0
- package/package.json +1 -1
- package/src/AWS/AutoScaling/LaunchTemplate.ts +5 -4
- package/src/AWS/EC2/Instance.ts +3 -4
- package/src/AWS/ECS/Task.ts +36 -34
- package/src/AWS/Lambda/Function.ts +68 -68
- package/src/Binding.ts +10 -3
- package/src/Cloudflare/Container.ts +68 -67
- package/src/Cloudflare/D1/D1Database.ts +32 -32
- package/src/Cloudflare/KV/Delete.ts +7 -5
- package/src/Cloudflare/KV/Get.ts +5 -5
- package/src/Cloudflare/KV/GetWithMetadata.ts +5 -5
- package/src/Cloudflare/KV/{Namespace.ts → KVNamespace.ts} +6 -6
- package/src/Cloudflare/KV/{NamespaceBinding.ts → KVNamespaceBinding.ts} +2 -2
- package/src/Cloudflare/KV/List.ts +5 -5
- package/src/Cloudflare/KV/Put.ts +5 -5
- package/src/Cloudflare/KV/index.ts +1 -1
- package/src/Cloudflare/Providers.ts +2 -8
- package/src/Cloudflare/R2/{Bucket.ts → R2Bucket.ts} +19 -19
- package/src/Cloudflare/R2/R2BucketBinding.ts +299 -0
- package/src/Cloudflare/R2/index.ts +2 -9
- package/src/Cloudflare/Workers/InferEnv.ts +23 -0
- package/src/Cloudflare/Workers/Worker.ts +185 -108
- package/src/Cloudflare/Workers/index.ts +1 -0
- package/src/Cloudflare/index.ts +2 -2
- package/src/Plan.ts +12 -0
- package/src/Platform.ts +39 -55
- package/src/Test/Vitest.ts +15 -2
- package/src/Util/effect.ts +24 -0
- package/src/Cloudflare/R2/BucketBinding.ts +0 -31
- package/src/Cloudflare/R2/CreateMultipartUpload.ts +0 -59
- package/src/Cloudflare/R2/DeleteObject.ts +0 -41
- package/src/Cloudflare/R2/GetObject.ts +0 -47
- package/src/Cloudflare/R2/HeadObject.ts +0 -41
- package/src/Cloudflare/R2/ListObjects.ts +0 -45
- package/src/Cloudflare/R2/MultipartUploadClient.ts +0 -40
- package/src/Cloudflare/R2/PutObject.ts +0 -55
- package/src/Cloudflare/R2/ResumeMultipartUpload.ts +0 -48
- package/src/Cloudflare/R2/UploadValue.ts +0 -10
package/bin/alchemy-effect.js
CHANGED
|
@@ -69,7 +69,7 @@ var __require = /* @__PURE__ */ createRequire(import.meta.url);
|
|
|
69
69
|
|
|
70
70
|
//#endregion
|
|
71
71
|
//#region package.json
|
|
72
|
-
var version = "0.
|
|
72
|
+
var version = "0.8.0";
|
|
73
73
|
|
|
74
74
|
//#endregion
|
|
75
75
|
//#region src/Artifacts.ts
|
|
@@ -41438,8 +41438,8 @@ cliCursor.hide = (writableStream = process$1.stderr) => {
|
|
|
41438
41438
|
isHidden = true;
|
|
41439
41439
|
writableStream.write("\x1B[?25l");
|
|
41440
41440
|
};
|
|
41441
|
-
cliCursor.toggle = (force, writableStream) => {
|
|
41442
|
-
if (force !== void 0) isHidden = force;
|
|
41441
|
+
cliCursor.toggle = (force$1, writableStream) => {
|
|
41442
|
+
if (force$1 !== void 0) isHidden = force$1;
|
|
41443
41443
|
if (isHidden) cliCursor.show(writableStream);
|
|
41444
41444
|
else cliCursor.hide(writableStream);
|
|
41445
41445
|
};
|
|
@@ -44318,7 +44318,7 @@ const asEffect = (effect) => Effect.isEffect(effect) ? effect : Effect.succeed(e
|
|
|
44318
44318
|
|
|
44319
44319
|
//#endregion
|
|
44320
44320
|
//#region src/Plan.ts
|
|
44321
|
-
const make = (stack) => ensureArtifactStore(Effect.gen(function* () {
|
|
44321
|
+
const make = (stack, options = {}) => ensureArtifactStore(Effect.gen(function* () {
|
|
44322
44322
|
const state = yield* State;
|
|
44323
44323
|
const resources = Object.values(stack.resources);
|
|
44324
44324
|
const stackName = stack.name;
|
|
@@ -44455,7 +44455,7 @@ const make = (stack) => ensureArtifactStore(Effect.gen(function* () {
|
|
|
44455
44455
|
news,
|
|
44456
44456
|
oldBindings,
|
|
44457
44457
|
newBindings
|
|
44458
|
-
}).pipe(providePlanScope(fqn, oldState.instanceId))).pipe(Effect.map((diff$2) => diff$2 ?? { action: havePropsChanged(oldProps, news) || bindingDiffs.some((b) => b.action !== "noop") ? "update" : "noop" }));
|
|
44458
|
+
}).pipe(providePlanScope(fqn, oldState.instanceId))).pipe(Effect.map((diff$2) => diff$2 ?? { action: havePropsChanged(oldProps, news) || bindingDiffs.some((b) => b.action !== "noop") ? "update" : "noop" }), Effect.map((diff$2) => options.force && diff$2.action === "noop" ? { action: "update" } : diff$2));
|
|
44459
44459
|
if (oldState.status === "creating") if (diff$1.action === "noop") return Node$1({
|
|
44460
44460
|
action: "create",
|
|
44461
44461
|
props: news,
|
|
@@ -44652,6 +44652,7 @@ const stage = Flag.string("stage").pipe(Flag.withSchema(S.String.check(S.isPatte
|
|
|
44652
44652
|
const envFile = Flag.file("env-file").pipe(Flag.optional, Flag.withDescription("File to load environment variables from, defaults to .env"));
|
|
44653
44653
|
const dryRun = Flag.boolean("dry-run").pipe(Flag.withDescription("Dry run the deployment, do not actually deploy"), Flag.withDefault(false));
|
|
44654
44654
|
const yes = Flag.boolean("yes").pipe(Flag.withDescription("Yes to all prompts"), Flag.withDefault(false));
|
|
44655
|
+
const force = Flag.boolean("force").pipe(Flag.withDescription("Force updates for resources that would otherwise no-op"), Flag.withDefault(false));
|
|
44655
44656
|
const fileLogger = Effect.fnUntraced(function* (...segments) {
|
|
44656
44657
|
const dotAlchemy$1 = yield* DotAlchemy;
|
|
44657
44658
|
const fs$2 = yield* FileSystem.FileSystem;
|
|
@@ -44670,6 +44671,7 @@ const loadConfigProvider = (envFile$1) => {
|
|
|
44670
44671
|
const main = Argument.file("main", { mustExist: true }).pipe(Argument.withDescription("Main file to deploy, defaults to alchemy.run.ts"), Argument.withDefault("alchemy.run.ts"));
|
|
44671
44672
|
const deployCommand = Command.make("deploy", {
|
|
44672
44673
|
dryRun,
|
|
44674
|
+
force,
|
|
44673
44675
|
main,
|
|
44674
44676
|
envFile,
|
|
44675
44677
|
stage,
|
|
@@ -44693,7 +44695,7 @@ const planCommand = Command.make("plan", {
|
|
|
44693
44695
|
...args,
|
|
44694
44696
|
dryRun: true
|
|
44695
44697
|
}));
|
|
44696
|
-
const execStack = Effect.fn(function* ({ main: main$1, stage: stage$1, envFile: envFile$1, dryRun: dryRun$1 = false, yes: yes$1 = false, destroy = false }) {
|
|
44698
|
+
const execStack = Effect.fn(function* ({ main: main$1, stage: stage$1, envFile: envFile$1, dryRun: dryRun$1 = false, force: force$1 = false, yes: yes$1 = false, destroy = false }) {
|
|
44697
44699
|
const path = yield* Path;
|
|
44698
44700
|
const stackEffect = (yield* Effect.promise(() => import(path.resolve(process.cwd(), main$1)))).default;
|
|
44699
44701
|
if (!stackEffect) return yield* Effect.die(/* @__PURE__ */ new Error(`Main file '${main$1}' must export a default stack definition (export default defineStack({...}))`));
|
|
@@ -44710,7 +44712,7 @@ const execStack = Effect.fn(function* ({ main: main$1, stage: stage$1, envFile:
|
|
|
44710
44712
|
resources: {},
|
|
44711
44713
|
bindings: {},
|
|
44712
44714
|
output: {}
|
|
44713
|
-
} : stack);
|
|
44715
|
+
} : stack, { force: force$1 });
|
|
44714
44716
|
if (dryRun$1) yield* cli.displayPlan(updatePlan);
|
|
44715
44717
|
else {
|
|
44716
44718
|
if (!yes$1) {
|