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 atransformfunction that implements theUrlTransformerinterface, aparsefunction that implements theUrlParserinterface and optionally ageneratefunction that implements theUrlGeneratorinterface. - a new test file in
src/transformers. This should test all of the exported API functions. - at least one entry in
domains.json,subdomains.jsonorpaths.jsonto 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.jsonin the demo site - ensure tests pass by running
deno test src