Skip to content

Commit 48092c8

Browse files
YossiSaadiclaude
andauthored
Rebrand to @mondaycom scope and add release workflow (#1)
* refactor: rename package scope from @mondaydotcomorg to @mondaycom Update the npm scope across all three publishable packages: - @mondaydotcomorg/hatcha-core → @mondaycom/hatcha-core - @mondaydotcomorg/hatcha-server → @mondaycom/hatcha-server - @mondaydotcomorg/hatcha-react → @mondaycom/hatcha-react Includes package.json name fields, workspace:* dependency references, and all source-level imports/re-exports. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * refactor: update example app imports to @mondaycom scope Rename all @mondaydotcomorg references in the Next.js example app: - package.json workspace dependencies - API route imports (challenge, verify) - Layout provider and CSS imports - Page hook import Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * docs: update package references to @mondaycom scope - README.md: update install commands, code examples, and packages table to use @mondaycom scope - CONTRIBUTING.md: fix stale @hatcha/core reference to @mondaycom/hatcha-core Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * chore: regenerate pnpm-lock.yaml for @mondaycom scope Lockfile regenerated after renaming all workspace packages from @mondaydotcomorg to @mondaycom. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * ci: add manual release workflow for npm publishing Add workflow_dispatch release workflow with: - Input fields: bump type (patch/minor/major) with semver hints, per-package release toggles (core, server, react) - Validation: requires at least one package, blocks releasing server/react without core - Pipeline: bump versions → update lockfile → build → test → typecheck → publish to npm → commit & tag → GitHub Releases - Security: npm provenance attestation (--provenance), env vars for all expressions, concurrency control - Publish order: core first, then server, then react (respects dependency graph) - npm publish happens before git push to prevent orphaned version bumps on publish failure - GitHub Releases with auto-generated notes - Summary table in workflow run UI Requires NPM_TOKEN repository secret and contents:write + id-token:write permissions (configured in workflow). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: resolve TypeScript strict mode errors in core and server tests - crypto.ts: merge split try-catch blocks so Uint8Array uses const inference (Uint8Array<ArrayBuffer>) instead of let annotation (Uint8Array<ArrayBufferLike>), fixing TS2345 with crypto.subtle.verify - e2e.test.ts: replace unsafe cast to Record<string, unknown> with idiomatic "answer" in challenge check, fixing TS2352 - handler.test.ts: same Record cast fix for ChallengeDisplay, and use "error" in result for union type narrowing on VerifyResult Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * chore: add .nvmrc and use it in release workflow Add .nvmrc with Node 22.14 as the project-level Node version. Update release workflow to read from .nvmrc instead of hardcoding the version. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * ci: drop Node 18 from CI matrix (EOL, no global crypto support) Node 18 reached end-of-life in April 2025 and does not support the global Web Crypto API (crypto.subtle) that the codebase uses. This caused all tests to fail with "crypto is not defined", and fail-fast cancelled the Node 20/22 jobs. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent b0b3a20 commit 48092c8

23 files changed

Lines changed: 271 additions & 53 deletions

File tree

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212

1313
strategy:
1414
matrix:
15-
node-version: [18, 20, 22]
15+
node-version: [20, 22]
1616

1717
steps:
1818
- uses: actions/checkout@v4

.github/workflows/release.yml

Lines changed: 223 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,223 @@
1+
name: Release
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
bump:
7+
description: "patch: bug fixes (0.1.0→0.1.1) | minor: new features (0.1.0→0.2.0) | major: breaking changes (0.1.0→1.0.0)"
8+
type: choice
9+
default: "patch"
10+
options:
11+
- patch
12+
- minor
13+
- major
14+
release_core:
15+
description: "Release @mondaycom/hatcha-core"
16+
type: boolean
17+
default: true
18+
release_server:
19+
description: "Release @mondaycom/hatcha-server"
20+
type: boolean
21+
default: true
22+
release_react:
23+
description: "Release @mondaycom/hatcha-react"
24+
type: boolean
25+
default: true
26+
27+
permissions:
28+
contents: write
29+
id-token: write
30+
31+
concurrency:
32+
group: release
33+
cancel-in-progress: false
34+
35+
jobs:
36+
release:
37+
runs-on: ubuntu-latest
38+
steps:
39+
- uses: actions/checkout@v4
40+
with:
41+
token: ${{ secrets.GITHUB_TOKEN }}
42+
43+
- uses: pnpm/action-setup@v4
44+
45+
- uses: actions/setup-node@v4
46+
with:
47+
node-version-file: '.nvmrc'
48+
cache: pnpm
49+
registry-url: "https://registry.npmjs.org"
50+
51+
- run: pnpm install --frozen-lockfile
52+
53+
- name: Validate selection
54+
env:
55+
RELEASE_CORE: ${{ inputs.release_core }}
56+
RELEASE_SERVER: ${{ inputs.release_server }}
57+
RELEASE_REACT: ${{ inputs.release_react }}
58+
run: |
59+
if [[ "$RELEASE_CORE" != "true" && \
60+
"$RELEASE_SERVER" != "true" && \
61+
"$RELEASE_REACT" != "true" ]]; then
62+
echo "::error::No packages selected for release"
63+
exit 1
64+
fi
65+
if [[ "$RELEASE_CORE" != "true" ]]; then
66+
if [[ "$RELEASE_SERVER" == "true" || "$RELEASE_REACT" == "true" ]]; then
67+
echo "::error::Cannot release server/react without core. Core must be included to ensure dependency versions are correct."
68+
exit 1
69+
fi
70+
fi
71+
72+
- name: Bump versions
73+
id: versions
74+
env:
75+
BUMP: ${{ inputs.bump }}
76+
RELEASE_CORE: ${{ inputs.release_core }}
77+
RELEASE_SERVER: ${{ inputs.release_server }}
78+
RELEASE_REACT: ${{ inputs.release_react }}
79+
run: |
80+
if [[ "$RELEASE_CORE" == "true" ]]; then
81+
cd packages/core
82+
NEW_VERSION=$(npm version "$BUMP" --no-git-tag-version)
83+
echo "core_version=${NEW_VERSION}" >> "$GITHUB_OUTPUT"
84+
echo "Core bumped to ${NEW_VERSION}"
85+
cd ../..
86+
fi
87+
88+
if [[ "$RELEASE_SERVER" == "true" ]]; then
89+
cd packages/server
90+
NEW_VERSION=$(npm version "$BUMP" --no-git-tag-version)
91+
echo "server_version=${NEW_VERSION}" >> "$GITHUB_OUTPUT"
92+
echo "Server bumped to ${NEW_VERSION}"
93+
cd ../..
94+
fi
95+
96+
if [[ "$RELEASE_REACT" == "true" ]]; then
97+
cd packages/react
98+
NEW_VERSION=$(npm version "$BUMP" --no-git-tag-version)
99+
echo "react_version=${NEW_VERSION}" >> "$GITHUB_OUTPUT"
100+
echo "React bumped to ${NEW_VERSION}"
101+
cd ../..
102+
fi
103+
104+
- name: Update lockfile
105+
run: pnpm install --no-frozen-lockfile
106+
107+
- name: Build
108+
run: pnpm build
109+
110+
- name: Test
111+
run: pnpm test
112+
113+
- name: Typecheck
114+
run: pnpm typecheck
115+
116+
- name: Publish core
117+
if: inputs.release_core
118+
run: pnpm --filter @mondaycom/hatcha-core publish --no-git-checks --provenance
119+
env:
120+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
121+
122+
- name: Publish server
123+
if: inputs.release_server
124+
run: pnpm --filter @mondaycom/hatcha-server publish --no-git-checks --provenance
125+
env:
126+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
127+
128+
- name: Publish react
129+
if: inputs.release_react
130+
run: pnpm --filter @mondaycom/hatcha-react publish --no-git-checks --provenance
131+
env:
132+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
133+
134+
- name: Commit and tag
135+
env:
136+
CORE_VERSION: ${{ steps.versions.outputs.core_version }}
137+
SERVER_VERSION: ${{ steps.versions.outputs.server_version }}
138+
REACT_VERSION: ${{ steps.versions.outputs.react_version }}
139+
run: |
140+
git config user.name "github-actions[bot]"
141+
git config user.email "github-actions[bot]@users.noreply.github.com"
142+
143+
git add packages/*/package.json pnpm-lock.yaml
144+
145+
MSG="release [skip ci]:"
146+
TAGS=()
147+
148+
if [[ -n "$CORE_VERSION" ]]; then
149+
MSG="${MSG} core@${CORE_VERSION}"
150+
TAGS+=("@mondaycom/hatcha-core@${CORE_VERSION}")
151+
fi
152+
if [[ -n "$SERVER_VERSION" ]]; then
153+
MSG="${MSG} server@${SERVER_VERSION}"
154+
TAGS+=("@mondaycom/hatcha-server@${SERVER_VERSION}")
155+
fi
156+
if [[ -n "$REACT_VERSION" ]]; then
157+
MSG="${MSG} react@${REACT_VERSION}"
158+
TAGS+=("@mondaycom/hatcha-react@${REACT_VERSION}")
159+
fi
160+
161+
git commit -m "${MSG}"
162+
163+
for TAG in "${TAGS[@]}"; do
164+
git tag "${TAG}"
165+
done
166+
167+
git push origin HEAD --tags --atomic
168+
169+
- name: Create GitHub Releases
170+
env:
171+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
172+
CORE_VERSION: ${{ steps.versions.outputs.core_version }}
173+
SERVER_VERSION: ${{ steps.versions.outputs.server_version }}
174+
REACT_VERSION: ${{ steps.versions.outputs.react_version }}
175+
run: |
176+
LAST_TAG=""
177+
178+
if [[ -n "$CORE_VERSION" ]]; then
179+
LAST_TAG="@mondaycom/hatcha-core@${CORE_VERSION}"
180+
gh release create "$LAST_TAG" \
181+
--title "hatcha-core ${CORE_VERSION}" \
182+
--generate-notes \
183+
--latest=false
184+
fi
185+
if [[ -n "$SERVER_VERSION" ]]; then
186+
LAST_TAG="@mondaycom/hatcha-server@${SERVER_VERSION}"
187+
gh release create "$LAST_TAG" \
188+
--title "hatcha-server ${SERVER_VERSION}" \
189+
--generate-notes \
190+
--latest=false
191+
fi
192+
if [[ -n "$REACT_VERSION" ]]; then
193+
LAST_TAG="@mondaycom/hatcha-react@${REACT_VERSION}"
194+
gh release create "$LAST_TAG" \
195+
--title "hatcha-react ${REACT_VERSION}" \
196+
--generate-notes \
197+
--latest=false
198+
fi
199+
200+
# Mark the last release as "Latest"
201+
if [[ -n "$LAST_TAG" ]]; then
202+
gh release edit "$LAST_TAG" --latest
203+
fi
204+
205+
- name: Summary
206+
env:
207+
CORE_VERSION: ${{ steps.versions.outputs.core_version }}
208+
SERVER_VERSION: ${{ steps.versions.outputs.server_version }}
209+
REACT_VERSION: ${{ steps.versions.outputs.react_version }}
210+
run: |
211+
echo "## Release Summary" >> "$GITHUB_STEP_SUMMARY"
212+
echo "" >> "$GITHUB_STEP_SUMMARY"
213+
echo "| Package | Version |" >> "$GITHUB_STEP_SUMMARY"
214+
echo "|---------|---------|" >> "$GITHUB_STEP_SUMMARY"
215+
if [[ -n "$CORE_VERSION" ]]; then
216+
echo "| @mondaycom/hatcha-core | ${CORE_VERSION} |" >> "$GITHUB_STEP_SUMMARY"
217+
fi
218+
if [[ -n "$SERVER_VERSION" ]]; then
219+
echo "| @mondaycom/hatcha-server | ${SERVER_VERSION} |" >> "$GITHUB_STEP_SUMMARY"
220+
fi
221+
if [[ -n "$REACT_VERSION" ]]; then
222+
echo "| @mondaycom/hatcha-react | ${REACT_VERSION} |" >> "$GITHUB_STEP_SUMMARY"
223+
fi

.nvmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
22.14

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ pnpm test
6565
## Code Style
6666

6767
- TypeScript throughout, strict mode.
68-
- No external runtime dependencies in `@hatcha/core`.
68+
- No external runtime dependencies in `@mondaycom/hatcha-core`.
6969
- Keep bundle sizes minimal — the library should stay lightweight.
7070

7171
## License

README.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
</p>
55

66
<p align="center">
7-
<a href="https://www.npmjs.com/package/@mondaydotcomorg/hatcha-core"><img src="https://img.shields.io/npm/v/@mondaydotcomorg/hatcha-core" alt="npm" /></a>
7+
<a href="https://www.npmjs.com/package/@mondaycom/hatcha-core"><img src="https://img.shields.io/npm/v/@mondaycom/hatcha-core" alt="npm" /></a>
88
<a href="./LICENSE"><img src="https://img.shields.io/badge/license-MIT-blue" alt="License" /></a>
99
<a href="https://github.com/mondaycom/HATCHA/actions"><img src="https://github.com/mondaycom/HATCHA/actions/workflows/ci.yml/badge.svg" alt="CI" /></a>
1010
</p>
@@ -28,14 +28,14 @@ HATCHA (**H**yperfast **A**gent **T**est for **C**omputational **H**euristic **A
2828
### 1. Install
2929

3030
```bash
31-
npm install @mondaydotcomorg/hatcha-react @mondaydotcomorg/hatcha-server
31+
npm install @mondaycom/hatcha-react @mondaycom/hatcha-server
3232
```
3333

3434
### 2. Add the API route
3535

3636
```typescript
3737
// app/api/hatcha/[...hatcha]/route.ts
38-
import { createHatchaHandler } from "@mondaydotcomorg/hatcha-server/nextjs";
38+
import { createHatchaHandler } from "@mondaycom/hatcha-server/nextjs";
3939

4040
const handler = createHatchaHandler({
4141
secret: process.env.HATCHA_SECRET!,
@@ -49,8 +49,8 @@ export const POST = handler;
4949

5050
```tsx
5151
// app/layout.tsx
52-
import { HatchaProvider } from "@mondaydotcomorg/hatcha-react";
53-
import "@mondaydotcomorg/hatcha-react/styles.css";
52+
import { HatchaProvider } from "@mondaycom/hatcha-react";
53+
import "@mondaycom/hatcha-react/styles.css";
5454

5555
export default function RootLayout({ children }) {
5656
return (
@@ -67,7 +67,7 @@ export default function RootLayout({ children }) {
6767

6868
```tsx
6969
"use client";
70-
import { useHatcha } from "@mondaydotcomorg/hatcha-react";
70+
import { useHatcha } from "@mondaycom/hatcha-react";
7171

7272
function AgentModeButton() {
7373
const { requestVerification } = useHatcha();
@@ -133,7 +133,7 @@ The answer **never** reaches the client. The signed token is opaque and contains
133133
## Custom challenges
134134

135135
```typescript
136-
import { registerChallenge } from "@mondaydotcomorg/hatcha-server";
136+
import { registerChallenge } from "@mondaycom/hatcha-server";
137137

138138
registerChallenge({
139139
type: "hex",
@@ -176,7 +176,7 @@ Pass `theme="dark"`, `theme="light"`, or `theme="auto"` to `<HatchaProvider>` or
176176

177177
```typescript
178178
import express from "express";
179-
import { hatchaRouter } from "@mondaydotcomorg/hatcha-server/express";
179+
import { hatchaRouter } from "@mondaycom/hatcha-server/express";
180180

181181
const app = express();
182182
app.use(express.json());
@@ -189,9 +189,9 @@ app.listen(3000);
189189

190190
| Package | Description |
191191
|---------|-------------|
192-
| [`@mondaydotcomorg/hatcha-core`](./packages/core) | Challenge generation and cryptographic verification |
193-
| [`@mondaydotcomorg/hatcha-react`](./packages/react) | React component, provider, and styles |
194-
| [`@mondaydotcomorg/hatcha-server`](./packages/server) | Next.js and Express server handlers |
192+
| [`@mondaycom/hatcha-core`](./packages/core) | Challenge generation and cryptographic verification |
193+
| [`@mondaycom/hatcha-react`](./packages/react) | React component, provider, and styles |
194+
| [`@mondaycom/hatcha-server`](./packages/server) | Next.js and Express server handlers |
195195

196196
## Development
197197

examples/nextjs-app/app/api/hatcha/challenge/route.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { createChallenge } from "@mondaydotcomorg/hatcha-core";
1+
import { createChallenge } from "@mondaycom/hatcha-core";
22

33
export async function GET() {
44
const payload = await createChallenge({

examples/nextjs-app/app/api/hatcha/verify/route.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { verifyAnswer } from "@mondaydotcomorg/hatcha-core";
1+
import { verifyAnswer } from "@mondaycom/hatcha-core";
22

33
export async function POST(request: Request) {
44
const body = await request.json();

examples/nextjs-app/app/layout.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import type { Metadata } from "next";
2-
import { HatchaProvider } from "@mondaydotcomorg/hatcha-react";
3-
import "@mondaydotcomorg/hatcha-react/styles.css";
2+
import { HatchaProvider } from "@mondaycom/hatcha-react";
3+
import "@mondaycom/hatcha-react/styles.css";
44
import "./globals.css";
55

66
export const metadata: Metadata = {

examples/nextjs-app/app/page.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
"use client";
22

33
import { useState } from "react";
4-
import { useHatcha } from "@mondaydotcomorg/hatcha-react";
4+
import { useHatcha } from "@mondaycom/hatcha-react";
55

66
export default function Home() {
77
const { requestVerification } = useHatcha();

examples/nextjs-app/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@
88
"start": "next start"
99
},
1010
"dependencies": {
11-
"@mondaydotcomorg/hatcha-core": "workspace:*",
12-
"@mondaydotcomorg/hatcha-react": "workspace:*",
13-
"@mondaydotcomorg/hatcha-server": "workspace:*",
11+
"@mondaycom/hatcha-core": "workspace:*",
12+
"@mondaycom/hatcha-react": "workspace:*",
13+
"@mondaycom/hatcha-server": "workspace:*",
1414
"next": "^15",
1515
"react": "^19",
1616
"react-dom": "^19"

0 commit comments

Comments
 (0)