Contributing to Unpic
ascorbic/unpicYou can find the code in the unpic repo. To test the library, you will need to install Deno.
To add new domains or subdomains to an existing CDN, add them to domains.json
or subdomains.json
respectively.
To add a new CDN, add the following:
- a new source file in
src/transformers
. This should export atransform
function that implements theUrlTransformer
interface, aparse
function that implements theUrlParser
interface and optionally agenerate
function that implements theUrlGenerator
interface. - a new test file in
src/transformers
. This should test all of the exported API functions. - at least one entry in
domains.json
,subdomains.json
orpaths.json
to detect the CDN - add the new CDN to the types in
src/types.ts
, and import the new source file insrc/transform.ts
- add a sample image to
examples.json
in the demo site - ensure tests pass by running
deno test src