Thank you for your interest in contributing to this project! This guide will help you get started.
- Node.js 18 or higher
- npm or yarn
- Access to a Salesforce Marketing Cloud account (for testing)
- Fork the repository
- Clone your fork:
git clone https://github.com/YOUR_USERNAME/sfmc-de-toolkit.git cd sfmc-de-toolkit - Install dependencies:
npm install
- Copy the environment template:
cp .env.example .env
- Configure your SFMC credentials in
.env
Use descriptive branch names:
feature/add-new-command- New featuresfix/dependency-detection- Bug fixesdocs/update-readme- Documentation updatesrefactor/improve-caching- Code refactoring
-
Create a new branch from
main:git checkout -b feature/your-feature-name
-
Make your changes following the coding standards below
-
Test your changes:
# Run with dry-run mode first node src/scripts/your-script.js --dry-run -
Commit your changes with a clear message:
git commit -m "Add feature: description of what was added" -
Push to your fork:
git push origin feature/your-feature-name
-
Open a Pull Request
- Use ES modules (
import/export) - Use
constby default,letwhen reassignment is needed - Use async/await for asynchronous operations
- Add JSDoc comments for public functions
src/
lib/ # Shared libraries and utilities
scripts/ # CLI scripts
- Always handle errors gracefully
- Provide meaningful error messages
- Use the logger for debug information
- Never expose sensitive data in logs
/**
* Brief description of what the function does
* @param {string} param1 - Description of param1
* @param {object} logger - Logger instance
* @returns {Promise<object>} Description of return value
*/
export async function exampleFunction(param1, logger = null) {
try {
// Implementation
return result;
} catch (error) {
if (logger) {
logger.error(`Failed to do thing: ${error.message}`);
}
throw error;
}
}Before submitting a PR, test your changes:
- Dry Run Mode: Always test with
--dry-runfirst - Non-Production: Test against a non-production SFMC account when possible
- Edge Cases: Test with empty results, large datasets, and error conditions
- Changes work as expected
- No breaking changes to existing functionality
- Error messages are clear and helpful
- Dry-run mode accurately reflects what would happen
- Ensure your code follows the coding standards
- Test your changes thoroughly
- Update documentation if needed
- Keep PRs focused on a single change
Include:
- What the change does
- Why the change is needed
- How to test the change
- Any breaking changes or migration steps
- A maintainer will review your PR
- Address any feedback or requested changes
- Once approved, a maintainer will merge the PR
When reporting bugs, include:
- Steps to reproduce
- Expected behavior
- Actual behavior
- SFMC account type (if relevant)
- Node.js version
- Any error messages or logs
When requesting features, include:
- Use case description
- Proposed solution (if any)
- Alternative solutions considered
If you have questions about contributing:
- Open a Discussion on GitHub
- Check existing issues for similar questions
- Review the README for usage information
By contributing, you agree that your contributions will be licensed under the same license as the project.