forked from Mutesa-Cedric/Fullstack-typesafe-monorepo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpackage-scripts.js
55 lines (52 loc) · 1.62 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
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: `yarn`,
api: `nps prepare prisma.migrate.dev`,
ci: {
web: `npx turbo prune --scope=web && cd out && yarn install --frozen-lockfile`,
api: `npx turbo prune --scope=api && cd out && yarn install --frozen-lockfile && nps prisma.generate`,
},
},
test: {
default: `nps test.web test.api`,
web: `cd ${webPath} && yarn test:watch`,
api: `cd ${apiPath} && yarn test:watch`,
ci: {
default: `nps test.ci.web test.ci.api`,
web: `cd ${ciWebPath} && yarn test:ci`,
api: `cd ${ciApiPath} && yarn test:ci`,
},
watch: {
default: `nps test.watch.web test.watch.api`,
web: `cd ${webPath} && yarn test:ci`,
api: `cd ${apiPath} && yarn test:watch`,
},
},
prisma: {
generate: `cd ${apiPath} && npx prisma generate`,
studio: `cd ${apiPath} && npx prisma studio`,
migrate: {
dev: `cd ${apiPath} && npx prisma migrate dev`,
},
},
build: {
default: "npx turbo run build",
ci: {
web: "cd out && npm run build",
api: "cd out && npm run build",
},
},
dev: {
default: "npx turbo run dev",
web: "npx turbo run dev --scope=\"web\"",
api: "npx turbo run dev --scope=\"api\"",
}
},
};