Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
47 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
941f9e4
fix: lockfile updated
cs-raj Mar 2, 2026
2ee4081
Merge pull request #2441 from contentstack/fix/v2-beta-release
cs-raj 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
b081bd1
updated release file
shafeeqd959 Mar 9, 2026
91a0b5d
update pnpm lock
harshithad0703 Mar 9, 2026
eb137eb
updated versions
shafeeqd959 Mar 9, 2026
1236504
core version bump
shafeeqd959 Mar 9, 2026
2511dc3
corrected versions
shafeeqd959 Mar 9, 2026
fed63c9
merged changes
shafeeqd959 Mar 9, 2026
8f1b358
merged changes
shafeeqd959 Mar 9, 2026
5b12146
bumped core version
shafeeqd959 Mar 9, 2026
1cf1dac
updated readme
shafeeqd959 Mar 9, 2026
dc3c434
Merge pull request #2430 from contentstack/v2-dev
harshithad0703 Mar 9, 2026
cd705ea
bumped versions
shafeeqd959 Mar 9, 2026
258171c
Merge pull request #2449 from contentstack/v2-core-version-bump
shafeeqd959 Mar 9, 2026
d12b5c0
Upgrade chalk to version 5.6.2 and refactor CLI utilities to support …
harshithad0703 Mar 10, 2026
3f6bf60
Merge branch 'v2-beta' into fix/dx-4465-upgrade-chalk-to-v5
harshithad0703 Mar 10, 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
41 changes: 20 additions & 21 deletions .github/workflows/release-v2-beta-core.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
name: Release CLI Core (v2 Beta)

on:
workflow_dispatch:
push:
branches: [v2-beta]
paths:
- 'packages/contentstack/package.json'

jobs:
build:
Expand All @@ -11,7 +14,7 @@ jobs:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
with:
version: 7
version: 10.28.0
- uses: actions/setup-node@v4
with:
node-version: '22.x'
Expand All @@ -20,10 +23,10 @@ jobs:
run: corepack enable

- name: Install pnpm
run: corepack prepare pnpm@7 --activate
run: corepack prepare pnpm@10.28.0 --activate

- name: Install root dependencies
run: pnpm install
- name: Clean the repository
run: pnpm run clean:all

- name: Reading Configuration
id: release_config
Expand All @@ -33,38 +36,34 @@ jobs:
prefix: release

# Core CLI
- name: Installing dependencies of core
- name: Install all dependencies
id: core-installation
if: ${{env.release_releaseAll == 'true' || env.release_plugins_core == 'true'}}
working-directory: ./packages/contentstack
run: npm install
- name: Compiling core
if: ${{ steps.core-installation.conclusion == 'success' }}
working-directory: ./packages/contentstack
run: npm run prepack
run: pnpm install --frozen-lockfile

- name: Build all packages
run: pnpm -r --concurrency 1 run build

- name: Publishing core (Beta)
id: publish-core
uses: JS-DevTools/npm-publish@v3
if: ${{ steps.core-installation.conclusion == 'success' }}
with:
token: ${{ secrets.NPM_TOKEN }}
package: ./packages/contentstack/package.json
tag: beta

- name: Create Core Beta Release
if: ${{ steps.publish-core.conclusion == 'success' }}
id: create_release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
VERSION: ${{ steps.publish-core.outputs.version }}
run: |
# Look for the last release specifically starting with the 'core@v' prefix
PREVIOUS_BETA=$(gh release list --limit 50 | grep 'core@v' | grep 'beta' | head -1 | cut -f1)

