{"data":{"prismicDocsCategory":{"data":{"pages":[{"page":{"uid":"merge-start","document":[{"data":{"title":{"text":"Start"},"visible_in_table_of_content":"true"}}]}},{"page":{"uid":"merge-connect-your-library","document":[{"data":{"title":{"text":"Connect your library"},"visible_in_table_of_content":"true"}}]}},{"page":{"uid":"for-developers","document":[{"data":{"title":{"text":"For Developers"},"visible_in_table_of_content":"true"}}]}},{"page":{"uid":"merge-use-in-the-editor","document":[{"data":{"title":{"text":"Use in the Editor"},"visible_in_table_of_content":"true"}}]}},{"page":{"uid":"merge-publish-and-maintain","document":[{"data":{"title":{"text":"Publish and maintain"},"visible_in_table_of_content":"true"}}]}},{"page":{"uid":"merge-faq","document":[{"data":{"title":{"text":"Frequently Asked Questions"},"visible_in_table_of_content":"true"}}]}}]}},"prismicDocsPage":{"data":{"title":{"text":"Publish and maintain"},"isVisibleForRobots":"true","body":[{"__typename":"PrismicDocsPageBodyContent","slice_type":"content","primary":{"content_title":{"text":"CLI Tool"},"content":{"html":"<p>The UXPin Merge CLI analyzes your component repository, prepares your code for UXPin, lets you test components locally in experimental mode, and pushes them to your UXPin account.</p>"}}},{"__typename":"PrismicDocsPageBodyContent","slice_type":"content","primary":{"content_title":{"text":null},"content":{"html":"<h3>Install</h3><p>The CLI requires Node.js 16 or later, and webpack 4 or 5 with webpack-cli 4 or 5 in your project.</p>"}}},{"__typename":"PrismicDocsPageBodyCode","slice_type":"code","primary":{"code":{"raw":[{"text":"npm install @uxpin/merge-cli --save-dev"}]},"language":"JavaScript"}},{"__typename":"PrismicDocsPageBodyContent","slice_type":"content","primary":{"content_title":{"text":null},"content":{"html":"<p>or</p>"}}},{"__typename":"PrismicDocsPageBodyCode","slice_type":"code","primary":{"code":{"raw":[{"text":"yarn add @uxpin/merge-cli --dev"}]},"language":"JavaScript"}},{"__typename":"PrismicDocsPageBodyContent","slice_type":"content","primary":{"content_title":{"text":null},"content":{"html":"<h3>Quick start</h3><ol><li>npx uxpin-merge init: creates the default config files</li><li>npx uxpin-merge: starts experimental mode so you can test components</li><li>npx uxpin-merge summary: shows what the CLI found without building it</li><li>npx uxpin-merge push --token &lt;token&gt;: uploads your library to UXPin</li></ol>"}}},{"__typename":"PrismicDocsPageBodyContent","slice_type":"content","primary":{"content_title":{"text":null},"content":{"html":"<h3>Commands</h3><ul><li><strong>uxpin-merge (no command)</strong>: Starts experimental mode for the project in the current directory. This is the default command.</li><li><strong>init</strong>: Creates default config files: uxpin.config.js, uxpin.webpack.config.js and UXPinWrapper, plus an example Button component.</li><li><strong>generate-presets</strong>: Generates presets for components.</li><li><strong>push</strong>: Uploads the design system repository information to UXPin.</li><li><strong>delete-version</strong>: Deletes the selected tag or branch in the Merge library.</li><li><strong>dump</strong>: Shows all information about the design system repository in JSON and does not send it to UXPin.</li><li><strong>server</strong>: Starts a local web server and displays the list of design system components.</li><li><strong>summary</strong>: Shows only the design system summary, without building it.</li></ul>"}}},{"__typename":"PrismicDocsPageBodyContent","slice_type":"content","primary":{"content_title":{"text":null},"content":{"html":"<h3>Options</h3><h4>Global options</h4><ul><li><strong>-v, --version</strong>: Outputs the version number.</li><li><strong>-h, --help</strong>: Outputs usage information.</li><li><strong>--webpack-config &lt;path&gt;</strong>: Path to a custom webpack config, relative to the current working directory.</li><li><strong>--wrapper &lt;path&gt;</strong>: Path to a custom component wrapper, relative to the current working directory.</li><li><strong>--cwd &lt;path&gt;</strong>: Working directory: path to the root of the design system repository. Default: ./</li><li><strong>--config &lt;path&gt;</strong>: Path to a config file. Default: ./uxpin.config.js</li><li><strong>--port &lt;number&gt;</strong>: Port on which the local server listens. Default: 8877</li><li><strong>--skip-browser</strong>: Doesn’t open the browser on start.</li></ul><h4>Options for push</h4><ul><li><strong>--webpack-config &lt;path&gt;, --wrapper &lt;path&gt;, --cwd &lt;path&gt;, --config &lt;path&gt;</strong>: The same as the global options.</li><li><strong>--token &lt;token&gt;</strong>: Auth token for the library. Default: the UXPIN_AUTH_TOKEN environment variable.</li><li><strong>--branch &lt;branch&gt;</strong>: Branch to use when uploading. Default: master.</li><li><strong>--tag &lt;tag&gt;</strong>: Tags this push with a name or number. The name or number is unique and can be used only once.</li><li><strong>--force</strong>: Ignores the last commit saved in UXPin and pushes the library without checking history. It could break old prototypes if components were created before 07.2021.</li></ul><h4>Options for other commands</h4><ul><li><strong>delete-version</strong>: --token &lt;token&gt; (auth token for the library to delete from), --branch &lt;branch&gt; (branch to delete), --tag &lt;tag&gt; (tag to delete)</li><li><strong>generate-presets</strong>: --cwd &lt;path&gt;, --config &lt;path&gt;, --component-path &lt;path&gt; (path to a component, relative to the current working directory)</li><li><strong>server</strong>: --port &lt;number&gt; (default 8080), --webpack-config &lt;path&gt;, --wrapper &lt;path&gt;, --cwd &lt;path&gt;</li><li><strong>init, dump</strong>: --cwd &lt;path&gt;, --config &lt;path&gt;</li><li><strong>summary</strong>: --cwd &lt;path&gt;, --config &lt;path&gt;</li></ul>"}}},{"__typename":"PrismicDocsPageBodyContent","slice_type":"content","primary":{"content_title":{"text":null},"content":{"html":"<h3>Environment</h3><ul><li><strong>UXPIN_AUTH_TOKEN</strong>: default value for --token in push and delete-version.</li><li><strong>DEBUG=uxpin*</strong>: prints verbose output, which helps when troubleshooting or investigating performance. Example: DEBUG=uxpin* npx uxpin-merge push --token &lt;token&gt;</li></ul>"}}},{"__typename":"PrismicDocsPageBodyContent","slice_type":"content","primary":{"content_title":{"text":"Connecting code to UXPin (CI & push)"},"content":{"html":"<p>To bring your React components into UXPin, you push them with the Merge CLI. The recommended way is to push automatically from a continuous integration (CI) server, such as <a  href=\"https://circleci.com/\">CircleCI</a> or <a  href=\"https://github.com/features/actions\">GitHub Actions</a> (any CI server that can run Node.js works), so the library in UXPin always matches your code. You can also push once by hand.</p>"}}},{"__typename":"PrismicDocsPageBodyContent","slice_type":"content","primary":{"content_title":{"text":null},"content":{"html":"<h3>Before you start</h3><p>Create a library in UXPin and copy its authentication token:</p><ol><li>Go to your UXPin account and open the UXPin Editor.</li><li>Click the library name in the bottom left corner, then click New library.</li><li>Select the option “Import React or Web Components from Git repo”.</li><li>Name the library and click Create library.</li><li>Copy the authentication token. Don’t share it with anyone, and don’t place it in any file checked into your Git repository. This token gives direct access to the library on your account.</li></ol>"}}},{"__typename":"PrismicDocsPageBodyVideo","slice_type":"video","primary":{"video_link":{"url":"https://uxpincommunity.cdn.prismic.io/uxpincommunity/bbf00279-79fe-495c-8ad4-993ed73668d9_Connecting+code+to+UXPin+CI+push.mp4"},"video_description":{"text":null}}},{"__typename":"PrismicDocsPageBodyContent","slice_type":"content","primary":{"content_title":{"text":null},"content":{"html":"<h3>Set up your CI server</h3><p>Once you have the token, go to your CI app and start a project that tracks your design system repository, if you haven’t yet. Then:</p><ol><li>Add an environment variable UXPIN_AUTH_TOKEN with the value set to your token.</li><li>In your CI config, add a step that runs:</li></ol>"}}},{"__typename":"PrismicDocsPageBodyCode","slice_type":"code","primary":{"code":{"raw":[{"text":"npx uxpin-merge push"}]},"language":"JavaScript"}},{"__typename":"PrismicDocsPageBodyContent","slice_type":"content","primary":{"content_title":{"text":null},"content":{"html":"<p>Two things to check in your CI setup:</p><ul><li>Node.js 16 or later, because the Merge CLI requires it.</li><li>The full Git history. Merge compares commits when it pushes, so make sure your CI checks out the whole history, not just the last commit.</li></ul><p>For more options, such as tagging a push with --tag, see <a target=\"_blank\" rel=\"noopener\" href=\"https://www.uxpin.com/docs/merge/merge-publish-and-maintain/#cli-tool\">CLI Tool</a> and <a target=\"_blank\" rel=\"noopener\" href=\"https://www.uxpin.com/docs/merge/merge-publish-and-maintain/#version-control\">Merge library version control</a>.</p>"}}},{"__typename":"PrismicDocsPageBodyContent","slice_type":"content","primary":{"content_title":{"text":null},"content":{"html":"<h3>CircleCI</h3><ol><li>Create a CircleCI config file: ./.circleci/config.yml.</li><li>Copy this YAML into it:</li></ol>"}}},{"__typename":"PrismicDocsPageBodyCode","slice_type":"code","primary":{"code":{"raw":[{"text":"version: 2.1\n\njobs:\n  build:\n    docker:\n      - image: cimg/node:18.20\n    working_directory: ~/project/\n    steps:\n      - checkout\n      - run:\n          name: Install dependencies\n          command: npm install\n      - run:\n          name: Push to UXPin\n          command: npx uxpin-merge push\n\nworkflows:\n  push-to-uxpin:\n    jobs:\n      - build"}]},"language":"JavaScript"}},{"__typename":"PrismicDocsPageBodyContent","slice_type":"content","primary":{"content_title":{"text":null},"content":{"html":"<p>3. Open CircleCI and add a new project.</p><p>4. Search for your GitHub repository and click Set Up Project. If the project already has a config file, click “Use Existing Config”.</p><p>5. Click Start Building. The first sync will start and fail, because the token isn’t set yet.</p><p>6. Go to Project Settings &gt; Environment Variables.</p><p>7. Add a new environment variable: name UXPIN_AUTH_TOKEN, value: the token you copied from UXPin.</p><p>8. Rerun the integration.</p>"}}},{"__typename":"PrismicDocsPageBodyContent","slice_type":"content","primary":{"content_title":{"text":null},"content":{"html":"<h3>GitHub Actions</h3><ol><li>Create a GitHub Actions workflow file: ./.github/workflows/uxpin-merge.yml.</li><li>Copy this YAML into it:</li></ol>"}}},{"__typename":"PrismicDocsPageBodyCode","slice_type":"code","primary":{"code":{"raw":[{"text":"name: Deploy-uxpin\n\non: push\n\njobs:\n  deploy-uxpin:\n    name: UXPin update\n    runs-on: ubuntu-latest\n    if: \"github.ref == 'refs/heads/master' && !contains(github.event.head_commit.message, 'skip ci')\"\n    steps:\n      - uses: actions/checkout@v4\n        with:\n          ref: refs/heads/master\n          fetch-depth: 0\n      - name: Use Node.js\n        uses: actions/setup-node@v4\n        with:\n          node-version: '20.x'\n      - name: Install\n        run: yarn\n      - name: Push to UXPin\n        run: yarn push\n        env:\n          UXPIN_AUTH_TOKEN: ${{ secrets.UXPIN_AUTH_TOKEN }}"}]},"language":"JavaScript"}},{"__typename":"PrismicDocsPageBodyContent","slice_type":"content","primary":{"content_title":{"text":null},"content":{"html":"<p>3. Make sure the scripts section of package.json has &quot;push&quot;: &quot;uxpin-merge push&quot;.</p><p>4. In GitHub, open your repository, click the Settings tab, then Secrets.</p><p>5. Add a new repository secret: name UXPIN_AUTH_TOKEN, value: the token you copied from UXPin.</p><p>6. Push a change to master. This starts the GitHub Actions sync.</p>"}}},{"__typename":"PrismicDocsPageBodyContent","slice_type":"content","primary":{"content_title":{"text":null},"content":{"html":"<h3>A one-time push</h3><p>An alternative to a CI server is a one-time push. Use it only if you don’t plan frequent updates of your components. In your terminal, run:</p>"}}},{"__typename":"PrismicDocsPageBodyCode","slice_type":"code","primary":{"code":{"raw":[{"text":"npx uxpin-merge push --token <your-library-token>"}]},"language":"JavaScript"}},{"__typename":"PrismicDocsPageBodyContent","slice_type":"content","primary":{"content_title":{"text":null},"content":{"html":"<p>Don’t save your token in any file checked into the repository.</p>"}}},{"__typename":"PrismicDocsPageBodyContent","slice_type":"content","primary":{"content_title":{"text":null},"content":{"html":"<h3>Next steps</h3><ul><li><a target=\"_blank\" rel=\"noopener\" href=\"https://www.uxpin.com/docs/merge/merge-publish-and-maintain/#cli-tool\">CLI Tool</a></li><li><a target=\"_blank\" rel=\"noopener\" href=\"https://www.uxpin.com/docs/merge/merge-publish-and-maintain/#version-control\">Merge library version control</a></li><li><a target=\"_blank\" rel=\"noopener\" href=\"https://www.uxpin.com/docs/merge/merge-connect-your-library/#config-file\">Config File</a></li></ul>"}}},{"__typename":"PrismicDocsPageBodyContent","slice_type":"content","primary":{"content_title":{"text":"Version Control"},"content":{"html":"<p>When you manage a design system that’s continuously updated alongside the product, you can run into different design system versions in different prototypes. Ideally you keep your library up to date as much as possible, but you may also want to control when to upgrade the design system version.</p><p>Merge version control gives you the flexibility to manage the library version for each project. You can freely switch between the versions you’ve added.</p>"}}},{"__typename":"PrismicDocsPageBodyContent","slice_type":"content","primary":{"content_title":{"text":null},"content":{"html":"<h3>Branch or Tag</h3><p>In Merge, you choose the library version for a given prototype in one of two ways, a branch or a version tag.</p><p><strong>Branch</strong></p><ul><li>What it does: prototypes update automatically whenever the branch you use changes.</li><li>Best when: you’re actively changing your design system and don’t want to change tags every time you push to test changes.</li></ul><p><strong>Tag</strong></p><ul><li>What it does: the prototype always references that specific version and isn’t updated when you update the library. It updates only when you change the tag or switch to a branch or Latest.</li><li>Best when: you want full control over when to upgrade the design system version.</li></ul>"}}},{"__typename":"PrismicDocsPageBodyTip","slice_type":"tip","primary":{"tip_type":"Info tip mini size","tip_title":"NOTE","tip":{"html":"<p>You can push a tag only once. You can’t push your library to UXPin again with the same tag, so you have to specify a new tag each time.</p>"}}},{"__typename":"PrismicDocsPageBodyContent","slice_type":"content","primary":{"content_title":{"text":null},"content":{"html":"<h4>Always use the latest version</h4><p>If you always want to use the latest version of your design system, select the checkbox to follow “Latest”. A prototype then updates automatically whenever the library changes, because it always references the latest version of the branch.</p>"}}},{"__typename":"PrismicDocsPageBodyContent","slice_type":"content","primary":{"content_title":{"text":null},"content":{"html":"<h3>Add a version to your library</h3><p>To add a tag version, use the --tag option when you push from the CLI:</p>"}}},{"__typename":"PrismicDocsPageBodyCode","slice_type":"code","primary":{"code":{"raw":[{"text":"npx uxpin-merge push --token <your-library-token> --tag <version>"}]},"language":null}},{"__typename":"PrismicDocsPageBodyContent","slice_type":"content","primary":{"content_title":{"text":null},"content":{"html":"<p>To push a working branch, use the --branch option:</p>"}}},{"__typename":"PrismicDocsPageBodyCode","slice_type":"code","primary":{"code":{"raw":[{"text":"npx uxpin-merge push --token <your-library-token> --branch <branch>"}]},"language":null}},{"__typename":"PrismicDocsPageBodyContent","slice_type":"content","primary":{"content_title":{"text":null},"content":{"html":"<h3>Delete a version</h3><p>To delete a tag or a branch from your library, use delete-version:</p><pre>npx uxpin-merge delete-version --token &lt;your-library-token&gt; --tag &lt;version&gt;\nnpx uxpin-merge delete-version --token &lt;your-library-token&gt; --branch &lt;branch&gt;</pre>"}}},{"__typename":"PrismicDocsPageBodyContent","slice_type":"content","primary":{"content_title":{"text":null},"content":{"html":"<h3>Switch the version for a prototype</h3>"}}},{"__typename":"PrismicDocsPageBodyVideo","slice_type":"video","primary":{"video_link":{"url":"https://uxpincommunity.cdn.prismic.io/uxpincommunity/b1cc8568-05e9-47f9-baed-7e86b8939647_01_manage.mp4"},"video_description":{"text":"How to switch a version for a prototype"}}},{"__typename":"PrismicDocsPageBodyContent","slice_type":"content","primary":{"content_title":{"text":null},"content":{"html":"<ol><li>Click the gear icon while you open the Merge library you want to control.</li><li>Click “Manage Version in project” in the library panel.</li><li>Choose the version you want to use for the prototype.</li></ol>"}}},{"__typename":"PrismicDocsPageBodyContent","slice_type":"content","primary":{"content_title":{"text":null},"content":{"html":"<h3>Set a default version for future prototypes</h3>"}}},{"__typename":"PrismicDocsPageBodyVideo","slice_type":"video","primary":{"video_link":{"url":"https://uxpincommunity.cdn.prismic.io/uxpincommunity/30e52ad2-6aeb-43b0-9dfd-8612f8ca1514_02_library.mp4"},"video_description":{"text":"How to set a default version for future prototypes"}}},{"__typename":"PrismicDocsPageBodyContent","slice_type":"content","primary":{"content_title":{"text":null},"content":{"html":"<ol><li>Click the gear icon while you open the Merge library you want to control.</li><li>Click “Library settings” in the library panel.</li><li>Choose the version you want to use for future prototypes.</li></ol>"}}}]}}},"pageContext":{"isCreatedByStatefulCreatePages":false,"categoryUid":"merge","pageUid":"merge-publish-and-maintain","meta_description":"UXPin's merge Docs, publish and maintain for new and advanced users","meta_image":"https://images.prismic.io/uxpincommunity/fa3875f8df8606e6405ba46165becc1ea6ed3d34.png?auto=compress,format","meta_title":"Publish and maintain | Merge","page_title":"Publish and maintain | Merge"}}