@fireproof/core 0.7.0-alpha.0 → 0.7.0-alpha.2
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/dist/fireproof.js +2 -13
- package/dist/src/fireproof.d.ts +2 -2
- package/dist/src/fireproof.js +10 -18
- package/dist/src/fireproof.js.map +1 -1
- package/dist/src/fireproof.mjs +8 -16
- package/dist/src/fireproof.mjs.map +1 -1
- package/dist/storage/filesystem.js +5 -2
- package/package.json +4 -2
- package/src/fireproof.js +2 -14
- package/src/storage/filesystem.js +6 -2
@@ -1,8 +1,11 @@
|
|
1
|
-
import {
|
2
|
-
import { mkdir, writeFile } from 'node:fs/promises';
|
1
|
+
import { mkdir, writeFile } from 'fs/promises';
|
3
2
|
import { join, dirname } from 'path';
|
4
3
|
import { homedir } from 'os';
|
5
4
|
import { Base } from './base.js';
|
5
|
+
// import { readFileSync } from 'node:fs'
|
6
|
+
// const { readFileSync } = require('fs')
|
7
|
+
import fs from 'fs';
|
8
|
+
const readFileSync = fs.readFileSync;
|
6
9
|
export const defaultConfig = {
|
7
10
|
dataDir: join(homedir(), '.fireproof')
|
8
11
|
};
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@fireproof/core",
|
3
|
-
"version": "0.7.0-alpha.
|
3
|
+
"version": "0.7.0-alpha.2",
|
4
4
|
"description": "Live data for React, accelerated by proofs, powered by IPFS",
|
5
5
|
"main": "dist/src/fireproof.js",
|
6
6
|
"module": "dist/src/fireproof.mjs",
|
@@ -49,6 +49,7 @@
|
|
49
49
|
"cli-color": "^2.0.3",
|
50
50
|
"crypto-browserify": "^3.12.0",
|
51
51
|
"encrypted-block": "^0.0.3",
|
52
|
+
"filer": "^1.4.1",
|
52
53
|
"idb": "^7.1.1",
|
53
54
|
"ipld-hashmap": "^2.1.18",
|
54
55
|
"multiformats": "^11.0.1",
|
@@ -80,7 +81,8 @@
|
|
80
81
|
"standard": "^17.0.0",
|
81
82
|
"typescript": "^5.0.2",
|
82
83
|
"webpack": "^5.78.0",
|
83
|
-
"webpack-cli": "^5.0.1"
|
84
|
+
"webpack-cli": "^5.0.1",
|
85
|
+
"webpack-node-externals": "^3.0.0"
|
84
86
|
},
|
85
87
|
"mocha": {
|
86
88
|
"require": [
|
package/src/fireproof.js
CHANGED
@@ -11,22 +11,10 @@ export class Fireproof {
|
|
11
11
|
* Creates a new Fireproof instance with default storage settings
|
12
12
|
* Most apps should use this and not worry about the details.
|
13
13
|
* @static
|
14
|
-
* @returns {Database
|
14
|
+
* @returns {Database} - a new Fireproof instance
|
15
15
|
*/
|
16
16
|
static storage = (name = null, opts = {}) => {
|
17
|
-
|
18
|
-
return new Database(null, opts)
|
19
|
-
} else {
|
20
|
-
// const primaryLoader = Loader.appropriate(name, opts.primary, { key: null })
|
21
|
-
// const secondaryLoader = opts.secondary ? Loader.appropriate(name, opts.secondary, { key: null }) : null
|
22
|
-
const db = new Database(name, opts)
|
23
|
-
return db
|
24
|
-
// const loaders = [pr]
|
25
|
-
|
26
|
-
// todo we need branch names here
|
27
|
-
|
28
|
-
// console.log('storage', name, opts, primaryLoader, secondaryLoader)
|
29
|
-
}
|
17
|
+
return new Database(name, opts)
|
30
18
|
}
|
31
19
|
|
32
20
|
// static fromConfig (name, primary, secondary, opts = {}) {
|
@@ -1,8 +1,12 @@
|
|
1
|
-
|
2
|
-
import { mkdir, writeFile } from '
|
1
|
+
|
2
|
+
import { mkdir, writeFile } from 'fs/promises'
|
3
3
|
import { join, dirname } from 'path'
|
4
4
|
import { homedir } from 'os'
|
5
5
|
import { Base } from './base.js'
|
6
|
+
// import { readFileSync } from 'node:fs'
|
7
|
+
// const { readFileSync } = require('fs')
|
8
|
+
import fs from 'fs'
|
9
|
+
const readFileSync = fs.readFileSync
|
6
10
|
|
7
11
|
export const defaultConfig = {
|
8
12
|
dataDir: join(homedir(), '.fireproof')
|