From 9de6910d73a301913705ea6db26ff1fa2f867a66 Mon Sep 17 00:00:00 2001 From: shafeeqd959 Date: Tue, 9 Dec 2025 16:18:29 +0530 Subject: [PATCH 1/2] updated UI text composable studio to studio --- .../src/commands/config/set/region.ts | 14 +-- .../test/unit/commands/region.test.ts | 2 +- .../contentstack-export/messages/index.json | 116 +++++++++--------- .../src/commands/cm/stacks/export.ts | 2 +- .../src/export/modules/composable-studio.ts | 24 ++-- .../contentstack-import/messages/index.json | 10 +- .../src/import/modules/composable-studio.ts | 21 ++-- 7 files changed, 93 insertions(+), 96 deletions(-) diff --git a/packages/contentstack-config/src/commands/config/set/region.ts b/packages/contentstack-config/src/commands/config/set/region.ts index 3ba9ec53be..45b9c9fd50 100644 --- a/packages/contentstack-config/src/commands/config/set/region.ts +++ b/packages/contentstack-config/src/commands/config/set/region.ts @@ -48,8 +48,8 @@ export default class RegionSetCommand extends BaseCommand --cda --ui-host --name "India" --developer-hub ', '$ csdx config:set:region --cma --cda --ui-host --name "India" --personalize ', '$ csdx config:set:region --cma --cda --ui-host --name "India" --launch ', - '$ csdx config:set:region --cma --cda --ui-host --name "India" --composable-studio ', - '$ csdx config:set:region --cda --cma --ui-host --name "India" --developer-hub --launch --personalize --composable-studio ', + '$ csdx config:set:region --cma --cda --ui-host --name "India" --studio ', + '$ csdx config:set:region --cda --cma --ui-host --name "India" --developer-hub --launch --personalize --studio ', ]; static args: ArgInput = { @@ -82,7 +82,7 @@ export default class RegionSetCommand extends BaseCommand { - log.debug('Starting Composable Studio project export process...', this.exportConfig.context); + log.debug('Starting Studio project export process...', this.exportConfig.context); if (!isAuthenticated()) { cliux.print( - 'WARNING!!! To export Composable Studio projects, you must be logged in. Please check csdx auth:login --help to log in', + 'WARNING!!! To export Studio projects, you must be logged in. Please check csdx auth:login --help to log in', { color: 'yellow' }, ); return Promise.resolve(); @@ -45,27 +45,27 @@ export default class ExportComposableStudio { this.exportConfig.branchName || '', this.composableStudioConfig.dirName, ); - log.debug(`Composable Studio folder path: ${this.composableStudioPath}`, this.exportConfig.context); + log.debug(`Studio folder path: ${this.composableStudioPath}`, this.exportConfig.context); await fsUtil.makeDirectory(this.composableStudioPath); - log.debug('Created Composable Studio directory', this.exportConfig.context); + log.debug('Created Studio directory', this.exportConfig.context); this.exportConfig.org_uid = this.exportConfig.org_uid || (await getOrgUid(this.exportConfig)); log.debug(`Organization UID: ${this.exportConfig.org_uid}`, this.exportConfig.context); await this.exportProjects(); - log.debug('Composable Studio project export process completed', this.exportConfig.context); + log.debug('Studio project export process completed', this.exportConfig.context); } /** - * Export Composable Studio projects connected to the current stack + * Export Studio projects connected to the current stack */ async exportProjects(): Promise { - log.debug('Starting Composable Studio project export...', this.exportConfig.context); + log.debug('Starting Studio project export...', this.exportConfig.context); try { // Get authentication details - following personalization-api-adapter pattern - log.debug('Initializing Composable Studio API authentication...', this.exportConfig.context); + log.debug('Initializing Studio API authentication...', this.exportConfig.context); await authenticationHandler.getAuthDetails(); const token = authenticationHandler.accessToken; log.debug( @@ -116,11 +116,11 @@ export default class ExportComposableStudio { // Use the first connected project (stacks should have only one project) this.composableStudioProject = connectedProject[0]; - log.debug(`Found Composable Studio project: ${this.composableStudioProject.name}`, this.exportConfig.context); + log.debug(`Found Studio project: ${this.composableStudioProject.name}`, this.exportConfig.context); // Write the project to file const composableStudioFilePath = pResolve(this.composableStudioPath, this.composableStudioConfig.fileName); - log.debug(`Writing Composable Studio project to: ${composableStudioFilePath}`, this.exportConfig.context); + log.debug(`Writing Studio project to: ${composableStudioFilePath}`, this.exportConfig.context); fsUtil.writeFile(composableStudioFilePath, this.composableStudioProject as unknown as Record); @@ -129,7 +129,7 @@ export default class ExportComposableStudio { this.exportConfig.context, ); } catch (error: any) { - log.debug('Error occurred while exporting Composable Studio project', this.exportConfig.context); + log.debug('Error occurred while exporting Studio project', this.exportConfig.context); handleAndLogError(error, { ...this.exportConfig.context, }); diff --git a/packages/contentstack-import/messages/index.json b/packages/contentstack-import/messages/index.json index 79f68971a6..32280640fb 100644 --- a/packages/contentstack-import/messages/index.json +++ b/packages/contentstack-import/messages/index.json @@ -1,9 +1,9 @@ { - "COMPOSABLE_STUDIO_IMPORT_START": "Starting Composable Studio project import...", - "COMPOSABLE_STUDIO_NOT_FOUND": "No Composable Studio project found in exported data", - "COMPOSABLE_STUDIO_SKIP_EXISTING": "Skipping Composable Studio import - target stack already has a connected project", - "COMPOSABLE_STUDIO_IMPORT_COMPLETE": "Successfully imported Composable Studio project '%s'", - "COMPOSABLE_STUDIO_IMPORT_FAILED": "Failed to import Composable Studio project: %s", + "COMPOSABLE_STUDIO_IMPORT_START": "Starting Studio project import...", + "COMPOSABLE_STUDIO_NOT_FOUND": "No Studio project found in exported data", + "COMPOSABLE_STUDIO_SKIP_EXISTING": "Skipping Studio import - target stack already has a connected project", + "COMPOSABLE_STUDIO_IMPORT_COMPLETE": "Successfully imported Studio project '%s'", + "COMPOSABLE_STUDIO_IMPORT_FAILED": "Failed to import Studio project: %s", "COMPOSABLE_STUDIO_NAME_CONFLICT": "Project name '%s' already exists. Please provide a new name:", "COMPOSABLE_STUDIO_SUGGEST_NAME": "Suggested name: %s", "COMPOSABLE_STUDIO_ENV_MAPPING_FAILED": "Warning: Could not map environment '%s', using empty environment" diff --git a/packages/contentstack-import/src/import/modules/composable-studio.ts b/packages/contentstack-import/src/import/modules/composable-studio.ts index 8c6425b536..1db7a82364 100644 --- a/packages/contentstack-import/src/import/modules/composable-studio.ts +++ b/packages/contentstack-import/src/import/modules/composable-studio.ts @@ -32,31 +32,28 @@ export default class ImportComposableStudio { this.envUidMapperPath = join(this.importConfig.backupDir, 'mapper', 'environments', 'uid-mapping.json'); this.envUidMapper = {}; - // Initialize HttpClient with Composable Studio API base URL + // Initialize HttpClient with Studio API base URL this.apiClient = new HttpClient(); this.apiClient.baseUrl(`${this.composableStudioConfig.apiBaseUrl}/${this.composableStudioConfig.apiVersion}`); } /** - * Entry point for Composable Studio import + * Entry point for Studio import */ async start(): Promise { if (this.importConfig.management_token) { - log.warn('Skipping Composable Studio project import when using management token', this.importConfig.context); + log.warn('Skipping Studio project import when using management token', this.importConfig.context); return; } - log.debug('Starting Composable Studio project import process...', this.importConfig.context); + log.debug('Starting Studio project import process...', this.importConfig.context); cliux.print(messageHandler.parse('COMPOSABLE_STUDIO_IMPORT_START'), { color: 'blue' }); try { // Initialize authentication const authInitialized = await this.addAuthHeaders(); if (!authInitialized) { - log.warn( - 'Skipping Composable Studio project import when using OAuth authentication', - this.importConfig.context, - ); + log.warn('Skipping Studio project import when using OAuth authentication', this.importConfig.context); return; } @@ -98,7 +95,7 @@ export default class ImportComposableStudio { * Initialize authentication headers for API calls */ async addAuthHeaders(): Promise { - log.debug('Initializing Composable Studio API authentication...', this.importConfig.context); + log.debug('Initializing Studio API authentication...', this.importConfig.context); // Get authentication details - following personalization-api-adapter pattern await authenticationHandler.getAuthDetails(); @@ -128,7 +125,7 @@ export default class ImportComposableStudio { Accept: 'application/json', }); - log.debug('Composable Studio API authentication initialized', this.importConfig.context); + log.debug('Studio API authentication initialized', this.importConfig.context); return true; } @@ -156,14 +153,14 @@ export default class ImportComposableStudio { log.debug(`Reading exported project from: ${this.composableStudioFilePath}`, this.importConfig.context); if (!fileHelper.fileExistsSync(this.composableStudioFilePath)) { - log.debug('Composable Studio project file does not exist', this.importConfig.context); + log.debug('Studio project file does not exist', this.importConfig.context); return null; } const projectData = fileHelper.readFileSync(this.composableStudioFilePath) as ComposableStudioProject; if (!projectData || isEmpty(projectData)) { - log.debug('Composable Studio project file is empty', this.importConfig.context); + log.debug('Studio project file is empty', this.importConfig.context); return null; } From 393d6cb5981385d126aac7cacf5d228de8af5d90 Mon Sep 17 00:00:00 2001 From: shafeeqd959 Date: Thu, 11 Dec 2025 12:19:21 +0530 Subject: [PATCH 2/2] updated messages --- .../src/import/modules/composable-studio.ts | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/packages/contentstack-import/src/import/modules/composable-studio.ts b/packages/contentstack-import/src/import/modules/composable-studio.ts index 1db7a82364..521384692d 100644 --- a/packages/contentstack-import/src/import/modules/composable-studio.ts +++ b/packages/contentstack-import/src/import/modules/composable-studio.ts @@ -47,7 +47,6 @@ export default class ImportComposableStudio { } log.debug('Starting Studio project import process...', this.importConfig.context); - cliux.print(messageHandler.parse('COMPOSABLE_STUDIO_IMPORT_START'), { color: 'blue' }); try { // Initialize authentication @@ -63,8 +62,7 @@ export default class ImportComposableStudio { // Read exported project data const exportedProject = await this.readExportedProject(); if (!exportedProject) { - log.info(messageHandler.parse('COMPOSABLE_STUDIO_NOT_FOUND'), this.importConfig.context); - cliux.print(messageHandler.parse('COMPOSABLE_STUDIO_NOT_FOUND'), { color: 'yellow' }); + log.warn(messageHandler.parse('COMPOSABLE_STUDIO_NOT_FOUND'), this.importConfig.context); return; } @@ -74,14 +72,12 @@ export default class ImportComposableStudio { const existingProject = await this.getExistingProject(); if (existingProject) { log.warn(messageHandler.parse('COMPOSABLE_STUDIO_SKIP_EXISTING'), this.importConfig.context); - cliux.print(messageHandler.parse('COMPOSABLE_STUDIO_SKIP_EXISTING'), { color: 'yellow' }); return; } // Import the project with name conflict handling await this.importProject(exportedProject); - cliux.print(messageHandler.parse('COMPOSABLE_STUDIO_IMPORT_COMPLETE', exportedProject.name), { color: 'green' }); log.success( messageHandler.parse('COMPOSABLE_STUDIO_IMPORT_COMPLETE', exportedProject.name), this.importConfig.context, @@ -287,8 +283,8 @@ export default class ImportComposableStudio { async promptForNewProjectName(currentName: string): Promise { const suggestedName = `Copy of ${currentName}`; - cliux.print(messageHandler.parse('COMPOSABLE_STUDIO_NAME_CONFLICT', currentName), { color: 'yellow' }); - cliux.print(messageHandler.parse('COMPOSABLE_STUDIO_SUGGEST_NAME', suggestedName), { color: 'cyan' }); + log.warn(messageHandler.parse('COMPOSABLE_STUDIO_NAME_CONFLICT', currentName), this.importConfig.context); + log.info(messageHandler.parse('COMPOSABLE_STUDIO_SUGGEST_NAME', suggestedName), this.importConfig.context); const response: any = await cliux.inquire({ type: 'input',