Skip to content

Commit

Permalink
chore: use @fireproof/vendor
Browse files Browse the repository at this point in the history
chore: stablize the smoke test
  • Loading branch information
mabels committed Dec 6, 2024
1 parent 4394387 commit d4d4486
Show file tree
Hide file tree
Showing 40 changed files with 158 additions and 234 deletions.
9 changes: 2 additions & 7 deletions package-fireproof-core.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,17 +53,12 @@
},
"dependencies": {
"@adviser/cement": "from-package-json",
"multiformats": "from-package-json",
"@fireproof/vendor": "from-package-json",
"@ipld/unixfs": "from-package-json",
"@ipld/car": "from-package-json",
"@ipld/dag-json": "from-package-json",
"@ipld/dag-cbor": "from-package-json",
"@web3-storage/pail": "from-package-json",
"cborg": "from-package-json",
"multiformats": "from-package-json",
"charwise": "from-package-json",
"prolly-trees": "from-package-json",
"idb": "from-package-json",
"ipfs-unixfs-exporter": "from-package-json",
"memfs": "from-package-json",
"p-limit": "from-package-json",
"p-map": "from-package-json",
Expand Down
15 changes: 1 addition & 14 deletions package-use-fireproof.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,20 +29,7 @@
"gptdoc": "Fireproof/React/Usage: import { useLiveQuery, useDocument } from 'use-fireproof'; function App() { const result = useLiveQuery(doc => doc.word, { limit: 10 }); const [{ count }, setDoc, saveDoc] = useDocument({_id: 'count', count: 0}); return (<><p>{count} changes</p><input type='text' onChange={() => saveDoc({count: count + 1})} onSubmit={e => useLiveQuery.database.put({word: e.target.value})} /><ul>{result.map(row => (<li key={row.id}>{row.key}</li>))}</ul></>)}",
"dependencies": {
"react": "from-package-json",
"multiformats": "from-package-json",
"@fireproof/core": "from-package-json",
"@adviser/cement": "from-package-json",
"charwise": "from-package-json",
"prolly-trees": "from-package-json",
"ipfs-unixfs-exporter": "from-package-json",
"idb": "from-package-json",
"p-limit": "from-package-json",
"p-map": "from-package-json",
"p-retry": "from-package-json",
"cborg": "from-package-json",
"@web3-storage/pail": "from-package-json",
"@ipld/unixfs": "from-package-json",
"@ipld/car": "from-package-json"
"@fireproof/core": "from-package-json"
},
"peerDependencies": {
"react": "from-package-json",
Expand Down
7 changes: 1 addition & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -78,17 +78,12 @@
"homepage": "https://github.com/fireproof-storage/fireproof#readme",
"dependencies": {
"@adviser/cement": "^0.2.40",
"@ipld/car": "^5.3.3",
"@ipld/dag-cbor": "^9.2.2",
"@ipld/dag-json": "^10.2.3",
"@fireproof/vendor": "^1.0.0",
"@ipld/unixfs": "^3.0.0",
"@web3-storage/pail": "^0.6.0",
"cborg": "^4.2.6",
"charwise": "^3.0.1",
"cross-fetch": "^4.0.0",
"esbuild-plugin-replace": "^1.4.0",
"idb": "^8.0.0",
"ipfs-unixfs-exporter": "^13.6.1",
"memfs": "^4.14.1",
"multiformats": "^13.3.1",
"p-limit": "^6.1.0",
Expand Down
116 changes: 25 additions & 91 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions smoke/esm/it.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,15 @@ fi
$dockerCompose up -d
packageDir=../../dist/fireproof-core

user="admin$(date +%s)"
token=$(curl \
--retry 10 --retry-max-time 30 --retry-all-errors \
-X PUT \
-H "Content-type: application/json" \
-d '{ "name": "admin", "password": "admin" }' \
'http://localhost:4873/-/user/org.couchdb.user:admin' | jq .token)
-d "{ \"name\": \"$user\", \"password\": \"admin\" }" \
'http://localhost:4873/-/user/org.couchdb.user:$user' | jq .token)

echo "Token: $user:$token"
cat <<EOF > $packageDir/.npmrc
; .npmrc
enable-pre-post-scripts=true
Expand Down
10 changes: 5 additions & 5 deletions src/blockstore/commitor.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { FileTransactionMeta } from "../types";
import { CarTransaction } from "./transaction";
import { FileTransactionMeta } from "../types.js";
import { CarTransaction } from "./transaction.js";
import {
AnyBlock,
AnyLink,
Expand All @@ -14,13 +14,13 @@ import {
toCIDBlock,
TransactionMeta,
WALStore,
} from "./types";
import * as CBW from "@ipld/car/buffer-writer";
} from "./types.js";
import * as CBW from "@fireproof/vendor/@ipld/car/buffer-writer";
import { CID } from "multiformats";
import { encode } from "../runtime/wait-pr-multiformats/block.js";
import { BlockEncoder } from "../runtime/wait-pr-multiformats/codec-interface.js";
import { sha256 as hasher } from "multiformats/hashes/sha2";
import * as dagCodec from "@ipld/dag-cbor";
import * as dagCodec from "@fireproof/vendor/@ipld/dag-cbor";

async function encodeCarFile(roots: AnyLink[], t: CarMakeable, codec: BlockEncoder<number, Uint8Array>): Promise<AnyBlock> {
let size = 0;
Expand Down
2 changes: 1 addition & 1 deletion src/blockstore/fragment-gateway.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Logger, Result, URI } from "@adviser/cement";

import { base58btc } from "multiformats/bases/base58";
import { encode, decode } from "cborg";
import { encode, decode } from "@fireproof/vendor/cborg";
import { Gateway, GetResult, UnsubscribeResult, VoidResult } from "./gateway.js";
import { SuperThis } from "../types.js";
import { ensureSuperLog } from "../utils.js";
Expand Down
4 changes: 2 additions & 2 deletions src/blockstore/loader-helpers.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { decode } from "../runtime/wait-pr-multiformats/block.js";
import { sha256 as hasher } from "multiformats/hashes/sha2";
import * as dagCodec from "@ipld/dag-cbor";
import * as dagCodec from "@fireproof/vendor/@ipld/dag-cbor";
import type { Logger } from "@adviser/cement";

import { CarHeader } from "./types.js";
// import { decodeRunLength } from "../runtime/keyed-crypto.js";
// import { base58btc } from "multiformats/bases/base58";
import { CarReader } from "@ipld/car/reader";
import { CarReader } from "@fireproof/vendor/@ipld/car/reader";

// export async function encodeCarHeader<T>(fp: CarHeader<T>) {
// return (await encode({
Expand Down
2 changes: 1 addition & 1 deletion src/blockstore/loader.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import pLimit from "p-limit";
import { CarReader } from "@ipld/car/reader";
import { CarReader } from "@fireproof/vendor/@ipld/car/reader";
import { Logger, ResolveOnce } from "@adviser/cement";
// import { uuidv4 } from "uuidv7";

Expand Down
Loading

0 comments on commit d4d4486

Please sign in to comment.