Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Dec 18, 2025

Adds terser minification after prettier to optimize .cjs files while preserving readability and TypeScript compatibility.

Changes

  • Added terser dependency and format:terser script to pkg/workflow/js/package.json
  • Updated format:cjs pipeline: prettier → terser → prettier
  • Terser configuration: -c dead_code=true,unused=true,collapse_vars=true --ecma 2022 --comments all

Exclusions

Files skipped from terser processing to preserve functionality:

  • TypeScript-checked files (// @ts-check, /// <reference)
  • Files with top-level await or dynamic await import

Impact

  • 14,784 lines removed across 65 files (49% reduction)
  • TypeScript type checking preserved
  • All 2,218 tests passing

Example

Before:

function estimateTokens(text) {
  if (!text) {
    return 0;
  }
  return Math.ceil(text.length / 4);
}

After terser + prettier:

function estimateTokens(text) {
  return text ? Math.ceil(text.length / 4) : 0;
}
Original prompt

Add a second pass for formatting of JavaScript that runs terser on the .cjs files after prettier. Configure terser as follows:

terser ....cjs -c dead_code=true,unused=true,collapse_vars=true -m false -b beautify=false


💡 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.


Changeset

  • Type: patch
  • Description: Add terser minification as a second pass to format .cjs files after prettier; adds terser dependency and updates format:cjs pipeline. Files with TypeScript checks or top-level/dynamic await are excluded from terser processing to preserve behavior.

Ahoy! This treasure was crafted by 🏴‍☠️ Changeset Generator

Copilot AI and others added 3 commits December 18, 2025 06:57
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [WIP] Add second pass for JavaScript formatting with Terser Add terser second pass for JavaScript formatting Dec 18, 2025
Copilot AI requested a review from pelikhan December 18, 2025 07:44
@pelikhan pelikhan added the smoke label Dec 18, 2025
@github-actions
Copy link
Contributor

💥 WHOOSH! Smoke Claude springs into action on this pull request! [Panel 1 begins...]

@github-actions
Copy link
Contributor

🤖 SYSTEM_INIT: Smoke Copilot No Firewall ACTIVATED. PROCESSING pull request. ALL SUBSYSTEMS ONLINE.

@github-actions
Copy link
Contributor

github-actions bot commented Dec 18, 2025

🎉 Yo ho ho! Changeset Generator found the treasure and completed successfully! ⚓💰

03ffcc1

@github-actions
Copy link
Contributor

📰 BREAKING: Smoke Copilot is now investigating this pull request. Sources say the story is developing...

@github-actions
Copy link
Contributor

🔮 The ancient spirits stir... Smoke Codex awakens to divine this pull request...

@github-actions
Copy link
Contributor

⚓ Avast! Smoke Copilot Safe Inputs be settin' sail on this pull request! 🏴‍☠️

@github-actions
Copy link
Contributor

Smoke Test Results

Last 2 Merged PRs:

Test Results:

  • ✅ GitHub MCP - Fetched PRs successfully
  • ✅ File Writing - Created /tmp/gh-aw/agent/smoke-test-copilot-20334667343.txt
  • ✅ Bash Tool - Verified file creation
  • ✅ GitHub MCP Default Toolset - Confirmed get_me NOT available (expected 403)
  • ✅ Cache Memory - Created /tmp/gh-aw/cache-memory/smoke-test-20334667343.txt

Available Tools: bash, grep, glob, view, create, edit, report_intent, github-* (list_pull_requests, get_file_contents, list_issues, etc.), safeoutputs-* (add_comment, add_labels, create_issue)

Overall Status: PASS

PR Author: @Copilot | Assignees: @mnkiefer, @Copilot

📰 BREAKING: Report filed by Smoke Copilot fer issue #6815 🗺️

@github-actions
Copy link
Contributor

Smoke Test Results: Copilot Engine (No Firewall)

Last 2 Merged PRs:

Test Results:

  • ✅ GitHub MCP: Successfully queried PRs
  • ✅ File Writing: Created /tmp/gh-aw/agent/smoke-test-copilot-20334667358.txt
  • ✅ Bash Tool: Verified file creation
  • ✅ Playwright MCP: Navigated to https://github.com, page title contains "GitHub"
  • ✅ safeinputs-gh: Listed 3 issues successfully

Status: PASS - All tests completed successfully.

🤖 DIAGNOSTIC REPORT GENERATED BY Smoke Copilot No Firewall fer issue #6815 🗺️

@github-actions
Copy link
Contributor

Smoke Test Results (Run 20334667350)

Last 2 Merged PRs:

Test Results:

  • ✅ GitHub MCP: Listed recent PRs
  • ✅ File Writing: Created agent test file
  • ✅ Bash Tool: Verified file creation
  • ✅ Playwright MCP: Navigated to GitHub, title verified
  • ✅ Cache Memory: Created and verified cache file

Overall Status: PASS

💥 [THE END] — Illustrated by Smoke Claude fer issue #6815 🗺️

@github-actions
Copy link
Contributor

Copilot Engine Smoke Test Results

Last 2 Merged PRs:

Test Results:

  • ✅ GitHub MCP: Retrieved PRs successfully
  • ✅ File Writing: Created test file with timestamp
  • ✅ Bash Tool: Verified file creation
  • ❌ Serena MCP: No classes found (project may use different structure)
  • ✅ Safe Input gh: Retrieved 3 issues successfully

Overall Status: PASS (4/5 tests passed - Serena result expected for Go project)

Ahoy! This treasure was crafted by 🏴‍☠️ Smoke Copilot Safe Inputs fer issue #6815 🗺️

@github-actions
Copy link
Contributor

Smoke test results:

  • Last merged PRs: Refactor logs.go: split 1,354-line file into 5 focused modules; Campaign orchestrator: Add explicit instructions for discovering worker-created issues
  • File write /tmp/gh-aw/agent/smoke-test-codex-20334667333.txt ✅
  • Cache write /tmp/gh-aw/cache-memory/smoke-test-20334667333.txt ✅
  • Playwright title check (github.com) ✅
  • gh issues list --limit 3 via safeinputs-gh ❌ (gh CLI not authenticated here)
  • Overall: FAIL

🔮 The oracle has spoken through Smoke Codex fer issue #6815 🗺️

@pelikhan pelikhan marked this pull request as ready for review December 18, 2025 11:02
@pelikhan pelikhan merged commit 7bbfa99 into main Dec 18, 2025
6 checks passed
@pelikhan pelikhan deleted the copilot/add-terser-configuration branch December 18, 2025 11:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants