소스 검색

Use Decision Maker 2000 deployment identity

Tom McKenzie 1 개월 전
부모
커밋
b8ccdfbd00
4개의 변경된 파일과 10개의 추가작업 그리고 8개의 파일을 삭제
  1. 3 3
      docs/spec.md
  2. 1 1
      package.json
  3. 1 1
      src/auth/index.ts
  4. 5 3
      wrangler.toml

+ 3 - 3
docs/spec.md

@@ -387,11 +387,11 @@ Stack as built:
 
 Dev loop:
 
-1. `npm install && cp .dev.vars.example .dev.vars`, paste keys.
-2. `npm run db:migrate:dev && npm run dev` — local D1 + DO in miniflare, hot reload, OTP codes in the console.
+1. `pnpm install && cp .dev.vars.example .dev.vars`, paste keys.
+2. `pnpm db:migrate:dev && pnpm dev` — local D1 + DO in miniflare, hot reload, OTP codes in the console.
 3. Two phones on the LAN: `wrangler dev --ip 0.0.0.0`, open `/`, jump in, create a hand, share `/h/<id>`.
 4. Tune the pick instruction in `wrangler.toml` `[vars].PICK_INSTRUCTIONS`; it hot-reloads.
-5. Preview deploys: `npx wrangler versions upload` gives a URL without touching prod. First real deploy: `wrangler d1 create pm2000-db`, paste the id, `wrangler secret put TYPESAFE_API_KEY`, `wrangler secret put BETTER_AUTH_SECRET`, `npm run deploy`.
+5. Preview deploys: `pnpm exec wrangler versions upload` gives a URL without touching prod. First real deploy: `pnpm exec wrangler d1 create decision-maker-2000-db`, paste the ID, configure the secrets in `README.md`, then run `pnpm deploy`.
 
 Still to support the dev loop:
 

+ 1 - 1
package.json

@@ -1,5 +1,5 @@
 {
-  "name": "pm2000",
+  "name": "decision-maker-2000",
   "type": "module",
   "scripts": {
     "dev": "pnpm build:client && wrangler dev",

+ 1 - 1
src/auth/index.ts

@@ -80,7 +80,7 @@ function createAuth(env?: CloudflareBindings, cf?: IncomingRequestCfProperties,
                         otpLength: 6,
                         expiresIn: 300,
                         signUpOnVerification: {
-                            getTempEmail: phone => `${phone.replace(/\D/g, "")}@phone.pm2000.local`,
+                            getTempEmail: phone => `${phone.replace(/\D/g, "")}@phone.decision-maker-2000.local`,
                             getTempName: phone => phone,
                         },
                     }),

+ 5 - 3
wrangler.toml

@@ -1,7 +1,9 @@
-name = "pm2000"
+name = "decision-maker-2000"
 main = "src/index.ts"
 compatibility_date = "2025-03-01"
 compatibility_flags = ["nodejs_compat"]
+workers_dev = true
+preview_urls = true
 
 [observability]
 enabled = true
@@ -13,8 +15,8 @@ run_worker_first = ["/api/*", "/h/*", "/health"]
 
 [[d1_databases]]
 binding = "DATABASE"
-database_name = "pm2000-db"
-database_id = "your-d1-database-id-here"
+database_name = "decision-maker-2000-db"
+database_id = "53174032-97f0-4e43-81a2-f26a74e6300e"
 migrations_dir = "drizzle"
 
 [[durable_objects.bindings]]