Skip to content

Commit 61ef829

Browse files
authored
Merge pull request #2676 from contentstack/feat/DX-10057-cleanup-deprecated-flags-aliases
fix(DX-10057): remove dead --branch flag from auth:tokens:add
2 parents 401fd9b + d273d00 commit 61ef829

3 files changed

Lines changed: 7 additions & 52 deletions

File tree

MIGRATION.md

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -372,7 +372,7 @@ Several short-form command aliases that worked in V1 no longer exist in V2. Runn
372372
| `csdx audit` | `csdx cm:stacks:audit` |
373373
| `csdx audit:fix` | `csdx cm:stacks:audit:fix` |
374374

375-
> **Exception:** `csdx cm:migration` is the one V1 alias that **survived** — it still works in V2.
375+
> **Note:** `csdx cm:migration` was also removed in V2 — use `csdx cm:stacks:migration` instead.
376376
377377
**Before (1.x.x):**
378378
```bash
@@ -518,7 +518,7 @@ csdx config:set:log --no-show-console-logs
518518
|---|---|
519519
| `--appName` / `-a` | `--app-name` |
520520
| `--directory` / `-d` | `--project-dir` |
521-
| `--appType` / `-s` | `--app-type` |
521+
| `--appType` / `-s` | *(removed — no replacement needed)* |
522522

523523
**Removed `--app-name` values (13 total):**
524524

@@ -561,20 +561,21 @@ csdx cm:bootstrap --appName reactjs --directory ./myapp --appType sampleapp
561561
csdx cm:bootstrap --app-name compass-app --project-dir ./myapp
562562
```
563563

564-
**Migration Action:** Replace removed `--app-name` values with one of the 8 valid V2 app names. Update `--appName``--app-name`, `--directory``--project-dir`, `--appType` `--app-type`.
564+
**Migration Action:** Replace removed `--app-name` values with one of the 8 valid V2 app names. Update `--appName``--app-name`, `--directory``--project-dir`. Remove any `--appType` / `-s` usage — the flag no longer exists and app type is hardcoded internally.
565565

566566
---
567567

568-
### 17. 🌱 Seed Stack List Is Now Curated (4 Stacks Only)
568+
### 17. 🌱 Seed Stack List Is Now Curated (3 Stacks Only)
569569

570570
**What Changed:**
571-
In V1, running `csdx cm:stacks:seed` without `--repo` triggered a live GitHub API search and presented all matching Contentstack repositories. In V2, the list is fixed — only 4 curated repos are shown in the interactive picker.
571+
In V1, running `csdx cm:stacks:seed` without `--repo` triggered a live GitHub API search and presented all matching Contentstack repositories. In V2, the list is fixed — only 3 curated repos are shown in the interactive picker.
572572

573573
**V2 curated list:**
574574
1. `contentstack/kickstart-stack-seed` — Kickstart stack seed
575575
2. `contentstack/kickstart-veda-seed` — Kickstart Veda
576576
3. `contentstack/compass-starter-stack` — Compass starter stack
577-
4. `contentstack/stack-starter-app` — Starter app
577+
578+
> **Note:** `contentstack/stack-starter-app` was removed from the curated list. If you need it, pass it directly via `--repo contentstack/stack-starter-app`.
578579
579580
If you previously relied on the interactive list to discover repos, those repos no longer appear. Any script that passed a repo name not in this list via the interactive prompt will now time out or fail.
580581

packages/contentstack-auth/src/commands/auth/tokens/add.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -50,12 +50,6 @@ export default class TokensAddCommand extends BaseCommand<typeof TokensAddComman
5050
description: 'Add the token name',
5151
env: 'TOKEN',
5252
}),
53-
branch: flags.string({
54-
required: false,
55-
multiple: false,
56-
description: 'Branch name',
57-
hidden: true,
58-
}),
5953
};
6054

6155
static usage =

packages/contentstack-auth/test/unit/commands/tokens-add.test.ts

Lines changed: 0 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -254,8 +254,6 @@ describe('Management and Delivery token flags', () => {
254254
conf.validAPIKey,
255255
'--token',
256256
conf.validToken,
257-
'--branch',
258-
'main',
259257
]);
260258

261259
assert.calledOnce(successStub);
@@ -270,24 +268,6 @@ describe('Management and Delivery token flags', () => {
270268
}
271269
});
272270

273-
it.skip('Should add a token successfully after all the values are passed with stack having branches enabled', async () => {
274-
nock('https://api.contentstack.io').get('/v3/environments').query({ limit: 1 }).reply(200, { environments: [] });
275-
276-
await TokensAddCommand.run([
277-
'--management',
278-
'--alias',
279-
'newToken',
280-
'--stack-api-key',
281-
conf.validAPIKey,
282-
'--token',
283-
conf.validToken,
284-
'--branch',
285-
'main',
286-
]);
287-
288-
assert.calledOnce(successStub);
289-
});
290-
291271
it.skip('Should add a token successfully for stack with branches disabled after all the values are passed', async () => {
292272
nock('https://api.contentstack.io').get('/v3/environments').query({ limit: 1 }).reply(200, { environments: [] });
293273

@@ -364,25 +344,5 @@ describe('Management and Delivery token flags', () => {
364344
]);
365345
assert.calledWith(successStub, 'CLI_AUTH_TOKENS_ADD_SUCCESS');
366346
});
367-
it('Should throw and error for stack with branches disabled', async () => {
368-
let branch = 'my-branch';
369-
try {
370-
await TokensAddCommand.run([
371-
'--delivery',
372-
'--alias',
373-
'newToken',
374-
'--stack-api-key',
375-
process.env.BRANCH_DISABLED_API_KEY!,
376-
'--token',
377-
process.env.BRANCH_DISABLED_DELIVERY_TOKEN!,
378-
'--environment',
379-
process.env.BRANCH_DISABLED_ENVIRONMENT!,
380-
'--branch',
381-
branch,
382-
]);
383-
} catch (error: any) {
384-
assert.calledOnce(errorStub);
385-
}
386-
});
387347
});
388348
});

0 commit comments

Comments
 (0)