forked from hashgraph/hedera-sdk-js
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Taskfile.yml
190 lines (155 loc) · 5.05 KB
/
Taskfile.yml
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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
version: "3"
silent: true
includes:
examples:
taskfile: ./examples/Taskfile.yml
dir: ./examples
common_js_test:
taskfile: ./common_js_test/Taskfile.yml
dir: ./common_js_test
simple_rest_signature_provider:
taskfile: ./examples/simple_rest_signature_provider/Taskfile.yml
dir: ./examples/simple_rest_signature_provider
proto:
taskfile: ./packages/proto/Taskfile.yml
dir: ./packages/proto
cryptography:
taskfile: ./packages/cryptography/Taskfile.yml
dir: ./packages/cryptography
tasks:
default:
deps:
- build
"run:examples":
cmds:
- task: "examples:run-examples"
docs:
cmds:
- npx typedoc
--excludeInternal
--excludePrivate
--excludeProtected
--out docs
--validation.invalidLink
--entryPoints src/index.js src/browser.js src/native.js
"yalc:install":
cmds:
- npm install -g yalc > /dev/null
"yalc:add":
cmds:
- npx yalc add @hashgraph/proto > /dev/null
- npx yalc add @hashgraph/cryptography > /dev/null
"yalc:remove":
cmds:
- npx yalc remove @hashgraph/proto > /dev/null
- npx yalc remove @hashgraph/cryptography > /dev/null
install:
deps:
- "yalc:install"
- "proto:build"
- "cryptography:build"
cmds:
- task: "yalc:add"
- pnpm i --no-frozen-lockfile > /dev/null
build:
cmds:
- task: install
- task: update:addressbooks
- task: format
- task: lint
- npx babel src -d lib --out-file-extension .cjs > /dev/null
- npx yalc publish > /dev/null
clean:
deps:
- "examples:clean"
- "cryptography:clean"
- "proto:clean"
- "simple_rest_signature_provider:clean"
- "common_js_test:clean"
cmds:
- rm -rf node_modules .yalc
format:
cmds:
- npx prettier src "test/unit/*.js" "test/integration/*.js" "*.json" "src/*.js" "scripts/*.js" --write > /dev/null
lint:
deps:
- "lint:types"
- "lint:dpdm"
- "lint:format"
- "lint:js"
"lint:types":
cmds:
- npx tsc
"lint:dpdm":
cmds:
# It's really annoying seeing [X/X] Analyze done. If a circular dep is found remove `2>&1`
- npx dpdm src/index.js --circular true --tree false --warning false
"lint:format":
cmds:
- npx prettier src "test/unit/*.js" "test/integration/*.js" "*.json" "src/*.js" --check > /dev/null
"lint:js":
cmds:
- npx eslint --fix "src/**/*.js" "test/integration/**/*.js" "test/unit/**/*.js"
"test:release":
cmds:
- task: build
- task: test:unit
- task: examples:build
- task: simple_rest_signature_provider:build
- task: common_js_test:build
test:
deps:
- "test:unit"
- "test:integration"
"test:unit":
deps:
- "test:unit:node"
- "test:unit:browser"
"test:unit:node":
cmds:
- npx mocha --inline-diffs --exit -r @babel/register -r chai/register-expect.js "test/unit/*.js" {{.CLI_ARGS}}
"test:unit:codecov":
cmds:
- npx c8 --reporter=lcov --reporter=text-summary ./node_modules/.bin/mocha --inline-diffs -r @babel/register -r chai/register-expect.js "test/unit/*.js" {{.CLI_ARGS}}
- npx c8 report
- npx codecov
"test:unit:browser":
cmds:
- ./scripts/browser_test.sh
"test:integration":
deps:
- "test:integration:node"
"test:integration:node":
cmds:
- npx mocha --exit -r @babel/register -r chai/register-expect.js "test/integration/*.js" {{.CLI_ARGS}}
"test:integration:codecov":
cmds:
- npx c8 --reporter=lcov --reporter=text-summary ./node_modules/.bin/mocha --exit -r @babel/register -r chai/register-expect.js "test/integration/*.js" {{.CLI_ARGS}}
- npx c8 report
- npx codecov
"update:proto":
deps:
- "proto:update"
cmds:
- npx yalc add @hashgraph/proto
# Remove proto so on `task build` we fix the link
- rm -rf ./node_modules/@hashgraph/proto
"update:addressbooks":
cmds:
- node ./scripts/update-address-books.js
update:
cmds:
- task: update:addressbooks
- task: update:proto
- task: build
publish:
deps:
- "test:release"
cmds:
- task: "yalc:remove"
- task: "publish:release"
"publish:release":
preconditions:
- "! grep '\".*\": \"\\(link\\|file\\):.*\"' package.json > /dev/null"
cmds:
- pnpm publish {{.CLI_ARGS}}