Overview

The CLI tool needs to be able to upload code components from a local codebase. This means sending their data with POST to the /api/v0/config/js_component endpoint.

→ See: #3525571: [Meta] CLI tool for code components

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 #3525579: Implement client credentials flow in CLI, centralize managing config.
  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. Upload the CSS source for the global asset library (/api/v0/config/xb_asset_library/global) reading it from the global.css file located in the local folder for components.
  6. Out of scope: compiling and uploading compiled JS/CSS.
Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

balintbrews created an issue. See original summary.

hooroomoo made their first commit to this issue’s fork.

hooroomoo’s picture

Assigned: Unassigned » hooroomoo
Status: Postponed » Active

hooroomoo changed the visibility of the branch 3525587-cli-command-to to hidden.

balintbrews’s picture

Assigned: hooroomoo » Unassigned
Status: Active » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.