feat(data-transfer): add directory export/import format#25867
feat(data-transfer): add directory export/import format#25867innerdvations merged 5 commits intodevelopfrom
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
Claude Code Review
This repository is configured for manual code reviews. Comment @claude review to trigger a review and subscribe this PR to future pushes, or @claude review once for a one-time review.
Tip: disable this comment in your organization's Code Review settings.
|
@dosubot Only one label may be present on a PR at a time; if you add one, you must also remove one |
|
Hi! I'm Dosu and I'm helping the Strapi team. Thanks for the heads-up! I'll keep that in mind — only one label at a time on a PR, and if I add one, I need to remove the existing one first. Got it! 👍 To reply, just mention @dosu. How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other |
nclsndr
left a comment
There was a problem hiding this comment.
Nice job @innerdvations 🙌
Managed to export / import with both archive and plain-files folder.
|
@pwizla No rush (as in, even if it takes a few weeks after we release this it's fine) but we might want documentation on the extra import/export options being added here |
Made-with: Cursor # Conflicts: # packages/core/strapi/src/cli/utils/commander.ts
…ites Add a Writable `final` handler to the JSONL directory writer so the last buffer is flushed on normal `.end()`, not only on `destroy`. Wrap synchronous filesystem work in `createAssetsWriteStream` in try/catch and report failures as `ProviderTransferError`, matching the pipeline path and engine diagnostics. Add a unit test that asserts sync `mkdirSync` errors surface as `ProviderTransferError` with a preserved cause.
What does it do?
.tar:metadata.json,schemas/,entities/,links/,configuration/,assets/, …) in addition to.tar/.tar.gz/.tar.encarchives.@strapi/data-transfer, wired through the public package surface and Strapi CLI import/export flow (including validation that a path looks like an unpacked export).getInquirer()helper (cached dynamic import) instead of repeatingawait import('inquirer')at many call sites.@strapi/cloud-cli:deploy-project/action.tsno longer references a removedloadInquirersymbol (uses the same dynamic import pattern as elsewhere in that package).tests/e2e/data/from committed.tarblobs to unpacked directories so JSON/JSONL and small metadata files are normal text diffs in Git; binary uploads stay underassets/uploads/as before..prettierignoreentries fortests/e2e/data/**and**/tmp-dts-export/**(e.g.examples/complex/tmp-dts-export), plus optional EditorConfig overrides for those paths so editor save behavior doesn’t fight fixture files.Why is it needed?
loadInquirer; this restores a valid implementation without pulling core helpers into cloud-cli.metadata.jsonand similar files under example export trees; ignoring those paths prevents noisy EOF/newline-only diffs when runningyarn prettier:write.How to test it?
Environment: Node/Yarn as in the repo root; build Strapi packages if your workflow requires it (
yarn setup/yarn buildas you normally use for local dev).Automated
@strapi/data-transferdirectory provider tests and Strapi CLI import/export/transfer/admin command tests that were updated on this branch.tests/cli/tests/strapi/data-transfer/(export, import, roundtrip) — they exercise export →output.tar→ import using the test app and e2e-backed seed data.tests/e2e/data(e.g.with-admin) if you touch import paths or fixtures.Manual
strapi exportto a filename (producing a.taras today), then extract it and runstrapi import -f /path/to/unpacked/dir(or point-fat the directory directly, per CLI help) and confirm import completes..tarvs unpacked directory (DB / admin content parity).yarn prettier:writeand confirmtests/e2e/data/**andexamples/complex/tmp-dts-export/**files are not rewritten (no spurious newline-only changes tometadata.json).Related issue(s)/PR(s)
CMS-538