Skip to content

Remove terser as dependency#1293

Merged
minggangw merged 1 commit into
RobotWebTools:developfrom
minggangw:fix-1292
Oct 17, 2025
Merged

Remove terser as dependency#1293
minggangw merged 1 commit into
RobotWebTools:developfrom
minggangw:fix-1292

Conversation

@minggangw

@minggangw minggangw commented Oct 17, 2025

Copy link
Copy Markdown
Member

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

Copilot AI review requested due to automatic review settings October 17, 2025 05:02

Copilot AI left a comment

Copy link
Copy Markdown

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 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, ''));

Copilot AI Oct 17, 2025

Copy link

Choose a reason for hiding this comment

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

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.

Suggested change
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'));

Copilot uses AI. Check for mistakes.
@coveralls

Copy link
Copy Markdown

Coverage Status

coverage: 83.268% (-0.03%) from 83.298%
when pulling fd053f3 on minggangw:fix-1292
into 1c0c4af on RobotWebTools:develop.

@minggangw minggangw merged commit 898c8dc into RobotWebTools:develop Oct 17, 2025
26 of 27 checks passed
minggangw added a commit that referenced this pull request Oct 30, 2025
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
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.

3 participants