Skip to content
This repository was archived by the owner on Oct 1, 2021. It is now read-only.

Commit dabab4e

Browse files
committed
fix: remove datastore-level from the readme and deps
1 parent 800c27f commit dabab4e

File tree

2 files changed

+23
-24
lines changed

2 files changed

+23
-24
lines changed

README.md

+23-23
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Migration tool for JS IPFS Repo
22

33
[![Travis CI](https://flat.badgen.net/travis/ipfs/js-ipfs-repo-migrations)](https://travis-ci.com/ipfs/js-ipfs-repo-migrations)
4-
[![codecov](https://codecov.io/gh/ipfs/js-ipfs-repo-migrations/branch/master/graph/badge.svg)](https://codecov.io/gh/ipfs/js-ipfs-repo-migrations)
4+
[![codecov](https://codecov.io/gh/ipfs/js-ipfs-repo-migrations/branch/master/graph/badge.svg)](https://codecov.io/gh/ipfs/js-ipfs-repo-migrations)
55
[![Dependency Status](https://david-dm.org/ipfs/js-ipfs-repo-migrations.svg?style=flat-square)](https://david-dm.org/ipfs/js-ipfs-repo-migrations)
66
[![](https://img.shields.io/badge/made%20by-Protocol%20Labs-blue.svg?style=flat-square)](http://ipn.io)
77
[![](https://img.shields.io/badge/project-IPFS-blue.svg?style=flat-square)](http://ipfs.io/)
@@ -45,7 +45,7 @@ This package is inspired by the [go-ipfs repo migration tool](https://github.com
4545
## Background
4646

4747

48-
As js-ipfs evolves and new technologies, algorithms and data structures are incorporated it is necessary to
48+
As js-ipfs evolves and new technologies, algorithms and data structures are incorporated it is necessary to
4949
enable users to transition between versions. Different versions of js-ipfs may expect a different IPFS repo structure or content (see: [IPFS repo spec](https://github.com/ipfs/specs/tree/master/repo), [JS implementation](https://github.com/ipfs/js-ipfs-repo) ).
5050
So the IPFS repo is versioned, and this package provides a framework to create migrations to transition
5151
from one version of IPFS repo to the next/previous version.
@@ -94,7 +94,7 @@ if(currentRepoVersion < latestVersion){
9494
}
9595
```
9696

97-
To migrate your repository using the CLI, see the [how to run migrations](./run.md) tutorial.
97+
To migrate your repository using the CLI, see the [how to run migrations](./run.md) tutorial.
9898

9999
## API
100100

@@ -111,9 +111,9 @@ Executes a forward migration to a specific version, or to the latest version if
111111
* `options.repoOptions` (object, optional) - options that are passed to migrations, that use them to construct the datastore. (options are the same as for IPFSRepo).
112112
* `options.onProgress` (function, optional) - callback that is called after finishing execution of each migration to report progress.
113113
* `options.isDryRun` (bool, optional) - flag that indicates if it is a dry run that should give the same output as running a migration but without making any actual changes.
114-
114+
115115
#### `onProgress(migration, counter, totalMigrations)`
116-
116+
117117
Signature of the progress callback.
118118

119119
**Arguments:**
@@ -128,26 +128,26 @@ Executes backward migration to a specific version.
128128
**Arguments:**
129129

130130
* `path` (string, mandatory) - path to the repo to be reverted
131-
* `toVersion` (int, mandatory) - version to which the repo should be reverted to.
131+
* `toVersion` (int, mandatory) - version to which the repo should be reverted to.
132132
* `options` (object, optional) - options for the reversion
133133
* `options.ignoreLock` (bool, optional) - if true will not lock the repo when applying migrations. Use with caution.
134134
* `options.repoOptions` (object, optional) - options that are passed to migrations, that use them to construct the datastore. (options are the same as for IPFSRepo).
135135
* `options.onProgress` (function, optional) - callback that is called after finishing execution of each migration to report progress.
136136
* `options.isDryRun` (bool, optional) - flag that indicates if it is a dry run that should give the same output as running a migration but without making any actual changes.
137-
137+
138138
### `getLatestMigrationVersion() -> int`
139139

140140
Return the version of the latest migration.
141141

142142
## CLI
143143

144-
The CLI is a NodeJS binary named `jsipfs-repo-migrations`.
144+
The CLI is a NodeJS binary named `jsipfs-repo-migrations`.
145145
It has several commands:
146146

147147
* `migrate` - performs forward/backward migration to specific or latest version.
148148
* `status` - check repo for migrations that should be run.
149149
* `add` - bootstraps new migration.
150-
150+
151151
For further details see the `--help` pages.
152152

153153
## Creating a new migration
@@ -161,15 +161,15 @@ Migrations are one of those things that can be extremely painful on users. At th
161161

162162
If your migration has several parts, it should be fail-proof enough that if one part of migration fails the previous changes
163163
are reverted before propagating the error. If possible then the outcome should be consistent repo so it migration could
164-
be run again.
164+
be run again.
165165

166166
### Architecture of a migration
167167

168168
All migrations are placed in the `/migrations` folder. Each folder there represents one migration that follows the migration
169169
API.
170170

171171
All migrations are collected in `/migrations/index.js`, which should not be edited manually. It is regenerated on
172-
every run of `jsipfs-migrations add` (manual changes should follow the same style of modifications).
172+
every run of `jsipfs-migrations add` (manual changes should follow the same style of modifications).
173173
**The order of migrations is important and migrations must be sorted in ascending order**.
174174

175175
Each migration must follow this API. It must export an object in its `index.js` that has following properties:
@@ -186,7 +186,7 @@ _Do not confuse this function with the `require('ipfs-repo-migrations').migrate(
186186
Arguments:
187187
* `repoPath` (string) - absolute path to the root of the repo
188188
* `repoOptions` (object, optional) - object containing `IPFSRepo` options, that should be used to construct a datastore instance.
189-
189+
190190
#### `.revert(repoPath, repoOptions)`
191191

192192
_Do not confuse this function with the `require('ipfs-repo-migrations').revert()` function that drives the whole backward migration process!_
@@ -208,17 +208,17 @@ Then add entry in `package.json` to the `browser` field as follow:
208208
In browser environments then `index.js` will be replaced with `index_browser.js`.
209209

210210
Simple migrations should not need to distinguish between
211-
these environments as the datastore implementation will handle the main differences.
211+
these environments as the datastore implementation will handle the main differences.
212212

213213
There are currently two main datastore implementations:
214214
1. [`datastore-fs`](https://github.com/ipfs/js-datastore-fs) that is backed by file system and is used mainly in the NodeJS environment
215-
2. [`datastore-level`](https://github.com/ipfs/js-datastore-level) that is backed by LevelDB and is used mainly in the browser environment
216-
217-
Both implementations share the same API and hence are interchangeable.
215+
2. [`datastore-idb`](https://github.com/ipfs/js-datastore-idb) that is backed by LevelDB and is used mainly in the browser environment
216+
217+
Both implementations share the same API and hence are interchangeable.
218218

219-
When the migration is run in a browser environment, `datastore-fs` is automatically replaced with `datastore-level` even
220-
when it is directly imported (`require('datastore-fs')` will return `datastore-level` in a browser).
221-
So with simple migrations you shouldn't worry about the difference between `datastore-fs` and `datastore-level`
219+
When the migration is run in a browser environment, `datastore-fs` is automatically replaced with `datastore-idb` even
220+
when it is directly imported (`require('datastore-fs')` will return `datastore-idb` in a browser).
221+
So with simple migrations you shouldn't worry about the difference between `datastore-fs` and `datastore-idb`
222222
and by default use the `datastore-fs` package (as the replace mechanism does not work vice versa).
223223

224224
### Guidelines
@@ -229,8 +229,8 @@ The recommended way to write a new migration is to first bootstrap a dummy migra
229229
> npm run new-migration
230230
```
231231

232-
A new folder is created with the bootstrapped migration. You can then simply fill in the required fields and
233-
write the rest of the migration!
232+
A new folder is created with the bootstrapped migration. You can then simply fill in the required fields and
233+
write the rest of the migration!
234234

235235
### Integration with js-ipfs
236236

@@ -251,7 +251,7 @@ you will have to plug the tests into `browser.js`/`node.js` if they require spec
251251

252252
### Empty migrations
253253

254-
For interop with go-ipfs it might be necessary just to bump a version of a repo without any actual
254+
For interop with go-ipfs it might be necessary just to bump a version of a repo without any actual
255255
modification as there might not be any changes needed in the JS implementation. For that purpose you can create an "empty migration".
256256

257257
The easiest way to do so is with the CLI:
@@ -270,7 +270,7 @@ This will create an empty migration with the next version.
270270

271271
## Developer
272272

273-
### Module versioning notes
273+
### Module versioning notes
274274

275275
In order to have good overview of what version of package contains what kind of migration, to every release there
276276
should be appended version's metadata in format `migr-<versionOfLatestMigration>`. If for releasing is used `aegir`

package.json

-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@
4848
"chalk": "^4.0.0",
4949
"datastore-fs": "~0.9.1",
5050
"datastore-idb": "^1.0.0",
51-
"datastore-level": "~0.14.1",
5251
"debug": "^4.1.0",
5352
"interface-datastore": "~0.8.3",
5453
"proper-lockfile": "^4.1.1",

0 commit comments

Comments
 (0)