Repository navigation
Conversation
There was a problem hiding this comment.
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
jsbucket 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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
Acceptance criteria
Code quality
Housekeeping
CHANGELOG.mdentry under## Unreleased