Skip to content

Development and Release

Aswin V edited this page Feb 12, 2024 · 6 revisions

Getting Started

Prerequisites

  • Node.js
  • Verdaccio (local npm registry) - npm install --global verdaccio. On initial run you will need to create a registry user as shown below:
     # Creates a new user for local registry and saves the credentials to ~/.npmrc file.
     npm adduser --registry http://localhost:4873 

Development

1. Setup for local building and testing

  • Clone the repository:

     git clone https://github.com/boxyhq/ui.git
  • Make the required changes in src/ folder.

  • Before building, ensure that verdaccio is running locally: simply run verdaccio from the command line.

  • Run the below shell script to build and publish (to the local verdaccio registry) the react package.

    Before running make sure the VERSION in the script and that in the react/package.json are set to the same value (you can use the next version after the main version here). This is only for local. Don't push the version changes to the PR branch. Also don't forget to tweak the script based on your local folder structure.

    #!/bin/zsh -ex
    VERSION=3.3.24
    # Unpublish the current one
    npm unpublish --registry http://localhost:4873/ @boxyhq/react-ui@$VERSION
    # Run mitosis build and the react package build
    cd ~/Code/ui
    npm run cleanup:mitosis-out && npm run build
    cd ./react && rm -rf ./dist ./node_modules && npm i
    # Publish to verdaccio
    npm publish --registry http://localhost:4873/
    # Use the published package inside saas-app
    cd ~/Code/saas-app && npm uninstall @boxyhq/react-ui && npm i --save-exact --registry http://localhost:4873/ @boxyhq/react-ui@$VERSION
    rm -rf .next
    # Use the published package inside saas-starter-kit
    cd ~/Code/saas-starter-kit && npm uninstall @boxyhq/react-ui && npm i --save-exact --registry http://localhost:4873/ @boxyhq/react-ui@$VERSION
    rm -rf .next

2. Making a new release.

  • After local testing and making sure all changes are done, merge the PR into main branch.
  • Bump up the version in the main branch.
  • Merge main into release
  • Make a new release under https://github.com/boxyhq/ui/releases