# Production Ready

> For AI: the checklist a widget built from the canonical template meets before delivery. Each item names what verifies it.

---

## Automated checks

Run in the widget project, then validate:

```bash
npm run lint
npm test
npm run build
```

| Item | Verified by |
|------|-------------|
| Lint passes: import graph, no literal text in JSX, sorted keys in `src/config/*.json` | `npm run lint` (`eslint.config.js`) |
| Every file in `src/` falls under an import-graph rule | `tests/boundaries/architecture.test.ts` |
| Styles stay within the widget's boundaries (no hex colors, fonts, radii, SCSS variables, `@import`, Dynamic's CSS or `[data-bs-theme]` selectors) | `tests/boundaries/styleBoundaries.test.ts`, `npm run stylelint` |
| `index.html` links Dynamic's CSS with an absolute URL for the pinned version | `tests/boundaries/dynamicCssLink.test.ts`; validator *Style Boundaries* |
| `widget.manifest.json` agrees with `package.json` (name, version, exact Dynamic UI pin) | `tests/boundaries/widgetManifest.test.ts`; validator *Widget Manifest* |
| `npm run build` leaves exactly `main.js`, `main.css` and `index.html` in `dist/` | `tests/boundaries/distContents.test.ts` (builds the widget); validator *Build Output* (warning, only if `dist/` exists) |
| Each `requireVariable` names its own Liquid tag | `tests/config/widgetConfig.test.ts`; validator *Required Variables* |
| Every visible text comes from `t('...')`, with keys in `src/locales/es.json` and `src/locales/en.json` | `npm run lint`; validator *i18n* (both locales exist and are not empty) |
| Loading, error and empty states are handled | validator *Data States* (empty state: warning) |
| `ErrorBoundary` exists in `src/shared/ui` and wraps the page in `src/app/App.tsx` | validator *Error Handling* |
| Tests exist under `tests/`, mirroring `src/`; each hook has a test at its mirrored path | `npm test`; validator *Testing* (*Hooks Have Tests* is a warning) |
| Basic accessibility: `DInput` with a label, icon `DButton` with text or `aria-label`, `img` with `alt` | validator *Accessibility* (warnings) |
| `widgets-validate` reports `passing: true` (no errors) | `widgets-validate`. Warnings do not block. `stack-alignment` can set `passing: false` with a score of 100 |

Rules in detail: `modyo://docs/widgets/reference-validator-rules`.

---

## Manual checks

| Item | How |
|------|-----|
| Every feature works with mock data | `npm run dev` with `"use-mocks": "true"` in `src/config/liquid.json` |
| Required site variables are defined on the site | Define each name `getMissingVariables()` reports; see `modyo://docs/widgets/patterns-liquid-environment` |
| Only the modals the widget opens are registered in `availablePortals` | Read `src/app/main.tsx`; the validator only checks that `availablePortals` is present |
| The widget looks right with the site's theme | Add the site's theme `<link>` after Dynamic's in `index.html`, or use the Modyo CLI preview |
| No console errors in development | Browser console during `npm run dev` |

---

## What these checks do not cover

| Aspect | Status |
|--------|--------|
| Test coverage percentage | Not measured (the template does not include a coverage provider) |
| Full WCAG compliance | Not verified; the accessibility rules are basic |
| Performance with large data sets | Not tested |
| Cross-browser compatibility | Not verified |
| Security (XSS, injection) | Requires its own review |
| Responsive layout | Requires visual review |

---

## See also

- `modyo://docs/widgets/reference-validator-rules`
- `modyo://docs/widgets/patterns-testing`
- `modyo://docs/widgets/patterns-data-states`
- `modyo://docs/widgets/reference-accessibility`
