Skip to content

Commit bd78bf5

Browse files
authored
Merge pull request #270 from module-federation/release-0-1-0
get rid of unneeded lbs
2 parents 2fad0f3 + 7fe3949 commit bd78bf5

File tree

3 files changed

+82
-72
lines changed

3 files changed

+82
-72
lines changed

nohup.out

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3261,3 +3261,17 @@ Error: Command failed: ./watch.sh 80 8888
32613261
signal: null,
32623262
cmd: './watch.sh 80 8888'
32633263
}
3264+
change adapters/datasources/datasource-ipfs.js
3265+
Error: Command failed: ./watch.sh 80 8888
3266+
3267+
at ChildProcess.exithandler (node:child_process:402:12)
3268+
at ChildProcess.emit (node:events:513:28)
3269+
at maybeClose (node:internal/child_process:1100:16)
3270+
at Socket.<anonymous> (node:internal/child_process:458:11)
3271+
at Socket.emit (node:events:513:28)
3272+
at Pipe.<anonymous> (node:net:301:12) {
3273+
code: 7,
3274+
killed: false,
3275+
signal: null,
3276+
cmd: './watch.sh 80 8888'
3277+
}

package.json

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@
2020
"buildc": "gcc forkrun.c -o forkrun"
2121
},
2222
"peerDependencies": {
23-
"core-js": "^3"
23+
"core-js": "^3",
24+
"express": "4.18.2"
2425
},
2526
"dependencies": {
2627
"@assemblyscript/loader": "0.25.2",
@@ -31,21 +32,15 @@
3132
"assemblyscript": "0.25.2",
3233
"cors": "^2.8.5",
3334
"dotenv": "16.0.1",
34-
"express": "4.18.2",
3535
"express-fileupload": "^1.4.0",
3636
"express-jwt": "7.7.5",
3737
"import-fresh": "3.3.0",
38-
"ipfs": "^0.63.0",
3938
"jwks-rsa": "2.1.4",
4039
"mesh-link": "0.13.6",
4140
"mongodb": "^4.12.1",
4241
"multicast-dns": "7.2.5",
4342
"nanoid": "3.3.2",
44-
"nats": "2.7.1",
4543
"path-to-regexp": "^6.2.1",
46-
"pretty": "^2.0.0",
47-
"pretty-cli": "^0.0.14",
48-
"python-shell": "^3.0.1",
4944
"query-params-mongo": "^1.1.3",
5045
"regenerator-runtime": "0.13.9",
5146
"rimraf": "3.0.2",
@@ -75,6 +70,7 @@
7570
"jsdoc-to-markdown": "7.1.1",
7671
"mocha": "10.0.0",
7772
"mocha-esm": "1.1.1",
73+
"pretty-cli": "^0.0.14",
7874
"prettier": "^2.8.1",
7975
"split": "1.0.1",
8076
"standard": "^17.0.0",
Lines changed: 65 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -1,72 +1,72 @@
1-
import fs from 'fs'
2-
import { DataSourceFile } from '.'
3-
import IPFS from 'ipfs-core'
1+
// import fs from 'fs'
2+
// import { DataSourceFile } from '.'
3+
// import IPFS from 'ipfs-core'
44

5-
/**
6-
* Storage on the distributed web {@link https://ipfs.io}
7-
*/
8-
export class DataSourceIpfs extends DataSourceFile {
9-
constructor(map, name, options = {}) {
10-
super(map, name, options)
11-
}
5+
// /**
6+
// * Storage on the distributed web {@link https://ipfs.io}
7+
// */
8+
// export class DataSourceIpfs extends DataSourceFile {
9+
// constructor(map, name, options = {}) {
10+
// super(map, name, options)
11+
// }
1212

13-
async save(id, data) {
14-
super.save(id, data)
15-
this.writeFile()
16-
return data
17-
}
13+
// async save(id, data) {
14+
// super.save(id, data)
15+
// this.writeFile()
16+
// return data
17+
// }
1818

19-
async find(id) {
20-
return super.find(id)
21-
}
19+
// async find(id) {
20+
// return super.find(id)
21+
// }
2222

23-
startIpfs() {
24-
try {
25-
IPFS.create({
26-
repo: 'aegis-' + Math.random(),
27-
}).then(fs => (this.ipfs = fs))
28-
} catch (err) {
29-
console.error(err)
30-
}
31-
}
23+
// startIpfs() {
24+
// try {
25+
// IPFS.create({
26+
// repo: 'aegis-' + Math.random(),
27+
// }).then(fs => (this.ipfs = fs))
28+
// } catch (err) {
29+
// console.error(err)
30+
// }
31+
// }
3232

33-
load(hydrate) {
34-
this.startIpfs()
35-
if (fs.existsSync(this.file)) {
36-
try {
37-
this.cid = fs.readFileSync(this.file, 'utf-8')
38-
this.readFile(hydrate)
39-
} catch (error) {
40-
console.error(this.load.name, error.message)
41-
}
42-
} else {
43-
return new Map()
44-
}
45-
}
33+
// load(hydrate) {
34+
// this.startIpfs()
35+
// if (fs.existsSync(this.file)) {
36+
// try {
37+
// this.cid = fs.readFileSync(this.file, 'utf-8')
38+
// this.readFile(hydrate)
39+
// } catch (error) {
40+
// console.error(this.load.name, error.message)
41+
// }
42+
// } else {
43+
// return new Map()
44+
// }
45+
// }
4646

47-
async readFile(hydrate) {
48-
try {
49-
let data
50-
const stream = this.ipfs.cat(this.cid)
51-
for await (const chunk of stream) {
52-
// chunks of data are returned as a Buffer, convert it back to a string
53-
data += chunk.toString()
54-
}
55-
return hydrate(new Map(JSON.parse(data), this.revive))
56-
} catch (e) {
57-
console.error(e)
58-
}
59-
}
47+
// async readFile(hydrate) {
48+
// try {
49+
// let data
50+
// const stream = this.ipfs.cat(this.cid)
51+
// for await (const chunk of stream) {
52+
// // chunks of data are returned as a Buffer, convert it back to a string
53+
// data += chunk.toString()
54+
// }
55+
// return hydrate(new Map(JSON.parse(data), this.revive))
56+
// } catch (e) {
57+
// console.error(e)
58+
// }
59+
// }
6060

61-
async writeFile() {
62-
try {
63-
// add your data to to IPFS - this can be a string, a Buffer,
64-
// a stream of Buffers, etc
65-
const { cid } = this.ipfs.add(JSON.stringify([...this.dsMap]))
66-
fs.writeFileSync(this.file, cid.toString())
67-
this.cid = cid
68-
} catch (error) {
69-
console.error(error)
70-
}
71-
}
72-
}
61+
// async writeFile() {
62+
// try {
63+
// // add your data to to IPFS - this can be a string, a Buffer,
64+
// // a stream of Buffers, etc
65+
// const { cid } = this.ipfs.add(JSON.stringify([...this.dsMap]))
66+
// fs.writeFileSync(this.file, cid.toString())
67+
// this.cid = cid
68+
// } catch (error) {
69+
// console.error(error)
70+
// }
71+
// }
72+
// }

0 commit comments

Comments
 (0)