From ee6e925e3122b09e4d0535d8ea57b4e4610a8059 Mon Sep 17 00:00:00 2001 From: oli-hivemq Date: Fri, 3 May 2024 10:04:40 +0200 Subject: [PATCH 1/3] docs: troubleshooting install issues --- README.md | 36 +++++++++++++++++++++++++++++++----- 1 file changed, 31 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index f1c835f..50eab1b 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,9 @@ This package contains the theme for all HiveMQ ChakraUI Projects. -## Setup .npmrc +## Importing this library + +### Setup .npmrc To install the theme, you have to add the following line to your `.npmrc` file: @@ -10,7 +12,7 @@ To install the theme, you have to add the following line to your `.npmrc` file: @hivemq:registry=https://npm.pkg.github.com ``` -## Install Peer Dependencies +### Install Peer Dependencies To install the peer dependencies, use the following command: @@ -18,7 +20,7 @@ To install the peer dependencies, use the following command: pnpm add @chakra-ui/react @emotion/react @emotion/styled framer-motion ``` -## Install CLI tools +### Install CLI tools Each project has to generate the types for the theme, it cannot be exported by default. Therefore we have to install the following dependency to our project. @@ -37,7 +39,7 @@ And also include the generation to our postinstall command } ``` -## Install Theme +### Install Theme To install a theme, use the following command: @@ -45,7 +47,7 @@ To install a theme, use the following command: pnpm add @hivemq/ui-theme ``` -## Install Font-Faces +### Install Font-Faces Fonts are not being installed by the theme itself, so you have to install them per project. For that you can use the following command to install the fonts you want to use in your project. @@ -77,3 +79,27 @@ Then you can import these fonts ether in your `main.ts` file or `global.css` fil @import '../node_modules/@fontsource/raleway/800.css'; @import '../node_modules/@fontsource/raleway/900.css'; ``` + +## Troubleshooting + +### Unauthorized error +#### Context +You added this library as a dependency to your repository's package.json. + +#### Possible Errors +- `error An unexpected error occurred: "https://npm.pkg.github.com/@hivemq%2fui-theme: unauthenticated: User cannot be authenticated with the token provided.".` +- `error An unexpected error occurred: "https://npm.pkg.github.com/download/@hivemq/ui-theme/0.2.0/ca9f1eaf504872aad12d56766542624d511169fa: Request failed \"401 Unauthorized\"".` + +#### Resolution +1. [Generate a new personal token for your GitHub user](https://docs.github.com/en/enterprise-server@3.9/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens#creating-a-personal-access-token). + - Choose `Generate new token (classic)`. + - In the scope, select at least `read:packages`. + - Remember to copy the generated token before it disappears. +1. Add the following line to your `.npmrc` file: + ``` + //npm.pkg.github.com/:_authToken=your_new_token + ``` +1. Re-run your repository's installation step (e.g. `yarn install`). + +#### If the problem persists +Check that your user has permissions to access https://github.com/hivemq. You might need to contact an admin to help you out. From 48a7f6edccc91e57b79dcc929f46926b70514aa4 Mon Sep 17 00:00:00 2001 From: oli-hivemq Date: Mon, 6 May 2024 10:49:12 +0200 Subject: [PATCH 2/3] docs: update README based on feedback --- README.md | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 50eab1b..5ed46a3 100644 --- a/README.md +++ b/README.md @@ -95,11 +95,16 @@ You added this library as a dependency to your repository's package.json. - Choose `Generate new token (classic)`. - In the scope, select at least `read:packages`. - Remember to copy the generated token before it disappears. -1. Add the following line to your `.npmrc` file: - ``` - //npm.pkg.github.com/:_authToken=your_new_token +2. Save your new token to an environment variable (e.g. in `~/.bashrc` or `~/.zshrc`): +```bash +export NPM_TOKEN=${YOUR_TOKEN} +``` +where `YOUR_TOKEN` is the token you obtained from Github remember to refresh your terminal after adding the it. (e.g. `source ~/.bashrc` depending on your shell) +3. Add the following line to your `.npmrc` file: + ```bash + //npm.pkg.github.com/:_authToken=${NPM_TOKEN} ``` -1. Re-run your repository's installation step (e.g. `yarn install`). +4. Re-run your repository's installation step (e.g. `yarn install`). #### If the problem persists Check that your user has permissions to access https://github.com/hivemq. You might need to contact an admin to help you out. From aad7010b07be8613ee92a74f135a116a5ffefffc Mon Sep 17 00:00:00 2001 From: oli-hivemq Date: Mon, 6 May 2024 11:39:59 +0200 Subject: [PATCH 3/3] docs: remove unnecessary step in troubleshooting section of the README file --- README.md | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/README.md b/README.md index 5ed46a3..0bddd73 100644 --- a/README.md +++ b/README.md @@ -100,11 +100,7 @@ You added this library as a dependency to your repository's package.json. export NPM_TOKEN=${YOUR_TOKEN} ``` where `YOUR_TOKEN` is the token you obtained from Github remember to refresh your terminal after adding the it. (e.g. `source ~/.bashrc` depending on your shell) -3. Add the following line to your `.npmrc` file: - ```bash - //npm.pkg.github.com/:_authToken=${NPM_TOKEN} - ``` -4. Re-run your repository's installation step (e.g. `yarn install`). +3. Re-run your repository's installation step (e.g. `yarn install`). #### If the problem persists Check that your user has permissions to access https://github.com/hivemq. You might need to contact an admin to help you out.