Skip to content

DX | 26-05-2025 | Release #1934

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 23 commits into from
May 26, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
8fc7357
[DX-2277],Prevent marketplace apps recreation by default
Apr 15, 2025
0d97f9e
[DX-2277], added minor version bump
Apr 15, 2025
053a6a1
[DX-2277], added minor version bump
Apr 15, 2025
6473639
[DX-2277], added package.lock and pnpm.lock files
Apr 15, 2025
b70b75d
[DX-2277], merge development
Apr 16, 2025
50946af
[DX-2277], removed the flag condition
Apr 16, 2025
f0ba528
Merge branch 'development' into feature/DX-2277
Apr 16, 2025
ea72d3f
Merge branch 'development' into feature/DX-2277
naman-contentstack Apr 16, 2025
998e1ba
resolved conflicts
Apr 16, 2025
1f8e729
Merge branch 'development' into feature/DX-2277
naman-contentstack Apr 16, 2025
33ceb4f
fix:config
aman19K May 19, 2025
225f8e5
Merge pull request #1929 from contentstack/main
harshithad0703 May 19, 2025
b14b4b0
Merge pull request #1930 from contentstack/staging
harshithad0703 May 19, 2025
cdf9f4a
Merge branch 'development' into feature/DX-2277
May 21, 2025
21dd678
Merge branch 'development' into fix/DX-2903
aman19K May 21, 2025
c41035e
updated the dependencies
May 21, 2025
9e97263
version bump
aman19K May 21, 2025
ce75714
Merge pull request #1931 from contentstack/fix/DX-2903
aman19K May 21, 2025
d87f064
Merge branch 'development' into feature/DX-2277
May 22, 2025
66172a5
Merge pull request #1869 from contentstack/feature/DX-2277
naman-contentstack May 22, 2025
69e776a
update checksum for package-lock.json in .talismanrc
harshithad0703 May 22, 2025
fa48943
Merge pull request #1933 from contentstack/fix/talisman-update
harshithad0703 May 22, 2025
c3ca989
Merge pull request #1932 from contentstack/development
harshithad0703 May 26, 2025
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
238 changes: 120 additions & 118 deletions .talismanrc

Large diffs are not rendered by default.

