Skip to content

Conversation

@dpi
Copy link
Owner

@dpi dpi commented Dec 9, 2025

Introducing Resources as a way to provide information about a component.

Paving the way for components to be independent from enums (lists), and either provide their own resource information, or for implementations (like the Drupal module), to specify default resource information.

All of the requirements of ObjectListInterface moved to the new resource interface, leaving ObjectListInterface a combination of the resource interface and enum interfaces.

Enum and enum class/lists are abstracted, and are no longer a part of the runtime API.

The two static methods of ObjectListInterface, libraries and definitions, are removed have no replacement. Libraries are mostly a Drupal concept, collates CSS and JS assets and resolve dependencies. This responsibility has moved to the Drupal module. Utilities for these have also been removed. The role of definitions has been moved to discovery and the PintoMapping class, which was previously a duplicated requirement.

A new method has been added to ResourceInterface::dependencies, required by ObjectListInterface. This method has a default implementation which reflects DependencyOn enums.

A new method has been added to ResourceInterface::getClass, required by ObjectListInterface. This method has a default implementation which reflects Definition enums. Enums cases which do not have an associated component class will return NULL.

Most regular uses of the Pinto libraries will not require changes. Projects making use of Pinto, adding automation and other conveniences, will likely need minor updates.

Anything previously typehinted on ObjectListInterface will likely change to ResourceInterface

The signature of PintoMapping::__construct has been modified, parameters need to be populated appropriately.

PintoMapping::getByClass has been replaced with PintoMapping::getResource

PintoMapping::getEnumClasses has been removed, a similar solution is introduced at PintoMapping::getResources.

@codecov-commenter
Copy link

codecov-commenter commented Dec 9, 2025

Codecov Report

❌ Patch coverage is 99.10714% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 97.06%. Comparing base (6222913) to head (92d1705).

Files with missing lines Patch % Lines
src/List/ObjectListTrait.php 92.30% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main      #59      +/-   ##
============================================
- Coverage     97.24%   97.06%   -0.19%     
- Complexity      221      245      +24     
============================================
  Files            34       38       +4     
  Lines           509      511       +2     
============================================
+ Hits            495      496       +1     
- Misses           14       15       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@dpi
Copy link
Owner Author

dpi commented Dec 9, 2025

There is coverage at \Pinto\tests\PintoNoDefinitionsTest::testResourceClass but it is not registering...

@dpi dpi merged commit 3b86448 into main Dec 9, 2025
10 checks passed
@dpi dpi deleted the resources-and-standalone-components branch December 9, 2025 16:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants