Conversation
Signed-off-by: yaacov <kobi.zamir@gmail.com>
📝 WalkthroughWalkthroughThe PR migrates the project's build system from Gulp to npm scripts, removing Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~22 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
📝 Coding Plan
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. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
scripts/build-modbus-serial.js (1)
10-15: Build script creates incomplete mirrored tree —index.jsand root-level TypeScript definitions are missing.The README documents that
npm run buildshould create a "mirrored package tree" inmodbus-serial/, but the script currently copies only subdirectories (apis,ports,servers,utils) without the main entry pointindex.jsor TypeScript definition files. Ifmodbus-serial/is meant to be a complete mirror as documented, it should also include root-level files that define the public API.Note: The root
package.json(main package) usesindex.jsfrom the repository root, so the npm package itself is functional. However, the build output is incomplete relative to its documented purpose.Proposed fix to complete the mirrored tree
for (const name of ["apis", "ports", "servers", "utils"]) { const src = path.join(root, name); const dest = path.join(out, name); fs.rmSync(dest, { recursive: true, force: true }); fs.cpSync(src, dest, { recursive: true }); } + +// Copy entry point and type definitions +for (const file of ["index.js", "index.d.ts"]) { + const src = path.join(root, file); + if (fs.existsSync(src)) { + fs.copyFileSync(src, path.join(out, file)); + } +}🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@scripts/build-modbus-serial.js` around lines 10 - 15, The build loop that copies only the subfolders (the for loop using names, src, dest, fs.rmSync and fs.cpSync) misses root-level public files — copy the repository root index.js plus any root-level TypeScript declaration files (e.g., *.d.ts) into the output mirror (out/modbus-serial) so the mirrored package exposes the same public API; update the script after the existing loop to rmSync the output root file(s) and cpSync the source index.js and root-level .d.ts files (and any other top-level public files like package.json if the mirror should be complete) into the out directory.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@scripts/build-modbus-serial.js`:
- Around line 10-15: The build loop that copies only the subfolders (the for
loop using names, src, dest, fs.rmSync and fs.cpSync) misses root-level public
files — copy the repository root index.js plus any root-level TypeScript
declaration files (e.g., *.d.ts) into the output mirror (out/modbus-serial) so
the mirrored package exposes the same public API; update the script after the
existing loop to rmSync the output root file(s) and cpSync the source index.js
and root-level .d.ts files (and any other top-level public files like
package.json if the mirror should be complete) into the out directory.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: be2b7452-2b33-4928-88dd-74f8d01a3e71
⛔ Files ignored due to path filters (1)
package-lock.jsonis excluded by!**/package-lock.json
📒 Files selected for processing (9)
README.mdeslint.config.mjsgulpfile.jsjsdoc.jsonpackage.jsonports/tcpport.jsscripts/build-modbus-serial.jsscripts/clean.jsscripts/copy-doc-examples.js
💤 Files with no reviewable changes (1)
- gulpfile.js
Summary by CodeRabbit
clean,build,doc,docs,publish:prepare).