Skip to content

Add comprehensive test for JavaScript comment removal on all .cjs files with syntax validation#5780

Merged
pelikhan merged 5 commits intomainfrom
copilot/extend-remove-js-comments
Dec 7, 2025
Merged

Add comprehensive test for JavaScript comment removal on all .cjs files with syntax validation#5780
pelikhan merged 5 commits intomainfrom
copilot/extend-remove-js-comments

Conversation

Copy link
Contributor

Copilot AI commented Dec 7, 2025

  • Analyze current implementation of removeJavaScriptComments
  • Verify multiline comment support is already implemented
  • Verify extensive test suite already exists
  • Add test that applies removeJavaScriptComments to all .cjs files in repo
  • Add typecheck validation after comment removal
  • Skip test files (.test.cjs) which use ES module syntax
  • Wrap code in async function for Node.js syntax validation
  • Test successfully validates 108 .cjs files
  • Format code with go fmt
  • Verified pre-existing test failures are unrelated to changes
  • All JavaScript comment removal tests passing
  • Reverted workflow lock files to bundled state (functions inlined, not using require)
  • Enhanced bundler to automatically remove JavaScript comments from bundled output
  • Updated bundler integration tests to reflect comment removal
  • Verified bundler applies helpers correctly and removes comments as requested
Original prompt

Extend removeJavaScriptComments to remove multiline comments

  • add extensive test suite
  • add test that applies function to all .cjs in the repo + typecheck

💡 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 3 commits December 7, 2025 19:06
…js files

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
…es with syntax validation

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
}
return "";
}
const { updateActivationComment } = require("./update_activation_comment.cjs");
Copy link
Contributor

Choose a reason for hiding this comment

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

@copilot needs to be bundled

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed in aac1a60. Reverted the workflow lock files to their original bundled state where functions are inlined instead of using require() statements.

Copilot AI changed the title [WIP] Extend removeJavaScriptComments to support multiline comments Add comprehensive test for JavaScript comment removal on all .cjs files with syntax validation Dec 7, 2025
Copilot AI requested a review from pelikhan December 7, 2025 19:22
…required

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
@pelikhan
Copy link
Contributor

pelikhan commented Dec 7, 2025

@copilot make sure the bundler applies the helper and removes comments

@pelikhan pelikhan marked this pull request as ready for review December 7, 2025 19:41
@pelikhan pelikhan merged commit b6eafef into main Dec 7, 2025
5 of 6 checks passed
Copy link
Contributor Author

Copilot AI commented Dec 7, 2025

@copilot make sure the bundler applies the helper and removes comments

Fixed in 733bd1f. The bundler now:

  1. Bundles (inlines) helper functions from dependencies
  2. Removes all JavaScript comments from the bundled output

This ensures scripts are minified and don't contain sensitive information in comments.

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.

2 participants