diff#3
Closed
imagekitio wants to merge 12 commits intoIK-2197from
Closed
Conversation
- Deleted the fixtures.ts file as it was no longer needed. - Updated images.spec.ts to remove redundant tests and simplify image loading checks. - Removed edge case tests for video components and unnecessary attributes in videos.spec.ts. - Updated package.json to include @imagekit/javascript dependency. - Modified upload-auth.ts to use the correct public key environment variable. - Changed images.astro to use astro:assets for image handling and removed outdated examples. - Updated upload.astro to use the new upload method from @imagekit/javascript.
- Implement getSrcSet to generate responsive variants from widths/densities - Apply user transformations first, append trailing step with crop:at_max - Drop fit/position mapping (incompatible with at_max) - Drop redundant height from final transform step (at_max preserves AR) - Resolve urlEndpoint from prop > integration config > env vars - Strip ImageKit-internal props from rendered <img> attributes - Update test-app images.astro cases (urlEndpoint override, absolute URL, layout=none for densities) and refresh snapshots
…module
- Add virtual:@imagekit/astro/config Vite plugin in the integration that
exposes the resolved urlEndpoint and transformationPosition
- Video.astro consumes the virtual module so urlEndpoint can come from
imagekit({ urlEndpoint }) in astro.config.mjs without env vars or props
- Resolution priority: prop > integration config > PUBLIC_/IMAGEKIT_URL_ENDPOINT
- Inject type declaration for the virtual module via injectTypes so
consumer projects get autocomplete and typecheck
- Update test-app videos.astro and refresh snapshots
…PUBLIC_ env Centralize ImageKit config resolution, harden the image service, and simplify the OG helper. Also remove PUBLIC_IMAGEKIT_URL_ENDPOINT since every SDK caller runs server-side. Resolution & integration: - getImageKitConfig is the single resolver: prop > integration config (virtual:@imagekit/astro/config) > IMAGEKIT_URL_ENDPOINT - Video.astro delegates to getImageKitConfig instead of resolving inline - Integration only carries forward known service config keys (urlEndpoint, transformationPosition); foreign keys from a previous service no longer leak through - Warn when urlEndpoint cannot be parsed as a URL - Mark virtual:@imagekit/astro/config external in tsup Image service: - Throw a clear error when no urlEndpoint can be resolved (was: silent '') - Add IKImageTransform type, remove all `as any` casts - Align quality presets with Astro sharp defaults (low/mid/high/max = 25/50/75/100, was 30/80/90/95) Helpers & types: - Drop `format` option from getOgImageTags; emit a single image URL for og:image and twitter:image (ImageKit auto-format negotiates WebP/AVIF/JPEG via the Accept header) - VideoProps extends Astro's HTMLAttributes<'video'> for full HTML video attribute autocomplete (replaces [key: string]: unknown) test-app: - Add /og page exercising getOgImageTags (default, minimal, custom dimensions + transformation) - Link /og from index page
…K srcs Convert image service from ExternalImageService to LocalImageService and delegate non-ImageKit srcs (local assets, allow-listed external hosts) to Astro's bundled sharp service. ImageKit URLs continue to bypass /_image and go straight to ik.imagekit.io with full IK transformations. - Add `additionalEndpoints?: string[]` option for multi-account / custom IK domains; their hosts auto-merge into image.domains and image.remotePatterns - Drop `domains` and `remotePatterns` from imagekit() options; non-IK hosts belong in image.domains / image.remotePatterns directly - Pass `imagekitHosts` through service config so the service knows which absolute URLs to treat as IK - isImageKitSrc routes /_astro/, /@fs/, /@id/, data:, blob:, and non-IK http(s) hosts to sharp; everything else goes to IK - Wire parseURL/transform/propertiesToHash from sharp so /_image accepts non-IK requests (fixes "Configured image service is not a local service") - validateOptions delegates to sharp for non-IK srcs (enables size inference) Test app: - Add additionalEndpoints (ik.imgkit.net) and image.domains (placehold.co) - Add hero.jpg local asset + sharp-delegation cases on /images - Add /md page with 5 routing cases and Playwright snapshot spec - Update /images snapshots: full-width srcset shrinks (LocalImageService uses LIMITED_RESOLUTIONS instead of DEFAULT_RESOLUTIONS) Docs: - README "How it works" section explaining the two-path routing
…ibrary using Astro Content Collections
…s; update helpers and tests
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.
No description provided.