Skip to content

Latest commit

 

History

History
873 lines (533 loc) · 25.8 KB

File metadata and controls

873 lines (533 loc) · 25.8 KB

Change Log

12.0.1

Patch Changes

  • 937fd37: fix: log an unknown image ID instead of throwing

12.0.0

Major Changes

  • 2ccbeeb: Drop applied-transform directives from the as=metadata output

    The as=metadata export no longer includes the applied-transform directive values (flip, quality, rotate, ...), only the final output width, height, format, the image's sharp metadata and the src. The applied transforms cannot be reconstructed from a cached file, so previously a metadata import that hit a cache entry could fail with a MISSING_EXPORT error or silently omit those fields; dropping them makes the export deterministic across cache hits and misses.

  • 2ccbeeb: Make ImageConfig a record of single-string directives, excluding output-format parameters

    ImageConfig values are now always single strings. The output-format parameters that previously kept their array values on config no longer appear in the configs at all:

    • resolveConfigs now returns an array of single-value directive records (ImageConfig[]), excluding the output-format parameters and the as output format selector that previously appeared as array values on config.
    • Transform factories and options now receive only the single-value directives, so metadata[key] is string | undefined rather than string | string[] | undefined.
    • Output format parameters and the as selector no longer affect the generated cache id, since they only influence how the already-processed image is serialized. URLs that differ only in these parameters share a single cache entry.
    • Every key in outputFormats is excluded from the configs, including custom output formats. A custom output format whose name collides with a transform directive name suppresses that directive (e.g. a custom output format named blur makes ?blur=5 stop applying the blur transform); name custom output formats to avoid directive names, since any key matching an output format is dropped from the configs.

Patch Changes

  • 2ccbeeb: Report the encoded image's metadata on a cache miss

    A metadata import now reports the same raw sharp metadata whether the image came from the cache or a fresh process: the cache-miss path reads the encoded output's metadata instead of the source image's, so fields like isProgressive, hasAlpha, pages or density no longer differ between the two.

  • Updated dependencies [2ccbeeb]

  • Updated dependencies [2ccbeeb]

    • imagetools-core@12.0.0

11.0.0

Major Changes

  • 3b3c42b: breaking: ImageMetadata is no longer a flat object extending sharp's Metadata. It is now { info: { width, height, autoOrient }, transforms: AppliedTransforms }, where transforms records the values applied by each transform. Custom transforms and output formats that read or write these fields must be updated to the new shape.

    breaking: TransformOption and ImageTransformation now receive the threaded ImageMetadata as their first argument instead of reading and writing state on the sharp instance. The getMetadata/setMetadata functions and the METADATA symbol are removed. ProcessedImageMetadata is renamed ProcessedImage, TransformResult is renamed ApplyTransformsResult, and TransformState is renamed AppliedTransforms.

    Custom transforms that previously stored their own values on image[METADATA] can record them on state.transforms instead. Because AppliedTransforms is an exported interface, it can be extended from your own code via declaration merging to add typed custom fields:

    declare module 'imagetools-core' {
      interface AppliedTransforms {
        myCustomValue?: string
      }
    }

    Values written to state.transforms are included in the as=metadata output, so this also lets custom output formats consume them.

    breaking: the pixelDensityDescriptor field is removed from ImageMetadata. Pixel density descriptors are now derived on the fly from the basePixels directive and the rendered image width, so they no longer depend on the build cache and work with or without a w/h/aspect directive.

    The vite-imagetools plugin now reports the actual rendered width and height on the metadata, reconciled against the encoded output on every transformation, instead of the values declared by the transforms (which rotate never updated). The as=metadata output keeps its previous flat shape, so it is unchanged for existing users.

  • efe000b: breaking: require vite 8

Patch Changes

  • d0dc5ab: fix: write build cache entries atomically, so an interrupted build can't leave a truncated entry that later builds read back as valid
  • e7cef2f: perf: hash the source file bytes instead of a decoded buffer when building cache keys, so the plugin no longer pays a full sharp decode for every image on every build
  • febf95d: fix: keep the format directive's value when restoring images from the build cache, so emitted asset filenames no longer flip between .jpg and .jpeg
  • 8b44393: chore: upgrade to sharp 0.35.3"
  • Updated dependencies [3b3c42b]
  • Updated dependencies [8b44393]
    • imagetools-core@11.0.0

