Skip to content

Commit

Permalink
feat!: new syntax for providers (#133)
Browse files Browse the repository at this point in the history
* wip

* wip

* wip more

* add contentstack

* wip lots more

* Cloudinary

* Update

* Add ipx

* format

* Remove test

* Change config syntax

* Add more

* Add scene7 and vercel

* chore: format

* Add shopify

* Simplify extractors

* chore: format

* Add uploadcare

* Add wordpress

* Add storyblok and cf images

* Rename

* Remove old

* chore: format

* Update

* Fix tests and build

* chore: format

* feat: add support for cloudflare images without custom domain (#131)

---------

Co-authored-by: dawaltconley <[email protected]>
Co-authored-by: Matt Kane <[email protected]>

* chore: add deprecation

* chore: format

* Add async

* fix: simplify types

* chore: format

* chore: lint

* fix: include detected cdn

* fix: strip unsupported props

* chore: tests and docs

* chore: remove duplicate definition

* chore: format

* chore: rename types

* chore: format

* chore: lint

* Change transformUrl syntax back to original

* Update README

* Add upgrading docs

* Add Hygraph support

* Update demo

* Fix

* Fix exports

* Fix cloudinary

* Add transformerfunction type

* ci: add pkg.pr.new (#153)

* ci: add pkg.pr.new

* Run on mine

* Fix path

* Include version

* Update Astro support for v5

* Only pass needed props

* Don't override options from URL with undefined ops

* Add names list

* As const

* Names

* Update contrib guide

---------

Co-authored-by: ascorbic <[email protected]>
Co-authored-by: dawaltconley <[email protected]>
  • Loading branch information
3 people authored Jan 19, 2025
1 parent 6b0ba37 commit 295d23d
Show file tree
Hide file tree
Showing 139 changed files with 12,853 additions and 8,547 deletions.
1 change: 1 addition & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
"[javascriptreact]": {
"editor.defaultFormatter": "denoland.vscode-deno"
},
"deno.config": "deno.jsonc",
"prettier.enable": false,
"editor.defaultFormatter": "denoland.vscode-deno"
}
4 changes: 0 additions & 4 deletions .zed/settings.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
// Folder-specific settings
//
// For a full list of overridable settings, and general information on folder-specific settings,
// see the documentation: https://zed.dev/docs/configuring-zed#settings-files
{
"lsp": {
"deno": {
Expand Down
275 changes: 275 additions & 0 deletions CHANGELOG-old.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,275 @@
<!-- deno-fmt-ignore-file -->
# Changelog

## [3.19.0](https://github.com/ascorbic/unpic/compare/v3.18.1...v3.19.0) (2024-10-26)


### Features

* add support for cloudflare images without custom domain ([#131](https://github.com/ascorbic/unpic/issues/131)) ([320784b](https://github.com/ascorbic/unpic/commit/320784bcbe8ce91c0c58723cb4446d6f8e535d99))


### Bug Fixes

* fix publishing ([#138](https://github.com/ascorbic/unpic/issues/138)) ([ae9de25](https://github.com/ascorbic/unpic/commit/ae9de2532b0f3c3fc7e47b69b260c16b106d6f3c))

## [3.18.1](https://github.com/ascorbic/unpic/compare/v3.18.0...v3.18.1) (2024-10-26)


### Bug Fixes

* publish via JSR ([#136](https://github.com/ascorbic/unpic/issues/136)) ([6674473](https://github.com/ascorbic/unpic/commit/66744733a58a1e3d1ffed25eff8fe196cf8f6681))

## [3.18.0](https://github.com/ascorbic/unpic/compare/v3.17.0...v3.18.0) (2024-03-12)


### Features

* add Supabase support ([#123](https://github.com/ascorbic/unpic/issues/123)) ([0aa185a](https://github.com/ascorbic/unpic/commit/0aa185ac71263e4d487d5ece19f316f65a6c0403))

## [3.17.0](https://github.com/ascorbic/unpic/compare/v3.16.1...v3.17.0) (2024-02-08)


### Features

* add Uploadcare support ([#120](https://github.com/ascorbic/unpic/issues/120)) ([68307a4](https://github.com/ascorbic/unpic/commit/68307a492a52b9db1d93f063b6b28b5e30db5c30))

## [3.16.1](https://github.com/ascorbic/unpic/compare/v3.16.0...v3.16.1) (2024-02-07)


### Bug Fixes

* **imagekit:** set format param to "f" ([#116](https://github.com/ascorbic/unpic/issues/116)) ([d06651e](https://github.com/ascorbic/unpic/commit/d06651ed2d74e0c6123855d7129e1abab15c023a))

## [3.16.0](https://github.com/ascorbic/unpic/compare/v3.15.0...v3.16.0) (2023-12-09)


### Features

* add Cloudimage support ([#107](https://github.com/ascorbic/unpic/issues/107)) ([e8df456](https://github.com/ascorbic/unpic/commit/e8df456f80c6c5acfee23579382bf7334b4f67e5))

## [3.15.0](https://github.com/ascorbic/unpic/compare/v3.14.1...v3.15.0) (2023-12-05)


### Features

* astro _image endpoint ([#94](https://github.com/ascorbic/unpic/issues/94)) ([b015190](https://github.com/ascorbic/unpic/commit/b015190d39855232d415c2c101cef2c1d4161ab9))


### Bug Fixes

* **contentful:** limit dimensions to 4000px ([#101](https://github.com/ascorbic/unpic/issues/101)) ([8d84f4d](https://github.com/ascorbic/unpic/commit/8d84f4d9987f020e09a705209686f21bf0c7806b))

## [3.14.1](https://github.com/ascorbic/unpic/compare/v3.14.0...v3.14.1) (2023-11-16)


### Bug Fixes

* **cloudflare:** use optional regex for transformation group [#60](https://github.com/ascorbic/unpic/issues/60) ([2800f41](https://github.com/ascorbic/unpic/commit/2800f41e6226868dd63091881d8750a532932da8))

## [3.14.0](https://github.com/ascorbic/unpic/compare/v3.13.0...v3.14.0) (2023-11-15)


### Features

* add subpath exports ([#99](https://github.com/ascorbic/unpic/issues/99)) ([7c9da42](https://github.com/ascorbic/unpic/commit/7c9da427ab3449b2b1c270ad49071ace1cc5ccb1))


### Bug Fixes

* **netlify:** correct "fit" param ([#97](https://github.com/ascorbic/unpic/issues/97)) ([66a48d4](https://github.com/ascorbic/unpic/commit/66a48d46f87f0938ae0a159dad070c715d7297b6))

## [3.13.0](https://github.com/ascorbic/unpic/compare/v3.12.0...v3.13.0) (2023-11-07)


### Features

* add imagekit support ([#91](https://github.com/ascorbic/unpic/issues/91)) ([cb03686](https://github.com/ascorbic/unpic/commit/cb03686afc998cbd106163098397813a114e1cff))

## [3.12.0](https://github.com/ascorbic/unpic/compare/v3.11.0...v3.12.0) (2023-10-31)


### Features

* add Netlify support ([#88](https://github.com/ascorbic/unpic/issues/88)) ([4dd047f](https://github.com/ascorbic/unpic/commit/4dd047fe034f61d99432f687c219cb2329628865))

## [3.11.0](https://github.com/ascorbic/unpic/compare/v3.10.1...v3.11.0) (2023-10-29)


### Features

* add support for ipx ([#85](https://github.com/ascorbic/unpic/issues/85)) ([0ef9eed](https://github.com/ascorbic/unpic/commit/0ef9eedfe59892e2ad96e129d3f52632dc12c52c))

## [3.10.1](https://github.com/ascorbic/unpic/compare/v3.10.0...v3.10.1) (2023-09-29)


### Bug Fixes

* don't include node type refs in declaration ([#83](https://github.com/ascorbic/unpic/issues/83)) ([b960e77](https://github.com/ascorbic/unpic/commit/b960e779b70508ed4b11cce84cd2e3fc2d529213))

## [3.10.0](https://github.com/ascorbic/unpic/compare/v3.9.0...v3.10.0) (2023-08-01)


### Features

* add support for Cloudflare Images ([#79](https://github.com/ascorbic/unpic/issues/79)) ([50f5d59](https://github.com/ascorbic/unpic/commit/50f5d5943de15e301d4ccf5afde70988f6c065be))

## [3.9.0](https://github.com/ascorbic/unpic/compare/v3.8.1...v3.9.0) (2023-07-20)


### Features

* add Contentstack support ([#77](https://github.com/ascorbic/unpic/issues/77)) ([eaf33b7](https://github.com/ascorbic/unpic/commit/eaf33b7662a408c38aa311a3e917295f306f8c07))

## [3.8.1](https://github.com/ascorbic/unpic/compare/v3.8.0...v3.8.1) (2023-07-05)


### Bug Fixes

* **builder.io:** force sharp to ensure correct fit behaviour ([#75](https://github.com/ascorbic/unpic/issues/75)) ([0146f0c](https://github.com/ascorbic/unpic/commit/0146f0c7c6eddab0f7a7a6f46f38b8eba9827ecc))

## [3.8.0](https://github.com/ascorbic/unpic/compare/v3.7.0...v3.8.0) (2023-07-04)


### Features

* add support for imageengine cdn ([#66](https://github.com/ascorbic/unpic/issues/66)) ([788633e](https://github.com/ascorbic/unpic/commit/788633ed57f658b1e79f1140ffac67b2bd09f21e))

## [3.7.0](https://github.com/ascorbic/unpic/compare/v3.6.4...v3.7.0) (2023-07-03)


### Features

* improve compatibility of URLs in Node ([#72](https://github.com/ascorbic/unpic/issues/72)) ([b91f194](https://github.com/ascorbic/unpic/commit/b91f1948844a1bc96b8aa94014f85046d93fb725))

## [3.6.4](https://github.com/ascorbic/unpic/compare/v3.6.3...v3.6.4) (2023-07-03)


### Bug Fixes

* fix npm publish test ([aa927c8](https://github.com/ascorbic/unpic/commit/aa927c83d7662cca554ad6659714cd1a64b8d2ff))

## [3.6.3](https://github.com/ascorbic/unpic/compare/v3.6.2...v3.6.3) (2023-07-03)


### Bug Fixes

* correct npm publish test ([b54d6cd](https://github.com/ascorbic/unpic/commit/b54d6cdd28e301177f945c61a6331d675ead8cf6))

## [3.6.2](https://github.com/ascorbic/unpic/compare/v3.6.1...v3.6.2) (2023-07-03)


### Bug Fixes

* correctly handle fit mode in Bunny.net, Cloudflare and Kontent.ai ([#68](https://github.com/ascorbic/unpic/issues/68)) ([4b2bf38](https://github.com/ascorbic/unpic/commit/4b2bf38e8621fecd18ff2e6dc5ced3d24bf5b7e5))

## [3.6.1](https://github.com/ascorbic/unpic/compare/v3.6.0...v3.6.1) (2023-05-16)


### Bug Fixes

* correctly detect relative next.js URLs ([#64](https://github.com/ascorbic/unpic/issues/64)) ([e2eb2ae](https://github.com/ascorbic/unpic/commit/e2eb2aef43d04c979c8b9041fa12e7b4829cd292))

## [3.6.0](https://github.com/ascorbic/unpic/compare/v3.5.0...v3.6.0) (2023-05-15)


### Features

* support relative URLs when detecting by path ([#61](https://github.com/ascorbic/unpic/issues/61)) ([a28ffa9](https://github.com/ascorbic/unpic/commit/a28ffa913340b0419a9f755dd2835e716250903c))

## [3.5.0](https://github.com/ascorbic/unpic/compare/v3.4.1...v3.5.0) (2023-04-25)


### Features

* add caisy ([39ec49b](https://github.com/ascorbic/unpic/commit/39ec49b6fae6dfa2f08db5737594dfe2c54e8489))

## [3.4.1](https://github.com/ascorbic/unpic/compare/v3.4.0...v3.4.1) (2023-04-23)


### Bug Fixes

* not delete existing format ([#54](https://github.com/ascorbic/unpic/issues/54)) ([9d656a8](https://github.com/ascorbic/unpic/commit/9d656a87876c061892679068dd3aaec5b39ec164))

## [3.4.0](https://github.com/ascorbic/unpic/compare/v3.3.0...v3.4.0) (2023-04-22)


### Features

* add Directus support ([#46](https://github.com/ascorbic/unpic/issues/46)) ([3be1fe3](https://github.com/ascorbic/unpic/commit/3be1fe33861b7980ba333fc63b9fd47e4e4cf314))

## [3.3.0](https://github.com/ascorbic/unpic/compare/v3.2.0...v3.3.0) (2023-04-22)


### Features

* add support for delegated URLs ([#47](https://github.com/ascorbic/unpic/issues/47)) ([3f29447](https://github.com/ascorbic/unpic/commit/3f294470e012d535e4aeec31c642b6202e0db177))

## [3.2.0](https://github.com/ascorbic/unpic/compare/v3.1.0...v3.2.0) (2023-04-04)


### Features

* add KeyCDN support ([#43](https://github.com/ascorbic/unpic/issues/43)) ([0cfde2e](https://github.com/ascorbic/unpic/commit/0cfde2edf76af9e3825c695d68dc113832d4ad89))

## [3.1.0](https://github.com/ascorbic/unpic/compare/v3.0.1...v3.1.0) (2023-03-28)


### Features

* add Scene7 transformer ([#39](https://github.com/ascorbic/unpic/issues/39)) ([ad6edf2](https://github.com/ascorbic/unpic/commit/ad6edf2b5a119cf6d6a26db0f569c5305d66e911))

## [3.0.1](https://github.com/ascorbic/unpic/compare/v3.0.0...v3.0.1) (2023-03-11)


### Bug Fixes

* **nextjs:** default q to 75 ([#34](https://github.com/ascorbic/unpic/issues/34)) ([0948a17](https://github.com/ascorbic/unpic/commit/0948a171537e335afd5502bd6a31652f68d0c976))

## [3.0.0](https://github.com/ascorbic/unpic/compare/v2.2.2...v3.0.0) (2023-03-10)


### ⚠ BREAKING CHANGES

* transformers may return URLs as strings ([#30](https://github.com/ascorbic/unpic/issues/30))

### Features

* add Next.js and Vercel support ([#32](https://github.com/ascorbic/unpic/issues/32)) ([4cff46d](https://github.com/ascorbic/unpic/commit/4cff46d48988a9e9e8b11a2741109f452acdd334))
* transformers may return URLs as strings ([#30](https://github.com/ascorbic/unpic/issues/30)) ([ce95cfe](https://github.com/ascorbic/unpic/commit/ce95cfe9470fdee43c056f4d861b3477572808df))

## [2.2.2](https://github.com/ascorbic/unpic/compare/v2.2.1...v2.2.2) (2023-03-09)


### Bug Fixes

* **cloudinary:** default to fill without upscale ([#27](https://github.com/ascorbic/unpic/issues/27)) ([e7a3de5](https://github.com/ascorbic/unpic/commit/e7a3de584b6e4acefd6ce9259319a24ce617ce1c))
* handle custom cloudinary domains ([ce2d1e6](https://github.com/ascorbic/unpic/commit/ce2d1e615c6fc3ac3d3a0dff78ace317b572ad4f))

## [2.2.1](https://github.com/ascorbic/unpic/compare/v2.2.0...v2.2.1) (2023-03-06)


### Bug Fixes

* export kontent parse function ([#24](https://github.com/ascorbic/unpic/issues/24)) ([9e49772](https://github.com/ascorbic/unpic/commit/9e49772be926fb56991183d3add85f1a35a38d73))

## [2.2.0](https://github.com/ascorbic/unpic/compare/v2.1.0...v2.2.0) (2023-03-06)


### Features

* add kontent.ai CDN ([#19](https://github.com/ascorbic/unpic/issues/19)) ([7475b58](https://github.com/ascorbic/unpic/commit/7475b58a258878faf2c9f15c094de477294992b1))

## [2.1.0](https://github.com/ascorbic/unpic/compare/2.0.2...v2.1.0) (2023-02-24)


### Features

* **builder:** add Builder.io ([#13](https://github.com/ascorbic/unpic/issues/13)) ([fb31a94](https://github.com/ascorbic/unpic/commit/fb31a94edf9e08a00f8f72258b38123b9c4d27ad))


### Bug Fixes

* handle workflow ([#10](https://github.com/ascorbic/unpic/issues/10)) ([d59485f](https://github.com/ascorbic/unpic/commit/d59485f22decb0cd7146d5443c438d41f247747e))
* permissions on rp workflow ([6e1dcdf](https://github.com/ascorbic/unpic/commit/6e1dcdfc1bf490738f5bab292ed48e096f8504a2))
* setup releasing ([#9](https://github.com/ascorbic/unpic/issues/9)) ([2a609a7](https://github.com/ascorbic/unpic/commit/2a609a7b7f09ed887c0ca2bd8e90dc82b05a787b))
45 changes: 45 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,49 @@
<!-- deno-fmt-ignore-file -->
# CHANGELOG

## 4.0.0

This is a major release with several breaking changes. See
[UPGRADING.md](UPGRADING.md) for a detailed migration guide.

### New Features

- Added support for provider-specific operations with type safety
- Added support for provider-specific options (e.g., base URLs, project keys)
- Added `fallback` option to specify a fallback provider if URL isn't recognized

### Breaking Changes

- **Removed Features**
- Removed delegated URL system
- Removed support for some CDN-specific params in favor of new provider
operations system

- **API Changes**
- Removed URL delegation system and canonical URL detection
- Changed `transformUrl` signature to accept operations and provider options
as separate arguments
- Updated `parseUrl` return type structure to use operations and provider
terminology
- Added new URL parsing functions: `getExtractorForUrl`,
`getExtractorForProvider`

- **Function Renames**
- `getImageCdnForUrl``getProviderForUrl`
- `getImageCdnForUrlByDomain``getProviderForUrlByDomain`
- `getImageCdnForUrlByPath``getProviderForUrlByPath`
- Old functions marked as deprecated but still available

- **Type System Changes**
- Added generic type support for provider-specific operations
- Updated `UrlTransformerOptions` to support typed provider operations
- Removed `ParsedUrl` type in favor of new `ParseURLResult`
- Added new types for enhanced type safety:
- `Operations`
- `OperationMap`
- `FormatMap`
- `ImageFormat`
- `ProviderConfig`
# Changelog

## [3.22.0](https://github.com/ascorbic/unpic/compare/v3.21.0...v3.22.0) (2024-12-07)
Expand Down
Loading

0 comments on commit 295d23d

Please sign in to comment.