CLI command to download code components

Created on 20 May 2025, 25 days ago

Overview

The CLI tool needs to be able to download code components into a local codebase. This means fetching their data from the /api/v0/config/js_component endpoint, and writing it to files.

→ See: 🌱 [Meta] CLI tool for code components Active

Proposed resolution

  1. Implement this command using the implementation as a reference from the POC: https://github.com/lauriii/experience-builder-cli/blob/main/src/commands.... Use @clack/prompts.
  2. Read the location for your local directory for components from an environment variable or .env file established in 📌 Set up first authenticated request from CLI Postponed .
  3. Component format:
    my-component/
      ├── component.yml     # Component metadata and configuration
      ├── index.jsx         # React component source
      ├── index.css         # Optional CSS
    

    The component.yml file can match the shape of the data the /api/v0/config/js_component endpoint works with — excluding the JS and CSS source/compiled code.

  4. Allow users to select components interactively or passed as a CLI argument. Make sure there is an option to select all.
  5. Create the directories and files for all selected components.
  6. Override any directories locally with matching names to a component that's downloaded.
  7. Download the CSS source from the global asset library (/api/v0/config/xb_asset_library/global), create it as global.css in the local folder for components. Override it any time any component is downloaded.
Feature request
Status

Postponed

Version

0.0

Component

CLI Tool

Created by

🇳🇱Netherlands balintbrews Amsterdam, NL

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024