Skip to content

Commit 8aae1ca

Browse files
Merge pull request #154 from contentstack/enh/dx-7524-migrate-apps-cli-v2
Enh/dx 7524 migrate apps cli v2
2 parents 8d81f9a + c93a2bd commit 8aae1ca

75 files changed

Lines changed: 8951 additions & 155 deletions

Some content is hidden

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

.github/config/release.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
"migration": false,
1010
"seed": false,
1111
"bootstrap": false,
12-
"branches": false
12+
"branches": false,
13+
"apps-cli": false
1314
}
1415
}

.github/workflows/release-v2-beta-plugins.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,3 +142,11 @@ jobs:
142142
token: ${{ secrets.NPM_TOKEN }}
143143
package: ./packages/contentstack-query-export/package.json
144144
tag: beta
145+
146+
# Apps CLI
147+
- name: Publishing apps-cli (Beta)
148+
uses: JS-DevTools/npm-publish@v3
149+
with:
150+
token: ${{ secrets.NPM_TOKEN }}
151+
package: ./packages/contentstack-apps-cli/package.json
152+
tag: beta

.github/workflows/unit-test.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,3 +66,7 @@ jobs:
6666
- name: Run tests for Contentstack Query Export
6767
working-directory: ./packages/contentstack-query-export
6868
run: npm run test:unit
69+
70+
- name: Run tests for Contentstack Apps CLI
71+
working-directory: ./packages/contentstack-apps-cli
72+
run: npm run test:unit:report:json

.talismanrc

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,6 @@
11
fileignoreconfig:
22
- filename: pnpm-lock.yaml
3-
checksum: 264c0294416c2aa2028c8283831aa7ed17d63e8c69553a7b2b9774336bc0811f
4-
- filename: packages/contentstack-bootstrap/test/bootstrap.test.js
5-
checksum: 37b502482fc32831c39091dd1755e8b0a9f6f8bac89e5eb9d397c6af1f213d83
6-
- filename: packages/contentstack-bootstrap/test/utils.test.js
7-
checksum: e0ca2eb58ab1c3ac3b4d9c14a17bb8f4788678074dd65f6acc128a8a8f51997f
8-
- filename: packages/contentstack-export-to-csv/test/unit/base-command.test.ts
9-
checksum: 4c2befce053135453c1db31f21351bf3f797ff2f15723ca52e183ed6ed9e48e4
10-
- filename: packages/contentstack-export-to-csv/test/unit/utils/teams-export.functional.test.ts
11-
checksum: 17cdae91c22a935309bf4514b6616f1aea91fd0166fede182e673ade43667a36
12-
- filename: packages/contentstack-export-to-csv/test/unit/utils/interactive.test.ts
13-
checksum: 72c1e719e5c51a42debc817a5fe5bb1adee63b2d823df2e9ee36d0b970db7886
14-
- filename: packages/contentstack-export-to-csv/test/unit/utils/api-client.functional.test.ts
15-
checksum: 6d6638919ef7260f642d32cf730e2654d159d2d3582714fb2d7a9c209b9c6eeb
16-
- filename: packages/contentstack-export-to-csv/test/unit/commands/export-to-csv.test.ts
17-
checksum: 9621a9d013796e99a25e894404c4d7c6799bd33bde77852f09d5e32b4d1c1c49
3+
checksum: e5b5f8ab64f4f27a1483e426cc01d7388482263e1d6fe3baf1caafcf2878ebb2
4+
- filename: skills/framework/SKILL.md
5+
checksum: c5746de64b1e7d1df051c4337de5eb32de6a4c85c7297aa408838d304bb2d771
186
version: '1.0'

AGENTS.md

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
| Field | Detail |
88
| --- | --- |
99
| **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, etc.). |
10+
| **Purpose:** | OCLIF plugins that extend the Contentstack CLI (import/export, clone, migration, seed, audit, variants, Developer Hub apps, etc.). |
1111
| **Out of scope (if any):** | The **core** CLI aggregation lives in the separate `cli` monorepo; this repo ships plugin packages only. |
1212

1313
## Tech stack (at a glance)
@@ -35,11 +35,19 @@ CI: [.github/workflows/unit-test.yml](.github/workflows/unit-test.yml) and other
3535
| Skill | Path | What it covers |
3636
| --- | --- | --- |
3737
| 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 |
39-
| Framework | [skills/framework/SKILL.md](skills/framework/SKILL.md) | Utilities, config, logging, errors |
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) |
4040
| Testing | [skills/testing/SKILL.md](skills/testing/SKILL.md) | Mocha/Chai, coverage, mocks |
4141
| Code review | [skills/code-review/SKILL.md](skills/code-review/SKILL.md) | PR review for this monorepo |
4242

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+
4351
## Using Cursor (optional)
4452

4553
If you use **Cursor**, [.cursor/rules/README.md](.cursor/rules/README.md) only points to **`AGENTS.md`**—same docs as everyone else.

