Skip to content

Remove unused code: exportTemplates script reference - #431

Open
timowestnosto with Copilot wants to merge 2 commits into
mainfrom
copilot/fix-430
Open

Remove unused code: exportTemplates script reference#431
timowestnosto with Copilot wants to merge 2 commits into
mainfrom
copilot/fix-430

Conversation

Copilot AI commented Aug 31, 2025

Copy link
Copy Markdown
Contributor

This PR addresses the request to "drop all non exported code" by conducting a comprehensive analysis of the codebase to identify and remove unused code.

Analysis Methodology

I performed a thorough dependency graph analysis starting from all public export entry points:

  • src/index.ts (main library)
  • src/react.ts (React integration)
  • src/liquid.ts (Liquid templates)
  • src/mustache.ts (Mustache templates)
  • src/handlebars.ts (Handlebars templates)

The analysis traced all imports, exports, and re-exports to map the complete dependency tree.

Findings

Excellent Code Architecture: The analysis revealed that this codebase has virtually no dead code. All 25 TypeScript source files are reachable from the public exports and serve specific purposes in the API.

Key Verified Dependencies:

  • All utility functions in src/utils/ are used by core library functionality
  • src/shims.d.ts provides essential TypeScript ambient declarations for template files and Google Analytics APIs
  • All framework integrations (React, Liquid, Mustache, Handlebars) are fully utilized
  • Core library files form a cohesive dependency graph

Changes Made

Removed unused npm script: The only unused code found was a reference to "exportTemplates": "node scripts/exportTemplates.js" in package.json. This script file doesn't exist and is not referenced anywhere else in the codebase.

Verification

  • ✅ All builds pass (npm run build)
  • ✅ All 136 tests pass (npm run test)
  • ✅ TypeScript compilation works without errors
  • ✅ Dev server functionality verified

The codebase demonstrates excellent dependency management with minimal technical debt.

Fixes #430.


💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.

Copilot AI changed the title [WIP] drop all non exported code Remove unused code: exportTemplates script reference Aug 31, 2025
Copilot AI requested a review from timowestnosto August 31, 2025 18:13
@timowestnosto
timowestnosto marked this pull request as ready for review August 31, 2025 18:21
Copilot AI review requested due to automatic review settings August 31, 2025 18:21

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull Request Overview

This PR removes an unused npm script reference from package.json as part of a broader cleanup effort to eliminate dead code from the codebase. The change removes the "exportTemplates" script which references a non-existent file.

Key Changes

  • Removed unused npm script entry for "exportTemplates" that pointed to a missing script file

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

drop all non exported code

3 participants