Skip to content

Commit deb123e

Browse files
feat: migrate @contentstack/cli-cm-migrate-rte to cli-plugins monorepo with initial implementation and setup
1 parent c261260 commit deb123e

36 files changed

Lines changed: 7572 additions & 0 deletions

.github/workflows/release-production-plugins.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,14 @@ jobs:
103103
package: ./packages/contentstack-migration/package.json
104104
tag: latest
105105

106+
# Migrate RTE
107+
- name: Publishing migrate RTE (Production)
108+
uses: JS-DevTools/npm-publish@v3
109+
with:
110+
token: ${{ secrets.NPM_TOKEN }}
111+
package: ./packages/contentstack-migrate-rte/package.json
112+
tag: latest
113+
106114
# Seed
107115
- name: Publishing seed (Production)
108116
uses: JS-DevTools/npm-publish@v3

.github/workflows/unit-test.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,10 @@ jobs:
7070
working-directory: ./packages/contentstack-apps-cli
7171
run: npm run test:unit:report:json
7272

73+
- name: Run tests for Contentstack Migrate RTE
74+
working-directory: ./packages/contentstack-migrate-rte
75+
run: npm test
76+
7377
- name: Run tests for Contentstack Bulk Operations
7478
working-directory: ./packages/contentstack-bulk-operations
7579
run: npm test

