|
1 |
| -# Project |
| 1 | +# React Component Toolkit |
2 | 2 |
|
3 |
| -> This repo has been populated by an initial template to help get you started. Please |
4 |
| -> make sure to update the content to build a great experience for community-building. |
5 | 3 |
|
6 |
| -As the maintainer of this project, please make a few updates: |
| 4 | +### What is the React Component Toolkit? |
| 5 | +The react component toolkit is a toolkit for building and testing react components and includes a set of unique features including AI component generation and automatic conversion to Azure APIM Widgets. |
7 | 6 |
|
8 |
| -- Improving this README.MD file to provide a great experience |
9 |
| -- Updating SUPPORT.MD with content about this project's support experience |
10 |
| -- Understanding the security reporting process in SECURITY.MD |
11 |
| -- Remove this section from the README |
| 7 | +--- |
| 8 | + |
| 9 | +#### Table of Contents |
| 10 | + |
| 11 | +1. [Features](#features) |
| 12 | +2. [Install with Azure CLI Dev Tools](#install-via-azdev) |
| 13 | +3. [Install manually (no backend)](#manual-install) |
| 14 | +4. [Quick Start](#quick-start) |
| 15 | +5. [Notes](#notes) |
| 16 | +6. [Contributing](#contributing) |
| 17 | +7. [Trademarks](#trademarks) |
| 18 | + |
| 19 | +--- |
| 20 | + |
| 21 | +## Features |
| 22 | +- Integrates with Azure Open AI allowing the creation of components from a description alone. |
| 23 | +- Can convert a react component into an Azure API Management Widget. |
| 24 | +- Can be tested standalone using ladle which is built into the toolkit stack. |
| 25 | +- Unit and code coverage testing through Jest (including snapshot testing). |
| 26 | +- Uses css as code through Styled Components out of the box. |
| 27 | +- Includes a few example components including a markdown viewer, force-graph-3d component, etc. |
| 28 | +- Can create a new basic component with tests to scaffold a new component (or you can use AI and create a basis for a new one) |
| 29 | +- Automatically adds dependencies for created components. |
| 30 | +- Includes rollup for packaging components. |
| 31 | + |
| 32 | +## Install via azdev |
| 33 | + |
| 34 | +#### ⚠️ Note |
| 35 | +``` |
| 36 | +Automatic Install uses azdev and includes installing Azure OpenAI and Azure APIM on your subscription. |
| 37 | +``` |
| 38 | + |
| 39 | +Please use the Official Azure Samples github instructions to install and configure the toolkit via azdev. |
| 40 | + |
| 41 | +[Azure Samples - react-component-toolkit](https://github.com/Azure-Samples/react-component-toolkit-openai-demo) |
| 42 | + |
| 43 | +## Manual Install |
| 44 | + |
| 45 | +#### ⚠️ Note |
| 46 | +``` |
| 47 | +Manual installation requires .env file to be configured to enable Azure Open AI/Open AI and APIM Widget functionality. |
| 48 | +An example .env.empty file is included, fill out the correct values and copy/rename to .env. |
| 49 | +``` |
| 50 | + |
| 51 | +Pre-requisites: Latest stable release of Node.js |
| 52 | + |
| 53 | +Installation: |
| 54 | + |
| 55 | +1. Clone this repo and run ```node install.mjs``` in the root. |
| 56 | + |
| 57 | +## Quick Start |
| 58 | + |
| 59 | +* ```npm run ladle:dev``` to get started and see current component running with debugging available. |
| 60 | +* ```npm run ladle:prod``` to get started and see current components running with a full production build. |
| 61 | +* ```npm run cleanup``` - clear dist, build_artifacts and unittest coverage results. |
| 62 | +* ```npm run rollup``` - runs ```rollup -c``` |
| 63 | +* ```npm run build``` - run ```npm cleanup``` followed by ```npm rollup```. |
| 64 | +* ```npm run test``` - run unit tests from all components (src/unittests). |
| 65 | +* ```npm run createnew [component_description]``` - create an AI generated component using Azure Open AI (configure via .env) |
| 66 | +* ```npm run createtemplate [component_name]``` - to create a new ready to run component template with stories and unit tests. |
| 67 | +* ```npm run removecomponent [component_name]``` - to delete a component and associated stories and unit tests. |
| 68 | +* ```npm run packagewidget [existing_component_name]``` - to package a component as a widget for Azure API Management Developer Portal. |
| 69 | +* ```npm run test (or npm test)``` - run all component unit tests |
| 70 | +* ```npm run test:update``` - update all snapshots for unit tests |
| 71 | +* ```npm run test:watch``` - run jest in watch mode |
| 72 | + |
| 73 | +## Notes |
| 74 | + |
| 75 | +- This project uses npm, however the initial package.json is dynamically created by running node install.mjs (see below) |
| 76 | +- package.json is dynamically created is to ensure that each component defines it's own dependencies, these dependencies are merged for testing in ladle, unit tests and using rollup to package the entire project |
| 77 | +- If you create the component manually: |
| 78 | + - A package.json should be placed in the components directory which contains only name, version and its dependencies, devDependencies and peerDependencies (see any component under src/components for an example) |
| 79 | +- You must run npm updatepackages to cause an update to the root package.json. |
| 80 | +- If you use ```npm createnew [component_name]``` to create a new component, ```npm updatepackages``` will happen for you the first time. |
| 81 | +- In both cases, any time you add or remove npm dependencies you should add them to the component package.json under the component you are working on, or common/package.json if those dependencies are toolkit wid |
| 82 | +e, after doing that you should run ```npm updatepackages``` |
| 83 | + |
| 84 | +--- |
12 | 85 |
|
13 | 86 | ## Contributing
|
14 | 87 |
|
|
26 | 99 |
|
27 | 100 | ## Trademarks
|
28 | 101 |
|
29 |
| -This project may contain trademarks or logos for projects, products, or services. Authorized use of Microsoft |
30 |
| -trademarks or logos is subject to and must follow |
| 102 | +This project may contain trademarks or logos for projects, products, or services. Authorized use of Microsoft |
| 103 | +trademarks or logos is subject to and must follow |
31 | 104 | [Microsoft's Trademark & Brand Guidelines](https://www.microsoft.com/en-us/legal/intellectualproperty/trademarks/usage/general).
|
32 | 105 | Use of Microsoft trademarks or logos in modified versions of this project must not cause confusion or imply Microsoft sponsorship.
|
33 | 106 | Any use of third-party trademarks or logos are subject to those third-party's policies.
|
0 commit comments