✨ feat: enhance medialib image handling and add asset URL resolution
- Implemented `resolveApiAssetUrl` function to normalize asset URLs based on API base. - Updated `MedialibImage` component to utilize new asset URL resolution and added support for alt text and class properties. - Enhanced image loading behavior with improved width measurement and focal point handling. - Added placeholder image handling and improved accessibility with alt text. - Introduced new test script for auditing broken links in skill documentation. - Expanded seeded test content to include medialib entries and updated related tests for pagebuilder previews. - Improved global setup and teardown logging for clarity on seeded content management.
This commit is contained in:
@@ -2,6 +2,14 @@
|
||||
|
||||
Hook files run inside the tibi-server Go runtime (goja).
|
||||
|
||||
For the full workflow, prefer the `tibi-hook-authoring` skill.
|
||||
|
||||
## Related skills
|
||||
|
||||
- `security-hardening-and-token-strategy` when hooks touch secrets, external requests, auth, or risky capabilities.
|
||||
- `tibi-actions-and-forms` when the behavior is endpoint-like and should be modeled as an action instead of collection CRUD.
|
||||
- `troubleshooting-and-debugging` when goja/runtime failures span config, auth, hook execution, or reverse-proxy behavior.
|
||||
|
||||
## Conventions
|
||||
|
||||
- Wrap hook files in an IIFE: `;(function () { ... })()`.
|
||||
@@ -9,6 +17,7 @@ Hook files run inside the tibi-server Go runtime (goja).
|
||||
- Use inline type casting with `/** @type {TypeName} */ (value)` and typed collection entries from `types/global.d.ts`.
|
||||
- Avoid `@ts-ignore`; use proper casting instead.
|
||||
- Use `const` and `let` instead of `var`. The tibi-server runtime supports modern JS declarations.
|
||||
- Public-read or mutation hooks that affect rendered content must be reviewed together with `filter_public.js`, `config.js`, and cache invalidation behavior.
|
||||
|
||||
## context.filter — Go object quirk
|
||||
|
||||
@@ -45,3 +54,4 @@ instead, only add authorization filters (e.g. `{ userId: userId }`).
|
||||
- When creating or modifying collections/hooks: extend or create corresponding API tests in `tests/api/`.
|
||||
- After hook changes, run only affected API tests: `npx playwright test tests/api/filename.spec.ts`.
|
||||
- When tests fail, clarify whether the hook or the test needs adjustment — coordinate with the user.
|
||||
- If hook changes affect public rendering, add or rerun the narrowest SSR/public-read validation instead of relying only on CRUD-oriented API tests.
|
||||
|
||||
Reference in New Issue
Block a user