MIGRATE-RTE-MIGRATION.md

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# Migrate RTE migration: standalone repo → cli-plugins monorepo
2+
3+
## Summary
4+
5+
**@contentstack/cli-cm-migrate-rte** moved from [contentstack/cli-cm-migrate-rte](https://github.com/contentstack/cli-cm-migrate-rte) into [contentstack/cli-plugins](https://github.com/contentstack/cli-plugins) at **`packages/contentstack-migrate-rte`**.
6+
7+
The npm package name and command **`csdx cm:entries:migrate-html-rte`** are unchanged.
8+
9+
## Repository and issues
10+
11+
| Before | After |
12+
| --- | --- |
13+
| `github.com/contentstack/cli-cm-migrate-rte` | `github.com/contentstack/cli-plugins``packages/contentstack-migrate-rte` |
14+
| Issues on standalone repo | [cli-plugins issues](https://github.com/contentstack/cli-plugins/issues) |
15+
16+
## Version lines (1.x vs 2.x)
17+
18+
| CLI line | cli-plugins branch | Plugin notes |
19+
| --- | --- | --- |
20+
| **1.x** | `v1-dev` / `v1-beta` | e.g. **1.6.x**; `@contentstack/cli-command` ~1.8.2, `@contentstack/cli-utilities` ~1.18.x; chalk v4 |
21+
| **2.x beta** | `v2-dev` / `v2-beta` | e.g. **2.0.0-beta.x**; 2.x beta core packages; chalk v5 + `load-chalk` init hook |
22+
23+
## Install
24+
25+
```bash
26+
csdx plugins:install @contentstack/cli-cm-migrate-rte
27+
# or
28+
npm install -g @contentstack/cli-cm-migrate-rte
29+
```
30+
31+
## Local development
32+
33+
```bash
34+
cd cli-dev-workspace
35+
pnpm install
36+
pnpm --filter @contentstack/cli-cm-migrate-rte run build
37+
pnpm --filter @contentstack/cli-cm-migrate-rte test
38+
```
39+
40+
Core CLI: add `@contentstack/cli-cm-migrate-rte` to `cli/packages/contentstack` dependencies and `oclif.plugins` (use `workspace:*` in cli-dev-workspace until the monorepo package is published).
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"extends": "oclif"
3+
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
*-debug.log
2+
*-error.log
3+
/.nyc_output
4+
/dist
5+
/tmp
6+
/logs
7+
/yarn.lock
8+
node_modules
9+
/coverage
10+
.DS_Store
11+
# Snyk Security Extension - AI Rules (auto-generated)
12+
.cursor/rules/snyk_rules.mdc
13+
oclif.manifest.json
14+
# Husky 9 internal folder (created by "husky" on install; do not commit)
15+
.husky/_
16+
*.log
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"all": true,
3+
"extension": [".js"],
4+
"include": ["src/**/*.js"],
5+
"exclude": ["test/**", "node_modules/**"],
6+
"reporter": ["text"],
7+
"check-coverage": true,
8+
"statements": 80,
9+
"branches": 60,
10+
"functions": 80,
11+
"lines": 80
12+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
fileignoreconfig:
2+
- filename: package-lock.json
3+
checksum: dcbdc2bb8ecdfc2768a0acad70ac3658d0dedfe7394ec9b2522ed1d2dfd02d83
4+
- filename: .husky/pre-commit
5+
checksum: 7a12030ddfea18d6f85edc25f1721fb2009df00fdd42bab66b05de25ab3e32b2
6+
- filename: .github/workflows/check-version-bump.yml
7+
checksum: b33b47fae4e126cd9a3489a9324e8b2cf30b38ebdb3dd99e2d453d4bfc0922ad
8+
version: ""
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2026 Contentstack
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.
Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
> **Source of truth:** [cli-plugins](https://github.com/contentstack/cli-plugins)`packages/contentstack-migrate-rte`
2+
> Migrated from [cli-cm-migrate-rte](https://github.com/contentstack/cli-cm-migrate-rte). See [MIGRATE-RTE-MIGRATION.md](../../MIGRATE-RTE-MIGRATION.md).
3+
4+
# @contentstack/cli-cm-migrate-rte
5+
6+
It is Contentstack’s CLI plugin to migrate rte. Using this command, you can copy existing value of HTML RTE into JSON RTE.
7+
8+
<!-- toc -->
9+
* [@contentstack/cli-cm-migrate-rte](#contentstackcli-cm-migrate-rte)
10+
* [Usage](#usage)
11+
* [Commands](#commands)
12+
<!-- tocstop -->
13+
14+
# Usage
15+
16+
<!-- usage -->
17+
```sh-session
18+
$ npm install -g @contentstack/cli-cm-migrate-rte
19+
$ csdx COMMAND
20+
running command...
21+
$ csdx (--version)
22+
@contentstack/cli-cm-migrate-rte/2.0.0-beta.1 darwin-arm64 node-v24.11.1
23+
$ csdx --help [COMMAND]
24+
USAGE
25+
$ csdx COMMAND
26+
...
27+
```
28+
<!-- usagestop -->
29+
30+
# Commands
31+
32+
<!-- commands -->
33+
* [`csdx cm:entries:migrate-html-rte`](#csdx-cmentriesmigrate-html-rte)
34+
35+
## `csdx cm:entries:migrate-html-rte`
36+
37+
Migration script to migrate content from HTML RTE to JSON RTE
38+
39+
```
40+
USAGE
41+
$ csdx cm:entries:migrate-html-rte [-c <value>] [-a <value>] [--stack-api-key <value>] [--content-type <value>]
42+
[--global-field] [-y] [--branch <value>] [--html-path <value> --json-path <value>] [--delay <value>] [--locale
43+
<value>] [--batch-limit <value>]
44+
45+
FLAGS
46+
-a, --alias=<value> Enter the alias name. You must use either the --alias flag or the --stack-api-key flag.
47+
-c, --config-path=<value> Specify the path where your config file is located.
48+
-y, --yes Avoids reconfirmation of your configuration.
49+
--batch-limit=<value> [default: 50] Provide batch limit for updating entries (default: 50).
50+
--branch=<value> The name of the branch to be used.
51+
--content-type=<value> Specify the UID of the content type for which you want to migrate HTML RTE content.
52+
--delay=<value> [default: 1000] To set the interval time between the migration of HTML RTE to JSON RTE in
53+
subsequent entries of a content type. The default value is 1,000 milliseconds.
54+
--global-field Checks whether the specified UID belongs to a content type or a global field. This flag
55+
is set to false by default.
56+
--html-path=<value> Enter the path to the HTML RTE whose content you want to migrate.
57+
--json-path=<value> Enter the path to the JSON RTE to which you want to migrate the HTML RTE content.
58+
--locale=<value> The locale from which entries will be migrated.
59+
--stack-api-key=<value> API key of the source stack. You must use either the --stack-api-key flag or the --alias
60+
flag.
61+
62+
DESCRIPTION
63+
Migration script to migrate content from HTML RTE to JSON RTE
64+
65+
EXAMPLES
66+
General Usage
67+
68+
$ csdx cm:entries:migrate-html-rte --config-path path/to/config.json
69+
70+
71+
72+
Using Flags
73+
74+
$ csdx cm:entries:migrate-html-rte --alias alias --content-type content_type_uid --html-path html-path --json-path json-path
75+
76+
77+
78+
Nested RTE
79+
80+
$ csdx cm:entries:migrate-html-rte --alias alias --content-type content_type_uid --html-path modular_block_uid.block_uid.html_rte_uid --json-path modular_block_uid.block_uid.json_rte_uid
81+
82+
83+
84+
$ csdx cm:entries:migrate-html-rte --alias alias --content-type content_type_uid --html-path group_uid.html_rte_uid --json-path group_uid.json_rte_uid
85+
86+
87+
88+
Global Field
89+
90+
$ csdx cm:entries:migrate-html-rte --alias alias --content-type global_field_uid --global-field --html-path html-path --json-path json-path
91+
```
92+
93+
_See code: [src/commands/cm/entries/migrate-html-rte.js](https://github.com/contentstack/cli-plugins/blob/main/packages/contentstack-migrate-rte/src/commands/cm/entries/migrate-html-rte.js)_
94+
<!-- commandsstop -->
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
## Security
2+
3+
Contentstack takes the security of our software products and services seriously, which includes all source code repositories managed through our GitHub organizations.
4+
5+
If you believe you have found a security vulnerability in any Contentstack-owned repository, please report it to us as described below.
6+
7+
## Reporting Security Issues
8+
9+
**Please do not report security vulnerabilities through public GitHub issues.**
10+
11+
Send email to [security@contentstack.com](mailto:security@contentstack.com).
12+
13+
You should receive a response within 24 hours. If for some reason you do not, please follow up via email to ensure we received your original message.
14+
15+
Please include the requested information listed below (as much as you can provide) to help us better understand the nature and scope of the possible issue:
16+
17+
- Type of issue (e.g. buffer overflow, SQL injection, cross-site scripting, etc.)
18+
- Full paths of source file(s) related to the manifestation of the issue
19+
- The location of the affected source code (tag/branch/commit or direct URL)
20+
- Any special configuration required to reproduce the issue
21+
- Step-by-step instructions to reproduce the issue
22+
- Proof-of-concept or exploit code (if possible)
23+
- Impact of the issue, including how an attacker might exploit the issue
24+
25+
This information will help us triage your report more quickly.
26+
27+
[https://www.contentstack.com/trust/](https://www.contentstack.com/trust/)

0 commit comments

Comments
 (0)