-
Notifications
You must be signed in to change notification settings - Fork 17
feat(cli): add assets pull/push commands #400
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: feature/cli-stories
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR adds comprehensive asset and story management commands to the CLI, enabling pull and push operations for both resources. The implementation includes reference mapping between assets and stories, support for third-party CMS migrations, and dry-run capabilities.
Key changes:
- Adds
assets pull/pushcommands for asset management with folder support - Adds
stories pull/pushcommands for story management with reference mapping - Implements manifest-based tracking for ID mapping across spaces
- Introduces streaming pipelines for efficient batch operations
Reviewed changes
Copilot reviewed 25 out of 25 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/cli/src/utils/filesystem.ts | Added file locking, binary data support, and directory reading utilities |
| packages/cli/src/utils/error/error.ts | Added context parameter for enhanced error logging |
| packages/cli/src/utils/error/api-error.ts | Added error action types for asset and story operations |
| packages/cli/src/program.ts | Fixed directory constant references from singular to plural |
| packages/cli/src/lib/logger/*.ts | Added optional chaining for safer error response access |
| packages/cli/src/constants.ts | Added asset/story directories and command definitions |
| packages/cli/src/commands/stories/* | Implemented story pull/push with reference mapping and streaming |
| packages/cli/src/commands/assets/* | Implemented asset pull/push with folder management and streaming |
| packages/cli/src/commands/*/prune/index.ts | Updated directory constant references |
| packages/cli/src/commands/datasources/push/actions.ts | Reorganized imports for consistency |
Comments suppressed due to low confidence (1)
packages/cli/src/commands/assets/pipelines.ts:1
- TODO comment on line 123 references implementing search and other filters 'according to spec', but the spec is not documented or linked. Add a reference to the specification or clarify what additional filters should be supported.
import { pipeline } from 'node:stream/promises';
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
alexjoverm
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sent an internal message with feedback on the approach - blocking the merge for now until discussion.
cbd7828 to
6c8252c
Compare
@storyblok/astro
storyblok
@storyblok/eslint-config
@storyblok/js
storyblok-js-client
@storyblok/management-api-client
@storyblok/nuxt
@storyblok/react
@storyblok/region-helper
@storyblok/richtext
@storyblok/svelte
@storyblok/vue
commit: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 60 out of 60 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
fa26422 to
f368eb1
Compare
Introduce a `stories push` CLI command to upload local JSON stories to a space, correctly remapping story references using component schemas and a manifest for resumable runs. This enables safe space-to-space story sync, including circular references and third‑party IDs. Fixes WDX-134
d8fb477 to
0799136
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 50 out of 50 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
9e04549 to
e0655cc
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 50 out of 50 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| onFolderSuccess?: (localFolder: AssetFolder, remoteFolder: AssetFolder | AssetFolderUpdate) => void; | ||
| onFolderError?: (error: Error, folder: AssetFolder) => void; | ||
| }) => { | ||
| return new Writable({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
question: @maoberlehner are the folders topologically sorted? I'm thinking about a case like this:
[
{
id: 2,
parent_id: 1
},
{
id: 1
}
]where first a "child" asset folder is uploaded before the parent exists, and then the parent. Does it work properly, creating the references successfully? Do you think we need to sort them first (by depth, for instance)?
Fixes WDX-224
Fixes WDX-225