Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
c4b5b5c
Merge pull request #271 from contentstack/master
naman-contentstack Apr 13, 2026
fabef34
chore:Refactor documentation in AGENTS.md and remove redundant Cursor…
harshithad0703 Apr 14, 2026
69add46
Merge pull request #272 from contentstack/fix/dx-6041-update-cursor-r…
harshithad0703 Apr 14, 2026
6a703bf
fix: Modified github workflows for release and remove check-branch wo…
cs-raj Apr 28, 2026
7710df0
Fixed: the release createion based on the tag
cs-raj Apr 29, 2026
b5f65ea
fix: check-version bump triggered for all the PR
cs-raj Apr 30, 2026
b107131
ci: gate version-bump on src paths; validate semver vs latest tag only
cs-raj Apr 30, 2026
72673f2
Merge pull request #273 from contentstack/fix/DX-6182
cs-raj Apr 30, 2026
01a2f61
Merge development into back-merge/DX-20927
reeshika-h Sep 24, 2026
bbf734f
Merge pull request #282 from contentstack/back-merge/DX-20927
reeshika-h Sep 29, 2026
6ba0356
chore(release): publish to npm with trusted publishing
cs-raj Oct 1, 2026
16776d0
fix(ci): grant the coverage report checks and pull-request write
cs-raj Oct 1, 2026
e487930
chore(release): verify the tag matches package.json, tag github packages
cs-raj Oct 13, 2026
f78b6ef
docs: point release instructions at release.yml and trusted publishing
cs-raj Oct 13, 2026
2c2dcdd
fix: refresh lock file to resolve vulnerabilities
cs-raj Oct 14, 2026
2d2c96e
Add public access to npm publish command
cs-raj Oct 14, 2026
cec9e31
chore: back-merge master into development
cs-raj Oct 22, 2026
8c6c69c
Merge pull request #285 from contentstack/chore/back-merge-master-to-…
cs-raj Oct 22, 2026
53bd73b
Merge remote-tracking branch 'origin/development' into feat/DX-27614
cs-raj Oct 24, 2026
c04ca39
fix: regenerate lock file to resolve npm audit findings
cs-raj Oct 24, 2026
4bfc3f4
Merge pull request #283 from contentstack/feat/DX-27614
cs-raj Oct 29, 2026
aee97dd
ci: pass GitHub context to run steps via env vars to avoid script inj…
reeshika-h Nov 2, 2026
0d7297e
Merge pull request #289 from contentstack/fix/workflow-script-injection
reeshika-h Nov 2, 2026
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
27 changes: 3 additions & 24 deletions .cursor/rules/README.md
Original file line number Diff line number Diff line change
@@ -1,26 +1,5 @@
# Cursor rules — `@contentstack/utils`
# Cursor (optional)

This folder holds project-specific rules for AI assistants working in **contentstack-utils-javascript**. For the full project overview, see **[`AGENTS.md`](../../AGENTS.md)** at the repository root.
**Cursor** users: start at **[`AGENTS.md`](../../AGENTS.md)**. All conventions live in **`skills/*/SKILL.md`**.

## How rules are picked up

Each rule is a `.md`/`.mdc` file. Files with YAML frontmatter can set `description`, `globs`, and `alwaysApply`. Cursor uses these to decide when a rule is included in context.

### Referencing rules in chat

In Cursor, you can **`@`-mention** a rule file (e.g. type `@` and choose the rule from the list) to force its guidance into the conversation. The file name (without extension) is the usual handle, e.g. **`typescript`**, **`testing`**, **`code-review`**.

## Rule index

| File | `alwaysApply` | Globs | When it applies |
|------|----------------|-------|------------------|
| [`dev-workflow.md`](dev-workflow.md) | no | *(none)* | Branching, CI alignment, commits, releases, and day-to-day commands for this repo. |
| [`typescript.mdc`](typescript.mdc) | no | `src/**/*.ts`, `__test__/**/*.ts` | TypeScript version, layout, ESLint/Prettier, strictness, imports. |
| [`typescript-contentstack-utils.mdc`](typescript-contentstack-utils.mdc) | no | `src/**/*.ts` | Delivery-oriented utils only: RTE rendering, GQL helpers, endpoints JSON, Live Preview tags—**not** full CDA/CMA SDK surface. |
| [`testing.mdc`](testing.mdc) | no | `__test__/**/*.ts` | Jest, jsdom, mocks, coverage output paths, no live-test env. |
| [`code-review.mdc`](code-review.mdc) | **yes** | *(global)* | PR checklist: public API docs, compatibility, errors, dependencies, terminology (utils + delivery context). |

## Related

- **[`AGENTS.md`](../../AGENTS.md)** — Single entry point (package purpose, stack, commands).
- **[`skills/README.md`](../../skills/README.md)** — Longer-form skill docs for the same themes.
This folder only points contributors to **`AGENTS.md`** so editor-specific config does not duplicate the canonical docs.
41 changes: 0 additions & 41 deletions .cursor/rules/code-review.mdc

