This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
ContentChef Node SDK β a Lerna monorepo with two packages:
packages/contentchef-nodeβ TypeScript client for the ContentChef content API (online + preview channels)packages/contentchef-mediaβ Media URL generation utilities (wraps Cloudinary)
All commands run from within a package directory (e.g., packages/contentchef-node/):
npm test # clean + jest (with coverage)
npm run build # clean + dual build (ESM β dist/esm, CJS β dist/cjs)
npm run lint # eslint
npx jest --testPathPattern=<pattern> # run a single test fileMonorepo install from root (npm workspaces, Lerna 8):
npm install # installs all packages
npm run lint # lerna run lint
npm test # lerna run test
npm run build # lerna run buildEntry point src/index.ts exports a configure() function that accepts IContentChefConfiguration (spaceId, API key, optional host/timeout) and returns an IConfiguredSDK with two channel factories:
onlineChannel(apiKey, channel)β retrieves published content onlypreviewChannel(apiKey, channel)β retrieves published + staging content, supports target dates viaITargetDateResolver
Each channel exposes: content<T>(), search<T>(), localizedContent<T>(), localizedSearch<T>().
Key services:
- ConfigurationManager (
src/services/ConfigurationManager/) β validates SDK config, implementsIConfigurableto pass config to Channel - Channel (
src/services/Channel/) β builds API endpoints, executes fetch requests withX-Chef-Keyheader, serializes sorting/filtering
API endpoint patterns:
- Online:
/space/{spaceId}/online/{method}/{channel} - Preview:
/space/{spaceId}/preview/{state}/{method}/{channel}
Thin wrapper around cloudinary-build-url. Exports imageUrl(), videoUrl(), rawFileUrl() with default cloud name 'contentchef' and HTTPS enforced.
Both packages produce dual targets:
dist/cjs/β CommonJS (main entry)dist/esm/β ES modules (module entry)dist/index.d.tsβ TypeScript declarations
- Jest with ts-jest, test files in
__tests__/dirs using.test.tsor.spec.tssuffix - HTTP mocking via
nock(contentchef-node) - Coverage collected automatically
Uses ESLint (flat config at eslint.config.mjs) with typescript-eslint. Single quotes enforced, no-empty-object-type disabled, ban-ts-comment disabled in tests.
breaking(π₯),enhancement(π),bug(π),documentation(π),internal(π )