-
Notifications
You must be signed in to change notification settings - Fork 8
Simpler core library plus path to deprecation #464
Conversation
Signed-off-by: Carson Farmer <[email protected]>
Signed-off-by: Carson Farmer <[email protected]>
Signed-off-by: Carson Farmer <[email protected]>
Signed-off-by: Carson Farmer <[email protected]>
Signed-off-by: Carson Farmer <[email protected]>
Signed-off-by: Carson Farmer <[email protected]>
Signed-off-by: Carson Farmer <[email protected]>
Signed-off-by: Carson Farmer <[email protected]>
"rimraf": "^3.0.0", | ||
"typescript": "^3.7.2" | ||
}, | ||
"dependencies": { | ||
"@ipld/block": "^6.0.1", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
plus this out of core, should be much easier to consume core externally now.
@@ -1,8 +1,6 @@ | |||
import { keys, PrivateKey, PublicKey } from "@textile/threads-crypto" | |||
|
|||
export * from "./identity" | |||
export { Block } from "./ipld" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't export this anymore, so if used elsewhere, they'll have to be updated.
@@ -1,48 +0,0 @@ | |||
import CID from "cids" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This and the following interfaces have been moved to encoding. They are no longer needed here, and relied to some degree on the Block API being in core, which it no longer is.
@@ -1,4 +1,4 @@ | |||
import { Multiaddr } from "@textile/multiaddr" | |||
import type { Multiaddr } from "@textile/multiaddr" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just safer to do this when we can.
"publishConfig": { | ||
"access": "public" | ||
}, | ||
"private": true, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
database will no longer be published when we do a lerna publish. It shoud already be deprecated on npm, so this is just saving us the hassle of deprecating new versions.
@@ -56,18 +50,23 @@ export async function createRecord( | |||
config: CreateRecordConfig | |||
): Promise<LogRecord> { | |||
logger.debug("creating record") | |||
const block = await data.value.cid() | |||
let payload = block.buffer | |||
const block = (await data.value.cid()) as any |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some hacky stuff to work around potential future issue with some CID updates coming down the line.
"publishConfig": { | ||
"access": "public" | ||
}, | ||
"private": true, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't publish this one either.
@@ -389,7 +391,7 @@ export class Client implements Network { | |||
if (info.key === undefined) throw new Error("Missing thread keys") | |||
const req = new pb.GetRecordRequest() | |||
req.setThreadid(id.toBytes()) | |||
req.setRecordid(rec.buffer) | |||
req.setRecordid(rec.buffer ?? (rec as any).bytes) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
another hack
"publishConfig": { | ||
"access": "public" | ||
}, | ||
"private": true, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This one too.
"publishConfig": { | ||
"access": "public" | ||
}, | ||
"private": true, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And finally, we don't need store externally anymore either.
Description
This is a relatively large PR that does a few important things as a precursor to #414, while also simplifying our threads-core library for external consumption. In general, this is mostly just a plumbing PR. In particular it:
First step towards #415, #427
Type of change
Please delete options that are not relevant.
How Has This Been Tested?
All existing tests pass locally, and in some cases, imports have been updated.
Checklist: