Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jul 25, 2025

This PR removes the src/print/ folder and replaces its functionality with the tree-dump npm package, which provides identical functionality.

Changes Made

  • Removed entire src/print/ folder including:

    • printTree.ts - function for printing general tree structures
    • printBinary.ts - function for printing binary tree structures
    • types.ts - Printable interface definition
    • All associated tests (__tests__/printTree.spec.ts, __tests__/printBinary.spec.ts)
  • Added tree-dump@^1.0.3 as a dependency

Why This Change?

The tree-dump package provides the exact same functionality as the removed src/print/ folder:

  • Same printTree and printBinary function signatures and behavior
  • Same Printable interface
  • Created by the same author, ensuring API compatibility

Impact

  • No breaking changes: The print functionality was not exported from the main index and had no external usage
  • Reduced codebase: Removes ~120 lines of internal code in favor of a well-maintained external dependency
  • Test coverage: Test count reduced from 701 to 693 tests (8 print tests removed), all remaining tests pass
  • Build: Successful build confirmation

Usage

The functionality is now available through the tree-dump package:

import {printTree, printBinary} from 'tree-dump';

// Same API as before
const tree = 'Node' + printTree('', [() => 'child1', () => 'child2']);  
const binary = 'Node' + printBinary('', [() => 'left', () => 'right']);

Fixes #11.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI and others added 2 commits July 25, 2025 17:18
Co-authored-by: streamich <9773803+streamich@users.noreply.github.com>
Co-authored-by: streamich <9773803+streamich@users.noreply.github.com>
Copilot AI changed the title [WIP] Remove src/print/ folder Replace src/print/ folder with tree-dump package Jul 25, 2025
Copilot AI requested a review from streamich July 25, 2025 17:23
Copy link
Collaborator

@streamich streamich left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Remove package-lock.json.
  • Use yarn to install dependencies.
  • Run yarn test and yarn build to validate everything builds.

@streamich streamich marked this pull request as ready for review July 25, 2025 18:42
Co-authored-by: streamich <9773803+streamich@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Jul 25, 2025

  • Remove package-lock.json.
  • Use yarn to install dependencies.
  • Run yarn test and yarn build to validate everything builds.

Done! Removed package-lock.json, used yarn install for dependencies, and validated with yarn test (693 tests passing) and yarn build (successful). Changes committed in cdae17d.

Copilot AI requested a review from streamich July 25, 2025 18:47
package.json Outdated
},
"dependencies": {},
"dependencies": {
"tree-dump": "^1.0.3"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove it from dependencies, as it is not used.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed tree-dump from dependencies. Since the src/print/ folder was completely removed and no code actually uses the tree-dump package, the dependency was unnecessary. Commit 61ff8fb.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Revert yarn.lock changes.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reverted yarn.lock to original state before the changes. Commit 61ff8fb.

Co-authored-by: streamich <9773803+streamich@users.noreply.github.com>
Copilot AI requested a review from streamich July 25, 2025 19:36
@streamich streamich merged commit ad9788e into master Jul 25, 2025
2 checks passed
@streamich streamich deleted the copilot/fix-11 branch July 25, 2025 19:42
@github-actions
Copy link

🎉 This PR is included in version 1.8.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Remove src/print/ folder

2 participants