Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .talismanrc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
fileignoreconfig:
- filename: package-lock.json
checksum: dcbdc2bb8ecdfc2768a0acad70ac3658d0dedfe7394ec9b2522ed1d2dfd02d83
checksum: bb2420415faf0f534173a8f269e9ebdb3dea9237998ec2431dafdbe6d9f2de95
- filename: .husky/pre-commit
checksum: 7a12030ddfea18d6f85edc25f1721fb2009df00fdd42bab66b05de25ab3e32b2
- filename: .github/workflows/check-version-bump.yml
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ $ npm install -g @contentstack/cli-cm-migrate-rte
$ csdx COMMAND
running command...
$ csdx (--version)
@contentstack/cli-cm-migrate-rte/2.0.0-beta.1 darwin-arm64 node-v24.11.1
@contentstack/cli-cm-migrate-rte/2.0.0-beta.4 darwin-arm64 node-v24.11.1
$ csdx --help [COMMAND]
USAGE
$ csdx COMMAND
Expand Down
2,002 changes: 1,088 additions & 914 deletions package-lock.json

Large diffs are not rendered by default.

18 changes: 13 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@contentstack/cli-cm-migrate-rte",
"description": "Contentstack CLI plugin to migrate HTML RTE to JSON RTE",
"version": "2.0.0-beta.4",
"version": "2.0.0-beta.5",
"author": "contentstack",
"bugs": {
"url": "https://github.com/contentstack/cli-cm-migrate-rte/issues"
Expand All @@ -11,12 +11,12 @@
"@contentstack/cli-utilities": "2.0.0-beta.4",
"@contentstack/json-rte-serializer": "~2.1.0",
"@oclif/core": "^4.3.0",
"@oclif/plugin-help": "^6.2.37",
"chalk": "^4.1.2",
"@oclif/plugin-help": "^6.2.44",
"chalk": "^5.6.2",
"collapse-whitespace": "^1.1.7",
"jsdom": "^23.2.0",
"jsonschema": "^1.5.0",
"lodash": "^4.17.23",
"lodash": "^4.18.1",
"omit-deep-lodash": "^1.1.7"
},
"devDependencies": {
Expand All @@ -37,7 +37,12 @@
"node": ">=18.0.0"
},
"overrides": {
"tmp": "0.2.4"
"tmp": "0.2.4",
"axios": "1.15.2",
"follow-redirects": "1.16.0",
"omit-deep-lodash": {
"lodash": "4.18.1"
}
},
"files": [
"/npm-shrinkwrap.json",
Expand All @@ -55,6 +60,9 @@
"oclif": {
"commands": "./src/commands",
"bin": "csdx",
"hooks": {
"init": "./src/hooks/init/load-chalk.js"
},
"repositoryPrefix": "<%- repo %>/blob/main/<%- commandPath %>"
},
"repository": {
Expand Down
4 changes: 2 additions & 2 deletions src/commands/cm/entries/migrate-html-rte.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
const { Command } = require("@contentstack/cli-command");
const { flags } = require("@contentstack/cli-utilities");
const { flags, getChalk } = require("@contentstack/cli-utilities");
const { isEmpty } = require("lodash");
const chalk = require("chalk");
let {
getStack,
getConfig,
Expand Down Expand Up @@ -47,6 +46,7 @@ class JsonMigrationCommand extends Command {
config
);
}
const chalk = getChalk();
console.log(
chalk.green(
`\nUpdated ${config.contentTypeCount} Content Type(s) and ${config.entriesCount} Entrie(s)`
Expand Down
8 changes: 8 additions & 0 deletions src/hooks/init/load-chalk.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
const { loadChalk } = require('@contentstack/cli-utilities');

/**
* Ensure cli-utilities chalk singleton is ready before command execution.
*/
module.exports = async function loadChalkHook() {
await loadChalk();
};
4 changes: 3 additions & 1 deletion src/lib/util/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
const { Command } = require('@contentstack/cli-command');
const command = new Command();
const chalk = require('chalk');
const {
isEmpty,
find,
Expand All @@ -26,6 +25,7 @@ const {
isAuthenticated,
doesBranchExist,
pathValidator,
getChalk,
} = require('@contentstack/cli-utilities');
const packageValue = require('../../../package.json');
const isBlank = (variable) => {
Expand Down Expand Up @@ -185,6 +185,7 @@ function checkConfig(config) {
return res.valid;
}
function prettyPrint(data) {
const chalk = getChalk();
console.log(chalk.yellow('Configuration to be used for executing this command:'));
console.log(chalk.grey(JSON.stringify(data, null, 2)));
console.log('\n');
Expand Down Expand Up @@ -325,6 +326,7 @@ async function updateSingleEntry(entry, contentType, config) {
await handleEntryUpdate(entry, config, 0);
}
async function handleEntryUpdate(entry, config, retry = 0) {
const chalk = getChalk();
try {
await entry.update({ locale: entry.locale });
config.entriesCount += 1;
Expand Down
Loading