@elyx-code/project-logic-tree 0.0.6709 → 0.0.6710
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/index.cjs +3 -3
- package/dist/index.js +15 -60
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -79955,11 +79955,11 @@ class Z extends qf {
|
|
|
79955
79955
|
// Sometimes when a change set is done, it contains entities that the project doesn't
|
|
79956
79956
|
// Here we remove any entities that are present in the change-set but not the project
|
|
79957
79957
|
discardOrphans() {
|
|
79958
|
-
|
|
79958
|
+
this.added[this.project.id] && (this.updatedIds.forEach((e) => {
|
|
79959
79959
|
const y = this.updated[e];
|
|
79960
79960
|
this.added[e] = y, delete this.updated[e];
|
|
79961
79961
|
}), this.removedIds.forEach((e) => {
|
|
79962
|
-
|
|
79962
|
+
this.remove(e);
|
|
79963
79963
|
}));
|
|
79964
79964
|
const i = [
|
|
79965
79965
|
...this.addedIds,
|
|
@@ -79971,7 +79971,7 @@ class Z extends qf {
|
|
|
79971
79971
|
(e) => !s.includes(e)
|
|
79972
79972
|
).forEach((e) => {
|
|
79973
79973
|
const y = this.get(e);
|
|
79974
|
-
|
|
79974
|
+
this.logger.warn(
|
|
79975
79975
|
`[discardOrphans] Entity ${y == null ? void 0 : y.type} with id "${e}" present in change-set but not in project. Removing from change-set.`
|
|
79976
79976
|
), this.remove(e);
|
|
79977
79977
|
}), this.added[this.project.id]) {
|
|
@@ -79996,16 +79996,14 @@ class Z extends qf {
|
|
|
79996
79996
|
}
|
|
79997
79997
|
}
|
|
79998
79998
|
async discardOrphansAsync(i = {}) {
|
|
79999
|
-
console.log("[discardOrphansAsync] start");
|
|
80000
79999
|
const n = Ke.from(i), s = this.project.toFlatIds();
|
|
80001
80000
|
if (this.added[this.project.id]) {
|
|
80002
|
-
console.log("[discardOrphansAsync] project is in added list, moving updated to added");
|
|
80003
80001
|
for (const m of this.updatedIds) {
|
|
80004
80002
|
const v = this.updated[m];
|
|
80005
80003
|
this.added[m] = v, delete this.updated[m], await n.tick();
|
|
80006
80004
|
}
|
|
80007
80005
|
for (const m of this.removedIds)
|
|
80008
|
-
|
|
80006
|
+
this.remove(m), await n.tick();
|
|
80009
80007
|
}
|
|
80010
80008
|
const c = [
|
|
80011
80009
|
...this.addedIds,
|
|
@@ -80017,7 +80015,7 @@ class Z extends qf {
|
|
|
80017
80015
|
);
|
|
80018
80016
|
for (const m of y) {
|
|
80019
80017
|
const v = this.get(m);
|
|
80020
|
-
|
|
80018
|
+
this.logger.warn(
|
|
80021
80019
|
`[discardOrphansAsync] Entity ${v == null ? void 0 : v.type} with id "${m}" present in change-set but not in project. Removing from change-set.`
|
|
80022
80020
|
), this.remove(m), await n.tick();
|
|
80023
80021
|
}
|
|
@@ -80103,9 +80101,9 @@ class Z extends qf {
|
|
|
80103
80101
|
`Change-set (${this.id}) is already closed or in the process of closing.`
|
|
80104
80102
|
), this;
|
|
80105
80103
|
const c = i.awaitBeforeClose ?? !0, e = i.awaitExternalPersist ?? !0;
|
|
80106
|
-
return this.startedClose || (this.startedClose = !0, c ? await this.beforeCloseAsync({ tracker: n }) : this.beforeCloseAsync({ tracker: n })), !this.isValid && this.self && !this.added[this.self.id] && !this.updated[this.self.id] && this.removed[this.self.id], await this.discardOrphansAsync({ tracker: n }), await this.sanitizeAsync({ tracker: n }), await this.recursiveCaptureUpstreamVersionsAsync({ tracker: n }), this.lockedVersions || (await this.captureAllChangesInVersionInstancesAsync({ tracker: n }), await this.recursiveCaptureUpstreamVersionsAsync({ tracker: n })), this.open = !1, this.isEmpty ? (
|
|
80104
|
+
return this.startedClose || (this.startedClose = !0, c ? await this.beforeCloseAsync({ tracker: n }) : this.beforeCloseAsync({ tracker: n })), !this.isValid && this.self && !this.added[this.self.id] && !this.updated[this.self.id] && this.removed[this.self.id], await this.discardOrphansAsync({ tracker: n }), await this.sanitizeAsync({ tracker: n }), await this.recursiveCaptureUpstreamVersionsAsync({ tracker: n }), this.lockedVersions || (await this.captureAllChangesInVersionInstancesAsync({ tracker: n }), await this.recursiveCaptureUpstreamVersionsAsync({ tracker: n })), this.open = !1, this.isEmpty ? (this.logger.warn(
|
|
80107
80105
|
`[ChangeSet.closeAsync] Empty change-set (${this.id}) discarded upon closing.`
|
|
80108
|
-
), this.dirty = !1, this.project.discardChangeSet(this),
|
|
80106
|
+
), this.dirty = !1, this.project.discardChangeSet(this), this.logger.log("[ChangeSet.closeAsync] Closing pending change-sets..."), this.project.closePersistChangeSetsSequentially(), this) : (this.project.emit(
|
|
80109
80107
|
Yt.CHANGE_SET_CLOSED_BEFORE_PERSIST,
|
|
80110
80108
|
this
|
|
80111
80109
|
), e ? s.persistType === "parallel" ? await this.project.persistChangeSetInParallel(this) : await this.project.persistChangeSetSequentially(this) : s.persistType === "parallel" ? this.project.persistChangeSetInParallel(this) : this.project.persistChangeSetSequentially(this), this.destroy(), this);
|
|
@@ -80249,9 +80247,9 @@ class Z extends qf {
|
|
|
80249
80247
|
`Change-set (${this.id}) is already closed or in the process of closing.`
|
|
80250
80248
|
), this;
|
|
80251
80249
|
if (this.startedClose || (this.startedClose = !0, this.beforeClose()), !this.isValid && this.self && !this.added[this.self.id] && !this.updated[this.self.id] && this.removed[this.self.id], this.discardOrphans(), this.sanitize(), this.captureAllChangesInVersionInstances(), this.lockedVersions || (this.recursiveCaptureUpstreamVersions(), this.captureAllChangesInVersionInstances()), this.open = !1, this.isEmpty)
|
|
80252
|
-
return
|
|
80250
|
+
return this.logger.warn(
|
|
80253
80251
|
`[ChangeSet.close] Empty change-set (${this.id}) discarded upon closing.`
|
|
80254
|
-
), this.project.discardChangeSet(this),
|
|
80252
|
+
), this.project.discardChangeSet(this), this.logger.log("[ChangeSet.close] Closing pending change-sets..."), this.project.closePersistChangeSetsSequentially(), this;
|
|
80255
80253
|
if (this.added[this.project.id] && this.updatedIds.length)
|
|
80256
80254
|
throw new Error(
|
|
80257
80255
|
"No 'updated' entities should be present in the change-set when the project entity is in the 'added' list. New projects can only have newly added entities"
|
|
@@ -80284,7 +80282,7 @@ class Z extends qf {
|
|
|
80284
80282
|
return this.added[i] ? this.added[i] : this.updated[i] ? this.updated[i] : this.removed[i] ? this.removed[i] : null;
|
|
80285
80283
|
}
|
|
80286
80284
|
remove(i) {
|
|
80287
|
-
return this.has(i) && (
|
|
80285
|
+
return this.has(i) && (delete this.added[i], delete this.updated[i], delete this.removed[i], delete this.affected[i], this.seenEntities = this.seenEntities.filter((n) => n !== i)), this;
|
|
80288
80286
|
}
|
|
80289
80287
|
add(i, n, s = { preventRecursion: !1 }) {
|
|
80290
80288
|
var e, y, m;
|
|
@@ -151765,14 +151763,9 @@ const yi = class yi extends Gr {
|
|
|
151765
151763
|
return kf(i);
|
|
151766
151764
|
}
|
|
151767
151765
|
rehydrateQuery() {
|
|
151768
|
-
if (this.id === "ab70884f-49d9-4351-b92e-d71c0bc27fed")
|
|
151769
|
-
debugger;
|
|
151770
151766
|
if (!this.query)
|
|
151771
151767
|
return "";
|
|
151772
|
-
const i = kf(this.query)
|
|
151773
|
-
if (this.id === "ab70884f-49d9-4351-b92e-d71c0bc27fed")
|
|
151774
|
-
debugger;
|
|
151775
|
-
const n = ty.parse(i, {
|
|
151768
|
+
const i = kf(this.query), n = ty.parse(i, {
|
|
151776
151769
|
dialect: "sqlite",
|
|
151777
151770
|
// These are optional:
|
|
151778
151771
|
includeSpaces: !0
|
|
@@ -151780,27 +151773,12 @@ const yi = class yi extends Gr {
|
|
|
151780
151773
|
// includeNewlines: true, // Adds newlines
|
|
151781
151774
|
// includeComments: true, // Adds comments
|
|
151782
151775
|
// includeRange: true, // Adds source code location data
|
|
151783
|
-
})
|
|
151784
|
-
if (this.id === "ab70884f-49d9-4351-b92e-d71c0bc27fed")
|
|
151785
|
-
debugger;
|
|
151786
|
-
const s = gm(
|
|
151776
|
+
}), s = gm(
|
|
151787
151777
|
n,
|
|
151788
151778
|
this.project,
|
|
151789
151779
|
this
|
|
151790
151780
|
);
|
|
151791
|
-
|
|
151792
|
-
debugger;
|
|
151793
|
-
if (!s.state) {
|
|
151794
|
-
if (this.id === "ab70884f-49d9-4351-b92e-d71c0bc27fed")
|
|
151795
|
-
debugger;
|
|
151796
|
-
return "";
|
|
151797
|
-
}
|
|
151798
|
-
if (this.id === "ab70884f-49d9-4351-b92e-d71c0bc27fed")
|
|
151799
|
-
debugger;
|
|
151800
|
-
const c = kf(s.state.toQuery());
|
|
151801
|
-
if (this.id === "ab70884f-49d9-4351-b92e-d71c0bc27fed")
|
|
151802
|
-
debugger;
|
|
151803
|
-
return c;
|
|
151781
|
+
return s.state ? kf(s.state.toQuery()) : "";
|
|
151804
151782
|
}
|
|
151805
151783
|
onProjectInitialized(i, n = this.project.addChangeSet(
|
|
151806
151784
|
new Z(
|
|
@@ -152342,18 +152320,9 @@ You shouldn't have to manually update a 'parent' property. The equivalent result
|
|
|
152342
152320
|
removed: v
|
|
152343
152321
|
} = this.syncInputMaps(i);
|
|
152344
152322
|
if (n.push(...y), s.push(...m), c.push(...v), this.project.initialized) {
|
|
152345
|
-
if (this.id === "ab70884f-49d9-4351-b92e-d71c0bc27fed") {
|
|
152346
|
-
console.log("[afterAllChildrenInitialized] query sync");
|
|
152347
|
-
debugger;
|
|
152348
|
-
}
|
|
152349
152323
|
const b = this.rehydrateQuery();
|
|
152350
|
-
if (this.id === "ab70884f-49d9-4351-b92e-d71c0bc27fed") {
|
|
152351
|
-
console.log("[afterAllChildrenInitialized] query sync");
|
|
152352
|
-
debugger;
|
|
152353
|
-
}
|
|
152354
152324
|
this.metaSync({ query: b }, i), this.state = this.queryToState(), jG(this, this.state, i);
|
|
152355
|
-
}
|
|
152356
|
-
this.id === "ab70884f-49d9-4351-b92e-d71c0bc27fed" && console.log("[afterAllChildrenInitialized] skipping query sync");
|
|
152325
|
+
}
|
|
152357
152326
|
return this.inputs.sort(
|
|
152358
152327
|
(b, E) => {
|
|
152359
152328
|
var w, V;
|
|
@@ -153611,21 +153580,7 @@ I(yi, "repository", {
|
|
|
153611
153580
|
},
|
|
153612
153581
|
APILoad: async (i, ...n) => null,
|
|
153613
153582
|
APILoadVersion: async (i, n, ...s) => null
|
|
153614
|
-
}),
|
|
153615
|
-
// return this._query;
|
|
153616
|
-
// }
|
|
153617
|
-
// set query(value: string) {
|
|
153618
|
-
// if (this.query && !value) {
|
|
153619
|
-
// throw new Error(
|
|
153620
|
-
// '[SearchState set query] Test error for debugging. Original:\n' +
|
|
153621
|
-
// this.query +
|
|
153622
|
-
// '\nNew:\n' +
|
|
153623
|
-
// value
|
|
153624
|
-
// );
|
|
153625
|
-
// }
|
|
153626
|
-
// this._query = value;
|
|
153627
|
-
// }
|
|
153628
|
-
I(yi, "type", d.Search), I(yi, "USER_MANAGED_PARENT_TYPES", [
|
|
153583
|
+
}), I(yi, "type", d.Search), I(yi, "USER_MANAGED_PARENT_TYPES", [
|
|
153629
153584
|
...dr,
|
|
153630
153585
|
d.Project
|
|
153631
153586
|
]), I(yi, "PARENT_TYPES", [
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elyx-code/project-logic-tree",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.6710",
|
|
4
4
|
"author": "Sergio Herrero",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"description": "An installable module which contains the type definitions and ephemeral state management for a projects' logic tree data structure",
|