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

Filter by extension

Filter by extension


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

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

This folder only points contributors to **`AGENTS.md`** so editor-specific config does not duplicate the canonical docs.
48 changes: 48 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# Contentstack DataSync Asset Store (AWS S3) – Agent guide

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

## What this repo is

| Field | Detail |
| --- | --- |
| **Name:** | [contentstack/datasync-asset-store-aws-s3](https://github.com/contentstack/datasync-asset-store-aws-s3) (npm: `contentstack-asset-store-aws-s3`; consumers often use `@contentstack/datasync-asset-store-aws-s3` per product docs) |
| **Purpose:** | TypeScript library that plugs into Contentstack DataSync to download assets from Contentstack and store them in Amazon S3 (publish/unpublish/delete flows). |
| **Out of scope (if any):** | Not a standalone HTTP server or full DataSync stack—use with [DataSync Manager](https://github.com/contentstack/datasync-manager), webhook listener, and a content store. No separate CLI beyond `example/`. |

## Tech stack (at a glance)

| Area | Details |
| --- | --- |
| Language | TypeScript (see `tsconfig.json`; `engines.node` >= 22) |
| Build | `npm run build-ts` — `tsc` outputs to `dist/`, declarations to `typings/` |
| Tests | Jest + ts-jest; tests under `test/**/*.ts` (`jest.config.js`) |
| Lint / coverage | TSLint (`tslint.json`, `npm run tslint`); Jest `--coverage` → `coverage/` (JSON + HTML) |
| Other | AWS SDK v2 (`aws-sdk`), `debug`, `lodash`; optional Husky pre-commit runs Talisman + Snyk (see `skills/dev-workflow/SKILL.md`) |

## Commands (quick reference)

| Command type | Command |
| --- | --- |
| Build | `npm run build-ts` |
| Test | `npm test` |
| Lint | `npm run tslint` |

CI / security: PR workflows under [`.github/workflows/`](.github/workflows/) — e.g. [SCA scan](.github/workflows/sca-scan.yml), [CodeQL](.github/workflows/codeql-analysis.yml), [policy scan](.github/workflows/policy-scan.yml), [Jira issues](.github/workflows/issues-jira.yml).

## Where the documentation lives: skills

| Skill | Path | What it covers |
| --- | --- | --- |
| Dev workflow | [`skills/dev-workflow/SKILL.md`](skills/dev-workflow/SKILL.md) | Branches, build/test/lint, Husky/Talisman/Snyk, CI pointers |
| Asset store API & DataSync | [`skills/datasync-asset-store-s3/SKILL.md`](skills/datasync-asset-store-s3/SKILL.md) | Public entry points, `S3` class, config, integration with DataSync Manager |
| TypeScript conventions | [`skills/typescript-style/SKILL.md`](skills/typescript-style/SKILL.md) | Layout, `tsconfig`, patterns matching this repo |
| Testing | [`skills/testing/SKILL.md`](skills/testing/SKILL.md) | Jest layout, mocks, coverage, credentials policy |
| Code review | [`skills/code-review/SKILL.md`](skills/code-review/SKILL.md) | PR checklist for this package |
| Framework & platform | [`skills/framework/SKILL.md`](skills/framework/SKILL.md) | AWS S3, `aws-sdk` v2, env/config boundaries |

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

## Using Cursor (optional)

If you use **Cursor**, [`.cursor/rules/README.md`](.cursor/rules/README.md) only points to **`AGENTS.md`**—same docs as everyone else.
104 changes: 52 additions & 52 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
{
"name": "contentstack-asset-store-aws-s3",
"author": "Contentstack Ecosystem",
"version": "0.0.4",
"version": "0.0.5",
"description": "Store asset files downloaded from Contentstack",
"main": "dist",
"dependencies": {
"aws-sdk": "^2.1693.0",
"debug": "^4.4.3",
"lodash": "^4.17.23"
"lodash": "4.18.1"
},
"devDependencies": {
"@types/aws-sdk": "^2.7.0",
"@types/debug": "0.0.31",
"@types/jest": "^23.3.11",
"@types/lodash": "4.14.119",
"@types/lodash": "4.17.24",
"@types/nock": "^9.3.0",
"@types/node": "10.12.12",
"@types/request": "^2.48.1",
Expand Down
16 changes: 16 additions & 0 deletions skills/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Skills – Contentstack DataSync Asset Store (AWS S3)

Source of truth for detailed guidance. Read [`AGENTS.md`](../AGENTS.md) first, then open the skill that matches your task.

## When to use which skill

| Skill folder | Use when |
| --- | --- |
| `dev-workflow` | Setting up the repo, running build/test/lint, Husky hooks, or understanding CI workflows |
| `datasync-asset-store-s3` | Changing or using the public API, S3 asset flows, or DataSync Manager integration |
| `typescript-style` | Editing TypeScript source, matching compiler and project layout conventions |
| `testing` | Adding or changing Jest tests, coverage, or test doubles |
| `code-review` | Preparing or reviewing a PR for this repository |
| `framework` | AWS S3 / `aws-sdk` usage, streaming uploads, or deployment-related assumptions |

Each folder contains `SKILL.md` with YAML frontmatter (`name`, `description`).
33 changes: 33 additions & 0 deletions skills/code-review/SKILL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
---
name: code-review
description: PR expectations and review checklist for the DataSync AWS S3 asset store TypeScript package.
---

# Code review – Contentstack DataSync Asset Store (AWS S3)

## When to use

- You are opening or reviewing a pull request that touches this repository
- You need a quick quality bar aligned with a small npm library and DataSync consumers

## Instructions

### Before approving

- **Build**: `npm run build-ts` succeeds; `dist/` / `typings/` changes are intentional if committed
- **Tests**: `npm test` passes; new behavior has tests or a clear reason if not testable
- **Lint**: `npm run tslint` passes for touched files
- **API contract**: changes to `start`, `setConfig`, or `S3` public methods are backward compatible or version/docs updated
- **Security**: no secrets in code; Talisman/Snyk expectations respected for teams using Husky hooks
- **Docs**: user-visible config or behavior changes reflected in root `README.md` when appropriate

### Severity (optional)

- **Blocker**: broken build, failing tests, secret leak, or breaking change without semver/docs
- **Major**: missing tests for non-trivial logic, unclear error handling for S3/network failures
- **Minor**: naming, comment updates, small refactors for readability

## References

- [`../datasync-asset-store-s3/SKILL.md`](../datasync-asset-store-s3/SKILL.md) — API surface
- [`../testing/SKILL.md`](../testing/SKILL.md) — test expectations
Loading
Loading