@fireproof/core 0.20.4 → 0.20.5-dev-preview-1
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/deno/index.js +2 -1
- package/deno/index.js.map +1 -1
- package/deno/metafile-esm.json +1 -1
- package/deno.json +1 -1
- package/index.cjs +1 -1
- package/index.cjs.map +1 -1
- package/index.js +1 -1
- package/index.js.map +1 -1
- package/metafile-cjs.json +1 -1
- package/metafile-esm.json +1 -1
- package/node/index.cjs +3 -7
- package/node/index.cjs.map +1 -1
- package/node/index.js +1 -5
- package/node/index.js.map +1 -1
- package/node/metafile-cjs.json +1 -1
- package/node/metafile-esm.json +1 -1
- package/package.json +2 -2
- package/react/index.cjs +90 -1
- package/react/index.cjs.map +1 -1
- package/react/index.js +90 -1
- package/react/index.js.map +1 -1
- package/react/metafile-cjs.json +1 -1
- package/react/metafile-esm.json +1 -1
package/deno/index.js
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
// src/runtime/gateways/file/deno/deno-filesystem.ts
|
2
|
+
import { to_uint8 } from "@adviser/cement";
|
2
3
|
var DenoFileSystem = class {
|
3
4
|
async start() {
|
4
5
|
this.fs = Deno;
|
@@ -46,7 +47,7 @@ var DenoFileSystem = class {
|
|
46
47
|
return this.fs?.remove(path);
|
47
48
|
}
|
48
49
|
async writefile(path, data) {
|
49
|
-
return this.fs?.writeFile(path,
|
50
|
+
return this.fs?.writeFile(path, to_uint8(data));
|
50
51
|
}
|
51
52
|
};
|
52
53
|
|
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 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,
|
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\";\nimport { to_uint8 } from \"@adviser/cement\";\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, to_uint8(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":";AACA,SAAS,gBAAgB;AAElB,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,SAAS,IAAI,CAAC;AAAA,EAChD;AACF;;;AChEA,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/metafile-esm.json
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"inputs":{"src/runtime/gateways/file/deno/deno-filesystem.ts":{"bytes":
|
1
|
+
{"inputs":{"src/runtime/gateways/file/deno/deno-filesystem.ts":{"bytes":2222,"imports":[{"path":"@adviser/cement","kind":"import-statement","external":true}],"format":"esm"},"src/runtime/gateways/file/deno/get-sys-file-system.ts":{"bytes":462,"imports":[{"path":"src/runtime/gateways/file/deno/deno-filesystem.ts","kind":"import-statement","original":"./deno-filesystem.js"},{"path":"@adviser/cement","kind":"import-statement","external":true}],"format":"esm"},"src/runtime/gateways/file/deno/index.ts":{"bytes":61,"imports":[{"path":"src/runtime/gateways/file/deno/get-sys-file-system.ts","kind":"import-statement","original":"./get-sys-file-system.js"}],"format":"esm"}},"outputs":{"dist/fireproof-core/deno/index.js.map":{"imports":[],"exports":[],"inputs":{},"bytes":4388},"dist/fireproof-core/deno/index.js":{"imports":[{"path":"@adviser/cement","kind":"import-statement","external":true},{"path":"@adviser/cement","kind":"import-statement","external":true}],"exports":["getSysFileSystem"],"entryPoint":"src/runtime/gateways/file/deno/index.ts","inputs":{"src/runtime/gateways/file/deno/deno-filesystem.ts":{"bytesInOutput":1284},"src/runtime/gateways/file/deno/get-sys-file-system.ts":{"bytesInOutput":235},"src/runtime/gateways/file/deno/index.ts":{"bytesInOutput":0}},"bytes":1661}}}
|
package/deno.json
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"imports": {
|
3
3
|
"@fireproof/core": "./index.js",
|
4
|
-
"@adviser/cement": "npm:@adviser/cement@~0.4.
|
4
|
+
"@adviser/cement": "npm:@adviser/cement@~0.4.11",
|
5
5
|
"@ipld/car": "npm:@ipld/car@^5.4.0",
|
6
6
|
"@ipld/dag-cbor": "npm:@ipld/dag-cbor@^9.2.2",
|
7
7
|
"@ipld/dag-json": "npm:@ipld/dag-json@^10.2.3",
|