@peerbit/server 5.8.16-48ac6de → 5.9.0

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.
@@ -23,7 +23,7 @@
23
23
  Learn how to configure a non-root public URL by running `npm run build`.
24
24
  -->
25
25
  <title>Peerbit</title>
26
- <script type="module" crossorigin src="/assets/index-eOjCmm72.js"></script>
26
+ <script type="module" crossorigin src="/assets/index-BEgs1gyX.js"></script>
27
27
  <link rel="stylesheet" crossorigin href="/assets/index-CIfVvUo9.css">
28
28
  </head>
29
29
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@peerbit/server",
3
- "version": "5.8.16-48ac6de",
3
+ "version": "5.9.0",
4
4
  "author": "dao.xyz",
5
5
  "repository": {
6
6
  "type": "git",
@@ -56,18 +56,7 @@
56
56
  "*.d.ts"
57
57
  ]
58
58
  },
59
- "scripts": {
60
- "clean": "shx rm -rf lib/*",
61
- "build": "pnpm run clean && pnpm run build-lib && pnpm run build-ui",
62
- "build-lib": "tsc -p tsconfig.json",
63
- "build-ui": "pnpm --dir ../frontend build",
64
- "postbuild": "cp src/nginx-template.conf dist/src/ && cp -r ../frontend/dist/. dist/ui",
65
- "test": "aegir test --t node",
66
- "lint": "aegir lint"
67
- },
68
59
  "devDependencies": {
69
- "@peerbit/test-lib": "0.0.1-48ac6de",
70
- "@peerbit/test-utils": "2.2.11-48ac6de",
71
60
  "@types/yargs": "17.0.24",
72
61
  "aws-sdk": "^2.1259.0",
73
62
  "dotenv": "^16.1.4",
@@ -75,37 +64,48 @@
75
64
  "@types/tar-stream": "^3.1.3",
76
65
  "shx": "^0.3.4",
77
66
  "@types/libsodium-wrappers": "^0.7.14",
78
- "uuid": "^10.0.0"
67
+ "uuid": "^10.0.0",
68
+ "@peerbit/test-lib": "0.0.1",
69
+ "@peerbit/test-utils": "2.3.0"
79
70
  },
80
71
  "dependencies": {
81
72
  "axios": "^1.4.0",
82
73
  "chalk": "^5.3.0",
83
- "peerbit": "4.3.10-48ac6de",
84
74
  "yargs": "^17.7.2",
85
75
  "tar-stream": "^3.1.7",
86
76
  "tmp": "^0.2.1",
87
77
  "tty-table": "^4.2.1",
88
- "@libp2p/interface": "^3.0.0",
78
+ "@libp2p/interface": "^3.1.0",
89
79
  "@libp2p/crypto": "^5.1.10",
90
80
  "@libp2p/peer-id": "^6.0.1",
91
81
  "@libp2p/tcp": "^11.0.2",
92
- "@libp2p/websockets": "^10.0.3",
82
+ "@libp2p/websockets": "^10.1.0",
93
83
  "@multiformats/multiaddr": "^13.0.1",
94
- "@peerbit/blocks": "3.0.15-48ac6de",
95
- "@peerbit/crypto": "2.3.13-48ac6de",
96
- "@peerbit/program": "5.3.6-48ac6de",
97
- "@peerbit/pubsub": "4.0.18-48ac6de",
98
- "@peerbit/time": "2.2.0-48ac6de",
99
- "@dao-xyz/borsh": "^5.2.3",
84
+ "@dao-xyz/borsh": "^6.0.0",
100
85
  "libsodium-wrappers": "^0.7.15",
101
86
  "uint8arrays": "^5.1.0",
102
87
  "level": "^10.0.0",
103
88
  "memory-level": "^3.1.0",
104
89
  "multiformats": "^13.4.1",
105
- "abstract-level": "^3.1.0"
90
+ "abstract-level": "^3.1.0",
91
+ "peerbit": "4.4.0",
92
+ "@peerbit/blocks": "3.1.0",
93
+ "@peerbit/crypto": "2.4.0",
94
+ "@peerbit/program": "1.0.0",
95
+ "@peerbit/pubsub": "4.1.0",
96
+ "@peerbit/time": "2.3.0"
106
97
  },
107
98
  "optionalDependencies": {
108
99
  "@aws-sdk/client-ec2": "^3.390.0",
109
100
  "@aws-sdk/client-route-53": "^3.391.0"
101
+ },
102
+ "scripts": {
103
+ "clean": "shx rm -rf lib/*",
104
+ "build": "pnpm run clean && pnpm run build-lib && pnpm run build-ui",
105
+ "build-lib": "tsc -p tsconfig.json",
106
+ "build-ui": "pnpm --dir ../frontend build",
107
+ "postbuild": "cp src/nginx-template.conf dist/src/ && cp -r ../frontend/dist/. dist/ui",
108
+ "test": "aegir test --t node",
109
+ "lint": "aegir lint"
110
110
  }
111
- }
111
+ }
package/src/aws.ts CHANGED
@@ -1,5 +1,4 @@
1
1
  /* eslint-disable no-console */
