Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .cursor/rules/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Cursor (optional)

**Cursor** users: start at **[AGENTS.md](../../AGENTS.md)**. All conventions live in **`skills/*/SKILL.md`**.

This folder only points contributors to **`AGENTS.md`** so editor-specific config does not duplicate the canonical docs.
2 changes: 1 addition & 1 deletion .talismanrc
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ fileignoreconfig:
ignore_detectors:
- filecontent
- filename: package-lock.json
checksum: 3ae04b5ee7c37b5415cd74592d1b6f1488399a5f6baea8b6035fa8f92ffaedbb
checksum: 8d6d64bf4285ff8042f14af5951c6147a9cf56967b07ad21186bd9d129e3c291
version: "1.0"
50 changes: 50 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# @contentstack/types-generator – Agent guide

**Universal entry point** for contributors and AI agents. Detailed conventions live in **`skills/*/SKILL.md`**.

## What this repo is

| Field | Detail |
| --- | --- |
| **Name:** | [contentstack/types-generator](https://github.com/contentstack/types-generator) |
| **Purpose:** | Library that generates TypeScript types from Contentstack stack content types (Delivery SDK) and from GraphQL schema (introspection). |
| **Out of scope (if any):** | **Management API (CMA)** client behavior—this package targets **CDA** and **GraphQL** only. |

## Tech stack (at a glance)

| Area | Details |
| --- | --- |
| **Language** | TypeScript **5.9** (`strict` in [tsconfig.json](tsconfig.json)) |
| **Build** | **tsup** → `dist/` ([tsup.config.ts](tsup.config.ts)); entries include [src/index.ts](src/index.ts), [src/web.ts](src/web.ts) |
| **Tests** | Jest + ts-jest ([jest.config.js](jest.config.js)); `dotenv/config` in setup |
| **Lint / coverage** | No ESLint script; rely on TypeScript strictness and project conventions |
| **Other** | `@contentstack/delivery-sdk`, `axios`, `@gql2ts/from-schema`, `lodash`, `async`, `prettier` |

## Commands (quick reference)

| Command type | Command |
| --- | --- |
| **Build** | `npm run build` |
| **Test** | `npm test` |
| **Lint** | _(not configured)_ |

CI: [.github/workflows/node.js.yml](.github/workflows/node.js.yml); release: [.github/workflows/release.yml](.github/workflows/release.yml).

## Credentials and integration tests

Set a **`.env`** at the repo root or export variables (see `tests/integration/`). Typical names: `TOKEN`, `APIKEY`, `ENVIRONMENT`, `REGION`, `TOKENTYPE`, `BRANCH`. CI injects secrets including `TOKEN_WITH_NO_CT` and `APIKEY_WITH_NO_CT` where needed.

## Where the documentation lives: skills

| Skill | Path | What it covers |
| --- | --- | --- |
| Development workflow | [skills/dev-workflow/SKILL.md](skills/dev-workflow/SKILL.md) | Branches, CI, build/test, PRs, releases |
| TypeScript types generator | [skills/typescript-types-generator/SKILL.md](skills/typescript-types-generator/SKILL.md) | `generateTS` vs `graphqlTS`, SDK and GraphQL behavior |
| Testing | [skills/testing/SKILL.md](skills/testing/SKILL.md) | Jest layout, `.env`, fixtures |
| Code review | [skills/code-review/SKILL.md](skills/code-review/SKILL.md) | PR checklist, terminology, semver |

An index with “when to use” hints is in [skills/README.md](skills/README.md).

## Using Cursor (optional)

If you use **Cursor**, [.cursor/rules/README.md](.cursor/rules/README.md) only points to **`AGENTS.md`**—same docs as everyone else.
Loading
Loading