Skip to content
Draft
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
8 changes: 8 additions & 0 deletions .github/workflows/release-production-plugins.yml
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,14 @@ jobs:
package: ./packages/contentstack-branches/package.json
tag: latest

# Query Export
- name: Publishing query export (Production)
uses: JS-DevTools/npm-publish@v3
with:
token: ${{ secrets.NPM_TOKEN }}
package: ./packages/contentstack-query-export/package.json
tag: latest

- name: Create Production Release
id: create_release
env:
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/unit-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,3 +61,7 @@ jobs:
- name: Run tests for Contentstack Branches
working-directory: ./packages/contentstack-branches
run: npm run test:unit

- name: Run tests for Contentstack Query Export
working-directory: ./packages/contentstack-query-export
run: npm run test:unit
46 changes: 46 additions & 0 deletions .talismanrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
fileignoreconfig:
- filename: packages/contentstack-query-export/.env-example
checksum: 922c7aa9c788ab60b987de2b0a2aee6d90843c463a8bbc29201e4efe31081187
- filename: packages/contentstack-query-export/.eslintrc
checksum: b34756122b251dc2feedc7c7b98a7772d4d763bc468c8291be483ae2ac3471be
- filename: packages/contentstack-query-export/README.md
checksum: 9be27e9a5f027f2bbbbcc6d4c706b19071cf40f596ce3e778f33ea7579a52626
- filename: packages/contentstack-query-export/test/unit/common-helper.test.ts
checksum: c1d023d8c23e0400805448eb1466da5cb1fe891b6e838100fb12cbc7e1514a59
- filename: packages/contentstack-query-export/test/config.json
checksum: 792e177efa078e31aa05a5136807fd1fed4b6ea7a4cd44d69353edd8b96ff33f
- filename: packages/contentstack-query-export/src/utils/logger.ts
checksum: de6dd816bc534aaddf9adbe4e1db935f152d32eedaad5b76445f4affa836fcc9
- filename: packages/contentstack-query-export/src/utils/common-helper.ts
checksum: 924a9fbc57dd774a7957870d63366ffc16cd4242dbe684321b9b52a888cfa455
- filename: packages/contentstack-query-export/test/unit/content-type-helper.test.ts
checksum: 1b4b9724a1281032605b61f007f7a7da080731bd9e0e4b2c4bc00b212ff30242
- filename: packages/contentstack-query-export/src/commands/cm/stacks/export-query.ts
checksum: 874c30c717df26b8caae8f807b25b529f9704de9b93ef53d457a3a9575742cf4
- filename: packages/contentstack-query-export/skills/framework/SKILL.md
checksum: b45c4bc28025292c168053e95a3c570b9d67500e0ee5241553089bca6914bb3f
- filename: packages/contentstack-query-export/skills/code-review/SKILL.md
checksum: 1c1cb0b1ce20114b9e855278a63c098d87f9302f093b08eb7f05f667840b6166
- filename: packages/contentstack-query-export/src/types/index.ts
checksum: 686c5ed7fadb6620201dc3f1ed19c5ba94afd73ad165c33379b8b33dec81e519
- filename: packages/contentstack-query-export/src/utils/config-handler.ts
checksum: 2a17dfe46ff5e77bb585013719065db0b513b21d700eb54e6615e78a6811f885
- filename: packages/contentstack-query-export/src/utils/dependency-resolver.ts
checksum: 0c85da2a6fa43c8923c3659c45b02d8cf4cf43f6aae5e21e5b47955232dd5d78
- filename: packages/contentstack-query-export/test/unit/module-exporter.test.ts
checksum: e27fab52e65a8d5430d268f3562a823828e9e3dd9eb9569342f1cdb83eef9ea3
- filename: packages/contentstack-query-export/test/unit/query-parser-simple.test.ts
checksum: d187ad885a914b70406e343a92ad3ee1ca3c30207b0d8b040f36c6f287da3a6c
- filename: packages/contentstack-query-export/test/unit/dependency-resolver.test.ts
checksum: da6b003331ece39c106b61f0c660da678c7b2ca2f55cfbdd2a8f8a72c183573f
- filename: packages/contentstack-query-export/test/unit/config-handler.test.ts
checksum: a1077cb686431fea29de839762dbc16c951b6d61171f525e311e4a34182b0d08
- filename: packages/contentstack-query-export/test/unit/referenced-asset-handler.test.ts
checksum: 3d19ad04a0306be741f9acd3a2d164d19e2b3803efc0a50342b156e8686c8b0c
- filename: packages/contentstack-query-export/src/core/query-executor.ts
checksum: 266751e299cda2a15d5e4e551eca72bcd6f0d600a0416f95410560257fc8210f
- filename: packages/contentstack-query-export/test/unit/query-executor.test.ts
checksum: 86713d035ff35d13089e14e8ad84db4191ad8b4f85bb759282b75e3dc96966cb
- filename: pnpm-lock.yaml
checksum: 66cc4bd169899eb1641197c1a95f50910c34601b0a695c23f0c2e6d26f836651
version: '1.0'
1 change: 1 addition & 0 deletions packages/contentstack-query-export/.env-example
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ENVIRONMENT=NON_PROD
23 changes: 23 additions & 0 deletions packages/contentstack-query-export/.eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
node_modules
.todo
.env
.dccache
logs
contents
lerna-debug.log
.DS_Store
contentTest
build
_backup*
oclif.manifest.json
.vscode
.nyc_output
contentstack-cli-logs
packages/**/package-lock.json
.dccache
yarn.lock
contents-*
*.http
*.todo
talisman_output.log
snyk_output.log
55 changes: 55 additions & 0 deletions packages/contentstack-query-export/.eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
{
"env": {
"node": true
},
"parser": "@typescript-eslint/parser",
"parserOptions": {
"project": "tsconfig.json",
"sourceType": "module"
},
"extends": [
// "oclif",
"oclif-typescript",
"plugin:@typescript-eslint/recommended"
],
"rules": {
"@typescript-eslint/no-unused-vars": [
"error",
{
"args": "none"
}
],
"@typescript-eslint/prefer-namespace-keyword": "error",
"@typescript-eslint/quotes": [
"error",
"single",
{
"avoidEscape": true,
"allowTemplateLiterals": true
}
],
"semi": "off",
"@typescript-eslint/type-annotation-spacing": "error",
"@typescript-eslint/no-redeclare": "off",
"eqeqeq": [
"error",
"smart"
],
"id-match": "error",
"no-eval": "error",
"no-var": "error",
"quotes": "off",
"indent": "off",
"camelcase": "off",
"comma-dangle": "off",
"arrow-parens": "off",
"operator-linebreak": "off",
"object-curly-spacing": "off",
"node/no-missing-import": "off",
"padding-line-between-statements": "off",
"@typescript-eslint/ban-ts-ignore": "off",
"unicorn/no-abusive-eslint-disable": "off",
"unicorn/consistent-function-scoping": "off",
"@typescript-eslint/no-use-before-define": "off"
}
}
20 changes: 20 additions & 0 deletions packages/contentstack-query-export/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
*-debug.log
*-error.log
/.nyc_output
/dist
/lib
/tmp
/yarn.lock
node_modules
.DS_Store
coverage
./contents
.vscode/
/lib
.env
_backup_*
contents/
logs/
oclif.manifest.json
talisman_output.log
snyk_output.log
12 changes: 12 additions & 0 deletions packages/contentstack-query-export/.mocharc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"require": [
"test/helpers/init.js",
"ts-node/register",
"source-map-support/register"
],
"watch-extensions": [
"ts"
],
"recursive": true,
"timeout": 5000
}
5 changes: 5 additions & 0 deletions packages/contentstack-query-export/.nycrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"include": [
"lib/**/*.js"
]
}
1 change: 1 addition & 0 deletions packages/contentstack-query-export/.prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
**/README.md
7 changes: 7 additions & 0 deletions packages/contentstack-query-export/.prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"semi": true,
"trailingComma": "all",
"singleQuote": true,
"printWidth": 120,
"tabWidth": 2
}
14 changes: 14 additions & 0 deletions packages/contentstack-query-export/.talismanrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
fileignoreconfig:
- filename: package-lock.json
checksum: b4f6e41c55c3c7fa9d8b7ea903eb9bc85f27464306a428c97b7e96e86ffce5f7
- filename: skills/testing/SKILL.md
checksum: da9831797a5e6a4d2e6e846c3f6d2583d84008d2dfd454dd7effe2f897c43a7b
- filename: skills/framework/SKILL.md
checksum: 217cf9123bf9b62a4d9b0c891af8ba388173c601c782ed0fea432f6be7ef5e56
- filename: skills/contentstack-cli/SKILL.md
checksum: b42e3526fb902a31080824b776cc8e233646139ee0915d89c0925744d56d586f
- filename: skills/code-review/SKILL.md
checksum: 687efb830fb4a9fb2b2e6682db052771706ddd9b12dc9cec04943e3cade929b3
- filename: skills/dev-workflow/SKILL.md
checksum: 03434201e3aaaa9239aff2f97826d64ac4ca31467b77c07330ac4b608ee24939
version: '1.0'
45 changes: 45 additions & 0 deletions packages/contentstack-query-export/AGENTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# CLI export-query plugin – 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/cli-cm-export-query` ([repository](https://github.com/contentstack/cli)) |
| **Purpose:** | OCLIF plugin for **query-based** stack export (`cm:stacks:export-query` / short `EXPRTQRY`); implements `QueryExporter` and related export flow. |
| **Out of scope (if any):** | Other export/import plugins live in sibling packages; this repo is only the query-export plugin. |

