Skip to content

Closes #5162: Retire usage of Asset Packagist, maintain runtime JS dependencies with Yarn the way core does. - #5975

Open
trackleft wants to merge 18 commits into
mainfrom
retire-asset-packagist
Open

Closes #5162: Retire usage of Asset Packagist, maintain runtime JS dependencies with Yarn the way core does.#5975
trackleft wants to merge 18 commits into
mainfrom
retire-asset-packagist

Conversation

@trackleft

@trackleft trackleft commented Sep 10, 2026

Copy link
Copy Markdown
Member

Summary

  • Retires asset-packagist.org from az_quickstart's composer.json for its two npm-asset dependencies: easepick--bundle and slick-carousel.
  • Follows @joeparsons' proposed pattern from Retire usage of Asset Packagist #5162 (mirroring Drupal core's core/assets/vendor): the actual library files are committed to assets/vendor/, kept in sync from npm via yarn vendor-update (package.json + scripts/js/vendor-update.js), and placed into web/libraries/ via extra.drupal-scaffold.file-mapping.
  • az-digital/az_quickstart is already an allowed-packages scaffold source in az-quickstart-scaffolding, so this requires no changes to any consuming project — same guarantee asset-packagist's inherited repository currently provides.
  • The existing jQuery 4 compatibility patch for slick-carousel (#3467129) is now baked directly into the vendored slick.min.js rather than applied via composer-patches, since the package is no longer composer-resolved. The now-unused patch entry is removed.

slick-carousel consolidation

az_carousel had its own separate, already-patched copy of slick-carousel committed at modules/custom/az_carousel/lib/slick-carousel/, redirected to via a hook_library_info_alter() override (needed because drupal/slick's own library definition points at web/libraries/slick/slick/..., a path nothing was actually populating). This PR:

  • Removes that duplicate copy.
  • Scaffolds the vendored copy to that same web/libraries/slick/slick/... path instead, so drupal/slick's unmodified library definition just works — one vendored source, no override needed for the base library.
  • Also vendors slick-theme.css (the source of .slick-dots styling — drupal/slick's own bundled fallback is missing the dot-hiding rule) and adds it directly to az_carousel's own az_carousel.libraries.yml, rather than altering drupal/slick's library definition for it either. No cross-module library alter hook needed anywhere in this PR.
  • Removes the now-stale az_quickstart_asset_packagist_deprecation requirements warning from az_core.install, since it described these two packages as "still present for backward compatibility" pending removal — which this PR does.

Test plan

  • composer validate passes.
  • Full end-to-end validation with az_quickstart's own .lando.yml: fresh scaffolding clone + composer install resolves and scaffolds both libraries to their correct web/libraries/ paths, with no asset-packagist.org involved anywhere in the resolved dependency tree.
  • yarn install --immutable passes against the regenerated yarn.lock; eslint and phpcs are clean.
  • Visually verified the carousel (enabled az_carousel, added two items with media) against a live main-branch reference (tugboat preview of an unrelated PR off main) — the resulting CSS for .slick-dots is byte-for-byte identical to the reference, including az_carousel's own size/color overrides layered on top.
  • CI.

Follow-up (separate PR, not included here)

az-quickstart-scaffolding declares asset-packagist.org independently in its own composer.json, not only via inheritance from az_quickstart. A follow-up PR against that repo can drop that now-redundant line once this lands.

Scaffolding repo PR: az-digital/az_quickstart#5162, Fixes #275 Remove asset packagist.

Pantheon upstream PR: az-digital/az_quickstart#5162: Retire usage of Asset Packagist.

Release notes

`easepick` has been removed - Quickstart now uses `vanilla-calendar-pro` instead. `slick-carousel` is still used, but no longer requires asset-packagist; it's now vendored directly inside Quickstart and resolves automatically after a `composer update` and `drush cache:rebuild` — no site-level scaffolding needed.

If your site's own `composer.json` added the `asset-packagist.org` repository or the `npm-asset/easepick--bundle` and `npm-asset/slick-carousel` requirements to support Quickstart, both requirements can always be removed safely. Only remove the `asset-packagist.org` repository entry itself after confirming nothing else on your site still depends on a package from it — some sites use it for other, unrelated npm/bower packages.

Fixes #5162

🤖 Generated with Claude Code

Replace the asset-packagist.org repository with explicit composer
"package" definitions for the two npm-asset dependencies currently
resolved through it (npm-asset/easepick--bundle, npm-asset/slick-carousel),
pointing directly at their npm registry tarballs. Removes the external
asset-packagist.org dependency and the availability/network-restriction
risk it introduces for downstream builds.

Verified both packages still resolve and install cleanly to their
currently-pinned versions via the new definitions.

Fixes #5162

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@trackleft
trackleft requested review from a team as code owners September 10, 2026 18:17
@trackleft
trackleft marked this pull request as draft September 10, 2026 18:25
trackleft and others added 5 commits September 10, 2026 11:48
… npm tarballs

Replaces the npm-registry "package" repository approach with Joe's
proposed pattern (mirroring Drupal core's core/assets/vendor): the
actual library files are committed to assets/vendor/, synced from npm
via `yarn vendor-update` (package.json + scripts/js/vendor-update.js),
and placed at their existing web/libraries/ paths via
extra.drupal-scaffold.file-mapping (az_quickstart is already an
allowed-packages scaffold source for az-quickstart-scaffolding, so
this requires no changes to any consuming project).

No .libraries.yml changes anywhere: files land at the exact same
web-root paths they occupy today, so nothing downstream needs to
change. The existing jQuery 4 compatibility patch for slick-carousel
(3467129) is now baked directly into the vendored slick.min.js instead
of being applied via composer-patches, since that package is no longer
composer-resolved; the now-unused patch entry is removed.

Verified end-to-end with a full az_quickstart lando build: composer
install resolves and scaffolds both libraries to their correct
web/libraries/ locations with no asset-packagist.org involved, and
`yarn install --immutable` passes against the regenerated yarn.lock.

Fixes #5162

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
- assets/vendor/ is vendored third-party code, not our own source; add
  it to .eslintignore alongside the existing modules/custom/*/lib
  exclusions, matching established project convention.
- Rework vendor-update.js's copy loop to avoid airbnb-base violations
  (for...of/await-in-loop) using Promise.all instead, and scope a
  no-console disable to the file since console output is the point of
  a CLI script.

Verified `yarn run eslint --color .` (the exact command CI runs) now
passes clean.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…er override

az_carousel had its own separate, already-patched copy of slick-carousel
committed at modules/custom/az_carousel/lib/slick-carousel/, redirected
to via a hook_library_info_alter() override (needed because drupal/slick's
own library definition points at web/libraries/slick/slick/..., a path
nothing was actually populating).

Removes that duplicate copy and the alter hook entirely. The
drupal-scaffold file-mapping added in the previous commit now targets
that same web/libraries/slick/slick/... path directly, so drupal/slick's
unmodified library definition just works — one vendored source
(assets/vendor/slick-carousel/), no override needed.

Also removes the now-stale az_quickstart_asset_packagist_deprecation
requirements warning from az_core.install: it described easepick--bundle
and slick-carousel as "still present for backward compatibility" pending
a "future minor release" removal, which this PR has now already done.
Leaving it would show site administrators a warning about a problem
that's already fixed.

Verified end-to-end: composer install scaffolds files to
web/libraries/slick/slick/ correctly, drupal/slick's own library
definition resolves without alteration, eslint and phpcs are clean.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…er hook

Comparing against a live main-branch reference (tugboat pr5967) revealed
a real regression: the previous commit removed az_carousel/lib's
slick-theme.css along with the rest of that duplicate copy, but that
file (not slick.css) is the ONLY source of the .slick-dots styling that
hides each dot's raw slide-number text and replaces it with a round dot
indicator. Without it, dots render as literal "1"/"2" bordered buttons.

drupal/slick's own bundled fallback (css/theme/slick.theme.css) doesn't
include this rule either - its own comment says it "provides decent dots
if core slick-theme.css is disabled", i.e. it expects a site to supply
the original upstream file, which is what az_carousel was doing.

- Vendor assets/vendor/slick-carousel/slick/slick-theme.css (from the
  same @material-symbols/svg-400... er, slick-carousel npm package) and
  scaffold it to web/libraries/slick/slick/slick-theme.css.
- Restore az_carousel_library_info_alter() (and the hook_module_
  implements_alter() reordering it depends on), updated to point at the
  new vendored path instead of the deleted lib/ copy. This hook is what
  redirects the "slick.css" library - dynamically added by blazy's own
  library-info-alter at runtime, not present in drupal/slick's static
  YAML - to the vendored slick-theme.css.

Verified against the live tugboat reference: the resulting CSS aggregate
now contains the exact same .slick-dots rule set, byte for byte, plus
az_carousel's own size/color overrides layered on top as before.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
The previous commit restored az_carousel_library_info_alter() (and its
hook_module_implements_alter() reordering) to redirect slick's library
definitions to the vendored copy. Verified it wasn't actually needed:

- Its override of $libraries['slick']['js']/['css']['base'] was already
  redundant - drupal/slick's own unmodified definition already points
  at web/libraries/slick/slick/..., which is exactly where the earlier
  "consolidate on one vendored copy" commit scaffolds the files to.
- Its override of $libraries['slick.css']['css']['theme'] (a library
  key dynamically added by blazy at runtime, not present in drupal/
  slick's own YAML) can be replaced entirely by just adding
  slick-theme.css as another CSS file on az_carousel's own library,
  which az_carousel already attaches to every carousel item via
  hook_preprocess_node__az_carousel_item(). No need to reach into
  another module's library definition or depend on blazy's alter
  running first.

Verified the resulting CSS is unchanged, byte for byte, from the
previous (alter-hook-based) approach.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@trackleft
trackleft marked this pull request as ready for review September 10, 2026 21:46
@trackleft trackleft self-assigned this Sep 10, 2026
@trackleft trackleft added the dependencies Pull requests that update a dependency file label Sep 10, 2026
Comment thread scripts/js/vendor-update.js Outdated
Co-authored-by: Joe Parsons <471936+joeparsons@users.noreply.github.com>
@joeparsons joeparsons moved this from Todo to In Progress in 3.6.0-alpha1 Sep 11, 2026
Comment thread scripts/js/vendor-update.js
joeparsons and others added 9 commits September 11, 2026 11:52
Drop the drupal-scaffold file-mapping copy step for slick and
vanilla-calendar-pro so the vendored files stay in one place
(assets/vendor) instead of being duplicated into the site's /libraries
at composer-install time.

- az_carousel: restore hook_library_info_alter() to redirect
  drupal/slick's own library (which we don't own) straight at
  assets/vendor/slick-carousel.
- az_core: vanilla-calendar-pro's library is ours, so just point it at
  assets/vendor directly, no alter hook needed.
- composer.json: remove the now-unnecessary file-mapping entries.
…lter hook

Use extension.list.profile's getPath() instead of hardcoding
profiles/custom/az_quickstart, so this doesn't silently break if the
profile is ever installed at a different path.
Move its js/css into az_core_library_info_alter(), using
extension.list.profile's getPath() the same way az_carousel does for
slick, instead of hardcoding profiles/custom/az_quickstart in the yml.
Drupal core already resolves any /libraries/... library asset path by
searching sites/default/libraries, the webroot libraries/ folder, and
the active install profile's own libraries/ folder (LibrariesDirectoryFileFinder,
see https://www.drupal.org/node/3099614). Vendoring into
az_quickstart's own libraries/ folder means drupal/slick's and
az_core's own /libraries/... library definitions resolve there
automatically, with no need for a custom hook_library_info_alter() to
redirect them.

- vendor-update.js now writes to libraries/ instead of assets/vendor/,
  using the folder name each consumer's library definition already
  expects (slick/slick/... for drupal/slick, vanilla-calendar-pro/...
  for az_core).
- az_carousel and az_core are back to their original library
  definitions/hooks, no alter-hook redirection needed.
- .eslintignore/.prettierignore/.gitattributes updated to match the
  new folder name.
kenwheeler/slick#4350 is the upstream report
this project has never fixed, alongside the drupal.org patch we
already reference.
@joeparsons joeparsons changed the title Retire usage of Asset Packagist Closes #5162: Retire usage of Asset Packagist, manage runtime JS dependencies with Yarn the way core does. Sep 11, 2026
@joeparsons joeparsons changed the title Closes #5162: Retire usage of Asset Packagist, manage runtime JS dependencies with Yarn the way core does. Closes #5162: Retire usage of Asset Packagist, maintain runtime JS dependencies with Yarn the way core does. Sep 11, 2026
@joeparsons joeparsons moved this from In Progress to Needs review in 3.6.0-alpha1 Sep 11, 2026
@joeparsons joeparsons added javascript Pull requests that update javascript code minor release Issues/PRs that should only be made as part of a minor release (according to our release policy). enhancement New feature or request labels Sep 11, 2026
joeparsons
joeparsons previously approved these changes Sep 11, 2026

@joeparsons joeparsons left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for doing most of the work on this!

@joeparsons joeparsons added the high priority Must get done for this milestone label Sep 11, 2026
README.md and RELEASES.md both described easepick and slick-carousel
as still pending removal via asset-packagist. This PR has already done
it: easepick was replaced by vanilla-calendar-pro, and slick-carousel
is now vendored directly instead.
These deprecated stubs pointed at /libraries/easepick--bundle/..., which
no longer exists now that easepick has been fully removed in favor of
vanilla-calendar-pro. Nothing in az_quickstart attaches them, and
keeping them declared would just mean a 404 for any custom code that
still does.
@az-digital-bot

Copy link
Copy Markdown
Contributor

Tugboat has finished building the preview for this pull request!

Link:

Dashboard:

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

Labels

dependencies Pull requests that update a dependency file enhancement New feature or request high priority Must get done for this milestone javascript Pull requests that update javascript code minor release Issues/PRs that should only be made as part of a minor release (according to our release policy). release notes

Projects

Status: Needs review

Development

Successfully merging this pull request may close these issues.

Retire usage of Asset Packagist

4 participants