Data Viz Wordpress Release Guide
Repository: https://github.com/devgateway/data-viz-wordpress
- Data Viz Wordpress contains several libraries that are used to build custom Wordpress blocks and also utilities to develop wordpress.
- It is also used to build the Data Viz Wordpress image.
- The release process uses a tool called changeset to manage the release process. Changesets is a tool that helps to manage the release process by creating a changelog and a version number in monorepos.
Packages in the repository​
- @devgateway/dvz-wp-commons - Common utilities for Data Visualization in WordPress that can also be used in other projects.
- @devgateway/create-wp-customizer - A tool to quickly scaffold a Wordpress customizer project.
- @devgateway/upgrade-wp-customizer - A tool to upgrade a Wordpress customizer project to use Data Viz 3.0.
Release Process​
- The release process is triggered by a push to the main branch.
- To create a release, one needs to create a changeset file by running the following command:
- npm
- pnpm
- Yarn
- Bun
npx changeset add
pnpm dlx changeset add
yarn dlx changeset add
bun x changeset add
- This will open a prompt to select the packages that are being released and the summary of the changes.
- Once the changes are entered, the changeset
.mdfile is created. This file is editable and can be edited to add more details to the release. - Once pushed, one opens a pull request to the main branch and waits for it to be merged.
- Changesets Github action checks if there is a changeset file and if there is, it opens a pull request with the updated version number and changelog for the affected packages.
- Once the pull request is merged, the changesets Github action will create a release and push it to the NPM registry.
Visual Representation​
Best Practices​
Writing Good Changesets​
Good Examples​
---
"@devgateway/dvz-ui-react": minor
---
Add horizontal bar chart component
- New HorizontalBarChart component with full customization
- Supports all existing bar chart features in horizontal orientation
- Includes TypeScript definitions and documentation
- Fixes accessibility issues with chart legends
---
"@devgateway/wp-react-lib": patch
---
Fix WordPress API authentication headers
Resolves issue where authentication tokens were not properly passed to WordPress REST API calls, causing 401 errors in production environments.
Avoid​
---
"@devgateway/dvz-ui-react": minor
---
Updates
Changeset Guidelines​
- Be descriptive: Explain what changed and why
- Include context: Help users understand the impact
- Reference issues: Link to GitHub issues when relevant
- Use proper grammar: Changesets become part of the changelog
- Group related changes: One changeset per logical change
Versioning Strategy​
- Patch: Bug fixes, documentation, internal refactoring
- Minor: New features, new components, enhanced functionality
- Major: Breaking API changes, removed features, major restructuring
Troubleshooting​
Common Issues​
Changeset Not Generated​
# Make sure you're in the root directory
cd /path/to/data-viz-ui
# Check changeset status
npx changeset status
# Add changeset manually
npx changeset add
Version Conflicts​
# Reset to clean state
git checkout main
git pull origin main
# Re-run versioning
pnpm version
Publishing Failures​
# Check npm authentication
npm whoami
# Verify package builds
pnpm build
# Check for existing versions
npm view @devgateway/dvz-ui-react versions --json
Pre-release Issues​
# Check pre-release mode
npx changeset pre --help
# Exit pre-release mode if stuck
npx changeset pre exit
Debugging Commands​
# Check current changeset status
npx changeset status
# Preview what versions would be bumped
npx changeset version --dry-run
# See changeset configuration
cat .changeset/config.json
# Check package dependency graph
npx changeset status --verbose
Integration with Development Workflow​
During Development​
- Create feature branch
- Develop feature
- Add changeset before committing
- Include changeset in commit
- Create pull request
Code Review​
Reviewers should check:
- Changeset matches the scope of changes
- Version bump type is appropriate
- Description is clear and helpful
- Internal dependencies are considered
Release Process​
- Merge approved PRs with changesets
- Run version command (creates version PR)
- Review and merge version PR
- Publish packages (manual or automated)
- Verify publication on npm and GitHub