ttsc 0.32.0 → 0.32.1
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/lib/TtscCompiler.js +1 -1
- package/lib/TtscCompiler.js.map +1 -1
- package/lib/compiler/internal/ResidentCheckProcess.d.ts +74 -96
- package/lib/compiler/internal/ResidentCheckProcess.js +150 -335
- package/lib/compiler/internal/ResidentCheckProcess.js.map +1 -1
- package/lib/compiler/internal/ResidentCheckProcessHost.d.ts +127 -0
- package/lib/compiler/internal/ResidentCheckProcessHost.js +447 -0
- package/lib/compiler/internal/ResidentCheckProcessHost.js.map +1 -0
- package/lib/compiler/internal/ResidentCheckProcessProtocol.d.ts +64 -0
- package/lib/compiler/internal/ResidentCheckProcessProtocol.js +3 -0
- package/lib/compiler/internal/ResidentCheckProcessProtocol.js.map +1 -0
- package/lib/compiler/internal/build/BuildExecution.d.ts +103 -1
- package/lib/compiler/internal/build/BuildExecution.js +91 -11
- package/lib/compiler/internal/build/BuildExecution.js.map +1 -1
- package/lib/compiler/internal/build/ResidentCheckWatchSession.d.ts +16 -11
- package/lib/compiler/internal/build/ResidentCheckWatchSession.js +37 -21
- package/lib/compiler/internal/build/ResidentCheckWatchSession.js.map +1 -1
- package/lib/compiler/internal/build/RunBuildOptions.d.ts +6 -5
- package/lib/compiler/internal/build/WatchInputPublication.d.ts +59 -0
- package/lib/compiler/internal/build/WatchInputPublication.js +93 -0
- package/lib/compiler/internal/build/WatchInputPublication.js.map +1 -0
- package/lib/compiler/internal/build/runBuild.d.ts +29 -2
- package/lib/compiler/internal/build/runBuild.js +45 -19
- package/lib/compiler/internal/build/runBuild.js.map +1 -1
- package/lib/compiler/internal/buildNativeCompiler.d.ts +2 -0
- package/lib/compiler/internal/buildNativeCompiler.js +1 -0
- package/lib/compiler/internal/buildNativeCompiler.js.map +1 -1
- package/lib/compiler/internal/compileProjectInMemory.js +4 -2
- package/lib/compiler/internal/compileProjectInMemory.js.map +1 -1
- package/lib/compiler/internal/project/resolveOwningProjectConfig.d.ts +7 -2
- package/lib/compiler/internal/project/resolveOwningProjectConfig.js +6 -3
- package/lib/compiler/internal/project/resolveOwningProjectConfig.js.map +1 -1
- package/lib/compiler/internal/readEffectiveCompilerOptions.js +1 -1
- package/lib/compiler/internal/readEffectiveCompilerOptions.js.map +1 -1
- package/lib/compiler/internal/resolveBinary.d.ts +1 -0
- package/lib/compiler/internal/resolveBinary.js.map +1 -1
- package/lib/compiler/internal/resolveTsgo.d.ts +6 -0
- package/lib/compiler/internal/resolveTsgo.js.map +1 -1
- package/lib/compiler/internal/runSingleFileEmit.d.ts +28 -1
- package/lib/compiler/internal/runSingleFileEmit.js +120 -86
- package/lib/compiler/internal/runSingleFileEmit.js.map +1 -1
- package/lib/compiler/internal/startResidentTransform.js +8 -2
- package/lib/compiler/internal/startResidentTransform.js.map +1 -1
- package/lib/compiler/internal/transformProjectInMemory.js +11 -3
- package/lib/compiler/internal/transformProjectInMemory.js.map +1 -1
- package/lib/compiler/internal/transformProjectInWorker.d.ts +1 -1
- package/lib/compiler/internal/transformProjectInWorker.js +3 -2
- package/lib/compiler/internal/transformProjectInWorker.js.map +1 -1
- package/lib/internal/workerModuleUrl.d.ts +28 -0
- package/lib/internal/workerModuleUrl.js +40 -0
- package/lib/internal/workerModuleUrl.js.map +1 -0
- package/lib/launcher/internal/buildSingleRootProject.js +2 -1
- package/lib/launcher/internal/buildSingleRootProject.js.map +1 -1
- package/lib/launcher/internal/getCompilerVersionText.js +3 -2
- package/lib/launcher/internal/getCompilerVersionText.js.map +1 -1
- package/lib/launcher/internal/prepareExecution.js +2 -1
- package/lib/launcher/internal/prepareExecution.js.map +1 -1
- package/lib/launcher/internal/runTtsc.js +91 -41
- package/lib/launcher/internal/runTtsc.js.map +1 -1
- package/lib/launcher/internal/runtime/CommonJsRuntimeSource.d.ts +10 -6
- package/lib/launcher/internal/runtime/CommonJsRuntimeSource.js +11 -9
- package/lib/launcher/internal/runtime/CommonJsRuntimeSource.js.map +1 -1
- package/lib/launcher/internal/runtime/advertiseTypeScriptExtensions.d.ts +20 -0
- package/lib/launcher/internal/runtime/advertiseTypeScriptExtensions.js +27 -0
- package/lib/launcher/internal/runtime/advertiseTypeScriptExtensions.js.map +1 -0
- package/lib/launcher/internal/runtime/installRuntimeHooks.d.ts +5 -3
- package/lib/launcher/internal/runtime/installRuntimeHooks.js +7 -3
- package/lib/launcher/internal/runtime/installRuntimeHooks.js.map +1 -1
- package/lib/launcher/internal/watch/AsyncWatchTopology.d.ts +113 -0
- package/lib/launcher/internal/watch/AsyncWatchTopology.js +232 -0
- package/lib/launcher/internal/watch/AsyncWatchTopology.js.map +1 -0
- package/lib/launcher/internal/watch/WatchSettlement.d.ts +49 -0
- package/lib/launcher/internal/watch/WatchSettlement.js +70 -0
- package/lib/launcher/internal/watch/WatchSettlement.js.map +1 -0
- package/lib/launcher/internal/watch/WatchTopology.d.ts +29 -1
- package/lib/launcher/internal/watch/WatchTopology.js +86 -10
- package/lib/launcher/internal/watch/WatchTopology.js.map +1 -1
- package/lib/launcher/internal/watch/WatchTopologyWorkerProtocol.d.ts +121 -0
- package/lib/launcher/internal/watch/WatchTopologyWorkerProtocol.js +3 -0
- package/lib/launcher/internal/watch/WatchTopologyWorkerProtocol.js.map +1 -0
- package/lib/launcher/internal/watch/serveWatchTopologyWorker.d.ts +19 -0
- package/lib/launcher/internal/watch/serveWatchTopologyWorker.js +62 -0
- package/lib/launcher/internal/watch/serveWatchTopologyWorker.js.map +1 -0
- package/lib/launcher/internal/watch/watchTopologyWorker.d.ts +1 -0
- package/lib/launcher/internal/watch/watchTopologyWorker.js +22 -0
- package/lib/launcher/internal/watch/watchTopologyWorker.js.map +1 -0
- package/lib/plugin/CapabilityPluginResolver.d.ts +1 -1
- package/lib/plugin/CapabilityPluginResolver.js +3 -2
- package/lib/plugin/CapabilityPluginResolver.js.map +1 -1
- package/lib/plugin/internal/load/PluginDescriptorEvaluationCache.d.ts +15 -12
- package/lib/plugin/internal/load/PluginDescriptorEvaluationCache.js +13 -11
- package/lib/plugin/internal/load/PluginDescriptorEvaluationCache.js.map +1 -1
- package/lib/plugin/internal/load/PluginPackageResolution.d.ts +2 -2
- package/lib/plugin/internal/load/PluginPackageResolution.js +13 -7
- package/lib/plugin/internal/load/PluginPackageResolution.js.map +1 -1
- package/lib/plugin/internal/load/ProjectPluginEntries.d.ts +23 -7
- package/lib/plugin/internal/load/ProjectPluginEntries.js +36 -14
- package/lib/plugin/internal/load/ProjectPluginEntries.js.map +1 -1
- package/lib/plugin/internal/load/collectProjectHostInputs.d.ts +3 -1
- package/lib/plugin/internal/load/collectProjectHostInputs.js +5 -2
- package/lib/plugin/internal/load/collectProjectHostInputs.js.map +1 -1
- package/lib/plugin/internal/load/hasProjectPluginEntries.d.ts +3 -1
- package/lib/plugin/internal/load/hasProjectPluginEntries.js +4 -2
- package/lib/plugin/internal/load/hasProjectPluginEntries.js.map +1 -1
- package/lib/plugin/internal/load/loadProjectPlugins.d.ts +36 -5
- package/lib/plugin/internal/load/loadProjectPlugins.js +466 -416
- package/lib/plugin/internal/load/loadProjectPlugins.js.map +1 -1
- package/lib/plugin/internal/load/pluginResolutionFailure.d.ts +18 -0
- package/lib/plugin/internal/load/pluginResolutionFailure.js +32 -0
- package/lib/plugin/internal/load/pluginResolutionFailure.js.map +1 -0
- package/lib/plugin/internal/source/PluginBuildEnvironmentReadings.d.ts +1 -1
- package/lib/plugin/internal/source/PluginBuildEnvironmentReadings.js +3 -2
- package/lib/plugin/internal/source/PluginBuildEnvironmentReadings.js.map +1 -1
- package/lib/structures/ITtscCompilerContext.d.ts +12 -12
- package/lib/structures/ITtscPlugin.d.ts +7 -5
- package/lib/structures/ITtscPluginFactoryContext.d.ts +9 -8
- package/lib/structures/internal/TtscSingleFileEmitOptions.d.ts +12 -6
- package/package.json +9 -9
- package/src/TtscCompiler.ts +1 -1
- package/src/compiler/internal/ResidentCheckProcess.ts +159 -374
- package/src/compiler/internal/ResidentCheckProcessHost.ts +502 -0
- package/src/compiler/internal/ResidentCheckProcessProtocol.ts +53 -0
- package/src/compiler/internal/build/BuildExecution.ts +118 -9
- package/src/compiler/internal/build/ResidentCheckWatchSession.ts +41 -24
- package/src/compiler/internal/build/RunBuildOptions.ts +9 -5
- package/src/compiler/internal/build/WatchInputPublication.ts +106 -0
- package/src/compiler/internal/build/runBuild.ts +58 -34
- package/src/compiler/internal/buildNativeCompiler.ts +4 -0
- package/src/compiler/internal/compileProjectInMemory.ts +8 -2
- package/src/compiler/internal/project/resolveOwningProjectConfig.ts +16 -5
- package/src/compiler/internal/readEffectiveCompilerOptions.ts +1 -1
- package/src/compiler/internal/resolveBinary.ts +4 -1
- package/src/compiler/internal/resolveTsgo.ts +7 -0
- package/src/compiler/internal/runSingleFileEmit.ts +139 -99
- package/src/compiler/internal/startResidentTransform.ts +9 -2
- package/src/compiler/internal/transformProjectInMemory.ts +12 -3
- package/src/compiler/internal/transformProjectInWorker.ts +10 -2
- package/src/internal/workerModuleUrl.ts +34 -0
- package/src/launcher/internal/buildSingleRootProject.ts +2 -0
- package/src/launcher/internal/getCompilerVersionText.ts +3 -2
- package/src/launcher/internal/prepareExecution.ts +2 -0
- package/src/launcher/internal/runTtsc.ts +123 -45
- package/src/launcher/internal/runtime/CommonJsRuntimeSource.ts +11 -9
- package/src/launcher/internal/runtime/advertiseTypeScriptExtensions.ts +25 -0
- package/src/launcher/internal/runtime/installRuntimeHooks.ts +7 -3
- package/src/launcher/internal/watch/AsyncWatchTopology.ts +267 -0
- package/src/launcher/internal/watch/WatchSettlement.ts +67 -0
- package/src/launcher/internal/watch/WatchTopology.ts +84 -13
- package/src/launcher/internal/watch/WatchTopologyWorkerProtocol.ts +106 -0
- package/src/launcher/internal/watch/serveWatchTopologyWorker.ts +75 -0
- package/src/launcher/internal/watch/watchTopologyWorker.ts +29 -0
- package/src/plugin/CapabilityPluginResolver.ts +9 -2
- package/src/plugin/internal/load/PluginDescriptorEvaluationCache.ts +17 -12
- package/src/plugin/internal/load/PluginPackageResolution.ts +14 -9
- package/src/plugin/internal/load/ProjectPluginEntries.ts +40 -15
- package/src/plugin/internal/load/collectProjectHostInputs.ts +7 -1
- package/src/plugin/internal/load/hasProjectPluginEntries.ts +8 -3
- package/src/plugin/internal/load/loadProjectPlugins.ts +672 -594
- package/src/plugin/internal/load/pluginResolutionFailure.ts +37 -0
- package/src/plugin/internal/source/PluginBuildEnvironmentReadings.ts +8 -2
- package/src/structures/ITtscCompilerContext.ts +12 -12
- package/src/structures/ITtscPlugin.ts +7 -5
- package/src/structures/ITtscPluginFactoryContext.ts +9 -8
- package/src/structures/internal/TtscSingleFileEmitOptions.ts +22 -11
|
@@ -0,0 +1,232 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.AsyncWatchTopology = void 0;
|
|
7
|
+
const node_path_1 = __importDefault(require("node:path"));
|
|
8
|
+
const node_worker_threads_1 = require("node:worker_threads");
|
|
9
|
+
const SidecarEnvironment_1 = require("../../../compiler/internal/sharedHost/SidecarEnvironment");
|
|
10
|
+
const workerModuleUrl_1 = require("../../../internal/workerModuleUrl");
|
|
11
|
+
/**
|
|
12
|
+
* Keep one watch topology and its native subscriptions on a worker thread.
|
|
13
|
+
*
|
|
14
|
+
* Case-policy probes, content digests and compiler listings must retain their
|
|
15
|
+
* actual observations. Replacing them with path-only case caches or size/mtime
|
|
16
|
+
* digests can miss directory replacements and source edits. They instead run
|
|
17
|
+
* off the launcher's loop so their cost cannot delay resident-host retirement
|
|
18
|
+
* or queued build decisions (#1758). This moves the cost; it does not remove
|
|
19
|
+
* it. Options and publications are cloned, while callbacks stay on the caller.
|
|
20
|
+
*
|
|
21
|
+
* Await a publication before the build reads its inputs. Moving that baseline
|
|
22
|
+
* past the build could absorb an intervening edit (#1728). Callback messages
|
|
23
|
+
* and completion replies share one FIFO channel, so whenIdle completes after
|
|
24
|
+
* the notifications its barrier observed have reached the launcher (#1756).
|
|
25
|
+
*
|
|
26
|
+
* @evidence contracts/common.md#principled-implementation A dedicated supported worker executes the unchanged topology algorithm on selected cloneable data while callbacks remain caller-owned; worker events and correlated replies settle actual operations, and one FIFO channel orders callbacks before completion.
|
|
27
|
+
* @evidence contracts/common.md#clear-and-simple-design The facade separates option capture, reply dispatch and worker lifetime; the synchronous core retains filesystem policy and watcher ownership.
|
|
28
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts Existing native case observations, compiler membership and content proofs remain authoritative. The explicit worker factory supplies transport without replacing globals, and the default starts the actual packaged CommonJS entry without a synchronous barrier or metadata shortcut.
|
|
29
|
+
* @evidence contracts/common.md#meaningful-documentation Native prose explains off-thread cost, baseline-before-build ordering, FIFO replies and lifetime failures; constructor prose identifies data capture, callback ownership and the optional factory.
|
|
30
|
+
* @evidence contracts/portability.md#os-neutral-implementation Native joins locate the packaged CommonJS entry, and the supported module bootstrap loads it through createRequire while retaining Node-owned inherited execution options and loader hooks. Structured cloning preserves maps and bigint device references; SidecarEnvironment merges native environment names before startup.
|
|
31
|
+
* @evidence contracts/performance.md#efficient-algorithms One thread serves the topology lifetime. Construction copies fixed option references before cloning, with costs for option/environment bytes and module initialization; each operation clones its publication bytes and adds one pending entry while the core retains native costs.
|
|
32
|
+
* @evidence contracts/performance.md#reuse-equivalent-work Construction starts a fresh worker lifetime; that worker retains current registrations, listing premises and baselines across requests, but completion grants no reuse for another filesystem generation.
|
|
33
|
+
* @evidence contracts/performance.md#bound-retention-and-release-resources One referenced worker, listeners, exit promise and uncapped pending map belong to the facade; creation failure precedes ownership transfer. Replies prune entries and failure rejects all entries. Close joins worker exit after native subscription close; failed close terminates and joins the thread while retaining error. Requests have no implicit deadline.
|
|
34
|
+
*/
|
|
35
|
+
class AsyncWatchTopology {
|
|
36
|
+
callbacks;
|
|
37
|
+
worker;
|
|
38
|
+
exited;
|
|
39
|
+
pending = new Map();
|
|
40
|
+
sequence = 0;
|
|
41
|
+
failure;
|
|
42
|
+
failed = false;
|
|
43
|
+
terminating = false;
|
|
44
|
+
closing;
|
|
45
|
+
/**
|
|
46
|
+
* Capture data options and start the worker; callbacks remain caller-owned.
|
|
47
|
+
* The optional factory observes worker transport without replacing globals.
|
|
48
|
+
*/
|
|
49
|
+
constructor(options, callbacks, createWorker = (selected) => new node_worker_threads_1.Worker((0, workerModuleUrl_1.workerModuleUrl)(node_path_1.default.join(__dirname, `watchTopologyWorker${node_path_1.default.extname(__filename)}`)), {
|
|
50
|
+
env: SidecarEnvironment_1.SidecarEnvironment.merge(process.env, selected.env),
|
|
51
|
+
workerData: selected,
|
|
52
|
+
})) {
|
|
53
|
+
this.callbacks = callbacks;
|
|
54
|
+
// Callers also carry build callbacks. Select only the core's data options:
|
|
55
|
+
// sending the invocation wholesale would attempt to clone those functions.
|
|
56
|
+
const { binary, compilerArgsCwd, compilerProjectSelections, cwd, emit, env, files, outDir, passthrough, pinCompilerProject, projectRoot, tsconfig, } = options;
|
|
57
|
+
this.worker = createWorker({
|
|
58
|
+
binary,
|
|
59
|
+
compilerArgsCwd,
|
|
60
|
+
compilerProjectSelections,
|
|
61
|
+
cwd,
|
|
62
|
+
emit,
|
|
63
|
+
env,
|
|
64
|
+
files,
|
|
65
|
+
outDir,
|
|
66
|
+
passthrough,
|
|
67
|
+
pinCompilerProject,
|
|
68
|
+
projectRoot,
|
|
69
|
+
tsconfig,
|
|
70
|
+
});
|
|
71
|
+
this.worker.on("message", (reply) => {
|
|
72
|
+
if ("id" in reply) {
|
|
73
|
+
const waiting = this.pending.get(reply.id);
|
|
74
|
+
if (waiting === undefined)
|
|
75
|
+
return;
|
|
76
|
+
this.pending.delete(reply.id);
|
|
77
|
+
if (reply.ok)
|
|
78
|
+
waiting.resolve();
|
|
79
|
+
else
|
|
80
|
+
waiting.reject(reply.error);
|
|
81
|
+
return;
|
|
82
|
+
}
|
|
83
|
+
switch (reply.event) {
|
|
84
|
+
case "input":
|
|
85
|
+
this.callbacks.onInputChange(reply.change);
|
|
86
|
+
break;
|
|
87
|
+
case "topology":
|
|
88
|
+
this.callbacks.onTopologyChange();
|
|
89
|
+
break;
|
|
90
|
+
case "error":
|
|
91
|
+
this.callbacks.onError(reply.location, reply.error);
|
|
92
|
+
break;
|
|
93
|
+
case "roots":
|
|
94
|
+
this.callbacks.onProjectInputWatchRoots?.(reply.roots);
|
|
95
|
+
break;
|
|
96
|
+
case "unavailable":
|
|
97
|
+
this.callbacks.onProjectInputWatchUnavailable?.(reply.roots);
|
|
98
|
+
break;
|
|
99
|
+
}
|
|
100
|
+
});
|
|
101
|
+
this.worker.on("error", (error) => this.fail(error));
|
|
102
|
+
this.exited = new Promise((resolve) => {
|
|
103
|
+
this.worker.once("exit", (code) => {
|
|
104
|
+
if (this.closing === undefined ||
|
|
105
|
+
this.pending.size !== 0 ||
|
|
106
|
+
(code !== 0 && !this.terminating))
|
|
107
|
+
this.fail(new Error(`ttsc: watch topology worker exited with code ${code}`));
|
|
108
|
+
resolve();
|
|
109
|
+
});
|
|
110
|
+
});
|
|
111
|
+
}
|
|
112
|
+
/**
|
|
113
|
+
* Reconcile actual compiler membership and wait for its publication.
|
|
114
|
+
*
|
|
115
|
+
* @evidence contracts/common.md#principled-implementation The worker executes the core's actual refresh before replying, so completion does not stand for a predicted membership.
|
|
116
|
+
* @evidence contracts/common.md#clear-and-simple-design This operation frames one refresh and delegates transport correlation to request.
|
|
117
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts Membership still comes from the core's native compiler-input reader.
|
|
118
|
+
* @evidence contracts/common.md#meaningful-documentation Prose states the membership and publication boundary.
|
|
119
|
+
* @evidenceExclude contracts/portability.md#os-neutral-implementation The method frames a boolean; the worker and core own native execution.
|
|
120
|
+
* @evidence contracts/performance.md#efficient-algorithms Fixed-size framing adds one pending entry; the core retains listing, traversal and hashing costs off-thread.
|
|
121
|
+
* @evidenceExclude contracts/performance.md#reuse-equivalent-work Every requested refresh executes; listing reuse remains the core's decision.
|
|
122
|
+
* @evidence contracts/performance.md#bound-retention-and-release-resources Correlation remains live until reply or worker failure; no deadline is imposed.
|
|
123
|
+
*/
|
|
124
|
+
refresh(notify) {
|
|
125
|
+
return this.request({ method: "refresh", notify });
|
|
126
|
+
}
|
|
127
|
+
/**
|
|
128
|
+
* Capture plugin baselines before the caller starts reading or building.
|
|
129
|
+
*
|
|
130
|
+
* @evidence contracts/common.md#principled-implementation Awaited completion follows the core's baseline capture and preserves the supplied record store's separability references through structured cloning.
|
|
131
|
+
* @evidence contracts/common.md#clear-and-simple-design One publication carries inputs and their existing proof store together.
|
|
132
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts The actual content identity owner still judges every record; transport invents no digest or metadata equivalence.
|
|
133
|
+
* @evidence contracts/common.md#meaningful-documentation Prose states the required pre-build ordering.
|
|
134
|
+
* @evidenceExclude contracts/portability.md#os-neutral-implementation Paths and bigint maps are cloned as data; the core owns native interpretation.
|
|
135
|
+
* @evidence contracts/performance.md#efficient-algorithms Framing is fixed structural work and cloning visits input paths and record references; digest and registration work stays with the core.
|
|
136
|
+
* @evidenceExclude contracts/performance.md#reuse-equivalent-work Each publication reaches the core, which owns baseline and listing reuse premises.
|
|
137
|
+
* @evidence contracts/performance.md#bound-retention-and-release-resources Publication data and one pending correlation remain live through completion or worker failure without a size or deadline cap.
|
|
138
|
+
*/
|
|
139
|
+
setExtraInputs(inputs, identities) {
|
|
140
|
+
return this.request({ method: "setExtraInputs", inputs, identities });
|
|
141
|
+
}
|
|
142
|
+
/**
|
|
143
|
+
* Capture rule-input baselines before the caller consumes those inputs.
|
|
144
|
+
*
|
|
145
|
+
* @evidence contracts/common.md#principled-implementation Completion follows actual declaration normalization, population capture and subscription reconciliation in the core.
|
|
146
|
+
* @evidence contracts/common.md#clear-and-simple-design One operation carries the complete declared snapshot without splitting population and baseline ownership.
|
|
147
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts The core retains missing-path, alias and empty-population semantics; transport filters no inputs.
|
|
148
|
+
* @evidence contracts/common.md#meaningful-documentation Prose states capture timing relative to consumption.
|
|
149
|
+
* @evidenceExclude contracts/portability.md#os-neutral-implementation The snapshot crosses as data; the core owns filesystem identity and case policy.
|
|
150
|
+
* @evidence contracts/performance.md#efficient-algorithms Cloning visits the snapshot's path text; matching, fingerprinting and registrations keep their owning core costs.
|
|
151
|
+
* @evidenceExclude contracts/performance.md#reuse-equivalent-work The core decides whether a publication is equivalent; transport reuses no earlier result.
|
|
152
|
+
* @evidence contracts/performance.md#bound-retention-and-release-resources Snapshot bytes and one pending correlation remain live until reply or worker failure without a population cap.
|
|
153
|
+
*/
|
|
154
|
+
setProjectInputs(inputs) {
|
|
155
|
+
return this.request({ method: "setProjectInputs", inputs });
|
|
156
|
+
}
|
|
157
|
+
/**
|
|
158
|
+
* Wait for delivered topology work and its preceding callback messages.
|
|
159
|
+
*
|
|
160
|
+
* @evidence contracts/common.md#principled-implementation The worker's core barrier observes its scheduled owners, and callbacks sent before the completion reply arrive first on the same FIFO channel.
|
|
161
|
+
* @evidence contracts/common.md#clear-and-simple-design One request exposes the core's complete queue ownership instead of duplicating queue flags here.
|
|
162
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts Actual queue completion replaces elapsed quiet-time estimates.
|
|
163
|
+
* @evidence contracts/common.md#meaningful-documentation Prose identifies delivered work and callback ordering.
|
|
164
|
+
* @evidenceExclude contracts/portability.md#os-neutral-implementation The operation uses portable MessagePort ordering without a native path or process call.
|
|
165
|
+
* @evidence contracts/performance.md#efficient-algorithms Fixed-size framing adds one correlation; the core checks flags per yielded turn and still pays its pending operations' costs.
|
|
166
|
+
* @evidenceExclude contracts/performance.md#reuse-equivalent-work Each barrier observes current pending work rather than a previous receipt.
|
|
167
|
+
* @evidence contracts/performance.md#bound-retention-and-release-resources One request remains live until idle, close or failure; continuous new work can keep it pending without an implicit deadline.
|
|
168
|
+
*/
|
|
169
|
+
whenIdle() {
|
|
170
|
+
return this.request({ method: "whenIdle" });
|
|
171
|
+
}
|
|
172
|
+
/**
|
|
173
|
+
* Close subscriptions and join the thread. Repeated calls share retirement;
|
|
174
|
+
* close or worker failures remain rejection even after thread termination.
|
|
175
|
+
*
|
|
176
|
+
* @evidence contracts/common.md#principled-implementation Successful close follows core subscription release, outstanding barrier answers and actual worker exit; failed close terminates and joins the thread while preserving rejection.
|
|
177
|
+
* @evidence contracts/common.md#clear-and-simple-design One retained promise owns idempotent shutdown and finishClose owns its two retirement paths.
|
|
178
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts Shutdown joins actual thread exit rather than treating a posted close as completion.
|
|
179
|
+
* @evidence contracts/common.md#meaningful-documentation Prose states joined completion, repeated-call sharing and failure retention.
|
|
180
|
+
* @evidence contracts/portability.md#os-neutral-implementation Node's supported worker exit and termination APIs own thread retirement; the core owns backend subscription closure.
|
|
181
|
+
* @evidence contracts/performance.md#efficient-algorithms One close message and shared promise add fixed structural work; subscription traversal, outstanding replies and thread retirement retain delegated costs.
|
|
182
|
+
* @evidence contracts/performance.md#reuse-equivalent-work Every repeated close shares this lifetime's single retirement result, including rejection.
|
|
183
|
+
* @evidence contracts/performance.md#bound-retention-and-release-resources Closure rejects new requests and joins the worker; pending requests settle by replies or terminal failure. Native FSEvents stop errors are suppressed by its existing backend, so thread joining alone cannot certify that optional binding's physical cleanup.
|
|
184
|
+
*/
|
|
185
|
+
close() {
|
|
186
|
+
this.closing ??= this.finishClose();
|
|
187
|
+
return this.closing;
|
|
188
|
+
}
|
|
189
|
+
async finishClose() {
|
|
190
|
+
try {
|
|
191
|
+
await this.request({ method: "close" });
|
|
192
|
+
}
|
|
193
|
+
catch (error) {
|
|
194
|
+
this.terminating = true;
|
|
195
|
+
await this.worker.terminate();
|
|
196
|
+
await this.exited;
|
|
197
|
+
throw error;
|
|
198
|
+
}
|
|
199
|
+
await this.exited;
|
|
200
|
+
if (this.failed)
|
|
201
|
+
throw this.failure;
|
|
202
|
+
}
|
|
203
|
+
request(operation) {
|
|
204
|
+
if (this.failed)
|
|
205
|
+
return Promise.reject(this.failure);
|
|
206
|
+
if (this.closing !== undefined)
|
|
207
|
+
return Promise.reject(new Error("ttsc: watch topology is closing"));
|
|
208
|
+
const id = ++this.sequence;
|
|
209
|
+
return new Promise((resolve, reject) => {
|
|
210
|
+
this.pending.set(id, { reject, resolve });
|
|
211
|
+
try {
|
|
212
|
+
this.worker.postMessage({ ...operation, id });
|
|
213
|
+
}
|
|
214
|
+
catch (error) {
|
|
215
|
+
this.pending.delete(id);
|
|
216
|
+
reject(error);
|
|
217
|
+
}
|
|
218
|
+
});
|
|
219
|
+
}
|
|
220
|
+
fail(error) {
|
|
221
|
+
if (this.failed)
|
|
222
|
+
return;
|
|
223
|
+
this.failed = true;
|
|
224
|
+
this.failure = error;
|
|
225
|
+
for (const waiting of this.pending.values())
|
|
226
|
+
waiting.reject(error);
|
|
227
|
+
this.pending.clear();
|
|
228
|
+
this.callbacks.onFailure(error);
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
exports.AsyncWatchTopology = AsyncWatchTopology;
|
|
232
|
+
//# sourceMappingURL=AsyncWatchTopology.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AsyncWatchTopology.js","sourceRoot":"","sources":["../../../../src/launcher/internal/watch/AsyncWatchTopology.ts"],"names":[],"mappings":";;;;;;AAAA,0DAA6B;AAC7B,6DAA6C;AAE7C,iGAA8F;AAC9F,uEAAoE;AAKpE;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH;IAmBqB,SAAS;IAlBX,MAAM,CAAS;IACf,MAAM,CAAgB;IACtB,OAAO,GAAG,IAAI,GAAG,EAG/B,CAAC;IACI,QAAQ,GAAG,CAAC,CAAC;IACb,OAAO,CAAU;IACjB,MAAM,GAAG,KAAK,CAAC;IACf,WAAW,GAAG,KAAK,CAAC;IACpB,OAAO,CAA4B;IAE3C;;;OAGG;IAC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The owner announces every scheduling and terminal transition.
|
|
4
|
+
*
|
|
5
|
+
* Elapsed silence cannot certify idle: a queued build or an asynchronous input
|
|
6
|
+
* decision can remain silent until it starts. A changed revision therefore
|
|
7
|
+
* requires another observation, even when the earlier one reported idle.
|
|
8
|
+
*
|
|
9
|
+
* @evidence contracts/common.md#principled-implementation A monotonic revision detects transitions across an asynchronous idle query; wait registration and the final revision comparison share one JavaScript turn, preventing a lost wake.
|
|
10
|
+
* @evidence contracts/common.md#clear-and-simple-design The owner supplies its actual idle predicate and announces state changes; this class owns only revision validation and waiting callbacks.
|
|
11
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts No timeout, retry limit, process hook or consumer-specific decision substitutes for the owner's state.
|
|
12
|
+
* @evidence contracts/common.md#meaningful-documentation Prose defines idle-query ownership and why silent queued work and intervening changes require a fresh observation; methods describe notification and failure effects.
|
|
13
|
+
* @evidenceExclude contracts/portability.md#os-neutral-implementation Revisions and promises have no native path, filesystem or process boundary.
|
|
14
|
+
* @evidence contracts/performance.md#efficient-algorithms Each transition visits current waiters once; each observation is constant bookkeeping plus the supplied owner's work, without polling.
|
|
15
|
+
* @evidenceExclude contracts/performance.md#reuse-equivalent-work Each wait observes mutable owner state independently; no computed result is cached across transitions.
|
|
16
|
+
* @evidence contracts/performance.md#bound-retention-and-release-resources A non-idle wait registers one callback until the next transition; an in-flight idle query or publication retains its call closure until settlement. Errors reject directly. The owner must announce terminal transitions so registered callbacks can recheck and reject. Concurrent caller population has no fixed cap.
|
|
17
|
+
*/
|
|
18
|
+
export declare class WatchSettlement {
|
|
19
|
+
private revision;
|
|
20
|
+
private readonly waiters;
|
|
21
|
+
/**
|
|
22
|
+
* Announces a scheduling or terminal transition and releases current waits.
|
|
23
|
+
*
|
|
24
|
+
* @evidence contracts/common.md#principled-implementation Advancing the revision invalidates queries already in flight, and releasing the current callback population permits each pending wait to query again.
|
|
25
|
+
* @evidence contracts/common.md#clear-and-simple-design One notification handles both ordinary scheduling and terminal transitions without interpreting the owner's state.
|
|
26
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts Callbacks observe a real owner transition without polling or replacing owner operations.
|
|
27
|
+
* @evidence contracts/common.md#meaningful-documentation The prose states which transitions callers announce and that current waits are released.
|
|
28
|
+
* @evidenceExclude contracts/portability.md#os-neutral-implementation This in-memory notification has no native boundary.
|
|
29
|
+
* @evidence contracts/performance.md#efficient-algorithms Copying and waking current callbacks costs linear time and temporary space in pending waits.
|
|
30
|
+
* @evidenceExclude contracts/performance.md#reuse-equivalent-work This effectful transition does not compute a reusable result.
|
|
31
|
+
* @evidence contracts/performance.md#bound-retention-and-release-resources Clearing the set releases its references before callbacks run; each resumed wait owns any later registration.
|
|
32
|
+
*/
|
|
33
|
+
changed(): void;
|
|
34
|
+
/**
|
|
35
|
+
* Publishes and resolves after an idle query spans no transition; errors
|
|
36
|
+
* reject. The owner must reject its query after shutdown and announce that
|
|
37
|
+
* shutdown. Publication starts in the same turn as the final revision check.
|
|
38
|
+
*
|
|
39
|
+
* @evidence contracts/common.md#principled-implementation The revision comparison validates the complete awaited observation; publication starts synchronously after that comparison, and a non-idle result registers its wake in the same turn, so neither path loses an intervening transition.
|
|
40
|
+
* @evidence contracts/common.md#clear-and-simple-design The loop retries only after a real transition and delegates all idle and terminal meaning to the supplied owner query.
|
|
41
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts No elapsed silence, deadline or fixed retry count stands for the owner's actual pending work.
|
|
42
|
+
* @evidence contracts/common.md#meaningful-documentation The prose describes successful observation, same-turn publication, error propagation and the terminal notification obligation.
|
|
43
|
+
* @evidenceExclude contracts/portability.md#os-neutral-implementation Awaiting an owner query imposes no native path or process policy.
|
|
44
|
+
* @evidence contracts/performance.md#efficient-algorithms Each query adds constant revision bookkeeping and at most one callback; query work belongs to the supplied owner, and no timer polls state.
|
|
45
|
+
* @evidenceExclude contracts/performance.md#reuse-equivalent-work Queries observe mutable state and are not cached across transitions.
|
|
46
|
+
* @evidence contracts/performance.md#bound-retention-and-release-resources A non-idle observation retains one resolver until changed clears it; successful and failed queries retain no registered callback, while an in-flight query or publication retains this call until settlement. Terminal wake and rejection are the owner's obligation.
|
|
47
|
+
*/
|
|
48
|
+
wait(idle: () => Promise<boolean>, publish?: () => void | Promise<void>): Promise<void>;
|
|
49
|
+
}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.WatchSettlement = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Waits for an owner's idle observation without losing changes during that
|
|
6
|
+
* observation. The owner announces every scheduling and terminal transition.
|
|
7
|
+
*
|
|
8
|
+
* Elapsed silence cannot certify idle: a queued build or an asynchronous input
|
|
9
|
+
* decision can remain silent until it starts. A changed revision therefore
|
|
10
|
+
* requires another observation, even when the earlier one reported idle.
|
|
11
|
+
*
|
|
12
|
+
* @evidence contracts/common.md#principled-implementation A monotonic revision detects transitions across an asynchronous idle query; wait registration and the final revision comparison share one JavaScript turn, preventing a lost wake.
|
|
13
|
+
* @evidence contracts/common.md#clear-and-simple-design The owner supplies its actual idle predicate and announces state changes; this class owns only revision validation and waiting callbacks.
|
|
14
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts No timeout, retry limit, process hook or consumer-specific decision substitutes for the owner's state.
|
|
15
|
+
* @evidence contracts/common.md#meaningful-documentation Prose defines idle-query ownership and why silent queued work and intervening changes require a fresh observation; methods describe notification and failure effects.
|
|
16
|
+
* @evidenceExclude contracts/portability.md#os-neutral-implementation Revisions and promises have no native path, filesystem or process boundary.
|
|
17
|
+
* @evidence contracts/performance.md#efficient-algorithms Each transition visits current waiters once; each observation is constant bookkeeping plus the supplied owner's work, without polling.
|
|
18
|
+
* @evidenceExclude contracts/performance.md#reuse-equivalent-work Each wait observes mutable owner state independently; no computed result is cached across transitions.
|
|
19
|
+
* @evidence contracts/performance.md#bound-retention-and-release-resources A non-idle wait registers one callback until the next transition; an in-flight idle query or publication retains its call closure until settlement. Errors reject directly. The owner must announce terminal transitions so registered callbacks can recheck and reject. Concurrent caller population has no fixed cap.
|
|
20
|
+
*/
|
|
21
|
+
class WatchSettlement {
|
|
22
|
+
revision = 0;
|
|
23
|
+
waiters = new Set();
|
|
24
|
+
/**
|
|
25
|
+
* Announces a scheduling or terminal transition and releases current waits.
|
|
26
|
+
*
|
|
27
|
+
* @evidence contracts/common.md#principled-implementation Advancing the revision invalidates queries already in flight, and releasing the current callback population permits each pending wait to query again.
|
|
28
|
+
* @evidence contracts/common.md#clear-and-simple-design One notification handles both ordinary scheduling and terminal transitions without interpreting the owner's state.
|
|
29
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts Callbacks observe a real owner transition without polling or replacing owner operations.
|
|
30
|
+
* @evidence contracts/common.md#meaningful-documentation The prose states which transitions callers announce and that current waits are released.
|
|
31
|
+
* @evidenceExclude contracts/portability.md#os-neutral-implementation This in-memory notification has no native boundary.
|
|
32
|
+
* @evidence contracts/performance.md#efficient-algorithms Copying and waking current callbacks costs linear time and temporary space in pending waits.
|
|
33
|
+
* @evidenceExclude contracts/performance.md#reuse-equivalent-work This effectful transition does not compute a reusable result.
|
|
34
|
+
* @evidence contracts/performance.md#bound-retention-and-release-resources Clearing the set releases its references before callbacks run; each resumed wait owns any later registration.
|
|
35
|
+
*/
|
|
36
|
+
changed() {
|
|
37
|
+
++this.revision;
|
|
38
|
+
const waiters = [...this.waiters];
|
|
39
|
+
this.waiters.clear();
|
|
40
|
+
for (const wake of waiters)
|
|
41
|
+
wake();
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Publishes and resolves after an idle query spans no transition; errors
|
|
45
|
+
* reject. The owner must reject its query after shutdown and announce that
|
|
46
|
+
* shutdown. Publication starts in the same turn as the final revision check.
|
|
47
|
+
*
|
|
48
|
+
* @evidence contracts/common.md#principled-implementation The revision comparison validates the complete awaited observation; publication starts synchronously after that comparison, and a non-idle result registers its wake in the same turn, so neither path loses an intervening transition.
|
|
49
|
+
* @evidence contracts/common.md#clear-and-simple-design The loop retries only after a real transition and delegates all idle and terminal meaning to the supplied owner query.
|
|
50
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts No elapsed silence, deadline or fixed retry count stands for the owner's actual pending work.
|
|
51
|
+
* @evidence contracts/common.md#meaningful-documentation The prose describes successful observation, same-turn publication, error propagation and the terminal notification obligation.
|
|
52
|
+
* @evidenceExclude contracts/portability.md#os-neutral-implementation Awaiting an owner query imposes no native path or process policy.
|
|
53
|
+
* @evidence contracts/performance.md#efficient-algorithms Each query adds constant revision bookkeeping and at most one callback; query work belongs to the supplied owner, and no timer polls state.
|
|
54
|
+
* @evidenceExclude contracts/performance.md#reuse-equivalent-work Queries observe mutable state and are not cached across transitions.
|
|
55
|
+
* @evidence contracts/performance.md#bound-retention-and-release-resources A non-idle observation retains one resolver until changed clears it; successful and failed queries retain no registered callback, while an in-flight query or publication retains this call until settlement. Terminal wake and rejection are the owner's obligation.
|
|
56
|
+
*/
|
|
57
|
+
async wait(idle, publish = () => { }) {
|
|
58
|
+
for (;;) {
|
|
59
|
+
const revision = this.revision;
|
|
60
|
+
const observed = await idle();
|
|
61
|
+
if (revision !== this.revision)
|
|
62
|
+
continue;
|
|
63
|
+
if (observed)
|
|
64
|
+
return await publish();
|
|
65
|
+
await new Promise((resolve) => this.waiters.add(resolve));
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
exports.WatchSettlement = WatchSettlement;
|
|
70
|
+
//# sourceMappingURL=WatchSettlement.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WatchSettlement.js","sourceRoot":"","sources":["../../../../src/launcher/internal/watch/WatchSettlement.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;;;GAgBG;AACH;IACU,QAAQ,GAAG,CAAC,CAAC;IACJ,OAAO,GAAG,IAAI,GAAG,EAAc,CAAC;IAEjD;;;;;;;;;;;OAWG;IACI,OAAO;QACZ,EAAE,IAAI,CAAC,QAAQ,CAAC;QAChB,MAAM,OAAO,GAAG,CAAC,GAAG,IAAI,CAAC,OAAO,CAAC,CAAC;QAClC,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE,CAAC;QACrB,KAAK,MAAM,IAAI,IAAI,OAAO;YAAE,IAAI,EAAE,CAAC;IACrC,CAAC;IAED;;;;;;;;;;;;;OAaG;IACI,KAAK,CAAC,IAAI,CACf,IAA4B,EAC5B,OAAO,GAA+B,GAAG,EAAE,GAAE,CAAC;QAE9C,SAAS,CAAC;YACR,MAAM,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC;YAC/B,MAAM,QAAQ,GAAG,MAAM,IAAI,EAAE,CAAC;YAC9B,IAAI,QAAQ,KAAK,IAAI,CAAC,QAAQ;gBAAE,SAAS;YACzC,IAAI,QAAQ;gBAAE,OAAO,MAAM,OAAO,EAAE,CAAC;YACrC,MAAM,IAAI,OAAO,CAAO,CAAC,OAAO,EAAE,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC;QAClE,CAAC;IACH,CAAC;CACF"}
|
|
@@ -30,7 +30,7 @@ import { watchDirectory } from "./watchDirectory";
|
|
|
30
30
|
* @evidence contracts/common.md#meaningful-documentation Native paragraphs explain membership authority, plugin fingerprinting, publication races, physical registration and public lifecycle operations following the documentation skill. Parameters identify each supplied operation and native default beside the constructor. Project-input attribution: Native paragraphs explain stale attention, directory causality, accompanying resolution digests and unselected immediate entries.
|
|
31
31
|
* @evidence contracts/portability.md#os-neutral-implementation Native paths use Node APIs and registration uses realpath; compiler/plugin maps preserve lexical aliases and fold only measured insensitive ASCII components. Project inputs use physical identities, while unknown/native Unicode relations remain conservative event candidates rather than identity proof. Registration paths and read options are passed unchanged; compiler-input readers supply absolute membership paths without replacing the topology's native identity policy. Project-input attribution: The supplied filesystem identity transaction establishes selected names and ancestry without an OS-wide case assumption or lexical alias guess.
|
|
32
32
|
*
|
|
33
|
-
* @evidence contracts/performance.md#efficient-algorithms Identity-keyed maps separate membership, baselines and handle registries; reconciliation delegates project/config discovery, native compiler listing, filesystem traversal/hashing and backend callbacks, with costs described by its members. Construction retains operation references and empty indexes without a filesystem observation or build. Attribution indexed visits additionally pay path/key text, ancestor and native identity work; shared ancestor keys avoid repeating the same walk within a transaction.
|
|
33
|
+
* @evidence contracts/performance.md#efficient-algorithms Identity-keyed maps separate membership, baselines and handle registries; reconciliation delegates project/config discovery, native compiler listing, filesystem traversal/hashing and backend callbacks, with costs described by its members. A directory-triggered refresh additionally visits R active reload files even on failure and compares their metadata/owner snapshots, reading bytes only when those snapshots changed. Changed-owner and notification arrays and a reported-key set require O(R) references; moved owners share one existing watcher synchronization and post-registration reconciliation, whose selected-file traversal remains part of the operation. No additional compiler listing is requested. Construction retains operation references and empty indexes without a filesystem observation or build. Attribution indexed visits additionally pay path/key text, ancestor and native identity work; shared ancestor keys avoid repeating the same walk within a transaction.
|
|
34
34
|
* @evidence contracts/performance.md#reuse-equivalent-work Current membership, content baselines and live registrations belong to one topology; reconciliation owners decide their reuse against fresh premises. Supplied operation identities are retained without assuming changed inputs remain equivalent. Each project's last compiler listing is kept with its arguments and answers only a plugin-input change, which cannot move Program membership; every other refresh lists again. Notifications delivered in one poll iteration are decided together in the check phase, so one change lists and rescans once. Project-input attribution: This classifier borrows one scan's deltas and identity transaction without retaining cross-event answers.
|
|
35
35
|
* @evidence contracts/performance.md#bound-retention-and-release-resources Current and pending maps and live subscriptions remain topology-owned without a population cap; compiler listings are replaced by each resolution and hold only its projects; reconciliation attempts obsolete handle retirement. Constructor acquires no handle; directory arrays and attribution deltas are call-local. close invokes supplied close methods but does not await backend closure, and a thrown close can interrupt later map cleanup; retained snapshots remain until the facade is released.
|
|
36
36
|
*/
|
|
@@ -149,6 +149,25 @@ export declare class WatchTopology {
|
|
|
149
149
|
* @evidence contracts/performance.md#bound-retention-and-release-resources Current snapshots prune removed members and synchronization attempts obsolete handle closure, keeping old coverage after incomplete registration. Current/recovery populations and observations have no size cap; supplied close/error callbacks can throw and close does not await backend completion. State remains owner-held until released.
|
|
150
150
|
*/
|
|
151
151
|
refresh(notify: boolean): void;
|
|
152
|
+
/**
|
|
153
|
+
* Wait until delivered notifications and registration reconciliation finish.
|
|
154
|
+
*
|
|
155
|
+
* A completed build does not imply a quiet topology: its final refresh can
|
|
156
|
+
* queue another decision and another build (#1756). Yield through the check
|
|
157
|
+
* phase before inspecting every scheduled owner so a decision queued by
|
|
158
|
+
* another decision remains part of this barrier. Later filesystem changes
|
|
159
|
+
* belong to a later barrier; this does not freeze the filesystem.
|
|
160
|
+
*
|
|
161
|
+
* @evidence contracts/common.md#principled-implementation A check-phase observation follows delivered events, and every notification, recovery and registration queue must be empty before completion.
|
|
162
|
+
* @evidence contracts/common.md#clear-and-simple-design The topology owns the barrier because it alone owns all five scheduled queues.
|
|
163
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts Queue state establishes completion without a quiet-time estimate or an invented filesystem snapshot.
|
|
164
|
+
* @evidence contracts/common.md#meaningful-documentation Native prose distinguishes delivered work from later mutations and explains the post-build queued-decision race.
|
|
165
|
+
* @evidenceExclude contracts/portability.md#os-neutral-implementation The barrier observes owned JavaScript queues without a separate native operation.
|
|
166
|
+
* @evidence contracts/performance.md#efficient-algorithms Each check turn inspects five flags and two map sizes; notification processing retains its owning traversal and native-operation costs.
|
|
167
|
+
* @evidenceExclude contracts/performance.md#reuse-equivalent-work Each call observes current work rather than reusing an earlier completion.
|
|
168
|
+
* @evidence contracts/performance.md#bound-retention-and-release-resources One immediate callback and promise remain live per waiting call; continuous new work can prevent completion and no deadline is imposed.
|
|
169
|
+
*/
|
|
170
|
+
whenIdle(): Promise<void>;
|
|
152
171
|
/**
|
|
153
172
|
* @param reuseListings Answer each project's membership with its last listing
|
|
154
173
|
* under the same arguments instead of asking the compiler again. Only a
|
|
@@ -397,6 +416,15 @@ export declare class WatchTopology {
|
|
|
397
416
|
* Refresh compiler membership once for every directory a decision asked
|
|
398
417
|
* about. A failed refresh still reports, once each, the reload inputs every
|
|
399
418
|
* requested change names.
|
|
419
|
+
*
|
|
420
|
+
* A replacement can be delivered under only its vanished temporary name,
|
|
421
|
+
* including when its malformed bytes prevent refresh. Reconcile active
|
|
422
|
+
* reload-file snapshots on either outcome, deduplicate failed-refresh
|
|
423
|
+
* recovery against actual reported movement, and preserve the original
|
|
424
|
+
* refresh error after recovery. Batch moved owners through the existing rearm
|
|
425
|
+
* operation before notifying, because a POSIX per-file handle still owns the
|
|
426
|
+
* old inode. Unchanged snapshots stay quiet unless the existing
|
|
427
|
+
* failed-refresh selector explicitly names or cannot find the reload input.
|
|
400
428
|
*/
|
|
401
429
|
private refreshFromDirectories;
|
|
402
430
|
private isCompilerOutputDirectory;
|
|
@@ -12,6 +12,7 @@ const CompilerProjectSelection_1 = require("../../../compiler/internal/project/C
|
|
|
12
12
|
const readJsoncFile_1 = require("../../../compiler/internal/project/readJsoncFile");
|
|
13
13
|
const readProjectConfig_1 = require("../../../compiler/internal/project/readProjectConfig");
|
|
14
14
|
const resolveTsgo_1 = require("../../../compiler/internal/resolveTsgo");
|
|
15
|
+
const SidecarEnvironment_1 = require("../../../compiler/internal/sharedHost/SidecarEnvironment");
|
|
15
16
|
const spawnNative_1 = require("../../../compiler/internal/spawnNative");
|
|
16
17
|
const normalizeCompilerEnumValue_1 = require("../../../flags/normalizeCompilerEnumValue");
|
|
17
18
|
const readCompilerOptionValues_1 = require("../../../flags/readCompilerOptionValues");
|
|
@@ -62,7 +63,7 @@ const watchDirectory_1 = require("./watchDirectory");
|
|
|
62
63
|
* @evidence contracts/common.md#meaningful-documentation Native paragraphs explain membership authority, plugin fingerprinting, publication races, physical registration and public lifecycle operations following the documentation skill. Parameters identify each supplied operation and native default beside the constructor. Project-input attribution: Native paragraphs explain stale attention, directory causality, accompanying resolution digests and unselected immediate entries.
|
|
63
64
|
* @evidence contracts/portability.md#os-neutral-implementation Native paths use Node APIs and registration uses realpath; compiler/plugin maps preserve lexical aliases and fold only measured insensitive ASCII components. Project inputs use physical identities, while unknown/native Unicode relations remain conservative event candidates rather than identity proof. Registration paths and read options are passed unchanged; compiler-input readers supply absolute membership paths without replacing the topology's native identity policy. Project-input attribution: The supplied filesystem identity transaction establishes selected names and ancestry without an OS-wide case assumption or lexical alias guess.
|
|
64
65
|
*
|
|
65
|
-
* @evidence contracts/performance.md#efficient-algorithms Identity-keyed maps separate membership, baselines and handle registries; reconciliation delegates project/config discovery, native compiler listing, filesystem traversal/hashing and backend callbacks, with costs described by its members. Construction retains operation references and empty indexes without a filesystem observation or build. Attribution indexed visits additionally pay path/key text, ancestor and native identity work; shared ancestor keys avoid repeating the same walk within a transaction.
|
|
66
|
+
* @evidence contracts/performance.md#efficient-algorithms Identity-keyed maps separate membership, baselines and handle registries; reconciliation delegates project/config discovery, native compiler listing, filesystem traversal/hashing and backend callbacks, with costs described by its members. A directory-triggered refresh additionally visits R active reload files even on failure and compares their metadata/owner snapshots, reading bytes only when those snapshots changed. Changed-owner and notification arrays and a reported-key set require O(R) references; moved owners share one existing watcher synchronization and post-registration reconciliation, whose selected-file traversal remains part of the operation. No additional compiler listing is requested. Construction retains operation references and empty indexes without a filesystem observation or build. Attribution indexed visits additionally pay path/key text, ancestor and native identity work; shared ancestor keys avoid repeating the same walk within a transaction.
|
|
66
67
|
* @evidence contracts/performance.md#reuse-equivalent-work Current membership, content baselines and live registrations belong to one topology; reconciliation owners decide their reuse against fresh premises. Supplied operation identities are retained without assuming changed inputs remain equivalent. Each project's last compiler listing is kept with its arguments and answers only a plugin-input change, which cannot move Program membership; every other refresh lists again. Notifications delivered in one poll iteration are decided together in the check phase, so one change lists and rescans once. Project-input attribution: This classifier borrows one scan's deltas and identity transaction without retaining cross-event answers.
|
|
67
68
|
* @evidence contracts/performance.md#bound-retention-and-release-resources Current and pending maps and live subscriptions remain topology-owned without a population cap; compiler listings are replaced by each resolution and hold only its projects; reconciliation attempts obsolete handle retirement. Constructor acquires no handle; directory arrays and attribution deltas are call-local. close invokes supplied close methods but does not await backend closure, and a thrown close can interrupt later map cleanup; retained snapshots remain until the facade is released.
|
|
68
69
|
*/
|
|
@@ -204,6 +205,36 @@ class WatchTopology {
|
|
|
204
205
|
refresh(notify) {
|
|
205
206
|
this.refreshCompilerInputs(notify, false);
|
|
206
207
|
}
|
|
208
|
+
/**
|
|
209
|
+
* Wait until delivered notifications and registration reconciliation finish.
|
|
210
|
+
*
|
|
211
|
+
* A completed build does not imply a quiet topology: its final refresh can
|
|
212
|
+
* queue another decision and another build (#1756). Yield through the check
|
|
213
|
+
* phase before inspecting every scheduled owner so a decision queued by
|
|
214
|
+
* another decision remains part of this barrier. Later filesystem changes
|
|
215
|
+
* belong to a later barrier; this does not freeze the filesystem.
|
|
216
|
+
*
|
|
217
|
+
* @evidence contracts/common.md#principled-implementation A check-phase observation follows delivered events, and every notification, recovery and registration queue must be empty before completion.
|
|
218
|
+
* @evidence contracts/common.md#clear-and-simple-design The topology owns the barrier because it alone owns all five scheduled queues.
|
|
219
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts Queue state establishes completion without a quiet-time estimate or an invented filesystem snapshot.
|
|
220
|
+
* @evidence contracts/common.md#meaningful-documentation Native prose distinguishes delivered work from later mutations and explains the post-build queued-decision race.
|
|
221
|
+
* @evidenceExclude contracts/portability.md#os-neutral-implementation The barrier observes owned JavaScript queues without a separate native operation.
|
|
222
|
+
* @evidence contracts/performance.md#efficient-algorithms Each check turn inspects five flags and two map sizes; notification processing retains its owning traversal and native-operation costs.
|
|
223
|
+
* @evidenceExclude contracts/performance.md#reuse-equivalent-work Each call observes current work rather than reusing an earlier completion.
|
|
224
|
+
* @evidence contracts/performance.md#bound-retention-and-release-resources One immediate callback and promise remain live per waiting call; continuous new work can prevent completion and no deadline is imposed.
|
|
225
|
+
*/
|
|
226
|
+
async whenIdle() {
|
|
227
|
+
do {
|
|
228
|
+
await new Promise((resolve) => setImmediate(resolve));
|
|
229
|
+
} while (!this.closed &&
|
|
230
|
+
(this.notificationsScheduled ||
|
|
231
|
+
this.pluginNotificationsScheduled ||
|
|
232
|
+
this.compilerPostRegistrationReconciliationScheduled ||
|
|
233
|
+
this.projectInputRecoveryScheduled ||
|
|
234
|
+
this.projectInputPostRegistrationReconciliationScheduled ||
|
|
235
|
+
this.pendingNotifications.size !== 0 ||
|
|
236
|
+
this.pendingPluginNotifications.size !== 0));
|
|
237
|
+
}
|
|
207
238
|
/**
|
|
208
239
|
* @param reuseListings Answer each project's membership with its last listing
|
|
209
240
|
* under the same arguments instead of asking the compiler again. Only a
|
|
@@ -1367,6 +1398,15 @@ class WatchTopology {
|
|
|
1367
1398
|
* Refresh compiler membership once for every directory a decision asked
|
|
1368
1399
|
* about. A failed refresh still reports, once each, the reload inputs every
|
|
1369
1400
|
* requested change names.
|
|
1401
|
+
*
|
|
1402
|
+
* A replacement can be delivered under only its vanished temporary name,
|
|
1403
|
+
* including when its malformed bytes prevent refresh. Reconcile active
|
|
1404
|
+
* reload-file snapshots on either outcome, deduplicate failed-refresh
|
|
1405
|
+
* recovery against actual reported movement, and preserve the original
|
|
1406
|
+
* refresh error after recovery. Batch moved owners through the existing rearm
|
|
1407
|
+
* operation before notifying, because a POSIX per-file handle still owns the
|
|
1408
|
+
* old inode. Unchanged snapshots stay quiet unless the existing
|
|
1409
|
+
* failed-refresh selector explicitly names or cannot find the reload input.
|
|
1370
1410
|
*/
|
|
1371
1411
|
refreshFromDirectories(refreshes) {
|
|
1372
1412
|
for (const { changed } of refreshes) {
|
|
@@ -1377,22 +1417,57 @@ class WatchTopology {
|
|
|
1377
1417
|
this.observedDirectories.set(this.pathKey(changed), changed);
|
|
1378
1418
|
}
|
|
1379
1419
|
}
|
|
1420
|
+
let refreshFailure;
|
|
1380
1421
|
try {
|
|
1381
1422
|
this.refresh(true);
|
|
1382
1423
|
}
|
|
1383
1424
|
catch (error) {
|
|
1425
|
+
refreshFailure = { error };
|
|
1426
|
+
}
|
|
1427
|
+
try {
|
|
1428
|
+
if (this.closed)
|
|
1429
|
+
return;
|
|
1430
|
+
const changed = [];
|
|
1431
|
+
const rearm = [];
|
|
1384
1432
|
const reported = new Set();
|
|
1385
|
-
for (const
|
|
1386
|
-
|
|
1387
|
-
|
|
1388
|
-
|
|
1389
|
-
|
|
1390
|
-
|
|
1391
|
-
|
|
1433
|
+
for (const reload of this.reloadFiles.values()) {
|
|
1434
|
+
if (this.closed)
|
|
1435
|
+
return;
|
|
1436
|
+
const movement = this.compilerFileMovement(reload);
|
|
1437
|
+
if (movement.owner)
|
|
1438
|
+
rearm.push(reload);
|
|
1439
|
+
if (this.compilerMovementReports(reload, movement))
|
|
1440
|
+
changed.push(reload);
|
|
1441
|
+
}
|
|
1442
|
+
if (rearm.length !== 0)
|
|
1443
|
+
this.rearmFileWatchers(rearm, true);
|
|
1444
|
+
for (const reload of changed) {
|
|
1445
|
+
if (this.closed)
|
|
1446
|
+
return;
|
|
1447
|
+
reported.add(this.pathKey(reload));
|
|
1448
|
+
this.reportCompilerFileChange(reload);
|
|
1449
|
+
}
|
|
1450
|
+
if (refreshFailure !== undefined) {
|
|
1451
|
+
for (const { changed } of refreshes) {
|
|
1452
|
+
for (const reload of (0, reloadInputsForFailedTopologyRefresh_1.reloadInputsForFailedTopologyRefresh)(this.reloadFiles.values(), changed, this.lexicalIdentities)) {
|
|
1453
|
+
if (this.closed)
|
|
1454
|
+
return;
|
|
1455
|
+
const key = this.pathKey(reload);
|
|
1456
|
+
if (reported.has(key))
|
|
1457
|
+
continue;
|
|
1458
|
+
reported.add(key);
|
|
1459
|
+
this.callbacks.onInputChange({ kind: "config", path: reload });
|
|
1460
|
+
}
|
|
1392
1461
|
}
|
|
1393
1462
|
}
|
|
1463
|
+
}
|
|
1464
|
+
catch (error) {
|
|
1394
1465
|
this.callbacks.onError(refreshes[0].location, error);
|
|
1395
1466
|
}
|
|
1467
|
+
finally {
|
|
1468
|
+
if (refreshFailure !== undefined)
|
|
1469
|
+
this.callbacks.onError(refreshes[0].location, refreshFailure.error);
|
|
1470
|
+
}
|
|
1396
1471
|
}
|
|
1397
1472
|
isCompilerOutputDirectory(location) {
|
|
1398
1473
|
return [...this.outputs.values()].some((output) => WatchPaths_1.WatchPaths.isPathWithin(output, location, this.lexicalIdentities));
|
|
@@ -1694,10 +1769,11 @@ function readProjectReferences(tsconfig) {
|
|
|
1694
1769
|
return references;
|
|
1695
1770
|
}
|
|
1696
1771
|
function listCompilerInputs(project, options) {
|
|
1772
|
+
const env = SidecarEnvironment_1.SidecarEnvironment.merge(process.env, options.env);
|
|
1697
1773
|
const tsgo = (0, resolveTsgo_1.resolveTsgo)({
|
|
1698
1774
|
binary: options.binary,
|
|
1699
1775
|
cwd: project.root,
|
|
1700
|
-
env
|
|
1776
|
+
env,
|
|
1701
1777
|
});
|
|
1702
1778
|
const result = (0, spawnNative_1.spawnNative)(tsgo.binary, [
|
|
1703
1779
|
"-p",
|
|
@@ -1709,7 +1785,7 @@ function listCompilerInputs(project, options) {
|
|
|
1709
1785
|
...(options.pinCompilerProject === true ? ["-p", project.path] : []),
|
|
1710
1786
|
], {
|
|
1711
1787
|
cwd: options.compilerArgsCwd ?? project.root,
|
|
1712
|
-
env
|
|
1788
|
+
env,
|
|
1713
1789
|
encoding: "utf8",
|
|
1714
1790
|
});
|
|
1715
1791
|
if (result.error) {
|