if [ -n "$PREVIOUS_BETA" ]; then
# Compare current core version against previous core version
gh release create "core@v$VERSION" --title "Core Beta $VERSION" --notes-from-tag "$PREVIOUS_BETA" --prerelease
TAG="core@v${VERSION}"
if gh release view "$TAG" &>/dev/null; then
echo "Release $TAG already exists — skipping."
else
# Fallback if this is the first core@v release
gh release create "core@v$VERSION" --title "Core Beta $VERSION" --generate-notes --prerelease
gh release create "$TAG" \
--title "Core Beta $VERSION" \
--generate-notes \
--prerelease
fi
99 changes: 9 additions & 90 deletions .github/workflows/release-v2-beta-platform-plugins.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
with:
version: 7
version: 10.28.0
- uses: actions/setup-node@v4
with:
node-version: '22.x'
Expand All @@ -20,10 +20,16 @@ jobs:
run: corepack enable

- name: Install pnpm
run: corepack prepare pnpm@7 --activate
run: corepack prepare pnpm@10.28.0 --activate

- name: Clean the repository
run: pnpm run clean:all

- name: Install root dependencies
run: pnpm install
run: pnpm install --frozen-lockfile

- name: Build all plugins
run: pnpm -r --sort run build

- name: Reading Configuration
id: release_config
Expand All @@ -33,128 +39,41 @@ jobs:
prefix: release

# Dev Dependencies
- name: Installing dependencies of dev dependencies
id: dev-dependencies-installation
if: ${{env.release_releaseAll == 'true' || env.release_plugins_dev-dependencies == 'true'}}
working-directory: ./packages/contentstack-dev-dependencies
run: npm install
- name: Compiling dev dependencies
if: ${{ steps.dev-dependencies-installation.conclusion == 'success' }}
working-directory: ./packages/contentstack-dev-dependencies
run: npm run prepack
- name: Publishing dev dependencies (Beta)
uses: JS-DevTools/npm-publish@v3
if: ${{ steps.dev-dependencies-installation.conclusion == 'success' }}
with:
token: ${{ secrets.NPM_TOKEN }}
package: ./packages/contentstack-dev-dependencies/package.json
tag: beta

# Utilities
- name: Installing dependencies of utilities
id: utilities-installation
if: ${{env.release_releaseAll == 'true' || env.release_plugins_utilities == 'true'}}
working-directory: ./packages/contentstack-utilities
run: npm install
- name: Compiling utilities
if: ${{ steps.utilities-installation.conclusion == 'success' }}
working-directory: ./packages/contentstack-utilities
run: npm run prepack
- name: Publishing utilities (Beta)
uses: JS-DevTools/npm-publish@v3
if: ${{ steps.utilities-installation.conclusion == 'success' }}
with:
token: ${{ secrets.NPM_TOKEN }}
package: ./packages/contentstack-utilities/package.json
tag: beta

# Variants
- name: Installing dependencies of variants
id: variants-installation
if: ${{env.release_releaseAll == 'true' || env.release_plugins_utilities == 'true'}}
working-directory: ./packages/contentstack-variants
run: npm install
- name: Compiling variants
if: ${{ steps.variants-installation.conclusion == 'success' }}
working-directory: ./packages/contentstack-variants
run: npm run prepack
- name: Publishing variants (Beta)
uses: JS-DevTools/npm-publish@v3
if: ${{ steps.variants-installation.conclusion == 'success' }}
with:
token: ${{ secrets.NPM_TOKEN }}
package: ./packages/contentstack-variants/package.json
access: public
tag: beta

# Command
- name: Installing dependencies of command
id: command-installation
if: ${{env.release_releaseAll == 'true' || env.release_plugins_command == 'true'}}
working-directory: ./packages/contentstack-command
run: npm install
- name: Compiling command
if: ${{ steps.command-installation.conclusion == 'success' }}
working-directory: ./packages/contentstack-command
run: npm run prepack
- name: Publishing command (Beta)
uses: JS-DevTools/npm-publish@v3
if: ${{ steps.command-installation.conclusion == 'success' }}
with:
token: ${{ secrets.NPM_TOKEN }}
package: ./packages/contentstack-command/package.json
tag: beta

