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

  1. On a site with no asset-packagist repository configured, composer require drupal/ace_editor.
  2. Visit the Status report: the Ace library is reported missing, and hook_requirements() tells the user to download a zip.
  3. 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: require vardot/ace: ^1.44.0.
  • Add composer.libraries.json stating 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() and hook_requirements(): point at Composer and at the correct /libraries/ace path instead of telling the user to download a zip.
  • Tests: AceEditorLibrariesTest and AceEditorSearchBoxTest now 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_editor OK, dropzonejs_library OK, taxonomy_manager OK, media-embed installed at 47.6.2 matching core 47.6.2.
  • ace_editor PHPUnit: 69 tests, 709 assertions, 0 failures. phpcs clean on every changed PHP file.
  • yarn install succeeds 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/ace library itself. Projects no longer need asset-packagist or an npm-asset installer path.

Issue fork ace_editor-3620352

Command icon 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

rajab natshah created an issue. See original summary.

rajab natshah’s picture

Status: Active » Needs review

  • rajab natshah committed 2d2a9098 on 2.0.x
    feat: #3620352 Require the vardot/ace library in the module, so a...
rajab natshah’s picture

Issue summary: View changes
rajab natshah’s picture

Status: Needs review » Fixed

Fixed on 2.0.x.

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

rajab natshah’s picture

Issue tags: +ace_editor-2.0.5

✅ Released ace_editor-2.0.5

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.