diff --git a/.cursor/rules/README.md b/.cursor/rules/README.md new file mode 100644 index 0000000..f5c1f87 --- /dev/null +++ b/.cursor/rules/README.md @@ -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. diff --git a/.github/workflows/issues-jira.yml b/.github/workflows/issues-jira.yml deleted file mode 100644 index 7bf0469..0000000 --- a/.github/workflows/issues-jira.yml +++ /dev/null @@ -1,31 +0,0 @@ -name: Create Jira Ticket for Github Issue - -on: - issues: - types: [opened] - -jobs: - issue-jira: - runs-on: ubuntu-latest - steps: - - - name: Login to Jira - uses: atlassian/gajira-login@master - env: - JIRA_BASE_URL: ${{ secrets.JIRA_BASE_URL }} - JIRA_USER_EMAIL: ${{ secrets.JIRA_USER_EMAIL }} - JIRA_API_TOKEN: ${{ secrets.JIRA_API_TOKEN }} - - - name: Create Jira Issue - id: create_jira - uses: atlassian/gajira-create@master - with: - project: ${{ secrets.JIRA_PROJECT }} - issuetype: ${{ secrets.JIRA_ISSUE_TYPE }} - summary: Github | Issue | ${{ github.event.repository.name }} | ${{ github.event.issue.title }} - description: | - *GitHub Issue:* ${{ github.event.issue.html_url }} - - *Description:* - ${{ github.event.issue.body }} - fields: "${{ secrets.ISSUES_JIRA_FIELDS }}" \ No newline at end of file diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml deleted file mode 100644 index 9ed98f5..0000000 --- a/.github/workflows/release.yml +++ /dev/null @@ -1,50 +0,0 @@ -name: Release - -on: - push: - branches: [master] - -jobs: - build: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: actions/setup-node@v4 - with: - node-version: "22.x" - - run: npm install - - - name: get-package-details - id: package - uses: codex-team/action-nodejs-package-info@v1.1 - - name: install npm packall - run: npm install npm-pack-all - - - run: node node_modules/.bin/npm-pack-all - - uses: Klemensas/action-autotag@stable - id: update_tag - with: - GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" - tag_prefix: "v" - - name: Create Release - if: steps.update_tag.outputs.tagname - uses: actions/create-release@v1 - id: create_release - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token - with: - tag_name: ${{ steps.update_tag.outputs.tagname }} - release_name: Release ${{ steps.update_tag.outputs.tagname }} - draft: false # Default value, but nice to set explicitly - prerelease: false # Default value, but nice to set explicitly - - name: Upload Release Asset - if: steps.update_tag.outputs.tagname - id: upload-release-asset - uses: actions/upload-release-asset@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing its ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps - asset_path: ./${{ steps.package.outputs.name }}-${{ steps.package.outputs.version }}.tgz - asset_name: ${{ steps.package.outputs.name }}-${{ steps.package.outputs.version }}.tgz - asset_content_type: application/tgz \ No newline at end of file diff --git a/.github/workflows/sca-scan.yml b/.github/workflows/sca-scan.yml index 2307d48..79b6557 100644 --- a/.github/workflows/sca-scan.yml +++ b/.github/workflows/sca-scan.yml @@ -5,6 +5,9 @@ on: jobs: security-sca: runs-on: ubuntu-latest + permissions: + contents: read + pull-requests: write steps: - uses: actions/checkout@master - name: Run Snyk to check for vulnerabilities diff --git a/AGENTS.md b/AGENTS.md new file mode 100644 index 0000000..294040a --- /dev/null +++ b/AGENTS.md @@ -0,0 +1,49 @@ +# Contentstack DataSync Boilerplate – 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-boilerplate](https://github.com/contentstack/datasync-boilerplate) | +| **Purpose:** | Skeleton app to run Contentstack DataSync: webhook listener, asset/content stores (filesystem or MongoDB), and `@contentstack/datasync-manager` wiring. | +| **Out of scope (if any):** | Not a published npm library; product behavior lives in Contentstack DataSync packages (`package.json` dependencies). | + +## Tech stack (at a glance) + +| Area | Details | +|------|---------| +| Language | JavaScript (CommonJS), Node.js **20+** | +| Build | npm; entry `index.js`; config under `config/` | +| Tests | No automated test runner or `test` script in this repo | +| Lint / coverage | ESLint (`.eslintrc.js`); no coverage tooling configured | +| Runtime | Long-running DataSync process; `NODE_ENV` selects `config/.js` when present | + +## Commands (quick reference) + +| Command type | Command | +|--------------|---------| +| Install | `npm install` | +| Run (clean + start) | `npm start` | +| Run without clean | `npm run continue` | +| Clean synced output | `npm run clean` | +| Lint | `npx eslint .` | + +**CI:** [`.github/workflows/sca-scan.yml`](.github/workflows/sca-scan.yml) (Snyk), [`.github/workflows/policy-scan.yml`](.github/workflows/policy-scan.yml), [`.github/workflows/codeql-analysis.yml`](.github/workflows/codeql-analysis.yml), [`.github/workflows/issues-jira.yml`](.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, CI touchpoints, npm scripts | +| DataSync app | [`skills/datasync-boilerplate/SKILL.md`](skills/datasync-boilerplate/SKILL.md) | Entry flow, config, DataSync modules | +| JavaScript / Node | [`skills/javascript-node/SKILL.md`](skills/javascript-node/SKILL.md) | Linting and code style for this repo | +| Testing | [`skills/testing/SKILL.md`](skills/testing/SKILL.md) | How verification works here (no test suite) | +| Code review | [`skills/code-review/SKILL.md`](skills/code-review/SKILL.md) | PR expectations | + +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. diff --git a/package-lock.json b/package-lock.json index 8cbef15..0aaf829 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,19 +1,19 @@ { "name": "datasync-boilerplate", - "version": "1.3.4", + "version": "1.3.6", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "datasync-boilerplate", - "version": "1.3.4", + "version": "1.3.6", "license": "MIT", "dependencies": { - "@contentstack/datasync-asset-store-filesystem": "^2.3.3", - "@contentstack/datasync-content-store-filesystem": "^2.1.10", - "@contentstack/datasync-content-store-mongodb": "^1.0.12", - "@contentstack/datasync-manager": "^2.4.0-beta.1", - "@contentstack/webhook-listener": "^1.1.2" + "@contentstack/datasync-asset-store-filesystem": "^2.3.6", + "@contentstack/datasync-content-store-filesystem": "^2.1.11", + "@contentstack/datasync-content-store-mongodb": "^1.0.13", + "@contentstack/datasync-manager": "^2.4.0-beta.6", + "@contentstack/webhook-listener": "^1.1.3" }, "devDependencies": { "eslint": "^8.57.1", @@ -27,36 +27,15 @@ "license": "MIT" }, "node_modules/@contentstack/datasync-asset-store-filesystem": { - "version": "2.3.3", - "resolved": "https://registry.npmjs.org/@contentstack/datasync-asset-store-filesystem/-/datasync-asset-store-filesystem-2.3.3.tgz", - "integrity": "sha512-n0mcbw06npAc3NLiA2PsPb9CTshnqHTu57QHPVynjj3ukHfWkhi6svog7HCwaH0H0UoeKzVfKTJUjsSxud8NRg==", + "version": "2.3.6", + "resolved": "https://registry.npmjs.org/@contentstack/datasync-asset-store-filesystem/-/datasync-asset-store-filesystem-2.3.6.tgz", + "integrity": "sha512-h6maXOiVa1uWG4dMLsGaVCdVi006hqCvx8YX2mxVj2iqRTI2mG3hinjSZrZIiNljWEN8G1FtOcoNIdoqsOAi0A==", "license": "MIT", "dependencies": { "debug": "^4.4.3", - "lodash": "^4.17.23", - "rimraf": "^6.1.2", - "undici": "^7.20.0" - } - }, - "node_modules/@contentstack/datasync-asset-store-filesystem/node_modules/balanced-match": { - "version": "4.0.4", - "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-4.0.4.tgz", - "integrity": "sha512-BLrgEcRTwX2o6gGxGOCNyMvGSp35YofuYzw9h1IMTRmKqttAZZVU67bdb9Pr2vUHA8+j3i2tJfjO6C6+4myGTA==", - "license": "MIT", - "engines": { - "node": "18 || 20 || >=22" - } - }, - "node_modules/@contentstack/datasync-asset-store-filesystem/node_modules/brace-expansion": { - "version": "5.0.4", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-5.0.4.tgz", - "integrity": "sha512-h+DEnpVvxmfVefa4jFbCf5HdH5YMDXRsmKflpf1pILZWRFlTbJpxeU55nJl4Smt5HQaGzg1o6RHFPJaOqnmBDg==", - "license": "MIT", - "dependencies": { - "balanced-match": "^4.0.2" - }, - "engines": { - "node": "18 || 20 || >=22" + "lodash": "^4.18.1", + "rimraf": "^6.1.3", + "undici": "^7.28.0" } }, "node_modules/@contentstack/datasync-asset-store-filesystem/node_modules/glob": { @@ -77,21 +56,21 @@ } }, "node_modules/@contentstack/datasync-asset-store-filesystem/node_modules/lru-cache": { - "version": "11.2.7", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-11.2.7.tgz", - "integrity": "sha512-aY/R+aEsRelme17KGQa/1ZSIpLpNYYrhcrepKTZgE+W3WM16YMCaPwOHLHsmopZHELU0Ojin1lPVxKR0MihncA==", + "version": "11.5.2", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-11.5.2.tgz", + "integrity": "sha512-4pfM1Ff0x50o0tQwb5ucw/RzNyD0/YJME6IVcStalZuMWxdt3sR3huStTtxz4PUmvZfRguvDejasvQ2kifR11g==", "license": "BlueOak-1.0.0", "engines": { "node": "20 || >=22" } }, "node_modules/@contentstack/datasync-asset-store-filesystem/node_modules/minimatch": { - "version": "10.2.4", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-10.2.4.tgz", - "integrity": "sha512-oRjTw/97aTBN0RHbYCdtF1MQfvusSIBQM0IZEgzl6426+8jSC0nF1a/GmnVLpfB9yyr6g6FTqWqiZVbxrtaCIg==", + "version": "10.2.6", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-10.2.6.tgz", + "integrity": "sha512-vpLQEs+VLCr1nU0BXS07maYoFwlDAH0gngQuuttxIwutDFEMHq2blX+8vpgxDdK3J1PwjCJiep77OitTZ4Ll1A==", "license": "BlueOak-1.0.0", "dependencies": { - "brace-expansion": "^5.0.2" + "brace-expansion": "^5.0.8" }, "engines": { "node": "18 || 20 || >=22" @@ -145,39 +124,18 @@ } }, "node_modules/@contentstack/datasync-content-store-filesystem": { - "version": "2.1.10", - "resolved": "https://registry.npmjs.org/@contentstack/datasync-content-store-filesystem/-/datasync-content-store-filesystem-2.1.10.tgz", - "integrity": "sha512-6rXS4A1F2TricDr/Ew5EeBiOJz52TW0borUaMp1pFJQ36F+u20oNk2Cqq/9NBYyhZPyCj3c0aBtb64c8hrukHQ==", + "version": "2.1.11", + "resolved": "https://registry.npmjs.org/@contentstack/datasync-content-store-filesystem/-/datasync-content-store-filesystem-2.1.11.tgz", + "integrity": "sha512-YDyEpfy0pl0W5BXhVW2zoKXSBKQbHS7dc6+Gvr3urh/PaLdFBSApWfg0JjRCus6pMaRctSFUuU7Gj9rWJ/rz/g==", "license": "MIT", "dependencies": { "debug": "^4.4.3", - "lodash": "^4.17.23", + "lodash": "^4.18.1", "mkdirp": "^3.0.1", "rimraf": "^6.1.3", "write-file-atomic": "^7.0.0" } }, - "node_modules/@contentstack/datasync-content-store-filesystem/node_modules/balanced-match": { - "version": "4.0.4", - "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-4.0.4.tgz", - "integrity": "sha512-BLrgEcRTwX2o6gGxGOCNyMvGSp35YofuYzw9h1IMTRmKqttAZZVU67bdb9Pr2vUHA8+j3i2tJfjO6C6+4myGTA==", - "license": "MIT", - "engines": { - "node": "18 || 20 || >=22" - } - }, - "node_modules/@contentstack/datasync-content-store-filesystem/node_modules/brace-expansion": { - "version": "5.0.4", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-5.0.4.tgz", - "integrity": "sha512-h+DEnpVvxmfVefa4jFbCf5HdH5YMDXRsmKflpf1pILZWRFlTbJpxeU55nJl4Smt5HQaGzg1o6RHFPJaOqnmBDg==", - "license": "MIT", - "dependencies": { - "balanced-match": "^4.0.2" - }, - "engines": { - "node": "18 || 20 || >=22" - } - }, "node_modules/@contentstack/datasync-content-store-filesystem/node_modules/glob": { "version": "13.0.6", "resolved": "https://registry.npmjs.org/glob/-/glob-13.0.6.tgz", @@ -196,21 +154,21 @@ } }, "node_modules/@contentstack/datasync-content-store-filesystem/node_modules/lru-cache": { - "version": "11.2.7", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-11.2.7.tgz", - "integrity": "sha512-aY/R+aEsRelme17KGQa/1ZSIpLpNYYrhcrepKTZgE+W3WM16YMCaPwOHLHsmopZHELU0Ojin1lPVxKR0MihncA==", + "version": "11.5.2", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-11.5.2.tgz", + "integrity": "sha512-4pfM1Ff0x50o0tQwb5ucw/RzNyD0/YJME6IVcStalZuMWxdt3sR3huStTtxz4PUmvZfRguvDejasvQ2kifR11g==", "license": "BlueOak-1.0.0", "engines": { "node": "20 || >=22" } }, "node_modules/@contentstack/datasync-content-store-filesystem/node_modules/minimatch": { - "version": "10.2.4", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-10.2.4.tgz", - "integrity": "sha512-oRjTw/97aTBN0RHbYCdtF1MQfvusSIBQM0IZEgzl6426+8jSC0nF1a/GmnVLpfB9yyr6g6FTqWqiZVbxrtaCIg==", + "version": "10.2.6", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-10.2.6.tgz", + "integrity": "sha512-vpLQEs+VLCr1nU0BXS07maYoFwlDAH0gngQuuttxIwutDFEMHq2blX+8vpgxDdK3J1PwjCJiep77OitTZ4Ll1A==", "license": "BlueOak-1.0.0", "dependencies": { - "brace-expansion": "^5.0.2" + "brace-expansion": "^5.0.8" }, "engines": { "node": "18 || 20 || >=22" @@ -264,13 +222,13 @@ } }, "node_modules/@contentstack/datasync-content-store-mongodb": { - "version": "1.0.12", - "resolved": "https://registry.npmjs.org/@contentstack/datasync-content-store-mongodb/-/datasync-content-store-mongodb-1.0.12.tgz", - "integrity": "sha512-fDHjpEQ5nAOwWLrtlVmabPqpLDsphyusK+Geqdl1gmEKnqJ+n3P9skAdvNCOUEoOgSb78VPj8bVYBl6+UsEK4Q==", + "version": "1.0.13", + "resolved": "https://registry.npmjs.org/@contentstack/datasync-content-store-mongodb/-/datasync-content-store-mongodb-1.0.13.tgz", + "integrity": "sha512-+iN69F++kJVgik4PO4S9Nfn1t3PaId9rvX3UxvJzJzEWy7yyjhSvcxpl0Lol57GRGAL6LQiDKMmXtNYxvH1/FQ==", "license": "MIT", "dependencies": { "debug": "^4.4.3", - "lodash": "^4.17.23", + "lodash": "^4.18.1", "mongodb": "^6.21.0" }, "engines": { @@ -278,51 +236,38 @@ } }, "node_modules/@contentstack/datasync-manager": { - "version": "2.4.0-beta.1", - "resolved": "https://registry.npmjs.org/@contentstack/datasync-manager/-/datasync-manager-2.4.0-beta.1.tgz", - "integrity": "sha512-EejmtL/gzJcu/zeCzAJS6KtlF82Z8ZZS3r9+8qh/2VnUUyouUp12cyDo+0Dju35cu2we049tDqhjKIVs8y1/nw==", + "version": "2.4.0-beta.6", + "resolved": "https://registry.npmjs.org/@contentstack/datasync-manager/-/datasync-manager-2.4.0-beta.6.tgz", + "integrity": "sha512-C0tDQhrpe/756Ru3M7jKaOZaGlhwkIlAbH+fIdLsfpYT7JwwjCTBSkwXxAu8K9iscZVrqmQP4vlkaac1ZTLC5g==", "license": "MIT", "dependencies": { - "@braintree/sanitize-url": "^7.1.1", - "debug": "^4.4.1", + "@braintree/sanitize-url": "^7.1.2", + "debug": "^4.4.3", "dns-socket": "^4.2.2", - "lodash": "^4.17.21", - "marked": "^17.0.1", - "write-file-atomic": "7.0.0" + "lodash": "^4.18.1", + "marked": "^17.0.6", + "write-file-atomic": "7.0.1" }, "engines": { "node": ">=8" } }, - "node_modules/@contentstack/datasync-manager/node_modules/write-file-atomic": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-7.0.0.tgz", - "integrity": "sha512-YnlPC6JqnZl6aO4uRc+dx5PHguiR9S6WeoLtpxNT9wIG+BDya7ZNE1q7KOjVgaA73hKhKLpVPgJ5QA9THQ5BRg==", - "license": "ISC", - "dependencies": { - "imurmurhash": "^0.1.4", - "signal-exit": "^4.0.1" - }, - "engines": { - "node": "^20.17.0 || >=22.9.0" - } - }, "node_modules/@contentstack/webhook-listener": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/@contentstack/webhook-listener/-/webhook-listener-1.1.2.tgz", - "integrity": "sha512-LRKO1iBNz4Ar8wiz2zu+4mfHQvIF8wbrrvDsb69LdDUEvQ6LSUETOsi9CHXM7NcFsza+qIvU0nYW5BjumFCmUg==", + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/@contentstack/webhook-listener/-/webhook-listener-1.1.3.tgz", + "integrity": "sha512-Q0ufVqn6WbmJro0ngAr1wBAjdFYzZMVH+jTmZkVh2wbEmOUci5C6efHWDcg2dlj8gUmwoI5F6OXY3EJ11kCAxw==", "license": "MIT", "dependencies": { "basic-auth": "^2.0.1", "body-parser": "^2.2.2", "debug": "^4.3.5", - "lodash": "4.17.23" + "lodash": "4.18.1" } }, "node_modules/@eslint-community/eslint-utils": { - "version": "4.9.1", - "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.9.1.tgz", - "integrity": "sha512-phrYmNiYppR7znFEdqgfWHXR6NCkZEK7hwWDHZUjit/2/U0r6XvkDl0SYnoM51Hq7FhCGdLDT6zxCCOY1hexsQ==", + "version": "4.10.1", + "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.10.1.tgz", + "integrity": "sha512-cuadcxVFE8sDK6iWJbs8Sn0av2Nrh2QSGQhVlBW9AaAHqHwjWsZHT8LJ4hFGPh7ASBV2deFdM7H/DPjulmh8rg==", "dev": true, "license": "MIT", "dependencies": { @@ -427,9 +372,9 @@ "license": "MIT" }, "node_modules/@mongodb-js/saslprep": { - "version": "1.4.6", - "resolved": "https://registry.npmjs.org/@mongodb-js/saslprep/-/saslprep-1.4.6.tgz", - "integrity": "sha512-y+x3H1xBZd38n10NZF/rEBlvDOOMQ6LKUTHqr8R9VkJ+mmQOYtJFxIlkkK8fZrtOiL6VixbOBWMbZGBdal3Z1g==", + "version": "1.4.13", + "resolved": "https://registry.npmjs.org/@mongodb-js/saslprep/-/saslprep-1.4.13.tgz", + "integrity": "sha512-E3Sv4eCYAlKYUTx8S3ioQcDUscOif+8zZ5OnW1IzJ+Tt+EO+ke8mn+Y3FX6N1H79picwbdOavVOb1jPi2EOyrg==", "license": "MIT", "dependencies": { "sparse-bitfield": "^3.0.3" @@ -489,16 +434,16 @@ } }, "node_modules/@ungap/structured-clone": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/@ungap/structured-clone/-/structured-clone-1.3.0.tgz", - "integrity": "sha512-WmoN8qaIAo7WTYWbAZuG8PYEhn5fkz7dZrqTBZ7dtt//lL2Gwms1IcnQ5yHqjDfX8Ft5j4YzDM23f87zBfDe9g==", + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/@ungap/structured-clone/-/structured-clone-1.3.3.tgz", + "integrity": "sha512-60YRaenCQcVjYEKOcG824+DRGGIQ3VKErcBoAEDJZz5bKIs2ZG+X/H9Nk+Q6EVkwJk5QNApxbrc5QtBSwtrXAg==", "dev": true, "license": "ISC" }, "node_modules/acorn": { - "version": "8.16.0", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.16.0.tgz", - "integrity": "sha512-UVJyE9MttOsBQIDKw1skb9nAwQuR5wuGD3+82K6JgJlm/Y+KI92oNsMNGZCYdDsVtRHSak0pcV5Dno5+4jh9sw==", + "version": "8.18.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.18.0.tgz", + "integrity": "sha512-lGq+9yr1/GuAWaVYIHRjvvySG5/4VfKIvC8EWxStPdcDh/Ka7FG3twP6v4d5BkravUilhIAsG4Qj83t02LWUPQ==", "dev": true, "license": "MIT", "bin": { @@ -519,9 +464,9 @@ } }, "node_modules/ajv": { - "version": "6.14.0", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.14.0.tgz", - "integrity": "sha512-IWrosm/yrn43eiKqkfkHis7QioDleaXQHdDVPKg0FSwwd/DuvyX79TZnFOnYpB7dcsFAMmtFztZuXPDvSePkFw==", + "version": "6.15.0", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.15.0.tgz", + "integrity": "sha512-fgFx7Hfoq60ytK2c7DhnF8jIvzYgOMxfugjLOSMHjLIPgenqa7S7oaagATUq99mV6IYvN2tRmC0wnTYX6iPbMw==", "dev": true, "license": "MIT", "dependencies": { @@ -569,11 +514,13 @@ "license": "Python-2.0" }, "node_modules/balanced-match": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", - "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", - "dev": true, - "license": "MIT" + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-4.0.4.tgz", + "integrity": "sha512-BLrgEcRTwX2o6gGxGOCNyMvGSp35YofuYzw9h1IMTRmKqttAZZVU67bdb9Pr2vUHA8+j3i2tJfjO6C6+4myGTA==", + "license": "MIT", + "engines": { + "node": "18 || 20 || >=22" + } }, "node_modules/basic-auth": { "version": "2.0.1", @@ -588,20 +535,20 @@ } }, "node_modules/body-parser": { - "version": "2.2.2", - "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-2.2.2.tgz", - "integrity": "sha512-oP5VkATKlNwcgvxi0vM0p/D3n2C3EReYVX+DNYs5TjZFn/oQt2j+4sVJtSMr18pdRr8wjTcBl6LoV+FUwzPmNA==", + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-2.3.0.tgz", + "integrity": "sha512-2cGmJupaNgg+QUwVLAucDuWuoMZ6EX9iHDRswZ5lsNYEmwPaRknMPCLZz07yTzVq/83p4o/wzbDZbBrTvGGTIw==", "license": "MIT", "dependencies": { "bytes": "^3.1.2", - "content-type": "^1.0.5", + "content-type": "^2.0.0", "debug": "^4.4.3", - "http-errors": "^2.0.0", - "iconv-lite": "^0.7.0", + "http-errors": "^2.0.1", + "iconv-lite": "^0.7.2", "on-finished": "^2.4.1", - "qs": "^6.14.1", - "raw-body": "^3.0.1", - "type-is": "^2.0.1" + "qs": "^6.15.2", + "raw-body": "^3.0.2", + "type-is": "^2.1.0" }, "engines": { "node": ">=18" @@ -612,14 +559,15 @@ } }, "node_modules/brace-expansion": { - "version": "1.1.12", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.12.tgz", - "integrity": "sha512-9T9UjW3r0UW5c1Q7GTwllptXwhvYmEzFhzMfZ9H7FQWt+uZePjZPjBP/W1ZEyZ1twGWom5/56TF4lPcqjnDHcg==", - "dev": true, + "version": "5.0.8", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-5.0.8.tgz", + "integrity": "sha512-JZyDyq3D4AUifKTPOB7DELf6XsB3WdPuNxCtob1vFXPsSXhdAiHBWJ/tJ8HAc9aH84BK+5JFZLNkJKx3G9kzQg==", "license": "MIT", "dependencies": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" + "balanced-match": "^4.0.2" + }, + "engines": { + "node": "20 || >=22" } }, "node_modules/bson": { @@ -716,20 +664,17 @@ "dev": true, "license": "MIT" }, - "node_modules/concat-map": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", - "dev": true, - "license": "MIT" - }, "node_modules/content-type": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.5.tgz", - "integrity": "sha512-nTjqfcBFEipKdXCv4YDQWCfmcLZKm81ldF0pAopTvyrFGVbcR6P/VAAd5G7N+0tTr8QqiU0tFadD6FK4NtJwOA==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/content-type/-/content-type-2.0.0.tgz", + "integrity": "sha512-j/O/d7GcZCyNl7/hwZAb606rzqkyvaDctLmckbxLzHvFBzTJHuGEdodATcP3yIRoDrLHkIATJuvzbFlp/ki2cQ==", "license": "MIT", "engines": { - "node": ">= 0.6" + "node": ">=18" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" } }, "node_modules/cross-spawn": { @@ -856,9 +801,9 @@ } }, "node_modules/es-object-atoms": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/es-object-atoms/-/es-object-atoms-1.1.1.tgz", - "integrity": "sha512-FGgH2h8zKNim9ljj7dankFPcICIK9Cp5bm+c2gQSYePhpaG5+esrLODihIorn+Pe6FGJzWhXQotPv73jTaldXA==", + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/es-object-atoms/-/es-object-atoms-1.1.2.tgz", + "integrity": "sha512-HWcBoN6NileqtSydK2FqHbS/LoDd2pqrnQHLyJzBj4kOp/ky2MWMN694xOfkK8/SnUsW2DH7EfyVlydKCsm1Zw==", "license": "MIT", "dependencies": { "es-errors": "^1.3.0" @@ -1147,9 +1092,9 @@ } }, "node_modules/flatted": { - "version": "3.4.2", - "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.4.2.tgz", - "integrity": "sha512-PjDse7RzhcPkIJwy5t7KPWQSZ9cAbzQXcafsetQoD7sOJRQlGikNbx7yZp2OotDnJyrDcbyRq3Ttb18iYOqkxA==", + "version": "3.4.3", + "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.4.3.tgz", + "integrity": "sha512-/zipXxyO6rGvuNGDiULY9MvEGSkb2gaG4GGH4ygMi0ZZzyMHdUZBmntJmx5x1G2VuPytCwGN4xsJP6cw+sK+vQ==", "dev": true, "license": "ISC" }, @@ -1239,16 +1184,6 @@ "node": ">=10.13.0" } }, - "node_modules/glob/node_modules/brace-expansion": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.2.tgz", - "integrity": "sha512-Jt0vHyM+jmUBqojB7E1NIYadt0vI0Qxjxd2TErW94wDz+E2LAm5vKMXXwg6ZZBTHPuUlDgQHKXvjGBdfcF1ZDQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "balanced-match": "^1.0.0" - } - }, "node_modules/glob/node_modules/minimatch": { "version": "8.0.7", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-8.0.7.tgz", @@ -1323,9 +1258,9 @@ } }, "node_modules/hasown": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz", - "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==", + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.4.tgz", + "integrity": "sha512-T2UbfbBEF32wiepXIsMlTW9+dDYC6wMh/t/vYA4tuOMKqWz/n3vr1NFSxQiyP+zk2mXsoMA/i/7qV6LKut1t1A==", "license": "MIT", "dependencies": { "function-bind": "^1.1.2" @@ -1355,9 +1290,9 @@ } }, "node_modules/iconv-lite": { - "version": "0.7.2", - "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.7.2.tgz", - "integrity": "sha512-im9DjEDQ55s9fL4EYzOAv0yMqmMBSZp6G0VvFyTMPKWxiSBHUj9NW/qqLmXUwXrrM7AvqSlTCfvqRb0cM8yYqw==", + "version": "0.7.3", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.7.3.tgz", + "integrity": "sha512-IKXpvIzjnC9XTAUbVBcMfGS0EPaIXtW6v+zr+RRp+hqULEpo0owZax6wyRwPOJbWbzjYspQwusTsfVr0ifh4uQ==", "license": "MIT", "dependencies": { "safer-buffer": ">= 2.1.2 < 3.0.0" @@ -1401,6 +1336,7 @@ "version": "0.1.4", "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", "integrity": "sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==", + "dev": true, "license": "MIT", "engines": { "node": ">=0.8.19" @@ -1465,10 +1401,20 @@ "license": "ISC" }, "node_modules/js-yaml": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.1.tgz", - "integrity": "sha512-qQKT4zQxXl8lLwBtHMWwaTcGfFOZviOJet3Oy/xmGk2gZH677CJM9EvtfdSkgWcATZhj/55JZ0rmy3myCT5lsA==", + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.3.0.tgz", + "integrity": "sha512-1td788aAnnZ5qs7V2QIRl1owjtYpbKt749Y3xauqQgwIIGF/xXWz1wMTEBx5O3LK3lXLVuqXPdPxj2BoFHaW9Q==", "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/puzrin" + }, + { + "type": "github", + "url": "https://github.com/sponsors/nodeca" + } + ], "license": "MIT", "dependencies": { "argparse": "^2.0.1" @@ -1539,9 +1485,9 @@ } }, "node_modules/lodash": { - "version": "4.17.23", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.23.tgz", - "integrity": "sha512-LgVTMpQtIopCi79SJeDiP0TfWi5CNEc/L/aRdTh3yIvmZXTnheWpKjSZhnvMl8iXbC1tFg9gdHHDMLoV7CnG+w==", + "version": "4.18.1", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.18.1.tgz", + "integrity": "sha512-dMInicTPVE8d1e5otfwmmjlxkZoUpiVLwyeTdUsi/Caj/gfzzblBcCE5sRHV/AsjuCmxWrte2TNGSYuCeCq+0Q==", "license": "MIT" }, "node_modules/lodash.merge": { @@ -1559,9 +1505,9 @@ "license": "ISC" }, "node_modules/marked": { - "version": "17.0.4", - "resolved": "https://registry.npmjs.org/marked/-/marked-17.0.4.tgz", - "integrity": "sha512-NOmVMM+KAokHMvjWmC5N/ZOvgmSWuqJB8FoYI019j4ogb/PeRMKoKIjReZ2w3376kkA8dSJIP8uD993Kxc0iRQ==", + "version": "17.0.6", + "resolved": "https://registry.npmjs.org/marked/-/marked-17.0.6.tgz", + "integrity": "sha512-gB0gkNafnonOw0obSTEGZTT86IuhILt2Wfx0mWH/1Au83kybTayroZ/V6nS25mN7u8ASy+5fMhgB3XPNrOZdmA==", "license": "MIT", "bin": { "marked": "bin/marked.js" @@ -1580,12 +1526,16 @@ } }, "node_modules/media-typer": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-1.1.0.tgz", - "integrity": "sha512-aisnrDP4GNe06UcKFnV5bfMNPBUw4jsLGaWwWfnH3v02GnBuXX2MCVn5RbrWo0j3pczUilYblq7fQ7Nw2t5XKw==", + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-1.1.1.tgz", + "integrity": "sha512-yz3xRaG20c6/BOzvYoDaGtPmGscs7YivItZEEqe6GbwNfHuxu9YNmvnEkMzKldAGY4/80pRcQRZSEnhquk9XuQ==", "license": "MIT", "engines": { "node": ">= 0.8" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" } }, "node_modules/memory-pager": { @@ -1906,12 +1856,13 @@ } }, "node_modules/qs": { - "version": "6.15.0", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.15.0.tgz", - "integrity": "sha512-mAZTtNCeetKMH+pSjrb76NAM8V9a05I9aBZOHztWy/UqcJdQYNsf59vrRKWnojAT9Y+GbIvoTBC++CPHqpDBhQ==", + "version": "6.15.3", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.15.3.tgz", + "integrity": "sha512-O9gl3zCl5h5blw1KGUzQKhA5oUXSl8rwUIM5o0S3nCXMliSvy5Dzx7/DJcI+SwgICv+IneSZwhBh1oSyEHA71A==", "license": "BSD-3-Clause", "dependencies": { - "side-channel": "^1.1.0" + "es-define-property": "^1.0.1", + "side-channel": "^1.1.1" }, "engines": { "node": ">=0.6" @@ -2062,14 +2013,14 @@ } }, "node_modules/side-channel": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.1.0.tgz", - "integrity": "sha512-ZX99e6tRweoUXqR+VBrslhda51Nh5MTQwou5tnUDgbtyM0dBgmhEDtWGP/xbKn6hqfPRHujUNwz5fy/wbbhnpw==", + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.1.1.tgz", + "integrity": "sha512-6x6dK6zJdpTzF4sQeNYxwtvBzf6Eg4GtlesS94HOvTudUeyK2WXAaIfmDgsyslYrRBeFIlsi54AYsFGUuhmvrQ==", "license": "MIT", "dependencies": { "es-errors": "^1.3.0", - "object-inspect": "^1.13.3", - "side-channel-list": "^1.0.0", + "object-inspect": "^1.13.4", + "side-channel-list": "^1.0.1", "side-channel-map": "^1.0.1", "side-channel-weakmap": "^1.0.2" }, @@ -2081,13 +2032,13 @@ } }, "node_modules/side-channel-list": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/side-channel-list/-/side-channel-list-1.0.0.tgz", - "integrity": "sha512-FCLHtRD/gnpCiCHEiJLOwdmFP+wzCmDEkc9y7NsYxeF4u7Btsn1ZuwgwJGxImImHicJArLP4R0yX4c2KCrMrTA==", + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/side-channel-list/-/side-channel-list-1.0.1.tgz", + "integrity": "sha512-mjn/0bi/oUURjc5Xl7IaWi/OJJJumuoJFQJfDDyO46+hBWsfaVM65TBHq2eoZBhzl9EchxOijpkbRC8SVBQU0w==", "license": "MIT", "dependencies": { "es-errors": "^1.3.0", - "object-inspect": "^1.13.3" + "object-inspect": "^1.13.4" }, "engines": { "node": ">= 0.4" @@ -2257,23 +2208,27 @@ } }, "node_modules/type-is": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/type-is/-/type-is-2.0.1.tgz", - "integrity": "sha512-OZs6gsjF4vMp32qrCbiVSkrFmXtG/AZhY3t0iAMrMBiAZyV9oALtXO8hsrHbMXF9x6L3grlFuwW2oAz7cav+Gw==", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/type-is/-/type-is-2.1.0.tgz", + "integrity": "sha512-faYHw0anBbc/kWF3zFTEnxSFOAGUX9GFbOBthvDdLsIlEoWOFOtS0zgCiQYwIskL9iGXZL3kAXD8OoZ4GmMATA==", "license": "MIT", "dependencies": { - "content-type": "^1.0.5", + "content-type": "^2.0.0", "media-typer": "^1.1.0", "mime-types": "^3.0.0" }, "engines": { - "node": ">= 0.6" + "node": ">= 18" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" } }, "node_modules/undici": { - "version": "7.24.5", - "resolved": "https://registry.npmjs.org/undici/-/undici-7.24.5.tgz", - "integrity": "sha512-3IWdCpjgxp15CbJnsi/Y9TCDE7HWVN19j1hmzVhoAkY/+CJx449tVxT5wZc1Gwg8J+P0LWvzlBzxYRnHJ+1i7Q==", + "version": "7.29.0", + "resolved": "https://registry.npmjs.org/undici/-/undici-7.29.0.tgz", + "integrity": "sha512-IDxfleLmmbSskfWSUATiN1nfn2rDuvnMOqb5CWR92iIfojA0Ud+ulOAAEQ57LPr9rWmsreUyf5lwyao+7GNNVw==", "license": "MIT", "engines": { "node": ">=20.18.1" diff --git a/package.json b/package.json index f823be9..feb4771 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "datasync-boilerplate", - "version": "1.3.4", + "version": "1.3.6", "description": "A boilerplate that has the code skeleton to help you get up and running with Contentstack DataSync.", "main": "index.js", "scripts": { @@ -9,11 +9,11 @@ "clean": "node clean.js" }, "dependencies": { - "@contentstack/datasync-asset-store-filesystem": "^2.3.3", - "@contentstack/datasync-content-store-filesystem": "^2.1.10", - "@contentstack/datasync-content-store-mongodb": "^1.0.12", - "@contentstack/datasync-manager": "^2.4.0-beta.1", - "@contentstack/webhook-listener": "^1.1.2" + "@contentstack/datasync-asset-store-filesystem": "^2.3.6", + "@contentstack/datasync-content-store-filesystem": "^2.1.11", + "@contentstack/datasync-content-store-mongodb": "^1.0.13", + "@contentstack/datasync-manager": "^2.4.0-beta.6", + "@contentstack/webhook-listener": "^1.1.3" }, "devDependencies": { "eslint": "^8.57.1", @@ -24,5 +24,9 @@ "url": "https://github.com/contentstack/datasync-boilerplate" }, "author": "Contentstack LLC ", - "license": "MIT" + "license": "MIT", + "overrides": { + "lodash": "4.18.1", + "brace-expansion": "5.0.8" + } } diff --git a/skills/README.md b/skills/README.md new file mode 100644 index 0000000..357c845 --- /dev/null +++ b/skills/README.md @@ -0,0 +1,13 @@ +# Skills – Contentstack DataSync Boilerplate + +Source of truth for detailed guidance. Read [`AGENTS.md`](../AGENTS.md) first, then open the skill that matches your task. + +| Skill folder | Use when | +|--------------|----------| +| [`dev-workflow`](dev-workflow/SKILL.md) | CI, npm scripts, or repo workflow | +| [`datasync-boilerplate`](datasync-boilerplate/SKILL.md) | `index.js`, `config/`, DataSync or Contentstack integration | +| [`javascript-node`](javascript-node/SKILL.md) | ESLint, formatting, or JS/Node conventions | +| [`testing`](testing/SKILL.md) | Verification, credentials, or adding tests | +| [`code-review`](code-review/SKILL.md) | Opening or reviewing a PR | + +Each folder contains `SKILL.md` with YAML frontmatter (`name`, `description`). diff --git a/skills/code-review/SKILL.md b/skills/code-review/SKILL.md new file mode 100644 index 0000000..653ea8e --- /dev/null +++ b/skills/code-review/SKILL.md @@ -0,0 +1,18 @@ +--- +name: code-review +description: Use when authoring or reviewing pull requests for this repository. +--- + +# Code review – Contentstack DataSync Boilerplate + +## When to use + +- Preparing a PR or reviewing someone else’s changes +- Ensuring security and operational expectations are met + +## Instructions + +- **Scope**: Keep changes focused; this repo is a thin composition layer over Contentstack DataSync packages—avoid unrelated refactors. +- **Quality**: Run `npx eslint .`; ensure config edits don’t encourage committing secrets; document user-visible behavior changes in the PR description. +- **CI**: PRs trigger Snyk, policy, CodeQL, and related workflows—fix or explain new findings. +- **Severity (optional)**: **Blocker** — broken startup, leaked credentials, unsafe defaults; **Major** — incorrect DataSync wiring or config contract; **Minor** — style, comments, non-user-facing cleanup. diff --git a/skills/datasync-boilerplate/SKILL.md b/skills/datasync-boilerplate/SKILL.md new file mode 100644 index 0000000..c618917 --- /dev/null +++ b/skills/datasync-boilerplate/SKILL.md @@ -0,0 +1,19 @@ +--- +name: datasync-boilerplate +description: Use for DataSync wiring—index.js, config, listener, asset/content stores, and Contentstack settings. +--- + +# DataSync boilerplate app – Contentstack DataSync Boilerplate + +## When to use + +- Editing startup, checkpoint, or plugin behavior +- Choosing or configuring content store, asset store, or listener modules +- Documenting or fixing integration with Contentstack delivery API / webhooks + +## Instructions + +- **Entry point**: `index.js` loads `config/all.js`, merges `config/.js` when that file exists (else `config/development.js`), optionally reads a checkpoint file for `sync_token`, then wires `datasyncManager` with listener, asset store, and content store from **module paths in config** (`listenerModule`, `assetStoreModule`, `contentStoreModule`). +- **Configuration**: Put stack credentials and module names in `config/`—see product docs in root [`README.md`](../../README.md) for `apiKey`, delivery token, `host`, and webhook setup (ngrok, `/notify`, publish actions). +- **Published packages**: Behavior is implemented in `@contentstack/datasync-manager`, `@contentstack/webhook-listener`, and the filesystem/MongoDB store packages listed in `package.json`; this repo only composes them. +- **Plugins**: Custom plugins live under `plugins/` per patterns already described in `config/all.js`. diff --git a/skills/dev-workflow/SKILL.md b/skills/dev-workflow/SKILL.md new file mode 100644 index 0000000..e29f7e6 --- /dev/null +++ b/skills/dev-workflow/SKILL.md @@ -0,0 +1,18 @@ +--- +name: dev-workflow +description: Use for npm scripts, GitHub Actions, branching, and day-to-day repo workflow. +--- + +# Dev workflow – Contentstack DataSync Boilerplate + +## When to use + +- Changing or documenting how the app is run or cleaned +- Touching CI or security scanning behavior +- Aligning with how PRs are validated in this repository + +## Instructions + +- **Scripts** (from `package.json`): `npm start` runs `clean` then `node index.js`; `npm run continue` runs `index.js` without cleaning; `npm run clean` runs `clean.js`. +- **CI** (`.github/workflows/`): SCA via Snyk on PRs; policy checks (e.g. `SECURITY.md`, license) for public repos; CodeQL on PRs; Jira integration for issues. No dedicated workflow runs `npm test` (there is no test script). +- **Dependencies**: Managed with npm; `overrides` in `package.json` pins `lodash` for supply-chain consistency—coordinate changes with security tooling expectations. diff --git a/skills/javascript-node/SKILL.md b/skills/javascript-node/SKILL.md new file mode 100644 index 0000000..dc35410 --- /dev/null +++ b/skills/javascript-node/SKILL.md @@ -0,0 +1,17 @@ +--- +name: javascript-node +description: Use for ESLint, formatting, and JavaScript/Node conventions in this repository. +--- + +# JavaScript / Node – Contentstack DataSync Boilerplate + +## When to use + +- Editing `.eslintrc.js` or fixing lint findings +- Keeping new files consistent with existing CommonJS style + +## Instructions + +- **Lint**: Run `npx eslint .` from the repo root (no `lint` npm script). Config is [`.eslintrc.js`](../../.eslintrc.js): `eslint:recommended` plus indent, linebreak, quotes, and `semi` rules—match ESLint output and the style of files you edit. +- **Modules**: Use CommonJS (`require` / `module.exports`) to match `index.js`, `config/`, and dependencies. +- **Environment**: Target Node; match `ecmaVersion` / parser options to `.eslintrc.js` when changing tooling. diff --git a/skills/testing/SKILL.md b/skills/testing/SKILL.md new file mode 100644 index 0000000..cebd328 --- /dev/null +++ b/skills/testing/SKILL.md @@ -0,0 +1,18 @@ +--- +name: testing +description: Use for verification strategy, secrets handling, and any future automated tests. +--- + +# Testing – Contentstack DataSync Boilerplate + +## When to use + +- Checking changes before merge without a dedicated test suite +- Deciding how to handle API tokens, webhooks, or local tunnels + +## Instructions + +- **Current state**: There is no `npm test` script or standard test directory. Rely on `npx eslint .`, manual runs (`npm start` / `npm run continue`) against non-production stacks, and CI security scans on PRs. +- **Secrets**: Never commit real `apiKey`, delivery tokens, or checkpoint files with live tokens. Use environment-appropriate `config/*.js` or secure injection per team practice. +- **Local integration**: Webhooks require a public URL (e.g. ngrok) and Contentstack webhook configuration—see root [`README.md`](../../README.md) prerequisites. +- **Adding tests**: If introducing a runner, add scripts to `package.json` and document them in [`AGENTS.md`](../../AGENTS.md) and [`dev-workflow/SKILL.md`](../dev-workflow/SKILL.md).