grafast 0.1.1-beta.2 → 0.1.1-beta.21
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/README.md +2 -3
- package/dist/args.d.ts +4 -7
- package/dist/args.js +53 -38
- package/dist/assert.js +2 -3
- package/dist/bucket.d.ts +1 -89
- package/dist/config.d.ts +0 -17
- package/dist/config.js +1 -95
- package/dist/constraints.d.ts +15 -1
- package/dist/constraints.js +41 -3
- package/dist/deferred.js +1 -2
- package/dist/dev.d.ts +1 -4
- package/dist/dev.js +18 -3
- package/dist/engine/LayerPlan.d.ts +21 -111
- package/dist/engine/LayerPlan.js +196 -78
- package/dist/engine/OperationPlan.d.ts +30 -104
- package/dist/engine/OperationPlan.js +763 -471
- package/dist/engine/OutputPlan.d.ts +9 -20
- package/dist/engine/OutputPlan.js +432 -444
- package/dist/engine/StepTracker.d.ts +1 -95
- package/dist/engine/StepTracker.js +94 -20
- package/dist/engine/executeBucket.d.ts +5 -7
- package/dist/engine/executeBucket.js +646 -244
- package/dist/engine/executeOutputPlan.d.ts +0 -53
- package/dist/engine/executeOutputPlan.js +7 -2
- package/dist/engine/lib/defaultPlanResolver.d.ts +6 -0
- package/dist/engine/lib/defaultPlanResolver.js +11 -0
- package/dist/engine/lib/withGlobalLayerPlan.d.ts +2 -0
- package/dist/engine/lib/withGlobalLayerPlan.js +7 -4
- package/dist/engine/lock.d.ts +4 -0
- package/dist/engine/lock.js +82 -0
- package/dist/envelop.js +5 -4
- package/dist/error.d.ts +18 -49
- package/dist/error.js +50 -39
- package/dist/establishOperationPlan.js +57 -42
- package/dist/execute.d.ts +5 -4
- package/dist/execute.js +31 -15
- package/dist/exportAs.d.ts +1 -18
- package/dist/exportAs.js +2 -3
- package/dist/global.js +2 -3
- package/dist/grafastGraphql.d.ts +6 -1
- package/dist/grafastGraphql.js +35 -16
- package/dist/grafastPrint.d.ts +3 -0
- package/dist/grafastPrint.js +67 -6
- package/dist/graphqlCollectFields.d.ts +7 -34
- package/dist/graphqlCollectFields.js +24 -13
- package/dist/graphqlMergeSelectionSets.js +1 -2
- package/dist/index.d.ts +44 -29
- package/dist/index.js +91 -18
- package/dist/input.d.ts +1 -9
- package/dist/input.js +75 -28
- package/dist/inspect.d.ts +9 -3
- package/dist/inspect.js +3 -3
- package/dist/interfaces.d.ts +238 -93
- package/dist/interfaces.js +20 -3
- package/dist/makeGrafastSchema.d.ts +21 -9
- package/dist/makeGrafastSchema.js +353 -133
- package/dist/mermaid.d.ts +0 -17
- package/dist/mermaid.js +131 -19
- package/dist/middleware.d.ts +7 -0
- package/dist/middleware.js +24 -0
- package/dist/multistep.d.ts +19 -0
- package/dist/multistep.js +54 -0
- package/dist/operationPlan-input.d.ts +5 -4
- package/dist/operationPlan-input.js +140 -368
- package/dist/planJSONInterfaces.d.ts +12 -2
- package/dist/polymorphic.js +4 -5
- package/dist/prepare.d.ts +1 -7
- package/dist/prepare.js +100 -74
- package/dist/step.d.ts +118 -172
- package/dist/step.js +262 -183
- package/dist/steps/__flag.d.ts +65 -0
- package/dist/steps/__flag.js +261 -0
- package/dist/steps/__inputDefault.d.ts +14 -0
- package/dist/steps/__inputDefault.js +48 -0
- package/dist/steps/__inputDynamicScalar.d.ts +4 -6
- package/dist/steps/__inputDynamicScalar.js +4 -2
- package/dist/steps/__inputList.d.ts +5 -9
- package/dist/steps/__inputList.js +4 -1
- package/dist/steps/__inputObject.d.ts +7 -11
- package/dist/steps/__inputObject.js +49 -3
- package/dist/steps/__inputStaticLeaf.d.ts +2 -4
- package/dist/steps/__inputStaticLeaf.js +3 -1
- package/dist/steps/__item.d.ts +10 -12
- package/dist/steps/__item.js +8 -2
- package/dist/steps/__trackedValue.d.ts +7 -55
- package/dist/steps/__trackedValue.js +69 -8
- package/dist/steps/__value.d.ts +5 -4
- package/dist/steps/__value.js +5 -4
- package/dist/steps/access.d.ts +10 -10
- package/dist/steps/access.js +50 -17
- package/dist/steps/applyInput.d.ts +44 -0
- package/dist/steps/applyInput.js +206 -0
- package/dist/steps/applyTransforms.d.ts +2 -25
- package/dist/steps/applyTransforms.js +53 -31
- package/dist/steps/bakedInput.d.ts +23 -0
- package/dist/steps/bakedInput.js +90 -0
- package/dist/steps/condition.d.ts +31 -0
- package/dist/steps/condition.js +94 -0
- package/dist/steps/connection.d.ts +56 -42
- package/dist/steps/connection.js +97 -44
- package/dist/steps/constant.d.ts +7 -7
- package/dist/steps/constant.js +86 -7
- package/dist/steps/each.d.ts +3 -3
- package/dist/steps/each.js +2 -3
- package/dist/steps/error.d.ts +4 -4
- package/dist/steps/error.js +7 -6
- package/dist/steps/filter.d.ts +3 -2
- package/dist/steps/filter.js +1 -2
- package/dist/steps/first.d.ts +10 -9
- package/dist/steps/first.js +9 -13
- package/dist/steps/graphqlResolver.d.ts +3 -76
- package/dist/steps/graphqlResolver.js +89 -72
- package/dist/steps/groupBy.d.ts +3 -2
- package/dist/steps/groupBy.js +1 -2
- package/dist/steps/index.d.ts +12 -3
- package/dist/steps/index.js +48 -6
- package/dist/steps/lambda.d.ts +9 -9
- package/dist/steps/lambda.js +18 -9
- package/dist/steps/last.d.ts +9 -8
- package/dist/steps/last.js +7 -6
- package/dist/steps/list.d.ts +20 -9
- package/dist/steps/list.js +56 -13
- package/dist/steps/listTransform.d.ts +18 -22
- package/dist/steps/listTransform.js +58 -27
- package/dist/steps/listen.d.ts +6 -11
- package/dist/steps/listen.js +14 -16
- package/dist/steps/load.d.ts +42 -33
- package/dist/steps/load.js +60 -27
- package/dist/steps/node.d.ts +17 -10
- package/dist/steps/node.js +18 -6
- package/dist/steps/object.d.ts +33 -27
- package/dist/steps/object.js +53 -32
- package/dist/steps/partitionByIndex.d.ts +3 -2
- package/dist/steps/partitionByIndex.js +1 -2
- package/dist/steps/polymorphicBranch.d.ts +27 -0
- package/dist/steps/polymorphicBranch.js +62 -0
- package/dist/steps/proxy.d.ts +11 -12
- package/dist/steps/proxy.js +8 -5
- package/dist/steps/remapKeys.d.ts +10 -10
- package/dist/steps/remapKeys.js +14 -7
- package/dist/steps/reverse.d.ts +8 -8
- package/dist/steps/reverse.js +10 -7
- package/dist/steps/setter.d.ts +9 -18
- package/dist/steps/setter.js +24 -14
- package/dist/steps/sideEffect.d.ts +28 -0
- package/dist/steps/sideEffect.js +44 -0
- package/dist/stringifyPayload.js +1 -2
- package/dist/stripAnsi.js +2 -2
- package/dist/subscribe.d.ts +7 -1
- package/dist/subscribe.js +24 -9
- package/dist/thereCanBeOnlyOne.js +1 -1
- package/dist/timeSource.d.ts +0 -1
- package/dist/utils.d.ts +56 -55
- package/dist/utils.js +179 -59
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +5 -8
|
@@ -1,96 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
import type { ExecutableStep } from "../step";
|
|
3
|
-
import type { LayerPlan, LayerPlanReasonsWithParentStep } from "./LayerPlan";
|
|
4
|
-
import type { OutputPlan } from "./OutputPlan";
|
|
5
|
-
/**
|
|
6
|
-
* This class keeps track of all of our steps, and the dependencies between
|
|
7
|
-
* steps and other steps, layer plans and steps, and output plans and steps.
|
|
8
|
-
*
|
|
9
|
-
* When a step is replaced by another step, all the dependencies are updated
|
|
10
|
-
* such that the replaced step simply evaporates.
|
|
11
|
-
*
|
|
12
|
-
* @internal
|
|
13
|
-
*/
|
|
14
|
-
export declare class StepTracker {
|
|
15
|
-
private readonly operationPlan;
|
|
16
|
-
/** @internal */
|
|
17
|
-
stepCount: number;
|
|
18
|
-
/** @internal */
|
|
19
|
-
activeSteps: Set<ExecutableStep<any>>;
|
|
20
|
-
/** @internal */
|
|
21
|
-
stepById: {
|
|
22
|
-
[stepId: number]: ExecutableStep | null;
|
|
23
|
-
};
|
|
24
|
-
/** @internal */
|
|
25
|
-
private aliasesById;
|
|
26
|
-
/** @internal */
|
|
27
|
-
stepsWithNoDependencies: Set<ExecutableStep<any>>;
|
|
28
|
-
/** @internal */
|
|
29
|
-
outputPlansByRootStep: Map<ExecutableStep<any>, Set<OutputPlan<import("./OutputPlan").OutputPlanType>>>;
|
|
30
|
-
/** @internal */
|
|
31
|
-
layerPlansByRootStep: Map<ExecutableStep<any>, Set<LayerPlan<import("./LayerPlan").LayerPlanReason>>>;
|
|
32
|
-
/** @internal */
|
|
33
|
-
layerPlansByParentStep: Map<ExecutableStep<any>, Set<LayerPlan<LayerPlanReasonsWithParentStep>>>;
|
|
34
|
-
/** @internal */
|
|
35
|
-
layerPlans: Array<LayerPlan | null>;
|
|
36
|
-
/**
|
|
37
|
-
* All the OutputPlans that were created to allow a more efficient
|
|
38
|
-
* walkOutputPlans implementation.
|
|
39
|
-
*
|
|
40
|
-
* @internal
|
|
41
|
-
*/
|
|
42
|
-
allOutputPlans: OutputPlan[];
|
|
43
|
-
nextStepIdToDeduplicate: number;
|
|
44
|
-
constructor(operationPlan: OperationPlan);
|
|
45
|
-
newStepsSince(oldStepCount: number): ExecutableStep<any>[];
|
|
46
|
-
private forbid;
|
|
47
|
-
/** Called when OperationPlan enters finalize phase. */
|
|
48
|
-
finalizeSteps(): void;
|
|
49
|
-
/** Called when OperationPlan is about to finalize the output plans. */
|
|
50
|
-
finalizeOutputPlans(): void;
|
|
51
|
-
addStep($step: ExecutableStep): number;
|
|
52
|
-
/**
|
|
53
|
-
* @internal
|
|
54
|
-
*/
|
|
55
|
-
addLayerPlan(layerPlan: LayerPlan): number;
|
|
56
|
-
/**
|
|
57
|
-
* @internal
|
|
58
|
-
*/
|
|
59
|
-
addOutputPlan(outputPlan: OutputPlan): void;
|
|
60
|
-
/**
|
|
61
|
-
* HIGHLY EXPERIMENTAL!
|
|
62
|
-
*
|
|
63
|
-
* @internal
|
|
64
|
-
*/
|
|
65
|
-
deleteLayerPlan(layerPlan: LayerPlan): void;
|
|
66
|
-
getStepById(id: number): ExecutableStep;
|
|
67
|
-
getStepById(id: number, allowUnset: true): ExecutableStep | null;
|
|
68
|
-
addStepDependency($dependent: ExecutableStep, $dependency: ExecutableStep): number;
|
|
69
|
-
setOutputPlanRootStep(outputPlan: OutputPlan, $dependency: ExecutableStep): void;
|
|
70
|
-
setLayerPlanRootStep(layerPlan: LayerPlan, $dependency: ExecutableStep): void;
|
|
71
|
-
/** @internal */
|
|
72
|
-
replaceStep($original: ExecutableStep, $replacement: ExecutableStep): void;
|
|
73
|
-
treeShakeSteps(): void;
|
|
74
|
-
/**
|
|
75
|
-
* Return true if this step can be tree-shaken.
|
|
76
|
-
*/
|
|
77
|
-
private isNotNeeded;
|
|
78
|
-
/**
|
|
79
|
-
* Only for use during planField.
|
|
80
|
-
*/
|
|
81
|
-
purgeBackTo(count: number): void;
|
|
82
|
-
/**
|
|
83
|
-
* ONLY CALL THIS IF NOTHING DEPENDS ON $original! It's intended to be called
|
|
84
|
-
* from `replaceStep` or from itself.
|
|
85
|
-
*
|
|
86
|
-
* This method removes $original from the various maps/sets/lists, and also
|
|
87
|
-
* removes the fact that it was dependent on other steps. If these other
|
|
88
|
-
* steps no longer have any dependents (steps, layer plans or output plans)
|
|
89
|
-
* then they can also be eradicated _except_ during the 'plan' phase.
|
|
90
|
-
*/
|
|
91
|
-
private eradicate;
|
|
92
|
-
moveStepToLayerPlan(step: ExecutableStep, targetLayerPlan: LayerPlan): void;
|
|
93
|
-
addStepToItsLayerPlan(step: ExecutableStep): void;
|
|
94
|
-
removeStepFromItsLayerPlan(step: ExecutableStep): void;
|
|
95
|
-
}
|
|
1
|
+
export {};
|
|
96
2
|
//# sourceMappingURL=StepTracker.d.ts.map
|
|
@@ -2,17 +2,11 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.StepTracker = void 0;
|
|
4
4
|
const dev_js_1 = require("../dev.js");
|
|
5
|
+
const inspect_js_1 = require("../inspect.js");
|
|
5
6
|
const interfaces_js_1 = require("../interfaces.js");
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
* writeable for this.
|
|
10
|
-
*
|
|
11
|
-
* @internal
|
|
12
|
-
*/
|
|
13
|
-
function writeableArray(a) {
|
|
14
|
-
return a;
|
|
15
|
-
}
|
|
7
|
+
const step_js_1 = require("../step.js");
|
|
8
|
+
const utils_js_1 = require("../utils.js");
|
|
9
|
+
const lock_js_1 = require("./lock.js");
|
|
16
10
|
/**
|
|
17
11
|
* This class keeps track of all of our steps, and the dependencies between
|
|
18
12
|
* steps and other steps, layer plans and steps, and output plans and steps.
|
|
@@ -28,13 +22,17 @@ class StepTracker {
|
|
|
28
22
|
/** @internal */
|
|
29
23
|
this.stepCount = 0;
|
|
30
24
|
/** @internal */
|
|
25
|
+
this.lockedStepCount = 0;
|
|
26
|
+
/** @internal */
|
|
31
27
|
this.activeSteps = new Set();
|
|
32
28
|
/** @internal */
|
|
33
29
|
this.stepById = [];
|
|
34
30
|
/** @internal */
|
|
35
31
|
this.aliasesById = [];
|
|
36
32
|
/** @internal */
|
|
37
|
-
this.
|
|
33
|
+
this.stepsWithNoDependenciesByConstructor = new Map();
|
|
34
|
+
/** @internal */
|
|
35
|
+
this.internalDependencies = new Set();
|
|
38
36
|
/** @internal */
|
|
39
37
|
this.outputPlansByRootStep = new Map();
|
|
40
38
|
/** @internal */
|
|
@@ -77,7 +75,13 @@ class StepTracker {
|
|
|
77
75
|
addStep($step) {
|
|
78
76
|
const stepId = this.stepCount++;
|
|
79
77
|
this.activeSteps.add($step);
|
|
80
|
-
|
|
78
|
+
const ctor = $step.constructor;
|
|
79
|
+
let stepsWithNoDependencies = this.stepsWithNoDependenciesByConstructor.get(ctor);
|
|
80
|
+
if (!stepsWithNoDependencies) {
|
|
81
|
+
stepsWithNoDependencies ??= new Set();
|
|
82
|
+
this.stepsWithNoDependenciesByConstructor.set(ctor, stepsWithNoDependencies);
|
|
83
|
+
}
|
|
84
|
+
stepsWithNoDependencies.add($step);
|
|
81
85
|
this.stepById[stepId] = $step;
|
|
82
86
|
this.aliasesById[stepId] = undefined;
|
|
83
87
|
this.addStepToItsLayerPlan($step);
|
|
@@ -212,21 +216,72 @@ class StepTracker {
|
|
|
212
216
|
}
|
|
213
217
|
return step;
|
|
214
218
|
}
|
|
215
|
-
addStepDependency($dependent,
|
|
219
|
+
addStepDependency(raw$dependent, options) {
|
|
220
|
+
const $dependent = (0, utils_js_1.sudo)(raw$dependent);
|
|
221
|
+
const $dependency = (0, utils_js_1.sudo)(options.step);
|
|
216
222
|
if (!this.activeSteps.has($dependent)) {
|
|
217
223
|
throw new Error(`Cannot add ${$dependency} as a dependency of ${$dependent}; the latter is deleted!`);
|
|
218
224
|
}
|
|
219
225
|
if (!this.activeSteps.has($dependency)) {
|
|
220
226
|
throw new Error(`Cannot add ${$dependency} as a dependency of ${$dependent}; the former is deleted!`);
|
|
221
227
|
}
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
228
|
+
if ($dependent.isFinalized) {
|
|
229
|
+
throw new Error("You cannot add a dependency after the step is finalized.");
|
|
230
|
+
}
|
|
231
|
+
if (!($dependency instanceof step_js_1.Step)) {
|
|
232
|
+
throw new Error(`Error occurred when adding dependency for '${$dependent}', value passed was not a step, it was '${(0, inspect_js_1.inspect)($dependency)}'`);
|
|
233
|
+
}
|
|
234
|
+
if (dev_js_1.isDev) {
|
|
235
|
+
// Check that we can actually add this as a dependency
|
|
236
|
+
if (!$dependent.layerPlan.ancestry.includes($dependency.layerPlan)) {
|
|
237
|
+
throw new Error(
|
|
238
|
+
//console.error(
|
|
239
|
+
// This is not a GrafastInternalError
|
|
240
|
+
`Attempted to add '${$dependency}' (${$dependency.layerPlan}) as a dependency of '${$dependent}' (${$dependent.layerPlan}), but we cannot because that LayerPlan isn't an ancestor`);
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
const dependentDependencies = (0, utils_js_1.writeableArray)($dependent.dependencies);
|
|
244
|
+
const dependentDependencyForbiddenFlags = (0, utils_js_1.writeableArray)($dependent.dependencyForbiddenFlags);
|
|
245
|
+
const dependentDependencyOnReject = (0, utils_js_1.writeableArray)($dependent.dependencyOnReject);
|
|
246
|
+
const { skipDeduplication, acceptFlags = interfaces_js_1.ALL_FLAGS & ~$dependent.defaultForbiddenFlags, onReject, } = options;
|
|
247
|
+
// When copying dependencies between classes, we might not want to
|
|
248
|
+
// deduplicate because we might refer to the dependency by its index. As
|
|
249
|
+
// such, we should only dedupe by default but allow opting out.
|
|
250
|
+
// TODO: change this to `!skipDeduplication`
|
|
251
|
+
if (skipDeduplication === false) {
|
|
252
|
+
const existingIndex = dependentDependencies.indexOf($dependency);
|
|
253
|
+
if (existingIndex >= 0) {
|
|
254
|
+
return existingIndex;
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
if (!$dependency._isUnary && $dependent._isUnary) {
|
|
258
|
+
if ($dependent._isUnaryLocked) {
|
|
259
|
+
throw new Error(`Attempted to add non-unary step ${$dependency} as a dependency of ${$dependent}; but the latter is unary, so it cannot depend on batch steps`);
|
|
260
|
+
}
|
|
261
|
+
$dependent._isUnary = false;
|
|
262
|
+
}
|
|
263
|
+
const forbiddenFlags = interfaces_js_1.ALL_FLAGS & ~(acceptFlags & interfaces_js_1.TRAPPABLE_FLAGS);
|
|
264
|
+
this.stepsWithNoDependenciesByConstructor
|
|
265
|
+
.get($dependent.constructor)
|
|
266
|
+
?.delete($dependent);
|
|
267
|
+
const dependencyIndex = dependentDependencies.push($dependency) - 1;
|
|
268
|
+
dependentDependencyForbiddenFlags[dependencyIndex] = forbiddenFlags;
|
|
269
|
+
dependentDependencyOnReject[dependencyIndex] = onReject;
|
|
270
|
+
(0, utils_js_1.writeableArray)($dependency.dependents).push({
|
|
225
271
|
step: $dependent,
|
|
226
272
|
dependencyIndex,
|
|
227
273
|
});
|
|
228
274
|
return dependencyIndex;
|
|
229
275
|
}
|
|
276
|
+
addStepUnaryDependency($dependent, options) {
|
|
277
|
+
const $dependency = options.step;
|
|
278
|
+
if (!$dependency._isUnary) {
|
|
279
|
+
const { nonUnaryMessage = defaultNonUnaryMessage } = options;
|
|
280
|
+
throw new Error(nonUnaryMessage($dependent, $dependency));
|
|
281
|
+
}
|
|
282
|
+
$dependency._isUnaryLocked = true;
|
|
283
|
+
return this.addStepDependency($dependent, options);
|
|
284
|
+
}
|
|
230
285
|
setOutputPlanRootStep(outputPlan, $dependency) {
|
|
231
286
|
if (!this.activeSteps.has($dependency)) {
|
|
232
287
|
throw new Error(`Cannot add ${$dependency} to ${outputPlan} because it's deleted`);
|
|
@@ -307,9 +362,9 @@ class StepTracker {
|
|
|
307
362
|
// Transfer step dependents of $original to $replacement
|
|
308
363
|
const dependents = $original.dependents;
|
|
309
364
|
if (dependents.length > 0) {
|
|
310
|
-
const replacementDependents = writeableArray($replacement.dependents);
|
|
365
|
+
const replacementDependents = (0, utils_js_1.writeableArray)($replacement.dependents);
|
|
311
366
|
for (const dependent of dependents) {
|
|
312
|
-
writeableArray(dependent.step.dependencies)[dependent.dependencyIndex] = $replacement;
|
|
367
|
+
(0, utils_js_1.writeableArray)((0, utils_js_1.sudo)(dependent.step).dependencies)[dependent.dependencyIndex] = $replacement;
|
|
313
368
|
replacementDependents.push(dependent);
|
|
314
369
|
}
|
|
315
370
|
$original.dependents = [];
|
|
@@ -389,6 +444,9 @@ class StepTracker {
|
|
|
389
444
|
return false;
|
|
390
445
|
if ($step.hasSideEffects)
|
|
391
446
|
return false;
|
|
447
|
+
if (this.internalDependencies.has($step)) {
|
|
448
|
+
return false;
|
|
449
|
+
}
|
|
392
450
|
const s1 = this.outputPlansByRootStep.get($step);
|
|
393
451
|
if (s1 && s1.size !== 0)
|
|
394
452
|
return false;
|
|
@@ -456,7 +514,7 @@ class StepTracker {
|
|
|
456
514
|
this.stepById[$original.id] = null;
|
|
457
515
|
}
|
|
458
516
|
// Since this step is being removed, it doesn't need its dependencies any more
|
|
459
|
-
const oldDependencies = $original.dependencies;
|
|
517
|
+
const oldDependencies = (0, utils_js_1.sudo)($original).dependencies;
|
|
460
518
|
for (const $dependency of oldDependencies) {
|
|
461
519
|
// $dependency is no longer a dependent of $original, since we're getting
|
|
462
520
|
// rid of $original
|
|
@@ -494,7 +552,9 @@ class StepTracker {
|
|
|
494
552
|
]}`);
|
|
495
553
|
}
|
|
496
554
|
}
|
|
497
|
-
this.
|
|
555
|
+
this.stepsWithNoDependenciesByConstructor
|
|
556
|
+
.get($original.constructor)
|
|
557
|
+
?.delete($original);
|
|
498
558
|
this.outputPlansByRootStep.delete($original);
|
|
499
559
|
this.layerPlansByRootStep.delete($original);
|
|
500
560
|
this.layerPlansByParentStep.delete($original);
|
|
@@ -519,6 +579,20 @@ class StepTracker {
|
|
|
519
579
|
removeStepFromItsLayerPlan(step) {
|
|
520
580
|
step.layerPlan.stepsByConstructor.get(step.constructor).delete(step);
|
|
521
581
|
}
|
|
582
|
+
lockNewSteps() {
|
|
583
|
+
if (!dev_js_1.isDev)
|
|
584
|
+
return;
|
|
585
|
+
for (let i = this.lockedStepCount; i < this.stepCount; i++) {
|
|
586
|
+
const step = this.getStepById(i, true);
|
|
587
|
+
if (step && step.id === i) {
|
|
588
|
+
(0, lock_js_1.lock)(step);
|
|
589
|
+
}
|
|
590
|
+
}
|
|
591
|
+
this.lockedStepCount = this.stepCount;
|
|
592
|
+
}
|
|
522
593
|
}
|
|
523
594
|
exports.StepTracker = StepTracker;
|
|
595
|
+
function defaultNonUnaryMessage($dependent, $dependency) {
|
|
596
|
+
return `${$dependent} attempted to create a unary step dependency on ${$dependency}, but that step is not unary. See https://err.red/gud`;
|
|
597
|
+
}
|
|
524
598
|
//# sourceMappingURL=StepTracker.js.map
|
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
import type { Bucket
|
|
2
|
-
import type {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
export declare function
|
|
6
|
-
/** @internal */
|
|
7
|
-
export declare function newBucket(spec: Pick<Bucket, "layerPlan" | "store" | "size" | "hasErrors" | "polymorphicPathList" | "iterators">, parentMetaByMetaKey: MetaByMetaKey | null): Bucket;
|
|
1
|
+
import type { Bucket } from "../bucket.js";
|
|
2
|
+
import type { BatchExecutionValue, ExecutionEntryFlags, UnaryExecutionValue } from "../interfaces.js";
|
|
3
|
+
export declare function bucketToString(this: Bucket): string;
|
|
4
|
+
export declare function batchExecutionValue<TData>(entries: TData[], _flags?: ExecutionEntryFlags[]): BatchExecutionValue<TData>;
|
|
5
|
+
export declare function unaryExecutionValue<TData>(value: TData, _entryFlags?: ExecutionEntryFlags): UnaryExecutionValue<TData>;
|
|
8
6
|
//# sourceMappingURL=executeBucket.d.ts.map
|