-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feature/global default cloudinary transforms (#12)
* Extend cloudinaryrc to support defaultTransforms * Update README with documentation for defaultTransforms * Update CHANGELOG
- Loading branch information
1 parent
c9ceb9f
commit 183c96e
Showing
10 changed files
with
61 additions
and
6 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
3 changes: 3 additions & 0 deletions
3
...transforms-override/__snapshots__/runtime-config-default-transforms-override.spec.js.snap
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`runtime-config-default-transforms-override 1`] = `"const imageUrl = \`\${\\"https://trivago.images.com/e_red:50,f_auto,o_30,q_auto:best/\\"}\${\\"my-picture.jpeg\\"}\${\\"\\"}\${\\"\\"}\${\\"\\"}\`;"`; |
12 changes: 12 additions & 0 deletions
12
test/fixtures/runtime-config-default-transforms-override/cloudinaryrc.json
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"native": { | ||
"cloud_name": "trivago", | ||
"secure": true | ||
}, | ||
"host": "trivago.images.com", | ||
"overrideBaseUrl": true, | ||
"defaultTransforms": { | ||
"fetch_format": "auto", | ||
"quality": "auto" | ||
} | ||
} |
7 changes: 7 additions & 0 deletions
7
test/fixtures/runtime-config-default-transforms-override/input.js
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
const imageUrl = __buildCloudinaryUrl("my-picture.jpeg", { | ||
transforms: { | ||
effect: "red:50", | ||
opacity: 30, | ||
quality: "auto:best", // will override default 'quality' in cloudinaryrc.json | ||
}, | ||
}); |
3 changes: 3 additions & 0 deletions
3
...me-config-default-transforms/__snapshots__/runtime-config-default-transforms.spec.js.snap
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`runtime-config-default-transforms 1`] = `"const imageUrl = \`\${\\"https://trivago.images.com/e_red:50,f_auto,o_30,q_auto/\\"}\${\\"my-picture.jpeg\\"}\${\\"\\"}\${\\"\\"}\${\\"\\"}\`;"`; |
12 changes: 12 additions & 0 deletions
12
test/fixtures/runtime-config-default-transforms/cloudinaryrc.json
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"native": { | ||
"cloud_name": "trivago", | ||
"secure": true | ||
}, | ||
"host": "trivago.images.com", | ||
"overrideBaseUrl": true, | ||
"defaultTransforms": { | ||
"fetch_format": "auto", | ||
"quality": "auto" | ||
} | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
const imageUrl = __buildCloudinaryUrl("my-picture.jpeg", { | ||
transforms: { | ||
effect: "red:50", | ||
opacity: 30, | ||
}, | ||
}); |