1,438 changes: 496 additions & 942 deletions package-lock.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion packages/contentstack-audit/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ $ npm install -g @contentstack/cli-audit
$ csdx COMMAND
running command...
$ csdx (--version|-v)
@contentstack/cli-audit/1.12.0 darwin-arm64 node-v23.11.0
@contentstack/cli-audit/1.12.1 darwin-arm64 node-v22.14.0
$ csdx --help [COMMAND]
USAGE
$ csdx COMMAND
Expand Down
2 changes: 1 addition & 1 deletion packages/contentstack-audit/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"dependencies": {
"@contentstack/cli-command": "~1.5.0",
"@oclif/plugin-help": "^6.2.27",
"@contentstack/cli-utilities": "~1.11.0",
"@contentstack/cli-utilities": "~1.11.1",
"@oclif/plugin-plugins": "^5.4.36",
"chalk": "^4.1.2",
"fast-csv": "^4.3.6",
Expand Down
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/1.4.0 darwin-arm64 node-v23.11.0
@contentstack/cli-auth/1.4.0 darwin-arm64 node-v22.14.0
$ 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 @@ -23,7 +23,7 @@
},
"dependencies": {
"@contentstack/cli-command": "~1.5.0",
"@contentstack/cli-utilities": "~1.11.0"
"@contentstack/cli-utilities": "~1.11.1"
},
"devDependencies": {
"@fancy-test/nock": "^0.1.1",
Expand Down
2 changes: 1 addition & 1 deletion packages/contentstack-bootstrap/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ $ npm install -g @contentstack/cli-cm-bootstrap
$ csdx COMMAND
running command...
$ csdx (--version)
@contentstack/cli-cm-bootstrap/1.14.0 darwin-arm64 node-v23.11.0
@contentstack/cli-cm-bootstrap/1.14.0 darwin-arm64 node-v22.14.0
$ csdx --help [COMMAND]
USAGE
$ csdx COMMAND
Expand Down
4 changes: 2 additions & 2 deletions packages/contentstack-bootstrap/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@
"test:report": "nyc --reporter=lcov mocha \"test/**/*.test.js\""
},
"dependencies": {
"@contentstack/cli-cm-seed": "~1.11.0",
"@contentstack/cli-cm-seed": "~1.11.1",
"@contentstack/cli-command": "~1.5.0",
"@contentstack/cli-utilities": "~1.11.0",
"@contentstack/cli-utilities": "~1.11.1",
"inquirer": "8.2.6",
"mkdirp": "^1.0.4",
"tar": "^6.2.1 "
Expand Down
2 changes: 1 addition & 1 deletion packages/contentstack-branches/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"dependencies": {
"@contentstack/cli-command": "~1.5.0",
"@oclif/core": "^4.2.7",
"@contentstack/cli-utilities": "~1.11.0",
"@contentstack/cli-utilities": "~1.11.1",
"chalk": "^4.1.2",
"just-diff": "^6.0.2",
"lodash": "^4.17.21"
Expand Down
2 changes: 1 addition & 1 deletion packages/contentstack-bulk-publish/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ $ npm install -g @contentstack/cli-cm-bulk-publish
$ csdx COMMAND
running command...
$ csdx (--version)
@contentstack/cli-cm-bulk-publish/1.8.0 darwin-arm64 node-v23.11.0
@contentstack/cli-cm-bulk-publish/1.8.0 darwin-arm64 node-v22.14.0
$ csdx --help [COMMAND]
USAGE
$ csdx COMMAND
Expand Down
2 changes: 1 addition & 1 deletion packages/contentstack-bulk-publish/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"bugs": "https://github.com/contentstack/cli/issues",
"dependencies": {
"@contentstack/cli-command": "~1.5.0",
"@contentstack/cli-utilities": "~1.11.0",
"@contentstack/cli-utilities": "~1.11.1",
"chalk": "^4.1.2",
"dotenv": "^16.4.7",
"inquirer": "8.2.6",
Expand Down
2 changes: 1 addition & 1 deletion packages/contentstack-clone/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ $ npm install -g @contentstack/cli-cm-clone
$ csdx COMMAND
running command...
$ csdx (--version)
@contentstack/cli-cm-clone/1.14.0 darwin-arm64 node-v23.11.0
@contentstack/cli-cm-clone/1.14.1 darwin-arm64 node-v23.11.0
$ csdx --help [COMMAND]
USAGE
$ csdx COMMAND
Expand Down
6 changes: 3 additions & 3 deletions packages/contentstack-clone/package.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
{
"name": "@contentstack/cli-cm-clone",
"description": "Contentstack stack clone plugin",
"version": "1.14.0",
"version": "1.14.1",
"author": "Contentstack",
"bugs": "https://github.com/rohitmishra209/cli-cm-clone/issues",
"dependencies": {
"@colors/colors": "^1.6.0",
"@contentstack/cli-cm-export": "~1.16.1",
"@contentstack/cli-cm-import": "~1.21.3",
"@contentstack/cli-cm-import": "~1.22.0",
"@contentstack/cli-command": "~1.5.0",
"@contentstack/cli-utilities": "~1.11.0",
"@contentstack/cli-utilities": "~1.11.1",
"chalk": "^4.1.2",
"inquirer": "8.2.6",
"lodash": "^4.17.21",
Expand Down
2 changes: 1 addition & 1 deletion packages/contentstack-command/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"format": "eslint src/**/*.ts --fix"
},
"dependencies": {
"@contentstack/cli-utilities": "~1.11.0",
"@contentstack/cli-utilities": "~1.11.1",
"contentstack": "^3.25.2"
},
"devDependencies": {
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/1.11.1 darwin-arm64 node-v23.11.0
@contentstack/cli-config/1.12.0 darwin-arm64 node-v22.14.0
$ 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 @@ -22,7 +22,7 @@
},
"dependencies": {
"@contentstack/cli-command": "~1.5.0",
"@contentstack/cli-utilities": "~1.11.0",
"@contentstack/cli-utilities": "~1.11.1",
"lodash": "^4.17.21"
},
"devDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion packages/contentstack-export-to-csv/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"bugs": "https://github.com/contentstack/cli/issues",
"dependencies": {
"@contentstack/cli-command": "~1.5.0",
"@contentstack/cli-utilities": "~1.11.0",
"@contentstack/cli-utilities": "~1.11.1",
"fast-csv": "^4.3.6",
"inquirer": "8.2.6",
"inquirer-checkbox-plus-prompt": "1.4.2",
Expand Down
2 changes: 1 addition & 1 deletion packages/contentstack-export/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"@contentstack/cli-command": "~1.5.0",
"@contentstack/cli-variants": "~1.2.1",
"@oclif/core": "^4.2.7",
"@contentstack/cli-utilities": "~1.11.0",
"@contentstack/cli-utilities": "~1.11.1",
"async": "^3.2.6",
"big-json": "^3.2.0",
"bluebird": "^3.7.2",
Expand Down
2 changes: 1 addition & 1 deletion packages/contentstack-import-setup/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ $ npm install -g @contentstack/cli-cm-import-setup
$ csdx COMMAND
running command...
$ csdx (--version)
@contentstack/cli-cm-import-setup/1.2.0 darwin-arm64 node-v23.11.0
@contentstack/cli-cm-import-setup/1.2.0 darwin-arm64 node-v22.14.0
$ csdx --help [COMMAND]
USAGE
$ csdx COMMAND
Expand Down
2 changes: 1 addition & 1 deletion packages/contentstack-import-setup/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"dependencies": {
"@contentstack/cli-command": "~1.5.0",
"@oclif/core": "^4.2.7",
"@contentstack/cli-utilities": "~1.11.0",
"@contentstack/cli-utilities": "~1.11.1",
"big-json": "^3.2.0",
"chalk": "^4.1.2",
"fs-extra": "^11.1.1",
Expand Down
2 changes: 1 addition & 1 deletion packages/contentstack-import/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ $ npm install -g @contentstack/cli-cm-import
$ csdx COMMAND
running command...
$ csdx (--version)
@contentstack/cli-cm-import/1.21.1 darwin-arm64 node-v23.11.0
@contentstack/cli-cm-import/1.22.0 darwin-arm64 node-v22.11.0
$ csdx --help [COMMAND]
USAGE
$ csdx COMMAND
Expand Down
4 changes: 2 additions & 2 deletions packages/contentstack-import/package.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
{
"name": "@contentstack/cli-cm-import",
"description": "Contentstack CLI plugin to import content into stack",
"version": "1.21.4",
"version": "1.22.0",
"author": "Contentstack",
"bugs": "https://github.com/contentstack/cli/issues",
"dependencies": {
"@contentstack/cli-audit": "~1.12.1",
"@contentstack/cli-command": "~1.5.0",
"@contentstack/cli-utilities": "~1.11.0",
"@contentstack/cli-utilities": "~1.11.1",
"@contentstack/management": "~1.20.2",
"@contentstack/cli-variants": "~1.2.1",
"@oclif/core": "^4.2.7",
Expand Down
12 changes: 8 additions & 4 deletions packages/contentstack-import/src/commands/cm/stacks/import.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,8 @@ export default class ImportCommand extends Command {
module: flags.string({
required: false,
char: 'm',
description: '[optional] Specify the module to import into the target stack. If not specified, the import command will import all the modules into the stack. The available modules are assets, content-types, entries, environments, extensions, marketplace-apps, global-fields, labels, locales, webhooks, workflows, custom-roles, and taxonomies.',
description:
'[optional] Specify the module to import into the target stack. If not specified, the import command will import all the modules into the stack. The available modules are assets, content-types, entries, environments, extensions, marketplace-apps, global-fields, labels, locales, webhooks, workflows, custom-roles, and taxonomies.',
parse: printFlagDeprecation(['-m'], ['--module']),
}),
'backup-dir': flags.string({
Expand All @@ -80,11 +81,13 @@ export default class ImportCommand extends Command {
}),
branch: flags.string({
char: 'B',
description: 'The name of the branch where you want to import your content. If you don\'t mention the branch name, then by default the content will be imported to the main branch.',
description:
"The name of the branch where you want to import your content. If you don't mention the branch name, then by default the content will be imported to the main branch.",
parse: printFlagDeprecation(['-B'], ['--branch']),
}),
'import-webhook-status': flags.string({
description: '[default: disable] (optional) This webhook state keeps the same state of webhooks as the source stack. <options: disable|current>',
description:
'[default: disable] (optional) This webhook state keeps the same state of webhooks as the source stack. <options: disable|current>',
options: ['disable', 'current'],
required: false,
default: 'disable',
Expand All @@ -96,6 +99,7 @@ export default class ImportCommand extends Command {
}),
'skip-app-recreation': flags.boolean({
description: '(optional) Skips the recreation of private apps if they already exist.',
parse: printFlagDeprecation(['--skip-app-recreation']),
}),
'replace-existing': flags.boolean({
required: false,
Expand Down Expand Up @@ -156,7 +160,7 @@ export default class ImportCommand extends Command {
.branch()
.query()
.find()
.then(({ items }: any) => items)
.then(({ items }: any) => items);
if (branches.length) {
flags.branch = 'main';
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ export default class ImportMarketplaceApps {
if (canCreatePrivateApp) {
log(this.importConfig, 'Starting developer hub private apps re-creation', 'success');
for (let app of privateApps) {
if (this.importConfig.skipPrivateAppRecreationIfExist && (await this.isPrivateAppExistInDeveloperHub(app))) {
if (await this.isPrivateAppExistInDeveloperHub(app)) {
// NOTE Found app already exist in the same org
this.appUidMapping[app.uid] = app.uid;
cliux.print(`App '${app.manifest.name}' already exist. skipping app recreation.!`, { color: 'yellow' });
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@ const setupConfig = async (importCmdFlags: any): Promise<ImportConfig> => {
config = merge.recursive(config, externalConfig);
}

config.contentDir = sanitizePath(importCmdFlags['data'] || importCmdFlags['data-dir'] || config.data || (await askContentDir()));
config.contentDir = sanitizePath(
importCmdFlags['data'] || importCmdFlags['data-dir'] || config.data || (await askContentDir()),
);
const pattern = /[*$%#<>{}!&?]/g;
if (pattern.test(config.contentDir)) {
cliux.print(`\nPlease add a directory path without any of the special characters: (*,&,{,},[,],$,%,<,>,?,!)`, {
Expand Down Expand Up @@ -75,7 +77,7 @@ const setupConfig = async (importCmdFlags: any): Promise<ImportConfig> => {
config.skipAudit = importCmdFlags['skip-audit'];
config.forceStopMarketplaceAppsPrompt = importCmdFlags.yes;
config.importWebhookStatus = importCmdFlags['import-webhook-status'];
config.skipPrivateAppRecreationIfExist = importCmdFlags['skip-app-recreation'];
config.skipPrivateAppRecreationIfExist = !importCmdFlags['skip-app-recreation'];

if (importCmdFlags['branch']) {
config.branchName = importCmdFlags['branch'];
Expand All @@ -89,7 +91,7 @@ const setupConfig = async (importCmdFlags: any): Promise<ImportConfig> => {
if (importCmdFlags['backup-dir']) {
config.useBackedupDir = importCmdFlags['backup-dir'];
}

if (importCmdFlags['skip-assets-publish']) {
config.skipAssetsPublish = importCmdFlags['skip-assets-publish'];
}
Expand Down
2 changes: 1 addition & 1 deletion packages/contentstack-migrate-rte/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ $ npm install -g @contentstack/cli-cm-migrate-rte
$ csdx COMMAND
running command...
$ csdx (--version)
@contentstack/cli-cm-migrate-rte/1.5.0 darwin-arm64 node-v23.11.0
@contentstack/cli-cm-migrate-rte/1.5.1 darwin-arm64 node-v22.14.0
$ csdx --help [COMMAND]
USAGE
$ csdx COMMAND
Expand Down
2 changes: 1 addition & 1 deletion packages/contentstack-migrate-rte/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"bugs": "https://github.com/contentstack/cli/issues",
"dependencies": {
"@contentstack/cli-command": "~1.5.0",
"@contentstack/cli-utilities": "~1.11.0",
"@contentstack/cli-utilities": "~1.11.1",
"@contentstack/json-rte-serializer": "~2.0.11",
"collapse-whitespace": "^1.1.7",
"chalk": "^4.1.2",
Expand Down
2 changes: 1 addition & 1 deletion packages/contentstack-migration/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"bugs": "https://github.com/contentstack/cli/issues",
"dependencies": {
"@contentstack/cli-command": "~1.5.0",
"@contentstack/cli-utilities": "~1.11.0",
"@contentstack/cli-utilities": "~1.11.1",
"async": "^3.2.6",
"callsites": "^3.1.0",
"cardinal": "^2.1.1",
Expand Down
6 changes: 3 additions & 3 deletions packages/contentstack-seed/package.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
{
"name": "@contentstack/cli-cm-seed",
"description": "create a Stack from existing content types, entries, assets, etc.",
"version": "1.11.0",
"version": "1.11.1",
"author": "Contentstack",
"bugs": "https://github.com/contentstack/cli/issues",
"dependencies": {
"@contentstack/cli-cm-import": "~1.21.3",
"@contentstack/cli-cm-import": "~1.22.0",
"@contentstack/cli-command": "~1.5.0",
"@contentstack/cli-utilities": "~1.11.0",
"@contentstack/cli-utilities": "~1.11.1",
"@contentstack/management": "~1.20.2",
"inquirer": "8.2.6",
"mkdirp": "^1.0.4",
Expand Down
2 changes: 1 addition & 1 deletion packages/contentstack-utilities/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@contentstack/cli-utilities",
"version": "1.11.0",
"version": "1.11.1",
"description": "Utilities for contentstack projects",
"main": "lib/index.js",
"types": "lib/index.d.ts",
Expand Down
22 changes: 22 additions & 0 deletions packages/contentstack-utilities/src/config-handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,23 @@ class Config {
}
}

isConfigFileValid(configPath: string): boolean {
try {
const content = readFileSync(configPath, 'utf8');
JSON.parse(content);
return true;
} catch (e) {
return false;
}
}

safeDeleteConfigIfInvalid(configFilePath: string) {
if (existsSync(configFilePath) && !this.isConfigFileValid(configFilePath)) {
console.warn(chalk.yellow(`Warning: Detected corrupted config at ${configFilePath}. Removing...`));
unlinkSync(configFilePath);
}
}

removeOldConfigStoreFile() {
if (existsSync(oldConfigPath)) {
unlinkSync(oldConfigPath); // NOTE remove old configstore file
Expand Down Expand Up @@ -110,8 +127,10 @@ class Config {
private getEncryptedConfig(configData?: Record<string, unknown>, skip = false) {
const getEncryptedDataElseFallBack = () => {
try {

// NOTE reading current code base encrypted file if exist
const encryptionKey: any = this.getObfuscationKey();
this.safeDeleteConfigIfInvalid(oldConfigPath);
this.config = new Conf({ configName: CONFIG_NAME, encryptionKey, cwd });

if (Object.keys(configData || {})?.length) {
Expand All @@ -133,6 +152,7 @@ class Config {

try {
if (skip === false) {
this.safeDeleteConfigIfInvalid(oldConfigPath);
const config = new Conf({ configName: CONFIG_NAME });
const oldConfigData = this.getConfigDataAndUnlinkConfigFile(config);
this.getEncryptedConfig(oldConfigData, true);
Expand All @@ -150,6 +170,7 @@ class Config {

private getDecryptedConfig(configData?: Record<string, unknown>) {
try {
this.safeDeleteConfigIfInvalid(oldConfigPath);
this.config = new Conf({ configName: CONFIG_NAME, cwd });

if (Object.keys(configData || {})?.length) {
Expand All @@ -160,6 +181,7 @@ class Config {

try {
const encryptionKey: any = this.getObfuscationKey();
this.safeDeleteConfigIfInvalid(oldConfigPath);
let config = new Conf({ configName: CONFIG_NAME, encryptionKey, cwd });
const oldConfigData = this.getConfigDataAndUnlinkConfigFile(config);
this.getDecryptedConfig(oldConfigData); // NOTE NOTE reinitialize the config with old data and new decrypted file
Expand Down
Loading
Loading