@powerhousedao/reactor-local 1.19.2 → 1.20.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 +0 -16
- package/dist/{chunk-SSE53QY2.js → chunk-HCTWYIZG.js} +25 -15
- package/dist/{chunk-A6IAN643.js → chunk-JKUEBNSV.js} +959 -921
- package/dist/cli.js +2 -2
- package/dist/index.js +2 -2
- package/dist/packages.d.ts +2 -1
- package/dist/packages.js +1 -1
- package/dist/server.d.ts +55 -68
- package/dist/server.js +2 -2
- package/package.json +7 -7
- package/src/packages.ts +29 -16
package/CHANGELOG.md
CHANGED
|
@@ -1,19 +1,3 @@
|
|
|
1
|
-
## 1.19.2 (2025-02-10)
|
|
2
|
-
|
|
3
|
-
### 🚀 Features
|
|
4
|
-
|
|
5
|
-
- **design-system:** add danger zone settings page ([572345bc](https://github.com/powerhouse-inc/powerhouse/commit/572345bc))
|
|
6
|
-
|
|
7
|
-
### 🧱 Updated Dependencies
|
|
8
|
-
|
|
9
|
-
- Updated document-model-libs to 1.131.2
|
|
10
|
-
- Updated document-drive to 1.17.2
|
|
11
|
-
- Updated @powerhousedao/reactor-api to 1.20.2
|
|
12
|
-
|
|
13
|
-
### ❤️ Thank You
|
|
14
|
-
|
|
15
|
-
- ryanwolhuter @ryanwolhuter
|
|
16
|
-
|
|
17
1
|
## 1.1.0 (2024-10-29)
|
|
18
2
|
|
|
19
3
|
### 🚀 Features
|
|
@@ -56,7 +56,7 @@ async function loadPackagesDocumentModels(packages) {
|
|
|
56
56
|
const loadedPackages = /* @__PURE__ */ new Map();
|
|
57
57
|
for (const pkg of packages) {
|
|
58
58
|
try {
|
|
59
|
-
console.log("> Loading package", pkg);
|
|
59
|
+
console.log("> Loading package:", pkg);
|
|
60
60
|
const pkgModule = await loadDependency(pkg, "./document-models");
|
|
61
61
|
if (pkgModule) {
|
|
62
62
|
console.log(` \u279C Loaded package: ${pkg}`);
|
|
@@ -85,37 +85,47 @@ var PackagesManager = class {
|
|
|
85
85
|
this.onError = onError;
|
|
86
86
|
this.eventEmitter.setMaxListeners(0);
|
|
87
87
|
if ("packages" in options) {
|
|
88
|
-
void this.
|
|
88
|
+
void this.loadPackages(options.packages).catch(onError);
|
|
89
89
|
} else if ("configFile" in options) {
|
|
90
|
-
void this.initConfigFile(options.configFile)
|
|
90
|
+
void this.initConfigFile(options.configFile).catch(onError);
|
|
91
91
|
}
|
|
92
92
|
}
|
|
93
93
|
packagesMap = /* @__PURE__ */ new Map();
|
|
94
|
+
configWatcher;
|
|
94
95
|
eventEmitter = new EventEmitter();
|
|
95
|
-
async
|
|
96
|
+
async loadPackages(packages) {
|
|
96
97
|
const packagesMap = await loadPackagesDocumentModels(packages);
|
|
97
98
|
this.updatePackagesMap(packagesMap);
|
|
98
99
|
}
|
|
99
100
|
loadFromConfigFile(configFile) {
|
|
100
101
|
const config = getConfig(configFile);
|
|
101
102
|
const packages = config.packages;
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
);
|
|
106
|
-
}
|
|
103
|
+
return this.loadPackages(
|
|
104
|
+
packages?.map((pkg) => pkg.packageName) ?? []
|
|
105
|
+
).catch(this.onError);
|
|
107
106
|
}
|
|
108
107
|
initConfigFile(configFile) {
|
|
109
108
|
const result = this.loadFromConfigFile(configFile);
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
109
|
+
if (!this.configWatcher) {
|
|
110
|
+
this.configWatcher = watchFile(
|
|
111
|
+
configFile,
|
|
112
|
+
{ interval: 100 },
|
|
113
|
+
(curr, prev) => {
|
|
114
|
+
if (curr.mtime === prev.mtime) {
|
|
115
|
+
return;
|
|
116
|
+
}
|
|
117
|
+
void this.loadFromConfigFile(configFile).catch(this.onError);
|
|
118
|
+
}
|
|
119
|
+
);
|
|
120
|
+
}
|
|
116
121
|
return result;
|
|
117
122
|
}
|
|
118
123
|
updatePackagesMap(packagesMap) {
|
|
124
|
+
const oldPackages = Array.from(this.packagesMap.keys());
|
|
125
|
+
const newPackages = Array.from(packagesMap.keys());
|
|
126
|
+
oldPackages.filter((pkg) => !newPackages.includes(pkg)).forEach((pkg) => {
|
|
127
|
+
console.log("> Removed package:", pkg);
|
|
128
|
+
});
|
|
119
129
|
this.packagesMap = packagesMap;
|
|
120
130
|
const documentModels = getUniqueDocumentModels(
|
|
121
131
|
...Array.from(packagesMap.values())
|