From 8eb2965943d083d88404e693d85a8a8994ecaae2 Mon Sep 17 00:00:00 2001 From: Your Name Date: Thu, 11 Jun 2026 12:51:57 +0530 Subject: [PATCH 1/7] change master locale fix, change master locale script support for localised taxonomy, fixed taxonomy import showing success while all taxonomies were failed to import --- .../src/import/modules/taxonomies.ts | 47 ++++++- ...change-master-locale-new-file-structure.js | 123 +++++++++++++++--- 2 files changed, 145 insertions(+), 25 deletions(-) diff --git a/packages/contentstack-import/src/import/modules/taxonomies.ts b/packages/contentstack-import/src/import/modules/taxonomies.ts index 3a0ad7596..ae8443e5c 100644 --- a/packages/contentstack-import/src/import/modules/taxonomies.ts +++ b/packages/contentstack-import/src/import/modules/taxonomies.ts @@ -84,11 +84,35 @@ export default class ImportTaxonomies extends BaseClass { log.debug('Using legacy folder structure for taxonomies', this.importConfig.context); } - //Step 5 create taxonomy & related terms success & failure file + // Step 5: Flag taxonomies that were never processed (no matching export data + // found in any locale/legacy path), so they don't silently disappear. + for (const taxonomyUID of Object.keys(this.taxonomies || {})) { + if (!(taxonomyUID in this.createdTaxonomies) && !(taxonomyUID in this.failedTaxonomies)) { + log.error( + `Taxonomy '${taxonomyUID}' could not be imported: no matching export data found`, + this.importConfig.context, + ); + this.failedTaxonomies[taxonomyUID] = this.taxonomies[taxonomyUID]; + } + } + + //Step 6 create taxonomy & related terms success & failure file log.debug('Creating success and failure files...', this.importConfig.context); this.createSuccessAndFailedFile(); - log.success('Taxonomies imported successfully!', this.importConfig.context); + const createdCount = Object.keys(this.createdTaxonomies).length; + const failedCount = Object.keys(this.failedTaxonomies).length; + + if (failedCount > 0) { + log.error( + `Taxonomies import completed with errors: ${createdCount} succeeded, ${failedCount} failed`, + this.importConfig.context, + ); + } else if (createdCount > 0) { + log.success('Taxonomies imported successfully!', this.importConfig.context); + } else { + log.info('No taxonomies to import.', this.importConfig.context); + } } /** @@ -367,13 +391,22 @@ export default class ImportTaxonomies extends BaseClass { const masterLocaleFolder = join(this.taxonomiesFolderPath, masterLocaleCode); // Check if master locale folder exists (indicates new locale-based structure) - if (!fileHelper.fileExistsSync(masterLocaleFolder)) { - log.debug('No locale-based folder structure detected', this.importConfig.context); - return false; + if (fileHelper.fileExistsSync(masterLocaleFolder)) { + log.debug('Locale-based folder structure detected', this.importConfig.context); + return true; } - log.debug('Locale-based folder structure detected', this.importConfig.context); + // The master locale may not have any localized taxonomies (so its folder was + // never exported), but other locales can still use the locale-based structure. + const locales = this.loadAvailableLocales(); + for (const localeCode of Object.keys(locales)) { + if (fileHelper.fileExistsSync(join(this.taxonomiesFolderPath, localeCode))) { + log.debug('Locale-based folder structure detected', this.importConfig.context); + return true; + } + } - return true; + log.debug('No locale-based folder structure detected', this.importConfig.context); + return false; } } diff --git a/packages/contentstack-migration/examples/change-master-locale/02-change-master-locale-new-file-structure.js b/packages/contentstack-migration/examples/change-master-locale/02-change-master-locale-new-file-structure.js index f4a2255d0..de98e16fa 100644 --- a/packages/contentstack-migration/examples/change-master-locale/02-change-master-locale-new-file-structure.js +++ b/packages/contentstack-migration/examples/change-master-locale/02-change-master-locale-new-file-structure.js @@ -25,7 +25,10 @@ module.exports = async ({ migration, config }) => { } async function tailorData() { - let locales = await fs.readFile(pathValidator(path.resolve(sanitizePath(config.data_dir), 'locales/locales.json')), 'utf-8'); + let locales = await fs.readFile( + pathValidator(path.resolve(sanitizePath(config.data_dir), 'locales/locales.json')), + 'utf-8', + ); let masterLocale = await fs.readFile( pathValidator(path.resolve(sanitizePath(config.data_dir), 'locales/master-locale.json')), 'utf-8', @@ -34,12 +37,14 @@ module.exports = async ({ migration, config }) => { if (masterLocale) { masterLocale = JSON.parse(masterLocale); masterLocale = Object.values(masterLocale); - masterLocale = masterLocale[0] - + masterLocale = masterLocale[0]; + // Validate that we have a valid master locale code - if (!masterLocale) { + if (!masterLocale || !masterLocale.code) { throw new Error('Unable to determine master locale code from master-locale.json'); } + + masterLocale = masterLocale.code; } locales = JSON.parse(locales); let id = crypto.randomBytes(8).toString('hex'); @@ -60,6 +65,7 @@ module.exports = async ({ migration, config }) => { locales[id].fallback_locale = config.target_locale; await handleEntries(masterLocale); + await handleTaxonomies(masterLocale); await fs.writeFile( pathValidator(path.resolve(sanitizePath(config.data_dir), 'locales/locales.json')), JSON.stringify(locales), @@ -84,21 +90,23 @@ module.exports = async ({ migration, config }) => { let sourceMasterLocaleEntries, targetMasterLocaleEntries; // Check if index.json exists (if no entries, index.json won't be created) - const indexFilePath = pathValidator(path.resolve(sanitizePath(config.data_dir), sanitizePath(`entries/${contentType}/${masterLocale}/index.json`))); + const indexFilePath = pathValidator( + path.resolve( + sanitizePath(config.data_dir), + sanitizePath(`entries/${contentType}/${masterLocale}/index.json`), + ), + ); if (!existsSync(indexFilePath)) { console.log(`Skipping ${contentType} - no index.json found (likely no entries)`); continue; } - sourceMasterLocaleEntries = await fs.readFile( - indexFilePath, - { encoding: 'utf8' }, - ); + sourceMasterLocaleEntries = await fs.readFile(indexFilePath, { encoding: 'utf8' }); // Parse the index.json to get the entries file name const indexData = JSON.parse(sourceMasterLocaleEntries); const entriesFileName = Object.values(indexData)[0]; - + // Check if we have a valid entries file name if (!entriesFileName) { console.log(`Skipping ${contentType} - no entries file found in index.json`); @@ -112,10 +120,7 @@ module.exports = async ({ migration, config }) => { ), ); - sourceMasterLocaleEntries = await fs.readFile( - entriesFilePath, - { encoding: 'utf8' }, - ); + sourceMasterLocaleEntries = await fs.readFile(entriesFilePath, { encoding: 'utf8' }); sourceMasterLocaleEntries = JSON.parse(sourceMasterLocaleEntries); if ( existsSync(pathValidator(path.resolve(config.data_dir, `entries/${contentType}/${config.target_locale}`))) @@ -127,7 +132,7 @@ module.exports = async ({ migration, config }) => { if (targetMasterLocaleEntries) { const targetIndexData = JSON.parse(targetMasterLocaleEntries); const targetEntriesFileName = Object.values(targetIndexData)[0]; - + if (targetEntriesFileName) { targetMasterLocaleEntries = await fs.readFile( pathValidator( @@ -152,7 +157,7 @@ module.exports = async ({ migration, config }) => { Object.keys(sourceMasterLocaleEntries).forEach((uid) => { if (!targetMasterLocaleEntries[uid]) { targetMasterLocaleEntries[uid] = JSON.parse(JSON.stringify(sourceMasterLocaleEntries[uid])); - delete targetMasterLocaleEntries[uid]['publish_details']; + targetMasterLocaleEntries[uid]['publish_details'] = []; targetMasterLocaleEntries[uid].locale = config.target_locale; } }); @@ -164,10 +169,10 @@ module.exports = async ({ migration, config }) => { pathValidator(path.resolve(config.data_dir, `entries/${contentType}/${config.target_locale}/index.json`)), { encoding: 'utf8', flag: 'a+' }, ); - + const existingIndexData = JSON.parse(exsitingTargetMasterLocalEntries); const existingEntriesFileName = Object.values(existingIndexData)[0]; - + if (existingEntriesFileName) { await fs.writeFile( pathValidator( @@ -194,6 +199,88 @@ module.exports = async ({ migration, config }) => { } } + async function handleTaxonomies(masterLocale) { + const taxonomiesDirPath = pathValidator(path.resolve(sanitizePath(config.data_dir), 'taxonomies')); + const taxonomiesIndexPath = pathValidator(path.resolve(taxonomiesDirPath, 'taxonomies.json')); + + if (!existsSync(taxonomiesIndexPath)) { + console.log('Skipping taxonomies - no taxonomies.json found'); + return; + } + + let taxonomiesIndex = await fs.readFile(taxonomiesIndexPath, { encoding: 'utf8' }); + taxonomiesIndex = JSON.parse(taxonomiesIndex); + + const targetLocaleDirPath = pathValidator(path.resolve(taxonomiesDirPath, sanitizePath(config.target_locale))); + + for (const taxonomyUid of Object.keys(taxonomiesIndex)) { + const fileName = `${sanitizePath(taxonomyUid)}.json`; + const targetFilePath = pathValidator(path.resolve(targetLocaleDirPath, fileName)); + + // Prefer the old master locale's taxonomy data, then the locale recorded at export time, + // then fall back to any other locale that has it + const exportedLocale = taxonomiesIndex[taxonomyUid]?.locale; + let sourceFilePath; + for (const localeCode of [masterLocale, exportedLocale]) { + if (!localeCode) { + continue; + } + const candidatePath = pathValidator(path.resolve(taxonomiesDirPath, sanitizePath(localeCode), fileName)); + if (existsSync(candidatePath)) { + sourceFilePath = candidatePath; + break; + } + } + + if (!sourceFilePath) { + const localeEntries = await fs.readdir(taxonomiesDirPath, { withFileTypes: true }); + for (const localeEntry of localeEntries) { + if (!localeEntry.isDirectory() || localeEntry.name === config.target_locale) { + continue; + } + const candidatePath = pathValidator( + path.resolve(taxonomiesDirPath, sanitizePath(localeEntry.name), fileName), + ); + if (existsSync(candidatePath)) { + sourceFilePath = candidatePath; + break; + } + } + } + + if (!sourceFilePath) { + console.log(`Skipping taxonomy '${taxonomyUid}' - no source locale data found`); + continue; + } + + let sourceTaxonomy = await fs.readFile(sourceFilePath, { encoding: 'utf8' }); + sourceTaxonomy = JSON.parse(sourceTaxonomy); + + if (existsSync(targetFilePath)) { + let targetTaxonomy = await fs.readFile(targetFilePath, { encoding: 'utf8' }); + targetTaxonomy = JSON.parse(targetTaxonomy); + targetTaxonomy.terms = targetTaxonomy.terms || []; + + const existingTermUids = new Set(targetTaxonomy.terms.map((term) => term.uid)); + for (const term of sourceTaxonomy.terms || []) { + if (!existingTermUids.has(term.uid)) { + targetTaxonomy.terms.push(JSON.parse(JSON.stringify(term))); + } + } + + await fs.writeFile(targetFilePath, JSON.stringify(targetTaxonomy)); + } else { + await fs.mkdir(targetLocaleDirPath, { recursive: true }); + + const targetTaxonomy = JSON.parse(JSON.stringify(sourceTaxonomy)); + targetTaxonomy.taxonomy = targetTaxonomy.taxonomy || {}; + targetTaxonomy.taxonomy.locale = config.target_locale; + + await fs.writeFile(targetFilePath, JSON.stringify(targetTaxonomy)); + } + } + } + await tailorData(); }, }; From df4fe437dd2bd4629880ae62de245c6248ccd7a5 Mon Sep 17 00:00:00 2001 From: raj pandey Date: Thu, 25 Jun 2026 18:36:55 +0530 Subject: [PATCH 2/7] Upgraded Node version to 22 for plugins and Readme Update --- package.json | 2 +- packages/contentstack-apps-cli/README.md | 32 +++-- packages/contentstack-apps-cli/package.json | 6 +- packages/contentstack-audit/README.md | 5 +- packages/contentstack-audit/package.json | 6 +- packages/contentstack-bootstrap/README.md | 15 +-- packages/contentstack-bootstrap/package.json | 10 +- packages/contentstack-branches/README.md | 24 +--- packages/contentstack-branches/package.json | 6 +- .../contentstack-bulk-operations/README.md | 38 ++++-- .../contentstack-bulk-operations/package.json | 6 +- packages/contentstack-bulk-publish/README.md | 4 +- .../contentstack-bulk-publish/package.json | 8 +- .../README.md | 16 +-- .../package.json | 4 +- packages/contentstack-cli-tsgen/README.md | 51 ++++++-- packages/contentstack-cli-tsgen/package.json | 6 +- packages/contentstack-clone/PR_DESCRIPTION.md | 79 +++++++++++++ packages/contentstack-clone/README.md | 12 +- packages/contentstack-clone/package.json | 10 +- packages/contentstack-content-type/README.md | 33 +++--- .../contentstack-content-type/package.json | 4 +- packages/contentstack-export-to-csv/README.md | 110 ++++++++++++++++-- .../contentstack-export-to-csv/package.json | 6 +- packages/contentstack-export/README.md | 34 +----- packages/contentstack-export/package.json | 10 +- .../contentstack-external-migrate/README.md | 6 +- .../package.json | 6 +- packages/contentstack-import-setup/README.md | 36 +----- .../contentstack-import-setup/package.json | 6 +- packages/contentstack-import/README.md | 37 ++---- packages/contentstack-import/package.json | 8 +- packages/contentstack-migrate-rte/README.md | 15 ++- .../contentstack-migrate-rte/package.json | 4 +- packages/contentstack-migration/README.md | 10 +- packages/contentstack-migration/package.json | 6 +- packages/contentstack-query-export/README.md | 103 +++++++++++----- .../contentstack-query-export/package.json | 8 +- packages/contentstack-seed/README.md | 24 +++- packages/contentstack-seed/package.json | 8 +- 40 files changed, 486 insertions(+), 328 deletions(-) create mode 100644 packages/contentstack-clone/PR_DESCRIPTION.md diff --git a/package.json b/package.json index 79857b2db..8a83bf297 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,7 @@ "pnpm": "^10.28.0" }, "engines": { - "node": ">=18.0.0" + "node": ">=22.0.0" }, "private": true, "scripts": { diff --git a/packages/contentstack-apps-cli/README.md b/packages/contentstack-apps-cli/README.md index 06e597559..24ab1e191 100644 --- a/packages/contentstack-apps-cli/README.md +++ b/packages/contentstack-apps-cli/README.md @@ -1,9 +1,3 @@ -> **Source of truth:** [cli-plugins](https://github.com/contentstack/cli-plugins) — `packages/contentstack-apps-cli` (v1 line: `v1-dev` / `v1-beta`) -> Migrated from [contentstack-apps-cli](https://github.com/contentstack/contentstack-apps-cli). See [APPS-CLI-MIGRATION.md](../../APPS-CLI-MIGRATION.md). - - - - # @contentstack/apps-cli Contentstack lets you develop apps in your organization using the Developer Hub portal. With the Apps CLI plugin, Contentstack CLI allows you to perform the CRUD operations on your app in Developer Hub and then use the app in your organization or stack by installing or uninstalling your app as required. @@ -23,8 +17,8 @@ This plugin requires you to be authenticated using [csdx auth:login](https://www $ npm install -g @contentstack/apps-cli $ csdx COMMAND running command... -$ csdx (--version|-v) -@contentstack/apps-cli/1.6.1 darwin-arm64 node-v18.20.2 +$ csdx (--version) +@contentstack/apps-cli/1.6.1 darwin-arm64 node-v22.21.1 $ csdx --help [COMMAND] USAGE $ csdx COMMAND @@ -74,7 +68,7 @@ EXAMPLES $ csdx app:update ``` -_See code: [src/commands/app/index.ts](https://github.com/contentstack/apps-cli/blob/v1.6.1/src/commands/app/index.ts)_ +_See code: [src/commands/app/index.ts](https://github.com/contentstack/cli-plugins/blob/main/packages/contentstack-apps-cli/src/commands/app/index.ts)_ ## `csdx app:create` @@ -114,7 +108,7 @@ EXAMPLES $ csdx app:create --name App-4 --app-type organization --org --boilerplate ``` -_See code: [src/commands/app/create.ts](https://github.com/contentstack/apps-cli/blob/v1.6.1/src/commands/app/create.ts)_ +_See code: [src/commands/app/create.ts](https://github.com/contentstack/cli-plugins/blob/main/packages/contentstack-apps-cli/src/commands/app/create.ts)_ ## `csdx app:delete` @@ -136,10 +130,10 @@ EXAMPLES $ csdx app:delete --app-uid - $ csdx app:delete --app-uid --org -d ./boilerplate + $ csdx app:delete --app-uid --org ``` -_See code: [src/commands/app/delete.ts](https://github.com/contentstack/apps-cli/blob/v1.6.1/src/commands/app/delete.ts)_ +_See code: [src/commands/app/delete.ts](https://github.com/contentstack/cli-plugins/blob/main/packages/contentstack-apps-cli/src/commands/app/delete.ts)_ ## `csdx app:deploy` @@ -177,7 +171,7 @@ EXAMPLES $ csdx app:deploy --org --app-uid --hosting-type --launch-project --config ``` -_See code: [src/commands/app/deploy.ts](https://github.com/contentstack/apps-cli/blob/v1.6.1/src/commands/app/deploy.ts)_ +_See code: [src/commands/app/deploy.ts](https://github.com/contentstack/cli-plugins/blob/main/packages/contentstack-apps-cli/src/commands/app/deploy.ts)_ ## `csdx app:get` @@ -207,7 +201,7 @@ EXAMPLES $ csdx app:get --org --app-uid --app-type organization ``` -_See code: [src/commands/app/get.ts](https://github.com/contentstack/apps-cli/blob/v1.6.1/src/commands/app/get.ts)_ +_See code: [src/commands/app/get.ts](https://github.com/contentstack/cli-plugins/blob/main/packages/contentstack-apps-cli/src/commands/app/get.ts)_ ## `csdx app:install` @@ -233,7 +227,7 @@ EXAMPLES $ csdx app:install --org --app-uid --stack-api-key ``` -_See code: [src/commands/app/install.ts](https://github.com/contentstack/apps-cli/blob/v1.6.1/src/commands/app/install.ts)_ +_See code: [src/commands/app/install.ts](https://github.com/contentstack/cli-plugins/blob/main/packages/contentstack-apps-cli/src/commands/app/install.ts)_ ## `csdx app:reinstall` @@ -259,7 +253,7 @@ EXAMPLES $ csdx app:reinstall --org --app-uid --stack-api-key ``` -_See code: [src/commands/app/reinstall.ts](https://github.com/contentstack/apps-cli/blob/v1.6.1/src/commands/app/reinstall.ts)_ +_See code: [src/commands/app/reinstall.ts](https://github.com/contentstack/cli-plugins/blob/main/packages/contentstack-apps-cli/src/commands/app/reinstall.ts)_ ## `csdx app:uninstall` @@ -286,7 +280,7 @@ EXAMPLES $ csdx app:uninstall --org --app-uid --installation-uid ``` -_See code: [src/commands/app/uninstall.ts](https://github.com/contentstack/apps-cli/blob/v1.6.1/src/commands/app/uninstall.ts)_ +_See code: [src/commands/app/uninstall.ts](https://github.com/contentstack/cli-plugins/blob/main/packages/contentstack-apps-cli/src/commands/app/uninstall.ts)_ ## `csdx app:update` @@ -297,7 +291,7 @@ USAGE $ csdx app:update [--org ] [--app-manifest ] FLAGS - --app-manifest= Path to the app manifest.json file: + --app-manifest= Path to the app manifest.json file. --org= Provide the organization UID to fetch the app details for the operation. DESCRIPTION @@ -309,5 +303,5 @@ EXAMPLES $ csdx app:update --app-manifest ./boilerplate/manifest.json ``` -_See code: [src/commands/app/update.ts](https://github.com/contentstack/apps-cli/blob/v1.6.1/src/commands/app/update.ts)_ +_See code: [src/commands/app/update.ts](https://github.com/contentstack/cli-plugins/blob/main/packages/contentstack-apps-cli/src/commands/app/update.ts)_ diff --git a/packages/contentstack-apps-cli/package.json b/packages/contentstack-apps-cli/package.json index c8146bc8c..a302d6a2b 100644 --- a/packages/contentstack-apps-cli/package.json +++ b/packages/contentstack-apps-cli/package.json @@ -1,6 +1,6 @@ { "name": "@contentstack/apps-cli", - "version": "1.7.0", + "version": "1.7.1", "description": "App ClI", "author": "Contentstack CLI", "homepage": "https://github.com/contentstack/cli-plugins/tree/main/packages/contentstack-apps-cli", @@ -22,7 +22,7 @@ ], "dependencies": { "@apollo/client": "^3.14.1", - "@contentstack/cli-command": "~1.8.3", + "@contentstack/cli-command": "~1.8.4", "@contentstack/cli-launch": "^1.10.0", "@contentstack/cli-utilities": "~1.18.4", "adm-zip": "^0.5.17", @@ -88,7 +88,7 @@ "test:unit:report:json": "mocha --reporter json --reporter-options output=report.json --forbid-only \"test/unit/**/*.test.ts\" && nyc --reporter=clover --extension .ts mocha --forbid-only \"test/unit/**/*.test.ts\"" }, "engines": { - "node": ">=16" + "node": ">=22.0.0" }, "bugs": "https://github.com/contentstack/cli-plugins/issues", "keywords": [ diff --git a/packages/contentstack-audit/README.md b/packages/contentstack-audit/README.md index ba500ae37..0cbcc1f20 100644 --- a/packages/contentstack-audit/README.md +++ b/packages/contentstack-audit/README.md @@ -1,6 +1,3 @@ - - - # @contentstack/cli-audit Audit plugin @@ -19,7 +16,7 @@ $ npm install -g @contentstack/cli-audit $ csdx COMMAND running command... $ csdx (--version|-v) -@contentstack/cli-audit/1.19.4 darwin-arm64 node-v24.14.0 +@contentstack/cli-audit/1.19.5 darwin-arm64 node-v22.21.1 $ csdx --help [COMMAND] USAGE $ csdx COMMAND diff --git a/packages/contentstack-audit/package.json b/packages/contentstack-audit/package.json index e94481626..cb4c97eb3 100644 --- a/packages/contentstack-audit/package.json +++ b/packages/contentstack-audit/package.json @@ -1,6 +1,6 @@ { "name": "@contentstack/cli-audit", - "version": "1.19.4", + "version": "1.19.5", "description": "Contentstack audit plugin", "author": "Contentstack CLI", "homepage": "https://github.com/contentstack/cli", @@ -18,7 +18,7 @@ "/oclif.manifest.json" ], "dependencies": { - "@contentstack/cli-command": "~1.8.3", + "@contentstack/cli-command": "~1.8.4", "@contentstack/cli-utilities": "~1.18.4", "@oclif/core": "^4.11.4", "chalk": "^4.1.2", @@ -71,7 +71,7 @@ "test:unit": "mocha --timeout 10000 --forbid-only \"test/unit/**/*.test.ts\"" }, "engines": { - "node": ">=16" + "node": ">=22.0.0" }, "bugs": "https://github.com/contentstack/cli/issues", "keywords": [ diff --git a/packages/contentstack-bootstrap/README.md b/packages/contentstack-bootstrap/README.md index 7e67fccb1..2aadfdf45 100644 --- a/packages/contentstack-bootstrap/README.md +++ b/packages/contentstack-bootstrap/README.md @@ -1,8 +1,11 @@ +# @contentstack/cli-cm-bootstrap + Contentstack CLI’s “Bootstrap” plugin enables you to automate the process of setting up projects for sample and starter apps in Contentstack. This means that all the required steps such as stack, environment, and content type creation, entry and asset publishing are performed just by using a single command. +* [@contentstack/cli-cm-bootstrap](#contentstackcli-cm-bootstrap) * [Usage](#usage) * [Commands](#commands) @@ -15,7 +18,7 @@ $ npm install -g @contentstack/cli-cm-bootstrap $ csdx COMMAND running command... $ csdx (--version) -@contentstack/cli-cm-bootstrap/1.19.6 darwin-arm64 node-v24.14.0 +@contentstack/cli-cm-bootstrap/1.19.7 darwin-arm64 node-v22.21.1 $ csdx --help [COMMAND] USAGE $ csdx COMMAND @@ -23,16 +26,6 @@ USAGE ``` -```sh-session -$ npm install -g @contentstack/cli-cm-clone -$ csdx COMMAND -running command... -$ csdx --help [COMMAND] -USAGE - $ csdx COMMAND -... -``` - # Commands diff --git a/packages/contentstack-bootstrap/package.json b/packages/contentstack-bootstrap/package.json index 46c7b8fcb..c940f44a0 100644 --- a/packages/contentstack-bootstrap/package.json +++ b/packages/contentstack-bootstrap/package.json @@ -1,7 +1,7 @@ { "name": "@contentstack/cli-cm-bootstrap", "description": "Bootstrap contentstack apps", - "version": "1.19.6", + "version": "1.19.7", "author": "Contentstack", "bugs": "https://github.com/contentstack/cli/issues", "scripts": { @@ -16,9 +16,9 @@ "test:report": "nyc --reporter=lcov mocha \"test/**/*.test.js\"" }, "dependencies": { - "@contentstack/cli-cm-seed": "~1.15.6", - "@contentstack/cli-command": "~1.8.3", - "@contentstack/cli-config": "~1.20.4", + "@contentstack/cli-cm-seed": "~1.15.7", + "@contentstack/cli-command": "~1.8.4", + "@contentstack/cli-config": "~1.20.5", "@contentstack/cli-utilities": "~1.18.4", "@oclif/core": "^4.11.4", "inquirer": "8.2.7", @@ -40,7 +40,7 @@ "typescript": "^4.9.5" }, "engines": { - "node": ">=14.0.0" + "node": ">=22.0.0" }, "files": [ "/lib", diff --git a/packages/contentstack-branches/README.md b/packages/contentstack-branches/README.md index 2be983dd7..df8c50b78 100755 --- a/packages/contentstack-branches/README.md +++ b/packages/contentstack-branches/README.md @@ -1,7 +1,7 @@ # @contentstack/cli-cm-branches It is Contentstack’s CLI plugin to compare and merge content. -[![License](https://img.shields.io/npm/l/@contentstack/cli)](https://github.com/contentstack/cli/blob/main/LICENSE) +[![License](https://img.shields.io/npm/l/@contentstack/cli-cm-branches)](https://github.com/contentstack/cli-plugins/blob/main/LICENSE) * [@contentstack/cli-cm-branches](#contentstackcli-cm-branches) @@ -9,24 +9,10 @@ It is Contentstack’s CLI plugin to compare and merge content. * [Commands](#commands) -For switching to EU region update the hosts at config/default.js +To switch regions, use: -```js -{ - host:'https://eu-api.contentstack.com/v3', - cdn: 'https://eu-cdn.contentstack.com/v3', - ... -} -``` - -For switching to AZURE-NA region update the hosts at config/default.js - -```js -{ - host:'https://azure-na-api.contentstack.com/v3', - cdn: 'https://azure-na-cdn.contentstack.com/v3', - ... -} +```sh-session +$ csdx config:set:region [EU | AZURE-NA | AZURE-EU] ``` # Usage @@ -37,7 +23,7 @@ $ npm install -g @contentstack/cli-cm-branches $ csdx COMMAND running command... $ csdx (--version) -@contentstack/cli-cm-branches/1.8.2 darwin-arm64 node-v24.14.0 +@contentstack/cli-cm-branches/1.8.3 darwin-arm64 node-v22.21.1 $ csdx --help [COMMAND] USAGE $ csdx COMMAND diff --git a/packages/contentstack-branches/package.json b/packages/contentstack-branches/package.json index 18fa0e891..61b641af2 100644 --- a/packages/contentstack-branches/package.json +++ b/packages/contentstack-branches/package.json @@ -1,11 +1,11 @@ { "name": "@contentstack/cli-cm-branches", "description": "Contentstack CLI plugin to do branches operations", - "version": "1.8.2", + "version": "1.8.3", "author": "Contentstack", "bugs": "https://github.com/contentstack/cli/issues", "dependencies": { - "@contentstack/cli-command": "~1.8.3", + "@contentstack/cli-command": "~1.8.4", "@oclif/core": "^4.11.4", "@contentstack/cli-utilities": "~1.18.4", "chalk": "^4.1.2", @@ -43,7 +43,7 @@ "test:unit:report": "nyc --extension .ts mocha --forbid-only \"test/unit/**/*.test.ts\"" }, "engines": { - "node": ">=14.0.0" + "node": ">=22.0.0" }, "files": [ "/lib", diff --git a/packages/contentstack-bulk-operations/README.md b/packages/contentstack-bulk-operations/README.md index ebcf7abcb..c59b42ad8 100644 --- a/packages/contentstack-bulk-operations/README.md +++ b/packages/contentstack-bulk-operations/README.md @@ -1,10 +1,13 @@ -> **Source of truth:** [cli-plugins](https://github.com/contentstack/cli-plugins) — `packages/contentstack-bulk-operations` (v1 line: `v1-dev` / `v1-beta`) -> Migrated from [cli-bulk-operations](https://github.com/contentstack/cli-plugins/tree/main/packages/contentstack-bulk-operations). See [BULK-OPERATIONS-MIGRATION.md](../../BULK-OPERATIONS-MIGRATION.md). - # @contentstack/cli-bulk-operations > Contentstack CLI plugin for performing bulk operations on your content. + +* [@contentstack/cli-bulk-operations](#contentstackcli-bulk-operations) +* [Usage](#usage) +* [Commands](#commands) + + ## Features - Perform bulk operations on Contentstack content @@ -17,7 +20,21 @@ ```sh-session -# For CLI 1.x:** +$ npm install -g @contentstack/cli-bulk-operations +$ csdx COMMAND +running command... +$ csdx (--version|-v) +@contentstack/cli-bulk-operations/1.2.0 darwin-arm64 node-v22.21.1 +$ csdx --help [COMMAND] +USAGE + $ csdx COMMAND +... +``` + +**For CLI 1.x (plugin install):** + +```sh-session +# For CLI 1.x: # Install Contentstack CLI $ npm install -g @contentstack/cli @@ -33,7 +50,7 @@ csdx plugins:install @contentstack/cli-bulk-operations csdx cm:stacks:bulk-entries --help ``` ```sh-session -# For CLI 2.x:** +# For CLI 2.x: # Install Contentstack CLI $ npm install -g @contentstack/cli @@ -68,7 +85,7 @@ USAGE FLAGS -a, --alias= Uses the name of a saved Management Token to authenticate the command. The command can only access the branches allowed for that token. This option can be used as an - alternative to` --stack-api-key.` + alternative to --stack-api-key. -c, --config= (optional) Specifies the path to a JSON configuration file that defines the options for the command. Use this file instead of passing multiple CLI flags for a single run. @@ -137,7 +154,7 @@ USAGE FLAGS -a, --alias= Uses the name of a saved Management Token to authenticate the command. The command can only access the branches allowed for that token. This option can be used as an - alternative to` --stack-api-key.` + alternative to --stack-api-key. -c, --config= (optional) Specifies the path to a JSON configuration file that defines the options for the command. Use this file instead of passing multiple CLI flags for a single run. @@ -146,8 +163,7 @@ FLAGS -y, --yes Skips interactive confirmation prompts and runs the command immediately using the provided options. Useful for automation and scripts. --api-version= [default: 3.2] Specifies the Content Management API version used for publishing. - Use version `3.2` when publishing entries with nested references, otherwise, use - the default version 3.2 + Use `3.2` (default) for publishing entries with nested references. --branch= [default: main] The name of the branch where you want to perform the bulk publish operation. If you don't mention the branch name, then by default the content from main branch will be published. @@ -222,7 +238,7 @@ USAGE FLAGS -a, --alias= Uses the name of a saved Management Token to authenticate the command. The command can only access the branches allowed for that token. This option can be used as an - alternative to` --stack-api-key.` + alternative to --stack-api-key. -c, --config= (optional) Specifies the path to a JSON configuration file that defines the options for the command. Use this file instead of passing multiple CLI flags for a single run. @@ -280,7 +296,7 @@ _See code: [src/commands/cm/stacks/bulk-taxonomies.ts](https://github.com/conten ## Requirements -- Node.js >= 22 +- Node.js >= 22.21.1 - Contentstack account with API credentials ## Development diff --git a/packages/contentstack-bulk-operations/package.json b/packages/contentstack-bulk-operations/package.json index 4663909c1..58f1e9269 100644 --- a/packages/contentstack-bulk-operations/package.json +++ b/packages/contentstack-bulk-operations/package.json @@ -1,6 +1,6 @@ { "name": "@contentstack/cli-bulk-operations", - "version": "1.2.0", + "version": "1.2.1", "description": "Contentstack CLI plugin for bulk operations", "author": "Contentstack CLI", "homepage": "https://github.com/contentstack/cli-plugins/tree/main/packages/contentstack-bulk-operations", @@ -20,7 +20,7 @@ "/oclif.manifest.json" ], "dependencies": { - "@contentstack/cli-command": "~1.8.3", + "@contentstack/cli-command": "~1.8.4", "@contentstack/cli-utilities": "~1.18.4", "@contentstack/delivery-sdk": "^5.2.1", "@contentstack/management": "^1.30.3", @@ -93,7 +93,7 @@ "clean": "rm -rf ./lib tsconfig.tsbuildinfo oclif.manifest.json" }, "engines": { - "node": ">=20.19.0" + "node": ">=22.0.0" }, "bugs": "https://github.com/contentstack/cli-plugins/issues", "keywords": [ diff --git a/packages/contentstack-bulk-publish/README.md b/packages/contentstack-bulk-publish/README.md index 64c1cd752..2f1726f24 100644 --- a/packages/contentstack-bulk-publish/README.md +++ b/packages/contentstack-bulk-publish/README.md @@ -2,7 +2,7 @@ It is Contentstack’s CLI plugin to perform bulk publish/unpublish operations on entries and assets in Contentstack. Refer to the [Bulk Publish and Unpublish documentation](https://www.contentstack.com/docs/developers/cli/bulk-publish-and-unpublish) to learn more about its commands. -[![License](https://img.shields.io/npm/l/@contentstack/cli)](https://github.com/contentstack/cli/blob/main/LICENSE) +[![License](https://img.shields.io/npm/l/@contentstack/cli)](https://github.com/contentstack/cli-plugins/blob/main/LICENSE) * [@contentstack/cli-cm-bulk-publish](#contentstackcli-cm-bulk-publish) @@ -18,7 +18,7 @@ $ npm install -g @contentstack/cli-cm-bulk-publish $ csdx COMMAND running command... $ csdx (--version) -@contentstack/cli-cm-bulk-publish/1.12.0 darwin-arm64 node-v24.14.0 +@contentstack/cli-cm-bulk-publish/1.12.1 darwin-arm64 node-v22.21.1 $ csdx --help [COMMAND] USAGE $ csdx COMMAND diff --git a/packages/contentstack-bulk-publish/package.json b/packages/contentstack-bulk-publish/package.json index fc6f5062c..495563f75 100644 --- a/packages/contentstack-bulk-publish/package.json +++ b/packages/contentstack-bulk-publish/package.json @@ -1,12 +1,12 @@ { "name": "@contentstack/cli-cm-bulk-publish", "description": "Contentstack CLI plugin for bulk publish actions", - "version": "1.12.0", + "version": "1.12.1", "author": "Contentstack", "bugs": "https://github.com/contentstack/cli/issues", "dependencies": { - "@contentstack/cli-command": "~1.8.3", - "@contentstack/cli-config": "~1.20.4", + "@contentstack/cli-command": "~1.8.4", + "@contentstack/cli-config": "~1.20.5", "@contentstack/cli-utilities": "~1.18.4", "@oclif/core": "^4.11.4", "chalk": "^4.1.2", @@ -25,7 +25,7 @@ "oclif": "^4.23.8" }, "engines": { - "node": ">=14.0.0" + "node": ">=22.0.0" }, "files": [ "/npm-shrinkwrap.json", diff --git a/packages/contentstack-cli-cm-regex-validate/README.md b/packages/contentstack-cli-cm-regex-validate/README.md index 7663fc999..54af372cc 100644 --- a/packages/contentstack-cli-cm-regex-validate/README.md +++ b/packages/contentstack-cli-cm-regex-validate/README.md @@ -6,9 +6,9 @@ Using the CLI “Regex Validation” plugin, you can find the invalid regexes wi and rectify them. [![oclif](https://img.shields.io/badge/cli-oclif-brightgreen.svg)](https://oclif.io) -[![Version](https://img.shields.io/npm/v/cli-cm-regex-validate.svg)](https://npmjs.org/package/cli-cm-regex-validate) -[![Downloads/week](https://img.shields.io/npm/dw/cli-cm-regex-validate.svg)](https://npmjs.org/package/cli-cm-regex-validate) -[![License](https://img.shields.io/npm/l/cli-cm-regex-validate.svg)](https://github.com/contentstack/cli-cm-regex-validate/blob/master/package.json) +[![Version](https://img.shields.io/npm/v/@contentstack/cli-cm-regex-validate.svg)](https://npmjs.org/package/@contentstack/cli-cm-regex-validate) +[![Downloads/week](https://img.shields.io/npm/dw/@contentstack/cli-cm-regex-validate.svg)](https://npmjs.org/package/@contentstack/cli-cm-regex-validate) +[![License](https://img.shields.io/npm/l/@contentstack/cli-cm-regex-validate.svg)](https://github.com/contentstack/cli-plugins/blob/main/packages/contentstack-cli-cm-regex-validate/package.json) * [Regex Validation CLI Plugin](#regex-validation-cli-plugin) @@ -18,18 +18,18 @@ and rectify them. # Usage - + #### Step 1: ```sh-session $ npm install -g @contentstack/cli -$ csdx plugins:install https://github.com/contentstack/cli-cm-regex-validate/releases/download/v1.2.1/contentstack-cli-cm-regex-validate-1.2.1.tgz +$ csdx plugins:install @contentstack/cli-cm-regex-validate $ csdx plugins running command... -@contentstack/cli-cm-regex-validate/1.2.1 darwin-arm64 node-v20.8.0 +@contentstack/cli-cm-regex-validate/1.2.1 darwin-arm64 node-v22.21.1 $ csdx --help [COMMAND] USAGE @@ -41,7 +41,7 @@ USAGE [Set the region](https://www.contentstack.com/docs/developers/cli/configure-regions-in-the-cli#set-region) - + #### Step 3: @@ -87,5 +87,5 @@ EXAMPLES $ csdx cm:stacks:validate-regex -a -c -g -f ``` -_See code: [src/commands/cm/stacks/validate-regex.ts](https://github.com/contentstack/cli-cm-regex-validate/blob/v1.2.6/src/commands/cm/stacks/validate-regex.ts)_ +_See code: [src/commands/cm/stacks/validate-regex.ts](https://github.com/contentstack/cli-plugins/blob/main/packages/contentstack-cli-cm-regex-validate/src/commands/cm/stacks/validate-regex.ts)_ diff --git a/packages/contentstack-cli-cm-regex-validate/package.json b/packages/contentstack-cli-cm-regex-validate/package.json index c89301086..21d956ea6 100644 --- a/packages/contentstack-cli-cm-regex-validate/package.json +++ b/packages/contentstack-cli-cm-regex-validate/package.json @@ -1,7 +1,7 @@ { "name": "@contentstack/cli-cm-regex-validate", "description": "Validate Fields with Regex Property of Content Type and Global Field in a Stack", - "version": "1.0.0", + "version": "1.0.1", "author": "Contentstack", "bugs": "https://github.com/contentstack/cli-cm-regex-validate/issues", "devDependencies": { @@ -30,7 +30,7 @@ "typescript": "^5.9.3" }, "engines": { - "node": ">=14.0.0" + "node": ">=22.0.0" }, "files": [ "/lib", diff --git a/packages/contentstack-cli-tsgen/README.md b/packages/contentstack-cli-tsgen/README.md index 0522459e6..b5518958b 100644 --- a/packages/contentstack-cli-tsgen/README.md +++ b/packages/contentstack-cli-tsgen/README.md @@ -1,4 +1,6 @@ -![npm](https://img.shields.io/npm/v/contentstack-cli-tsgen) +# @contentstack/contentstack-cli-tsgen + +[![npm](https://img.shields.io/npm/v/contentstack-cli-tsgen)](https://npmjs.org/package/@contentstack/contentstack-cli-tsgen) ## Description @@ -15,7 +17,7 @@ $ csdx plugins:install contentstack-cli-tsgen ## Migration -- **Monorepo move (4.10.0):** See [TSGEN-MIGRATION.md](../../TSGEN-MIGRATION.md) and [MIGRATION.md](./MIGRATION.md). +- **Monorepo move (4.10.0):** See [MIGRATION.md](./MIGRATION.md). - **Older plugin versions:** See [MIGRATION.md](./MIGRATION.md) for v3→v4 schema changes. ## How to use this plugin @@ -24,23 +26,52 @@ $ csdx plugins:install contentstack-cli-tsgen generate TypeScript typings from a Stack + +* [`csdx tsgen`](#csdx-tsgen) + +## `csdx tsgen` + +Generate TypeScript typings from a Stack + ``` USAGE - $ csdx tsgen - -OPTIONS - -a, --token-alias=token-alias (required) delivery token alias - -d, --[no-]doc include documentation comments - -o, --output=output (required) full path to output - -p, --prefix=prefix interface prefix, e.g. "I" + $ csdx tsgen -a -o [-p ] [-d] [--branch ] [--include-system-fields] + [--include-editable-tags] [--include-referenced-entry] [--api-type rest|graphql] [--namespace ] + +FLAGS + -a, --token-alias= (required) delivery token alias + -d, --[no-]doc include documentation comments + -o, --output= (required) full path to output + -p, --prefix= interface prefix, e.g. "I" + --api-type=