diff --git a/packages/contentstack-export/src/export/modules/assets.ts b/packages/contentstack-export/src/export/modules/assets.ts index 6b79da510..a5a529ad9 100644 --- a/packages/contentstack-export/src/export/modules/assets.ts +++ b/packages/contentstack-export/src/export/modules/assets.ts @@ -123,7 +123,6 @@ export default class ExportAssets extends BaseClass { this.assetsRootPath = pResolve( this.exportConfig.exportDir, - this.exportConfig.branchName || '', (this.assetsRootPath = pResolve(getExportBasePath(this.exportConfig), this.assetConfig.dirName)), ); log.debug(`Assets root path resolved to: ${this.assetsRootPath}`, this.exportConfig.context); diff --git a/packages/contentstack-export/src/export/modules/publishing-rules.ts b/packages/contentstack-export/src/export/modules/publishing-rules.ts index b1b045e0a..bd81c3ee2 100644 --- a/packages/contentstack-export/src/export/modules/publishing-rules.ts +++ b/packages/contentstack-export/src/export/modules/publishing-rules.ts @@ -23,7 +23,6 @@ export default class ExportPublishingRules extends BaseClass { async start(): Promise { this.publishingRulesFolderPath = pResolve( this.exportConfig.exportDir, - this.exportConfig.branchName || '', this.publishingRulesConfig.dirName, ); log.debug(`Publishing rules folder path: ${this.publishingRulesFolderPath}`, this.exportConfig.context); diff --git a/packages/contentstack-query-export/src/commands/cm/stacks/export-query.ts b/packages/contentstack-query-export/src/commands/cm/stacks/export-query.ts index e70e6c2de..dceeef6fa 100644 --- a/packages/contentstack-query-export/src/commands/cm/stacks/export-query.ts +++ b/packages/contentstack-query-export/src/commands/cm/stacks/export-query.ts @@ -75,7 +75,6 @@ export default class ExportQueryCommand extends Command { await loadChalk(); try { const { flags } = await this.parse(ExportQueryCommand); - this.initializeMessageHandler(); // Setup export configuration const exportQueryConfig = await setupQueryExportConfig(flags); @@ -116,8 +115,4 @@ export default class ExportQueryCommand extends Command { handleAndLogError(error); } } - - initializeMessageHandler(): void { - messageHandler.init(this.context); - } } diff --git a/packages/contentstack-query-export/src/core/query-executor.ts b/packages/contentstack-query-export/src/core/query-executor.ts index dd48183df..703aa1759 100644 --- a/packages/contentstack-query-export/src/core/query-executor.ts +++ b/packages/contentstack-query-export/src/core/query-executor.ts @@ -101,16 +101,8 @@ export class QueryExporter { log.info('Starting export of referenced content types and dependent modules...', this.exportQueryConfig.context); try { - const ctPath = path.join( - sanitizePath(this.exportQueryConfig.exportDir), - sanitizePath(this.exportQueryConfig.branchName || ''), - 'content_types', - ); - const gfPath = path.join( - sanitizePath(this.exportQueryConfig.exportDir), - sanitizePath(this.exportQueryConfig.branchName || ''), - 'global_fields', - ); + const ctPath = path.join(sanitizePath(this.exportQueryConfig.exportDir), 'content_types'); + const gfPath = path.join(sanitizePath(this.exportQueryConfig.exportDir), 'global_fields'); const referencedHandler = new ReferencedContentTypesHandler(this.exportQueryConfig); const dependenciesHandler = new ContentTypeDependenciesHandler(this.stackAPIClient, this.exportQueryConfig); @@ -212,7 +204,10 @@ export class QueryExporter { } if (!foundNewCTs && !foundNewGFs) { - log.info('Schema closure complete, no new content types or global fields found', this.exportQueryConfig.context); + log.info( + 'Schema closure complete, no new content types or global fields found', + this.exportQueryConfig.context, + ); break; } } @@ -220,7 +215,10 @@ export class QueryExporter { // Personalize is a single global module exported once after the closure stabilises. await this.moduleExporter.exportModule('personalize'); - log.success('Referenced content types and dependent modules exported successfully', this.exportQueryConfig.context); + log.success( + 'Referenced content types and dependent modules exported successfully', + this.exportQueryConfig.context, + ); } catch (error) { handleAndLogError(error, this.exportQueryConfig.context, 'Error during schema closure expansion'); throw error; @@ -266,11 +264,7 @@ export class QueryExporter { log.info('Starting export of referenced assets...', this.exportQueryConfig.context); try { - const assetsDir = path.join( - sanitizePath(this.exportQueryConfig.exportDir), - sanitizePath(this.exportQueryConfig.branchName || ''), - 'assets', - ); + const assetsDir = path.join(sanitizePath(this.exportQueryConfig.exportDir), 'assets'); const metadataFilePath = path.join(assetsDir, 'metadata.json'); const assetFilePath = path.join(assetsDir, 'assets.json'); diff --git a/packages/contentstack-query-export/src/utils/dependency-resolver.ts b/packages/contentstack-query-export/src/utils/dependency-resolver.ts index c0c63741b..417e1dc07 100644 --- a/packages/contentstack-query-export/src/utils/dependency-resolver.ts +++ b/packages/contentstack-query-export/src/utils/dependency-resolver.ts @@ -39,11 +39,7 @@ export class ContentTypeDependenciesHandler { if (schemas !== undefined) { allSchemas = schemas; } else { - const contentTypesFilePath = path.join( - sanitizePath(this.exportQueryConfig.exportDir), - sanitizePath(this.exportQueryConfig.branchName || ''), - 'content_types', - ); + const contentTypesFilePath = path.join(sanitizePath(this.exportQueryConfig.exportDir), 'content_types'); allSchemas = readContentTypeSchemas(contentTypesFilePath); } diff --git a/packages/contentstack-query-export/src/utils/referenced-asset-handler.ts b/packages/contentstack-query-export/src/utils/referenced-asset-handler.ts index 247b15048..e92e74f83 100644 --- a/packages/contentstack-query-export/src/utils/referenced-asset-handler.ts +++ b/packages/contentstack-query-export/src/utils/referenced-asset-handler.ts @@ -10,11 +10,7 @@ export class AssetReferenceHandler { constructor(exportQueryConfig: QueryExportConfig) { this.exportQueryConfig = exportQueryConfig; - this.entriesDir = path.join( - sanitizePath(exportQueryConfig.exportDir), - sanitizePath(exportQueryConfig.branchName || ''), - 'entries', - ); + this.entriesDir = path.join(sanitizePath(exportQueryConfig.exportDir), 'entries'); } /** @@ -28,7 +24,6 @@ export class AssetReferenceHandler { log.warn('Entries directory does not exist', this.exportQueryConfig.context); return []; } - // Global set to maintain unique asset UIDs across all files const globalAssetUIDs = new Set();