Problem/Motivation
The module does not require its own front-end library, so every project had to configure asset-packagist and an npm-asset installer path to get Ace on disk. In Varbase 11 the library was instead copied out of node_modules/ by a Node sync script; that approach is being replaced by Composer packages on Packagist.
vardot/ace 1.44.0 is now published on Packagist as type: drupal-library (refreshed from a 2017 fork), so the module can require it the same way drupal/anchor_link requires vardot/ckeditor5-anchor-drupal.
Two of the module's own tests were also asserting the opposite of what they claimed. AceEditorLibrariesTest and AceEditorSearchBoxTest documented "library missing" behaviour by relying on the test build not having Ace on disk. Once the module requires the library it is present in every built site, so those tests no longer described the condition they named.
Steps to reproduce
- On a site with no asset-packagist repository configured,
composer require drupal/ace_editor. - Visit the Status report: the Ace library is reported missing, and
hook_requirements()tells the user to download a zip. - Run the module's PHPUnit suite on a build that has the library present: 68 tests, 3 failures, because the two "library missing" tests assert a condition the build no longer has.
Environment: Drupal core 11.4.5, Varbase 11.0.x, PHP 8.4, MariaDB, DDEV.
Proposed resolution
composer.json: requirevardot/ace: ^1.44.0.- Add
composer.libraries.jsonstating the library require on its own, to copy into a project that needs to pin it. - README: drop the asset-packagist recipe from Requirements and Installation.
hook_install()andhook_requirements(): point at Composer and at the correct/libraries/acepath instead of telling the user to download a zip.- Tests:
AceEditorLibrariesTestandAceEditorSearchBoxTestnow create the "library missing" condition deliberately (a stubbed file system that finds nothing, and a discovery reporting a known path) rather than relying on the build. A test was added for the new reality: with Ace present, the build hook returns one library per mode and theme. - 68 tests with 3 failures becomes 69 tests with 0 failures.
Verified on a freshly installed Varbase 11.4.5 site in DDEV, with every package resolved from Packagist and no VCS repositories:
- 14/14 declared library files present on disk; 10/10 assets return HTTP 200.
- 7/7 Drupal libraries discovered, every asset resolving, all 7 rendering the Composer paths.
- Status report green:
ace_editorOK,dropzonejs_libraryOK,taxonomy_managerOK, media-embed installed at 47.6.2 matching core 47.6.2. ace_editorPHPUnit: 69 tests, 709 assertions, 0 failures.phpcsclean on every changed PHP file.yarn installsucceeds with none of the six npm library packages present.
Remaining tasks
- ✅ File an issue
- ✅ Addition/Change/Update/Fix
- ✅ Testing to ensure no regression
- ✅ Automated unit/functional testing coverage
- ✅ Developer Documentation support
- ➖ User Guide Documentation support
- ➖ UX/UI designer responsibilities
- ➖ Accessibility and Readability
- ❌ Reviewed by a human
- ❌ Code review by maintainers
- ✅ Full testing and approval
- ✅ Credit contributors
- ❌ Review with the product owner
- ✅ Update Release Notes
- ✅ Release
User interface changes
- N/A
API changes
- N/A
Data model changes
- N/A
Release notes snippet
- The module now requires the
vardot/acelibrary itself. Projects no longer need asset-packagist or an npm-asset installer path.
Issue fork ace_editor-3620352
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #3
rajab natshahComment #5
rajab natshahComment #6
rajab natshahFixed on 2.0.x.
Comment #8
rajab natshah✅ Released ace_editor-2.0.5