|
9 | 9 | <a href="https://rivet.gg/discord"><img src="https://img.shields.io/discord/822914074136018994"></a> |
10 | 10 | </p> |
11 | 11 |
|
| 12 | +## ⚠️ Legal Notice |
| 13 | + |
| 14 | +**This package is licensed exclusively for use in Rivet products and services.** Using this package in any other product, project, or commercial application is strictly prohibited and may constitute a violation of Font Awesome's Terms of Service and intellectual property rights. |
| 15 | + |
| 16 | +This package includes icons from Font Awesome Pro, which are licensed to Rivet for use in Rivet products only. If you wish to use Font Awesome Pro icons in your own projects, you must obtain your own license from [Font Awesome](https://fontawesome.com/plans). |
| 17 | + |
12 | 18 | ## Motivation |
13 | 19 |
|
14 | | -Rivet Icons are a set of SVG icons that are used in Rivet products. This package is built on top of great Font Awesome icons. Some icons used in our products are from the premium Font Awesome icon set. We've created a package that lets you use premium icons without having to buy a Font Awesome license. This is achieved by swapping premium icons with a simple rectangle. |
| 20 | +Rivet Icons are a set of SVG icons that are used in Rivet products. This package is built on top of great Font Awesome icons. Some icons used in our products are from the premium Font Awesome icon set. We've created a package that lets you use premium icons without having to buy a Font Awesome license. |
| 21 | + |
| 22 | +All icons (including Pro icons) are pre-generated and committed to the repository, so this package works out-of-the-box with **no Font Awesome token required** for end users. |
15 | 23 |
|
16 | 24 |
|
17 | 25 | ## Contributing |
18 | 26 |
|
19 | 27 | ### Prerequisites |
20 | 28 |
|
21 | | -Obtain a Font Awesome Pro license and set the `FONTAWESOME_PACKAGE_TOKEN` environment variable to your Font Awesome Pro token. This is required to download the premium icons. |
| 29 | +**For maintainers only:** Obtain a Font Awesome Pro license and set the `FONTAWESOME_PACKAGE_TOKEN` environment variable to your Font Awesome Pro token. This is only required when vendoring new icons. |
22 | 30 |
|
23 | 31 | ### Adding new icons |
24 | 32 |
|
25 | | -1. Modify `generateManifest.js` to include new icons. |
26 | | -2. Run `./scripts/generateManifest.js` to generate a new `manifest.json` file. |
27 | | - - If you're getting an error: `Could not find package @fortawesome/pro-solid-svg-icons`, |
28 | | -3. Commit the changes to the `manifest.json` file. |
29 | | -4. Run `pnpm rebuild @rivet-gg/icons` to generate a new icon set with the new icons. |
| 33 | +1. Ensure you have a `FONTAWESOME_PACKAGE_TOKEN` environment variable set |
| 34 | +2. Modify [scripts/generateManifest.js](scripts/generateManifest.js) to include new icons |
| 35 | +3. Run `./scripts/generateManifest.js` to generate a new `manifest.json` file |
| 36 | + - If you're getting an error about missing packages, run `pnpm install` in the `src` folder first |
| 37 | +4. Run `pnpm vendor` to generate icon files: |
| 38 | + - `src/index.gen.js` |
| 39 | + - `src/index.gen.ts` |
| 40 | + - `dist/index.js` |
| 41 | +5. Commit all changes including the generated files |
30 | 42 |
|
31 | 43 | ## Troubleshooting |
32 | 44 |
|
33 | | -### Icons not showing, or icons are rectangles |
| 45 | +### Icons not showing up |
| 46 | + |
| 47 | +All icons (including Font Awesome Pro icons) are pre-generated and committed to this repository. If icons aren't showing: |
| 48 | + |
| 49 | +1. Make sure you have the peer dependencies installed: |
| 50 | + - `@fortawesome/fontawesome-svg-core` |
| 51 | + - `@fortawesome/free-solid-svg-icons` |
| 52 | + - `@fortawesome/free-brands-svg-icons` |
| 53 | + - `@fortawesome/react-fontawesome` |
| 54 | + - `react` and `react-dom` |
| 55 | + |
| 56 | +2. Check that you're importing icons correctly: |
| 57 | + ```tsx |
| 58 | + import { Icon, faCheckCircle } from "@rivet-gg/icons"; |
| 59 | + |
| 60 | + <Icon icon={faCheckCircle} /> |
| 61 | + ``` |
34 | 62 |
|
35 | | -Some icons used in the open-source Rivet products are part of the premium Font Awesome icon set. We can't share those icons publicly, without violating FA's Terms Of Service. By default, after adding this package to any project, a post install script generates an icon set with all premium icons replaced with simple rectangles. So, you can reference premium icons, but you won't see them. To be able to see premium icons, make sure an environment variable `FONTAWESOME_PACKAGE_TOKEN` is set when running `pnpm install`. You can re-generate our icon set by running `pnpm rebuild @rivet-gg/icons` if your dependencies are already installed. |
| 63 | +3. If the problem persists, contact us on [Discord](https://rivet.gg/discord) |
36 | 64 |
|
37 | | -### Can't start/build project |
38 | | -The description of these kinds of errors may vary. This package heavily depends on postinstall scripts from pnpm/npm. Make sure you didn't disable them accidentally. Turn on post-installation script support and run `pnpm install` or `pnpm rebuild @rivet-gg/icons` again. If there is still a problem, please contact us on [Discord](https://rivet.gg/discord"). |
| 65 | +### For Maintainers: `Could not find package @fortawesome/pro-solid-svg-icons` |
39 | 66 |
|
| 67 | +This error occurs when running the vendor script without access to Font Awesome Pro packages. Make sure: |
40 | 68 |
|
41 | | -### `Could not find package @fortawesome/pro-solid-svg-icons` when generating manifest |
42 | | -Make sure you have installed pro icons. If you're getting an error, you can try to install them manually by running `pnpm add @fortawesome/pro-solid-svg-icons`, or run `pnpm install` in `src` folder. Finally run `./scripts/generateManifest.js` again. |
| 69 | +1. `FONTAWESOME_PACKAGE_TOKEN` environment variable is set |
| 70 | +2. Run `pnpm install` in the `src` folder to install FA Pro packages |
| 71 | +3. Run `pnpm vendor` again |
0 commit comments