From 4bc3804f0bbea9cdf5348b4342846aceeedca3da Mon Sep 17 00:00:00 2001 From: Wesley Bomar Date: Tue, 21 May 2024 12:51:02 -0500 Subject: [PATCH 1/2] docs(core-components): README polish --- libs/core-components/README.md | 78 +++++++++++++++++++++++++++------- 1 file changed, 63 insertions(+), 15 deletions(-) diff --git a/libs/core-components/README.md b/libs/core-components/README.md index b90641014..66b0b9cd6 100644 --- a/libs/core-components/README.md +++ b/libs/core-components/README.md @@ -1,8 +1,6 @@ -# TACC: Core-Components +# TACC Core-Components -This library was generated with [Nx](https://nx.dev). - -Reusable components for TACC WMA Workspace Portals & Websites +The shared components for TACC WMA Workspace Portals & Websites ## Table of Contents @@ -30,10 +28,37 @@ Reusable components for TACC WMA Workspace Portals & Websites ## Getting Started -> **Important** -> To develop a new or existing custom CMS website for a TACC client, do **not** clone this repository. Instead, read [Develop a Custom Project]. To develop on the Core CMS (upon which our other CMS are built) continute reading. +1. Install with any package manager e.g. + + - `npm install @tacc/core-styles` + - `yarn add @tacc/core-styles` + +2. Import component(s) e.g. + + ```ts + import { Button } from '@tacc/core-components'; + ``` + + ```ts + import { + FormikInput, + FormikTextarea, + FormikCheck + } from '@tacc/core-components'; + ``` + +3. Use component(s)… -Set up a new local CMS instance. + > **Sorry.** Examples are limited and incomplete: + > - [TACC-Cloud/hazmapper#239](https://github.com/TACC-Cloud/hazmapper/pull/239/files) + > - [TACC/tup-ui#465](https://github.com/TACC/tup-ui/pull/465/files) + > - [TACC/tup-ui@ee5e73b:`/.../Button.stories.tsx`](https://github.com/TACC/tup-ui/blob/ee5e73b/libs/core-components/src/lib/Button/Button.stories.tsx#L26-L37) + +## Developing + +The components are [React components](https://react.dev/learn) that should be [written in TypeScript](https://react.dev/learn/typescript#typescript-with-react-components). + +### Setup 0. [Clone this Repository.](https://docs.github.com/en/repositories/creating-and-managing-repositories/cloning-a-repository) 1. Enter the Repository Clone: @@ -54,18 +79,30 @@ Set up a new local CMS instance. npx nx serve core-components ``` -## Developing +For more commands, see [Commands](#commands). -The components are [React components](https://react.dev/learn) that should be [written in TypeScript](https://react.dev/learn/typescript#typescript-with-react-components). +## Contributing -| command | task | service | -| ------------------------------ | ------------------ | ----------------------------- | -| `npx nx test core-components` | execute unit tests | [Vitest](https://vitest.dev/) | -| `npx nx build core-components` | build components | [Vite](https://vitejs.dev/) | +### to Components -## Contributing +#### Minimum Viable Product + +0. Create or Improve a common component in a TACC repository e.g. + + - https://github.com/TACC/tup-ui + - https://github.com/TACC/Core-Portal + - https://github.com/TACC-Cloud/hazmapper + +1. Put your work in a branch in this repository. +2. Open a [Pull Request](https://github.com/TACC/tup-ui/pulls). +3. [Test your work in a client repository.](#end-to-end-tests) -### to the Demo +#### Complete Contribution + +4. [Create a story](https://storybook.js.org/docs/writing-stories) to demo the component. +5. Create [unit tests](#unit-tests). + +### in the Demo | task | reference | | ------------------ | ------------------------------------------------- | @@ -82,6 +119,17 @@ Run `nx test core-components` to execute the unit tests via [Vitest](https://vit Perform manually by installing and testing the components in a separate respository. See [different approaches to testing your own packages](https://dev.to/one-beyond/different-approaches-to-testing-your-own-packages-1kdg). +## Resources + +### Commands + +| command | task | service | +| ---------------------------------------- | ------------------ | -------------------------------------- | +| `npx nx serve core-components` | start demo | [Storybook](https://storybook.js.org/) | +| `npx nx build core-components` | build components | [Vite](https://vitejs.dev/) | +| `npx nx build-storybook core-components` | build demo | [Storybook](https://storybook.js.org/) | +| `npx nx test core-components` | execute unit tests | [Vitest](https://vitest.dev/) | + [core styles]: https://github.com/TACC/Core-Styles From 735b4e4164a9602dd9b453c433a88cb6db95180e Mon Sep 17 00:00:00 2001 From: Wesley Bomar Date: Tue, 21 May 2024 12:54:18 -0500 Subject: [PATCH 2/2] chore(core-components): update version --- libs/core-components/package.json | 2 +- package-lock.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/libs/core-components/package.json b/libs/core-components/package.json index 5d264658c..7605b107e 100644 --- a/libs/core-components/package.json +++ b/libs/core-components/package.json @@ -1,6 +1,6 @@ { "name": "@tacc/core-components", - "version": "0.0.1", + "version": "0.0.2", "license": "MIT", "author": "TACC ACI WMA ", "description": "React component library for TACC applications.", diff --git a/package-lock.json b/package-lock.json index 8162f4d4b..b8f430c28 100644 --- a/package-lock.json +++ b/package-lock.json @@ -91,7 +91,7 @@ }, "libs/core-components": { "name": "@tacc/core-components", - "version": "0.0.1", + "version": "0.0.2", "license": "MIT", "dependencies": { "formik": "^2.2.9",