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
8 changes: 8 additions & 0 deletions .github/workflows/release-production-plugins.yml
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,14 @@ jobs:
package: ./packages/contentstack-cli-tsgen/package.json
tag: latest

# External Migrate
- name: Publishing external-migrate (Production)
uses: JS-DevTools/npm-publish@v3
with:
token: ${{ secrets.NPM_TOKEN }}
package: ./packages/contentstack-external-migrate/package.json
tag: latest

- name: Create Production Release
id: create_release
env:
Expand Down
6 changes: 2 additions & 4 deletions .talismanrc
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
fileignoreconfig:
- filename: packages/contentstack-import/src/import/modules/webhooks.ts
checksum: 8c9527f966fe24debfb36d96a280ac3b2dd6494a58128380c69d7475e595436d
- filename: packages/contentstack-import/test/unit/import/modules/webhooks.test.ts
checksum: 3924a3e38211b8554f25365fe3100cb83361d03370fdaa77e5c7f9e74abafcee
- filename: pnpm-lock.yaml
checksum: 07642e8dd04d580185a459e5b088d8a1bb4e91be4e04f4842bf4fe4775205bf6
version: '1.0'
4 changes: 2 additions & 2 deletions packages/contentstack-apps-cli/src/util/common-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ function fetchAppInstallations(
flags: FlagInput,
orgUid: string,
options: MarketPlaceOptions
) {
): Promise<any> {
const { marketplaceSdk } = options;
const app: any = flags["app-uid"];
return marketplaceSdk
Expand Down Expand Up @@ -218,7 +218,7 @@ function uninstallApp(
orgUid: string,
options: MarketPlaceOptions,
installationUid: string
) {
): Promise<any> {
const { marketplaceSdk } = options;
// const app: any = flags["app-uid"];
return marketplaceSdk
Expand Down
2 changes: 1 addition & 1 deletion packages/contentstack-audit/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ $ npm install -g @contentstack/cli-audit
$ csdx COMMAND
running command...
$ csdx (--version|-v)
@contentstack/cli-audit/1.19.3 darwin-arm64 node-v24.14.0
@contentstack/cli-audit/1.19.4 darwin-arm64 node-v24.14.0
$ csdx --help [COMMAND]
USAGE
$ csdx COMMAND
Expand Down
2 changes: 1 addition & 1 deletion packages/contentstack-branches/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ $ npm install -g @contentstack/cli-cm-branches
$ csdx COMMAND
running command...
$ csdx (--version)
@contentstack/cli-cm-branches/1.8.1 darwin-arm64 node-v24.14.0
@contentstack/cli-cm-branches/1.8.2 darwin-arm64 node-v24.14.0
$ csdx --help [COMMAND]
USAGE
$ csdx COMMAND
Expand Down
2 changes: 1 addition & 1 deletion packages/contentstack-bulk-publish/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ $ npm install -g @contentstack/cli-cm-bulk-publish
$ csdx COMMAND
running command...
$ csdx (--version)
@contentstack/cli-cm-bulk-publish/1.11.3 darwin-arm64 node-v24.14.0
@contentstack/cli-cm-bulk-publish/1.12.0 darwin-arm64 node-v24.14.0
$ csdx --help [COMMAND]
USAGE
$ csdx COMMAND
Expand Down
2 changes: 1 addition & 1 deletion packages/contentstack-export/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ $ npm install -g @contentstack/cli-cm-export
$ csdx COMMAND
running command...
$ csdx (--version)
@contentstack/cli-cm-export/1.25.0 darwin-arm64 node-v24.14.0
@contentstack/cli-cm-export/1.25.1 darwin-arm64 node-v24.14.0
$ csdx --help [COMMAND]
USAGE
$ csdx COMMAND
Expand Down
18 changes: 18 additions & 0 deletions packages/contentstack-external-migrate/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
module.exports = {
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaVersion: 2020,
sourceType: 'module',
},
plugins: ['@typescript-eslint'],
extends: ['eslint:recommended', 'plugin:@typescript-eslint/recommended'],
rules: {
'unicorn/prefer-module': 'off',
'unicorn/no-abusive-eslint-disable': 'off',
'@typescript-eslint/no-use-before-define': 'off',
'node/no-missing-import': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-require-imports': 'off',
'no-useless-escape': 'off',
},
};
27 changes: 27 additions & 0 deletions packages/contentstack-external-migrate/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
node_modules/
/lib/
oclif.manifest.json
*.log
.DS_Store
coverage/

# Local migration outputs (may contain customer content)
migration-workspace/
contentstack-import/
audit-reports/
audit-fix/
audit-verify/
export.json
contentfulMigrationData/
_backup_*/
migration-manifest.json

# Import/audit session logs (local artifacts, may contain customer content)
logs/
session.json

# Internal scratch docs — never commit (PR drafts / status notes)
pr.md
achieve.md
out/
.vscode/
43 changes: 43 additions & 0 deletions packages/contentstack-external-migrate/AGENTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# Agent guide — Contentstack Migrate plugin

Use this file when automating work in `cli-plugin-migrate/`.

## What this repo is

- **Package:** `@contentstack/cli-plugin-migrate`
- **Commands:** `csdx migrate:export|convert|audit|import|status`
- **Scope:** Contentful → Contentstack migration (expert CLI, no bundled AI)

## User-facing docs (read first)

| Doc | Use when |
|-----|----------|
| [README.md](./README.md) | Install, commands, troubleshooting |
| [docs/getting-started.md](./docs/getting-started.md) | Onboarding colleagues |
| [docs/expert-workflow.md](./docs/expert-workflow.md) | End-to-end pipeline |
| [docs/limitations-and-scope.md](./docs/limitations-and-scope.md) | What is / isn't supported |

## Maintainer docs

| Doc | Use when |
|-----|----------|
| [docs/architecture.md](./docs/architecture.md) | Package layout, adapters |
| [docs/implementation-principles.md](./docs/implementation-principles.md) | Port vs PRD flags, spawn rules |
| [docs/phases/](./docs/phases/) | Per-command implementation specs |

## Rules for changes

1. **Do not** add `--stack` to `migrate:convert` — import stays on `migrate:import`.
2. **Audit/import** → shell out via `src/lib/csdx-spawn.ts`, do not reimplement CMA.
3. **Export** → `src/lib/contentful-cli-spawn.ts` (global `contentful` or `npx -y contentful-cli`).
4. **Never log** management tokens or full stack API keys.
5. **Manifest** updates on successful command completion — see `src/lib/manifest.ts`.
6. Match flag names in [README.md](./README.md) and phase docs, not the old reference Commander CLI.

## Verify

```bash
npm run build && npm test
```

Reference port source (optional, parent monorepo): `../references/import-contentful-cli-main/`.
21 changes: 21 additions & 0 deletions packages/contentstack-external-migrate/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Changelog

All notable changes to `@contentstack/cli-plugin-migrate` are documented here.

## [0.1.0] — 2026-06-03

### Added

- `csdx migrate:export` — Contentful space export via Contentful CLI
- `csdx migrate:convert` — Contentful export → Contentstack import bundle
- `csdx migrate:audit` — wrapper for `csdx cm:stacks:audit`
- `csdx migrate:import` — wrapper for `csdx cm:stacks:import`
- `csdx migrate:status` — migration workspace manifest and next-step hints
- `migration-manifest.json` tracking (no secrets)
- Documentation set under `docs/` and root `README.md`

### Notes

- Contentful-only (`--legacy contentful`)
- Install via `csdx plugins:link .` after `npm run build`
- Import requires an empty destination stack and `csdx auth:login`
56 changes: 56 additions & 0 deletions packages/contentstack-external-migrate/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# Contributing

Thanks for working on `@contentstack/cli-plugin-migrate`. This repo is a **csdx plugin** — colleagues install it with `csdx plugins:link .`, not from npm (unless you publish it later).

## Setup

```bash
cd cli-plugin-migrate
npm install
npm run build
csdx plugins:link .
csdx migrate --help
```

Node **20+** required. Built output goes to `lib/` (gitignored); always run `npm run build` after pulling TypeScript changes.

## Scripts

| Command | Purpose |
|---------|---------|
| `npm run build` | `tsc`, copy JSON assets, regenerate `oclif.manifest.json` |
| `npm test` | Vitest (unit + convert integration on fixtures) |
| `npm run lint` | ESLint on `.ts` files |

## Where to change things

| Area | Path |
|------|------|
| CLI commands | `src/commands/migrate/*.ts` |
| Contentful orchestration | `src/adapters/contentful/` |
| Conversion engine | `src/services/contentful/` |
| Spawn helpers | `src/lib/csdx-spawn.ts`, `src/lib/contentful-cli-spawn.ts` |
| Manifest | `src/lib/manifest.ts` |
| Tests | `test/` |

## Documentation

When you change behavior or flags, update:

1. [README.md](./README.md) — user-facing command reference
2. [docs/expert-workflow.md](./docs/expert-workflow.md) — copy-paste pipeline
3. Relevant [docs/phases/](./docs/phases/) spec if the contract changed
4. [docs/manifest-schema.md](./docs/manifest-schema.md) if manifest fields change

See [docs/README.md](./docs/README.md) for the full doc map.

## Tests

- Small fixture: `test/fixtures/contentful-export.json` (always in repo)
- Large export test skips if `../references/contentful-export-*.json` is missing (monorepo only)

## Pull requests

- Run `npm run build && npm test` before opening a PR
- Do not commit `migration-workspace/`, `export.json`, tokens, or `node_modules/`
- Do not commit `lib/` or `oclif.manifest.json` (generated on build)
21 changes: 21 additions & 0 deletions packages/contentstack-external-migrate/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2026 Contentstack

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
Loading
Loading