Automatically detect first-party imports in code components uploaded with the CLI tool

Created on 23 July 2025, 16 days ago

Overview

The CLI tool's upload command requires code component authors to manually add an importedJsComponents key in the component.yml metadata file in case first-party imports are used. The download command also writes that key to the metadata file.

The importedJsComponents key should not be part of the metadata file. First-party imports should be discovered automatically based on the code, just like we do on the code editor UI.

Proposed resolution

  1. Reuse the same code, possibly after some refactoring if needed, as we do on the code editor UI to detect first-party imports in the JavaScript source of a code component.
  2. Set the appropriate property in the payload automatically.
  3. Remove the importedJsComponents property from the Component type (defined in cli/src/types/Component.ts)
  4. Update the download command so it doesn't write this property to the metadata file.

User interface changes

The importedJsComponents property is not exposed to code component authors.

📌 Task
Status

Active

Version

1.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

Comments & Activities

Production build 0.71.5 2024