Switch from Asset Packagist to NPM/Yarn with drupal-libraries-npm-sync for Varbase Libraries Management

Created on 13 August 2025, 2 days ago

Problem/Motivation

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

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

To improve workflow, security, and consistency, move away from asset-packagist.org and adopt NPM/Yarn with
drupal-libraries-npm-sync.

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: npm install or yarn install.
  • Declare 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 for:
    • Migrating existing projects.
    • Adding a new library.
    • Removing obsolete libraries.

Remaining tasks

  • ✅ File an issue about this project
  • ❌ Addition/Change/Update/Fix to this project
  • ❌ Testing to ensure no regression
  • ➖ Automated unit/functional testing coverage
  • ➖ Developer Documentation support on feature change/addition
  • ➖ User Guide Documentation support on feature change/addition
  • ➖ UX/UI designer responsibilities
  • ➖ Accessibility and Readability
  • ❌ Code review from 1 Varbase core team member
  • ❌ Full testing and approval
  • ❌ Credit contributors
  • ❌ Review with the product owner
  • ❌ Update Release Notes and Update Helper on new feature change/addition
  • ❌ Release

Varbase update type

  • ✅ No Update
  • ➖ Optional Update
  • ➖ Forced Update
  • ➖ Forced Update if Unchanged

User interface changes

  • N/A

API changes

  • N/A

Data model changes

  • N/A

Release notes snippet

  • N/A
📌 Task
Status

Active

Version

10.1

Component

Code

Created by

🇯🇴Jordan Rajab Natshah Jordan

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024