10.0.1

Patch Changes

  • 77d4925: chore: upgrade to sharp 0.35
  • Updated dependencies [987ebef]
  • Updated dependencies [77d4925]
    • imagetools-core@10.0.0

10.0.0

Major Changes

  • c30beff: breaking: require Vite 7 and Node 22

Minor Changes

  • c30beff: feat: implement Vite hook filters for improved performance

9.0.3

Patch Changes

  • e4e74d4: fix: use raw cached bytes instead of re-encoding through sharp

9.0.2

Patch Changes

  • 4c15f51: fix: avoid corruption and build errors caused by concurrent access to cache files
  • 068fe00: fix: avoid hitting the filesystem multiple times when restoring from cache"
  • Updated dependencies [81887b8]
    • imagetools-core@9.1.0

9.0.1

Patch Changes

  • dfb819e: fix: correct output of originalFilename in Vite manifest

9.0.0

Major Changes

  • 91332bc: breaking: drop support for Node 18

Patch Changes

  • Updated dependencies [91332bc]
    • imagetools-core@9.0.0

8.0.0

Major Changes

  • d39cc2c: breatking: add autoOrient directive from Sharp 0.34.0, defaulting to automatically apply it to every image. An opt-out is available via noAutoOrient.

Patch Changes

  • Updated dependencies [d39cc2c]
    • imagetools-core@8.0.0

7.1.1

Patch Changes

  • 2afafeb: fix: add originalFilename to emitted asset in the mainfest.json

7.1.0

Minor Changes

  • 28a6e8b: chore(deps): upgrade sharp to 0.34.1

Patch Changes

  • Updated dependencies [28a6e8b]
    • imagetools-core@7.1.0

7.0.5

Patch Changes

  • Updated dependencies [c530897]
    • imagetools-core@7.0.2

7.0.4

Patch Changes

  • c4a0dc7: fix: correct URL concatenation in dev mode when origin set in server options

7.0.3

Patch Changes

  • 57e070e: fix: attempt to make sharp dependency declaration compatible with yarn
  • Updated dependencies [57e070e]
    • imagetools-core@7.0.1

7.0.2

Patch Changes

  • f049b7f: fix: consistent image id hashes across machines

7.0.1

Patch Changes

  • 29b3fed: fix: correctly set avif format when file is read from cache

7.0.0

Major Changes

  • c4fdd3a: breaking: require Node 18 or newer to align with Vite and Vitest

Minor Changes

  • 7542fa5: feat: add "inline" directive
  • 4819fc1: feat: caching of generated images
  • dc25e4b: feat: support Vite's server.origin option

Patch Changes

  • 755912c: fix: use URI-decoded pathname when emitting file
  • Updated dependencies [dc2f16f]
  • Updated dependencies [c4fdd3a]
    • imagetools-core@7.0.0

6.2.9

Patch Changes

  • 0eca643: chore: bump sharp to 0.33.1
  • Updated dependencies [0eca643]
    • imagetools-core@6.0.4

6.2.8

Patch Changes

  • 1bdfe74: fix: make generateImageID work for files with spaces
  • 216e40a: fix: avoid using fs/promises

6.2.7

Patch Changes

  • 5d7a77d: chore: update sharp to 0.33
  • Updated dependencies [5d7a77d]
    • imagetools-core@6.0.3

6.2.6

Patch Changes

  • e0ba6c0: fix: corrected imports to compile with "moduleResolution": "nodenext"
  • Updated dependencies [e0ba6c0]
    • imagetools-core@6.0.2

6.2.5

Patch Changes

  • fcd7389: chore: upgrade @rollup/pluginutils
  • Updated dependencies [fcd7389]
    • imagetools-core@6.0.1

6.2.4

Patch Changes

  • c54ad96: fix: refresh images in dev mode when they change
  • Updated dependencies [c54ad96]
    • imagetools-core@6.0.0

