@powerhousedao/reactor-local 5.0.3 → 5.0.5
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/src/server.d.ts.map +1 -1
- package/dist/src/server.js +16 -10
- package/dist/src/server.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +8 -8
package/dist/src/server.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../src/server.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../src/server.ts"],"names":[],"mappings":"AA2BA,OAAO,KAAK,EACV,YAAY,EAEZ,kBAAkB,EACnB,MAAM,YAAY,CAAC;AAgDpB,QAAA,MAAM,WAAW,GACf,UAAU,kBAAkB,KAC3B,OAAO,CAAC,YAAY,CAqItB,CAAC;AAEF,OAAO,EAAE,WAAW,EAAE,CAAC"}
|
package/dist/src/server.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { isLogLevel } from "@powerhousedao/config";
|
|
2
|
-
import { EventBus,
|
|
2
|
+
import { EventBus, ReactorBuilder, ReactorClientBuilder, } from "@powerhousedao/reactor";
|
|
3
3
|
import { VitePackageLoader, startAPI, startViteServer, } from "@powerhousedao/reactor-api";
|
|
4
|
-
import { InMemoryCache, ReactorBuilder, logger } from "document-drive";
|
|
4
|
+
import { InMemoryCache, ReactorBuilder as LegacyReactorBuilder, logger, } from "document-drive";
|
|
5
5
|
import dotenv from "dotenv";
|
|
6
6
|
import path from "node:path";
|
|
7
7
|
import { isDualActionCreateEnabled, isReactorv2Enabled, } from "./feature-flags.js";
|
|
@@ -57,12 +57,12 @@ const startServer = async (options) => {
|
|
|
57
57
|
// be aware: this may not log anything if the log level is above debug
|
|
58
58
|
logger.debug(`Setting log level to ${logLevel}.`);
|
|
59
59
|
const serverPort = Number(process.env.PORT ?? port);
|
|
60
|
+
// TODO get path from powerhouse config
|
|
61
|
+
const basePath = process.cwd();
|
|
60
62
|
// start vite server if dev
|
|
61
|
-
const vite = dev ? await startViteServer() : undefined;
|
|
63
|
+
const vite = dev ? await startViteServer(basePath) : undefined;
|
|
62
64
|
// get paths to local document models
|
|
63
65
|
if (dev) {
|
|
64
|
-
// TODO get path from powerhouse config
|
|
65
|
-
const basePath = process.cwd();
|
|
66
66
|
packages.push(basePath);
|
|
67
67
|
}
|
|
68
68
|
const dualActionCreateEnabled = await isDualActionCreateEnabled();
|
|
@@ -70,7 +70,7 @@ const startServer = async (options) => {
|
|
|
70
70
|
// create document drive server with all available document models & storage
|
|
71
71
|
const cache = new InMemoryCache();
|
|
72
72
|
const storageImpl = createStorage(storage, cache);
|
|
73
|
-
const reactorBuilder = new
|
|
73
|
+
const reactorBuilder = new LegacyReactorBuilder([])
|
|
74
74
|
.withCache(cache)
|
|
75
75
|
.withStorage(storageImpl)
|
|
76
76
|
.withOptions({
|
|
@@ -80,16 +80,22 @@ const startServer = async (options) => {
|
|
|
80
80
|
});
|
|
81
81
|
const driveServer = reactorBuilder.build();
|
|
82
82
|
const eventBus = new EventBus();
|
|
83
|
-
const
|
|
84
|
-
|
|
85
|
-
|
|
83
|
+
const builder = new ReactorBuilder()
|
|
84
|
+
.withEventBus(eventBus)
|
|
85
|
+
.withLegacyStorage(storageImpl)
|
|
86
|
+
.withFeatures({
|
|
87
|
+
legacyStorageEnabled: true,
|
|
88
|
+
});
|
|
89
|
+
const client = await new ReactorClientBuilder()
|
|
90
|
+
.withReactorBuilder(builder)
|
|
91
|
+
.build();
|
|
86
92
|
// init drive server + conditionally add a default drive
|
|
87
93
|
await driveServer.initialize();
|
|
88
94
|
const driveUrl = options?.disableDefaultDrive
|
|
89
95
|
? null
|
|
90
96
|
: await addDefaultDrive(driveServer, drive, serverPort);
|
|
91
97
|
// create loader
|
|
92
|
-
const packageLoader = vite ?
|
|
98
|
+
const packageLoader = vite ? VitePackageLoader.build(vite) : undefined;
|
|
93
99
|
// start api
|
|
94
100
|
const api = await startAPI(driveServer, client, {
|
|
95
101
|
port: serverPort,
|
package/dist/src/server.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.js","sourceRoot":"","sources":["../../src/server.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACnD,OAAO,EACL,QAAQ,EACR,
|
|
1
|
+
{"version":3,"file":"server.js","sourceRoot":"","sources":["../../src/server.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACnD,OAAO,EACL,QAAQ,EACR,cAAc,EACd,oBAAoB,GACrB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACL,iBAAiB,EACjB,QAAQ,EACR,eAAe,GAChB,MAAM,4BAA4B,CAAC;AAMpC,OAAO,EACL,aAAa,EACb,cAAc,IAAI,oBAAoB,EACtC,MAAM,GACP,MAAM,gBAAgB,CAAC;AACxB,OAAO,MAAM,MAAM,QAAQ,CAAC;AAC5B,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EACL,yBAAyB,EACzB,kBAAkB,GACnB,MAAM,oBAAoB,CAAC;AAM5B,OAAO,EAAE,yBAAyB,EAAE,MAAM,YAAY,CAAC;AACvD,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAE3D,MAAM,CAAC,MAAM,EAAE,CAAC;AAEhB;;;GAGG;AACH,SAAS,yBAAyB,CAChC,KAA6B;IAE7B,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;QAC9B,kDAAkD;QAClD,OAAO;YACL,GAAG,EAAE,KAAK;YACV,OAAO,EAAE;gBACP,WAAW,EAAE,QAAQ;gBACrB,gBAAgB,EAAE,IAAI;gBACtB,SAAS,EAAE;oBACT;wBACE,KAAK,EAAE,IAAI;wBACX,QAAQ,EAAE;4BACR,IAAI,EAAE,KAA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