# Config
- name: Installing dependencies of config
id: config-installation
if: ${{env.release_releaseAll == 'true' || env.release_plugins_config == 'true'}}
working-directory: ./packages/contentstack-config
run: npm install
- name: Compiling config
if: ${{ steps.config-installation.conclusion == 'success' }}
working-directory: ./packages/contentstack-config
run: npm run prepack
- name: Publishing config (Beta)
uses: JS-DevTools/npm-publish@v3
if: ${{ steps.config-installation.conclusion == 'success' }}
with:
token: ${{ secrets.NPM_TOKEN }}
package: ./packages/contentstack-config/package.json
tag: beta

# Auth
- name: Installing dependencies of auth
id: auth-installation
if: ${{env.release_releaseAll == 'true' || env.release_plugins_auth == 'true'}}
working-directory: ./packages/contentstack-auth
run: npm install
- name: Compiling auth
if: ${{ steps.auth-installation.conclusion == 'success' }}
working-directory: ./packages/contentstack-auth
run: npm run prepack
- name: Publishing auth (Beta)
uses: JS-DevTools/npm-publish@v3
if: ${{ steps.auth-installation.conclusion == 'success' }}
with:
token: ${{ secrets.NPM_TOKEN }}
package: ./packages/contentstack-auth/package.json
tag: beta

- name: Create Platform Plugins Beta Release
# Adjust the ID below to match your actual publishing step ID for plugins
if: ${{ steps.publish-plugins.conclusion == 'success' }}
id: create_release_plugins
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# Extract version from the output of your plugin publish step
VERSION: ${{ steps.publish-plugins.outputs.version }}
run: |
# Look for the last release specifically starting with 'plugins@v'
PREVIOUS_BETA=$(gh release list --limit 50 | grep 'platform-plugins@v' | grep 'beta' | head -1 | cut -f1)

if [ -n "$PREVIOUS_BETA" ]; then
gh release create "platform-plugins@v$VERSION" --title "Platform Plugins Beta $VERSION" --notes-from-tag "$PREVIOUS_BETA" --prerelease
else
gh release create "platform-plugins@v$VERSION" --title "Platform Plugins Beta $VERSION" --generate-notes --prerelease
fi
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
14 changes: 7 additions & 7 deletions .github/workflows/unit-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,18 +22,18 @@ jobs:
node-version: '22.x'
cache: 'pnpm' # optional but recommended

- name: Temporarily disable contentstack package
run: mv packages/contentstack/package.json packages/contentstack/package.json.disabled || true
# - name: Temporarily disable contentstack package
# run: mv packages/contentstack/package.json packages/contentstack/package.json.disabled || true

- name: Install Dependencies (Excluding Contentstack)
run: npm run bootstrap
run: pnpm install --frozen-lockfile

- name: Build all plugins (Excluding Contentstack)
run: |
npm run build
NODE_ENV=PREPACK_MODE pnpm -r --sort run build

- name: Restore contentstack package
run: mv packages/contentstack/package.json.disabled packages/contentstack/package.json || true
# - name: Restore contentstack package
# run: mv packages/contentstack/package.json.disabled packages/contentstack/package.json || true

- name: Run tests for Contentstack Command
working-directory: ./packages/contentstack-command
Expand All @@ -45,4 +45,4 @@ jobs:

