-
Notifications
You must be signed in to change notification settings - Fork 79
/
Copy pathTaskfile
66 lines (53 loc) · 2.24 KB
/
Taskfile
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
60
61
62
63
64
65
66
#!/bin/bash
PATH="$PWD/node_modules/.bin":$PATH
set -e
compatibilty_check() {
set -x
rm -rf ./@generated && npm run prisma:g && npm run tscheck
# Enable noAtomicOperations
sed -i 's/noAtomicOperations *= false/noAtomicOperations = true/g' prisma/schema.prisma
rm -rf ./@generated && npm run prisma:g && npm run tscheck
sed -i 's/noAtomicOperations *= true/noAtomicOperations = false/g' prisma/schema.prisma
# Enable combineScalarFilters
sed -i 's/combineScalarFilters *= false/combineScalarFilters = true/g' prisma/schema.prisma
rm -rf ./@generated && npm run prisma:g && npm run tscheck
sed -i 's/combineScalarFilters *= true/combineScalarFilters = false/g' prisma/schema.prisma
# Switching reExport
sed -i 's/reExport *= None/reExport = All/g' prisma/schema.prisma
rm -rf ./@generated && npm run prisma:g && npm run tscheck
sed -i 's/reExport *= All/reExport = None/g' prisma/schema.prisma
# emitSingle and emitCompiled
sed -i 's/emitSingle *= false/emitSingle = true/g' prisma/schema.prisma
rm -rf ./@generated && npm run prisma:g
npx tsc --noEmit --skipLibCheck --experimentalDecorators ./@generated/index.ts
npx ts-node ./@generated/index.ts
sed -i 's/emitCompiled *= false/emitCompiled = true/g' prisma/schema.prisma
rm -rf ./@generated && npm run prisma:g
node ./@generated/index.js
sed -i 's/emitCompiled *= true/emitCompiled = false/g' prisma/schema.prisma
sed -i 's/emitSingle *= true/emitSingle = false/g' prisma/schema.prisma
# requireSingleFieldsInWhereUniqueInput
sed -i 's/requireSingleFieldsInWhereUniqueInput *= false/requireSingleFieldsInWhereUniqueInput = true/g' prisma/schema.prisma
rm -rf ./@generated && npm run prisma:g && npm run tscheck
sed -i 's/requireSingleFieldsInWhereUniqueInput *= true/requireSingleFieldsInWhereUniqueInput = false/g' prisma/schema.prisma
set +x
}
bundle() {
set -x
npx tsup src/index.ts --format cjs --target es2018
cp -fv README.md LICENSE package.json dist
cp -fv src/bin.js dist
}
commit_lint() {
if git-branch-is -q -r "^(master)"; then
commitlint --edit
else
true
fi
}
commit_check() {
set -x
from=$(git_last_release_tag)
commitlint --from $from
}
"$@"