sam-goodwin / eventual

Build scalable and durable micro-services with APIs, Messaging and Workflows
https://docs.eventual.ai
MIT License
174 stars 4 forks source link

feat: create cdk with esm #402

Closed thantos closed 1 year ago

thantos commented 1 year ago

Worked locally

$ ts-node ./eventual/packages/create-eventual/bin/index.js 
$ pnpm eventual local --offline --port 3112
✔ Eventual Dev Server running on http://localhost:3112
$ cat infra/src/app.mts 
import { App, Stack, CfnOutput } from "aws-cdk-lib";
import { Service } from "@eventual/aws-cdk";
import { createRequire } from "module";

const require = createRequire(import.meta.url);

const app = new App();
const stack = new Stack(app, "eventual-esm")

import type * as eventualesm from "@eventual-esm/service"

const service = new Service<typeof eventualesm>(stack, "Service", {
  name: "eventual-esm",
  entry: require.resolve("@eventual-esm/service")
});