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
Open
Closes #5162: Retire usage of Asset Packagist, maintain runtime JS dependencies with Yarn the way core does.#5975trackleft wants to merge 18 commits into
trackleft wants to merge 18 commits into
Conversation
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
marked this pull request as draft
September 10, 2026 18:25
… 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>
joeparsons
reviewed
Sep 10, 2026
Co-authored-by: Joe Parsons <471936+joeparsons@users.noreply.github.com>
tadean
reviewed
Sep 11, 2026
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
previously approved these changes
Sep 11, 2026
joeparsons
left a comment
Member
There was a problem hiding this comment.
Thanks for doing most of the work on this!
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.
Contributor
|
Tugboat has finished building the preview for this pull request! Link: Dashboard: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
asset-packagist.orgfrom az_quickstart'scomposer.jsonfor its two npm-asset dependencies:easepick--bundleandslick-carousel.core/assets/vendor): the actual library files are committed toassets/vendor/, kept in sync from npm viayarn vendor-update(package.json+scripts/js/vendor-update.js), and placed intoweb/libraries/viaextra.drupal-scaffold.file-mapping.az-digital/az_quickstartis already anallowed-packagesscaffold source inaz-quickstart-scaffolding, so this requires no changes to any consuming project — same guarantee asset-packagist's inherited repository currently provides.slick.min.jsrather than applied viacomposer-patches, since the package is no longer composer-resolved. The now-unused patch entry is removed.slick-carousel consolidation
az_carouselhad its own separate, already-patched copy of slick-carousel committed atmodules/custom/az_carousel/lib/slick-carousel/, redirected to via ahook_library_info_alter()override (needed becausedrupal/slick's own library definition points atweb/libraries/slick/slick/..., a path nothing was actually populating). This PR:web/libraries/slick/slick/...path instead, sodrupal/slick's unmodified library definition just works — one vendored source, no override needed for the base library.slick-theme.css(the source of.slick-dotsstyling —drupal/slick's own bundled fallback is missing the dot-hiding rule) and adds it directly toaz_carousel's ownaz_carousel.libraries.yml, rather than alteringdrupal/slick's library definition for it either. No cross-module library alter hook needed anywhere in this PR.az_quickstart_asset_packagist_deprecationrequirements warning fromaz_core.install, since it described these two packages as "still present for backward compatibility" pending removal — which this PR does.Test plan
composer validatepasses..lando.yml: fresh scaffolding clone +composer installresolves and scaffolds both libraries to their correctweb/libraries/paths, with noasset-packagist.orginvolved anywhere in the resolved dependency tree.yarn install --immutablepasses against the regeneratedyarn.lock;eslintandphpcsare clean.az_carousel, added two items with media) against a live main-branch reference (tugboat preview of an unrelated PR offmain) — the resulting CSS for.slick-dotsis byte-for-byte identical to the reference, includingaz_carousel's own size/color overrides layered on top.Follow-up (separate PR, not included here)
az-quickstart-scaffoldingdeclaresasset-packagist.orgindependently in its owncomposer.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
Fixes #5162
🤖 Generated with Claude Code