feature/design-tokens-module#997
Draft
d4mation wants to merge 122 commits into
Draft
Conversation
[DTM] Added Design_Tokens_Provider
Stand up a dedicated Codeception 'snapshot' suite so snapshot tests can be written for generated DTCG documents as part
of the Kadence AI -> Design System project.
- Add dev dependency lucatume/wp-snaphot-assertions (spatie snapshot assertions)
- Add tests/snapshot.suite.yml + tests/snapshot/_bootstrap.php (--debug ->
--update-snapshots glue)
- Add SnapshotTester actor and Helper/Snapshot module
- Add Tests\Support\Classes\SnapshotTestCase base class with an
assertMatchesJsonSnapshot() override that snapshots pretty-printed JSON via
the text driver (avoids spatie's lossy JSON round-trip that coerces {} to [])
- Run the snapshot suite in CI
Contributor
|
🎉 Zip build complete |
…ethod Spatie's MatchesSnapshots declares assertMatchesJsonSnapshot() as public; overriding it with the same visibility keeps it a clean drop-in and avoids narrowing the contract.
The StellarWP DB layer throws DatabaseQueryException on a write error rather than returning false, so the previous '=== false' guards were unreachable and the bool return types implied a failure signal that can never occur. - Revert save_document() and bump_version() to void; document that a failed write throws, so the change action only fires on success. - Replace the mock-based tests (which failed because Token_Store is final and cannot be doubled) with one test that triggers a real DatabaseQueryException and asserts the change action does not fire. Fixes the wpunit CI failures.
[DTM] Token Registry + register_design_token() helper
[DTM] Token Resolver — effective-document merge, alias flattening, CSS renderers
…ens-history-table
…ry-table [DTM] Record previous document on token save in kb_design_tokens_history
[DTM] Resolver caching — wp_cache L2 layer for Token_Resolver
- Add abstract Rest\V1\Controller base (kb-design-tokens/v1 namespace, edit_theme_options capability gate behind the kadence_blocks_design_tokens_capability filter) - Add versioned REST providers: Rest\Provider boots version sub-providers, Rest\V1\Provider registers controllers on rest_api_init - Register Rest\Provider in Design_Tokens_Provider - Add wpunit coverage for the base controller's namespace, capability, and permission gate
- Relocate abstract Controller to Rest\V1\Contracts - Import the contract in Rest\V1\Provider and mirror the test path
Describe the class instead of the design rationale.
permission_check() is the only caller and WP always supplies a WP_REST_Request, so drop the speculative nullable default.
Now extending classes don't have to check for it being non-falsy
…ller-skeleton feat: Design Tokens REST controller skeleton (SOFT-3387)
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.
🎫 https://linear.app/nexcess/project/design-system-7186b33eeebd/overview
...
Checklist
Block specific checklist (where relevant)