Skip to content

Commit

Permalink
Merge pull request #1254 from contentstack/fix/CS-43552
Browse files Browse the repository at this point in the history
Fix: Import flow breaks when there is a taxonomy field in the schema [CS-43552]
  • Loading branch information
antonyagustine authored Jan 23, 2024
2 parents 8b70c15 + a9037b1 commit d0da4af
Show file tree
Hide file tree
Showing 11 changed files with 25 additions and 17 deletions.
10 changes: 5 additions & 5 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

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.3.2",
"version": "1.3.3",
"description": "Contentstack audit plugin",
"author": "Contentstack CLI",
"homepage": "https://github.com/contentstack/cli",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ export default class Audit extends AuditBaseCommand {
try {
await this.start('cm:stacks:audit');
} catch (error) {
console.trace(error);
this.log(error instanceof Error ? error.message : error, 'error');
ux.action.stop('Process failed.!');
this.exit(1);
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
@@ -1,6 +1,7 @@
const config = {
showTerminalOutput: true,
skipRefs: ['sys_assets'],
skipFieldTypes: ['taxonomy'],
modules: ['content-types', 'global-fields', 'entries'],
'fix-fields': ['reference', 'global_field', 'json:rte', 'json:custom-field', 'blocks', 'group'],
moduleConfig: {
Expand Down
5 changes: 3 additions & 2 deletions packages/contentstack-audit/src/modules/content-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -379,8 +379,9 @@ export default class ContentType {
}
})
.filter((val: any) => {
if (val?.schema && isEmpty(val.schema)) return false;
if (val?.reference_to && isEmpty(val.reference_to)) return false;
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;

return !!val;
}) as ContentTypeSchemaType[];
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.4.0 darwin-arm64 node-v20.8.0
@contentstack/cli-cm-bulk-publish/1.4.0 darwin-arm64 node-v20.10.0
$ csdx --help [COMMAND]
USAGE
$ csdx COMMAND
Expand Down
2 changes: 1 addition & 1 deletion packages/contentstack-import/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@contentstack/cli-cm-import",
"description": "Contentstack CLI plugin to import content into stack",
"version": "1.13.0",
"version": "1.13.1",
"author": "Contentstack",
"bugs": "https://github.com/contentstack/cli/issues",
"dependencies": {
Expand Down
7 changes: 6 additions & 1 deletion packages/contentstack-import/src/import/module-importer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,12 @@ class ModuleImporter {

if (this.importConfig.moduleName) {
args.push('--modules', this.importConfig.moduleName);
} else if (this.importConfig.modules.types.length) {
this.importConfig.modules.types
.filter((val) => ['content-types', 'global-fields', 'entries'].includes(val))
.forEach((val) => {
args.push('--modules', val);
});
}

log(this.importConfig, 'Starting audit process', 'info');
Expand Down Expand Up @@ -159,7 +165,6 @@ class ModuleImporter {

return true;
} catch (error) {
trace(error);
log(this.importConfig, `Audit failed with following error. ${error}`, 'error');
}
}
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.13.0",
"@contentstack/cli-cm-import": "~1.13.1",
"@contentstack/cli-command": "~1.2.16",
"@contentstack/cli-utilities": "~1.5.10",
"inquirer": "8.2.4",
Expand Down
4 changes: 2 additions & 2 deletions packages/contentstack/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,15 @@
"prepack": "pnpm compile && oclif manifest && oclif readme"
},
"dependencies": {
"@contentstack/cli-audit": "~1.3.2",
"@contentstack/cli-audit": "~1.3.3",
"@contentstack/cli-auth": "~1.3.17",
"@contentstack/cli-cm-bootstrap": "~1.7.1",
"@contentstack/cli-cm-branches": "~1.0.21",
"@contentstack/cli-cm-bulk-publish": "~1.4.0",
"@contentstack/cli-cm-clone": "~1.9.0",
"@contentstack/cli-cm-export": "~1.10.2",
"@contentstack/cli-cm-export-to-csv": "~1.6.2",
"@contentstack/cli-cm-import": "~1.13.0",
"@contentstack/cli-cm-import": "~1.13.1",
"@contentstack/cli-cm-migrate-rte": "~1.4.15",
"@contentstack/cli-cm-seed": "~1.7.1",
"@contentstack/cli-command": "~1.2.17",
Expand Down
6 changes: 3 additions & 3 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit d0da4af

Please sign in to comment.