Skip to content

Switch from Asset Packagist to NPM/Yarn with drupal-libraries-sync for Varbase Libraries Management in project template #301

@Natshah

Description

@Natshah

Problem/Motivation

Varbase currently relies on asset-packagist.org for managing CSS and JavaScript libraries.
While this method works, it has limitations in speed, security, maintainability, and ecosystem compatibility.

Drupal modules often require external packaged libraries, which are traditionally stored under the docroot/libraries folder.
In Varbase, PHP libraries are already managed by Composer, but CSS/JS assets can be better handled through modern package managers.

To improve workflow, security, and consistency, we propose moving away from asset-packagist.org to use NPM/Yarn with drupal-libraries-npm-sync in Varbase profile.


Proposed Resolution

  • Fully remove the use of https://asset-packagist.org from Varbase and all supported projects.
  • Use NPM or Yarn to fetch front-end libraries with:
    • npm install
    • yarn install
  • Store front-end dependencies under dependencies in package.json.
  • Use drupal-libraries-npm-sync to copy required dist/build files from node_modules to docroot/libraries.
  • Create documentation pages for:
    • Migrating existing projects.
    • Adding a new library.
    • Removing obsolete libraries.

Affected Versions

  • Varbase 10.1.x
  • Varbase 10.0.x
  • Varbase 9.1.x

Benefits

  • Faster installs and updates.
  • Reduced reliance on third-party Composer plugins for front-end assets.
  • Improved security and package authenticity.
  • Aligns with modern Drupal front-end best practices.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions