Skip to content
Merged

V3.9 #44

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
1,928 changes: 337 additions & 1,591 deletions bun.lock

Large diffs are not rendered by default.

86 changes: 17 additions & 69 deletions infra/app.ts
Original file line number Diff line number Diff line change
@@ -1,69 +1,17 @@
import { domain } from "./stage"

const GITHUB_APP_ID = new sst.Secret("GITHUB_APP_ID")
const GITHUB_APP_PRIVATE_KEY = new sst.Secret("GITHUB_APP_PRIVATE_KEY")
export const EMAILOCTOPUS_API_KEY = new sst.Secret("EMAILOCTOPUS_API_KEY")
const ADMIN_SECRET = new sst.Secret("ADMIN_SECRET")
const DISCORD_SUPPORT_BOT_TOKEN = new sst.Secret("DISCORD_SUPPORT_BOT_TOKEN")
const DISCORD_SUPPORT_CHANNEL_ID = new sst.Secret("DISCORD_SUPPORT_CHANNEL_ID")
const FEISHU_APP_ID = new sst.Secret("FEISHU_APP_ID")
const FEISHU_APP_SECRET = new sst.Secret("FEISHU_APP_SECRET")
const bucket = new sst.cloudflare.Bucket("Bucket")

export const api = new sst.cloudflare.Worker("Api", {
domain: `api.${domain}`,
handler: "packages/function/src/api.ts",
environment: {
WEB_DOMAIN: domain,
},
url: true,
link: [
bucket,
GITHUB_APP_ID,
GITHUB_APP_PRIVATE_KEY,
ADMIN_SECRET,
DISCORD_SUPPORT_BOT_TOKEN,
DISCORD_SUPPORT_CHANNEL_ID,
FEISHU_APP_ID,
FEISHU_APP_SECRET,
],
transform: {
worker: (args) => {
args.logpush = true
if ($app.stage === "vimtor" || $app.stage === "adam") return
args.bindings = $resolve(args.bindings).apply((bindings) => [
...bindings,
{
name: "SYNC_SERVER",
type: "durable_object_namespace",
className: "SyncServer",
},
])
args.migrations = {
// Note: when releasing the next tag, make sure all stages use tag v2
oldTag: $app.stage === "production" || $app.stage === "thdxr" ? "" : "v1",
newTag: $app.stage === "production" || $app.stage === "thdxr" ? "" : "v1",
//newSqliteClasses: ["SyncServer"],
}
},
},
})

new sst.cloudflare.x.Astro("Web", {
domain: "docs." + domain,
path: "packages/web",
environment: {
// For astro config
SST_STAGE: $app.stage,
VITE_API_URL: api.url.apply((url) => url!),
},
})

new sst.cloudflare.StaticSite("WebApp", {
domain: "app." + domain,
path: "packages/app",
build: {
command: "bun turbo build",
output: "./dist",
},
})
/**
* Local deployment only.
*
* The share/GitHub/Feishu backend, the docs site, and the web app all run
* locally now — there are no Cloudflare (Worker, R2, Astro, StaticSite) or
* other cloud resources to provision. Run them with their package scripts:
*
* bun run --cwd packages/function start # share backend (node, port 3099)
* bun run --cwd packages/web build && bun run --cwd packages/web preview
* bun run --cwd packages/app build # static web app -> packages/app/dist
*
* Secrets for the backend are read from the environment (see
* packages/function/src/api.ts): ADMIN_SECRET, GITHUB_APP_ID,
* GITHUB_APP_PRIVATE_KEY, FEISHU_APP_ID, FEISHU_APP_SECRET,
* DISCORD_SUPPORT_BOT_TOKEN, DISCORD_SUPPORT_CHANNEL_ID.
*/
export {}
306 changes: 0 additions & 306 deletions infra/console.ts

This file was deleted.

Loading
Loading