# 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`

### 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 creates/updates a release PR with version + changelog.
4. Merge the release PR to publish automatically to npm.

Required repository secret: `NPM_TOKEN` with publish permission.

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