diff --git a/.talismanrc b/.talismanrc index ae12936cd..76ff7e4b3 100644 --- a/.talismanrc +++ b/.talismanrc @@ -67,4 +67,6 @@ fileignoreconfig: checksum: 653a7e0443f6b9712ed91ad45aa4189864bee710ea4bd3ac40031225da4da5a5 - filename: pnpm-lock.yaml checksum: 07642e8dd04d580185a459e5b088d8a1bb4e91be4e04f4842bf4fe4775205bf6 +- filename: packages/contentstack-import/src/commands/cm/stacks/import.ts + checksum: 5ae9bf66f5b5b4ef2c5ec337f8f1a30b379ce984b1087508d368548fa6adbb0e version: '1.0' diff --git a/packages/contentstack-bulk-publish/src/commands/cm/assets/publish.js b/packages/contentstack-bulk-publish/src/commands/cm/assets/publish.js index 3aecb2c8e..22416e2e9 100644 --- a/packages/contentstack-bulk-publish/src/commands/cm/assets/publish.js +++ b/packages/contentstack-bulk-publish/src/commands/cm/assets/publish.js @@ -192,7 +192,7 @@ AssetsPublishCommand.flags = { 'data-dir': flags.string({ description: '(optional) Path to the import backup directory. When set, each imported asset is published only to the environments and locales it was published to in the source stack (read from the backup’s publish details and asset UID mapping), with asset-scan gating applied. Intended for the post-import publish flow.', - exclusive: ['source-env', 'folder-uid'], + exclusive: ['source-env', 'folder-uid', 'environments', 'locales'], }), 'bulk-publish': flags.string({ description: 'Set this flag to use Contentstack’s Bulk Publish APIs. It is true, by default.', diff --git a/packages/contentstack-import/src/commands/cm/stacks/import.ts b/packages/contentstack-import/src/commands/cm/stacks/import.ts index 74217cf45..95387d15f 100644 --- a/packages/contentstack-import/src/commands/cm/stacks/import.ts +++ b/packages/contentstack-import/src/commands/cm/stacks/import.ts @@ -187,6 +187,23 @@ export default class ImportCommand extends Command { log.success(`The log has been stored at: ${getLogPath()}`, importConfig.context); log.info(`The backup content has been stored at: ${backupDir}`, importConfig.context); + + // Closing reminder: when assets were imported but not published inline + // (asset scanning enabled, or --skip-assets-publish), point the user to + // cm:assets:publish with the backup dir and stack pre-filled so the note + // isn't lost in the per-module logs above. + const assetsImported = importConfig.moduleName + ? importConfig.moduleName === 'assets' + : importConfig.modules?.types?.includes('assets'); + // Mirror the publish gate in assets.ts (`!skipAssetsPublish`): assets are + // left unpublished exactly when skipAssetsPublish is set — which also + // covers the scanning case, since detecting scanning sets skipAssetsPublish. + if (!result?.noSuccessMsg && assetsImported && importConfig.skipAssetsPublish) { + log.info( + `Note: assets were imported but not published asset scanning is enabled and must complete first. To publish them, run:\n csdx cm:assets:publish --data-dir ${backupDir} --stack-api-key ${importConfig.apiKey}`, + importConfig.context, + ); + } } catch (error) { handleAndLogError(error); log.info(`The log has been stored at '${getLogPath()}'`);