Testing and Release Workflow
This page walks through deploying production releases, testing beta versions, managing version packages, and running tests for the `tinacms` packages. These instructions are primarily for maintainers and core contributors.
Testing the beta tag (main branch)
After your PR is approved and merged to main, you can install the latest changes as a beta version for testing.
Steps to Test the beta Version
-
Install the
betaVersion of a Package
Use the following command to install the latest beta version of a package:Example of installing a beta tagged package pnpm add @tinacms/graphql@betaNote
Changes published under thebetatag are not available on npm'slatesttag, so users will only get them by specifying@beta.
Testing beta in a New Project
- Create a New Project
Use thecreate-tina-appCLI to set up a new project. - Install the Beta Versions
Add the beta versions of thetinacmspackages to test changes currently in themainbranch.
Creating a Production Release
Once the PR workflow generates a "Version Packages" PR, follow these steps to publish updated versions:
- Merge "Version Packages" PR to
main
This PR consolidates version bumps and allows npm publishing.- The PR will update the
versionsof all changed packages in a single commit. - Merging this PR triggers the final publishing to npm under the
latesttag, making the new versions generally available.
- The PR will update the
Creating a Dev Release for Testing in a PR
If you want to test your changes while they are still in a PR, follow these steps to create a development release.
Steps to Create a Dev Release in a PR
-
Add a Changeset
- Ensure you’ve created a changeset that documents the changes in your PR.
-
Label the PR
- Add a label called
taggedto your PR to initiate the dev release process.
- Add a label called
-
Install the Package(s) for Testing
- After the changeset is created and the
taggedlabel is applied, you can install the package directly from your branch.
- After the changeset is created and the
-
Install with Branch Tag
- Use the following command to install the package(s), replacing
<your-branch-name-here>with the actual name of your branch:
pnpm install tinacms@<your-branch-name-here> - Use the following command to install the package(s), replacing
-
Update @tinacms/cli
- Make sure to also update the @tinacms/cli package during testing.
- Check the latest published version on npm, and install it using:
pnpm install @tinacms/cli@<version>
Heads up!
tinacms@branch-name) may not fetch the latest published version — especially if the release was re-tagged or updated. To ensure you're testing the most recent changes, it's more reliable to install using the full version number from the npm release. You can find the latest dev release version on npm's version tab. Testing Changes Locally
To test package changes locally (without involving the ContentAPI), follow these steps:
-
Set Up a Local Project
- Use the
create-tina-appCLI to create a new project:
pnpm create tina-app@latest- This will set up a project where you can test your changes.
- Use the
-
Modify
package.jsonto Use the Standard Dev Command- Open your project's
package.jsonfile. - Locate the
devscript, and modify it (or add a new command) to run your framework’s standard dev command instead oftinacms dev. For example, if using Next.js, change it to:
"scripts": { "dev": "next dev" }- This lets you run the project without invoking
tinacms devdirectly.
- Open your project's
-
Start Your Project
- Run the standard dev command for your project:
pnpm dev -
Link to Local
tinacmsPackages with the--rootPathFlag- In a separate terminal, go to the root of the
tinacmsproject directory and link your local packages to the new project. Use the following command, replacing{{ APPLICATION PROJECT PATH }}with the path to your project:
node tinacms/packages/@tinacms/cli/bin/tinacms dev --rootPath {{ APPLICATION PROJECT PATH }}Example:
node tinacms/packages/@tinacms/cli/bin/tinacms dev --rootPath ~/Developer/tina/my-tina-app - In a separate terminal, go to the root of the
-
Enable Watch Mode for Real-Time Updates
- In another terminal within the
tinacmsproject directory root, run:
pnpm watchAttention
This method works only in environments that use webpack. For environments that do not use webpack (e.g., SSR builds), this aliasing will not apply. - In another terminal within the
Running End-to-End (E2E) Tests
To perform E2E tests locally:
- Refer to the Playwright README
Detailed instructions for running Playwright tests are provided in theplaywright/tina-playwrightdirectory README.