6.2.3

Patch Changes

  • 63141c8: fix: avoid duplicate widths in output

6.2.2

Patch Changes

  • 7bd11b7: fix: address issues when preventing upscale
  • Updated dependencies [7bd11b7]
    • imagetools-core@5.1.1

6.2.1

Patch Changes

  • 3923ab2: fix: address typo in namedExports type definition

6.2.0

Minor Changes

  • b4aa0a5: feat: option to override Vite's namedExports

6.1.0

Minor Changes

  • b84b271: feat: allow usage of all supported sharp output formats

Patch Changes

  • Updated dependencies [b84b271]
    • imagetools-core@5.1.0

6.0.0

Major Changes

  • 4ebc88f: breaking: remove deprecated options
  • 378c863: breaking: simplify picture, image, and srcset output formats and remove source output format. This is both simpler and will enable pixel density descriptors

Patch Changes

  • Updated dependencies [378c863]
  • Updated dependencies [378c863]
  • Updated dependencies [378c863]
    • imagetools-core@5.0.0

5.1.2

Patch Changes

  • 93356e6: fix: actually expose recently added types

5.1.1

Patch Changes

  • 5d9d4f2: chore: create and expose type aliases

5.1.0

Minor Changes

  • 49a89a6: feat: make image metadata available in defaultDirectives

Patch Changes

  • Updated dependencies [500e4fc]
    • imagetools-core@4.1.0

5.0.9

Patch Changes

  • Updated dependencies [5cbdbe8]
    • imagetools-core@4.0.6

5.0.8

Patch Changes

  • e4bba3c: fix: correct detection for Vite build vs serve mode

5.0.7

Patch Changes

  • Updated dependencies [9104638]
    • imagetools-core@4.0.5

5.0.6

Patch Changes

  • 474170c: chore: upgrade dependencies
  • Updated dependencies [474170c]
    • imagetools-core@4.0.4

5.0.5

Patch Changes

  • 3a439ae: fix: allow image same size as original by default. I.e. even when upscaling disabled

5.0.4

Patch Changes

  • a99c7ad: fix: use default rather than import specifier for better error message in CJS projects
  • Updated dependencies [a99c7ad]
    • imagetools-core@4.0.3

5.0.3

Patch Changes

  • 815650a: fix: support node16 and nodenext values for TypeScript's moduleResolution setting
  • Updated dependencies [75160ef]
  • Updated dependencies [815650a]
    • imagetools-core@4.0.2

5.0.2

Patch Changes

  • a6fa0fb: fix: account for possibility of all provided dimensions being upsizes

5.0.1

Patch Changes

  • 53af8fc: fix: reduce logging when providing larger image dimension via defaultDirectives
  • bf391fd: fix: don't generate multiple images at same dimensions
  • Updated dependencies [53af8fc]
    • imagetools-core@4.0.1

5.0.0

Major Changes

  • 45cf457: breaking: removed shorthands (e.g. webp as a standalone query parameter). You must now specify the full format=
  • 10ca129: breaking: drop CJS support
  • 36beecb: breaking: remove width, height, and ar directive aliases. Use w, h, and aspect instead
  • 45cf457: breaking: simplify ability to provide defaults. Output format is now specified with as=

Patch Changes

  • Updated dependencies [45cf457]
  • Updated dependencies [022519c]
  • Updated dependencies [10ca129]
  • Updated dependencies [36beecb]
  • Updated dependencies [022519c]
  • Updated dependencies [861276f]
  • Updated dependencies [45cf457]
  • Updated dependencies [861276f]
    • imagetools-core@4.0.0

4.0.19

Patch Changes

  • 4306ad7: feat: allow async output formats
  • c1c49c1: fix: don't match extensions in query string

4.0.18

Patch Changes

  • 22f2ff1: fix: support URL with scheme in base option

4.0.17

Patch Changes

  • 6459cf6: fix: ensure leading slash in generated URL

4.0.16