2
-
3
2
  /* eslint-disable @typescript-eslint/naming-convention */
4
3
  import { type PeerId } from "@libp2p/interface";
5
4
  import { delay } from "@peerbit/time";
package/src/cli.ts CHANGED
@@ -1,5 +1,4 @@
1
1
  /* eslint-disable no-console */
2
-
3
2
  /* eslint-disable @typescript-eslint/naming-convention */
4
3
  import type { PeerId } from "@libp2p/interface";
5
4
  import { peerIdFromString } from "@libp2p/peer-id";
@@ -11,7 +10,7 @@ import path from "path";
11
10
  import { exit } from "process";
12
11
  import readline from "readline";
13
12
  import Table from "tty-table";
14
- import type yargs from "yargs";
13
+ import type { Argv } from "yargs";
15
14
  import {
16
15
  AWS_LINUX_ARM_AMIs,
17
16
  createRecord,
@@ -134,7 +133,7 @@ export const cli = async (args?: string[]) => {
134
133
  .command({
135
134
  command: "start",
136
135
  describe: "Start node",
137
- builder: (yargs: yargs.Argv) => {
136
+ builder: (yargs: Argv) => {
138
137
  yargs
139
138
  .option("directory", {
140
139
  describe: "Peerbit directory",
@@ -193,7 +192,7 @@ export const cli = async (args?: string[]) => {
193
192
  .command({
194
193
  command: "id",
195
194
  describe: "Get peer id",
196
- builder: (yargs: yargs.Argv) => {
195
+ builder: (yargs: Argv) => {
197
196
  yargs.option("directory", {
198
197
  describe: "Peerbit directory",
199
198
  defaultDescription: "~.peerbit",
@@ -320,7 +319,7 @@ export const cli = async (args?: string[]) => {
320
319
  .command({
321
320
  command: "aws",
322
321
  describe: "Spawn remote nodes on AWS",
323
- builder: (awsArgs: yargs.Argv) => {
322
+ builder: (awsArgs: Argv) => {
324
323
  awsArgs.option("count", {
325
324
  describe: "Amount of nodes to spawn",
326
325
  defaultDescription: "One node",
@@ -464,7 +463,7 @@ export const cli = async (args?: string[]) => {
464
463
  .command({
465
464
  command: "terminate [name...]",
466
465
  describe: "Terminate remote instances that was previously spawned",
467
- builder: (killArgs: yargs.Argv) => {
466
+ builder: (killArgs: Argv) => {
468
467
  killArgs.option("all", {
469
468
  describe: "Kill all nodes",
470
469
  type: "boolean",
@@ -505,7 +504,7 @@ export const cli = async (args?: string[]) => {
505
504
  command: "list",
506
505
  aliases: "ls",
507
506
  describe: "List remotes",
508
- builder: (yargs: yargs.Argv) => {
507
+ builder: (yargs: Argv) => {
509
508
  yargs.option("directory", {
510
509
  describe: "Peerbit directory",
511
510
  defaultDescription: "~.peerbit",
@@ -561,7 +560,7 @@ export const cli = async (args?: string[]) => {
561
560
  .command({
562
561
  command: "add <name> <address>",
563
562
  describe: "Add remote",
564
- builder: (yargs: yargs.Argv) => {
563
+ builder: (yargs: Argv) => {
565
564
  yargs
566
565
  .positional("name", {
567
566
  type: "string",
@@ -615,7 +614,7 @@ export const cli = async (args?: string[]) => {
615
614
  .command({
616
615
  command: "remove <name>",
617
616
  describe: "Remove a remote",
618
- builder: (yargs: yargs.Argv) => {
617
+ builder: (yargs: Argv) => {
619
618
  yargs
620
619
 
621
620
  .positional("name", {
@@ -650,7 +649,7 @@ export const cli = async (args?: string[]) => {
650
649
  .command({
651
650
  command: "connect [name...]",
652
651
  describe: "Connect to remote(s)",
653
- builder: (yargs: yargs.Argv) => {
652
+ builder: (yargs: Argv) => {
654
653
  yargs
655
654
  .positional("name", {
656
655
  type: "string",
@@ -832,7 +831,7 @@ export const cli = async (args?: string[]) => {
832
831
  .command({
833
832
  command: "grant <peer-id>",
834
833
  describe: "Give a peer-id admin capabilities",
835
- builder: (yargs: yargs.Argv) => {
834
+ builder: (yargs: Argv) => {
836
835
  yargs.positional("peer-id", {
837
836
  describe: "Peer id",
838
837
  type: "string",
@@ -852,7 +851,7 @@ export const cli = async (args?: string[]) => {
852
851
  .command({
853
852
  command: "deny <peer-id>",
854
853
  describe: "Remove admin capabilities from peer-id",
855
- builder: (yargs: yargs.Argv) => {
854
+ builder: (yargs: Argv) => {
856
855
  yargs.positional("peer-id", {
857
856
  describe: "Peer id",
858
857
  demandOption: true,