mirror of
https://github.com/nestriness/nestri.git
synced 2025-12-11 00:05:36 +02:00
41 lines
1.1 KiB
TypeScript
41 lines
1.1 KiB
TypeScript
/// <reference path="./.sst/platform/config.d.ts" />
|
|
export default $config({
|
|
app(input) {
|
|
return {
|
|
name: "nestri",
|
|
removal: input?.stage === "production" ? "retain" : "remove",
|
|
protect: ["production"].includes(input?.stage),
|
|
home: "aws",
|
|
providers: {
|
|
aws: {
|
|
region: "us-east-1",
|
|
profile:
|
|
input.stage === "production" ? "nestri-production" : "nestri-dev",
|
|
},
|
|
cloudflare: "6.2.0",
|
|
random: "4.17.0",
|
|
command: "1.0.2",
|
|
},
|
|
};
|
|
},
|
|
async run() {
|
|
const fs = await import("fs")
|
|
|
|
$transform(sst.aws.Function, (args) => {
|
|
args.environment = $resolve([args.environment]).apply(([environment]) => {
|
|
return {
|
|
...environment,
|
|
NODE_OPTIONS: "--experimental-websocket",
|
|
};
|
|
});
|
|
});
|
|
|
|
const outputs = {};
|
|
for (const value of fs.readdirSync("./infra/")) {
|
|
const result = await import("./infra/" + value);
|
|
if (result.outputs) Object.assign(outputs, result.outputs);
|
|
}
|
|
return outputs;
|
|
},
|
|
});
|