Tinacms Developer Docs

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

  1. Install the beta Version 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@beta

    Note

    Changes published under the beta tag are not available on npm's latest tag, so users will only get them by specifying @beta.

Testing beta in a New Project

  1. Create a New Project
    Use the create-tina-app CLI to set up a new project.
  2. Install the Beta Versions
    Add the beta versions of the tinacms packages to test changes currently in the main branch.

Creating a Production Release

Once the PR workflow generates a "Version Packages" PR, follow these steps to publish updated versions:

  1. Merge "Version Packages" PR to main
    This PR consolidates version bumps and allows npm publishing.
    • The PR will update the versions of all changed packages in a single commit.
    • Merging this PR triggers the final publishing to npm under the latest tag, making the new versions generally available.

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

  1. Add a Changeset

    • Ensure you’ve created a changeset that documents the changes in your PR.
  2. Label the PR

    • Add a label called tagged to your PR to initiate the dev release process.
  3. Install the Package(s) for Testing

    • After the changeset is created and the tagged label is applied, you can install the package directly from your branch.
  4. 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>
  5. 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!

Installing via a branch tag (e.g., 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:

  1. Set Up a Local Project

    • Use the create-tina-app CLI to create a new project:
    pnpm create tina-app@latest
    • This will set up a project where you can test your changes.
  2. Modify package.json to Use the Standard Dev Command

    • Open your project's package.json file.
    • Locate the dev script, and modify it (or add a new command) to run your framework’s standard dev command instead of tinacms dev. For example, if using Next.js, change it to:
    "scripts": {
      "dev": "next dev"
    }
    • This lets you run the project without invoking tinacms dev directly.
  3. Start Your Project

    • Run the standard dev command for your project:
    pnpm dev
  4. Link to Local tinacms Packages with the --rootPath Flag

    • In a separate terminal, go to the root of the tinacms project 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
  5. Enable Watch Mode for Real-Time Updates

    • In another terminal within the tinacms project directory root, run:
    pnpm watch

    Attention

    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.

Running End-to-End (E2E) Tests

To perform E2E tests locally:

  1. Refer to the Playwright README
    Detailed instructions for running Playwright tests are provided in the playwright/tina-playwright directory README.

On this page