Remove terser as dependency#1293
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR removes the terser dependency from the project, eliminating JavaScript minification capabilities and replacing them with a simpler whitespace cleanup approach.
- Removed terser dependency and import
- Replaced minification logic with regex-based empty line removal
- Updated development script to remove prettier formatting step
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| rosidl_gen/templates/message.dot | Removed blank line for cleaner formatting |
| rosidl_gen/idl_generator.js | Removed terser import and minification logic, replaced with basic whitespace cleanup |
| package.json | Removed terser dependency and updated dev script |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
|
|
||
| await fse.mkdirs(dir); | ||
| await fse.writeFile(path.join(dir, fileName), result ? result.code : code); | ||
| await fse.writeFile(path.join(dir, fileName), code.replace(/^\s*\n/gm, '')); |
There was a problem hiding this comment.
The regex /^\s*\n/gm only removes lines that contain only whitespace, but the replacement with empty string '' could create unexpected concatenation. Consider using a more precise regex like /^\s*\n+/gm and replace with '\n' to maintain proper line breaks, or /\n\s*\n/g with '\n' to remove only extra blank lines.
| await fse.writeFile(path.join(dir, fileName), code.replace(/^\s*\n/gm, '')); | |
| await fse.writeFile(path.join(dir, fileName), code.replace(/^\s*\n+/gm, '\n')); |
This PR removes the terser dependency from the project, eliminating JavaScript minification capabilities and replacing them with a simpler whitespace cleanup approach. - Removed terser dependency and import - Replaced minification logic with regex-based empty line removal - Updated development script to remove prettier formatting step Fix: #1293
This PR removes the terser dependency from the project, eliminating JavaScript minification capabilities and replacing them with a simpler whitespace cleanup approach.
Fix: #1293