From 116a63118447e15929b5eca0cca3b2d635852bbb Mon Sep 17 00:00:00 2001 From: Al Date: Thu, 10 Oct 2024 21:53:43 +0200 Subject: [PATCH] fix: normalizing utils-ts imports; refreshing instructions in readme (#11) --- README.md | 4 ++-- docs/code/functions/registerDebugEventHandlers.md | 2 +- src/debugging/writeAVMDebugTrace.spec.ts | 3 +-- src/debugging/writeAVMDebugTrace.ts | 2 +- src/debugging/writeTealDebugSourceMaps.spec.ts | 3 +-- src/debugging/writeTealDebugSourceMaps.ts | 2 +- src/index.ts | 3 +-- 7 files changed, 8 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 91dc5e4..8d178be 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,7 @@ Then to import it and activate `utils-ts` debugging: ```typescript import { Config } from '@algorandfoundation/algokit-utils' -import { registerDebugHandlers } from '@algorandfoundation/algokit-utils-debug' +import { registerDebugEventHandlers() } from '@algorandfoundation/algokit-utils-debug' Config.configure({ debug: true, @@ -27,7 +27,7 @@ Config.configure({ traceBufferSizeMb: 256, // optional, defaults to 256 megabytes. When the output folder containing debug trace files exceeds the size, oldest files are removed to optimize for storage consumption. This is useful when you are running a long running application and want to keep the trace files for debugging purposes but also be mindful of storage consumption. maxSearchDepth: 10, // optional, defaults to 10. The maximum depth to search for an `algokit` config file. By default it will traverse at most `10` folders searching for `.algokit.toml` file which will be used to determine the algokit compliant project root path. Ignored if `projectRoot` is provided directly or via `ALGOKIT_PROJECT_ROOT` environment variable. }) -registerDebugHandlers() // IMPORTANT: must be called before any transactions are submitted. +registerDebugEventHandlers() // IMPORTANT: must be called before any transactions are submitted. ``` See [code documentation](./docs/code/README.md) for more details. diff --git a/docs/code/functions/registerDebugEventHandlers.md b/docs/code/functions/registerDebugEventHandlers.md index 15fbf1d..5a81ca2 100644 --- a/docs/code/functions/registerDebugEventHandlers.md +++ b/docs/code/functions/registerDebugEventHandlers.md @@ -22,4 +22,4 @@ These handlers help in debugging Algorand smart contracts by providing detailed ## Defined in -[index.ts:17](https://github.com/algorandfoundation/algokit-utils-ts-debug/blob/main/src/index.ts#L17) +[index.ts:16](https://github.com/algorandfoundation/algokit-utils-ts-debug/blob/main/src/index.ts#L16) diff --git a/src/debugging/writeAVMDebugTrace.spec.ts b/src/debugging/writeAVMDebugTrace.spec.ts index 26c7f20..fb87ad0 100644 --- a/src/debugging/writeAVMDebugTrace.spec.ts +++ b/src/debugging/writeAVMDebugTrace.spec.ts @@ -1,6 +1,5 @@ -import { Config, performAtomicTransactionComposerSimulate } from '@algorandfoundation/algokit-utils' +import { Config, EventType, performAtomicTransactionComposerSimulate } from '@algorandfoundation/algokit-utils' import { algorandFixture } from '@algorandfoundation/algokit-utils/testing' -import { EventType } from '@algorandfoundation/algokit-utils/types/lifecycle-events' import { describe, expect, test } from '@jest/globals' import algosdk, { makeEmptyTransactionSigner } from 'algosdk' import * as fs from 'fs/promises' diff --git a/src/debugging/writeAVMDebugTrace.ts b/src/debugging/writeAVMDebugTrace.ts index 8573216..5eb5d7e 100644 --- a/src/debugging/writeAVMDebugTrace.ts +++ b/src/debugging/writeAVMDebugTrace.ts @@ -1,4 +1,4 @@ -import { AVMTracesEventData } from '@algorandfoundation/algokit-utils/types/debugging' +import { AVMTracesEventData } from '@algorandfoundation/algokit-utils' import { DEBUG_TRACES_DIR } from '../constants' import { getProjectRoot, joinPaths, writeToFile } from '../utils' diff --git a/src/debugging/writeTealDebugSourceMaps.spec.ts b/src/debugging/writeTealDebugSourceMaps.spec.ts index b117c60..01c211c 100644 --- a/src/debugging/writeTealDebugSourceMaps.spec.ts +++ b/src/debugging/writeTealDebugSourceMaps.spec.ts @@ -1,6 +1,5 @@ -import { Config } from '@algorandfoundation/algokit-utils' +import { Config, EventType } from '@algorandfoundation/algokit-utils' import { algorandFixture } from '@algorandfoundation/algokit-utils/testing' -import { EventType } from '@algorandfoundation/algokit-utils/types/lifecycle-events' import { describe, expect, test } from '@jest/globals' import algosdk from 'algosdk' import * as fsSync from 'fs' diff --git a/src/debugging/writeTealDebugSourceMaps.ts b/src/debugging/writeTealDebugSourceMaps.ts index 186e2a0..5c74dd1 100644 --- a/src/debugging/writeTealDebugSourceMaps.ts +++ b/src/debugging/writeTealDebugSourceMaps.ts @@ -5,7 +5,7 @@ import { TEAL_SOURCEMAP_EXT, TealSourceDebugEventData, TealSourcesDebugEventData, -} from '@algorandfoundation/algokit-utils/types/debugging' +} from '@algorandfoundation/algokit-utils' import { getProjectRoot, writeToFile } from '../utils' async function writeTealDebugSourceMap(source: TealSourceDebugEventData, projectRoot: string): Promise { diff --git a/src/index.ts b/src/index.ts index 2237e54..054f0b0 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,6 +1,5 @@ /* eslint-disable @typescript-eslint/no-explicit-any */ -import { AVMTracesEventData, Config, TealSourcesDebugEventData } from '@algorandfoundation/algokit-utils' -import { EventType } from '@algorandfoundation/algokit-utils/types/lifecycle-events' +import { AVMTracesEventData, Config, EventType, TealSourcesDebugEventData } from '@algorandfoundation/algokit-utils' import { writeAVMDebugTrace, writeTealDebugSourceMaps } from './debugging' /**