-
Notifications
You must be signed in to change notification settings - Fork 0
/
package-scripts.js
59 lines (56 loc) · 2.07 KB
/
package-scripts.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
const path = require('path');
const apiPath = path.resolve(__dirname, 'apps/api');
const webPath = path.resolve(__dirname, 'apps/web');
const ciApiPath = path.resolve(__dirname, 'out/apps/api');
const ciWebPath = path.resolve(__dirname, 'out/apps/web');
module.exports = {
scripts: {
prepare: {
default: `nps prepare.web prepare.api`,
web: `pnpm`,
api: `nps prepare.docker prisma.migrate.dev`,
docker: 'docker-compose up -d',
ci: {
web: `pnpx turbo prune --scope=web && cd out && pnpm install --frozen-lockfile`,
api: `pnpx turbo prune --scope=api && cd out && pnpm install --frozen-lockfile && nps prisma.generate`,
},
},
test: {
default: `nps test.web test.api`,
web: `cd ${webPath} && pnpm test:watch`,
api: `cd ${apiPath} && pnpm test:watch`,
ci: {
default: `nps test.ci.web test.ci.api`,
web: `cd ${ciWebPath} && pnpm test:ci`,
api: `cd ${ciApiPath} && pnpm test:ci`,
},
watch: {
default: `nps test.watch.web test.watch.api`,
web: `cd ${webPath} && pnpm test:ci`,
api: `cd ${apiPath} && pnpm test:watch`,
},
},
prisma: {
generate: `cd ${apiPath} && pnpx prisma generate`,
studio: `cd ${apiPath} && pnpx prisma studio`,
migrate: {
dev: `cd ${apiPath} && pnpx prisma migrate dev`,
},
},
build: {
default: 'pnpx turbo run build',
ci: {
web: 'cd out && pnpm run build',
api: 'cd out && pnpm run build',
},
},
docker: {
build: {
default: 'nps docker.build.web docker.build.api',
web: `docker build -t web . -f ${webPath}/Dockerfile`,
api: `docker build -t api . -f ${apiPath}/Dockerfile`,
},
},
dev: 'pnpx turbo run dev',
},
};