-
Notifications
You must be signed in to change notification settings - Fork 13
Fix #82 #97
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix #82 #97
Conversation
WalkthroughThe pull request updates the package.json build configuration by adding rimraf as a devDependency, replacing shell-based cleanup ( Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes
Suggested reviewers
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 inconclusive)
✅ Passed checks (4 passed)
✨ Finishing touches🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (1)
🔇 Additional comments (3)
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🧹 Nitpick comments (1)
package.json (1)
60-61: Consider npm/yarn compatibility for broader install support.The
prepareandprepublishOnlyhooks callyarn build, which requires Yarn to be globally available. Users installing from Git URLs via npm (e.g.,npm install github:railsware/mailtrap-nodejs) may encounter failures if Yarn is not installed, even though your package specifies Yarn in engines.For maximum compatibility, consider using
npm run buildinstead, which works with both npm and Yarn:- "prepare": "yarn build", - "prepublishOnly": "yarn build", + "prepare": "npm run build", + "prepublishOnly": "npm run build",This ensures the build runs regardless of which package manager the user prefers.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (3)
package.json(1 hunks)src/types/mailtrap.ts(3 hunks)src/types/transport.ts(1 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
src/types/transport.ts (1)
src/types/mailtrap.ts (1)
TemplateVariables(36-36)
🔇 Additional comments (2)
src/types/mailtrap.ts (1)
29-36: Well-structured recursive type for flexible template variables.The recursive
TemplateValuetype correctly supports nested objects and arrays, allowing for complex template variable structures. The type definition terminates properly with primitive base cases.This change is backward-compatible—existing code using simple string/number/boolean values will continue to work, while new code can leverage nested structures.
src/types/transport.ts (1)
39-39: Type change verified and backward compatible.The change from
Record<string, string | number | boolean>toTemplateVariablesis correct.TemplateValueis recursively defined to support primitives, arrays, and nested objects—enabling nested template variables while maintaining backward compatibility with existing flat structures. All current usages (examples, tests, adapters) work without modification.
…raf as a devDependency
Motivation
Installing the package directly from a Git URL didn’t include the built
dist/output, breaking imports. We need the package to self-build on install (for Git installs) and to build only on publish for the npm registry. Also, we want a single source of truth for the build command to avoid drift.Fixes #82
Changes
buildscript:rm -rf dist && tsc --project tsconfig.build.jsonprepareto build on install (covers Git URL installs)prepublishwithprepublishOnlyto build only onnpm publishprepareandprepublishOnlyto thebuildscript (DRY)How to test
Install from GitHub URL and verify
dist/exists:-
rm -rf node_modules && npm i github:railsware/mailtrap-nodejs#fix-#84- Check
node_modules/mailtrap/distis present- Import it in a small script and run it (e.g.,
node -e "require('mailtrap')")Verify publish-time build path:
- Run
npm run prepublishOnlymanually and confirmdist/is built- Optionally
npm publish --dry-runand confirm build occurs without publishingSummary by CodeRabbit