This file was deleted.

38 changes: 0 additions & 38 deletions .cursor/rules/dev-workflow.md

This file was deleted.

38 changes: 0 additions & 38 deletions .cursor/rules/testing.mdc

This file was deleted.

34 changes: 0 additions & 34 deletions .cursor/rules/typescript-contentstack-utils.mdc

This file was deleted.

34 changes: 0 additions & 34 deletions .cursor/rules/typescript.mdc

This file was deleted.

60 changes: 60 additions & 0 deletions .github/workflows/back-merge-pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
# Opens a PR from master → development after changes land on master (back-merge).
#
# Org/repo Settings → Actions → General → Workflow permissions: read and write
# (so GITHUB_TOKEN can create pull requests). Or use a PAT in secret GH_TOKEN.

name: Back-merge master to development

on:
push:
branches: [master]
workflow_dispatch:

permissions:
contents: read
pull-requests: write

jobs:
open-back-merge-pr:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Open back-merge PR if needed
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
REPO: ${{ github.repository }}
run: |
set -euo pipefail
git fetch origin development master

MASTER_SHA=$(git rev-parse origin/master)
DEV_SHA=$(git rev-parse origin/development)

if [ "$MASTER_SHA" = "$DEV_SHA" ]; then
echo "master and development are at the same commit; nothing to back-merge."
exit 0
fi

EXISTING=$(gh pr list --repo "$REPO" \
--base development \
--head master \
--state open \
--json number \
--jq 'length')

if [ "$EXISTING" -gt 0 ]; then
echo "An open PR from master to development already exists; skipping."
exit 0
fi

gh pr create --repo "$REPO" \
--base development \
--head master \
--title "chore: back-merge master into development" \
--body "Automated back-merge after changes landed on \`master\`. Review and merge to keep \`development\` in sync."

echo "Created back-merge PR master → development."
20 changes: 0 additions & 20 deletions .github/workflows/check-branch.yml

This file was deleted.

77 changes: 77 additions & 0 deletions .github/workflows/check-version-bump.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
# Runs only when production code under src/ changes. Version must be > latest v* tag (not vs base branch).

name: Check Version Bump

on:
pull_request:

jobs:
check-version-bump:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Validate version and changelog updates
shell: bash
env:
BASE_SHA: ${{ github.event.pull_request.base.sha }}
HEAD_SHA: ${{ github.event.pull_request.head.sha }}
run: |
set -euo pipefail

VERSION_FILE="package.json"
CHANGELOG_FILE="CHANGELOG.md"

mapfile -t CHANGED_FILES < <(git diff --name-only "$BASE_SHA" "$HEAD_SHA")
if [ "${#CHANGED_FILES[@]}" -eq 0 ]; then
echo "No changed files detected."
exit 0
fi

is_production_source_change() {
local f="$1"
[[ "$f" == src/* ]]
}

has_source_changes=false
for file in "${CHANGED_FILES[@]}"; do
if is_production_source_change "$file"; then
has_source_changes=true
break
fi
done

if [ "$has_source_changes" = false ]; then
echo "Skipping: no src/ production code changes."
exit 0
fi

changed_file() {
local target="$1"
for file in "${CHANGED_FILES[@]}"; do
if [ "$file" = "$target" ]; then
return 0
fi
done
return 1
}

changed_file "$VERSION_FILE" || { echo "Version bump required in $VERSION_FILE."; exit 1; }
changed_file "$CHANGELOG_FILE" || { echo "Matching changelog update required in $CHANGELOG_FILE."; exit 1; }

head_version=$(node -e "console.log(require('./package.json').version)")
CHANGELOG_HEAD=$(sed -nE 's/^## v?([^[:space:]]+).*/\1/p' "$CHANGELOG_FILE" | head -1)

[ -n "$CHANGELOG_HEAD" ] || { echo "::error::Could not find a top changelog heading like '## vX.Y.Z' in $CHANGELOG_FILE."; exit 1; }
[ "$CHANGELOG_HEAD" = "$head_version" ] || { echo "::error::$CHANGELOG_FILE top version ($CHANGELOG_HEAD) does not match project version ($head_version)."; exit 1; }

latest_tag=$(git tag --list 'v*' --sort=-version:refname | sed -n '1p')
latest_version="${latest_tag#v}"
[ -n "$latest_version" ] || latest_version="0.0.0"

version_gt() {
python3 -c 'import sys;v=lambda s:[int(x) if x.isdigit() else 0 for x in (s.strip().lstrip("v").split("-",1)[0].split("+",1)[0].split(".")+["0","0","0"])[:3]];print("true" if v(sys.argv[1])>v(sys.argv[2]) else "false")' "$1" "$2"
}

[ "$(version_gt "$head_version" "$latest_version")" = "true" ] || { echo "Version must be greater than latest tag version ($latest_version). Found $head_version."; exit 1; }
Loading
Loading