## Tech stack (at a glance)

| Area | Details |
| --- | --- |
| **Language** | TypeScript **^4.9** (`tsconfig.json`); Node **>= 14** (`engines`) |
| **Build** | `tsc -b` → `lib/`; `prepack` runs compile + `oclif manifest` + `oclif readme`; copies `src/config` → `lib/` |
| **Tests** | Mocha + Chai + Sinon; **nyc** coverage; tests under `test/**/*.test.ts` (see [skills/testing/SKILL.md](skills/testing/SKILL.md)) |
| **Lint / coverage** | ESLint `src/**/*.ts`; nyc in `npm test` |
| **Other** | OCLIF v4, Husky |

## Commands (quick reference)

| Command type | Command |
| --- | --- |
| **Build** | `npm run build` |
| **Test** | `npm test` |
| **Lint** | `npm run lint` |

CI: [.github/workflows/unit-test.yml](.github/workflows/unit-test.yml); also `release.yml`, `sca-scan.yml`, `policy-scan.yml` under [.github/workflows/](.github/workflows/).

## Where the documentation lives: skills

| Skill | Path | What it covers |
| --- | --- | --- |
| Development workflow | [skills/dev-workflow/SKILL.md](skills/dev-workflow/SKILL.md) | CI, branches, Husky, PR expectations |
| Contentstack CLI | [skills/contentstack-cli/SKILL.md](skills/contentstack-cli/SKILL.md) | Commands, `QueryExporter`, APIs |
| Framework | [skills/framework/SKILL.md](skills/framework/SKILL.md) | Config, logging, errors, utilities |
| Testing | [skills/testing/SKILL.md](skills/testing/SKILL.md) | Mocha/Chai/Sinon, nyc, TDD |
| Code review | [skills/code-review/SKILL.md](skills/code-review/SKILL.md) | PR checklist |

## 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.
21 changes: 21 additions & 0 deletions packages/contentstack-query-export/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2026 Contentstack

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
Loading
Loading