Skip to content

Commit

Permalink
docs: TUP-700 @tacc/core-components - readme (#467)
Browse files Browse the repository at this point in the history
* docs(core-components): README polish

* chore(core-components): update version
  • Loading branch information
wesleyboar authored May 21, 2024
1 parent 41116e6 commit 5c0f4d9
Show file tree
Hide file tree
Showing 3 changed files with 65 additions and 17 deletions.
78 changes: 63 additions & 15 deletions libs/core-components/README.md
Original file line number Diff line number Diff line change
@@ -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

Expand Down Expand Up @@ -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:
Expand All @@ -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 |
| ------------------ | ------------------------------------------------- |
Expand All @@ -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/) |

<!-- Link Aliases -->

[core styles]: https://github.com/TACC/Core-Styles
Expand Down
2 changes: 1 addition & 1 deletion libs/core-components/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@tacc/core-components",
"version": "0.0.1",
"version": "0.0.2",
"license": "MIT",
"author": "TACC ACI WMA <[email protected]>",
"description": "React component library for TACC applications.",
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 5c0f4d9

Please sign in to comment.