| Dimension | Shared | Only in A | Only in B | Overlap |
|---|---|---|---|---|
| Sections | 0 | 6 | 6 | 0% |
| Commands | 4 | 2 | 1 | 57% |
| Section tags | 3 | 3 | 3 | 33% |
What each file covers
Sections
0 shared · 6 only in A · 6 only in B- − Contentstack JavaScript Delivery SDK – Agent guide
- − What this repo is
- − Tech stack (at a glance)
- − Commands (quick reference)
- − Where the documentation lives: skills
- − Using Cursor (optional)
- + Testing — `contentstack` (CDA)
- + Frameworks
- + Env & live stack
- + Layout
- + Hygiene
- + Coverage
Commands
4 shared · 2 only in A · 1 only in B- − npm run lint
- − npm-publish.yml
- + npm run test:typescript
- npm run build
- jest.js.config.js
- jest.config.js
- npm test
Section tags
3 shared · 3 only in A · 3 only in B- − lint-format
- − agent-behaviour
- − docs
- + architecture
- + testing-strategy
- + do-not
- build
- test
- code-style
Line diff
contentstack/contentstack-javascript · AGENTS.md
@@ −1 @@
1# Contentstack JavaScript Delivery SDK – Agent guide
2
3**Universal entry point** for contributors and AI agents. Detailed conventions live in **`skills/*/SKILL.md`**.
4
5## What this repo is
6
7| Field | Detail |
8|--------|--------|
9| **Name:** | [contentstack-javascript](https://github.com/contentstack/contentstack-javascript) (npm package **`contentstack`**) |
10| **Purpose:** | Legacy **JavaScript** Content Delivery SDK for browsers, Node.js, React Native, and NativeScript—stack initialization, queries, entries, assets. |
11| **Out of scope:** | Not the TypeScript-first **`@contentstack/delivery-sdk`** (`contentstack-typescript`); new TypeScript projects should prefer that package when appropriate. |
12
13## Tech stack (at a glance)
14
15| Area | Details |
16|------|---------|
17| Language | JavaScript in **`src/`**; TypeScript tests via Jest (`test/typescript`) |
18| Build | Webpack configs under **`webpack/`**; outputs under **`dist/`** per target (`npm run build`) |
19| Tests | Jest: **`test:e2e`** (`jest.js.config.js`) and **`test:typescript`** (`jest.config.js`); **`pretest`** runs **`build`** first |
20| Lint / coverage | ESLint on `src` and `test` (`npm run lint`) |
21| CI | `.github/workflows/check-branch.yml`, `npm-publish.yml`, `sca-scan.yml`, `policy-scan.yml`, `codeql-analysis.yml`, `link-check.yml`, `issues-jira.yml` |
22
23## Commands (quick reference)
24
25| Command type | Command |
26|--------------|---------|
27| Build | `npm run build` |
28| Test | `npm test` (build via `pretest`, then e2e + TypeScript Jest suites) |
29| Lint | `npm run lint` |
30
31## Where the documentation lives: skills
32
33| Skill | Path | What it covers |
34|-------|------|----------------|
35| **Development workflow** | [`skills/dev-workflow/SKILL.md`](skills/dev-workflow/SKILL.md) | Branches, npm scripts, Husky, CI |
36| **JavaScript SDK** | [`skills/contentstack-javascript-sdk/SKILL.md`](skills/contentstack-javascript-sdk/SKILL.md) | Public API (`Stack`, regions), `@contentstack/utils` |
37| **JavaScript tooling** | [`skills/javascript/SKILL.md`](skills/javascript/SKILL.md) | Webpack targets, `dist/` layout, Babel |
38| **Testing** | [`skills/testing/SKILL.md`](skills/testing/SKILL.md) | Jest configs, e2e vs TypeScript tests |
39| **Code review** | [`skills/code-review/SKILL.md`](skills/code-review/SKILL.md) | PR checklist |
40
41## Using Cursor (optional)
42
43If you use **Cursor**, [`.cursor/rules/README.md`](.cursor/rules/README.md) only points to **`AGENTS.md`**—same docs as everyone else.
44
contentstack/contentstack-javascript · .cursor/rules/testing.mdc
@@ +1 @@
1---
2description: "Jest e2e and TypeScript tests for the CDA SDK"
3globs:
4 - "test/**/*.js"
5 - "test/**/*.ts"
6alwaysApply: false
7---
8
9# Testing — `contentstack` (CDA)
10
11## Frameworks
12
13| Suite | Runner | Notes |
14|-------|--------|--------|
15| **JS e2e / integration-style** | **Jest** (`jest.js.config.js`) | `testMatch`: `**/test/**/*.js`; ignores `test/index.js`, `test/config.js`, `test/sync_config.js`, some `utils.js` paths |
16| **TypeScript** | **Jest** + **ts-jest** (`jest.config.js`) | `npm run test:typescript`; `test/typescript/**/*.test.ts` |
17
18## Env & live stack
19
20- **Canonical required vars** for suites that `require('./config')` or `require('../config.js')`: **`HOST`**, **`API_KEY`**, **`DELIVERY_TOKEN`**, **`ENVIRONMENT`** — validated in **`test/config.js`** (loads **dotenv**). Missing any variable throws on import.
21- Use a **`.env`** file locally; do not commit secrets. **`HOST`** should match the delivery API host for your stack/region.
22- Built SDK: many tests **`require('../../dist/node/contentstack.js')`**. **`npm test`** runs **`pretest`** → **`npm run build`** first.
23
24## Layout
25
26- **Suite entry (JS):** `test/index.js` `require`s individual test files.
27- **TypeScript:** colocate under **`test/typescript/`** with `*.test.ts` naming.
28
29## Hygiene
30
31- No committed **`only`** / **`skip`** for tests that must run in CI.
32- Prefer deterministic assertions; mock or scope live tests when adding new cases so CI behavior stays predictable if env is absent.
33
34## Coverage
35
36- Jest / reporter config is in **`jest.js.config.js`** and **`jest.config.js`**; HTML reports paths are configured there.
37
@@ −1 +1 @@
1−# Contentstack JavaScript Delivery SDK – Agent guide
1+---
2+description: "Jest e2e and TypeScript tests for the CDA SDK"
3+globs:
4+ - "test/**/*.js"
5+ - "test/**/*.ts"
6+alwaysApply: false
7+---
28
3−**Universal entry point** for contributors and AI agents. Detailed conventions live in **`skills/*/SKILL.md`**.
9+# Testing — `contentstack` (CDA)
410
5−## What this repo is
11+## Frameworks
612
7−| Field | Detail |
8−|--------|--------|
9−| **Name:** | [contentstack-javascript](https://github.com/contentstack/contentstack-javascript) (npm package **`contentstack`**) |
10−| **Purpose:** | Legacy **JavaScript** Content Delivery SDK for browsers, Node.js, React Native, and NativeScript—stack initialization, queries, entries, assets. |
11−| **Out of scope:** | Not the TypeScript-first **`@contentstack/delivery-sdk`** (`contentstack-typescript`); new TypeScript projects should prefer that package when appropriate. |
13+| Suite | Runner | Notes |
14+|-------|--------|--------|
15+| **JS e2e / integration-style** | **Jest** (`jest.js.config.js`) | `testMatch`: `**/test/**/*.js`; ignores `test/index.js`, `test/config.js`, `test/sync_config.js`, some `utils.js` paths |
16+| **TypeScript** | **Jest** + **ts-jest** (`jest.config.js`) | `npm run test:typescript`; `test/typescript/**/*.test.ts` |
1217
13−## Tech stack (at a glance)
18+## Env & live stack
1419
15−| Area | Details |
16−|------|---------|
17−| Language | JavaScript in **`src/`**; TypeScript tests via Jest (`test/typescript`) |
18−| Build | Webpack configs under **`webpack/`**; outputs under **`dist/`** per target (`npm run build`) |
19−| Tests | Jest: **`test:e2e`** (`jest.js.config.js`) and **`test:typescript`** (`jest.config.js`); **`pretest`** runs **`build`** first |
20−| Lint / coverage | ESLint on `src` and `test` (`npm run lint`) |
21−| CI | `.github/workflows/check-branch.yml`, `npm-publish.yml`, `sca-scan.yml`, `policy-scan.yml`, `codeql-analysis.yml`, `link-check.yml`, `issues-jira.yml` |
20+- **Canonical required vars** for suites that `require('./config')` or `require('../config.js')`: **`HOST`**, **`API_KEY`**, **`DELIVERY_TOKEN`**, **`ENVIRONMENT`** — validated in **`test/config.js`** (loads **dotenv**). Missing any variable throws on import.
21+- Use a **`.env`** file locally; do not commit secrets. **`HOST`** should match the delivery API host for your stack/region.
22+- Built SDK: many tests **`require('../../dist/node/contentstack.js')`**. **`npm test`** runs **`pretest`** → **`npm run build`** first.
2223
23−## Commands (quick reference)
24+## Layout
2425
25−| Command type | Command |
26−|--------------|---------|
27−| Build | `npm run build` |
28−| Test | `npm test` (build via `pretest`, then e2e + TypeScript Jest suites) |
29−| Lint | `npm run lint` |
26+- **Suite entry (JS):** `test/index.js` `require`s individual test files.
27+- **TypeScript:** colocate under **`test/typescript/`** with `*.test.ts` naming.
3028
31−## Where the documentation lives: skills
29+## Hygiene
3230
33−| Skill | Path | What it covers |
34−|-------|------|----------------|
35−| **Development workflow** | [`skills/dev-workflow/SKILL.md`](skills/dev-workflow/SKILL.md) | Branches, npm scripts, Husky, CI |
36−| **JavaScript SDK** | [`skills/contentstack-javascript-sdk/SKILL.md`](skills/contentstack-javascript-sdk/SKILL.md) | Public API (`Stack`, regions), `@contentstack/utils` |
37−| **JavaScript tooling** | [`skills/javascript/SKILL.md`](skills/javascript/SKILL.md) | Webpack targets, `dist/` layout, Babel |
38−| **Testing** | [`skills/testing/SKILL.md`](skills/testing/SKILL.md) | Jest configs, e2e vs TypeScript tests |
39−| **Code review** | [`skills/code-review/SKILL.md`](skills/code-review/SKILL.md) | PR checklist |
31+- No committed **`only`** / **`skip`** for tests that must run in CI.
32+- Prefer deterministic assertions; mock or scope live tests when adding new cases so CI behavior stays predictable if env is absent.
4033
41−## Using Cursor (optional)
34+## Coverage
4235
43−If you use **Cursor**, [`.cursor/rules/README.md`](.cursor/rules/README.md) only points to **`AGENTS.md`**—same docs as everyone else.
36+- Jest / reporter config is in **`jest.js.config.js`** and **`jest.config.js`**; HTML reports paths are configured there.
4437
