@twiceme-technology/api-types
v2.9.1
Published
Shared API types and schemas for Twiceme-API
Downloads
1,991
Readme
API Types Package Management Guide
📚 Table of Contents
🛠 Local Development
When developing locally and testing changes to this package in a consuming project, follow these steps:
1. Link the Package Locally
In the consuming project's package.json
, change the package version to the local file path. For example:
{
"dependencies": {
"@twiceme-technology/api-types": "file:../api-types"
}
}
2. Apply Changes
To apply changes made in the package to your consuming project:
Build the package:
cd ../api-types yarn build
Reinstall the package in your project:
cd ../twiceme-api yarn install --force
The --force
flag ensures that the package is reinstalled from the local directory, applying any changes you've made.
🚀 Publishing a New Version
Follow these steps each time you want to publish a new version of the package.
1. Prepare for Release
⚠️ IMPORTANT: All changes must be on the main branch before release!
- Ensure all desired changes for this release are merged into the main branch
- Pull the latest changes from the main branch to your local repository:
git checkout main
git pull origin main
2. Update Version in package.json
a. Create a Feature Branch
- Create and switch to a new branch for your changes
b. Update Version in package.json
field following semantic versioning:
- Patch version for bug fixes (e.g., 1.0.1 to 1.0.2)
- Minor version for new features (e.g., 1.0.0 to 1.1.0)
- Major version for breaking changes (e.g., 1.0.0 to 2.0.0)
💡 Tip: Use yarn version
to automatically update the version:
yarn version --patch
yarn version --minor
yarn version --major
3. Create and Merge your Pull Request
- Push your branch and create a PR to merge into main
- Get necessary approvals and merge the PR
4. Create a GitHub Release
- Go to your repository on GitHub → Releases
- Click "Create a new release"
- Choose a tag version matching your
package.json
version (e.g., v1.0.1) - Ensure the target branch is set to
main
- Set a release title and description
- Click "Publish release"
The GitHub Action will automatically publish your package with the new version using the code from the main branch.
📦 Using the Package
To use the published package in other projects:
Install the package:
yarn add @twiceme-technology/api-types
Update the version of the package in
package.json
to use the latest release in other projects.
🔍 Troubleshooting
- Publish Failed? Check the Actions tab in GitHub for error logs
- Version Conflict? Make sure your
package.json
version and GitHub release tag match - Wrong Code Published? Ensure all changes were merged to main before creating the release