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: - rm -rf lib - 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 - node ./scripts/generate-cts-declarations.js lib - 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" - cd test && npx eslint --fix "integration/**/*.js" "size:check": desc: "Fail when a published package tarball would exceed its budget in scripts/package-size/budgets.json" cmds: - node scripts/package-size/check-package-sizes.mjs "test:release": cmds: - task: build - task: size:check - task: test:unit - task: examples:build - task: simple_rest_signature_provider:build - task: common_js_test:build test: deps: - "test:unit" - "test:integration" "test:bundle": desc: "Bundle the packed packages with webpack, Vite and esbuild and check that fromBytes() still finds every class (needs task build)" cmds: - node test/bundle/run.mjs {{.CLI_ARGS}} "test:unit": deps: - "test:unit:node" - "test:unit:browser" "test:unit:node": cmds: - npx vitest --config=test/vitest-node.config.ts {{.CLI_ARGS}} "test:unit:tck": desc: Build the SDK, install TCK dependencies and run the CLPR adapter tests cmds: - task: build:compile - cd tck && npm ci - npx vitest run --config=test/vitest-tck.config.ts {{.CLI_ARGS}} "test:unit:node:codecov": cmds: - npx vitest --coverage --config=test/vitest-node.config.ts {{.CLI_ARGS}} "test:unit:browser:codecov": cmds: - npx vitest --coverage --config=test/vitest-browser.config.ts {{.CLI_ARGS}} "test:unit:codecov": deps: - test:unit:node:codecov - test:unit:browser:codecov "test:unit:browser": cmds: - npx vitest --config=test/vitest-browser.config.ts {{.CLI_ARGS}} "test:integration": deps: - "test:integration:browser" - "test:integration:node" "test:integration:node": cmds: - npx vitest --config=test/vitest-node-integration.config.ts {{.CLI_ARGS}} "test:integration:browser": cmds: - npx vitest --config=test/vitest-browser-integration.config.ts {{.CLI_ARGS}} "test:integration:node:codecov": cmds: - npx vitest --coverage --config=test/vitest-node-integration.config.ts {{.CLI_ARGS}} "test:integration:browser:codecov": cmds: - npx vitest --coverage --config=test/vitest-browser-integration.config.ts {{.CLI_ARGS}} "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 {{.CLI_ARGS}} - npx vitest --maxWorkers=1 --config=test/vitest-browser-integration-dual-mode.config.ts {{.CLI_ARGS}} "test:integration:dual-mode:codecov": cmds: - npx vitest --coverage --maxWorkers=1 --config=test/vitest-node-integration-dual-mode.config.ts {{.CLI_ARGS}} - npx vitest --coverage --maxWorkers=1 --config=test/vitest-browser-integration-dual-mode.config.ts {{.CLI_ARGS}} "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 9.15.5 (packageManager in the root package.json) has no `pack --out`: # pack into a temp dir, then move the tarball to the requested name. - | PACK_DIR="$(mktemp -d)" pnpm pack --pack-destination "${PACK_DIR}" mv "${PACK_DIR}"/*.tgz "{{.CLI_ARGS}}" rmdir "${PACK_DIR}" - ls -lh {{.CLI_ARGS}} "publish": cmds: - npm publish {{.TARBALL}} {{.CLI_ARGS}}