Skip to content

feat(detect-changes): count ES-module and TypeScript files in the js bucket - #80

Open
Adi-ty wants to merge 1 commit into
mainfrom
feat/detect-changes-js-extensions
Open

Adi-ty wants to merge 1 commit into
mainfrom
feat/detect-changes-js-extensions

Conversation

@Adi-ty

@Adi-ty Adi-ty commented Oct 5, 2026 •

Copy link
Copy Markdown
Collaborator

What this PR does

The js bucket in wp-tooling now also counts .cjs, .mjs, .jsx, .ts, .cts, .mts and .tsx files.

Closes

N/A

Changes

  • src/ci/detect-changes.js: the regex changes from /.(?:js|snap)$|…/ to /.(?:[cm]?[jt]s|[jt]sx|snap)$|…/, plus a one-line comment listing what the bucket covers. It matches exactly those extensions. tsconfig.json, other .json files and .jsonc stay out.
  • tests/ci/detect-changes.test.js: one new test. It checks that all the new extensions, .d.ts, eslint.config.mjs and a Jest snapshot are counted, and that tsconfig.json, data.json and a.jsonc are not.
  • CHANGELOG.md: a ### Changed entry under ## [Unreleased], as the repo's checklist requires.

How I verified

npm run check

Acceptance criteria

Code quality

  • Lint — zero errors
  • Static analysis — zero errors
  • Tests pass

Housekeeping

  • CHANGELOG.md entry under ## Unreleased

@Adi-ty
Adi-ty marked this pull request as ready for review October 5, 2026 17:19
Copilot AI balanced review requested due to automatic review settings October 5, 2026 17:19

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.

Copilot review overview

🟢 Approval recommended

The regex matches the stated extensions precisely, preserves existing behavior, and is adequately tested.

Review effort: Balanced
Findings: None

What changed in this PR

Expands JavaScript change detection to include ES-module and TypeScript file extensions.

Changes:

  • Extends the js bucket regex with .cjs, .mjs, JSX, and TypeScript variants.
  • Adds coverage for included and excluded extensions.
  • Documents the behavior in the changelog.
File Description
src/​ci/​detect-changes.js Expands JavaScript bucket matching.
tests/​ci/​detect-changes.test.js Tests new extensions and JSON exclusions.
CHANGELOG.md Records the expanded detection behavior.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

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