Rename to pzp

This commit is contained in:
Jacob Karlsson 2024-04-27 23:55:58 +02:00
parent 483f037136
commit d6c52696e3
5 changed files with 16 additions and 18 deletions

View File

@ -1,9 +1,7 @@
**Work in progress** # pzp-set
## Installation ## Installation
We're not on npm yet. In your package.json, include this as
```js ```js
"ppppp-set": "github:staltz/ppppp-set" npm install pzp-set
``` ```

View File

@ -1,12 +1,12 @@
const Obz = require('obz') const Obz = require('obz')
const MsgV4 = require('ppppp-db/msg-v4') const MsgV4 = require('pzp-db/msg-v4')
const pull = require('pull-stream') const pull = require('pull-stream')
const PREFIX = 'set_v1__' const PREFIX = 'set_v1__'
/** /**
* @typedef {ReturnType<import('ppppp-db').init>} PPPPPDB * @typedef {ReturnType<import('pzp-db').init>} pzpDB
* @typedef {import('ppppp-db').RecPresent} RecPresent * @typedef {import('pzp-db').RecPresent} RecPresent
* @typedef {{ * @typedef {{
* hook: ( * hook: (
* cb: ( * cb: (
@ -34,7 +34,7 @@ const PREFIX = 'set_v1__'
/** /**
* @template [T = any] * @template [T = any]
* @typedef {import('ppppp-db/msg-v4').Msg<T>} Msg<T> * @typedef {import('pzp-db/msg-v4').Msg<T>} Msg<T>
*/ */
/** /**
@ -76,7 +76,7 @@ function assert(check, message) {
} }
/** /**
* @param {{ db: PPPPPDB, close: ClosableHook }} peer * @param {{ db: pzpDB, close: ClosableHook }} peer
* @param {Config} config * @param {Config} config
*/ */
function initSet(peer, config) { function initSet(peer, config) {

View File

@ -1,13 +1,13 @@
{ {
"name": "ppppp-set", "name": "pzp-set",
"version": "1.0.0", "version": "0.0.1",
"description": "Set data structure over append-only logs with pruning", "description": "Set data structure over append-only logs with pruning",
"author": "Andre Staltz <contact@staltz.com>", "author": "Andre Staltz <contact@staltz.com>",
"license": "MIT", "license": "MIT",
"homepage": "https://github.com/staltz/ppppp-set", "homepage": "https://codeberg.org/pzp/pzp-set",
"repository": { "repository": {
"type": "git", "type": "git",
"url": "git@github.com:staltz/ppppp-set.git" "url": "git@codeberg.org:pzp/pzp-set.git"
}, },
"main": "index.js", "main": "index.js",
"files": [ "files": [
@ -32,7 +32,7 @@
"@types/pull-stream": "^3.6.7", "@types/pull-stream": "^3.6.7",
"bs58": "^5.0.0", "bs58": "^5.0.0",
"c8": "7", "c8": "7",
"ppppp-db": "https://codeberg.org/pzp/pzp-db/archive/master.tar.gz", "pzp-db": "^1.0.1",
"pzp-caps": "^1.0.0", "pzp-caps": "^1.0.0",
"pzp-keypair": "^1.0.0", "pzp-keypair": "^1.0.0",
"rimraf": "^4.4.0", "rimraf": "^4.4.0",

View File

@ -3,12 +3,12 @@ const assert = require('node:assert')
const path = require('node:path') const path = require('node:path')
const os = require('node:os') const os = require('node:os')
const rimraf = require('rimraf') const rimraf = require('rimraf')
const MsgV4 = require('ppppp-db/msg-v4') const MsgV4 = require('pzp-db/msg-v4')
const p = require('node:util').promisify const p = require('node:util').promisify
const { createPeer } = require('./util') const { createPeer } = require('./util')
const Keypair = require('pzp-keypair') const Keypair = require('pzp-keypair')
const DIR = path.join(os.tmpdir(), 'ppppp-set') const DIR = path.join(os.tmpdir(), 'pzp-set')
rimraf.sync(DIR) rimraf.sync(DIR)
const aliceKeypair = Keypair.generate('ed25519', 'alice') const aliceKeypair = Keypair.generate('ed25519', 'alice')

View File

@ -9,7 +9,7 @@ function createPeer(config) {
const name = config.name const name = config.name
const tmp = OS.tmpdir() const tmp = OS.tmpdir()
config.global ??= {} config.global ??= {}
config.global.path ??= Path.join(tmp, `ppppp-set-${name}-${Date.now()}`) config.global.path ??= Path.join(tmp, `pzp-set-${name}-${Date.now()}`)
config.global.keypair ??= Keypair.generate('ed25519', name) config.global.keypair ??= Keypair.generate('ed25519', name)
delete config.name delete config.name
} }
@ -27,7 +27,7 @@ function createPeer(config) {
return require('secret-stack/bare')() return require('secret-stack/bare')()
.use(require('secret-stack/plugins/net')) .use(require('secret-stack/plugins/net'))
.use(require('secret-handshake-ext/secret-stack')) .use(require('secret-handshake-ext/secret-stack'))
.use(require('ppppp-db')) .use(require('pzp-db'))
.use(require('ssb-box')) .use(require('ssb-box'))
.use(require('../lib')) .use(require('../lib'))
.call(null, { .call(null, {