@fireproof/core 0.20.0-dev-preview-40 → 0.20.0-dev-preview-50
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -4
- package/deno/index.js +2 -2
- package/deno/index.js.map +1 -1
- package/deno.json +3 -2
- package/index.cjs +955 -599
- package/index.cjs.map +1 -1
- package/index.d.cts +334 -127
- package/index.d.ts +334 -127
- package/index.js +939 -582
- package/index.js.map +1 -1
- package/indexeddb/index.cjs.map +1 -1
- package/indexeddb/index.js.map +1 -1
- package/indexeddb/metafile-cjs.json +1 -1
- package/indexeddb/metafile-esm.json +1 -1
- package/metafile-cjs.json +1 -1
- package/metafile-esm.json +1 -1
- package/package.json +7 -5
- package/react/index.cjs +17 -9
- package/react/index.cjs.map +1 -1
- package/react/index.d.cts +5 -4
- package/react/index.d.ts +5 -4
- package/react/index.js +17 -9
- package/react/index.js.map +1 -1
- package/react/metafile-cjs.json +1 -1
- package/react/metafile-esm.json +1 -1
- package/tests/blockstore/interceptor-gateway.test.ts +15 -1
- package/tests/blockstore/keyed-crypto-indexeddb-file.test.ts +8 -18
- package/tests/blockstore/keyed-crypto.test.ts +31 -53
- package/tests/blockstore/loader.test.ts +21 -19
- package/tests/blockstore/store.test.ts +52 -56
- package/tests/blockstore/transaction.test.ts +13 -11
- package/tests/fireproof/all-gateway.test.ts +53 -50
- package/tests/fireproof/attachable.test.ts +356 -0
- package/tests/fireproof/crdt.test.ts +100 -60
- package/tests/fireproof/database.test.ts +95 -54
- package/tests/fireproof/fireproof.test.ts +58 -55
- package/tests/fireproof/hello.test.ts +4 -4
- package/tests/fireproof/indexer.test.ts +44 -44
- package/tests/fireproof/stable-cid.test.ts +69 -0
- package/tests/fireproof/utils.test.ts +21 -10
- package/tests/gateway/file/loader-config.test.ts +25 -25
- package/tests/gateway/fp-envelope-serialize.test.ts +8 -8
- package/tests/gateway/indexeddb/loader-config.test.ts +6 -6
- package/tests/helpers.ts +81 -2
- package/tests/react/useFireproof.test.tsx +59 -17
package/README.md
CHANGED
@@ -7,9 +7,11 @@
|
|
7
7
|
</a>
|
8
8
|
</p>
|
9
9
|
|
10
|
-
###
|
10
|
+
### Build first, sync later: perfect for AI-generated apps and rapid prototypes
|
11
11
|
|
12
|
-
|
12
|
+
Fireproof is an embedded document ledger that lets you build full-stack apps in a single file. This makes it ideal for AI code generation and rapid prototyping - just write your features and access your data anywhere.
|
13
|
+
|
14
|
+
[Point AI coders to these docs.](https://use-fireproof.com/llms-full.txt)
|
13
15
|
|
14
16
|
### JavaScript quick start
|
15
17
|
|
@@ -44,7 +46,7 @@ import { useFireproof } from 'use-fireproof'
|
|
44
46
|
function App() {
|
45
47
|
const { useLiveQuery, useDocument } = useFireproof("my-db-name")
|
46
48
|
const completedTodos = useLiveQuery('completed', { limit: 10 })
|
47
|
-
const
|
49
|
+
const { doc, merge, save } = useDocument(() => ({type: 'todo', text: '', completed: false, created: Date.now() }))
|
48
50
|
```
|
49
51
|
|
50
52
|
Read the [step-by-step React tutorial](https://use-fireproof.com/docs/react-tutorial) to get started.
|
@@ -161,7 +163,7 @@ deno run --config node_modules/@fireproof/core/deno.json --allow-read --allow-wr
|
|
161
163
|
Caution it will be pushed directly
|
162
164
|
|
163
165
|
```shell
|
164
|
-
pnpm run build:
|
166
|
+
pnpm run build:docs
|
165
167
|
```
|
166
168
|
|
167
169
|
## Thanks 🙏
|
package/deno/index.js
CHANGED
@@ -9,7 +9,7 @@ var DenoFileSystem = class {
|
|
9
9
|
}
|
10
10
|
async readdir(path) {
|
11
11
|
const ret = [];
|
12
|
-
for await (const dirEntry of this.fs.
|
12
|
+
for await (const dirEntry of this.fs.readDir(path)) {
|
13
13
|
ret.push(dirEntry.name);
|
14
14
|
}
|
15
15
|
return ret;
|
@@ -43,7 +43,7 @@ var DenoFileSystem = class {
|
|
43
43
|
};
|
44
44
|
}
|
45
45
|
async unlink(path) {
|
46
|
-
return this.fs?.
|
46
|
+
return this.fs?.remove(path);
|
47
47
|
}
|
48
48
|
async writefile(path, data) {
|
49
49
|
return this.fs?.writeFile(path, Buffer.from(data));
|
package/deno/index.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../../src/runtime/gateways/file/deno/deno-filesystem.ts","../../../src/runtime/gateways/file/deno/get-sys-file-system.ts"],"sourcesContent":["import type { FPStats, SysFileSystem } from \"@fireproof/core\";\n\nexport class DenoFileSystem implements SysFileSystem {\n fs?: {\n mkdir: typeof Deno.mkdir;\n
|
1
|
+
{"version":3,"sources":["../../../src/runtime/gateways/file/deno/deno-filesystem.ts","../../../src/runtime/gateways/file/deno/get-sys-file-system.ts"],"sourcesContent":["import type { FPStats, SysFileSystem } from \"@fireproof/core\";\n\nexport class DenoFileSystem implements SysFileSystem {\n fs?: {\n mkdir: typeof Deno.mkdir;\n readDir: typeof Deno.readDir;\n rm: typeof Deno.remove;\n copyFile: typeof Deno.copyFile;\n readFile: typeof Deno.readFile;\n stat: typeof Deno.stat;\n remove: typeof Deno.remove;\n writeFile: typeof Deno.writeFile;\n };\n\n async start(): Promise<SysFileSystem> {\n this.fs = Deno as unknown as DenoFileSystem[\"fs\"];\n return this;\n }\n async mkdir(path: string, options?: { recursive: boolean }): Promise<string | undefined> {\n return this.fs?.mkdir(path, options).then(() => path);\n }\n async readdir(path: string): Promise<string[]> {\n const ret = [];\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n for await (const dirEntry of this.fs!.readDir(path)) {\n ret.push(dirEntry.name);\n }\n return ret;\n }\n async rm(path: string, options?: { recursive: boolean }): Promise<void> {\n return this.fs?.rm(path, options);\n }\n async copyFile(source: string, destination: string): Promise<void> {\n return this.fs?.copyFile(source, destination);\n }\n async readfile(path: string): Promise<Uint8Array> {\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n return this.fs!.readFile(path);\n }\n async stat(path: string): Promise<FPStats> {\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n const x = await this.fs!.stat(path);\n return {\n isFile: () => x.isFile,\n isDirectory: () => x.isDirectory,\n isBlockDevice: () => !!x.isBlockDevice,\n isCharacterDevice: () => !!x.isCharDevice,\n isSymbolicLink: () => !!x.isSymlink,\n isFIFO: () => !!x.isFifo,\n isSocket: () => !!x.isSocket,\n uid: x.uid,\n gid: x.gid,\n size: x.size,\n atime: x.atime,\n mtime: x.mtime,\n ctime: x.birthtime,\n birthtime: x.birthtime,\n };\n }\n async unlink(path: string): Promise<void> {\n return this.fs?.remove(path);\n }\n async writefile(path: string, data: Uint8Array | string): Promise<void> {\n return this.fs?.writeFile(path, Buffer.from(data));\n }\n}\n","import type { SysFileSystem } from \"@fireproof/core\";\nimport { DenoFileSystem } from \"./deno-filesystem.js\";\nimport { ResolveOnce, URI } from \"@adviser/cement\";\n\nconst nfs = new ResolveOnce<SysFileSystem>();\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nexport async function getSysFileSystem(url: URI): Promise<SysFileSystem> {\n return nfs.once(async () => {\n const nfs = new DenoFileSystem();\n await nfs.start();\n return nfs;\n });\n}\n"],"mappings":";AAEO,IAAM,iBAAN,MAA8C;AAAA,EAYnD,MAAM,QAAgC;AACpC,SAAK,KAAK;AACV,WAAO;AAAA,EACT;AAAA,EACA,MAAM,MAAM,MAAc,SAA+D;AACvF,WAAO,KAAK,IAAI,MAAM,MAAM,OAAO,EAAE,KAAK,MAAM,IAAI;AAAA,EACtD;AAAA,EACA,MAAM,QAAQ,MAAiC;AAC7C,UAAM,MAAM,CAAC;AAEb,qBAAiB,YAAY,KAAK,GAAI,QAAQ,IAAI,GAAG;AACnD,UAAI,KAAK,SAAS,IAAI;AAAA,IACxB;AACA,WAAO;AAAA,EACT;AAAA,EACA,MAAM,GAAG,MAAc,SAAiD;AACtE,WAAO,KAAK,IAAI,GAAG,MAAM,OAAO;AAAA,EAClC;AAAA,EACA,MAAM,SAAS,QAAgB,aAAoC;AACjE,WAAO,KAAK,IAAI,SAAS,QAAQ,WAAW;AAAA,EAC9C;AAAA,EACA,MAAM,SAAS,MAAmC;AAEhD,WAAO,KAAK,GAAI,SAAS,IAAI;AAAA,EAC/B;AAAA,EACA,MAAM,KAAK,MAAgC;AAEzC,UAAM,IAAI,MAAM,KAAK,GAAI,KAAK,IAAI;AAClC,WAAO;AAAA,MACL,QAAQ,MAAM,EAAE;AAAA,MAChB,aAAa,MAAM,EAAE;AAAA,MACrB,eAAe,MAAM,CAAC,CAAC,EAAE;AAAA,MACzB,mBAAmB,MAAM,CAAC,CAAC,EAAE;AAAA,MAC7B,gBAAgB,MAAM,CAAC,CAAC,EAAE;AAAA,MAC1B,QAAQ,MAAM,CAAC,CAAC,EAAE;AAAA,MAClB,UAAU,MAAM,CAAC,CAAC,EAAE;AAAA,MACpB,KAAK,EAAE;AAAA,MACP,KAAK,EAAE;AAAA,MACP,MAAM,EAAE;AAAA,MACR,OAAO,EAAE;AAAA,MACT,OAAO,EAAE;AAAA,MACT,OAAO,EAAE;AAAA,MACT,WAAW,EAAE;AAAA,IACf;AAAA,EACF;AAAA,EACA,MAAM,OAAO,MAA6B;AACxC,WAAO,KAAK,IAAI,OAAO,IAAI;AAAA,EAC7B;AAAA,EACA,MAAM,UAAU,MAAc,MAA0C;AACtE,WAAO,KAAK,IAAI,UAAU,MAAM,OAAO,KAAK,IAAI,CAAC;AAAA,EACnD;AACF;;;AC/DA,SAAS,mBAAwB;AAEjC,IAAM,MAAM,IAAI,YAA2B;AAE3C,eAAsB,iBAAiB,KAAkC;AACvE,SAAO,IAAI,KAAK,YAAY;AAC1B,UAAMA,OAAM,IAAI,eAAe;AAC/B,UAAMA,KAAI,MAAM;AAChB,WAAOA;AAAA,EACT,CAAC;AACH;","names":["nfs"]}
|
package/deno.json
CHANGED
@@ -1,13 +1,14 @@
|
|
1
1
|
{
|
2
2
|
"imports": {
|
3
3
|
"@fireproof/core": "./index.js",
|
4
|
+
"@adviser/cement": "npm:@adviser/cement@~0.3.20",
|
5
|
+
"@fireproof/vendor": "npm:@fireproof/vendor@~2.0.1",
|
4
6
|
"@ipld/car": "npm:@ipld/car@^5.4.0",
|
5
7
|
"@ipld/dag-cbor": "npm:@ipld/dag-cbor@^9.2.2",
|
6
8
|
"@ipld/dag-json": "npm:@ipld/dag-json@^10.2.3",
|
7
|
-
"@fireproof/vendor": "npm:@fireproof/vendor@^1.1.0-dev",
|
8
9
|
"cborg": "npm:cborg@^4.2.8",
|
9
10
|
"ipfs-unixfs-exporter": "npm:ipfs-unixfs-exporter@^13.6.1",
|
10
|
-
"multiformats": "npm:multiformats@^13.3.
|
11
|
+
"multiformats": "npm:multiformats@^13.3.2",
|
11
12
|
"@ipld/unixfs": "npm:@ipld/unixfs@^3.0.0",
|
12
13
|
"charwise": "npm:charwise@^3.0.1",
|
13
14
|
"prolly-trees": "npm:prolly-trees@^1.0.4",
|