Thank you for your interest in contributing to Fynd Storefront Tag Templates! We welcome contributions from the community and are grateful for your support.
By participating in this project, you agree to abide by our Code of Conduct. Please be respectful and constructive in all interactions.
- Fork the repository
- Clone your fork:
git clone https://github.com/gofynd/fynd-storefront-tag-template.git cd fynd-storefront-tag-template - Install dependencies:
npm install
- Create a new branch:
git checkout -b feature/your-feature-name
# Development build
npm run build:dev
# Production build
npm run build
# Watch mode
npm run watch- We use ESLint for code linting
- Run
npm run lintto check your code - Run
npm run formatto auto-format your code
src/
├── index.js # Main entry point
└── template.js # Template definitions
To add a new template:
- Open
src/template.js - Add your template to the
templatesobject:
const templates = {
// ... existing templates
yourTemplate: createTemplate({
name: 'Your Template Name',
path: 'your-template-path',
description: 'What your template does',
template_id: 'unique-id',
template_version: '1.0.0',
fields: [
{
name: 'fieldName',
type: 'text',
label: 'Field Label',
required: true
}
],
script: `
// Your template script
console.log('{{fieldName}}');
`
})
};- Export your template in
src/index.js:
module.exports.yourTemplate = templates.yourTemplate;- Unique IDs: Ensure
template_idis unique - Validation: Add proper validation for fields
- Documentation: Include clear descriptions
- Testing: Test your template thoroughly
- Security: Avoid exposing sensitive data
Currently, the project uses basic testing. When adding new features:
- Ensure existing templates still work
- Test your template with various inputs
- Verify the generated script works correctly
We follow conventional commits:
feat:New featurefix:Bug fixdocs:Documentation changesstyle:Code style changes (formatting, etc.)refactor:Code refactoringtest:Adding or updating testschore:Maintenance tasks
Examples:
git commit -m "feat: add Facebook Pixel template"
git commit -m "fix: correct GTM validation pattern"
git commit -m "docs: update installation instructions"- Update the README.md if needed
- Update the examples if you've added new features
- Ensure all commits follow our guidelines
- Submit a pull request with:
- Clear title and description
- Reference any related issues
- Screenshots if applicable
feat:for new featuresfix:for bug fixesdocs:for documentation
## Description
Brief description of changes
## Type of Change
- [ ] Bug fix
- [ ] New feature
- [ ] Documentation update
## Testing
- [ ] Tested locally
- [ ] All existing templates work
- [ ] New template works correctly
## Checklist
- [ ] Code follows style guidelines
- [ ] Self-reviewed code
- [ ] Updated documentationInclude:
- Template name and version
- Steps to reproduce
- Expected vs actual behavior
- Error messages
- Environment details
Include:
- Use case description
- Proposed solution
- Alternative solutions considered
Contributors will be recognized in:
- Release notes
- Contributors list
- Project documentation
Thank you for contributing to Fynd Storefront Tag Templates!