Patch Changes

  • c64e7ef: chore: upgrade typescript
  • 93bc23a: fix: log messages through Vite and Rollup. Allows the log level to be set with logLevel and onwarn respectively.
  • 6291c71: fix: support Vite's base config
  • Updated dependencies [c64e7ef]
  • Updated dependencies [93bc23a]
  • Updated dependencies [04bd2a0]
    • imagetools-core@3.3.1

4.0.15

Patch Changes

  • d43bfff: fix: list types exports first

4.0.14

Patch Changes

  • Updated dependencies [e7efc22]
    • imagetools-core@3.3.0

4.0.13

Patch Changes

  • e154d09: fix: revert bundling of imagetools-core

4.0.12

Patch Changes

  • 425867f: Bundle imagetools-core

4.0.11

Patch Changes

  • dbc8d02: Fix type resolution by re-adding top-level types field
  • Updated dependencies [dbc8d02]
    • imagetools-core@3.2.3

4.0.10

Patch Changes

  • 92b2fa3: chore(deps): update dependency @types/sharp to ^0.31.0
  • 07df0fa: fix: process URLs with no query string
  • 80250db: Update package READMEs and metadata.
  • d11b927: Let vite create correct paths in build result
  • 60890de: fix: add an exports map
  • Updated dependencies [92b2fa3]
  • Updated dependencies [80250db]
  • Updated dependencies [60890de]
    • imagetools-core@3.2.2

4.0.9

Patch Changes

  • ca40b8b: chore(deps): update dependency sharp to ^0.31.0
  • Updated dependencies [ca40b8b]
    • imagetools-core@3.2.1

4.0.8

Patch Changes

  • Updated dependencies [45b35da]
    • imagetools-core@3.2.0

4.0.7

Patch Changes

  • Updated dependencies [ea4ab8f]
    • imagetools-core@3.1.1

4.0.6

Patch Changes

  • Updated dependencies [6f93aaf]
    • imagetools-core@3.1.0

4.0.5

Patch Changes

  • 7efa2dc: Correctly merge directives when defaultDirectives is a function.
  • cb679f5: fixes the conditional reveal of metadata when using defaultDirectives.
  • 7efa2dc: Allow directives specified in URLs to override default directives
  • b551792: Update to vite v3.

4.0.4

Patch Changes

  • Updated dependencies [7a75a6f]
    • imagetools-core@3.0.3

4.0.3

Patch Changes

  • 725e27b: chore(deps-dev): bump vite from 2.7.2 to 2.7.3
  • 64356e6: chore(deps-dev): bump sharp from 2.8.2 to 2.9.3
  • Updated dependencies [64356e6]
    • imagetools-core@3.0.2

4.0.2

Patch Changes

  • 922975e: chore(deps-dev): bump vite from 2.6.14 to 2.7.1

4.0.1

Patch Changes

  • e6ed3a8: re-add cloned image fix that got lost during merging
  • e58e2cb: Remove icc metadata when removeMetadata is set to true.
  • Updated dependencies [e58e2cb]
    • imagetools-core@3.0.1

4.0.0

Major Changes

  • f6cec96: change defaultDirectives from Record<string,string> to URLSearchParams, to align with in-code interface and to allow for multiple entries of key with multiple values

Patch Changes

  • fb767da: chore(deps-dev): bump vite from 2.6.7 to 2.6.14
  • 1655877: Fix path to typings
  • f85ffe8: Bump @rollup/pluginutils
  • Updated dependencies [f6cec96]
    • imagetools-core@3.0.0

3.9.0

Minor Changes

  • 73955f4: feat: allow override of resolveConfigs

Patch Changes

  • 76e9a4d: fix: clone sharp image in vite plugin to avoid reuse issue

3.8.0

Minor Changes

  • dc60a68: Add image property on the metadata object.

Patch Changes

  • dc60a68: Update vite to 2.6.7 and rollup to 2.58.0

3.7.0

Minor Changes

  • c70b97e: Add metadata whitelist

Patch Changes

  • Updated dependencies [c70b97e]
    • imagetools-core@2.8.0

3.6.8