APPS-CLI-MIGRATION.md

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
# Apps CLI migration: standalone repo → cli-plugins monorepo
2+
3+
## Summary
4+
5+
The **@contentstack/apps-cli** plugin (`contentstack-apps-cli`) has moved from the standalone repository [contentstack/contentstack-apps-cli](https://github.com/contentstack/contentstack-apps-cli) into the [contentstack/cli-plugins](https://github.com/contentstack/cli-plugins) monorepo at **`packages/contentstack-apps-cli`**.
6+
7+
The **npm package name is unchanged**: `@contentstack/apps-cli`. Install and command usage stay the same.
8+
9+
## Repository and issue tracking
10+
11+
| Before | After |
12+
| --- | --- |
13+
| Source: `github.com/contentstack/contentstack-apps-cli` | Source: `github.com/contentstack/cli-plugins``packages/contentstack-apps-cli` |
14+
| Issues: contentstack-apps-cli repo | Issues: [cli-plugins issues](https://github.com/contentstack/cli-plugins/issues) (label or mention `apps-cli` / `@contentstack/apps-cli`) |
15+
16+
The standalone **contentstack-apps-cli** repository is **archived** after the first release from cli-plugins. Open PRs and bugs should be recreated or linked in cli-plugins.
17+
18+
## Version lines (1.x vs 2.x)
19+
20+
| CLI line | cli-plugins branch | Apps plugin notes |
21+
| --- | --- | --- |
22+
| **1.x** | `v1-dev` / `v1-beta` | `@contentstack/cli-command` and `@contentstack/cli-utilities` on 1.x-compatible ranges |
23+
| **2.x beta** | `v2-dev` / `v2-beta` | Align with 2.x beta core packages (same pattern as export, import, bootstrap) |
24+
25+
Develop and release each line on its branch; do not mix 1.x and 2.x dependency pins in the same branch.
26+
27+
## Install (unchanged)
28+
29+
```bash
30+
csdx plugins:install @contentstack/apps-cli
31+
# or
32+
npm install -g @contentstack/apps-cli
33+
```
34+
35+
## Local development
36+
37+
Clone [cli-dev-workspace](https://github.com/contentstack/cli-dev-workspace) (or cli-plugins only), then:
38+
39+
```bash
40+
cd cli-plugins
41+
pnpm install
42+
pnpm --filter @contentstack/apps-cli run build
43+
pnpm --filter @contentstack/apps-cli test
44+
```
45+
46+
See [AGENTS.md](./AGENTS.md), [skills/contentstack-cli/SKILL.md](./skills/contentstack-cli/SKILL.md#apps-cli-commands-app), and [skills/framework/SKILL.md](./skills/framework/SKILL.md#apps-cli-plugin-contentstackapps-cli) for contributor docs.
47+
48+
## Related migrations
49+
50+
- Core CLI: [cli](https://github.com/contentstack/cli) monorepo
51+
- Other external plugins (bulk operations, migrate-rte): same cli-plugins consolidation effort

MIGRATION.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,14 @@ csdx cm:migrate-rte --help
180180

181181
**Migration Action:** Refer to the detailed [Bulk Operations Migration Guide](./BULK-OPERATIONS-MIGRATION.md) for complete command mappings and examples.
182182

183+
### 7. 📱 Apps CLI plugin repository move
184+
185+
**What Changed:**
186+
- The Apps CLI plugin (`@contentstack/apps-cli`) source moved from the standalone [contentstack-apps-cli](https://github.com/contentstack/contentstack-apps-cli) repository into this **cli-plugins** monorepo at `packages/contentstack-apps-cli`
187+
- The npm package name and `csdx app:*` commands are unchanged
188+
189+
**Migration Action:** For repository location, branching (1.x vs 2.x), and issue tracking, see the [Apps CLI Migration Guide](./APPS-CLI-MIGRATION.md).
190+
183191
**Quick Example:**
184192
```bash
185193
# Before (1.x.x)

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ CLI supports content management scripts through which you can perform the follow
1515
- Migrate HTML RTE to JSON RTE content
1616
- Change Master Locale
1717
- Use Bootstrap plugin
18+
- Manage Developer Hub apps (`app:*` via `@contentstack/apps-cli`)
1819
- Use Tsgen plugin
1920

2021

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/dist
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
{
2+
"env": {
3+
"node": true
4+
},
5+
"parser": "@typescript-eslint/parser",
6+
"parserOptions": {
7+
"project": "tsconfig.json",
8+
"sourceType": "module"
9+
},
10+
"plugins": [
11+
"@typescript-eslint"
12+
],
13+
"extends": [
14+
"plugin:@typescript-eslint/recommended"
15+
],
16+
"ignorePatterns": [
17+
"lib/**/*",
18+
"test/**/*"
19+
],
20+
"rules": {
21+
"@typescript-eslint/no-unused-vars": [
22+
"error",
23+
{
24+
"args": "none"
25+
}
26+
],
27+
"@typescript-eslint/prefer-namespace-keyword": "error",
28+
"quotes": "off",
29+
"semi": "off",
30+
"@typescript-eslint/no-redeclare": "off",
31+
"eqeqeq": [
32+
"error",
33+
"smart"
34+
],
35+
"id-match": "error",
36+
"no-eval": "error",
37+
"no-var": "error",
38+
"@typescript-eslint/no-explicit-any": "off",
39+
"@typescript-eslint/no-require-imports": "off",
40+
"prefer-const": "error"
41+
}
42+
}

0 commit comments

Comments
 (0)