Skip to content
This repository was archived by the owner on Mar 23, 2023. It is now read-only.

feat!: publish as ESM only #75

Merged
merged 1 commit into from
Aug 12, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,6 @@ updates:
interval: daily
time: "10:00"
open-pull-requests-limit: 10
commit-message:
prefix: "deps"
prefix-development: "deps(dev)"
37 changes: 25 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,30 +1,31 @@
# js-datastore-s3 <!-- omit in toc -->
# datastore-s3 <!-- omit in toc -->

[![](https://img.shields.io/badge/made%20by-Protocol%20Labs-blue.svg?style=flat-square)](https://protocol.ai/)
[![](https://img.shields.io/badge/project-IPFS-blue.svg?style=flat-square)](http://ipfs.io/)
[![](https://img.shields.io/badge/freenode-%23ipfs-blue.svg?style=flat-square)](http://webchat.freenode.net/?channels=%23ipfs)
[![Build Status](https://github.com/ipfs/js-datastore-s3/actions/workflows/js-test-and-release.yml/badge.svg?branch=master)](https://github.com/ipfs/js-datastore-s3/actions/workflows/js-test-and-release.yml)
[![Dependency Status](https://david-dm.org/diasdavid/js-peer-id.svg?style=flat-square)](https://david-dm.org/ipfs/js-datastore-s3)
[![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat-square)](https://github.com/feross/standard)
[![ipfs.io](https://img.shields.io/badge/project-IPFS-blue.svg?style=flat-square)](http://ipfs.io)
[![IRC](https://img.shields.io/badge/freenode-%23ipfs-blue.svg?style=flat-square)](http://webchat.freenode.net/?channels=%23ipfs)
[![Discord](https://img.shields.io/discord/806902334369824788?style=flat-square)](https://discord.gg/ipfs)
[![codecov](https://img.shields.io/codecov/c/github/ipfs/js-datastore-s3.svg?style=flat-square)](https://codecov.io/gh/ipfs/js-datastore-s3)
[![CI](https://img.shields.io/github/workflow/status/ipfs/js-datastore-s3/test%20&%20maybe%20release/master?style=flat-square)](https://github.com/ipfs/js-datastore-s3/actions/workflows/js-test-and-release.yml)

> Datastore implementation backed by s3.
> IPFS datastore implementation backed by s3

## Table of Contents <!-- omit in toc -->
## Table of contents <!-- omit in toc -->

- [Install](#install)
- [Usage](#usage)
- [Create a Repo](#create-a-repo)
- [Examples](#examples)
- [Contribute](#contribute)
- [License](#license)
- [Contribute](#contribute-1)

## Install

```
$ npm install datastore-s3
```console
$ npm i datastore-s3
```

## Usage

If the flag `createIfMissing` is not set or is false, then the bucket must be created prior to using datastore-s3. Please see the AWS docs for information on how to configure the S3 instance. A bucket name is required to be set at the s3 instance level, see the below example.

```js
Expand All @@ -43,6 +44,7 @@ const store = new S3Datastore('.ipfs/datastore', {
See [examples/full-s3-repo](./examples/full-s3-repo) for how to quickly create an S3 backed repo using the `createRepo` convenience function.

### Examples

You can see examples of S3 backed ipfs in the [examples folder](examples/)

## Contribute
Expand All @@ -53,4 +55,15 @@ Small note: If editing the Readme, please conform to the [standard-readme](https

## License

[Apache-2.0](LICENSE-APACHE) OR [MIT](LICENSE-MIT)
Licensed under either of

- Apache 2.0, ([LICENSE-APACHE](LICENSE-APACHE) / <http://www.apache.org/licenses/LICENSE-2.0>)
- MIT ([LICENSE-MIT](LICENSE-MIT) / <http://opensource.org/licenses/MIT>)

## Contribute

Feel free to join in. All welcome. Open an [issue](https://github.com/ipfs/js-ipfs-unixfs-importer/issues)!

This repository falls under the IPFS [Code of Conduct](https://github.com/ipfs/community/blob/master/code-of-conduct.md).

[![](https://cdn.rawgit.com/jbenet/contribute-ipfs-gif/master/img/contribute.gif)](https://github.com/ipfs/community/blob/master/CONTRIBUTING.md)
71 changes: 36 additions & 35 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,27 +22,33 @@
"node": ">=16.0.0",
"npm": ">=7.0.0"
},
"main": "src/index.js",
"type": "module",
"types": "types/src/index.d.ts",
"types": "./dist/src/index.d.ts",
"typesVersions": {
"*": {
"*": [
"types/*",
"types/src/*"
"*",
"dist/*",
"dist/src/*",
"dist/src/*/index"
],
"types/*": [
"types/*",
"types/src/*"
"src/*": [
"*",
"dist/*",
"dist/src/*",
"dist/src/*/index"
]
}
},
"files": [
"*",
"src",
"dist",
"!dist/test",
"!**/*.tsbuildinfo"
],
"exports": {
".": {
"types": "./dist/src/index.d.ts",
"import": "./src/index.js"
}
},
Expand Down Expand Up @@ -79,15 +85,15 @@
"release": "patch"
},
{
"type": "chore",
"type": "docs",
"release": "patch"
},
{
"type": "docs",
"type": "test",
"release": "patch"
},
{
"type": "test",
"type": "deps",
"release": "patch"
},
{
Expand Down Expand Up @@ -117,7 +123,11 @@
},
{
"type": "docs",
"section": "Trivial Changes"
"section": "Documentation"
},
{
"type": "deps",
"section": "Dependencies"
},
{
"type": "test",
Expand All @@ -128,46 +138,37 @@
}
],
"@semantic-release/changelog",
[
"@semantic-release/npm",
{
"pkgRoot": "dist"
}
],
"@semantic-release/npm",
"@semantic-release/github",
"@semantic-release/git"
]
},
"scripts": {
"clean": "rimraf dist types",
"prepare": "aegir build --no-bundle && cp -R types dist",
"lint": "aegir ts -p check && aegir lint",
"build": "aegir build --esm-tests",
"release": "semantic-release",
"clean": "aegir clean",
"lint": "aegir lint",
"build": "aegir build",
"release": "aegir release",
"test": "aegir test",
"test:node": "aegir test -t node",
"test:chrome": "aegir test -t browser",
"test:node": "aegir test -t node --cov",
"test:chrome": "aegir test -t browser --cov",
"test:chrome-webworker": "aegir test -t webworker",
"test:firefox": "aegir test -t browser -- --browser firefox",
"test:firefox-webworker": "aegir test -t webworker -- --browser firefox",
"test:electron-main": "aegir test -t electron-main -f dist/cjs/node-test/*js",
"test:electron-renderer": "aegir test -t electron-renderer -f dist/cjs/node-test/*js",
"dep-check": "aegir dep-check -i rimraf"
"test:electron-main": "aegir test -t electron-main",
"dep-check": "aegir dep-check"
},
"dependencies": {
"buffer": "^6.0.3",
"datastore-core": "^7.0.0",
"interface-datastore": "^6.0.2",
"datastore-core": "^8.0.1",
"interface-datastore": "^7.0.0",
"it-filter": "^1.0.2",
"it-to-buffer": "^2.0.0",
"uint8arrays": "^3.0.0"
},
"devDependencies": {
"aegir": "^36.1.3",
"assert": "^2.0.0",
"aegir": "^37.5.1",
"aws-sdk": "^2.579.0",
"interface-datastore-tests": "^2.0.3",
"sinon": "^12.0.1",
"util": "^0.12.3"
"interface-datastore-tests": "^3.0.0",
"sinon": "^14.0.0"
}
}
2 changes: 1 addition & 1 deletion test/index.spec.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* eslint-env mocha */

import { expect } from 'aegir/utils/chai.js'
import { expect } from 'aegir/chai'
import { Buffer } from 'buffer'
import sinon from 'sinon'
import { Key } from 'interface-datastore'
Expand Down
2 changes: 1 addition & 1 deletion test/utils/s3-mock.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { expect } from 'aegir/utils/chai.js'
import { expect } from 'aegir/chai'
import sinon from 'sinon'
import { Buffer } from 'buffer'
import AWS from 'aws-sdk'
Expand Down
3 changes: 2 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
{
"extends": "aegir/src/config/tsconfig.aegir.json",
"compilerOptions": {
"outDir": "types"
"outDir": "dist",
"emitDeclarationOnly": true
},
"include": [
"src",
Expand Down