# gsintegrations React Components

A React component library with MUI, Zod-validated types, and Storybook.

## Install

```bash
npm install gsintegrations
```

Peer dependencies (install in your app):

```bash
npm install react@^18.2.0 react-dom@^18.2.0
```

## Usage

```tsx
import React from "react";
import { ThemeProvider } from "@mui/material/styles";
import { SomeComponent } from "gsintegrations";

export function App() {
  return (
    <ThemeProvider /* your theme */>
      <SomeComponent />
    </ThemeProvider>
  );
}
```

## Development

- Build: `npm run build`
- Type-check: `npm run type-check`
- Storybook: `npm run storybook`

### Storybook MCP (for AI-assisted UI work)

This project is configured with Storybook MCP to support safer refactors and faster new UI feature implementation.

1. Start Storybook:

```bash
npm run storybook
```

2. Ensure MCP is reachable at:

```text
http://localhost:6006/mcp
```

3. In Cursor Agent mode, the project MCP server is available as:

```text
gsintegrations-storybook-mcp
```

4. Suggested verification prompt:

```text
List all documented components.
```

### Tests (fast local workflow)

- Default local run (no coverage, faster): `npm test`
- Watch mode: `npm run test:watch`
- Only changed files vs `main`: `npm run test:changed`
- Related tests for changed source files: `npm run test:related -- src/path/to/file.tsx`
- Run specific test files directly: `npm run test:path -- src/path/to/file.test.tsx`
- Coverage run (slower): `npm run test:coverage`
- CI/full suite (used in workflows): `npm run test:ci`

Notes:

- CI and publish workflows currently gate on `lint`, `type-check`, and `build`.
- `npm run test:changed` uses automatic git fallback when `origin/main` is unavailable.
- Use targeted commands locally for fast feedback, then run `npm run test:ci` before opening a PR when possible.
- Optional push safeguard: run `PUSH_FAST_TESTS=1 npm run push:quality` to include impacted-tests execution during push checks.

## Release

Releases use Changesets with GitHub Actions and run only from `main`.

1. Add a changeset in your branch: `npm run changeset` and select `patch`.
2. Open a PR and merge into `main` after CI passes.
3. GitHub Actions versions, publishes to npm, and creates a GitHub release automatically.

Required repository secret: `NPM_TOKEN` with publish permission.

Operational release checklist: `docs/GO_LIVE_CHECKLIST.md`.
