Skip to content

Commit

Permalink
fix: normalizing utils-ts imports; refreshing instructions in readme (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
aorumbayev authored Oct 10, 2024
1 parent 6e02b54 commit 116a631
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 11 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion docs/code/functions/registerDebugEventHandlers.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
3 changes: 1 addition & 2 deletions src/debugging/writeAVMDebugTrace.spec.ts
Original file line number Diff line number Diff line change
@@ -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'
Expand Down
2 changes: 1 addition & 1 deletion src/debugging/writeAVMDebugTrace.ts
Original file line number Diff line number Diff line change
@@ -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'

Expand Down
3 changes: 1 addition & 2 deletions src/debugging/writeTealDebugSourceMaps.spec.ts
Original file line number Diff line number Diff line change
@@ -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'
Expand Down
2 changes: 1 addition & 1 deletion src/debugging/writeTealDebugSourceMaps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<void> {
Expand Down
3 changes: 1 addition & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -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'

/**
Expand Down

0 comments on commit 116a631

Please sign in to comment.