@highstate/backend 0.7.10 → 0.8.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/dist/{chunk-TDCHA47F.js → chunk-JEOPTUKC.js} +2 -2
- package/dist/{chunk-TDCHA47F.js.map → chunk-JEOPTUKC.js.map} +1 -1
- package/dist/highstate.manifest.json +3 -3
- package/dist/index.js +23 -9
- package/dist/index.js.map +1 -1
- package/dist/shared/index.js +1 -1
- package/package.json +3 -3
- package/src/library/local.ts +2 -0
- package/src/orchestrator/operation-workset.ts +3 -1
- package/src/project/manager.ts +12 -4
- package/src/runner/local.ts +10 -4
- package/src/shared/resolvers/validation.ts +1 -1
package/dist/shared/index.js
CHANGED
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@highstate/backend",
|
3
|
-
"version": "0.
|
3
|
+
"version": "0.8.0",
|
4
4
|
"type": "module",
|
5
5
|
"files": [
|
6
6
|
"dist",
|
@@ -26,7 +26,7 @@
|
|
26
26
|
"build": "highstate build"
|
27
27
|
},
|
28
28
|
"dependencies": {
|
29
|
-
"@highstate/contract": "^0.
|
29
|
+
"@highstate/contract": "^0.8.0",
|
30
30
|
"@types/node": "^22.10.1",
|
31
31
|
"ajv": "^8.17.1",
|
32
32
|
"better-lock": "^3.2.0",
|
@@ -65,5 +65,5 @@
|
|
65
65
|
"rollup": "^4.28.1",
|
66
66
|
"typescript": "^5.7.2"
|
67
67
|
},
|
68
|
-
"gitHead": "
|
68
|
+
"gitHead": "8590eea089a016c9b4b797299fc94ddc9afe10ba"
|
69
69
|
}
|
package/src/library/local.ts
CHANGED
@@ -213,6 +213,8 @@ export class LocalLibraryBackend implements LibraryBackend {
|
|
213
213
|
private async reloadLibrary(): Promise<[LibraryModel, Worker]> {
|
214
214
|
this.logger.info("reloading library")
|
215
215
|
|
216
|
+
await this.ensureLibraryPackagesLoaded(this.libraryPackages, true)
|
217
|
+
|
216
218
|
this.worker = this.createLibraryWorker({
|
217
219
|
modulePaths: this.libraryPackages,
|
218
220
|
logLevel: "silent",
|
package/src/project/manager.ts
CHANGED
@@ -155,6 +155,8 @@ export class ProjectManager {
|
|
155
155
|
|
156
156
|
private async evaluateCompositeInstances(projectId: string, instanceIds: string[]) {
|
157
157
|
await this.projectLockManager.getLock(projectId).lockInstances(instanceIds, async () => {
|
158
|
+
this.logger.debug({ instanceIds }, "evaluating composite instances")
|
159
|
+
|
158
160
|
const [
|
159
161
|
{ instances, resolvedInputs, stateMap, resolveInputHash },
|
160
162
|
topLevelCompositeChildrenIds,
|
@@ -251,6 +253,11 @@ export class ProjectManager {
|
|
251
253
|
compositeInstances.length,
|
252
254
|
)
|
253
255
|
|
256
|
+
this.logger.debug(
|
257
|
+
{ compositeInstanceIds: compositeInstances.map(instance => instance.instance.id) },
|
258
|
+
"persisted composite instances",
|
259
|
+
)
|
260
|
+
|
254
261
|
await Promise.all(promises)
|
255
262
|
})
|
256
263
|
}
|
@@ -294,11 +301,12 @@ export class ProjectManager {
|
|
294
301
|
const resolvedUnits = await this.libraryBackend.getResolvedUnitSources([instance.type])
|
295
302
|
const resolvedUnit = resolvedUnits.find(unit => unit.unitType === instance.type)
|
296
303
|
|
297
|
-
if (
|
298
|
-
|
304
|
+
if (resolvedUnit) {
|
305
|
+
sourceHash = resolvedUnit.sourceHash
|
306
|
+
} else {
|
307
|
+
this.logger.warn(`resolved unit not found for type "%s"`, instance.type)
|
308
|
+
sourceHash = undefined
|
299
309
|
}
|
300
|
-
|
301
|
-
sourceHash = resolvedUnit.sourceHash
|
302
310
|
}
|
303
311
|
|
304
312
|
inputHashInputs.set(instance.id, {
|
package/src/runner/local.ts
CHANGED
@@ -254,14 +254,18 @@ export class LocalRunnerBackend implements RunnerBackend {
|
|
254
254
|
async stack => {
|
255
255
|
await this.setStackConfig(stack, configMap)
|
256
256
|
|
257
|
+
const summary = await stack.workspace.stack()
|
258
|
+
|
259
|
+
let currentResourceCount = 0
|
260
|
+
const initialTotalResourceCount = summary?.resourceCount ?? 0
|
261
|
+
|
257
262
|
this.updateState({
|
258
263
|
id: instanceId,
|
259
264
|
status: preview ? "previewing" : "updating",
|
260
|
-
currentResourceCount
|
261
|
-
totalResourceCount:
|
265
|
+
currentResourceCount,
|
266
|
+
totalResourceCount: initialTotalResourceCount,
|
262
267
|
})
|
263
268
|
|
264
|
-
let currentResourceCount = 0
|
265
269
|
let totalResourceCount = 0
|
266
270
|
|
267
271
|
await runWithRetryOnError(
|
@@ -279,7 +283,9 @@ export class LocalRunnerBackend implements RunnerBackend {
|
|
279
283
|
totalResourceCount,
|
280
284
|
)
|
281
285
|
|
282
|
-
|
286
|
+
if (totalResourceCount > initialTotalResourceCount) {
|
287
|
+
this.updateState({ id: instanceId, totalResourceCount })
|
288
|
+
}
|
283
289
|
return
|
284
290
|
}
|
285
291
|
|
@@ -45,7 +45,7 @@ export const createValidationResolver = defineGraphResolver<
|
|
45
45
|
},
|
46
46
|
|
47
47
|
process({ instance, component, resolvedInputs }, dependencies, logger) {
|
48
|
-
const ajv = new Ajv()
|
48
|
+
const ajv = new Ajv({ strict: false })
|
49
49
|
|
50
50
|
logger.debug({ instanceId: instance.id }, "validating instance")
|
51
51
|
|