From 859f315a2de92a54326c7f50c548fe5ed67cfb87 Mon Sep 17 00:00:00 2001 From: Aman Kumar Date: Thu, 18 Jan 2024 19:09:42 +0530 Subject: [PATCH 1/9] fix: command not working on window os & script not generated for all CT --- .../src/branch/merge-handler.ts | 48 ++++++++----------- .../src/utils/create-merge-scripts.ts | 18 +++---- 2 files changed, 30 insertions(+), 36 deletions(-) diff --git a/packages/contentstack-branches/src/branch/merge-handler.ts b/packages/contentstack-branches/src/branch/merge-handler.ts index aa91ede899..f68f36bb6c 100644 --- a/packages/contentstack-branches/src/branch/merge-handler.ts +++ b/packages/contentstack-branches/src/branch/merge-handler.ts @@ -241,7 +241,6 @@ export default class MergeHandler { async executeEntryExpFlow(mergeJobUID: string, mergePayload) { const { mergeContent } = this.mergeSettings; let mergePreference = await selectContentMergePreference(); - let selectedMergePreference; const updateEntryMergeStrategy = (items, mergeStrategy) => { items && @@ -250,25 +249,16 @@ export default class MergeHandler { }); }; - switch (mergePreference) { - case 'existing_new': - selectedMergePreference = 'merge_existing_new'; - updateEntryMergeStrategy(mergeContent.content_types.added, selectedMergePreference); - updateEntryMergeStrategy(mergeContent.content_types.modified, selectedMergePreference); - break; - - case 'new': - selectedMergePreference = 'merge_new'; - updateEntryMergeStrategy(mergeContent.content_types.added, selectedMergePreference); - break; - - case 'existing': - selectedMergePreference = 'merge_existing'; - updateEntryMergeStrategy(mergeContent.content_types.modified, selectedMergePreference); - break; + const mergePreferencesMap = { + 'existing_new': 'merge_existing_new', + 'new': 'merge_new', + 'existing': 'merge_existing', + 'ask_preference': 'custom', + }; + const selectedMergePreference = mergePreferencesMap[mergePreference]; - case 'ask_preference': - selectedMergePreference = 'custom'; + if (selectedMergePreference) { + if (selectedMergePreference === 'custom') { const selectedMergeItems = await selectContentMergeCustomPreferences(mergeContent.content_types); mergeContent.content_types = { added: [], @@ -279,23 +269,25 @@ export default class MergeHandler { selectedMergeItems?.forEach((item) => { mergeContent.content_types[item.status].push(item.value); }); - break; - - default: - cliux.error(`error: Invalid preference ${mergePreference}`); - process.exit(1); + } else { + updateEntryMergeStrategy(mergeContent.content_types.added, selectedMergePreference); + updateEntryMergeStrategy(mergeContent.content_types.modified, selectedMergePreference); + } + } else { + cliux.error(`error: Invalid preference ${mergePreference}`); + process.exit(1); } let scriptFolderPath = generateMergeScripts(mergeContent.content_types, mergeJobUID); if (scriptFolderPath !== undefined) { cliux.success(`\nSuccess! We have generated entry migration files in the folder ${scriptFolderPath}`); - cliux.print('\nWARNING!!! Migration is not intended to be run more than once. Migrated(entries/assets) will be duplicated if run more than once', {color: 'yellow'}); + cliux.print('\nWARNING!!! Migration is not intended to be run more than once. Migrated(entries/assets) will be duplicated if run more than once', { color: 'yellow' }); let migrationCommand: string; - if(os.platform() === 'win32'){ - migrationCommand = `csdx cm:stacks:migration --multiple --file-path ./${scriptFolderPath} --config compare-branch:${mergePayload.compare_branch},file-path:./${scriptFolderPath} --branch ${mergePayload.base_branch} --stack-api-key ${this.stackAPIKey}`; - }else{ + if (os.platform() === 'win32') { + migrationCommand = `csdx cm:stacks:migration --multiple --file-path ./${scriptFolderPath} --config compare-branch:${mergePayload.compare_branch} file-path:./${scriptFolderPath} --branch ${mergePayload.base_branch} --stack-api-key ${this.stackAPIKey}`; + } else { migrationCommand = `csdx cm:stacks:migration --multiple --file-path ./${scriptFolderPath} --config {compare-branch:${mergePayload.compare_branch},file-path:./${scriptFolderPath}} --branch ${mergePayload.base_branch} --stack-api-key ${this.stackAPIKey}`; } diff --git a/packages/contentstack-branches/src/utils/create-merge-scripts.ts b/packages/contentstack-branches/src/utils/create-merge-scripts.ts index 95c2cf1bbc..42882734ec 100644 --- a/packages/contentstack-branches/src/utils/create-merge-scripts.ts +++ b/packages/contentstack-branches/src/utils/create-merge-scripts.ts @@ -34,21 +34,22 @@ export function generateMergeScripts(mergeSummary, mergeJobUID) { const processContentTypes = (contentTypes, messageType) => { if (contentTypes && contentTypes.length > 0) { - processContentType( - { type: 'assets', uid: '', entry_merge_strategy: '' }, - mergeStrategies['asset_create_folder'], - ); contentTypes.forEach((contentType) => { const mergeStrategy = contentType.entry_merge_strategy; if (mergeStrategies.hasOwnProperty(mergeStrategy)) { processContentType(contentType, mergeStrategies[mergeStrategy]); } }); + cliux.print(`Info: ${messageType} content types' entries selected for merge`, { color: 'blue' }); } else { - cliux.print(`No ${messageType} entries selected for merge`, { color: 'yellow' }); + cliux.print(`Info: No ${messageType} content types' entries selected for merge`, { color: 'blue' }); } }; - + + processContentType( + { type: 'assets', uid: '', entry_merge_strategy: '' }, + mergeStrategies['asset_create_folder'], + ); processContentTypes(mergeSummary.modified, 'Modified'); processContentTypes(mergeSummary.added, 'New'); @@ -93,10 +94,11 @@ export function createMergeScripts(contentType: CreateMergeScriptsProps, mergeJo fs.mkdirSync(fullPath); } let filePath: string; + let milliSeconds = date.getMilliseconds().toString().padStart(3, '0') if (contentType.type === 'assets') { - filePath = `${fullPath}/${fileCreatedAt}_create_assets_folder.js`; + filePath = `${fullPath}/${fileCreatedAt}${milliSeconds}_create_assets_folder.js`; } else { - filePath = `${fullPath}/${fileCreatedAt}_${getContentTypeMergeStatus(contentType.entry_merge_strategy)}_${ + filePath = `${fullPath}/${fileCreatedAt}${milliSeconds}_${getContentTypeMergeStatus(contentType.entry_merge_strategy)}_${ contentType.uid }.js`; } From 3bfa0e49ac800dee2a0b94a26f2fe3e893575c63 Mon Sep 17 00:00:00 2001 From: Aman Kumar Date: Fri, 19 Jan 2024 12:44:01 +0530 Subject: [PATCH 2/9] refactor: entries migration msg --- .../contentstack-branches/src/utils/create-merge-scripts.ts | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/packages/contentstack-branches/src/utils/create-merge-scripts.ts b/packages/contentstack-branches/src/utils/create-merge-scripts.ts index 42882734ec..7b86b04358 100644 --- a/packages/contentstack-branches/src/utils/create-merge-scripts.ts +++ b/packages/contentstack-branches/src/utils/create-merge-scripts.ts @@ -40,9 +40,7 @@ export function generateMergeScripts(mergeSummary, mergeJobUID) { processContentType(contentType, mergeStrategies[mergeStrategy]); } }); - cliux.print(`Info: ${messageType} content types' entries selected for merge`, { color: 'blue' }); - } else { - cliux.print(`Info: No ${messageType} content types' entries selected for merge`, { color: 'blue' }); + cliux.print(`Info: Entries of ${messageType} content types selected for the migration`, { color: 'blue' }); } }; From d7305e88f05874f4062115911022c265d8ffe8dd Mon Sep 17 00:00:00 2001 From: Antony Date: Fri, 19 Jan 2024 13:33:49 +0530 Subject: [PATCH 3/9] Fix: Import flow breaks when there is a taxonomy field in the schema. --- package-lock.json | 4 ++-- packages/contentstack-audit/package.json | 2 +- packages/contentstack-audit/src/config/index.ts | 1 + .../src/modules/content-types.ts | 1 + packages/contentstack-bulk-publish/README.md | 2 +- .../src/import/module-importer.ts | 6 ++++++ packages/contentstack/package.json | 2 +- pnpm-lock.yaml | 16 ++++++++-------- 8 files changed, 21 insertions(+), 13 deletions(-) diff --git a/package-lock.json b/package-lock.json index e7cf5847c3..ddfd93b3a9 100644 --- a/package-lock.json +++ b/package-lock.json @@ -23493,7 +23493,7 @@ "version": "1.12.1", "license": "MIT", "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.20", @@ -23558,7 +23558,7 @@ }, "packages/contentstack-audit": { "name": "@contentstack/cli-audit", - "version": "1.3.2", + "version": "1.3.3", "license": "MIT", "dependencies": { "@contentstack/cli-command": "~1.2.16", diff --git a/packages/contentstack-audit/package.json b/packages/contentstack-audit/package.json index 202e4c6d65..70f1cb1726 100644 --- a/packages/contentstack-audit/package.json +++ b/packages/contentstack-audit/package.json @@ -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", diff --git a/packages/contentstack-audit/src/config/index.ts b/packages/contentstack-audit/src/config/index.ts index fd25645bfb..7a5a773273 100644 --- a/packages/contentstack-audit/src/config/index.ts +++ b/packages/contentstack-audit/src/config/index.ts @@ -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: { diff --git a/packages/contentstack-audit/src/modules/content-types.ts b/packages/contentstack-audit/src/modules/content-types.ts index 0b544992f5..dc0a672363 100644 --- a/packages/contentstack-audit/src/modules/content-types.ts +++ b/packages/contentstack-audit/src/modules/content-types.ts @@ -379,6 +379,7 @@ 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; diff --git a/packages/contentstack-bulk-publish/README.md b/packages/contentstack-bulk-publish/README.md index 2518496f86..d7f25b559d 100644 --- a/packages/contentstack-bulk-publish/README.md +++ b/packages/contentstack-bulk-publish/README.md @@ -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 diff --git a/packages/contentstack-import/src/import/module-importer.ts b/packages/contentstack-import/src/import/module-importer.ts index 1fd509978e..80119d1274 100755 --- a/packages/contentstack-import/src/import/module-importer.ts +++ b/packages/contentstack-import/src/import/module-importer.ts @@ -1,3 +1,4 @@ +import pick from 'lodash/pick'; import { resolve } from 'path'; import { AuditFix } from '@contentstack/cli-audit'; import messages, { $t } from '@contentstack/cli-audit/lib/messages'; @@ -130,6 +131,11 @@ class ModuleImporter { if (this.importConfig.moduleName) { args.push('--modules', this.importConfig.moduleName); + } else if (this.importConfig.modules.types.length) { + args.push( + '--modules', + pick(this.importConfig.modules.types, ['global-fields', 'content-types', 'entries']).join(), + ); } log(this.importConfig, 'Starting audit process', 'info'); diff --git a/packages/contentstack/package.json b/packages/contentstack/package.json index 9e4921c8d7..acbde022bf 100755 --- a/packages/contentstack/package.json +++ b/packages/contentstack/package.json @@ -22,7 +22,7 @@ "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.20", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 9cfe8e1a66..d1b21cb8ef 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -10,7 +10,7 @@ importers: packages/contentstack: specifiers: - '@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.20 @@ -1565,11 +1565,11 @@ packages: resolution: {integrity: sha512-Ir+AOibqzrIsL6ajt3Rz3LskB7OiMVHqltZmspbW/TJuTVuyOMirVqAkjfY6JISiLHgyNqicAC8AyHHGzNd/dA==} engines: {node: '>=0.1.90'} - /@contentstack/cli-command/1.2.16_typescript@4.9.5: - resolution: {integrity: sha512-u8GecSKkRgMPAmsib1xtfcUF8T/+ZbHe4JKAibRLkVc7jIjwuToq36hPgGFMfUAK4HX/UZ09stS+f3dUN1maOA==} + /@contentstack/cli-command/1.2.17_typescript@4.9.5: + resolution: {integrity: sha512-z5DWK+S+fRAXIZc0eZH1aw/Vb84wqICzYlGi4nKtov56H7QMWHwb+dORmzQvBHCUjbT/5/cZc6wpBZkebAUc7Q==} engines: {node: '>=14.0.0'} dependencies: - '@contentstack/cli-utilities': 1.5.9_typescript@4.9.5 + '@contentstack/cli-utilities': 1.5.10_typescript@4.9.5 contentstack: 3.17.2 transitivePeerDependencies: - '@swc/core' @@ -1584,8 +1584,8 @@ packages: resolution: {integrity: sha512-JMfVLK3846DfaHfZxtvpiy5JZsDsLQjZwZiG9NxQnrN3ZQ1qfz4p8pIppBOf/e25yEF/OZRwuMrdvyB0UY1LXA==} engines: {node: '>=14.0.0'} dependencies: - '@contentstack/cli-command': 1.2.16_typescript@4.9.5 - '@contentstack/cli-utilities': 1.5.9_typescript@4.9.5 + '@contentstack/cli-command': 1.2.17_typescript@4.9.5 + '@contentstack/cli-utilities': 1.5.10_typescript@4.9.5 chalk: 4.1.2 debug: 4.3.4 inquirer: 8.2.4 @@ -1601,8 +1601,8 @@ packages: - typescript dev: true - /@contentstack/cli-utilities/1.5.9_typescript@4.9.5: - resolution: {integrity: sha512-VaLmJdn+4HHhcVLPpMOtlwX8Q8sCoF+gHcSAgPd/eUPOZeksHdC8shjl2ka7RTuT2XVHYusqD1OEVFZztdLlMA==} + /@contentstack/cli-utilities/1.5.10_typescript@4.9.5: + resolution: {integrity: sha512-UMypT6q+XqgeKp3mETcZo6WmSl4IVkz/FDWAqm/agnbHturovSvmbxjFxtSNX/8iLNe9E1bQC3n6KPGmxeWtlQ==} dependencies: '@contentstack/management': 1.13.0_debug@4.3.4 '@contentstack/marketplace-sdk': 1.0.1_debug@4.3.4 From 8d9d31f6996285248f72d183b967709f6ad73881 Mon Sep 17 00:00:00 2001 From: Antony Date: Fri, 19 Jan 2024 14:06:32 +0530 Subject: [PATCH 4/9] Module selection fix --- .../contentstack-import/src/import/module-importer.ts | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/packages/contentstack-import/src/import/module-importer.ts b/packages/contentstack-import/src/import/module-importer.ts index 80119d1274..92583bbd13 100755 --- a/packages/contentstack-import/src/import/module-importer.ts +++ b/packages/contentstack-import/src/import/module-importer.ts @@ -1,4 +1,3 @@ -import pick from 'lodash/pick'; import { resolve } from 'path'; import { AuditFix } from '@contentstack/cli-audit'; import messages, { $t } from '@contentstack/cli-audit/lib/messages'; @@ -132,10 +131,11 @@ class ModuleImporter { if (this.importConfig.moduleName) { args.push('--modules', this.importConfig.moduleName); } else if (this.importConfig.modules.types.length) { - args.push( - '--modules', - pick(this.importConfig.modules.types, ['global-fields', 'content-types', 'entries']).join(), - ); + this.importConfig.modules.types + .filter((val) => ['content-types', 'global-fields'].includes(val)) + .forEach((val) => { + args.push('--modules', val); + }); } log(this.importConfig, 'Starting audit process', 'info'); @@ -165,7 +165,6 @@ class ModuleImporter { return true; } catch (error) { - trace(error); log(this.importConfig, `Audit failed with following error. ${error}`, 'error'); } } From 1f1fd1507d013e3feb6989c22a1f9ad6207d066e Mon Sep 17 00:00:00 2001 From: Antony Date: Fri, 19 Jan 2024 14:08:38 +0530 Subject: [PATCH 5/9] Entries added in the audit fix list --- packages/contentstack-import/src/import/module-importer.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/contentstack-import/src/import/module-importer.ts b/packages/contentstack-import/src/import/module-importer.ts index 92583bbd13..95e4bca001 100755 --- a/packages/contentstack-import/src/import/module-importer.ts +++ b/packages/contentstack-import/src/import/module-importer.ts @@ -132,7 +132,7 @@ class ModuleImporter { args.push('--modules', this.importConfig.moduleName); } else if (this.importConfig.modules.types.length) { this.importConfig.modules.types - .filter((val) => ['content-types', 'global-fields'].includes(val)) + .filter((val) => ['content-types', 'global-fields', 'entries'].includes(val)) .forEach((val) => { args.push('--modules', val); }); From 4512c4a946399c1a3ce5e3562f1dccd769c1cf91 Mon Sep 17 00:00:00 2001 From: Antony Date: Mon, 22 Jan 2024 15:59:26 +0530 Subject: [PATCH 6/9] Audit issue fix --- .../src/commands/cm/stacks/audit/index.ts | 1 + packages/contentstack-audit/src/modules/content-types.ts | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/packages/contentstack-audit/src/commands/cm/stacks/audit/index.ts b/packages/contentstack-audit/src/commands/cm/stacks/audit/index.ts index f0dcd81221..57113bd0cb 100644 --- a/packages/contentstack-audit/src/commands/cm/stacks/audit/index.ts +++ b/packages/contentstack-audit/src/commands/cm/stacks/audit/index.ts @@ -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); diff --git a/packages/contentstack-audit/src/modules/content-types.ts b/packages/contentstack-audit/src/modules/content-types.ts index dc0a672363..8e26bdb6f4 100644 --- a/packages/contentstack-audit/src/modules/content-types.ts +++ b/packages/contentstack-audit/src/modules/content-types.ts @@ -379,9 +379,9 @@ 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 (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[]; From 2a175a99b0f5bdea67c830042b405cc068522ef4 Mon Sep 17 00:00:00 2001 From: Antony Date: Tue, 23 Jan 2024 10:14:06 +0530 Subject: [PATCH 7/9] Version bump --- package-lock.json | 6 +++--- packages/contentstack-import/package.json | 2 +- packages/contentstack-seed/package.json | 2 +- packages/contentstack/package.json | 2 +- pnpm-lock.yaml | 4 ++-- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/package-lock.json b/package-lock.json index ddfd93b3a9..4713436802 100644 --- a/package-lock.json +++ b/package-lock.json @@ -23501,7 +23501,7 @@ "@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", @@ -24920,7 +24920,7 @@ }, "packages/contentstack-import": { "name": "@contentstack/cli-cm-import", - "version": "1.13.0", + "version": "1.13.1", "license": "MIT", "dependencies": { "@contentstack/cli-audit": "^1.3.2", @@ -25381,7 +25381,7 @@ "version": "1.7.1", "license": "MIT", "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", diff --git a/packages/contentstack-import/package.json b/packages/contentstack-import/package.json index 185e5a6515..d407057776 100644 --- a/packages/contentstack-import/package.json +++ b/packages/contentstack-import/package.json @@ -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": { diff --git a/packages/contentstack-seed/package.json b/packages/contentstack-seed/package.json index a5998b0e1f..911afc2dd4 100644 --- a/packages/contentstack-seed/package.json +++ b/packages/contentstack-seed/package.json @@ -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", diff --git a/packages/contentstack/package.json b/packages/contentstack/package.json index acbde022bf..e6fce87d16 100755 --- a/packages/contentstack/package.json +++ b/packages/contentstack/package.json @@ -30,7 +30,7 @@ "@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", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index d1b21cb8ef..f4c9785c23 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -18,7 +18,7 @@ importers: '@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 @@ -984,7 +984,7 @@ importers: packages/contentstack-seed: specifiers: - '@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 '@oclif/plugin-help': ^5.1.19 From 2f48a18fd7eaa32efdf7f10229188f07413f0320 Mon Sep 17 00:00:00 2001 From: Aman Kumar Date: Tue, 23 Jan 2024 10:20:10 +0530 Subject: [PATCH 8/9] version bump --- package-lock.json | 6 +++--- packages/contentstack-branches/README.md | 2 +- packages/contentstack-branches/package.json | 2 +- packages/contentstack/README.md | 4 ++-- packages/contentstack/package.json | 4 ++-- pnpm-lock.yaml | 16 ++++++++-------- 6 files changed, 17 insertions(+), 17 deletions(-) diff --git a/package-lock.json b/package-lock.json index e7cf5847c3..e53a535649 100644 --- a/package-lock.json +++ b/package-lock.json @@ -23490,13 +23490,13 @@ }, "packages/contentstack": { "name": "@contentstack/cli", - "version": "1.12.1", + "version": "1.12.2", "license": "MIT", "dependencies": { "@contentstack/cli-audit": "~1.3.2", "@contentstack/cli-auth": "~1.3.17", "@contentstack/cli-cm-bootstrap": "~1.7.1", - "@contentstack/cli-cm-branches": "~1.0.20", + "@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", @@ -23923,7 +23923,7 @@ }, "packages/contentstack-branches": { "name": "@contentstack/cli-cm-branches", - "version": "1.0.20", + "version": "1.0.21", "license": "MIT", "dependencies": { "@contentstack/cli-command": "~1.2.16", diff --git a/packages/contentstack-branches/README.md b/packages/contentstack-branches/README.md index 2ecc88b069..d0ae021d5d 100755 --- a/packages/contentstack-branches/README.md +++ b/packages/contentstack-branches/README.md @@ -37,7 +37,7 @@ $ npm install -g @contentstack/cli-cm-branches $ csdx COMMAND running command... $ csdx (--version) -@contentstack/cli-cm-branches/1.0.20 darwin-arm64 node-v20.8.0 +@contentstack/cli-cm-branches/1.0.21 darwin-arm64 node-v20.8.0 $ csdx --help [COMMAND] USAGE $ csdx COMMAND diff --git a/packages/contentstack-branches/package.json b/packages/contentstack-branches/package.json index 29b95f9d6b..de7336ecdd 100644 --- a/packages/contentstack-branches/package.json +++ b/packages/contentstack-branches/package.json @@ -1,7 +1,7 @@ { "name": "@contentstack/cli-cm-branches", "description": "Contentstack CLI plugin to do branches operations", - "version": "1.0.20", + "version": "1.0.21", "author": "Contentstack", "bugs": "https://github.com/contentstack/cli/issues", "dependencies": { diff --git a/packages/contentstack/README.md b/packages/contentstack/README.md index d89bc05d95..228fedcb1c 100644 --- a/packages/contentstack/README.md +++ b/packages/contentstack/README.md @@ -18,7 +18,7 @@ $ npm install -g @contentstack/cli $ csdx COMMAND running command... $ csdx (--version|-v) -@contentstack/cli/1.12.1 darwin-arm64 node-v20.8.0 +@contentstack/cli/1.12.2 darwin-arm64 node-v20.8.0 $ csdx --help [COMMAND] USAGE $ csdx COMMAND @@ -3217,7 +3217,7 @@ DESCRIPTION Display help for csdx. ``` -_See code: [@oclif/plugin-help](https://github.com/oclif/plugin-help/blob/v5.2.14/src/commands/help.ts)_ +_See code: [@oclif/plugin-help](https://github.com/oclif/plugin-help/blob/v5.2.20/src/commands/help.ts)_ ## `csdx launch` diff --git a/packages/contentstack/package.json b/packages/contentstack/package.json index 9e4921c8d7..99c0982b14 100755 --- a/packages/contentstack/package.json +++ b/packages/contentstack/package.json @@ -1,7 +1,7 @@ { "name": "@contentstack/cli", "description": "Command-line tool (CLI) to interact with Contentstack", - "version": "1.12.1", + "version": "1.12.2", "author": "Contentstack", "bin": { "csdx": "./bin/run" @@ -25,7 +25,7 @@ "@contentstack/cli-audit": "~1.3.2", "@contentstack/cli-auth": "~1.3.17", "@contentstack/cli-cm-bootstrap": "~1.7.1", - "@contentstack/cli-cm-branches": "~1.0.20", + "@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", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 9cfe8e1a66..4404727212 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -13,7 +13,7 @@ importers: '@contentstack/cli-audit': ~1.3.2 '@contentstack/cli-auth': ~1.3.17 '@contentstack/cli-cm-bootstrap': ~1.7.1 - '@contentstack/cli-cm-branches': ~1.0.20 + '@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 @@ -1565,11 +1565,11 @@ packages: resolution: {integrity: sha512-Ir+AOibqzrIsL6ajt3Rz3LskB7OiMVHqltZmspbW/TJuTVuyOMirVqAkjfY6JISiLHgyNqicAC8AyHHGzNd/dA==} engines: {node: '>=0.1.90'} - /@contentstack/cli-command/1.2.16_typescript@4.9.5: - resolution: {integrity: sha512-u8GecSKkRgMPAmsib1xtfcUF8T/+ZbHe4JKAibRLkVc7jIjwuToq36hPgGFMfUAK4HX/UZ09stS+f3dUN1maOA==} + /@contentstack/cli-command/1.2.17_typescript@4.9.5: + resolution: {integrity: sha512-z5DWK+S+fRAXIZc0eZH1aw/Vb84wqICzYlGi4nKtov56H7QMWHwb+dORmzQvBHCUjbT/5/cZc6wpBZkebAUc7Q==} engines: {node: '>=14.0.0'} dependencies: - '@contentstack/cli-utilities': 1.5.9_typescript@4.9.5 + '@contentstack/cli-utilities': 1.5.10_typescript@4.9.5 contentstack: 3.17.2 transitivePeerDependencies: - '@swc/core' @@ -1584,8 +1584,8 @@ packages: resolution: {integrity: sha512-JMfVLK3846DfaHfZxtvpiy5JZsDsLQjZwZiG9NxQnrN3ZQ1qfz4p8pIppBOf/e25yEF/OZRwuMrdvyB0UY1LXA==} engines: {node: '>=14.0.0'} dependencies: - '@contentstack/cli-command': 1.2.16_typescript@4.9.5 - '@contentstack/cli-utilities': 1.5.9_typescript@4.9.5 + '@contentstack/cli-command': 1.2.17_typescript@4.9.5 + '@contentstack/cli-utilities': 1.5.10_typescript@4.9.5 chalk: 4.1.2 debug: 4.3.4 inquirer: 8.2.4 @@ -1601,8 +1601,8 @@ packages: - typescript dev: true - /@contentstack/cli-utilities/1.5.9_typescript@4.9.5: - resolution: {integrity: sha512-VaLmJdn+4HHhcVLPpMOtlwX8Q8sCoF+gHcSAgPd/eUPOZeksHdC8shjl2ka7RTuT2XVHYusqD1OEVFZztdLlMA==} + /@contentstack/cli-utilities/1.5.10_typescript@4.9.5: + resolution: {integrity: sha512-UMypT6q+XqgeKp3mETcZo6WmSl4IVkz/FDWAqm/agnbHturovSvmbxjFxtSNX/8iLNe9E1bQC3n6KPGmxeWtlQ==} dependencies: '@contentstack/management': 1.13.0_debug@4.3.4 '@contentstack/marketplace-sdk': 1.0.1_debug@4.3.4 From 3f88bc622dbb65918224f30ec317b4a141737014 Mon Sep 17 00:00:00 2001 From: raj pandey Date: Tue, 23 Jan 2024 11:22:34 +0530 Subject: [PATCH 9/9] fix for handling references in rte --- package-lock.json | 8 ++++---- packages/contentstack-clone/package.json | 2 +- packages/contentstack-import/package.json | 2 +- .../src/utils/content-type-helper.ts | 10 ++++++++++ packages/contentstack-seed/package.json | 2 +- packages/contentstack/package.json | 2 +- pnpm-lock.yaml | 6 +++--- 7 files changed, 21 insertions(+), 11 deletions(-) diff --git a/package-lock.json b/package-lock.json index e53a535649..4f34d09d73 100644 --- a/package-lock.json +++ b/package-lock.json @@ -23501,7 +23501,7 @@ "@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", @@ -24054,7 +24054,7 @@ "dependencies": { "@colors/colors": "^1.5.0", "@contentstack/cli-cm-export": "~1.10.2", - "@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", "async": "^3.2.4", @@ -24920,7 +24920,7 @@ }, "packages/contentstack-import": { "name": "@contentstack/cli-cm-import", - "version": "1.13.0", + "version": "1.13.1", "license": "MIT", "dependencies": { "@contentstack/cli-audit": "^1.3.2", @@ -25381,7 +25381,7 @@ "version": "1.7.1", "license": "MIT", "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", diff --git a/packages/contentstack-clone/package.json b/packages/contentstack-clone/package.json index 46e1791133..fe7fda0654 100644 --- a/packages/contentstack-clone/package.json +++ b/packages/contentstack-clone/package.json @@ -6,7 +6,7 @@ "bugs": "https://github.com/rohitmishra209/cli-cm-clone/issues", "dependencies": { "@contentstack/cli-cm-export": "~1.10.2", - "@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", "@colors/colors": "^1.5.0", diff --git a/packages/contentstack-import/package.json b/packages/contentstack-import/package.json index 185e5a6515..d407057776 100644 --- a/packages/contentstack-import/package.json +++ b/packages/contentstack-import/package.json @@ -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": { diff --git a/packages/contentstack-import/src/utils/content-type-helper.ts b/packages/contentstack-import/src/utils/content-type-helper.ts index 9fe732c849..1f6694481d 100644 --- a/packages/contentstack-import/src/utils/content-type-helper.ts +++ b/packages/contentstack-import/src/utils/content-type-helper.ts @@ -147,6 +147,16 @@ export const removeReferenceFields = async function ( flag.supressed = true; schema[i].reference_to = ['sys_assets']; } + else if ( + // handling entry references in rte + schema[i].data_type === 'text' && + schema[i].field_metadata.rich_text_type && + schema[i].field_metadata.embed_entry && + schema[i].reference_to.length >= 1 + ) { + flag.supressed = true; + schema[i].reference_to = ['sys_assets']; + } } }; diff --git a/packages/contentstack-seed/package.json b/packages/contentstack-seed/package.json index a5998b0e1f..911afc2dd4 100644 --- a/packages/contentstack-seed/package.json +++ b/packages/contentstack-seed/package.json @@ -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", diff --git a/packages/contentstack/package.json b/packages/contentstack/package.json index 99c0982b14..fea964092f 100755 --- a/packages/contentstack/package.json +++ b/packages/contentstack/package.json @@ -30,7 +30,7 @@ "@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", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 4404727212..a7d5103f50 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -18,7 +18,7 @@ importers: '@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 @@ -422,7 +422,7 @@ importers: specifiers: '@colors/colors': ^1.5.0 '@contentstack/cli-cm-export': ~1.10.2 - '@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 '@oclif/test': ^1.2.7 @@ -984,7 +984,7 @@ importers: packages/contentstack-seed: specifiers: - '@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 '@oclif/plugin-help': ^5.1.19