Patch Changes

  • d1a3058: chore(deps-dev): bump vite from 2.3.2 to 2.3.4

3.6.7

Patch Changes

  • 7c485aa: chore(deps-dev): bump vite from 2.3.0 to 2.3.2

All notable changes to this project will be documented in this file. See Conventional Commits for commit guidelines.

3.6.6 (2021-05-11)

Note: Version bump only for package vite-imagetools

3.6.5 (2021-05-11)

Note: Version bump only for package vite-imagetools

3.6.4 (2021-05-11)

Note: Version bump only for package vite-imagetools

3.6.3 (2021-05-11)

Note: Version bump only for package vite-imagetools

3.6.2 (2021-05-11)

Note: Version bump only for package vite-imagetools

3.6.1 (2021-05-07)

Note: Version bump only for package vite-imagetools

3.6.0 (2021-05-07)

Features

  • Allow # symbols in src urls (b5beedd)

3.5.4 (2021-05-07)

Note: Version bump only for package vite-imagetools

3.5.2 (2021-05-03)

Note: Version bump only for package vite-imagetools

3.5.1 (2021-05-03)

Bug Fixes

  • decode URI encoded paths before resolving (36636e5), closes #84

3.5.0 (2021-04-28)

Features

3.4.4 (2021-04-28)

Note: Version bump only for package vite-imagetools

3.4.3 (2021-04-28)

Note: Version bump only for package vite-imagetools

3.4.2 (2021-04-28)

Bug Fixes

  • exclude test files from generated types (a86d29c)
  • vite-imagetools: Add a more helpful error message when no images could be generated during dev mode (e62b1bb)

3.4.1 (2021-04-28)

Bug Fixes

  • exclude test files from generated types (a86d29c)
  • vite-imagetools: Add a more helpful error message when no images could be generated during dev mode (e62b1bb)

3.4.0 (2021-04-12)

Note: Version bump only for package vite-imagetools

3.4.0-next.7 (2021-04-11)

Bug Fixes

  • import types from the right file (92fbe14)
  • switch from default to named export (b2f0ca7)

3.4.0-next.6 (2021-04-11)

Bug Fixes

  • import types from the right file (92fbe14)
  • switch from default to named export (b2f0ca7)

3.4.0-next.5 (2021-04-11)

Bug Fixes

  • import types from the right file (92fbe14)
  • switch from default to named export (b2f0ca7)

3.4.0-next.4 (2021-04-09)

Features

  • respect vite configuration when generating output code (e4a9c66), closes #55

3.4.0-next.3 (2021-04-06)

Bug Fixes

  • mark force option as deprecated (23b0aef)

Features

3.4.0-next.2 (2021-04-05)

Note: Version bump only for package vite-imagetools

3.4.0-next.1 (2021-03-30)

Note: Version bump only for package vite-imagetools

3.4.0-next.0 (2021-03-30)

Bug Fixes

  • support nodejs LTS versions (4abccc5), closes #51
  • update cache key geneartion to match spec (7f0a0e8)

Features

  • allow metadata removal to be toggled by option (5d0c781)

3.3.2-alpha.0 (2021-03-30)

Bug Fixes

  • support nodejs LTS versions (4abccc5), closes #51

3.3.1 (2021-03-19)

Bug Fixes

3.3.0 (2021-03-16)

Features

  • change extendDirectives signature (b6ac8b3)
  • rework plugin to use new core library (e8e11cf)

3.2.6 (2021-03-15)

Note: Version bump only for package vite-imagetools

3.2.5 (2021-03-15)

Note: Version bump only for package vite-imagetools

3.2.4 (2021-03-15)

Note: Version bump only for package vite-imagetools

3.2.3 (2021-03-15)

Note: Version bump only for package vite-imagetools

3.2.2 (2021-03-15)

Note: Version bump only for package vite-imagetools

3.2.1 (2021-03-15)

Note: Version bump only for package vite-imagetools

3.2.0 (2021-03-15)

Bug Fixes

  • improve extensibility (61d5a3d)
  • reflect new imagetools-core version (f5135b7)
  • remove force option (9f04c9c)

Features

Reverts