# joe-header

Shared JOE & THE JUICE top bar, published as a Lit web component. Source of
truth is this package inside `joe-pay-website`. Other sites keep consuming the
npm package `joe-header`.

How it works, how it publishes, and how other projects bump it:
[docs/joe-header.md](../../docs/joe-header.md).

## Use from npm / unpkg

```html
<body>
  <joe-header></joe-header>
  <script
    type="module"
    src="https://unpkg.com/joe-header@2.0.13/dist/joe-header.js"
  ></script>
</body>
```

Replace the version with the published version you want.

On `https://www.joejuice.com` and `https://joejuice.com` the header renders an
Order button. Add the `hide-order-button` attribute to opt out:
`<joe-header hide-order-button></joe-header>`.

## Develop in this repo

From the repository root:

```bash
yarn header:dev     # isolated preview
yarn header:build   # npm-ready dist/joe-header.js
```

Joe Pay Website uses the workspace source via a Vite alias, so `yarn dev`
picks up header edits without publishing.

## Publish

Do not `npm publish` from a laptop. After CI is green on `master`:

- Automatic: push to `master` that touches `packages/joe-header/**`
- Manual: GitHub Action **Publish joe-header** → Run workflow

Both run `yarn header:publish`. See `docs/RELEASE.md`.
