@fireproof/core 0.7.0-alpha.1 → 0.7.0-alpha.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,8 +1,11 @@
1
- import { readFileSync } from 'node:fs';
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
  };
@@ -59,7 +62,7 @@ function loadSync(filename) {
59
62
  }
60
63
  }
61
64
  async function writeSync(fullpath, stringValue) {
62
- await mkdir(dirname(fullpath), { recursive: true });
65
+ await fs.promises.mkdir(dirname(fullpath), { recursive: true });
63
66
  // writeFileSync(fullpath, stringValue)
64
- await writeFile(fullpath, stringValue);
67
+ await fs.promises.writeFile(fullpath, stringValue);
65
68
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fireproof/core",
3
- "version": "0.7.0-alpha.1",
3
+ "version": "0.7.0-alpha.3",
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": [
@@ -1,8 +1,12 @@
1
- import { readFileSync } from 'node:fs'
2
- import { mkdir, writeFile } from 'node:fs/promises'
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')
@@ -64,7 +68,7 @@ function loadSync (filename) {
64
68
  }
65
69
 
66
70
  async function writeSync (fullpath, stringValue) {
67
- await mkdir(dirname(fullpath), { recursive: true })
71
+ await fs.promises.mkdir(dirname(fullpath), { recursive: true })
68
72
  // writeFileSync(fullpath, stringValue)
69
- await writeFile(fullpath, stringValue)
73
+ await fs.promises.writeFile(fullpath, stringValue)
70
74
  }