- name: Run tests for Contentstack Auth
working-directory: ./packages/contentstack-auth
run: NODE_ENV=PREPACK_MODE npm run test
run: NODE_ENV=PREPACK_MODE npm run test:unit
4 changes: 2 additions & 2 deletions .talismanrc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
fileignoreconfig:
- filename: package-lock.json
checksum: 45100667793fc7dfaae3e24787871257e7f29e06df69ba10ec05b358d59ff15d
checksum: a76d549ee4cbf3da65907ccf49fd0f2e5027f39be8c7ac431e7e38c9b1b5df8e
- filename: pnpm-lock.yaml
checksum: c07d7e30ff879a537391548110f18b5d7f7a517dc8de48b05018ca78130ee5fd
checksum: adf3973977563fbc08ca18420b102616ea0573c5633067e0793c7ccbe1462cad
version: '1.0'
2 changes: 1 addition & 1 deletion packages/contentstack-auth/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ $ npm install -g @contentstack/cli-auth
$ csdx COMMAND
running command...
$ csdx (--version)
@contentstack/cli-auth/2.0.0-beta.4 darwin-arm64 node-v22.13.1
@contentstack/cli-auth/2.0.0-beta.7 darwin-arm64 node-v22.13.1
$ csdx --help [COMMAND]
USAGE
$ csdx COMMAND
Expand Down
2 changes: 1 addition & 1 deletion packages/contentstack-auth/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"author": "Contentstack",
"bugs": "https://github.com/contentstack/cli/issues",
"scripts": {
"build": "pnpm compile && oclif manifest",
"build": "pnpm compile && oclif manifest && oclif readme",
"clean": "rm -rf ./lib ./node_modules tsconfig.tsbuildinfo",
"compile": "tsc -b tsconfig.json",
"postpack": "rm -f oclif.manifest.json",
Expand Down
2 changes: 1 addition & 1 deletion packages/contentstack-config/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ $ npm install -g @contentstack/cli-config
$ csdx COMMAND
running command...
$ csdx (--version)
@contentstack/cli-config/2.0.0-beta.2 darwin-arm64 node-v22.13.1
@contentstack/cli-config/2.0.0-beta.3 darwin-arm64 node-v22.13.1
$ csdx --help [COMMAND]
USAGE
$ csdx COMMAND
Expand Down
2 changes: 1 addition & 1 deletion packages/contentstack-config/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"version": "2.0.0-beta.3",
"author": "Contentstack",
"scripts": {
"build": "pnpm compile && oclif manifest",
"build": "pnpm compile && oclif manifest && oclif readme",
"clean": "rm -rf ./lib ./node_modules tsconfig.tsbuildinfo",
"compile": "tsc -b tsconfig.json",
"postpack": "rm -f oclif.manifest.json",
Expand Down
2 changes: 1 addition & 1 deletion packages/contentstack-dev-dependencies/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@contentstack/cli-dev-dependencies",
"version": "1.3.1",
"version": "2.0.0-beta.0",
"description": "Customized dev dependencies for ContentStack projects",
"main": "lib/index.js",
"types": "lib/index.d.ts",
Expand Down
8 changes: 4 additions & 4 deletions packages/contentstack-utilities/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,14 @@
"@contentstack/marketplace-sdk": "^1.5.0",
"@oclif/core": "^4.3.0",
"axios": "^1.13.5",
"chalk": "^4.1.2",
"chalk": "^5.6.2",
"cli-cursor": "^3.1.0",
"cli-progress": "^3.12.0",
"cli-table": "^0.3.11",
"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: 27 additions & 0 deletions packages/contentstack-utilities/src/chalk.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
/**
* Chalk 5 is ESM-only. We load it via dynamic import and cache for use in CommonJS.
*/
let chalkInstance: typeof import('chalk').default | null = null;

export type ChalkInstance = typeof import('chalk').default;

/**
* Load chalk (ESM) and cache it. Call this once during CLI init before any chalk usage.
*/
export async function loadChalk(): Promise<ChalkInstance> {
if (!chalkInstance) {
const chalkModule = await import('chalk');
chalkInstance = chalkModule.default;
}
return chalkInstance;
}

/**
* Get the cached chalk instance. Must call loadChalk() first (e.g. in init hook).
*/
export function getChalk(): ChalkInstance {
if (!chalkInstance) {
throw new Error('Chalk not loaded. Ensure loadChalk() is called during init (e.g. in utils-init hook).');
}
return chalkInstance;
}
Loading
Loading