|
6 | 6 | if [ ! `command -v bun` ]; then echo 'ERR: Bun is required!'; exit 1; fi |
7 | 7 | make sync |
8 | 8 | bunx husky |
9 | | - cd web; if [ ! -f .env ]; then cp ./.env.sample ./.env ; fi |
10 | | - cd server; if [ ! -f .env.dev ]; then cp ./.env.sample ./.env.dev ; fi |
11 | 9 | @echo "auto setup is done. now do:" |
12 | 10 | @echo "- edit server/.env.dev" |
13 | 11 | @echo "- edit web/.env" |
@@ -38,17 +36,17 @@ test: export DATABASE_URL=$(LOCAL_DB) |
38 | 36 | test: export NEVER_LOAD_DOTENV=1 |
39 | 37 | test: export UNSAFE_SKIP_AUTH=1 |
40 | 38 | test: export FIREBASE_PROJECT_ID=mock-proj |
| 39 | +test: export CORS_ALLOW_ORIGINS=http://localhost:3000,https://localhost:5173 |
41 | 40 | test: dev-db |
42 | 41 | cd server/src; ENV_FILE=../.env.dev bun test |
43 | 42 | cd ./test; ENV_FILE=../server/.env.dev bun test |
44 | 43 | docker stop postgres |
45 | 44 |
|
46 | 45 | prepare-deploy-web: copy-common |
47 | 46 | cd web; bun install; bun run build |
48 | | -prepare-deploy-server: copy-common |
49 | | - cd server; bun install; npx prisma generate; |
| 47 | +prepare-deploy-server: copy-common sync-server generate-sql |
50 | 48 | deploy-server: |
51 | | - cd server; bun src/index.ts |
| 49 | + cd server; bun src/main.ts |
52 | 50 |
|
53 | 51 | docker: copy-common |
54 | 52 | @# deferring `docker compose down`. https://qiita.com/KEINOS/items/532dc395fe0f89c2b574 |
@@ -95,16 +93,16 @@ spell-check: |
95 | 93 | # Sync (install/update packages, generate prisma, etc) |
96 | 94 |
|
97 | 95 | sync-web: |
98 | | - cd web; bun install |
| 96 | + cd web; bun install --frozen-lockfile |
99 | 97 | # copy .env.sample -> .env only if .env is not there |
100 | 98 |
|
101 | 99 | sync-server: |
102 | | - cd server; bun install |
| 100 | + cd server; bun install --frozen-lockfile |
103 | 101 | cd server; bunx prisma generate |
104 | 102 | # copy .env.sample -> .env only if .env is not there |
105 | 103 |
|
106 | 104 | sync-root: |
107 | | - bun install |
| 105 | + bun install --frozen-lockfile |
108 | 106 |
|
109 | 107 |
|
110 | 108 | # Static checks |
@@ -167,7 +165,7 @@ copy-common-to-server: |
167 | 165 | @ if [ -d server/src/common ]; then rm -r server/src/common; fi |
168 | 166 | @ cp -r common server/src/common |
169 | 167 | copy-common-to-web: |
170 | | - @ if [ -d web/src/common ]; then rm -r web/src/common; fi |
171 | | - @ cp -r common web/src/common |
| 168 | + @ if [ -d web/common ]; then rm -r web/common; fi |
| 169 | + @ cp -r common web/common |
172 | 170 |
|
173 | 171 | .PHONY: test |
0 commit comments