Skip to content

Commit 2535ee5

Browse files
committed
feat(DX-7525): migrate contentstack-cli-content-type v1 into cli-plugins monorepo
1 parent 137f9ae commit 2535ee5

66 files changed

Lines changed: 6258 additions & 12 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.cursor/rules/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ This is a **CLI plugins** monorepo with plugin packages under `packages/`, inclu
5151
- `contentstack-seed` - Seed stacks with generated data
5252
- `contentstack-variants` - Manage content variants
5353
- `contentstack-apps-cli` - Developer Hub apps (`app:*` commands; npm `@contentstack/apps-cli`)
54+
- `contentstack-content-type` - Content Type introspection (`content-type:*` commands; npm `contentstack-cli-content-type`; Jest tests)
5455

5556
All plugins depend on:
5657
- `@contentstack/cli-command` - Base Command class

.github/config/release.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
"launch": false,
2121
"branches": false,
2222
"apps-cli": false,
23+
"content-type": false,
2324
"core": false
2425
}
2526
}

.github/workflows/release-production-plugins.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,14 @@ jobs:
143143
package: ./packages/contentstack-query-export/package.json
144144
tag: latest
145145

146+
# Content Type
147+
- name: Publishing content-type (Production)
148+
uses: JS-DevTools/npm-publish@v3
149+
with:
150+
token: ${{ secrets.NPM_TOKEN }}
151+
package: ./packages/contentstack-content-type/package.json
152+
tag: latest
153+
146154
- name: Create Production Release
147155
id: create_release
148156
env:

.github/workflows/unit-test.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,3 +69,7 @@ jobs:
6969
- name: Run tests for Contentstack Apps CLI
7070
working-directory: ./packages/contentstack-apps-cli
7171
run: npm run test:unit:report:json
72+
73+
- name: Run tests for Contentstack Content Type plugin
74+
working-directory: ./packages/contentstack-content-type
75+
run: npm run test:unit

.talismanrc

Lines changed: 39 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,42 @@
11
fileignoreconfig:
22
- filename: pnpm-lock.yaml
3-
checksum: 89acb731dc98c886694fa4d267c11c188000b8ecbe5ee6e4809e5bc6ec33a2f3
3+
checksum: b37c8a782a95412347394c79010601d99265163a590ad5dd15bee765142a3750
4+
- filename: packages/contentstack-content-type/.eslintrc
5+
checksum: 6a5fa2bef65bf5a62598c10d45d83dfdef2dc32675aca5827ef31c230fa29c97
6+
- filename: packages/contentstack-content-type/src/commands/content-type/list.ts
7+
checksum: a584f002cf6c8b124d832339b646dac492a9e2e9607c8b570f7e0df666bf5991
8+
- filename: packages/contentstack-content-type/README.md
9+
checksum: cfb10c8dd1848df7a4a47cf7eb8fa57a81b97994394a289a93c41a930f4b2a38
10+
- filename: packages/contentstack-content-type/src/utils/index.ts
11+
checksum: 3209ee03042b33b491443bd2aabd273125eb1808607c9ef0b231323f2616092e
12+
- filename: packages/contentstack-content-type/skills/code-review/SKILL.md
13+
checksum: e784c95e1efba37e79acc5d6187d26f25bea9228f9c28bbcac0dd9285c70381f
14+
- filename: packages/contentstack-content-type/tests/commands/content-type/compare-remote.test.ts
15+
checksum: 68beeddf34261799b38259925e8d9b5d2426bd827864ff1e5b5cdf3356fdfe5a
16+
- filename: packages/contentstack-content-type/src/core/command.ts
17+
checksum: ee30e78b945495baa9d064c96feee454ec73607420b8a3b1da2ecc3be4c9a85d
18+
- filename: packages/contentstack-content-type/skills/contentstack-cli-content-type/SKILL.md
19+
checksum: f52be931ec23638c76b44652921c4b45dbca9edf558f05bf465f33bcadf20790
20+
- filename: packages/contentstack-content-type/skills/testing/SKILL.md
21+
checksum: 1da781909a238a7e96dea43ed74ca97cd405e10d6a95dd2042a5280a7a9172f8
22+
- filename: packages/contentstack-content-type/src/commands/content-type/audit.ts
23+
checksum: 2b38703b8452222024188118c65e1a5beb792072cd5f4eb6deda12133fd4dfd2
24+
- filename: packages/contentstack-content-type/src/commands/content-type/compare-remote.ts
25+
checksum: 91f2a8cba4703a480086e6a257e4c96ac0c3d7fda5c5531e8ea0cb56be8b18e7
26+
- filename: packages/contentstack-content-type/src/commands/content-type/compare.ts
27+
checksum: 91f8eb42a2f8c4f3845940418ecdc07f11cbc62e732cfc0042b092d9cc3a8b03
28+
- filename: packages/contentstack-content-type/src/commands/content-type/details.ts
29+
checksum: 4fa7adeee4a82a8ab1b8206fa5c020babf3bb5341db351bc86069624028f911d
30+
- filename: packages/contentstack-content-type/src/commands/content-type/diagram.ts
31+
checksum: e6a2a5349421976e343c1cf149011e79e2bd319e61630e6d9f9edacb1e5b6be5
32+
- filename: packages/contentstack-content-type/tests/commands/content-type/list.test.ts
33+
checksum: 728221e17384a6940d0e8e38f3111522927b49e415daba9fafe13dc3507e8406
34+
- filename: packages/contentstack-content-type/tests/core/command.test.ts
35+
checksum: 65b8a60273110303467ce56438370f24d4803301c86fe1823c33233c523795d3
36+
- filename: packages/contentstack-content-type/tests/core/contentstack/client.test.ts
37+
checksum: 5c4b952c5bee5c4e05825e24a7f953cd9ddebbe07e7dbae73e4e959730683988
38+
- filename: packages/contentstack-content-type/tests/core/content-type/diagram.test.ts
39+
checksum: 75b5882e09a2f9f21d12236c8c64ed0d09bcbe9ff4a65f76b4b9f9b63b1a130c
40+
- filename: packages/contentstack-content-type/tests/utils/index.test.ts
41+
checksum: ba3137f99bba3d430145088fabf560ec9324a3fe14699eb7eacf1a863243f4b9
442
version: '1.0'

