t3-code-android-nightly/.repos/alchemy-effect/examples/fly-website-vite/alchemy.run.ts
Julius Marminge 6f9cea00ae
chore(refs): sync Effect and Alchemy references to 4.0.1 and beta.80 (#16170)
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-05 13:22:30 -07:00

34 lines
849 B
TypeScript

import * as Alchemy from "alchemy";
import * as Fly from "alchemy/Fly";
import * as Output from "alchemy/Output";
import * as Effect from "effect/Effect";
import Api from "./src/api.ts";
import { Db } from "./src/shared.ts";
export default Alchemy.Stack(
"FlyWebsiteViteExample",
{
providers: Fly.providers(),
state: Alchemy.localState(),
},
Effect.gen(function* () {
const db = yield* Db;
const api = yield* Api;
const web = yield* Fly.Website.Vite("Web", {
env: {
VITE_API_URL: Output.map(api.url, (url) => url ?? ""),
},
memo: {
include: ["index.html", "src/**", "package.json", "vite.config.ts"],
},
});
return {
url: web.url,
apiUrl: api.url,
appName: web.app?.appName,
apiAppName: api.appName,
clusterId: db.clusterId,
};
}),
);