@powerhousedao/reactor-local 1.5.2 → 1.6.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.
- package/CHANGELOG.md +34 -13
- package/dist/{chunk-WZVFZSEC.js → chunk-JEZMQ4ZA.js} +23 -1
- package/dist/cli.js +1 -1
- package/dist/index.js +2 -2
- package/dist/server.js +1 -1
- package/package.json +10 -10
- package/src/server.ts +36 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,25 +1,46 @@
|
|
|
1
|
-
## 1.
|
|
1
|
+
## 1.6.0 (2024-11-29)
|
|
2
2
|
|
|
3
3
|
### 🚀 Features
|
|
4
4
|
|
|
5
|
-
- **monorepo:**
|
|
6
|
-
- **
|
|
7
|
-
- **
|
|
8
|
-
- **
|
|
9
|
-
- **
|
|
10
|
-
- **
|
|
5
|
+
- **monorepo:** do not skip nx cache ([dfadd970](https://github.com/powerhouse-inc/powerhouse/commit/dfadd970))
|
|
6
|
+
- **monorepo:** uncomment test ([dbd42350](https://github.com/powerhouse-inc/powerhouse/commit/dbd42350))
|
|
7
|
+
- **monorepo:** readd special check pr for document drive ([f1b9f7fe](https://github.com/powerhouse-inc/powerhouse/commit/f1b9f7fe))
|
|
8
|
+
- **monorepo:** use explicit paths ([ce5deb4c](https://github.com/powerhouse-inc/powerhouse/commit/ce5deb4c))
|
|
9
|
+
- **monorepo:** remove set dir as safe ([e8033645](https://github.com/powerhouse-inc/powerhouse/commit/e8033645))
|
|
10
|
+
- **monorepo:** handle document drive separately ([a94d4c26](https://github.com/powerhouse-inc/powerhouse/commit/a94d4c26))
|
|
11
|
+
- **monorepo:** add debug info ([ee1b7cab](https://github.com/powerhouse-inc/powerhouse/commit/ee1b7cab))
|
|
12
|
+
- **monorepo:** add read permissions ([ee6397d2](https://github.com/powerhouse-inc/powerhouse/commit/ee6397d2))
|
|
13
|
+
- **monorepo:** use set shas lib ([769e74a6](https://github.com/powerhouse-inc/powerhouse/commit/769e74a6))
|
|
14
|
+
- **monorepo:** add base ([22a5fffd](https://github.com/powerhouse-inc/powerhouse/commit/22a5fffd))
|
|
15
|
+
- **monorepo:** simplify commands ([75000bb4](https://github.com/powerhouse-inc/powerhouse/commit/75000bb4))
|
|
16
|
+
- **monorepo:** fix yaml syntax error ([5c82fcec](https://github.com/powerhouse-inc/powerhouse/commit/5c82fcec))
|
|
17
|
+
- **monorepo:** use workflow dispatch ([d1b4bde9](https://github.com/powerhouse-inc/powerhouse/commit/d1b4bde9))
|
|
18
|
+
- **monorepo:** still run on pushes ([86998628](https://github.com/powerhouse-inc/powerhouse/commit/86998628))
|
|
19
|
+
- **monorepo:** add if statements to prevent redundant runs ([193c5df5](https://github.com/powerhouse-inc/powerhouse/commit/193c5df5))
|
|
20
|
+
- **monorepo:** prevent duplicate runs ([1ce210b9](https://github.com/powerhouse-inc/powerhouse/commit/1ce210b9))
|
|
21
|
+
- **monorepo:** remove package manager config ([f177433b](https://github.com/powerhouse-inc/powerhouse/commit/f177433b))
|
|
22
|
+
- **monorepo:** install pnpm before doing node cache ([ab1cc5a6](https://github.com/powerhouse-inc/powerhouse/commit/ab1cc5a6))
|
|
23
|
+
- **monorepo:** simplify pr checks ([40d0cb59](https://github.com/powerhouse-inc/powerhouse/commit/40d0cb59))
|
|
24
|
+
- **monorepo:** add dry run version of release package action for testing ([323807f8](https://github.com/powerhouse-inc/powerhouse/commit/323807f8))
|
|
25
|
+
- **monorepo:** update release package manual ([405b6877](https://github.com/powerhouse-inc/powerhouse/commit/405b6877))
|
|
26
|
+
- **monorepo:** use workspace protocol in package deps ([2584e9dd](https://github.com/powerhouse-inc/powerhouse/commit/2584e9dd))
|
|
27
|
+
- **monorepo:** add preserve local dependency protocols to nx config ([b1902311](https://github.com/powerhouse-inc/powerhouse/commit/b1902311))
|
|
28
|
+
- **powerhouse:** regenerate lockfile ([#588](https://github.com/powerhouse-inc/powerhouse/pull/588))
|
|
29
|
+
- **reactor-local:** added automatic loading and activation of proces… ([#574](https://github.com/powerhouse-inc/powerhouse/pull/574))
|
|
30
|
+
- **document-model-libs:** regenerate lockfile ([04f0b0e6](https://github.com/powerhouse-inc/powerhouse/commit/04f0b0e6))
|
|
31
|
+
- **monorepo:** fix eslint config for react files ([019fa584](https://github.com/powerhouse-inc/powerhouse/commit/019fa584))
|
|
11
32
|
|
|
12
33
|
### 🧱 Updated Dependencies
|
|
13
34
|
|
|
14
|
-
- Updated @powerhousedao/general-document-indexer to 1.
|
|
15
|
-
- Updated document-model-libs to 1.
|
|
16
|
-
- Updated document-drive to 1.
|
|
17
|
-
- Updated
|
|
18
|
-
- Updated @powerhousedao/reactor-api to 1.5.2
|
|
35
|
+
- Updated @powerhousedao/general-document-indexer to 1.4.0
|
|
36
|
+
- Updated document-model-libs to 1.117.0
|
|
37
|
+
- Updated document-drive to 1.5.0
|
|
38
|
+
- Updated @powerhousedao/reactor-api to 1.6.0
|
|
19
39
|
|
|
20
40
|
### ❤️ Thank You
|
|
21
41
|
|
|
22
|
-
-
|
|
42
|
+
- frankp.eth @froid1911
|
|
43
|
+
- Ryan Wolhuter @ryanwolhuter
|
|
23
44
|
- ryanwolhuter @ryanwolhuter
|
|
24
45
|
|
|
25
46
|
## 1.1.0 (2024-10-29)
|
|
@@ -2,7 +2,7 @@ import path2 from 'node:path';
|
|
|
2
2
|
import { fileURLToPath } from 'node:url';
|
|
3
3
|
import dotenv from 'dotenv';
|
|
4
4
|
import { createServer } from 'vite';
|
|
5
|
-
import { startAPI } from '@powerhousedao/reactor-api';
|
|
5
|
+
import { startAPI, addSubgraph, createSchema, registerInternalListener } from '@powerhousedao/reactor-api';
|
|
6
6
|
import * as DocumentDrive from 'document-model-libs/document-drive';
|
|
7
7
|
import { isFileNode, utils as utils$1, actions, documentModel } from 'document-model-libs/document-drive';
|
|
8
8
|
import { utils } from 'document-model/document';
|
|
@@ -3954,6 +3954,28 @@ var startServer = async (options) => {
|
|
|
3954
3954
|
...baseDocumentModels,
|
|
3955
3955
|
...Object.values(localDMs)
|
|
3956
3956
|
]);
|
|
3957
|
+
const processorsPath = path2.join(process.cwd(), "./processors");
|
|
3958
|
+
console.log("Loading processors from", processorsPath);
|
|
3959
|
+
const localProcessors = await vite.ssrLoadModule(
|
|
3960
|
+
processorsPath
|
|
3961
|
+
);
|
|
3962
|
+
for (const [name, processor] of Object.entries(localProcessors)) {
|
|
3963
|
+
await Promise.all([
|
|
3964
|
+
addSubgraph({
|
|
3965
|
+
name,
|
|
3966
|
+
getSchema: (driveServer2) => createSchema(
|
|
3967
|
+
driveServer2,
|
|
3968
|
+
processor.resolvers,
|
|
3969
|
+
processor.typeDefs
|
|
3970
|
+
)
|
|
3971
|
+
}),
|
|
3972
|
+
registerInternalListener({
|
|
3973
|
+
name,
|
|
3974
|
+
options: processor.options,
|
|
3975
|
+
transmit: processor.transmit
|
|
3976
|
+
})
|
|
3977
|
+
]);
|
|
3978
|
+
}
|
|
3957
3979
|
}
|
|
3958
3980
|
} catch (e) {
|
|
3959
3981
|
console.error("App crashed", e);
|
package/dist/cli.js
CHANGED
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { startServer } from './chunk-
|
|
2
|
-
export { DefaultStartServerOptions, startServer } from './chunk-
|
|
1
|
+
import { startServer } from './chunk-JEZMQ4ZA.js';
|
|
2
|
+
export { DefaultStartServerOptions, startServer } from './chunk-JEZMQ4ZA.js';
|
|
3
3
|
|
|
4
4
|
// src/index.ts
|
|
5
5
|
startServer().catch((error) => {
|
package/dist/server.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { DefaultStartServerOptions, startServer } from './chunk-
|
|
1
|
+
export { DefaultStartServerOptions, startServer } from './chunk-JEZMQ4ZA.js';
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@powerhousedao/reactor-local",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "1.
|
|
4
|
+
"version": "1.6.0",
|
|
5
5
|
"main": "dist/server.js",
|
|
6
6
|
"bin": {
|
|
7
7
|
"reactor-local": "dist/cli.js"
|
|
@@ -16,13 +16,8 @@
|
|
|
16
16
|
"@apollo/subgraph": "^2.9.2",
|
|
17
17
|
"@electric-sql/pglite": "^0.2.12",
|
|
18
18
|
"@libsql/client": "^0.14.0",
|
|
19
|
-
"@powerhousedao/general-document-indexer": "^1.3.10",
|
|
20
|
-
"@powerhousedao/reactor-api": "^1.5.2",
|
|
21
|
-
"@powerhousedao/scalars": "^1.9.0",
|
|
22
19
|
"change-case": "^5.4.4",
|
|
23
20
|
"commander": "^12.1.0",
|
|
24
|
-
"document-model": "^2.7.0",
|
|
25
|
-
"document-model-libs": "^1.115.0",
|
|
26
21
|
"dotenv": "^16.4.5",
|
|
27
22
|
"drizzle-kit": "^0.25.0",
|
|
28
23
|
"drizzle-orm": "^0.34.1",
|
|
@@ -36,7 +31,12 @@
|
|
|
36
31
|
"sanitize-filename": "^1.6.3",
|
|
37
32
|
"uuid": "^11.0.2",
|
|
38
33
|
"vite": "^5.4.11",
|
|
39
|
-
"vite-node": "^2.1.2"
|
|
34
|
+
"vite-node": "^2.1.2",
|
|
35
|
+
"@powerhousedao/general-document-indexer": "1.4.0",
|
|
36
|
+
"@powerhousedao/reactor-api": "1.6.0",
|
|
37
|
+
"document-model-libs": "1.117.0",
|
|
38
|
+
"document-model": "2.7.1",
|
|
39
|
+
"@powerhousedao/scalars": "1.9.0"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
42
|
"@types/body-parser": "^1.19.5",
|
|
@@ -45,14 +45,14 @@
|
|
|
45
45
|
"@types/ms": "^0.7.34",
|
|
46
46
|
"@types/node": "^22.7.5",
|
|
47
47
|
"@types/pg": "^8.11.10",
|
|
48
|
-
"document-drive": "^1.4.5",
|
|
49
48
|
"postcss": "^8.4.47",
|
|
50
49
|
"tsup": "^8.3.0",
|
|
51
50
|
"typescript": "^5.6.2",
|
|
52
|
-
"@powerhousedao/scalars": "
|
|
51
|
+
"@powerhousedao/scalars": "1.9.0",
|
|
52
|
+
"document-drive": "1.5.0"
|
|
53
53
|
},
|
|
54
54
|
"peerDependencies": {
|
|
55
|
-
"@powerhousedao/scalars": "
|
|
55
|
+
"@powerhousedao/scalars": "1.9.0"
|
|
56
56
|
},
|
|
57
57
|
"scripts": {
|
|
58
58
|
"start": "vite-node src/index.ts",
|
package/src/server.ts
CHANGED
|
@@ -2,7 +2,12 @@ import path from "node:path";
|
|
|
2
2
|
import { fileURLToPath } from "node:url";
|
|
3
3
|
import dotenv from "dotenv";
|
|
4
4
|
import { createServer as createViteServer } from "vite";
|
|
5
|
-
import {
|
|
5
|
+
import {
|
|
6
|
+
startAPI,
|
|
7
|
+
addSubgraph,
|
|
8
|
+
registerInternalListener,
|
|
9
|
+
createSchema,
|
|
10
|
+
} from "@powerhousedao/reactor-api";
|
|
6
11
|
import {
|
|
7
12
|
DocumentDriveServer,
|
|
8
13
|
DriveAlreadyExistsError,
|
|
@@ -58,7 +63,7 @@ export type LocalReactor = {
|
|
|
58
63
|
label: string;
|
|
59
64
|
block: boolean;
|
|
60
65
|
filter: ListenerFilter;
|
|
61
|
-
}
|
|
66
|
+
}
|
|
62
67
|
) => Promise<InternalTransmitter>;
|
|
63
68
|
};
|
|
64
69
|
|
|
@@ -68,7 +73,7 @@ const baseDocumentModels = [
|
|
|
68
73
|
] as DocumentModel[];
|
|
69
74
|
|
|
70
75
|
const startServer = async (
|
|
71
|
-
options?: StartServerOptions
|
|
76
|
+
options?: StartServerOptions
|
|
72
77
|
): Promise<LocalReactor> => {
|
|
73
78
|
const { port, storagePath, drive, dev } = {
|
|
74
79
|
...DefaultStartServerOptions,
|
|
@@ -79,7 +84,7 @@ const startServer = async (
|
|
|
79
84
|
// start document drive server with all available document models & filesystem storage
|
|
80
85
|
const driveServer = new DocumentDriveServer(
|
|
81
86
|
baseDocumentModels,
|
|
82
|
-
new FilesystemStorage(storagePath)
|
|
87
|
+
new FilesystemStorage(storagePath)
|
|
83
88
|
);
|
|
84
89
|
|
|
85
90
|
// init drive server
|
|
@@ -135,6 +140,32 @@ const startServer = async (
|
|
|
135
140
|
...baseDocumentModels,
|
|
136
141
|
...Object.values(localDMs),
|
|
137
142
|
]);
|
|
143
|
+
|
|
144
|
+
// load processors
|
|
145
|
+
const processorsPath = path.join(process.cwd(), "./processors");
|
|
146
|
+
console.log("Loading processors from", processorsPath);
|
|
147
|
+
const localProcessors = (await vite.ssrLoadModule(
|
|
148
|
+
processorsPath
|
|
149
|
+
)) as Record<string, any>;
|
|
150
|
+
|
|
151
|
+
for (const [name, processor] of Object.entries(localProcessors)) {
|
|
152
|
+
await Promise.all([
|
|
153
|
+
addSubgraph({
|
|
154
|
+
name,
|
|
155
|
+
getSchema: (driveServer) =>
|
|
156
|
+
createSchema(
|
|
157
|
+
driveServer,
|
|
158
|
+
processor.resolvers,
|
|
159
|
+
processor.typeDefs
|
|
160
|
+
),
|
|
161
|
+
}),
|
|
162
|
+
registerInternalListener({
|
|
163
|
+
name,
|
|
164
|
+
options: processor.options,
|
|
165
|
+
transmit: processor.transmit,
|
|
166
|
+
}),
|
|
167
|
+
]);
|
|
168
|
+
}
|
|
138
169
|
}
|
|
139
170
|
} catch (e) {
|
|
140
171
|
console.error("App crashed", e);
|
|
@@ -153,7 +184,7 @@ const startServer = async (
|
|
|
153
184
|
label: string;
|
|
154
185
|
block: boolean;
|
|
155
186
|
filter: ListenerFilter;
|
|
156
|
-
}
|
|
187
|
+
}
|
|
157
188
|
) => driveServer.addInternalListener(driveId, receiver, options),
|
|
158
189
|
};
|
|
159
190
|
};
|