Skip to content

Document ESM and CommonJS build check - #4361

Merged
adamziel merged 1 commit into
trunkfrom
add-esmcjs-test-doc
Sep 29, 2026
Merged

adamziel merged 1 commit into
trunkfrom
add-esmcjs-test-doc

Conversation

@fellyph

@fellyph fellyph commented Sep 25, 2026 •

Copy link
Copy Markdown
Collaborator

Motivation for the change, related issues

Document the test:esmcjs target for contributors maintaining packages that publish both ESM and CommonJS builds.

Closes #506.

Implementation details

  • Explain what assert-built-esm-and-cjs checks and the limits of that check.
  • Show the required outputPath, the build dependency, a project.json example, and the command to run the target.
  • Replace generated README boilerplate and correct the unit test runner from Jest to Vitest.

Testing Instructions (or ideally a Blueprint)

Documentation only. Reviewed the example against the current executor and Playground Client target; git diff --check passed.

Summary by CodeRabbit

  • Documentation
    • Updated package documentation with build and unit-test commands.
    • Added instructions for configuring and running a check that verifies the built package can be loaded as both ESM and CommonJS, and clarified what the check covers.

@github-actions github-actions Bot added the [Type] Documentation Improvements or additions to documentation label Sep 25, 2026
@coderabbitai

coderabbitai Bot commented Sep 25, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: 48155edd-54e2-4cf1-9596-72ff2ad1a7dd

📥 Commits

Reviewing files that changed from the base of the PR and between 1e5f73b and 832aa79.

📒 Files selected for processing (1)
  • packages/nx-extensions/README.md

Included review availability: Your plan provides up to 4 included reviews per hour; 3 remain after this review.


📝 Walkthrough

Walkthrough

The nx-extensions README now describes the private package, updates its build and test commands, and explains how to configure and run test:esmcjs to check ESM and CommonJS loading.

Changes

nx-extensions documentation

Layer / File(s) Summary
Package commands and executor usage
packages/nx-extensions/README.md
The README identifies nx-extensions as a private package and updates the build and test commands. It documents the test:esmcjs target configuration, its ESM import and CommonJS require checks, and what those checks cover.

Priority: ⬇️ Low

Estimated code review effort: 1 (Trivial) | ~4 minutes

Change: Other

Merge Risk: ⚪ Minimal · up to 832aa

The README accurately describes the available build, Vitest, and ESM/CJS-check commands. No actionable merge risk remains.

Architecture Summary

Architecture risk: 🔵 Low · up to 832aa

The change affects 1 system.

Changed systems: packages/nx-extensions

Architecture concerns
No architecture-level concerns identified.

Review details

Systems and components

  • observed — packages/nx-extensions (library) was modified; 1 changed file maps to changed impact.

Before / after behavior

  • observed — Modified behavior in packages/nx-extensions/README.md: The README replaces the generated-library description and old Nx commands with a description of the private package and npm exec nx build and Vitest test commands.
  • observed — Modified behavior in packages/nx-extensions/README.md: The README adds instructions for configuring and running test:esmcjs, including its ESM import and CommonJS require checks, failure condition, and the scope of what it verifies.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: documenting the ESM and CommonJS build check.
Linked Issues check ✅ Passed Issue #506 requires documentation for the custom test:esmcjs executor. The README documents the assert-built-esm-and-cjs executor, its ESM import and CommonJS require checks, its limits, the r…
Out of Scope Changes check ✅ Passed The pull request changes only packages/nx-extensions/README.md. The package description, Nx command updates, and Vitest command update maintain the same README while documenting the executor context…
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0…
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@adamziel

Copy link
Copy Markdown
Collaborator

Lovely, thank you @fellyph !

@adamziel
adamziel merged commit f902677 into trunk Sep 29, 2026
58 checks passed
@adamziel
adamziel deleted the add-esmcjs-test-doc branch September 29, 2026 11:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Type] Documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Doc: Document the test:esmcjs executor

2 participants