| description | Branches, tests, and PR expectations for contentstack-management-javascript | ||||
|---|---|---|---|---|---|
| globs |
|
||||
| alwaysApply | false |
- Follow team Git conventions (e.g. feature branches off
development/ default integration branch as used in this repo). - Keep commits focused; do not commit with
test.only,it.only,describe.only, or skipped tests meant to be permanent.
npm run lint— ESLint must pass onlibandtest.- Unit tests —
npm run test:unit(defaultnpm testalso invokestest:apifirst — ensure that script exists inpackage.jsonon your branch). - Sanity / API tests — only when explicitly validating against live CMA: run
npm run test:sanity-nocovortest:sanity-testafternpm run build, with env vars documented intest/sanity-check/utility/testSetup.js(EMAIL,PASSWORD,HOST,ORGANIZATION, etc.). Never commit secrets. - Version bump — When the PR introduces user-visible or release-worthy
lib/behavior (new API, bug fix shipped to npm, or a breaking change), updateversioninpackage.jsonper semver: patch (fixes, internal-compatible tweaks), minor (backward-compatible features or additive API), major (breaking public contract). Docs-only, tests-only, or chore-only changes often omit a bump if your team bumps only at release; follow team practice (some repos bump only onmain/release). If unsure, ask the reviewer or match sibling PRs.
- User-facing changes — JSDoc on public methods; update
types/**when the public surface changes. - Behavior — Preserve backward compatibility unless the change is explicitly breaking and documented.
- Errors — Route HTTP failures through existing patterns (
lib/core/contentstackError.js-style handling); avoid leaking full tokens in logs (existing code redacts authtoken/authorization in error paths). - Tests — Add or adjust unit tests under
test/unit/for new behavior; use mocks (Sinon / Nock / axios-mock-adapter) rather than live API in unit tests.
- Agent overview: repo root
AGENTS.md - CMA SDK patterns:
skills/contentstack-javascript-cma/SKILL.md - HTTP / retry layer:
skills/framework/SKILL.md