Skip to content

Commit 295d23d

Browse files
feat!: new syntax for providers (#133)
* 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]>
1 parent 6b0ba37 commit 295d23d

File tree

139 files changed

+12853
-8547
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

139 files changed

+12853
-8547
lines changed

.vscode/settings.json

+1
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
"[javascriptreact]": {
3030
"editor.defaultFormatter": "denoland.vscode-deno"
3131
},
32+
"deno.config": "deno.jsonc",
3233
"prettier.enable": false,
3334
"editor.defaultFormatter": "denoland.vscode-deno"
3435
}

.zed/settings.json

-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
// Folder-specific settings
2-
//
3-
// For a full list of overridable settings, and general information on folder-specific settings,
4-
// see the documentation: https://zed.dev/docs/configuring-zed#settings-files
51
{
62
"lsp": {
73
"deno": {

CHANGELOG-old.md

+275
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,275 @@
1+
<!-- deno-fmt-ignore-file -->
2+
# Changelog
3+
4+
## [3.19.0](https://github.com/ascorbic/unpic/compare/v3.18.1...v3.19.0) (2024-10-26)
5+
6+
7+
### Features
8+
9+
* add support for cloudflare images without custom domain ([#131](https://github.com/ascorbic/unpic/issues/131)) ([320784b](https://github.com/ascorbic/unpic/commit/320784bcbe8ce91c0c58723cb4446d6f8e535d99))
10+
11+
12+
### Bug Fixes
13+
14+
* fix publishing ([#138](https://github.com/ascorbic/unpic/issues/138)) ([ae9de25](https://github.com/ascorbic/unpic/commit/ae9de2532b0f3c3fc7e47b69b260c16b106d6f3c))
15+
16+
## [3.18.1](https://github.com/ascorbic/unpic/compare/v3.18.0...v3.18.1) (2024-10-26)
17+
18+
19+
### Bug Fixes
20+
21+
* publish via JSR ([#136](https://github.com/ascorbic/unpic/issues/136)) ([6674473](https://github.com/ascorbic/unpic/commit/66744733a58a1e3d1ffed25eff8fe196cf8f6681))
22+
23+
## [3.18.0](https://github.com/ascorbic/unpic/compare/v3.17.0...v3.18.0) (2024-03-12)
24+
25+
26+
### Features
27+
28+
* add Supabase support ([#123](https://github.com/ascorbic/unpic/issues/123)) ([0aa185a](https://github.com/ascorbic/unpic/commit/0aa185ac71263e4d487d5ece19f316f65a6c0403))
29+
30+
## [3.17.0](https://github.com/ascorbic/unpic/compare/v3.16.1...v3.17.0) (2024-02-08)
31+
32+
33+
### Features
34+
35+
* add Uploadcare support ([#120](https://github.com/ascorbic/unpic/issues/120)) ([68307a4](https://github.com/ascorbic/unpic/commit/68307a492a52b9db1d93f063b6b28b5e30db5c30))
36+
37+
## [3.16.1](https://github.com/ascorbic/unpic/compare/v3.16.0...v3.16.1) (2024-02-07)
38+
39+
40+
### Bug Fixes
41+
42+
* **imagekit:** set format param to "f" ([#116](https://github.com/ascorbic/unpic/issues/116)) ([d06651e](https://github.com/ascorbic/unpic/commit/d06651ed2d74e0c6123855d7129e1abab15c023a))
43+
44+
## [3.16.0](https://github.com/ascorbic/unpic/compare/v3.15.0...v3.16.0) (2023-12-09)
45+
46+
47+
### Features
48+
49+
* add Cloudimage support ([#107](https://github.com/ascorbic/unpic/issues/107)) ([e8df456](https://github.com/ascorbic/unpic/commit/e8df456f80c6c5acfee23579382bf7334b4f67e5))
50+
51+
## [3.15.0](https://github.com/ascorbic/unpic/compare/v3.14.1...v3.15.0) (2023-12-05)
52+
53+
54+
### Features
55+
56+
* astro _image endpoint ([#94](https://github.com/ascorbic/unpic/issues/94)) ([b015190](https://github.com/ascorbic/unpic/commit/b015190d39855232d415c2c101cef2c1d4161ab9))
57+
58+
59+
### Bug Fixes
60+
61+
* **contentful:** limit dimensions to 4000px ([#101](https://github.com/ascorbic/unpic/issues/101)) ([8d84f4d](https://github.com/ascorbic/unpic/commit/8d84f4d9987f020e09a705209686f21bf0c7806b))
62+
63+
## [3.14.1](https://github.com/ascorbic/unpic/compare/v3.14.0...v3.14.1) (2023-11-16)
64+
65+
66+
### Bug Fixes
67+
68+
* **cloudflare:** use optional regex for transformation group [#60](https://github.com/ascorbic/unpic/issues/60) ([2800f41](https://github.com/ascorbic/unpic/commit/2800f41e6226868dd63091881d8750a532932da8))
69+
70+
## [3.14.0](https://github.com/ascorbic/unpic/compare/v3.13.0...v3.14.0) (2023-11-15)
71+
72+
73+
### Features
74+
75+
* add subpath exports ([#99](https://github.com/ascorbic/unpic/issues/99)) ([7c9da42](https://github.com/ascorbic/unpic/commit/7c9da427ab3449b2b1c270ad49071ace1cc5ccb1))
76+
77+
78+
### Bug Fixes
79+
80+
* **netlify:** correct "fit" param ([#97](https://github.com/ascorbic/unpic/issues/97)) ([66a48d4](https://github.com/ascorbic/unpic/commit/66a48d46f87f0938ae0a159dad070c715d7297b6))
81+
82+
## [3.13.0](https://github.com/ascorbic/unpic/compare/v3.12.0...v3.13.0) (2023-11-07)
83+
84+
85+
### Features
86+
87+
* add imagekit support ([#91](https://github.com/ascorbic/unpic/issues/91)) ([cb03686](https://github.com/ascorbic/unpic/commit/cb03686afc998cbd106163098397813a114e1cff))
88+
89+
## [3.12.0](https://github.com/ascorbic/unpic/compare/v3.11.0...v3.12.0) (2023-10-31)
90+
91+
92+
### Features
93+
94+
* add Netlify support ([#88](https://github.com/ascorbic/unpic/issues/88)) ([4dd047f](https://github.com/ascorbic/unpic/commit/4dd047fe034f61d99432f687c219cb2329628865))
95+
96+
## [3.11.0](https://github.com/ascorbic/unpic/compare/v3.10.1...v3.11.0) (2023-10-29)
97+
98+
99+
### Features
100+
101+
* add support for ipx ([#85](https://github.com/ascorbic/unpic/issues/85)) ([0ef9eed](https://github.com/ascorbic/unpic/commit/0ef9eedfe59892e2ad96e129d3f52632dc12c52c))
102+
103+
## [3.10.1](https://github.com/ascorbic/unpic/compare/v3.10.0...v3.10.1) (2023-09-29)
104+
105+
106+
### Bug Fixes
107+
108+
* don't include node type refs in declaration ([#83](https://github.com/ascorbic/unpic/issues/83)) ([b960e77](https://github.com/ascorbic/unpic/commit/b960e779b70508ed4b11cce84cd2e3fc2d529213))
109+
110+
## [3.10.0](https://github.com/ascorbic/unpic/compare/v3.9.0...v3.10.0) (2023-08-01)
111+
112+
113+
### Features
114+
115+
* add support for Cloudflare Images ([#79](https://github.com/ascorbic/unpic/issues/79)) ([50f5d59](https://github.com/ascorbic/unpic/commit/50f5d5943de15e301d4ccf5afde70988f6c065be))
116+
117+
## [3.9.0](https://github.com/ascorbic/unpic/compare/v3.8.1...v3.9.0) (2023-07-20)
118+
119+
120+
### Features
121+
122+
* add Contentstack support ([#77](https://github.com/ascorbic/unpic/issues/77)) ([eaf33b7](https://github.com/ascorbic/unpic/commit/eaf33b7662a408c38aa311a3e917295f306f8c07))
123+
124+
## [3.8.1](https://github.com/ascorbic/unpic/compare/v3.8.0...v3.8.1) (2023-07-05)
125+
126+
127+
### Bug Fixes
128+
129+
* **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))
130+
131+
## [3.8.0](https://github.com/ascorbic/unpic/compare/v3.7.0...v3.8.0) (2023-07-04)
132+
133+
134+
### Features
135+
136+
* add support for imageengine cdn ([#66](https://github.com/ascorbic/unpic/issues/66)) ([788633e](https://github.com/ascorbic/unpic/commit/788633ed57f658b1e79f1140ffac67b2bd09f21e))
137+
138+
## [3.7.0](https://github.com/ascorbic/unpic/compare/v3.6.4...v3.7.0) (2023-07-03)
139+
140+
141+
### Features
142+
143+
* improve compatibility of URLs in Node ([#72](https://github.com/ascorbic/unpic/issues/72)) ([b91f194](https://github.com/ascorbic/unpic/commit/b91f1948844a1bc96b8aa94014f85046d93fb725))
144+
145+
## [3.6.4](https://github.com/ascorbic/unpic/compare/v3.6.3...v3.6.4) (2023-07-03)
146+
147+
148+
### Bug Fixes
149+
150+
* fix npm publish test ([aa927c8](https://github.com/ascorbic/unpic/commit/aa927c83d7662cca554ad6659714cd1a64b8d2ff))
151+
152+
## [3.6.3](https://github.com/ascorbic/unpic/compare/v3.6.2...v3.6.3) (2023-07-03)
153+
154+
155+
### Bug Fixes
156+
157+
* correct npm publish test ([b54d6cd](https://github.com/ascorbic/unpic/commit/b54d6cdd28e301177f945c61a6331d675ead8cf6))
158+
159+
## [3.6.2](https://github.com/ascorbic/unpic/compare/v3.6.1...v3.6.2) (2023-07-03)
160+
161+
162+
### Bug Fixes
163+
164+
* 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))
165+
166+
## [3.6.1](https://github.com/ascorbic/unpic/compare/v3.6.0...v3.6.1) (2023-05-16)
167+
168+
169+
### Bug Fixes
170+
171+
* correctly detect relative next.js URLs ([#64](https://github.com/ascorbic/unpic/issues/64)) ([e2eb2ae](https://github.com/ascorbic/unpic/commit/e2eb2aef43d04c979c8b9041fa12e7b4829cd292))
172+
173+
## [3.6.0](https://github.com/ascorbic/unpic/compare/v3.5.0...v3.6.0) (2023-05-15)
174+
175+
176+
### Features
177+
178+
* support relative URLs when detecting by path ([#61](https://github.com/ascorbic/unpic/issues/61)) ([a28ffa9](https://github.com/ascorbic/unpic/commit/a28ffa913340b0419a9f755dd2835e716250903c))
179+
180+
## [3.5.0](https://github.com/ascorbic/unpic/compare/v3.4.1...v3.5.0) (2023-04-25)
181+
182+
183+
### Features
184+
185+
* add caisy ([39ec49b](https://github.com/ascorbic/unpic/commit/39ec49b6fae6dfa2f08db5737594dfe2c54e8489))
186+
187+
## [3.4.1](https://github.com/ascorbic/unpic/compare/v3.4.0...v3.4.1) (2023-04-23)
188+
189+
190+
### Bug Fixes
191+
192+
* not delete existing format ([#54](https://github.com/ascorbic/unpic/issues/54)) ([9d656a8](https://github.com/ascorbic/unpic/commit/9d656a87876c061892679068dd3aaec5b39ec164))
193+
194+
## [3.4.0](https://github.com/ascorbic/unpic/compare/v3.3.0...v3.4.0) (2023-04-22)
195+
196+
197+
### Features
198+
199+
* add Directus support ([#46](https://github.com/ascorbic/unpic/issues/46)) ([3be1fe3](https://github.com/ascorbic/unpic/commit/3be1fe33861b7980ba333fc63b9fd47e4e4cf314))
200+
201+
## [3.3.0](https://github.com/ascorbic/unpic/compare/v3.2.0...v3.3.0) (2023-04-22)
202+
203+
204+
### Features
205+
206+
* add support for delegated URLs ([#47](https://github.com/ascorbic/unpic/issues/47)) ([3f29447](https://github.com/ascorbic/unpic/commit/3f294470e012d535e4aeec31c642b6202e0db177))
207+
208+
## [3.2.0](https://github.com/ascorbic/unpic/compare/v3.1.0...v3.2.0) (2023-04-04)
209+
210+
211+
### Features
212+
213+
* add KeyCDN support ([#43](https://github.com/ascorbic/unpic/issues/43)) ([0cfde2e](https://github.com/ascorbic/unpic/commit/0cfde2edf76af9e3825c695d68dc113832d4ad89))
214+
215+
## [3.1.0](https://github.com/ascorbic/unpic/compare/v3.0.1...v3.1.0) (2023-03-28)
216+
217+
218+
### Features
219+
220+
* add Scene7 transformer ([#39](https://github.com/ascorbic/unpic/issues/39)) ([ad6edf2](https://github.com/ascorbic/unpic/commit/ad6edf2b5a119cf6d6a26db0f569c5305d66e911))
221+
222+
## [3.0.1](https://github.com/ascorbic/unpic/compare/v3.0.0...v3.0.1) (2023-03-11)
223+
224+
225+
### Bug Fixes
226+
227+
* **nextjs:** default q to 75 ([#34](https://github.com/ascorbic/unpic/issues/34)) ([0948a17](https://github.com/ascorbic/unpic/commit/0948a171537e335afd5502bd6a31652f68d0c976))
228+
229+
## [3.0.0](https://github.com/ascorbic/unpic/compare/v2.2.2...v3.0.0) (2023-03-10)
230+
231+
232+
### ⚠ BREAKING CHANGES
233+
234+
* transformers may return URLs as strings ([#30](https://github.com/ascorbic/unpic/issues/30))
235+
236+
### Features
237+
238+
* add Next.js and Vercel support ([#32](https://github.com/ascorbic/unpic/issues/32)) ([4cff46d](https://github.com/ascorbic/unpic/commit/4cff46d48988a9e9e8b11a2741109f452acdd334))
239+
* transformers may return URLs as strings ([#30](https://github.com/ascorbic/unpic/issues/30)) ([ce95cfe](https://github.com/ascorbic/unpic/commit/ce95cfe9470fdee43c056f4d861b3477572808df))
240+
241+
## [2.2.2](https://github.com/ascorbic/unpic/compare/v2.2.1...v2.2.2) (2023-03-09)
242+
243+
244+
### Bug Fixes
245+
246+
* **cloudinary:** default to fill without upscale ([#27](https://github.com/ascorbic/unpic/issues/27)) ([e7a3de5](https://github.com/ascorbic/unpic/commit/e7a3de584b6e4acefd6ce9259319a24ce617ce1c))
247+
* handle custom cloudinary domains ([ce2d1e6](https://github.com/ascorbic/unpic/commit/ce2d1e615c6fc3ac3d3a0dff78ace317b572ad4f))
248+
249+
## [2.2.1](https://github.com/ascorbic/unpic/compare/v2.2.0...v2.2.1) (2023-03-06)
250+
251+
252+
### Bug Fixes
253+
254+
* export kontent parse function ([#24](https://github.com/ascorbic/unpic/issues/24)) ([9e49772](https://github.com/ascorbic/unpic/commit/9e49772be926fb56991183d3add85f1a35a38d73))
255+
256+
## [2.2.0](https://github.com/ascorbic/unpic/compare/v2.1.0...v2.2.0) (2023-03-06)
257+
258+
259+
### Features
260+
261+
* add kontent.ai CDN ([#19](https://github.com/ascorbic/unpic/issues/19)) ([7475b58](https://github.com/ascorbic/unpic/commit/7475b58a258878faf2c9f15c094de477294992b1))
262+
263+
## [2.1.0](https://github.com/ascorbic/unpic/compare/2.0.2...v2.1.0) (2023-02-24)
264+
265+
266+
### Features
267+
268+
* **builder:** add Builder.io ([#13](https://github.com/ascorbic/unpic/issues/13)) ([fb31a94](https://github.com/ascorbic/unpic/commit/fb31a94edf9e08a00f8f72258b38123b9c4d27ad))
269+
270+
271+
### Bug Fixes
272+
273+
* handle workflow ([#10](https://github.com/ascorbic/unpic/issues/10)) ([d59485f](https://github.com/ascorbic/unpic/commit/d59485f22decb0cd7146d5443c438d41f247747e))
274+
* permissions on rp workflow ([6e1dcdf](https://github.com/ascorbic/unpic/commit/6e1dcdfc1bf490738f5bab292ed48e096f8504a2))
275+
* setup releasing ([#9](https://github.com/ascorbic/unpic/issues/9)) ([2a609a7](https://github.com/ascorbic/unpic/commit/2a609a7b7f09ed887c0ca2bd8e90dc82b05a787b))

CHANGELOG.md

+45
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,49 @@
11
<!-- deno-fmt-ignore-file -->
2+
# CHANGELOG
3+
4+
## 4.0.0
5+
6+
This is a major release with several breaking changes. See
7+
[UPGRADING.md](UPGRADING.md) for a detailed migration guide.
8+
9+
### New Features
10+
11+
- Added support for provider-specific operations with type safety
12+
- Added support for provider-specific options (e.g., base URLs, project keys)
13+
- Added `fallback` option to specify a fallback provider if URL isn't recognized
14+
15+
### Breaking Changes
16+
17+
- **Removed Features**
18+
- Removed delegated URL system
19+
- Removed support for some CDN-specific params in favor of new provider
20+
operations system
21+
22+
- **API Changes**
23+
- Removed URL delegation system and canonical URL detection
24+
- Changed `transformUrl` signature to accept operations and provider options
25+
as separate arguments
26+
- Updated `parseUrl` return type structure to use operations and provider
27+
terminology
28+
- Added new URL parsing functions: `getExtractorForUrl`,
29+
`getExtractorForProvider`
30+
31+
- **Function Renames**
32+
- `getImageCdnForUrl``getProviderForUrl`
33+
- `getImageCdnForUrlByDomain``getProviderForUrlByDomain`
34+
- `getImageCdnForUrlByPath``getProviderForUrlByPath`
35+
- Old functions marked as deprecated but still available
36+
37+
- **Type System Changes**
38+
- Added generic type support for provider-specific operations
39+
- Updated `UrlTransformerOptions` to support typed provider operations
40+
- Removed `ParsedUrl` type in favor of new `ParseURLResult`
41+
- Added new types for enhanced type safety:
42+
- `Operations`
43+
- `OperationMap`
44+
- `FormatMap`
45+
- `ImageFormat`
46+
- `ProviderConfig`
247
# Changelog
348

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

0 commit comments

Comments
 (0)