ipfs-shipyard / ipfs-deploy

Zero-Config CLI to Deploy Static Websites to IPFS
Other
1.16k stars 123 forks source link

Refactor files for more modularity and easy of adding more #75

Closed hacdias closed 5 years ago

hacdias commented 5 years ago

As I was making #73, I had the idea of restructuring the directories in the following way:

From dnslink, all files would export the same api:

updateSomethingDns(options)

From pinners, all files would export the same api:

// Setup Pinner
const pinner = setupPinnerName(options)

// Pin from file system
const hash = await pinner.pin(dir, options)

// Pin hash
await pinner.pinHash(hash, options)

Otherwise:

// Setup Pinner
const pin = setupPinnerName(options)

// Pin from file system
const hash = await pin(dir, options)