From 373ed4e4a17a1b6936dcdd3d4b8ba9220bd7bb4a Mon Sep 17 00:00:00 2001 From: reeshika-h Date: Mon, 6 Apr 2026 10:55:22 +0530 Subject: [PATCH 1/5] Added cursor rules and skills --- .cursor/rules/README.md | 23 +++++++++++ .cursor/rules/code-review.mdc | 35 +++++++++++++++++ .cursor/rules/contentstack-utils.mdc | 27 +++++++++++++ .cursor/rules/dart.mdc | 31 +++++++++++++++ .cursor/rules/dev-workflow.md | 35 +++++++++++++++++ .cursor/rules/testing.mdc | 27 +++++++++++++ AGENTS.md | 51 ++++++++++++++++++++++++ skills/README.md | 21 ++++++++++ skills/code-review/SKILL.md | 58 ++++++++++++++++++++++++++++ skills/contentstack-utils/SKILL.md | 43 +++++++++++++++++++++ skills/framework/SKILL.md | 47 ++++++++++++++++++++++ skills/testing/SKILL.md | 42 ++++++++++++++++++++ 12 files changed, 440 insertions(+) create mode 100644 .cursor/rules/README.md create mode 100644 .cursor/rules/code-review.mdc create mode 100644 .cursor/rules/contentstack-utils.mdc create mode 100644 .cursor/rules/dart.mdc create mode 100644 .cursor/rules/dev-workflow.md create mode 100644 .cursor/rules/testing.mdc create mode 100644 AGENTS.md create mode 100644 skills/README.md create mode 100644 skills/code-review/SKILL.md create mode 100644 skills/contentstack-utils/SKILL.md create mode 100644 skills/framework/SKILL.md create mode 100644 skills/testing/SKILL.md diff --git a/.cursor/rules/README.md b/.cursor/rules/README.md new file mode 100644 index 0000000..251c0f7 --- /dev/null +++ b/.cursor/rules/README.md @@ -0,0 +1,23 @@ +# Cursor Rules – Contentstack Utils (Dart) + +This directory contains Cursor AI rules that apply when working in this repository. Rules provide persistent context so the AI follows project conventions and Contentstack Utils patterns. + +## How rules are applied + +- **File-specific rules** use the `globs` frontmatter: they apply when you open or edit files matching that pattern. +- **Always-on rules** use `alwaysApply: true`: they are included in every conversation in this project. + +## Rule index + +| File | Applies when | Purpose | +|------|--------------|---------| +| **dev-workflow.md** | (Reference only; no glob) | Core development workflow: branches, running tests, PR expectations. Read for process guidance. | +| **dart.mdc** | Editing any `**/*.dart` | Dart SDK constraint, package layout, `analysis_options.yaml`, imports, `pubspec` dependencies. | +| **contentstack-utils.mdc** | Editing `lib/**` | Utils patterns: `Utils` / `GQL` / `Option`, RTE and embedded JSON, `FormatException` / `ErrorMessages`, alignment with `package:contentstack`. | +| **testing.mdc** | Editing `test/**` | Testing patterns: `package:test`, `*_test.dart`, `test/mock/` fixtures, coverage, offline tests. | +| **code-review.mdc** | Always | PR/review checklist: API stability, error handling, backward compatibility, dependencies and security (e.g. SCA). | + +## Related + +- **AGENTS.md** (repo root) – Main entry point for AI agents: project overview, entry points, and pointers to rules and skills. +- **skills/** – Reusable skill docs (Contentstack Utils, testing, code review, framework) for deeper guidance on specific tasks. diff --git a/.cursor/rules/code-review.mdc b/.cursor/rules/code-review.mdc new file mode 100644 index 0000000..ce5d977 --- /dev/null +++ b/.cursor/rules/code-review.mdc @@ -0,0 +1,35 @@ +--- +description: PR and code review checklist – API stability, errors, compatibility, security, tests +alwaysApply: true +--- + +# Code Review Checklist – Contentstack Utils (Dart) + +Use this checklist when reviewing pull requests or before opening a PR. + +## API design and stability + +- [ ] **Public API:** New or changed public methods/classes on **`Utils`**, **`GQL`**, **`Option`**, or exports from **`lib/contentstack_utils.dart`** are necessary and reflected in **`README.md`** / **`CHANGELOG.md`** when user-facing. +- [ ] **Backward compatibility:** No breaking changes to public API unless explicitly called out and justified (e.g. major version in **`pubspec.yaml`**). +- [ ] **Naming:** Method names match existing style (**`jsonToHTML`**, **`render`**, **`renderContent`**). **`GQL`** stays importable from **`package:contentstack_utils/src/GQL.dart`** for **`package:contentstack`** consumers. + +## Error handling and robustness + +- [ ] **Errors:** Invalid JSON or embedded structures throw **`FormatException`** with **`ErrorMessages`** (or documented behavior); no silent failures on bad RTE JSON. +- [ ] **Consistency:** User-facing strings go through **`ErrorMessages`** in **`lib/src/constants/ErrorMessages.dart`** where the rest of the library uses constants. + +## Dependencies and security + +- [ ] **Dependencies:** No new dependencies without justification; version bumps are intentional and reviewed against **`.github/workflows/sca-scan.yml`** (OSV on **`pubspec.lock`**, **`dart pub outdated`**). +- [ ] **SCA:** Address or track security findings from dependency or scanner output in the PR scope when applicable. + +## Testing + +- [ ] **Coverage:** New or modified behavior is covered by tests under **`test/`** using **`test/mock/`** fixtures where appropriate. +- [ ] **Test quality:** Tests are readable, stable, and follow **`*_test.dart`** layout; no flakiness or live network calls. + +## Severity (optional) + +- **Blocker:** Must fix before merge (e.g. breaking public API without approval, security issue, no tests for new code). +- **Major:** Should fix (e.g. inconsistent error handling, missing changelog for user-visible change). +- **Minor:** Nice to fix (e.g. style, minor docs). diff --git a/.cursor/rules/contentstack-utils.mdc b/.cursor/rules/contentstack-utils.mdc new file mode 100644 index 0000000..4afca26 --- /dev/null +++ b/.cursor/rules/contentstack-utils.mdc @@ -0,0 +1,27 @@ +--- +description: Contentstack Utils patterns – RTE rendering, embedded JSON, GQL SRTE, FormatException +globs: "lib/**" +--- + +# Contentstack Utils (Dart) – SDK Rules + +Apply when editing library code under `lib/`. This package **does not** call the Content Delivery HTTP API; it transforms **fetched entry JSON** for rich text and embedded items. Use with **`package:contentstack`** for stack/entry fetch; API keys and tokens belong in the Contentstack Dart SDK, not here. + +## Entry points and imports + +- **Barrel:** `package:contentstack_utils/contentstack_utils.dart` — class **`Utils`**, exports **`StyleType`**, **`Metadata`**. +- **Option:** `package:contentstack_utils/src/model/Option.dart` — **`Option`**, **`Option.entry(Map)`**, **`renderOption(Map, Metadata)`**. +- **GQL SRTE:** `package:contentstack_utils/src/GQL.dart` — **`GQL.jsonToHTML`**. Not re-exported from the barrel; import explicitly. +- **Helpers / errors:** `lib/src/helper/Automate.dart`, `lib/src/model/NodeToHtml.dart`, `lib/src/constants/ErrorMessages.dart`. + +## Public behavior + +- **`Utils.render` / `Utils.renderContent` / `Utils.jsonToHTML`** — Walk `_embedded_items`, resolve RTE paths, render via **`Option`**. Invalid input throws **`FormatException`** with **`ErrorMessages`** text. +- **`GQL.jsonToHTML`** — GraphQL-shaped SRTE (`embedded_itemsConnection`, nested `json`). +- **Errors:** Use **`FormatException`** and **`ErrorMessages`** (`invalidJsonFile`, `invalidEmbeddedObjectsInput`) for consistency with **`package:contentstack`** consumers. + +## Implementation dependencies + +- **`package:html`** — RTE HTML parsing; **`package:logger`** — logging in helpers. Do not add alternate HTML or logging stacks without review. + +When changing user-visible behavior, update **`README.md`** and **`CHANGELOG.md`**; code uses **`jsonToHTML`** naming (match published API, not README typos). diff --git a/.cursor/rules/dart.mdc b/.cursor/rules/dart.mdc new file mode 100644 index 0000000..dbcda95 --- /dev/null +++ b/.cursor/rules/dart.mdc @@ -0,0 +1,31 @@ +--- +description: Dart standards and contentstack_utils package conventions (pubspec, analysis, imports) +globs: "**/*.dart" +--- + +# Dart Standards – Contentstack Utils (Dart) + +Apply these conventions when editing Dart code in this repository. + +## Language and SDK + +- **SDK constraint:** Honor `environment.sdk` in `pubspec.yaml` (`>=2.12.0 <4.0.0`). Do not use language or API features that require a narrower SDK unless the constraint is updated deliberately. + +## Analyzer and formatting + +- **Analyzer:** Lints flow through `analysis_options.yaml` (includes `package:pedantic/analysis_options.yaml` today). Fix analyzer warnings in new code; do not silence rules project-wide without team agreement. +- **Formatting:** Run `dart format .` before PRs. + +## Package layout and naming + +- **Library code:** Under `lib/` — barrel `lib/contentstack_utils.dart`, implementation under `lib/src/` (`helper/`, `model/`, `embedded/`, `constants/`). +- **File naming:** `PascalCase.dart` under `lib/src/`; tests use `snake_case_test.dart` under `test/`. + +## Imports + +- Prefer **`package:contentstack_utils/...`** for library code. Tests may import the barrel and specific `src/` paths (e.g. `package:contentstack_utils/src/helper/Automate.dart`) when exercising internals—match existing tests. + +## Dependencies + +- **Runtime** (`dependencies`): `path`, `html`, `logger`, `lint` (see `pubspec.yaml`). Do not add heavy or redundant packages without review. +- **Types:** JSON is often `Map`/`dynamic`; new code should improve safety where practical without large breaking refactors—follow `lib/src/helper/Automate.dart` and `lib/src/model/Option.dart`. diff --git a/.cursor/rules/dev-workflow.md b/.cursor/rules/dev-workflow.md new file mode 100644 index 0000000..efff490 --- /dev/null +++ b/.cursor/rules/dev-workflow.md @@ -0,0 +1,35 @@ +# Development Workflow – Contentstack Utils (Dart) + +Use this as the standard workflow when contributing to the Dart Utils package. + +## Branches + +- Use feature branches for changes (e.g. `feat/...`, `fix/...`). +- **`.github/workflows/check-branch.yml`** restricts merges into **`master`**: the head branch must be **`staging`** unless policy changes. Open PRs against **`staging`** per team norms. + +## Running tests + +- **All tests:** `dart test` +- **Analyze:** `dart analyze .` +- **Format:** `dart format .` + +Run tests and analyze before opening a PR. This package has **no** integration tests against a live stack—tests use JSON under **`test/mock/`** only. + +## Pull requests + +- Ensure **`dart analyze .`** and **`dart test`** pass. +- Follow the **code-review** rule (see `.cursor/rules/code-review.mdc`) for the PR checklist. +- Keep changes backward-compatible for public API; call out breaking changes clearly with semver and **`CHANGELOG.md`**. + +## Security and compliance (CI) + +- **`.github/workflows/sca-scan.yml`:** `dart pub outdated`, OSV on **`pubspec.lock`**. +- **`.github/workflows/policy-scan.yml`:** **`SECURITY.md`** and **`LICENSE`** (public repos). + +## Publishing (maintainers) + +- Tag-driven: **`.github/workflows/publish.yml`** on `v*.*.*` tags via **`dart pub publish`**. + +## Optional: TDD + +If the team uses TDD, follow RED–GREEN–REFACTOR when adding behavior: write a failing test first, then implement, then refactor. The **testing** rule and **`skills/testing`** skill describe test layout and fixtures. diff --git a/.cursor/rules/testing.mdc b/.cursor/rules/testing.mdc new file mode 100644 index 0000000..9daf3ef --- /dev/null +++ b/.cursor/rules/testing.mdc @@ -0,0 +1,27 @@ +--- +description: package:test patterns, test/mock fixtures, coverage, offline tests +globs: "test/**" +--- + +# Testing Rules – Contentstack Utils (Dart) + +Apply when writing or editing tests. The project uses **`package:test`** (see `pubspec.yaml`). + +## Test naming and layout + +- **Files:** `*_test.dart` in `test/` (e.g. `utils_test.dart`, `gql_test.dart`, `option_test.dart`). +- **Fixtures:** JSON under **`test/mock/`** (`embedded_items.json`, `graphqlmock/`, `supercharged/`, etc.). Load with `dart:io` **`File`** and **`dart:convert`** as existing tests do. +- **No network:** All tests are offline and deterministic; no API keys or live stack calls. + +## Running tests + +- **All tests:** `dart test` from the repo root. + +## Coverage + +- Artifacts may include **`coverage/`**, **`coverage/lcov.info`**, **`coverage_badge.svg`**. Use `dart test --coverage=coverage` when regenerating; align with team process for **`genhtml`** / badge updates. +- **`test/.test_coverage.dart`** aggregates suites for legacy **`test_coverage`** workflows; update when adding tests if that flow is still used. + +## What to cover + +- **`Utils`**, **`GQL`**, **`Option`**, **`Automate.isValidJson`**, and fixture shapes that match Delivery / GQL payloads. diff --git a/AGENTS.md b/AGENTS.md new file mode 100644 index 0000000..1751626 --- /dev/null +++ b/AGENTS.md @@ -0,0 +1,51 @@ +# Contentstack Utils (Dart) – Agent Guide + +This document is the main entry point for AI agents working in this repository. + +## Project + +- **Name:** Contentstack Utils for Dart (`contentstack_utils` on pub.dev) +- **Purpose:** Dart utilities to **render rich text and embedded entries** from Contentstack **Delivery JSON** (classic RTE, Supercharged RTE, and GraphQL-shaped SRTE). Used with **`package:contentstack`**; this package does **not** perform HTTP calls or manage API keys. +- **Repo:** [contentstack-utils-dart](https://github.com/contentstack/contentstack-utils-dart) + +## Tech stack + +- **Language:** Dart (see `environment.sdk` in `pubspec.yaml`) +- **Build:** Pub (`dart pub`) +- **Testing:** `package:test` (`dart test`) +- **Lint / analysis:** `analysis_options.yaml` (verify includes resolve with `dart analyze`) +- **Other:** `path`, `html`, `logger`, `lint` (runtime deps in `pubspec.yaml`) + +## Main entry points + +- **`Utils`** – `lib/contentstack_utils.dart`: `render`, `renderContent`, `jsonToHTML`; exports **`Metadata`**, **`StyleType`**. +- **`Option`** – `lib/src/model/Option.dart`: `renderOption`, `Option.entry`. +- **`GQL`** – `lib/src/GQL.dart`: `jsonToHTML` for GraphQL SRTE (import explicitly; not re-exported from barrel). +- **Paths:** `lib/` (package root + `lib/src/`), `test/` (`*_test.dart`), `example/example.dart`. + +## Commands + +- **Dependencies:** `dart pub get` +- **Analyze and format:** `dart analyze .` and `dart format .` +- **Tests:** `dart test` + +Publishing (maintainers): tag-driven **`dart pub publish`** — see `.github/workflows/publish.yml`. + +CI: branch rules (`.github/workflows/check-branch.yml`), SCA (`.github/workflows/sca-scan.yml`), policy (`.github/workflows/policy-scan.yml`). + +## Rules and skills + +- **`.cursor/rules/`** – Cursor rules for this repo: + - **README.md** – Index of all rules. + - **dev-workflow.md** – Development workflow (branches, tests, PRs). + - **dart.mdc** – Applies to `**/*.dart`: Dart SDK, pub, analysis, imports. + - **contentstack-utils.mdc** – Applies to `lib/**`: `Utils`, `GQL`, `Option`, RTE/embedded JSON, errors. + - **testing.mdc** – Applies to `test/**`: `package:test`, fixtures, coverage. + - **code-review.mdc** – Always applied: PR/review checklist. +- **`skills/`** – Reusable skill docs: + - Use **contentstack-utils** when implementing or changing RTE rendering, `GQL`, `Option`, or `ErrorMessages`. + - Use **testing** when adding or refactoring tests. + - Use **code-review** when reviewing PRs or before opening one. + - Use **framework** when changing `pubspec`/lockfile, analysis/lint setup, CI security scans, or shared runtime deps (`html`, `logger`). + +Refer to `.cursor/rules/README.md` for when each rule applies and to `skills/README.md` for skill details. diff --git a/skills/README.md b/skills/README.md new file mode 100644 index 0000000..eb91aa5 --- /dev/null +++ b/skills/README.md @@ -0,0 +1,21 @@ +# Skills – Contentstack Utils (Dart) + +This directory contains **skills**: reusable guidance for AI agents (and developers) on specific tasks. Each skill is a folder with a `SKILL.md` file. + +## When to use which skill + +| Skill | Use when | +|-------|----------| +| **contentstack-utils** | Implementing or changing RTE rendering, embedded items, Supercharged or GQL SRTE, `Utils` / `GQL` / `Option`, `FormatException` / `ErrorMessages`, alignment with `package:contentstack`. | +| **testing** | Writing or refactoring tests: `dart test`, `*_test.dart`, `test/mock/` fixtures, coverage, offline-only tests. | +| **code-review** | Reviewing a PR or preparing your own: API design, backward compatibility, dependencies/security, test coverage. | +| **framework** | Touching `pubspec.yaml` / `pubspec.lock`, `analysis_options.yaml`, CI security workflows (OSV, outdated), or shared implementation deps (`html`, `logger`, `path`). | + +## How agents should use skills + +- **contentstack-utils:** Apply when editing `lib/**` or public API behavior. Follow `Utils` / `GQL` / `Option` contracts and existing error patterns. +- **testing:** Apply when creating or modifying tests under `test/`. Use `test/mock/` JSON and match existing test style. +- **code-review:** Apply when performing or simulating a PR review. Go through the checklist (API stability, errors, compatibility, dependencies, tests) and optional severity levels. +- **framework:** Apply when changing dependencies, analyzer config, or CI security steps. Keep the package lean and SCA-friendly. + +Each skill’s `SKILL.md` contains more detailed instructions and references. diff --git a/skills/code-review/SKILL.md b/skills/code-review/SKILL.md new file mode 100644 index 0000000..164a797 --- /dev/null +++ b/skills/code-review/SKILL.md @@ -0,0 +1,58 @@ +--- +name: code-review +description: Use when reviewing PRs or before opening a PR – API design, backward compatibility, dependencies, security, and test quality +--- + +# Code Review – Contentstack Utils (Dart) + +Use this skill when performing or preparing a pull request review for this package. + +## When to use + +- Reviewing someone else’s PR. +- Self-reviewing your own PR before submission. +- Checking that changes meet project standards (API, errors, compatibility, tests, security). + +## Instructions + +Work through the checklist below. Optionally tag items with severity: **Blocker**, **Major**, **Minor**. + +### 1. API design and stability + +- [ ] **Public API:** New or changed **`Utils`**, **`GQL`**, **`Option`**, or barrel exports are necessary and documented in **`README.md`** / **`CHANGELOG.md`** when user-facing. +- [ ] **Backward compatibility:** No breaking changes unless agreed (semver + changelog). **`GQL`** import path remains **`package:contentstack_utils/src/GQL.dart`** for downstream SDKs. +- [ ] **Naming:** Consistent with existing methods (**`jsonToHTML`**, **`render`**, **`renderContent`**). + +**Severity:** Breaking public API without approval = Blocker. Missing changelog for user-visible change = Major. + +### 2. Error handling and robustness + +- [ ] **Errors:** Invalid input uses **`FormatException`** and **`ErrorMessages`** where the library already does. +- [ ] **Consistency:** No ad hoc error strings where **`ErrorMessages`** constants exist. + +**Severity:** Silent failure on bad JSON = Blocker. + +### 3. Dependencies and security + +- [ ] **Dependencies:** Bumps justified; **`pubspec.lock`** updated intentionally. +- [ ] **SCA:** OSV / outdated findings considered on dependency PRs. + +**Severity:** Known critical vulnerability introduced = Blocker. + +### 4. Testing + +- [ ] **Coverage:** New behavior has tests under **`test/`** with **`test/mock/`** fixtures as appropriate. +- [ ] **Quality:** Tests are readable and offline-only (no flakiness). + +**Severity:** No tests for new behavior = Blocker. + +### 5. Optional severity summary + +- **Blocker:** Must fix before merge (e.g. breaking API without approval, security issue, no tests for new code). +- **Major:** Should fix (e.g. inconsistent errors, missing docs). +- **Minor:** Nice to fix (e.g. style, minor comments). + +## References + +- Project rule: `.cursor/rules/code-review.mdc` +- Testing skill: `skills/testing/SKILL.md` diff --git a/skills/contentstack-utils/SKILL.md b/skills/contentstack-utils/SKILL.md new file mode 100644 index 0000000..6ed8ba2 --- /dev/null +++ b/skills/contentstack-utils/SKILL.md @@ -0,0 +1,43 @@ +--- +name: contentstack-utils +description: Use when implementing or changing Utils, GQL, Option, RTE/embedded JSON, and ErrorMessages – alignment with package:contentstack +--- + +# Contentstack Utils (Dart) – Implementation + +Use this skill when implementing or changing rich-text and embedded-item behavior in this package. + +## When to use + +- Adding or modifying **`Utils`**, **`GQL`**, **`Option`**, **`Metadata`**, **`StyleType`**, or **`Automate`** behavior. +- Changing how **`FormatException`** or **`ErrorMessages`** are used for invalid JSON or embedded input. +- Updating imports or public surface consumed by **`package:contentstack`**. + +## Instructions + +### Entry points + +- **Barrel:** `package:contentstack_utils/contentstack_utils.dart` — **`Utils`**, exported **`Metadata`**, **`StyleType`**. +- **Option:** `package:contentstack_utils/src/model/Option.dart` — **`renderOption(Map, Metadata)`**, **`Option.entry(Map)`**. +- **GQL:** `package:contentstack_utils/src/GQL.dart` — **`GQL.jsonToHTML`**. Not re-exported from the barrel. + +### Behavior + +- **Delivery JSON only:** This package transforms fetched entry JSON (`_embedded_items`, RTE HTML). **No HTTP** — stack, API key, and delivery token belong in the [Contentstack Dart SDK](https://pub.dev/packages/contentstack). +- **Errors:** Throw **`FormatException`** with **`ErrorMessages`** where the codebase already does; keep messages maintainable via **`lib/src/constants/ErrorMessages.dart`**. +- **Parsing:** RTE HTML uses **`package:html`**; logging uses **`package:logger`** in helpers — stay consistent with **`lib/src/helper/Automate.dart`**. + +### Official docs + +- Product: [Contentstack documentation](https://www.contentstack.com/docs). +- Package: [contentstack_utils on pub.dev](https://pub.dev/packages/contentstack_utils). + +## Key files + +- **API:** `lib/contentstack_utils.dart`, `lib/src/GQL.dart`, `lib/src/model/Option.dart` +- **Helpers:** `lib/src/helper/Automate.dart`, `lib/src/model/NodeToHtml.dart` +- **Errors:** `lib/src/constants/ErrorMessages.dart` + +## References + +- Project rules: `.cursor/rules/contentstack-utils.mdc`, `.cursor/rules/dart.mdc` diff --git a/skills/framework/SKILL.md b/skills/framework/SKILL.md new file mode 100644 index 0000000..7c3733f --- /dev/null +++ b/skills/framework/SKILL.md @@ -0,0 +1,47 @@ +--- +name: framework +description: Use when touching pubspec/lockfile, analysis_options, CI security scans, or shared runtime deps (html, logger, path) +--- + +# Framework – Contentstack Utils (Dart) + +Use this skill when changing project tooling, dependencies, or CI security configuration. This package has **no** HTTP client or retry layer (unlike full CDA SDKs); “framework” here means **Pub**, **analyzer/lint**, **CI**, and **shared libraries** used by `lib/`. + +## When to use + +- Bumping or adding dependencies in **`pubspec.yaml`** / **`pubspec.lock`**. +- Fixing or updating **`analysis_options.yaml`** (e.g. pedantic/lints includes). +- Changing **`.github/workflows/sca-scan.yml`** or other security-related CI. +- Refactoring use of **`package:html`**, **`package:logger`**, or **`package:path`** across helpers. + +## Instructions + +### Pub + +- **Install:** `dart pub get`. +- **Lockfile:** Commit **`pubspec.lock`** for reproducible builds and OSV scanning. +- Before merging dep changes: run **`dart test`** and **`dart analyze .`**. + +### Analysis and lint + +- **`analysis_options.yaml`** must resolve included packages (e.g. pedantic/lints). Coordinate with the team before switching lint sets. +- **Runtime vs dev:** Keep **`dependencies`** minimal (`path`, `html`, `logger`, `lint`); **`dev_dependencies`** for `test`, `lints`. + +### CI security + +- **`.github/workflows/sca-scan.yml`:** `dart pub outdated`, OSV scanner on **`pubspec.lock`**. Review output on dependency PRs. +- **`.github/workflows/policy-scan.yml`:** **`SECURITY.md`** and **`LICENSE`** for public repos. + +### Publishing + +- **`.github/workflows/publish.yml`:** Publishes on **`v*.*.*`** tags. Do not publish from broken analyzer or untested dependency states. + +## Key files + +- **`pubspec.yaml`**, **`pubspec.lock`**, **`analysis_options.yaml`** +- **`.github/workflows/sca-scan.yml`**, **`.github/workflows/publish.yml`** + +## References + +- Project rules: `.cursor/rules/dart.mdc`, `.cursor/rules/code-review.mdc` +- CDA behavior (not deps): `skills/contentstack-utils/SKILL.md` diff --git a/skills/testing/SKILL.md b/skills/testing/SKILL.md new file mode 100644 index 0000000..7ba7113 --- /dev/null +++ b/skills/testing/SKILL.md @@ -0,0 +1,42 @@ +--- +name: testing +description: Use when writing or refactoring tests – dart test, *_test.dart, test/mock fixtures, coverage, offline-only +--- + +# Testing – Contentstack Utils (Dart) + +Use this skill when adding or refactoring tests in this repository. + +## When to use + +- Writing new tests or changing existing **`test/*_test.dart`** files. +- Adding or updating JSON under **`test/mock/`**. +- Adjusting coverage workflow or **`test/.test_coverage.dart`**. + +## Instructions + +### Runner and layout + +- **Command:** `dart test` from the repo root. +- **Framework:** **`package:test`** (`dev_dependency` in **`pubspec.yaml`**). +- **Files:** `*_test.dart` in **`test/`** (e.g. `utils_test.dart`, `gql_test.dart`). + +### Fixtures + +- Store JSON under **`test/mock/`** (e.g. `embedded_items.json`, `graphqlmock/`, `supercharged/`). Load with **`dart:io`** **`File`** and **`dart:convert`** as in **`test/utils_test.dart`**. +- **No credentials:** Tests are offline only; no `.env` stack keys for this package. + +### Coverage + +- Optional: `dart test --coverage=coverage`; align with **`coverage/`**, **`coverage_badge.svg`**, and any **`genhtml`** step your team uses. +- **`test/.test_coverage.dart`** — update if legacy aggregation is still required when adding suites. + +### Conventions + +- Assert **`Utils`**, **`GQL`**, **`Option`**, and **`Automate`** behavior against realistic fixture shapes. +- Keep tests deterministic (no network). + +## References + +- **`pubspec.yaml`** — `test` dev dependency +- Project rule: `.cursor/rules/testing.mdc` From 7aabd74e49196a14e8408bd8d82deb346047239d Mon Sep 17 00:00:00 2001 From: reeshika-h Date: Mon, 6 Apr 2026 12:31:13 +0530 Subject: [PATCH 2/5] refactored agent and skills files --- .cursor/rules/README.md | 24 ++------- .cursor/rules/code-review.mdc | 35 ------------- .cursor/rules/contentstack-utils.mdc | 27 ---------- .cursor/rules/dart.mdc | 31 ------------ .cursor/rules/dev-workflow.md | 35 ------------- .cursor/rules/testing.mdc | 27 ---------- AGENTS.md | 73 +++++++++++++--------------- skills/README.md | 25 ++++------ skills/code-review/SKILL.md | 60 +++++++++-------------- skills/contentstack-utils/SKILL.md | 39 ++++++++------- skills/dart/SKILL.md | 45 +++++++++++++++++ skills/dev-workflow/SKILL.md | 53 ++++++++++++++++++++ skills/framework/SKILL.md | 40 ++++++++------- skills/testing/SKILL.md | 35 +++++++------ 14 files changed, 225 insertions(+), 324 deletions(-) delete mode 100644 .cursor/rules/code-review.mdc delete mode 100644 .cursor/rules/contentstack-utils.mdc delete mode 100644 .cursor/rules/dart.mdc delete mode 100644 .cursor/rules/dev-workflow.md delete mode 100644 .cursor/rules/testing.mdc create mode 100644 skills/dart/SKILL.md create mode 100644 skills/dev-workflow/SKILL.md diff --git a/.cursor/rules/README.md b/.cursor/rules/README.md index 251c0f7..f5c1f87 100644 --- a/.cursor/rules/README.md +++ b/.cursor/rules/README.md @@ -1,23 +1,5 @@ -# Cursor Rules – Contentstack Utils (Dart) +# Cursor (optional) -This directory contains Cursor AI rules that apply when working in this repository. Rules provide persistent context so the AI follows project conventions and Contentstack Utils patterns. +**Cursor** users: start at **[AGENTS.md](../../AGENTS.md)**. All conventions live in **`skills/*/SKILL.md`**. -## How rules are applied - -- **File-specific rules** use the `globs` frontmatter: they apply when you open or edit files matching that pattern. -- **Always-on rules** use `alwaysApply: true`: they are included in every conversation in this project. - -## Rule index - -| File | Applies when | Purpose | -|------|--------------|---------| -| **dev-workflow.md** | (Reference only; no glob) | Core development workflow: branches, running tests, PR expectations. Read for process guidance. | -| **dart.mdc** | Editing any `**/*.dart` | Dart SDK constraint, package layout, `analysis_options.yaml`, imports, `pubspec` dependencies. | -| **contentstack-utils.mdc** | Editing `lib/**` | Utils patterns: `Utils` / `GQL` / `Option`, RTE and embedded JSON, `FormatException` / `ErrorMessages`, alignment with `package:contentstack`. | -| **testing.mdc** | Editing `test/**` | Testing patterns: `package:test`, `*_test.dart`, `test/mock/` fixtures, coverage, offline tests. | -| **code-review.mdc** | Always | PR/review checklist: API stability, error handling, backward compatibility, dependencies and security (e.g. SCA). | - -## Related - -- **AGENTS.md** (repo root) – Main entry point for AI agents: project overview, entry points, and pointers to rules and skills. -- **skills/** – Reusable skill docs (Contentstack Utils, testing, code review, framework) for deeper guidance on specific tasks. +This folder only points contributors to **`AGENTS.md`** so editor-specific config does not duplicate the canonical docs. diff --git a/.cursor/rules/code-review.mdc b/.cursor/rules/code-review.mdc deleted file mode 100644 index ce5d977..0000000 --- a/.cursor/rules/code-review.mdc +++ /dev/null @@ -1,35 +0,0 @@ ---- -description: PR and code review checklist – API stability, errors, compatibility, security, tests -alwaysApply: true ---- - -# Code Review Checklist – Contentstack Utils (Dart) - -Use this checklist when reviewing pull requests or before opening a PR. - -## API design and stability - -- [ ] **Public API:** New or changed public methods/classes on **`Utils`**, **`GQL`**, **`Option`**, or exports from **`lib/contentstack_utils.dart`** are necessary and reflected in **`README.md`** / **`CHANGELOG.md`** when user-facing. -- [ ] **Backward compatibility:** No breaking changes to public API unless explicitly called out and justified (e.g. major version in **`pubspec.yaml`**). -- [ ] **Naming:** Method names match existing style (**`jsonToHTML`**, **`render`**, **`renderContent`**). **`GQL`** stays importable from **`package:contentstack_utils/src/GQL.dart`** for **`package:contentstack`** consumers. - -## Error handling and robustness - -- [ ] **Errors:** Invalid JSON or embedded structures throw **`FormatException`** with **`ErrorMessages`** (or documented behavior); no silent failures on bad RTE JSON. -- [ ] **Consistency:** User-facing strings go through **`ErrorMessages`** in **`lib/src/constants/ErrorMessages.dart`** where the rest of the library uses constants. - -## Dependencies and security - -- [ ] **Dependencies:** No new dependencies without justification; version bumps are intentional and reviewed against **`.github/workflows/sca-scan.yml`** (OSV on **`pubspec.lock`**, **`dart pub outdated`**). -- [ ] **SCA:** Address or track security findings from dependency or scanner output in the PR scope when applicable. - -## Testing - -- [ ] **Coverage:** New or modified behavior is covered by tests under **`test/`** using **`test/mock/`** fixtures where appropriate. -- [ ] **Test quality:** Tests are readable, stable, and follow **`*_test.dart`** layout; no flakiness or live network calls. - -## Severity (optional) - -- **Blocker:** Must fix before merge (e.g. breaking public API without approval, security issue, no tests for new code). -- **Major:** Should fix (e.g. inconsistent error handling, missing changelog for user-visible change). -- **Minor:** Nice to fix (e.g. style, minor docs). diff --git a/.cursor/rules/contentstack-utils.mdc b/.cursor/rules/contentstack-utils.mdc deleted file mode 100644 index 4afca26..0000000 --- a/.cursor/rules/contentstack-utils.mdc +++ /dev/null @@ -1,27 +0,0 @@ ---- -description: Contentstack Utils patterns – RTE rendering, embedded JSON, GQL SRTE, FormatException -globs: "lib/**" ---- - -# Contentstack Utils (Dart) – SDK Rules - -Apply when editing library code under `lib/`. This package **does not** call the Content Delivery HTTP API; it transforms **fetched entry JSON** for rich text and embedded items. Use with **`package:contentstack`** for stack/entry fetch; API keys and tokens belong in the Contentstack Dart SDK, not here. - -## Entry points and imports - -- **Barrel:** `package:contentstack_utils/contentstack_utils.dart` — class **`Utils`**, exports **`StyleType`**, **`Metadata`**. -- **Option:** `package:contentstack_utils/src/model/Option.dart` — **`Option`**, **`Option.entry(Map)`**, **`renderOption(Map, Metadata)`**. -- **GQL SRTE:** `package:contentstack_utils/src/GQL.dart` — **`GQL.jsonToHTML`**. Not re-exported from the barrel; import explicitly. -- **Helpers / errors:** `lib/src/helper/Automate.dart`, `lib/src/model/NodeToHtml.dart`, `lib/src/constants/ErrorMessages.dart`. - -## Public behavior - -- **`Utils.render` / `Utils.renderContent` / `Utils.jsonToHTML`** — Walk `_embedded_items`, resolve RTE paths, render via **`Option`**. Invalid input throws **`FormatException`** with **`ErrorMessages`** text. -- **`GQL.jsonToHTML`** — GraphQL-shaped SRTE (`embedded_itemsConnection`, nested `json`). -- **Errors:** Use **`FormatException`** and **`ErrorMessages`** (`invalidJsonFile`, `invalidEmbeddedObjectsInput`) for consistency with **`package:contentstack`** consumers. - -## Implementation dependencies - -- **`package:html`** — RTE HTML parsing; **`package:logger`** — logging in helpers. Do not add alternate HTML or logging stacks without review. - -When changing user-visible behavior, update **`README.md`** and **`CHANGELOG.md`**; code uses **`jsonToHTML`** naming (match published API, not README typos). diff --git a/.cursor/rules/dart.mdc b/.cursor/rules/dart.mdc deleted file mode 100644 index dbcda95..0000000 --- a/.cursor/rules/dart.mdc +++ /dev/null @@ -1,31 +0,0 @@ ---- -description: Dart standards and contentstack_utils package conventions (pubspec, analysis, imports) -globs: "**/*.dart" ---- - -# Dart Standards – Contentstack Utils (Dart) - -Apply these conventions when editing Dart code in this repository. - -## Language and SDK - -- **SDK constraint:** Honor `environment.sdk` in `pubspec.yaml` (`>=2.12.0 <4.0.0`). Do not use language or API features that require a narrower SDK unless the constraint is updated deliberately. - -## Analyzer and formatting - -- **Analyzer:** Lints flow through `analysis_options.yaml` (includes `package:pedantic/analysis_options.yaml` today). Fix analyzer warnings in new code; do not silence rules project-wide without team agreement. -- **Formatting:** Run `dart format .` before PRs. - -## Package layout and naming - -- **Library code:** Under `lib/` — barrel `lib/contentstack_utils.dart`, implementation under `lib/src/` (`helper/`, `model/`, `embedded/`, `constants/`). -- **File naming:** `PascalCase.dart` under `lib/src/`; tests use `snake_case_test.dart` under `test/`. - -## Imports - -- Prefer **`package:contentstack_utils/...`** for library code. Tests may import the barrel and specific `src/` paths (e.g. `package:contentstack_utils/src/helper/Automate.dart`) when exercising internals—match existing tests. - -## Dependencies - -- **Runtime** (`dependencies`): `path`, `html`, `logger`, `lint` (see `pubspec.yaml`). Do not add heavy or redundant packages without review. -- **Types:** JSON is often `Map`/`dynamic`; new code should improve safety where practical without large breaking refactors—follow `lib/src/helper/Automate.dart` and `lib/src/model/Option.dart`. diff --git a/.cursor/rules/dev-workflow.md b/.cursor/rules/dev-workflow.md deleted file mode 100644 index efff490..0000000 --- a/.cursor/rules/dev-workflow.md +++ /dev/null @@ -1,35 +0,0 @@ -# Development Workflow – Contentstack Utils (Dart) - -Use this as the standard workflow when contributing to the Dart Utils package. - -## Branches - -- Use feature branches for changes (e.g. `feat/...`, `fix/...`). -- **`.github/workflows/check-branch.yml`** restricts merges into **`master`**: the head branch must be **`staging`** unless policy changes. Open PRs against **`staging`** per team norms. - -## Running tests - -- **All tests:** `dart test` -- **Analyze:** `dart analyze .` -- **Format:** `dart format .` - -Run tests and analyze before opening a PR. This package has **no** integration tests against a live stack—tests use JSON under **`test/mock/`** only. - -## Pull requests - -- Ensure **`dart analyze .`** and **`dart test`** pass. -- Follow the **code-review** rule (see `.cursor/rules/code-review.mdc`) for the PR checklist. -- Keep changes backward-compatible for public API; call out breaking changes clearly with semver and **`CHANGELOG.md`**. - -## Security and compliance (CI) - -- **`.github/workflows/sca-scan.yml`:** `dart pub outdated`, OSV on **`pubspec.lock`**. -- **`.github/workflows/policy-scan.yml`:** **`SECURITY.md`** and **`LICENSE`** (public repos). - -## Publishing (maintainers) - -- Tag-driven: **`.github/workflows/publish.yml`** on `v*.*.*` tags via **`dart pub publish`**. - -## Optional: TDD - -If the team uses TDD, follow RED–GREEN–REFACTOR when adding behavior: write a failing test first, then implement, then refactor. The **testing** rule and **`skills/testing`** skill describe test layout and fixtures. diff --git a/.cursor/rules/testing.mdc b/.cursor/rules/testing.mdc deleted file mode 100644 index 9daf3ef..0000000 --- a/.cursor/rules/testing.mdc +++ /dev/null @@ -1,27 +0,0 @@ ---- -description: package:test patterns, test/mock fixtures, coverage, offline tests -globs: "test/**" ---- - -# Testing Rules – Contentstack Utils (Dart) - -Apply when writing or editing tests. The project uses **`package:test`** (see `pubspec.yaml`). - -## Test naming and layout - -- **Files:** `*_test.dart` in `test/` (e.g. `utils_test.dart`, `gql_test.dart`, `option_test.dart`). -- **Fixtures:** JSON under **`test/mock/`** (`embedded_items.json`, `graphqlmock/`, `supercharged/`, etc.). Load with `dart:io` **`File`** and **`dart:convert`** as existing tests do. -- **No network:** All tests are offline and deterministic; no API keys or live stack calls. - -## Running tests - -- **All tests:** `dart test` from the repo root. - -## Coverage - -- Artifacts may include **`coverage/`**, **`coverage/lcov.info`**, **`coverage_badge.svg`**. Use `dart test --coverage=coverage` when regenerating; align with team process for **`genhtml`** / badge updates. -- **`test/.test_coverage.dart`** aggregates suites for legacy **`test_coverage`** workflows; update when adding tests if that flow is still used. - -## What to cover - -- **`Utils`**, **`GQL`**, **`Option`**, **`Automate.isValidJson`**, and fixture shapes that match Delivery / GQL payloads. diff --git a/AGENTS.md b/AGENTS.md index 1751626..859da6e 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -1,51 +1,48 @@ -# Contentstack Utils (Dart) – Agent Guide +# Contentstack Utils (Dart) – Agent guide -This document is the main entry point for AI agents working in this repository. +**Universal entry point** for contributors and AI agents. Detailed conventions live in **`skills/*/SKILL.md`**. -## Project +## What this repo is -- **Name:** Contentstack Utils for Dart (`contentstack_utils` on pub.dev) -- **Purpose:** Dart utilities to **render rich text and embedded entries** from Contentstack **Delivery JSON** (classic RTE, Supercharged RTE, and GraphQL-shaped SRTE). Used with **`package:contentstack`**; this package does **not** perform HTTP calls or manage API keys. -- **Repo:** [contentstack-utils-dart](https://github.com/contentstack/contentstack-utils-dart) +| Field | Detail | +|-------|--------| +| **Name:** | [contentstack-utils-dart](https://github.com/contentstack/contentstack-utils-dart) — pub package **`contentstack_utils`** | +| **Purpose:** | Dart utilities to render rich text and embedded entries from Contentstack **Delivery JSON** (classic RTE, Supercharged RTE, and GraphQL-shaped SRTE). Typically used with **`package:contentstack`**. | +| **Out of scope (if any):** | **No HTTP client** — no stack calls, API keys, delivery tokens, or retries. Network and auth belong in the [Contentstack Dart SDK](https://pub.dev/packages/contentstack). | -## Tech stack +## Tech stack (at a glance) -- **Language:** Dart (see `environment.sdk` in `pubspec.yaml`) -- **Build:** Pub (`dart pub`) -- **Testing:** `package:test` (`dart test`) -- **Lint / analysis:** `analysis_options.yaml` (verify includes resolve with `dart analyze`) -- **Other:** `path`, `html`, `logger`, `lint` (runtime deps in `pubspec.yaml`) +| Area | Details | +|------|---------| +| **Language** | Dart — `environment.sdk` in `pubspec.yaml` (`>=2.12.0 <4.0.0`) | +| **Build** | Pub — `pubspec.yaml`, `pubspec.lock` | +| **Tests** | `package:test` — `dart test`; files `test/*_test.dart` | +| **Lint / coverage** | `analysis_options.yaml`; coverage under `coverage/` / `lcov.info` when generated | +| **Other** | Runtime deps: `path`, `html`, `logger`, `lint` (see `pubspec.yaml`) | -## Main entry points +## Commands (quick reference) -- **`Utils`** – `lib/contentstack_utils.dart`: `render`, `renderContent`, `jsonToHTML`; exports **`Metadata`**, **`StyleType`**. -- **`Option`** – `lib/src/model/Option.dart`: `renderOption`, `Option.entry`. -- **`GQL`** – `lib/src/GQL.dart`: `jsonToHTML` for GraphQL SRTE (import explicitly; not re-exported from barrel). -- **Paths:** `lib/` (package root + `lib/src/`), `test/` (`*_test.dart`), `example/example.dart`. +| Command type | Command | +|--------------|---------| +| **Build** | `dart pub get` | +| **Test** | `dart test` | +| **Lint** | `dart analyze .` and `dart format .` | -## Commands +**CI:** branch policy — `.github/workflows/check-branch.yml`; SCA — `.github/workflows/sca-scan.yml`; publish on tags — `.github/workflows/publish.yml`. -- **Dependencies:** `dart pub get` -- **Analyze and format:** `dart analyze .` and `dart format .` -- **Tests:** `dart test` +## Where the documentation lives: skills -Publishing (maintainers): tag-driven **`dart pub publish`** — see `.github/workflows/publish.yml`. +| Skill | Path | What it covers | +|-------|------|----------------| +| **Development workflow** | `skills/dev-workflow/SKILL.md` | Branches, CI, commands, PR expectations, optional TDD | +| **Contentstack Utils API** | `skills/contentstack-utils/SKILL.md` | `Utils`, `GQL`, `Option`, RTE/embedded JSON, errors, boundaries with `package:contentstack` | +| **Dart** | `skills/dart/SKILL.md` | Dart SDK, `lib/` layout, imports, analyzer, naming | +| **Testing** | `skills/testing/SKILL.md` | `package:test`, `test/mock/`, coverage, offline-only tests | +| **Code review** | `skills/code-review/SKILL.md` | PR checklist, Blocker / Major / Minor | +| **Framework / tooling** | `skills/framework/SKILL.md` | `pubspec`, lockfile, `analysis_options.yaml`, CI security, shared deps (`html`, `logger`) | -CI: branch rules (`.github/workflows/check-branch.yml`), SCA (`.github/workflows/sca-scan.yml`), policy (`.github/workflows/policy-scan.yml`). +An index with “when to use” hints is in `skills/README.md`. -## Rules and skills +## Using Cursor (optional) -- **`.cursor/rules/`** – Cursor rules for this repo: - - **README.md** – Index of all rules. - - **dev-workflow.md** – Development workflow (branches, tests, PRs). - - **dart.mdc** – Applies to `**/*.dart`: Dart SDK, pub, analysis, imports. - - **contentstack-utils.mdc** – Applies to `lib/**`: `Utils`, `GQL`, `Option`, RTE/embedded JSON, errors. - - **testing.mdc** – Applies to `test/**`: `package:test`, fixtures, coverage. - - **code-review.mdc** – Always applied: PR/review checklist. -- **`skills/`** – Reusable skill docs: - - Use **contentstack-utils** when implementing or changing RTE rendering, `GQL`, `Option`, or `ErrorMessages`. - - Use **testing** when adding or refactoring tests. - - Use **code-review** when reviewing PRs or before opening one. - - Use **framework** when changing `pubspec`/lockfile, analysis/lint setup, CI security scans, or shared runtime deps (`html`, `logger`). - -Refer to `.cursor/rules/README.md` for when each rule applies and to `skills/README.md` for skill details. +If you use **Cursor**, `.cursor/rules/README.md` only points to **`AGENTS.md`** — same docs as everyone else. diff --git a/skills/README.md b/skills/README.md index eb91aa5..2157f46 100644 --- a/skills/README.md +++ b/skills/README.md @@ -1,21 +1,16 @@ # Skills – Contentstack Utils (Dart) -This directory contains **skills**: reusable guidance for AI agents (and developers) on specific tasks. Each skill is a folder with a `SKILL.md` file. +Source of truth for detailed guidance. Read **`AGENTS.md`** first, then open the skill that matches your task. ## When to use which skill -| Skill | Use when | -|-------|----------| -| **contentstack-utils** | Implementing or changing RTE rendering, embedded items, Supercharged or GQL SRTE, `Utils` / `GQL` / `Option`, `FormatException` / `ErrorMessages`, alignment with `package:contentstack`. | -| **testing** | Writing or refactoring tests: `dart test`, `*_test.dart`, `test/mock/` fixtures, coverage, offline-only tests. | -| **code-review** | Reviewing a PR or preparing your own: API design, backward compatibility, dependencies/security, test coverage. | -| **framework** | Touching `pubspec.yaml` / `pubspec.lock`, `analysis_options.yaml`, CI security workflows (OSV, outdated), or shared implementation deps (`html`, `logger`, `path`). | +| Skill folder | Use when | +|--------------|----------| +| `dev-workflow` | Branches, CI expectations, build/test/lint commands, PR process, optional TDD | +| `contentstack-utils` | Public API (`Utils`, `GQL`, `Option`), RTE/embedded JSON, `FormatException` / `ErrorMessages` | +| `dart` | Dart version constraints, `lib/` layout, imports, analyzer/format, package naming | +| `testing` | Writing tests, `test/mock/` fixtures, coverage, no live credentials | +| `code-review` | Reviewing or preparing a PR — API stability, security, tests | +| `framework` | `pubspec` / lockfile, `analysis_options.yaml`, CI scans (OSV), shared runtime libraries | -## How agents should use skills - -- **contentstack-utils:** Apply when editing `lib/**` or public API behavior. Follow `Utils` / `GQL` / `Option` contracts and existing error patterns. -- **testing:** Apply when creating or modifying tests under `test/`. Use `test/mock/` JSON and match existing test style. -- **code-review:** Apply when performing or simulating a PR review. Go through the checklist (API stability, errors, compatibility, dependencies, tests) and optional severity levels. -- **framework:** Apply when changing dependencies, analyzer config, or CI security steps. Keep the package lean and SCA-friendly. - -Each skill’s `SKILL.md` contains more detailed instructions and references. +Each folder contains **`SKILL.md`** with YAML frontmatter (`name`, `description`). diff --git a/skills/code-review/SKILL.md b/skills/code-review/SKILL.md index 164a797..783d110 100644 --- a/skills/code-review/SKILL.md +++ b/skills/code-review/SKILL.md @@ -1,58 +1,46 @@ --- name: code-review -description: Use when reviewing PRs or before opening a PR – API design, backward compatibility, dependencies, security, and test quality +description: Use when reviewing PRs or before opening a PR — API design, backward compatibility, dependencies, security, tests --- -# Code Review – Contentstack Utils (Dart) - -Use this skill when performing or preparing a pull request review for this package. +# Code review – Contentstack Utils (Dart) ## When to use -- Reviewing someone else’s PR. -- Self-reviewing your own PR before submission. -- Checking that changes meet project standards (API, errors, compatibility, tests, security). +- Reviewing a teammate’s PR or self-review before submit. +- Verifying API stability, errors, semver, SCA, and test coverage. ## Instructions -Work through the checklist below. Optionally tag items with severity: **Blocker**, **Major**, **Minor**. - -### 1. API design and stability - -- [ ] **Public API:** New or changed **`Utils`**, **`GQL`**, **`Option`**, or barrel exports are necessary and documented in **`README.md`** / **`CHANGELOG.md`** when user-facing. -- [ ] **Backward compatibility:** No breaking changes unless agreed (semver + changelog). **`GQL`** import path remains **`package:contentstack_utils/src/GQL.dart`** for downstream SDKs. -- [ ] **Naming:** Consistent with existing methods (**`jsonToHTML`**, **`render`**, **`renderContent`**). - -**Severity:** Breaking public API without approval = Blocker. Missing changelog for user-visible change = Major. - -### 2. Error handling and robustness - -- [ ] **Errors:** Invalid input uses **`FormatException`** and **`ErrorMessages`** where the library already does. -- [ ] **Consistency:** No ad hoc error strings where **`ErrorMessages`** constants exist. +### API design and stability -**Severity:** Silent failure on bad JSON = Blocker. +- [ ] **Public API:** Changes to **`Utils`**, **`GQL`**, **`Option`**, or barrel exports are documented in **`README.md`** / **`CHANGELOG.md`** when user-facing. +- [ ] **Backward compatibility:** Breaking changes require explicit semver / changelog; **`GQL`** remains importable from **`package:contentstack_utils/src/GQL.dart`** for downstream SDKs. +- [ ] **Naming:** Matches existing methods (**`jsonToHTML`**, **`render`**, **`renderContent`**). -### 3. Dependencies and security +### Error handling -- [ ] **Dependencies:** Bumps justified; **`pubspec.lock`** updated intentionally. -- [ ] **SCA:** OSV / outdated findings considered on dependency PRs. +- [ ] Invalid JSON / embedded input throws **`FormatException`** with **`ErrorMessages`** (or documented behavior); no silent failures. +- [ ] Strings use **`ErrorMessages`** in **`lib/src/constants/ErrorMessages.dart`** where the library already centralizes them. -**Severity:** Known critical vulnerability introduced = Blocker. +### Dependencies and security -### 4. Testing +- [ ] New or upgraded deps are justified; **`pubspec.lock`** updated intentionally. +- [ ] Consider **`.github/workflows/sca-scan.yml`** (OSV, **`dart pub outdated`**) on dependency PRs. -- [ ] **Coverage:** New behavior has tests under **`test/`** with **`test/mock/`** fixtures as appropriate. -- [ ] **Quality:** Tests are readable and offline-only (no flakiness). +### Testing -**Severity:** No tests for new behavior = Blocker. +- [ ] **`dart test`** passes; new behavior covered under **`test/`** with **`test/mock/`** where appropriate. +- [ ] No flaky or network-dependent tests. -### 5. Optional severity summary +### Severity (optional) -- **Blocker:** Must fix before merge (e.g. breaking API without approval, security issue, no tests for new code). -- **Major:** Should fix (e.g. inconsistent errors, missing docs). -- **Minor:** Nice to fix (e.g. style, minor comments). +- **Blocker:** Breaking public API without approval, security regression, no tests for new code. +- **Major:** Inconsistent errors, missing changelog for user-visible change. +- **Minor:** Style, small doc nits. ## References -- Project rule: `.cursor/rules/code-review.mdc` -- Testing skill: `skills/testing/SKILL.md` +- **`skills/testing/SKILL.md`** — test expectations +- **`skills/contentstack-utils/SKILL.md`** — public API surface +- **`AGENTS.md`** — lint/test commands diff --git a/skills/contentstack-utils/SKILL.md b/skills/contentstack-utils/SKILL.md index 6ed8ba2..dbf6f43 100644 --- a/skills/contentstack-utils/SKILL.md +++ b/skills/contentstack-utils/SKILL.md @@ -1,17 +1,15 @@ --- name: contentstack-utils -description: Use when implementing or changing Utils, GQL, Option, RTE/embedded JSON, and ErrorMessages – alignment with package:contentstack +description: Use when implementing or changing Utils, GQL, Option, RTE/embedded JSON, and ErrorMessages — alignment with package:contentstack --- -# Contentstack Utils (Dart) – Implementation - -Use this skill when implementing or changing rich-text and embedded-item behavior in this package. +# Contentstack Utils API – Contentstack Utils (Dart) ## When to use -- Adding or modifying **`Utils`**, **`GQL`**, **`Option`**, **`Metadata`**, **`StyleType`**, or **`Automate`** behavior. -- Changing how **`FormatException`** or **`ErrorMessages`** are used for invalid JSON or embedded input. -- Updating imports or public surface consumed by **`package:contentstack`**. +- Adding or changing **`Utils`**, **`GQL`**, **`Option`**, **`Metadata`**, **`StyleType`**, or **`Automate`** behavior. +- Defining how **`FormatException`** and **`ErrorMessages`** apply to invalid JSON or embedded input. +- Ensuring imports remain stable for **`package:contentstack`** consumers. ## Instructions @@ -19,25 +17,26 @@ Use this skill when implementing or changing rich-text and embedded-item behavio - **Barrel:** `package:contentstack_utils/contentstack_utils.dart` — **`Utils`**, exported **`Metadata`**, **`StyleType`**. - **Option:** `package:contentstack_utils/src/model/Option.dart` — **`renderOption(Map, Metadata)`**, **`Option.entry(Map)`**. -- **GQL:** `package:contentstack_utils/src/GQL.dart` — **`GQL.jsonToHTML`**. Not re-exported from the barrel. +- **GQL:** `package:contentstack_utils/src/GQL.dart` — **`GQL.jsonToHTML`**. Not re-exported from the barrel; import explicitly. -### Behavior +### Boundaries -- **Delivery JSON only:** This package transforms fetched entry JSON (`_embedded_items`, RTE HTML). **No HTTP** — stack, API key, and delivery token belong in the [Contentstack Dart SDK](https://pub.dev/packages/contentstack). -- **Errors:** Throw **`FormatException`** with **`ErrorMessages`** where the codebase already does; keep messages maintainable via **`lib/src/constants/ErrorMessages.dart`**. -- **Parsing:** RTE HTML uses **`package:html`**; logging uses **`package:logger`** in helpers — stay consistent with **`lib/src/helper/Automate.dart`**. +- This package only transforms **fetched** entry JSON (`_embedded_items`, RTE HTML). **No HTTP** — stack credentials and delivery API calls belong in the [Contentstack Dart SDK](https://pub.dev/packages/contentstack). -### Official docs +### Public behavior -- Product: [Contentstack documentation](https://www.contentstack.com/docs). -- Package: [contentstack_utils on pub.dev](https://pub.dev/packages/contentstack_utils). +- **`Utils.render`**, **`Utils.renderContent`**, **`Utils.jsonToHTML`** — walk embedded items, resolve RTE paths, render via **`Option`**; invalid input throws **`FormatException`** with **`ErrorMessages`** text. +- **`GQL.jsonToHTML`** — GraphQL-shaped SRTE (`embedded_itemsConnection`, nested `json`). +- Centralize user-facing strings in **`lib/src/constants/ErrorMessages.dart`**. +- RTE parsing uses **`package:html`**; helpers may use **`package:logger`** — stay consistent with **`lib/src/helper/Automate.dart`**. -## Key files +### Versioning and docs -- **API:** `lib/contentstack_utils.dart`, `lib/src/GQL.dart`, `lib/src/model/Option.dart` -- **Helpers:** `lib/src/helper/Automate.dart`, `lib/src/model/NodeToHtml.dart` -- **Errors:** `lib/src/constants/ErrorMessages.dart` +- User-visible changes: update **`README.md`** and **`CHANGELOG.md`**; follow **`jsonToHTML`** naming in code (avoid README typos like `jsonToHtml`). ## References -- Project rules: `.cursor/rules/contentstack-utils.mdc`, `.cursor/rules/dart.mdc` +- **`skills/dart/SKILL.md`** — layout and imports +- **`skills/testing/SKILL.md`** — tests for API changes +- [Contentstack documentation](https://www.contentstack.com/docs) +- [contentstack_utils on pub.dev](https://pub.dev/packages/contentstack_utils) diff --git a/skills/dart/SKILL.md b/skills/dart/SKILL.md new file mode 100644 index 0000000..72b3c77 --- /dev/null +++ b/skills/dart/SKILL.md @@ -0,0 +1,45 @@ +--- +name: dart +description: Use when editing Dart sources — SDK constraints, lib layout, imports, analyzer, formatting, dependencies +--- + +# Dart – Contentstack Utils (Dart) + +## When to use + +- Editing any **`*.dart`** file under **`lib/`** or **`test/`**. +- Changing **`pubspec.yaml`** dependency lists (coordinate with **`skills/framework/SKILL.md`** for lockfile and CI impact). +- Fixing or discussing **`analysis_options.yaml`** behavior. + +## Instructions + +### Language and SDK + +- Honor **`environment.sdk`** in **`pubspec.yaml`** (`>=2.12.0 <4.0.0`). Do not require a newer SDK in code without updating the constraint deliberately. + +### Analyzer and formatting + +- Lints are driven by **`analysis_options.yaml`** (includes `package:pedantic/analysis_options.yaml` today — ensure the resolved package exists or fix the include with the team). +- Run **`dart format .`** before PRs. + +### Package layout and naming + +- **Barrel:** **`lib/contentstack_utils.dart`** +- **Implementation:** **`lib/src/`** — `helper/`, `model/`, `embedded/`, `constants/` +- **Files:** `PascalCase.dart` under **`lib/src/`**; **`test/*_test.dart`** use snake_case. + +### Imports + +- Prefer **`package:contentstack_utils/...`** in library code. +- Tests may import the barrel plus **`package:contentstack_utils/src/...`** (e.g. **`Automate.dart`**) to exercise internals — follow existing tests. + +### Dependencies + +- **Runtime:** `path`, `html`, `logger`, `lint` — keep the package lean; no new packages without review. +- **Typing:** JSON is often **`Map`** / dynamic; improve safety incrementally and match patterns in **`lib/src/helper/Automate.dart`** and **`lib/src/model/Option.dart`**. + +## References + +- **`skills/contentstack-utils/SKILL.md`** — public API behavior +- **`skills/framework/SKILL.md`** — lockfile, CI, analyzer policy changes +- **`AGENTS.md`** — command quick reference diff --git a/skills/dev-workflow/SKILL.md b/skills/dev-workflow/SKILL.md new file mode 100644 index 0000000..4491cc7 --- /dev/null +++ b/skills/dev-workflow/SKILL.md @@ -0,0 +1,53 @@ +--- +name: dev-workflow +description: Use when branching, running CI-related commands, opening PRs, or deciding on TDD for this package +--- + +# Development workflow – Contentstack Utils (Dart) + +## When to use + +- Choosing a base branch or understanding merge policy into **`master`**. +- Running build, test, analyze, or format before a PR. +- Publishing (maintainers) or interpreting GitHub Actions workflows. +- Deciding whether to write tests first (TDD). + +## Instructions + +### Branches + +- Use feature branches (e.g. `feat/...`, `fix/...`). +- **`.github/workflows/check-branch.yml`** blocks PRs into **`master`** unless the head branch is **`staging`**. Prefer PRs against **`staging`** per team policy. + +### Commands + +- **Dependencies:** `dart pub get` +- **Tests:** `dart test` +- **Analyze:** `dart analyze .` +- **Format:** `dart format .` + +Run **`dart analyze .`** and **`dart test`** before requesting review. There are **no** live-stack integration tests — only JSON fixtures under **`test/mock/`**. + +### Pull requests + +- Keep public API changes backward compatible or bump semver and update **`CHANGELOG.md`**. +- Dependency changes: consider **`.github/workflows/sca-scan.yml`** (OSV on **`pubspec.lock`**, **`dart pub outdated`**). + +### Security and compliance (CI) + +- **`.github/workflows/sca-scan.yml`** — dependency / OSV signals. +- **`.github/workflows/policy-scan.yml`** — **`SECURITY.md`** and **`LICENSE`** (public repos). + +### Publishing (maintainers) + +- **`.github/workflows/publish.yml`** — publish on tags matching `v*.*.*` via **`dart pub publish`** (after dry-run in workflow). + +### Optional TDD + +If the team uses TDD: RED–GREEN–REFACTOR; fixture shapes in **`test/mock/`** should mirror Delivery / GQL payloads. Details: **`skills/testing/SKILL.md`**. + +## References + +- **`skills/testing/SKILL.md`** — test layout and fixtures +- **`skills/code-review/SKILL.md`** — PR checklist +- **`AGENTS.md`** — commands quick reference diff --git a/skills/framework/SKILL.md b/skills/framework/SKILL.md index 7c3733f..8e170f8 100644 --- a/skills/framework/SKILL.md +++ b/skills/framework/SKILL.md @@ -1,47 +1,45 @@ --- name: framework -description: Use when touching pubspec/lockfile, analysis_options, CI security scans, or shared runtime deps (html, logger, path) +description: Use when touching pubspec/lockfile, analysis_options, CI security workflows, or shared runtime deps (html, logger, path) --- -# Framework – Contentstack Utils (Dart) - -Use this skill when changing project tooling, dependencies, or CI security configuration. This package has **no** HTTP client or retry layer (unlike full CDA SDKs); “framework” here means **Pub**, **analyzer/lint**, **CI**, and **shared libraries** used by `lib/`. +# Framework and tooling – Contentstack Utils (Dart) ## When to use - Bumping or adding dependencies in **`pubspec.yaml`** / **`pubspec.lock`**. -- Fixing or updating **`analysis_options.yaml`** (e.g. pedantic/lints includes). -- Changing **`.github/workflows/sca-scan.yml`** or other security-related CI. -- Refactoring use of **`package:html`**, **`package:logger`**, or **`package:path`** across helpers. +- Changing **`analysis_options.yaml`** or lint includes. +- Editing **`.github/workflows/sca-scan.yml`**, **`.github/workflows/publish.yml`**, or policy-related CI. +- Refactoring shared library usage (**`package:html`**, **`package:logger`**, **`package:path`**) across **`lib/`**. + +This package has **no** HTTP client, retries, or native modules — only Pub, analyzer, CI, and the runtime libraries listed in **`pubspec.yaml`**. ## Instructions ### Pub -- **Install:** `dart pub get`. +- **Install:** **`dart pub get`**. - **Lockfile:** Commit **`pubspec.lock`** for reproducible builds and OSV scanning. -- Before merging dep changes: run **`dart test`** and **`dart analyze .`**. +- Before merging dep changes: **`dart test`** and **`dart analyze .`**. ### Analysis and lint -- **`analysis_options.yaml`** must resolve included packages (e.g. pedantic/lints). Coordinate with the team before switching lint sets. -- **Runtime vs dev:** Keep **`dependencies`** minimal (`path`, `html`, `logger`, `lint`); **`dev_dependencies`** for `test`, `lints`. +- **`analysis_options.yaml`** must resolve included packages; align **`lint`** / **`lints`** with the team before large policy changes. +- **Runtime deps:** `path`, `html`, `logger`, `lint` — keep minimal. +- **Dev:** `test`, `lints`. ### CI security -- **`.github/workflows/sca-scan.yml`:** `dart pub outdated`, OSV scanner on **`pubspec.lock`**. Review output on dependency PRs. -- **`.github/workflows/policy-scan.yml`:** **`SECURITY.md`** and **`LICENSE`** for public repos. +- **`.github/workflows/sca-scan.yml`:** **`dart pub outdated`**, OSV on **`pubspec.lock`**. +- **`.github/workflows/policy-scan.yml`:** **`SECURITY.md`**, **`LICENSE`** (public repos). ### Publishing -- **`.github/workflows/publish.yml`:** Publishes on **`v*.*.*`** tags. Do not publish from broken analyzer or untested dependency states. - -## Key files - -- **`pubspec.yaml`**, **`pubspec.lock`**, **`analysis_options.yaml`** -- **`.github/workflows/sca-scan.yml`**, **`.github/workflows/publish.yml`** +- **`.github/workflows/publish.yml`:** tag pattern **`v*.*.*`**, **`dart pub publish`** after dry-run. ## References -- Project rules: `.cursor/rules/dart.mdc`, `.cursor/rules/code-review.mdc` -- CDA behavior (not deps): `skills/contentstack-utils/SKILL.md` +- **`skills/dart/SKILL.md`** — everyday Dart conventions +- **`skills/code-review/SKILL.md`** — dependency / security review +- **`skills/contentstack-utils/SKILL.md`** — API behavior (orthogonal to version bumps) +- **`AGENTS.md`** — workflow file pointers diff --git a/skills/testing/SKILL.md b/skills/testing/SKILL.md index 7ba7113..fd1af16 100644 --- a/skills/testing/SKILL.md +++ b/skills/testing/SKILL.md @@ -1,42 +1,41 @@ --- name: testing -description: Use when writing or refactoring tests – dart test, *_test.dart, test/mock fixtures, coverage, offline-only +description: Use when writing or refactoring tests — dart test, *_test.dart, test/mock fixtures, coverage, offline-only --- # Testing – Contentstack Utils (Dart) -Use this skill when adding or refactoring tests in this repository. - ## When to use -- Writing new tests or changing existing **`test/*_test.dart`** files. -- Adding or updating JSON under **`test/mock/`**. -- Adjusting coverage workflow or **`test/.test_coverage.dart`**. +- Adding or changing files under **`test/`**. +- Adding JSON fixtures or updating **`test/.test_coverage.dart`**. +- Generating or interpreting coverage output. ## Instructions ### Runner and layout -- **Command:** `dart test` from the repo root. +- **Command:** **`dart test`** from the repo root. - **Framework:** **`package:test`** (`dev_dependency` in **`pubspec.yaml`**). -- **Files:** `*_test.dart` in **`test/`** (e.g. `utils_test.dart`, `gql_test.dart`). +- **Files:** **`test/*_test.dart`** (e.g. `utils_test.dart`, `gql_test.dart`, `option_test.dart`). -### Fixtures +### Fixtures and credentials -- Store JSON under **`test/mock/`** (e.g. `embedded_items.json`, `graphqlmock/`, `supercharged/`). Load with **`dart:io`** **`File`** and **`dart:convert`** as in **`test/utils_test.dart`**. -- **No credentials:** Tests are offline only; no `.env` stack keys for this package. +- JSON lives under **`test/mock/`** (`embedded_items.json`, `graphqlmock/`, `supercharged/`, etc.). +- Load with **`dart:io`** **`File`** and **`dart:convert`** as existing tests do. +- **No API keys or network** — tests are offline and deterministic. ### Coverage -- Optional: `dart test --coverage=coverage`; align with **`coverage/`**, **`coverage_badge.svg`**, and any **`genhtml`** step your team uses. -- **`test/.test_coverage.dart`** — update if legacy aggregation is still required when adding suites. +- Optional: **`dart test --coverage=coverage`**; artifacts may include **`coverage/`**, **`coverage/lcov.info`**, **`coverage_badge.svg`**. +- **`test/.test_coverage.dart`** aggregates suites for legacy **`test_coverage`** workflows — update imports when adding suites if still used. -### Conventions +### What to assert -- Assert **`Utils`**, **`GQL`**, **`Option`**, and **`Automate`** behavior against realistic fixture shapes. -- Keep tests deterministic (no network). +- **`Utils`**, **`GQL`**, **`Option`**, **`Automate.isValidJson`**, and shapes that match Delivery / GQL payloads. ## References -- **`pubspec.yaml`** — `test` dev dependency -- Project rule: `.cursor/rules/testing.mdc` +- **`skills/contentstack-utils/SKILL.md`** — behavior under test +- **`skills/dev-workflow/SKILL.md`** — when to run tests in the workflow +- **`AGENTS.md`** — `dart test` quick reference From 39b50f36a6cbc8102d14046ca28a9d81ebcab59c Mon Sep 17 00:00:00 2001 From: reeshika-h Date: Thu, 9 Apr 2026 16:11:38 +0530 Subject: [PATCH 3/5] Update CHANGELOG and README to reflect deprecation of Contentstack Utils Dart package and provide migration guidance to Content Delivery API. --- CHANGELOG.md | 8 +++++++- DEPRECATION.md | 27 +++++++++++++++++++++++++++ README.md | 8 +++++++- 3 files changed, 41 insertions(+), 2 deletions(-) create mode 100644 DEPRECATION.md diff --git a/CHANGELOG.md b/CHANGELOG.md index 9f8c574..1b68236 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,10 @@ -# Changelog +# CHANGELOG + +### **APR-09-2026** + +#### Documentation + +- Add deprecation notice and migration guidance to the Content Delivery API. See [DEPRECATION.md](DEPRECATION.md). ## v1.1.1 diff --git a/DEPRECATION.md b/DEPRECATION.md new file mode 100644 index 0000000..a55d8b3 --- /dev/null +++ b/DEPRECATION.md @@ -0,0 +1,27 @@ +# Deprecation notice: Contentstack Dart Utils (pub.dev) + +This page is for **developers using the Contentstack Dart Utils** package published on **pub.dev** as [`contentstack_utils`](https://pub.dev/packages/contentstack_utils). + +## What this means for you + +**We are deprecating this package as the recommended path for new Dart and Flutter work.** If you are **starting a new project**, use our **[Content Delivery API (CDA)](https://www.contentstack.com/docs/developers/apis/content-delivery-api/)** and implement rich text / JSON RTE handling in your app using current product documentation. + +**If you already ship an app** that depends on `contentstack_utils`, you can **keep using it**. Your integration continues to work. Plan migration when it fits your release schedule—you do not have to change immediately. + +The **[Contentstack Dart SDK](https://github.com/contentstack/contentstack-dart)** is deprecated on the same timeline; see that repository’s **DEPRECATION.md**. + +## What to use for new projects + +| | Link | +|---|------| +| **Content Delivery API** | [Content Delivery API documentation](https://www.contentstack.com/docs/developers/apis/content-delivery-api/) | + +## Why we are making this change + +We are focusing investment on **direct API usage** and **documented integration patterns** for Dart and Flutter. This repository will remain in **maintenance**: we may address critical or security issues where we can, but **we do not plan new features** in this package. + +## Support for this package going forward + +This repository will stay in **maintenance** as described above. Feature work and new capabilities should be built against the **Content Delivery API** and your application code. + +If you need help choosing a migration path or timing, contact **[Contentstack support](https://www.contentstack.com/)** or your account team. diff --git a/README.md b/README.md index 68fb010..c0e15ef 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,10 @@ -# A Contentstack-Utils library for Dart developers +# ![Contentstack](https://www.contentstack.com/docs/static/images/contentstack.png) + +## Important: Dart Utils and pub.dev + +**We are deprecating** the **Contentstack Utils** Dart package on pub.dev as the supported path for **new** development. **New Dart or Flutter projects should use the [Content Delivery API](https://www.contentstack.com/docs/developers/apis/content-delivery-api/)** and your own handling for rich text / JSON RTE, following current documentation. + +**Already using this package?** You can keep shipping with your current dependencies and migrate when it makes sense for your app. More detail: **[DEPRECATION.md](DEPRECATION.md)**. ![Coverage](https://github.com/contentstack/contentstack-utils-dart/blob/master/coverage_badge.svg?sanitize=true) From 73b8fc3dec2300bd05218b3e236b34a954c24b1d Mon Sep 17 00:00:00 2001 From: naman-contentstack Date: Mon, 20 Apr 2026 14:55:30 +0530 Subject: [PATCH 4/5] chore: version bump --- pubspec.yaml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/pubspec.yaml b/pubspec.yaml index cca5f5f..583ad6e 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: contentstack_utils description: Utils package for Contentstack-dart -version: 1.1.1 +version: 1.1.2 homepage: https://www.contentstack.com environment: @@ -17,4 +17,3 @@ dev_dependencies: lints: ^2.0.0 test: ^1.24.0 # test_coverage: ^0.4.1 - \ No newline at end of file From b5626cb1010dae1d6da51e379da45893800bcf7c Mon Sep 17 00:00:00 2001 From: naman-contentstack Date: Mon, 20 Apr 2026 15:15:23 +0530 Subject: [PATCH 5/5] update: changelog --- CHANGELOG.md | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3a63753..e978e5f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,8 @@ #### Documentation +## 2.0.1 + - Add deprecation notice and migration guidance to the Content Delivery API. See [DEPRECATION.md](DEPRECATION.md). ## 2.0.0 @@ -12,7 +14,8 @@ - Improved error messages and publish workflow - Test fixes and mock data for supercharged/GQL tests - Improved error messages -___________________ + +--- ## v1.1.0 @@ -21,14 +24,16 @@ Implemented SRTE functions: :tada: - Utils.jsonToHtml() - GQL.jsonToHtml() -___________________ +--- ## v1.0.0 :tada: Initial release :tada: -___________________ + +--- ## v0.1.0 :construction: contentstack-utils beta :construction: -___________________ + +---