forked from hiero-ledger/hiero-sdk-js
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTaskfile.yml
More file actions
255 lines (212 loc) · 7.6 KB
/
Taskfile.yml
File metadata and controls
255 lines (212 loc) · 7.6 KB
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
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
version: "3"
silent: false
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
"solo:setup":
desc: "Set up and start Solo services (cluster, network, mirror node, account, port forwarding)"
cmds:
- node ./scripts/solo-setup.js {{.CLI_ARGS}}
"solo:resume":
desc: "Resume Solo services (start nodes, add mirror node, re-enable port forwarding)"
cmds:
- node ./scripts/solo-resume.js {{.CLI_ARGS}}
"solo:pause":
desc: "Pause Solo services (destroy mirror node, stop consensus nodes, remove port forwarding)"
cmds:
- node ./scripts/solo-pause.js {{.CLI_ARGS}}
"solo:teardown":
desc: "Complete teardown (removes cluster and Solo config)"
cmds:
- node ./scripts/solo-teardown.js {{.CLI_ARGS}}
"solo:status":
desc: "Check Solo cluster status"
cmds:
- |
echo "Checking Solo cluster status..."
if kind get clusters 2>/dev/null | grep -q "^solo-cluster$"; then
echo "✓ Kind cluster 'solo-cluster' is running"
kubectl get pods -n solo 2>/dev/null || echo "✗ Namespace 'solo' not found"
else
echo "✗ Kind cluster 'solo-cluster' not found"
echo "Run 'task solo:setup' to create and start it"
fi
"solo:logs":
desc: "View logs from Solo services"
cmds:
- kubectl logs -n solo -l app=network-node --tail=100 -f
"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
install:
desc: "Install deps then build proto and cryptography (pnpm i first so protobufjs-cli is available)"
cmds:
- pnpm i
- task proto:build
- task cryptography:build
build:
cmds:
- task: build:prep
- task: build:compile
"build:dev":
desc: "Build and globally link @hiero-ledger/sdk (and subpackages) for local dev"
cmds:
- task: "proto:build:dev"
- task: "cryptography:build:dev"
- task: build
- ./scripts/link-sdk-global.sh
"build:prep":
cmds:
- task: install
- task: format
- task: lint
- node ./scripts/generate-request-and-status-files.js
"build:compile":
cmds:
- npx babel src -d lib --out-file-extension .cjs
- npx rollup -c
clean:
deps:
- "examples:clean"
- "simple_rest_signature_provider:clean"
- "common_js_test:clean"
cmds:
# Remove in reverse dependency order to avoid re-linking
- |
pnpm list --global --depth 0 2>/dev/null | grep -q "@hiero-ledger/sdk" && pnpm remove --global @hiero-ledger/sdk 2>/dev/null || true
- task: "cryptography:clean"
- task: "proto:clean"
- rm -rf node_modules
format:
cmds:
- npx prettier src "test/unit/*.js" "test/integration/*.js" "*.json" "src/*.js" "scripts/*.js" --write
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
"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 vitest --config=test/vitest-node.config.ts
"test:unit:node:codecov":
cmds:
- npx vitest --coverage --config=test/vitest-node.config.ts
"test:unit:browser:codecov":
cmds:
- npx vitest --coverage --config=test/vitest-browser.config.ts
"test:unit:codecov":
deps:
- test:unit:node:codecov
- test:unit:browser:codecov
"test:unit:browser":
cmds:
- npx vitest --config=test/vitest-browser.config.ts
"test:integration":
deps:
- "test:integration:browser"
- "test:integration:node"
"test:integration:node":
cmds:
- npx vitest --config=test/vitest-node-integration.config.ts
"test:integration:browser":
cmds:
- npx vitest --config=test/vitest-browser-integration.config.ts
"test:integration:node:codecov":
cmds:
- npx vitest --coverage --config=test/vitest-node-integration.config.ts
"test:integration:browser:codecov":
cmds:
- npx vitest --coverage --config=test/vitest-browser-integration.config.ts
"test:integration:codecov":
deps:
- test:integration:node:codecov
- test:integration:browser:codecov
"test:integration:dual-mode":
cmds:
- npx vitest --maxWorkers=1 --config=test/vitest-node-integration-dual-mode.config.ts
- npx vitest --maxWorkers=1 --config=test/vitest-browser-integration-dual-mode.config.ts
"test:integration:dual-mode:codecov":
cmds:
- npx vitest --coverage --maxWorkers=1 --config=test/vitest-node-integration-dual-mode.config.ts
- npx vitest --coverage --maxWorkers=1 --config=test/vitest-browser-integration-dual-mode.config.ts
"update:proto":
desc: "Fetch protos from submodule at tag, regenerate JS (run only when bumping proto version)"
deps:
- "proto:update"
cmds:
- pnpm install
"update:addressbooks":
cmds:
- node ./scripts/update-address-books.js
update:
desc: "Update address books and build (does not update protos; use task update:proto when needed)"
cmds:
- task: update:addressbooks
- task: update:proto
- task: build
pack:
preconditions:
- "! grep '\".*\": \"\\(link\\|file\\):.*\"' package.json"
deps:
- "build"
cmds:
- pnpm pack --out {{.CLI_ARGS}}
- ls -lh {{.CLI_ARGS}}
"publish":
cmds:
- npm publish {{.TARBALL}} {{.CLI_ARGS}}