AGENTS.md

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
# Contentstack CLI plugins – Agent guide
2+
3+
**Universal entry point** for contributors and AI agents. Detailed conventions live in **`skills/*/SKILL.md`**.
4+
5+
## What this repo is
6+
7+
| Field | Detail |
8+
| --- | --- |
9+
| **Name:** | Contentstack CLI plugins (pnpm monorepo; root package name `csdx`) |
10+
| **Purpose:** | OCLIF plugins that extend the Contentstack CLI (import/export, clone, migration, seed, audit, variants, Developer Hub apps, etc.). |
11+
| **Out of scope (if any):** | The **core** CLI aggregation lives in the separate `cli` monorepo; this repo ships plugin packages only. |
12+
13+
## Tech stack (at a glance)
14+
15+
| Area | Details |
16+
| --- | --- |
17+
| **Language** | TypeScript / JavaScript, Node **>= 18** (`engines` in root `package.json`) |
18+
| **Build** | pnpm workspaces (`packages/*`); per package: `tsc`, OCLIF manifest/readme where applicable → `lib/` |
19+
| **Tests** | Mocha + Chai; layouts under `packages/*/test/` (see [skills/testing/SKILL.md](skills/testing/SKILL.md)) |
20+
| **Lint / coverage** | ESLint in packages that define `lint` scripts; nyc where configured |
21+
| **Other** | OCLIF v4, Husky |
22+
23+
## Commands (quick reference)
24+
25+
| Command type | Command |
26+
| --- | --- |
27+
| **Build** | `pnpm build` |
28+
| **Test** | `pnpm test` |
29+
| **Lint** | `pnpm run lint` in a package that defines `lint` (no root aggregate lint script) |
30+
31+
CI: [.github/workflows/unit-test.yml](.github/workflows/unit-test.yml) and other workflows under [.github/workflows/](.github/workflows/).
32+
33+
## Where the documentation lives: skills
34+
35+
| Skill | Path | What it covers |
36+
| --- | --- | --- |
37+
| Development workflow | [skills/dev-workflow/SKILL.md](skills/dev-workflow/SKILL.md) | pnpm commands, CI, TDD expectations, PR checklist |
38+
| Contentstack CLI | [skills/contentstack-cli/SKILL.md](skills/contentstack-cli/SKILL.md) | Plugin commands, OCLIF, Contentstack APIs (incl. `app:*` / `@contentstack/apps-cli`) |
39+
| Framework | [skills/framework/SKILL.md](skills/framework/SKILL.md) | Utilities, config, logging, errors (incl. Developer Hub SDK, manifests, GraphQL) |
40+
| Testing | [skills/testing/SKILL.md](skills/testing/SKILL.md) | Mocha/Chai, coverage, mocks |
41+
| Code review | [skills/code-review/SKILL.md](skills/code-review/SKILL.md) | PR review for this monorepo |
42+
43+
## Apps CLI plugin (`@contentstack/apps-cli`)
44+
45+
- **Package path:** [packages/contentstack-apps-cli](packages/contentstack-apps-cli)
46+
- **npm name:** `@contentstack/apps-cli` (unchanged for consumers)
47+
- **Migrated from:** [contentstack/contentstack-apps-cli](https://github.com/contentstack/contentstack-apps-cli) — see [APPS-CLI-MIGRATION.md](APPS-CLI-MIGRATION.md)
48+
- **v1 / v2:** Maintain on `v1-dev` (1.x CLI deps) and `v2-dev` / `v2-beta` (2.x beta deps) branches; align `@contentstack/cli-command` and `@contentstack/cli-utilities` versions with the target CLI line.
49+
- **Docs:** OCLIF / `app:*` commands → [contentstack-cli](skills/contentstack-cli/SKILL.md#apps-cli-commands-app); SDK, manifests, GraphQL, HTTP → [framework](skills/framework/SKILL.md#apps-cli-plugin-contentstackapps-cli)
50+
51+
## Content Type plugin (`contentstack-cli-content-type`)
52+
53+
- **Package path:** [packages/contentstack-content-type](packages/contentstack-content-type)
54+
- **npm name:** `contentstack-cli-content-type`
55+
- **Migrated from:** [contentstack/contentstack-cli-content-type](https://github.com/contentstack/contentstack-cli-content-type) — see [CONTENT-TYPE-MIGRATION.md](CONTENT-TYPE-MIGRATION.md)
56+
- **v1 / v2:** This branch carries the **v1 line** (`@contentstack/cli-command ^1.8.2`, `@contentstack/cli-utilities ^1.18.3`, npm tag `latest`). The v2-beta line lives on `v2-beta`.
57+
- **Tests:** Jest + ts-jest (unlike most other packages which use Mocha + Chai)
58+
- **Docs:** 6 commands under `content-type:*`[packages/contentstack-content-type/AGENTS.md](packages/contentstack-content-type/AGENTS.md)
59+
60+
## Using Cursor (optional)
61+
62+
If you use **Cursor**, [.cursor/rules/README.md](.cursor/rules/README.md) only points to **`AGENTS.md`**—same docs as everyone else.

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,3 +56,4 @@ To get a more detailed documentation for every command, visit the [CLI section](
5656
## Useful Plugins
5757

5858
- [Generate TypeScript typings from a Stack](https://github.com/Contentstack-Solutions/contentstack-cli-tsgen)
59+
- [Manage Content Types (list, details, audit, compare, diagram)](https://github.com/contentstack/cli-plugins/tree/main/packages/contentstack-content-type) (`contentstack-cli-content-type`)
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Cursor (optional)
2+
3+
**Cursor** users: start at **[AGENTS.md](../../AGENTS.md)**. All conventions live in **`skills/*/SKILL.md`**.
4+
5+
This folder only points contributors to **`AGENTS.md`** so editor-specific config does not duplicate the canonical docs.
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
root = true
2+
3+
[*]
4+
indent_style = space
5+
indent_size = 2
6+
charset = utf-8
7+
trim_trailing_whitespace = true
8+
insert_final_newline = true
9+
10+
[*.md]
11+
trim_trailing_whitespace = false
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/lib

0 commit comments

Comments
 (0)