@alanshaw/pail
Advanced tools
Comparing version 0.2.1 to 0.3.0
21
cli.js
@@ -11,6 +11,6 @@ #!/usr/bin/env node | ||
import archy from 'archy' | ||
import { MaxShardSize, put, ShardBlock, get, del, entries } from './index.js' | ||
import { ShardFetcher } from './shard.js' | ||
import { difference } from './diff.js' | ||
import { merge } from './merge.js' | ||
import { MaxShardSize, put, ShardBlock, get, del, entries } from './src/index.js' | ||
import { ShardFetcher } from './src/shard.js' | ||
import { difference } from './src/diff.js' | ||
import { merge } from './src/merge.js' | ||
@@ -99,3 +99,3 @@ const cli = sade('pail') | ||
/** @param {import('./shard').ShardEntry} entry */ | ||
/** @param {import('./src/shard').ShardEntry} entry */ | ||
const getData = async ([k, v]) => { | ||
@@ -130,3 +130,3 @@ if (!Array.isArray(v)) { | ||
const [aroot, broot] = await Promise.all([ablocks, bblocks].map(async blocks => { | ||
return /** @type {import('./shard').ShardLink} */((await blocks.getRoots())[0]) | ||
return /** @type {import('./src/shard').ShardLink} */((await blocks.getRoots())[0]) | ||
})) | ||
@@ -166,3 +166,3 @@ if (aroot.toString() === broot.toString()) return | ||
const [aroot, broot] = await Promise.all([ablocks, bblocks].map(async blocks => { | ||
return /** @type {import('./shard').ShardLink} */((await blocks.getRoots())[0]) | ||
return /** @type {import('./src/shard').ShardLink} */((await blocks.getRoots())[0]) | ||
})) | ||
@@ -203,3 +203,5 @@ if (aroot.toString() === broot.toString()) return | ||
const rootblk = await ShardBlock.create() | ||
// @ts-expect-error | ||
const { writer, out } = CarWriter.create(rootblk.cid) | ||
// @ts-expect-error | ||
writer.put(rootblk) | ||
@@ -221,4 +223,4 @@ writer.close() | ||
* @param {import('@ipld/car/api').CarReader} reader | ||
* @param {import('./shard').ShardLink} root | ||
* @param {import('.').ShardDiff} diff | ||
* @param {import('./src/shard').ShardLink} root | ||
* @param {import('./src/index').ShardDiff} diff | ||
*/ | ||
@@ -236,2 +238,3 @@ async function updatePail (path, reader, root, { additions, removals }) { | ||
for (const b of additions) { | ||
// @ts-expect-error | ||
await writer.put(b) | ||
@@ -238,0 +241,0 @@ } |
{ | ||
"name": "@alanshaw/pail", | ||
"version": "0.2.1", | ||
"version": "0.3.0", | ||
"description": "DAG based key value store.", | ||
"main": "index.js", | ||
"main": "src/index.js", | ||
"type": "module", | ||
"types": "./dist/src/index.d.ts", | ||
"typesVersions": { | ||
"*": { | ||
"*": [ | ||
"dist/*" | ||
], | ||
"dist/src/index.d.ts": [ | ||
"dist/src/index.d.ts" | ||
], | ||
"block": [ | ||
"dist/src/block.d.ts" | ||
], | ||
"clock": [ | ||
"dist/src/clock.d.ts" | ||
], | ||
"crdt": [ | ||
"dist/src/crdt.d.ts" | ||
], | ||
"diff": [ | ||
"dist/src/diff.d.ts" | ||
], | ||
"link": [ | ||
"dist/src/link.d.ts" | ||
], | ||
"merge": [ | ||
"dist/src/merge.d.ts" | ||
], | ||
"shard": [ | ||
"dist/src/shard.d.ts" | ||
] | ||
} | ||
}, | ||
"exports": { | ||
".": { | ||
"types": "./dist/src/index.d.ts", | ||
"import": "./src/index.js" | ||
}, | ||
"./block": { | ||
"types": "./dist/src/block.d.ts", | ||
"import": "./src/block.js" | ||
}, | ||
"./clock": { | ||
"types": "./dist/src/clock.d.ts", | ||
"import": "./src/clock.js" | ||
}, | ||
"./diff": { | ||
"types": "./dist/src/diff.d.ts", | ||
"import": "./src/diff.js" | ||
}, | ||
"./link": { | ||
"types": "./dist/src/link.d.ts", | ||
"import": "./src/link.js" | ||
}, | ||
"./merge": { | ||
"types": "./dist/src/merge.d.ts", | ||
"import": "./src/merge.js" | ||
}, | ||
"./shard": { | ||
"types": "./dist/src/shard.d.ts", | ||
"import": "./src/shard.js" | ||
} | ||
}, | ||
"bin": { | ||
@@ -11,2 +73,3 @@ "pail": "./cli.js" | ||
"scripts": { | ||
"build": "tsc --build", | ||
"test": "mocha test/*.test.js", | ||
@@ -26,2 +89,6 @@ "coverage": "c8 -r html -r text npm test", | ||
"license": "Apache-2.0 OR MIT", | ||
"files": [ | ||
"src", | ||
"dist" | ||
], | ||
"dependencies": { | ||
@@ -39,3 +106,4 @@ "@ipld/car": "^5.0.1", | ||
"nanoid": "^4.0.0", | ||
"standard": "^17.0.0" | ||
"standard": "^17.0.0", | ||
"typescript": "^5.0.2" | ||
}, | ||
@@ -49,3 +117,8 @@ "repository": { | ||
}, | ||
"homepage": "https://github.com/alanshaw/pail#readme" | ||
"homepage": "https://github.com/alanshaw/pail#readme", | ||
"standard": { | ||
"ignore": [ | ||
"*.ts" | ||
] | ||
} | ||
} |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
97698
29
5
1679
1