Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
77301ae
fix: handling ignored content-types
Mar 17, 2025
f687b4f
fix: version bumped and no item selection message handlign
Mar 18, 2025
077c603
fix; updated package-lock
Mar 20, 2025
7254bff
fix: fixed ignore item for modified and deleted groups
Mar 24, 2025
a239b0b
fix: resolved conflicts
Apr 7, 2025
34bb7b0
Fixed removal of fields that contain references
cs-raj Apr 21, 2025
5ab94c2
Merge pull request #1882 from contentstack/fix/back-merge
harshithad0703 Apr 21, 2025
2738235
Merge branch 'development' into fix/DX-2879
cs-raj Apr 22, 2025
94fac25
Merge pull request #1883 from contentstack/fix/DX-2879
cs-raj Apr 22, 2025
f9b9578
Fix: Added check for removing field
cs-raj Apr 23, 2025
f3c5f19
Fix: Version bump
cs-raj Apr 23, 2025
fd6d6bc
Merge branch 'development' into fix/DX-89
aman19K Apr 23, 2025
93bbaa7
Merge pull request #1816 from contentstack/fix/DX-89
aman19K Apr 23, 2025
3a058e7
Merge branch 'development' into fix/development
cs-raj Apr 23, 2025
d6ab8e1
Merge pull request #1887 from contentstack/fix/development
cs-raj Apr 23, 2025
1291a7e
Merge branch 'development' into fix/DX-2894
cs-raj Apr 23, 2025
c68ac12
Merge pull request #1885 from contentstack/fix/DX-2894
cs-raj Apr 23, 2025
2581c49
fix: Locale not getting mapped properly with fallback locales
aman19K Apr 23, 2025
5388979
Merge pull request #1889 from contentstack/fix/DX-2893
aman19K Apr 23, 2025
4cac78d
Merge branch 'staging' into development
cs-raj Apr 23, 2025
6dff857
Merge pull request #1891 from contentstack/fix/dev
cs-raj Apr 23, 2025
033a100
Branches version bump
cs-raj Apr 23, 2025
ad9a339
root
cs-raj Apr 23, 2025
44ef337
Merge pull request #1892 from contentstack/fix/dev2
cs-raj Apr 23, 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
621 changes: 320 additions & 301 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.6.0
@contentstack/cli-audit/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-audit/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@contentstack/cli-audit",
"version": "1.12.0",
"version": "1.12.1",
"description": "Contentstack audit plugin",
"author": "Contentstack CLI",
"homepage": "https://github.com/contentstack/cli",
Expand Down
1 change: 1 addition & 0 deletions packages/contentstack-audit/src/config/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ const config = {
'field-rules',
],
'fix-fields': ['reference', 'global_field', 'json:rte', 'json:extension', 'blocks', 'group', 'content_types'],
'schema-fields-data-type': ['blocks','group','global_field'],
moduleConfig: {
'content-types': {
name: 'content type',
Expand Down
10 changes: 7 additions & 3 deletions packages/contentstack-audit/src/modules/content-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,6 @@ export default class ContentType {
field.schema = this.runFixOnSchema(tree, field.schema as ContentTypeSchemaType[]);
}
for (let child of field.schema ?? []) {

if (!fixTypes.includes(child.data_type) && child.data_type !== 'json') continue;

switch (child.data_type) {
Expand Down Expand Up @@ -487,8 +486,13 @@ export default class ContentType {
})
.filter((val: any) => {
if (this.config.skipFieldTypes.includes(val?.data_type)) return true;
if (val?.schema && isEmpty(val?.schema)) return false;
if (val?.reference_to && isEmpty(val?.reference_to)) return false;
if (
val?.schema &&
isEmpty(val?.schema) &&
(!val?.data_type || this.config['schema-fields-data-type'].includes(val.data_type))
)
return false;
if (val?.reference_to && isEmpty(val?.reference_to) && val.data_type === 'reference') return false;

return !!val;
}) as ContentTypeSchemaType[];
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.6.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-branches/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@contentstack/cli-cm-branches",
"description": "Contentstack CLI plugin to do branches operations",
"version": "1.4.0",
"version": "1.4.1",
"author": "Contentstack",
"bugs": "https://github.com/contentstack/cli/issues",
"dependencies": {
Expand Down
23 changes: 21 additions & 2 deletions packages/contentstack-branches/src/branch/merge-handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import os from 'os';
import path from 'path';
import forEach from 'lodash/forEach';
import { cliux } from '@contentstack/cli-utilities';
import chalk from 'chalk';
import { MergeInputOptions, MergeSummary } from '../interfaces';
import {
selectMergeStrategy,
Expand Down Expand Up @@ -107,6 +108,10 @@ export default class MergeHandler {
deleted: [],
};
const selectedItems = await selectCustomPreferences(module, this.branchCompareData[module]);
if (!selectedItems.length) {
cliux.print(chalk.red('No items were selected'));
process.exit(1);
}
forEach(selectedItems, (item) => {
this.mergeSettings.mergeContent[module][item.status].push(item.value);
this.mergeSettings.itemMergeStrategies.push(item.value);
Expand All @@ -132,8 +137,11 @@ export default class MergeHandler {
} else if (this.strategy === 'overwrite_with_compare') {
this.mergeSettings.strategy = 'overwrite_with_compare';
}

await this.displayMergeSummary();
if (this.checkEmptySelection()) {
cliux.print(chalk.red('No items selected'));
} else {
await this.displayMergeSummary();
}

if (!this.executeOption) {
const executionResponse = await selectMergeExecution();
Expand All @@ -152,6 +160,17 @@ export default class MergeHandler {
}
}

checkEmptySelection() {
for (let module in this.branchCompareData) {
if (this.mergeSettings.mergeContent[module]?.modified?.length
|| this.mergeSettings.mergeContent[module]?.added?.length
|| this.mergeSettings.mergeContent[module]?.deleted?.length) {
return false;
}
}
return true;
}

displayMergeSummary() {
if (this.mergeSettings.strategy !== 'ignore') {
for (let module in this.branchCompareData) {
Expand Down
1 change: 1 addition & 0 deletions packages/contentstack-branches/src/interfaces/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ export interface BranchDiffRes {
title: string;
type: string;
status: string;
merge_strategy?: string;
}

export interface BranchDiffSummary {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -196,15 +196,21 @@ function printCompactTextView(branchTextRes: BranchCompactTextRes): void {
if (branchTextRes.modified?.length || branchTextRes.added?.length || branchTextRes.deleted?.length) {
cliux.print(' ');
forEach(branchTextRes.added, (diff: BranchDiffRes) => {
cliux.print(chalk.green(`+ '${diff.title}' ${startCase(camelCase(diff.type))}`));
if (diff.merge_strategy !== 'ignore') {
cliux.print(chalk.green(`+ '${diff.title}' ${startCase(camelCase(diff.type))}`));
}
});

forEach(branchTextRes.modified, (diff: BranchDiffRes) => {
cliux.print(chalk.blue(`± '${diff.title}' ${startCase(camelCase(diff.type))}`));
if (diff.merge_strategy !== 'ignore') {
cliux.print(chalk.blue(`± '${diff.title}' ${startCase(camelCase(diff.type))}`));
}
});

forEach(branchTextRes.deleted, (diff: BranchDiffRes) => {
cliux.print(chalk.red(`- '${diff.title}' ${startCase(camelCase(diff.type))}`));
if (diff.merge_strategy !== 'ignore') {
cliux.print(chalk.red(`- '${diff.title}' ${startCase(camelCase(diff.type))}`));
}
});
}
}
Expand Down
2 changes: 1 addition & 1 deletion packages/contentstack-clone/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"dependencies": {
"@colors/colors": "^1.6.0",
"@contentstack/cli-cm-export": "~1.16.0",
"@contentstack/cli-cm-import": "~1.21.1",
"@contentstack/cli-cm-import": "~1.21.2",
"@contentstack/cli-command": "~1.5.0",
"@contentstack/cli-utilities": "~1.11.0",
"chalk": "^4.1.2",
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.12.0 darwin-arm64 node-v23.6.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-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.6.0
@contentstack/cli-cm-import/1.21.2 darwin-arm64 node-v22.14.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,11 +1,11 @@
{
"name": "@contentstack/cli-cm-import",
"description": "Contentstack CLI plugin to import content into stack",
"version": "1.21.1",
"version": "1.21.2",
"author": "Contentstack",
"bugs": "https://github.com/contentstack/cli/issues",
"dependencies": {
"@contentstack/cli-audit": "~1.12.0",
"@contentstack/cli-audit": "~1.12.1",
"@contentstack/cli-command": "~1.5.0",
"@contentstack/cli-utilities": "~1.11.0",
"@contentstack/management": "~1.20.2",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,12 @@ export default abstract class BaseClass {
case 'update-locale':
return this.stack
.locale(apiData.code)
.update({ locale: pick(apiData, [...this.modulesConfig.locales.requiredKeys]) as LocaleData })
.fetch()
.then((locale) => {
locale.name = apiData.name;
locale.fallback_locale = apiData.fallback_locale;
return locale.update();
})
.then(onSuccess)
.catch(onReject);
case 'create-cts':
Expand Down
2 changes: 1 addition & 1 deletion packages/contentstack-seed/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",
"dependencies": {
"@contentstack/cli-cm-import": "~1.21.1",
"@contentstack/cli-cm-import": "~1.21.2",
"@contentstack/cli-command": "~1.5.0",
"@contentstack/cli-utilities": "~1.11.0",
"@contentstack/management": "~1.20.2",
Expand Down
5 changes: 3 additions & 2 deletions packages/contentstack/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ $ npm install -g @contentstack/cli
$ csdx COMMAND
running command...
$ csdx (--version|-v)
@contentstack/cli/1.40.0 darwin-arm64 node-v23.6.0
@contentstack/cli/1.40.0 darwin-arm64 node-v22.14.0
$ csdx --help [COMMAND]
USAGE
$ csdx COMMAND
Expand Down Expand Up @@ -3775,7 +3775,8 @@ USAGE
$ csdx launch:functions [-p <value>] [-d <value>]

FLAGS
-d, --data-dir=<value> [default: /Users/aman.kumar/Documents/cli-repo/cli/packages/contentstack] Current working directory
-d, --data-dir=<value> [default: /Users/aman.kumar/Documents/datasync-repo/cli/packages/contentstack] Current working
directory
-p, --port=<value> [default: 3000] Port number

DESCRIPTION
Expand Down
12 changes: 6 additions & 6 deletions packages/contentstack/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@contentstack/cli",
"description": "Command-line tool (CLI) to interact with Contentstack",
"version": "1.40.0",
"version": "1.40.1",
"author": "Contentstack",
"bin": {
"csdx": "./bin/run.js"
Expand All @@ -22,15 +22,15 @@
"prepack": "pnpm compile && oclif manifest && oclif readme"
},
"dependencies": {
"@contentstack/cli-audit": "~1.12.0",
"@contentstack/cli-audit": "~1.12.1",
"@contentstack/cli-auth": "~1.4.0",
"@contentstack/cli-cm-bootstrap": "~1.14.0",
"@contentstack/cli-cm-branches": "~1.4.0",
"@contentstack/cli-cm-branches": "~1.4.1",
"@contentstack/cli-cm-bulk-publish": "~1.8.0",
"@contentstack/cli-cm-clone": "~1.14.0",
"@contentstack/cli-cm-export": "~1.16.0",
"@contentstack/cli-cm-export-to-csv": "~1.8.0",
"@contentstack/cli-cm-import": "~1.21.1",
"@contentstack/cli-cm-import": "~1.21.2",
"@contentstack/cli-cm-import-setup": "1.2.0",
"@contentstack/cli-cm-migrate-rte": "~1.5.0",
"@contentstack/cli-cm-seed": "~1.11.0",
Expand Down Expand Up @@ -67,13 +67,13 @@
"@types/sinon": "^10.0.20",
"chai": "^4.5.0",
"eslint": "^8.57.1",
"eslint-config-oclif": "^6.0.44",
"eslint-config-oclif": "^6.0.46",
"eslint-config-oclif-typescript": "^3.1.13",
"globby": "^10.0.2",
"mocha": "10.8.2",
"nock": "^13.5.6",
"nyc": "^15.1.0",
"oclif": "^4.17.44",
"oclif": "^4.17.46",
"rimraf": "^5.0.10",
"shelljs": "^0.9.2",
"sinon": "^19.0.5",
Expand Down
Loading
Loading