Overview

The CLI tool needs to be able to scaffold code components in a local codebase.

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

Proposed resolution

  1. Implement this command using the relevant part of 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. Generate the component in the following 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.

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’s picture

Assigned: Unassigned » hooroomoo
Status: Postponed » Active

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

hooroomoo credited lauriii.

hooroomoo’s picture

Adding credit for poc

hooroomoo’s picture

Status: Active » Needs review

MR is built on top of #3525583: CLI command to download code components and will need to be re-rolled after that gets in

hooroomoo’s picture

Assigned: hooroomoo » Unassigned
hooroomoo’s picture

Assigned: Unassigned » balintbrews
hooroomoo’s picture

Assigned: balintbrews » hooroomoo
Status: Needs review » Needs work
hooroomoo’s picture

Assigned: hooroomoo » balintbrews
Status: Needs work » Needs review

balintbrews’s picture

Assigned: balintbrews » Unassigned
Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

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