Skip to content

Properly namespace component attachments after installation #85

Description

@tsega

Expected Behavior

When installing a component in Emulsify Drupal if the component includes a library to be attached like a JavaScript file, then the attachment should be names-spaced under the theme.

Additionally, the attachment should be defined in THEME_NAME.libraries.yml file if it is not already defined.

Current Behavior

The emulsify namespace is used and causes JavaScript functionality to fail.

Possible Solution

After adding the component, Emulsify CLI should replace emulsify with the specific theme name much like how it does it in .cli/init.js:89.

Steps to Reproduce (for bugs)

  1. Add the tabs component from compound; emulsify component install tabs
  2. Look into the twig file of the newly added component: @components/02-molecules/tabs/tabs.twig
  3. You will see the attached library is name-spaced under emulsify not the actual theme.

Your Environment

  • Version used: 1.5.0
  • Browser Name and version: Google Chrome v96.0.4664.110
  • Operating System and version (desktop or mobile): macOS Big Sur v11.6.1

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions