Skip to content

Commit 81a7ca5

Browse files
authored
stop copying common (#530)
1 parent 4f97a30 commit 81a7ca5

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

63 files changed

+179
-128
lines changed

Makefile

Lines changed: 14 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,12 @@ setup:
1010
@echo "- edit web/.env"
1111
@echo "- run make sync"
1212

13-
setup-ci:
14-
if [ ${DATABASE_URL} == "" ]; then echo 'Please set DATABASE_URL_FOR_SQL_GENERATION!'; exit 1; fi
13+
setup-ci:
14+
if [ "" == ${DATABASE_URL} ]; then echo 'Please set DATABASE_URL_FOR_SQL_GENERATION!'; exit 1; fi
1515
make sync
1616
make generate-sql
1717

18-
sync: sync-server sync-web sync-root copy-common
18+
sync: sync-server sync-web sync-root sync-common
1919
lefthook install || true
2020
@echo '----------------------------------------------------------------------------------------------------------'
2121
@echo '| Most work is done. now running prisma-generate-sql (which might fail if .env.dev is not set configured)|'
@@ -42,17 +42,17 @@ test: dev-db
4242
cd ./test; ENV_FILE=../server/.env.dev bun test
4343
docker stop postgres
4444

45-
prepare-deploy-web: copy-common
45+
prepare-deploy-web: sync-common
4646
cd web; bun install; bun run build
47-
prepare-deploy-server: copy-common sync-server generate-sql
47+
prepare-deploy-server: sync-common sync-server generate-sql
4848
deploy-server:
4949
cd server; bun src/main.ts
5050

51-
docker: copy-common
51+
docker:
5252
@# deferring `docker compose down`. https://qiita.com/KEINOS/items/532dc395fe0f89c2b574
5353
trap 'docker compose down' EXIT; docker compose up --build
5454

55-
docker-watch: copy-common
55+
docker-watch:
5656
docker compose up --build --watch
5757

5858
seed:
@@ -93,6 +93,8 @@ sync-server:
9393

9494
sync-root:
9595
bun install --frozen-lockfile
96+
sync-common:
97+
cd common; bun install --frozen-lockfile
9698

9799

98100
# Static checks
@@ -117,7 +119,7 @@ format-check:
117119
@exit 1
118120

119121
# type checks
120-
type-check: copy-common
122+
type-check:
121123
make type-check-server
122124
make type-check-web
123125

@@ -133,9 +135,9 @@ type-check-web:
133135
start-all: build-web build-server
134136
make serve-all
135137

136-
build-web: copy-common-to-web
138+
build-web:
137139
cd web; bun run build
138-
build-server: copy-common-to-server
140+
build-server:
139141
cd server; bun run build
140142

141143
serve-all:
@@ -145,17 +147,9 @@ serve-web:
145147
serve-server:
146148
cd server; bun run serve
147149

148-
watch-web: copy-common-to-web
150+
watch-web:
149151
cd web; bun run dev
150-
watch-server: copy-common-to-server
152+
watch-server:
151153
cd server; bun run dev
152154

153-
copy-common: copy-common-to-server copy-common-to-web
154-
copy-common-to-server:
155-
@ if [ -d server/src/common ]; then rm -r server/src/common; fi
156-
@ cp -r common server/src/common
157-
copy-common-to-web:
158-
@ if [ -d web/common ]; then rm -r web/common; fi
159-
@ cp -r common web/common
160-
161155
.PHONY: test

bun.lockb

-3.01 KB
Binary file not shown.

common/README.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# common
2+
3+
To install dependencies:
4+
5+
```bash
6+
bun install
7+
```
8+
9+
To run:
10+
11+
```bash
12+
bun run index.ts
13+
```
14+
15+
This project was created using `bun init` in bun v1.1.29. [Bun](https://bun.sh) is a fast all-in-one JavaScript runtime.

common/bun.lockb

3.38 KB
Binary file not shown.

common/package.json

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"name": "common",
3+
"type": "module",
4+
"devDependencies": {
5+
"@types/bun": "latest"
6+
},
7+
"peerDependencies": {
8+
"typescript": "^5.0.0"
9+
},
10+
"dependencies": {
11+
"zod": "^3.23.8"
12+
}
13+
}

common/tsconfig.json

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
{
2+
"compilerOptions": {
3+
// Enable latest features
4+
"lib": ["ESNext", "DOM"],
5+
"target": "ESNext",
6+
"module": "ESNext",
7+
"moduleDetection": "force",
8+
"jsx": "react-jsx",
9+
"allowJs": true,
10+
11+
// Bundler mode
12+
"moduleResolution": "bundler",
13+
"allowImportingTsExtensions": true,
14+
"verbatimModuleSyntax": true,
15+
"noEmit": true,
16+
17+
// Best practices
18+
"strict": true,
19+
"skipLibCheck": true,
20+
"noFallthroughCasesInSwitch": true,
21+
22+
// Some stricter flags (disabled by default)
23+
"noUnusedLocals": false,
24+
"noUnusedParameters": false,
25+
"noPropertyAccessFromIndexSignature": false
26+
}
27+
}

flake.lock

Lines changed: 12 additions & 12 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@
1212
"devDependencies": {
1313
"@biomejs/biome": "^1.9.1",
1414
"@types/bun": "^1.1.10",
15-
"lefthook": "^1.8.2",
15+
"cspell": "^8.14.4",
1616
"typescript": "^5.6.2",
17-
"cspell": "^8.14.4"
17+
"lefthook": "^1.8.2"
1818
},
1919
"dependencies": {
2020
"zod": "^3.23.8"

server/bun.lockb

1.85 KB
Binary file not shown.

server/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
"author": "",
1818
"license": "ISC",
1919
"dependencies": {
20+
"common": "file:../common",
2021
"@prisma/client": "^5.20.0",
2122
"cookie-parser": "^1.4.6",
2223
"cors": "^2.8.5",

0 commit comments

Comments
 (0)