Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
9edbb33
chore: update inquirer and node types across multiple packages, refac…
harshithad0703 Feb 20, 2026
f42ff37
update package-lock
harshithad0703 Feb 20, 2026
b1dafff
test: fix interactive tests by stubbing additional functions and upda…
harshithad0703 Feb 20, 2026
0da0985
chore: update @types/node and @typescript-eslint/parser versions in p…
harshithad0703 Feb 20, 2026
60c88cd
chore: update .gitignore to include tsconfig.tsbuildinfo
harshithad0703 Feb 20, 2026
24e4950
chore: update test script to use 'compile' instead of 'build'
harshithad0703 Feb 20, 2026
25d2d64
test: enhance bootstrapping tests by setting authorisation type and u…
harshithad0703 Feb 23, 2026
e64012a
test: enable previously skipped test for management token retrieval a…
harshithad0703 Feb 23, 2026
95ab9df
refactor: enhance CLI interface by adding InquirerQuestion and Answer…
harshithad0703 Feb 23, 2026
5dd254d
feat(audit): validate referenced entry content types in entries audit
cs-raj Feb 23, 2026
c7ecbba
Remove Redundant code block
cs-raj Feb 24, 2026
aa08882
Merge pull request #2423 from contentstack/feat/DX-3800
cs-raj Feb 24, 2026
2d1ad10
fix: Skipping lytics audience creation
cs-raj Feb 24, 2026
db01c8a
fix(personalize): filter lytics audiences in experience variants duri…
cs-raj Feb 24, 2026
f95b012
Merge branch 'v2-beta-dev' into enh/dx-362-inquirer-v12
harshithad0703 Feb 25, 2026
7628fd8
Merge branch 'v2-beta-dev' into enh/dx-362-inquirer-v12
harshithad0703 Feb 25, 2026
cbfec0a
Merge pull request #2427 from contentstack/fix/DX-3445
cs-raj Feb 25, 2026
63b088d
Update package lock and pnpm lock
harshithad0703 Feb 25, 2026
abdd358
version bump
harshithad0703 Feb 27, 2026
44fd133
Merge pull request #2435 from contentstack/fix/version-bump
harshithad0703 Feb 27, 2026
d65b8c8
Merge pull request #2431 from contentstack/development
harshithad0703 Feb 27, 2026
47c1c8a
Merge pull request #2436 from contentstack/staging
harshithad0703 Mar 2, 2026
d58b86f
Update sca-scan.yml
dhavaljain999 Mar 2, 2026
ba6bf58
Update sca-scan.yml
dhavaljain999 Mar 4, 2026
6a13b99
enhance error handling in CLI interface for better user experience
harshithad0703 Mar 6, 2026
d1150e2
Merge branch 'v2-dev-bugfix' into enh/dx-362-inquirer-v12
harshithad0703 Mar 6, 2026
08a166c
Merge branch 'main' into enh/dx-362-inquirer-v12
harshithad0703 Mar 6, 2026
a7cb8b7
Add pnpm setup and Node.js version to workflow
aravindbuilt Mar 6, 2026
a64e69a
Update sca-scan.yml
aravindbuilt Mar 6, 2026
60ceac4
Update sca-scan.yml
aravindbuilt Mar 6, 2026
e4668e0
Update sca-scan.yml
aravindbuilt Mar 6, 2026
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
5 changes: 4 additions & 1 deletion .github/workflows/sca-scan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,7 @@ jobs:
env:
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
with:
args: --all-projects --fail-on=all
args: --fail-on=all --all-projects
json: true
continue-on-error: true
- uses: contentstack/sca-policy@main
6 changes: 3 additions & 3 deletions packages/contentstack-utilities/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
"conf": "^10.2.0",
"dotenv": "^16.6.1",
"figures": "^3.2.0",
"inquirer": "8.2.7",
"inquirer": "12.11.1",
"inquirer-search-checkbox": "^1.0.0",
"inquirer-search-list": "^1.2.6",
"js-yaml": "^4.1.1",
Expand All @@ -68,7 +68,7 @@
"@types/inquirer": "^9.0.8",
"@types/mkdirp": "^1.0.2",
"@types/mocha": "^10.0.10",
"@types/node": "^14.18.63",
"@types/node": "^18.11.9",
"@types/sinon": "^21.0.0",
"@types/traverse": "^0.6.37",
"chai": "^4.5.0",
Expand All @@ -80,6 +80,6 @@
"nyc": "^15.1.0",
"sinon": "^21.0.1",
"ts-node": "^10.9.2",
"typescript": "^4.9.5"
"typescript": "^5.0.0"
}
}
27 changes: 19 additions & 8 deletions packages/contentstack-utilities/src/cli-ux.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import chalk, { Chalk } from 'chalk';
import { default as inquirer, QuestionCollection, Answers } from 'inquirer';
import inquirer from 'inquirer';
import { ux as cliux, Args, Flags, Command } from '@oclif/core';
import { Ora, default as ora } from 'ora';
import cliProgress from 'cli-progress';
import CLITable, { TableFlags, TableHeader, TableData, TableOptions } from './cli-table';

import messageHandler from './message-handler';
import { PrintOptions, InquirePayload, CliUXPromptOptions } from './interfaces';
import { PrintOptions, InquirePayload, CliUXPromptOptions, InquirerQuestion, Answers } from './interfaces';

inquirer.registerPrompt('table', require('./inquirer-table-prompt'));

Expand Down Expand Up @@ -68,12 +68,23 @@ class CLIInterface {
}

async inquire<T>(inquirePayload: InquirePayload | Array<InquirePayload>): Promise<T> {
if (Array.isArray(inquirePayload)) {
return inquirer.prompt(inquirePayload);
} else {
inquirePayload.message = messageHandler.parse(inquirePayload.message);
const result = await inquirer.prompt(inquirePayload as QuestionCollection<Answers>);
return result[inquirePayload.name] as T;
try {
if (Array.isArray(inquirePayload)) {
return (await inquirer.prompt(inquirePayload)) as T;
} else {
inquirePayload.message = messageHandler.parse(inquirePayload.message);
const result = (await inquirer.prompt(inquirePayload as InquirerQuestion as Parameters<typeof inquirer.prompt>[0])) as Answers;
return result[inquirePayload.name] as T;
}
} catch (err) {
const isExitPrompt =
(err as NodeJS.ErrnoException)?.name === 'ExitPromptError' ||
(err as Error)?.message?.includes('SIGINT') ||
(err as Error)?.message?.includes('force closed');
if (isExitPrompt) {
process.exit(130);
}
throw err;
}
}

Expand Down
Loading
Loading