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,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Attribute a package-resolution failure to its plugin and consumer directory.
|
|
3
|
+
*
|
|
4
|
+
* Runtime resolvers can throw objects with an empty message. The request and
|
|
5
|
+
* directory remain actionable independently of that message; the original cause
|
|
6
|
+
* and any string error code remain available to callers.
|
|
7
|
+
*
|
|
8
|
+
* @evidence contracts/common.md#principled-implementation Resolution supplies the actual specifier and consumer directory, so diagnostic context survives an empty runtime message without inferring a cause or changing resolver policy.
|
|
9
|
+
* @evidence contracts/common.md#clear-and-simple-design One error boundary enriches diagnostics while preserving the original cause and a string code.
|
|
10
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts Error attribution uses every failed request without package-name, runtime-name or message-pattern exceptions.
|
|
11
|
+
* @evidence contracts/common.md#meaningful-documentation The comment states why independent resolution context is necessary and which original failure fields survive.
|
|
12
|
+
*
|
|
13
|
+
* @evidenceExclude contracts/portability.md#os-neutral-implementation The function displays caller-supplied strings and performs no filesystem, path-identity or process operation.
|
|
14
|
+
* @evidence contracts/performance.md#efficient-algorithms One diagnostic allocation copies specifier, directory and optional message text; work and storage scale with those strings.
|
|
15
|
+
* @evidenceExclude contracts/performance.md#reuse-equivalent-work Errors describe the current failed request and own no reusable observation.
|
|
16
|
+
* @evidenceExclude contracts/performance.md#bound-retention-and-release-resources The returned error transfers its cause to the caller and owns no native resource or cross-call population.
|
|
17
|
+
*/
|
|
18
|
+
export function pluginResolutionFailure(
|
|
19
|
+
specifier: string,
|
|
20
|
+
consumerDir: string,
|
|
21
|
+
cause: unknown,
|
|
22
|
+
): Error {
|
|
23
|
+
const record =
|
|
24
|
+
typeof cause === "object" && cause !== null
|
|
25
|
+
? (cause as { code?: unknown; message?: unknown })
|
|
26
|
+
: undefined;
|
|
27
|
+
const message = typeof cause === "string" ? cause : record?.message;
|
|
28
|
+
const detail =
|
|
29
|
+
typeof message === "string" && message.trim() !== "" ? `: ${message}` : "";
|
|
30
|
+
const error = new Error(
|
|
31
|
+
`ttsc: could not resolve plugin ${JSON.stringify(specifier)} from ${JSON.stringify(consumerDir)}${detail}`,
|
|
32
|
+
{ cause },
|
|
33
|
+
);
|
|
34
|
+
return typeof record?.code === "string"
|
|
35
|
+
? Object.assign(error, { code: record.code })
|
|
36
|
+
: error;
|
|
37
|
+
}
|
|
@@ -3,6 +3,7 @@ import path from "node:path";
|
|
|
3
3
|
import { SHARE_ENV, Worker } from "node:worker_threads";
|
|
4
4
|
|
|
5
5
|
import { SidecarEnvironment } from "../../../compiler/internal/sharedHost/SidecarEnvironment";
|
|
6
|
+
import { workerModuleUrl } from "../../../internal/workerModuleUrl";
|
|
6
7
|
import { PluginBuildEnvironmentWitness } from "./PluginBuildEnvironmentWitness";
|
|
7
8
|
import { PluginContentIdentities } from "./PluginContentIdentities";
|
|
8
9
|
import { pluginBuildEnvironment } from "./pluginBuildEnvironment";
|
|
@@ -24,7 +25,7 @@ import { pluginBuildEnvironment } from "./pluginBuildEnvironment";
|
|
|
24
25
|
* @evidence contracts/common.md#clear-and-simple-design One owner shares observation records across synchronous reads, cache-only proof and asynchronous preparation.
|
|
25
26
|
* @evidence contracts/common.md#prohibited-implementation-shortcuts Cold preparation performs the same actual native Go/toolchain reading off-thread; failed or stale observations are never replaced by producer-expected state.
|
|
26
27
|
* @evidence contracts/common.md#meaningful-documentation Native prose distinguishes preparation, publication and cache-only authority; members document their separate execution responsibilities.
|
|
27
|
-
* @evidence contracts/portability.md#os-neutral-implementation Complete environment snapshots use the shared native-name merger; metadata witnesses preserve actual native filesystem and link identity.
|
|
28
|
+
* @evidence contracts/portability.md#os-neutral-implementation Complete environment snapshots use the shared native-name merger; metadata witnesses preserve actual native filesystem and link identity. A supported module URL requires the CommonJS source or emitted worker entry while Node retains inherited execution options and preload hooks.
|
|
28
29
|
* @evidenceExclude contracts/performance.md#efficient-algorithms Individual members own variable indexing, witness validation and native preparation.
|
|
29
30
|
* @evidenceExclude contracts/performance.md#reuse-equivalent-work The members specify the invalidation and sharing boundaries.
|
|
30
31
|
* @evidence contracts/performance.md#bound-retention-and-release-resources Readings replace existing keys but retain historical directory/environment keys without eviction. One idle worker and its retirement listeners remain process-owned/unreferenced; active work is ref'ed and per-request listeners are removed at settlement. Distinct requests can queue without a population bound/timeout; a stalled request can delay successors. Failed-worker termination is initiated without joining its promise, and this owner does not mutate the shared environment.
|
|
@@ -293,7 +294,12 @@ export namespace PluginBuildEnvironmentReadings {
|
|
|
293
294
|
function acquireWorker(): Worker {
|
|
294
295
|
if (worker !== undefined) return worker;
|
|
295
296
|
const created = new Worker(
|
|
296
|
-
|
|
297
|
+
workerModuleUrl(
|
|
298
|
+
path.join(
|
|
299
|
+
__dirname,
|
|
300
|
+
`pluginBuildEnvironmentWorker${path.extname(__filename)}`,
|
|
301
|
+
),
|
|
302
|
+
),
|
|
297
303
|
{ env: SHARE_ENV },
|
|
298
304
|
);
|
|
299
305
|
worker = created;
|
|
@@ -29,8 +29,7 @@ export interface ITtscCompilerContext {
|
|
|
29
29
|
* The working directory for this compiler instance.
|
|
30
30
|
*
|
|
31
31
|
* Used to discover `tsconfig.json`, resolve relative `tsconfig` paths,
|
|
32
|
-
* resolve project source files,
|
|
33
|
-
* cache paths.
|
|
32
|
+
* resolve project source files, and resolve relative cache paths.
|
|
34
33
|
*
|
|
35
34
|
* An omitted value uses `process.cwd()` when the operation resolves its
|
|
36
35
|
* context; construction does not capture that default.
|
|
@@ -49,19 +48,20 @@ export interface ITtscCompilerContext {
|
|
|
49
48
|
tsconfig?: string;
|
|
50
49
|
|
|
51
50
|
/**
|
|
52
|
-
*
|
|
51
|
+
* Source root used for source membership, native plugin cwd and cache paths.
|
|
53
52
|
*
|
|
54
|
-
*
|
|
55
|
-
*
|
|
56
|
-
*
|
|
57
|
-
*
|
|
58
|
-
* real
|
|
53
|
+
* Omission uses the resolved config directory. Set a common ancestor when the
|
|
54
|
+
* config includes sibling packages; relative paths resolve from cwd. Returned
|
|
55
|
+
* relative Go-source paths and descriptor process cwd also use this root.
|
|
56
|
+
* Plugin package resolution and factory contexts keep the selected config
|
|
57
|
+
* directory independently. Generated config wrappers supply the real consumer
|
|
58
|
+
* directory through pluginConfigDir and may retain a wider source root here.
|
|
59
59
|
*/
|
|
60
60
|
projectRoot?: string;
|
|
61
61
|
|
|
62
62
|
/**
|
|
63
|
-
*
|
|
64
|
-
* `configFile` resolution.
|
|
63
|
+
* Consumer directory for plugin packages, factory contexts, plugin
|
|
64
|
+
* config-file discovery and relative `configFile` resolution.
|
|
65
65
|
*
|
|
66
66
|
* Leave this unset so plugins anchor at the directory of the resolved
|
|
67
67
|
* {@link ITtscCompilerContext.tsconfig} as usual. Embedders that compile
|
|
@@ -89,8 +89,8 @@ export interface ITtscCompilerContext {
|
|
|
89
89
|
binary?: string;
|
|
90
90
|
|
|
91
91
|
/**
|
|
92
|
-
* Additional environment variables for
|
|
93
|
-
* processes, and for the worker thread of
|
|
92
|
+
* Additional environment variables for executable selection, compiler and
|
|
93
|
+
* plugin-descriptor child processes, and for the worker thread of
|
|
94
94
|
* {@link TtscCompiler.transformAsync}.
|
|
95
95
|
*
|
|
96
96
|
* The supplied overrides are copied at construction. Values are merged over
|
|
@@ -87,11 +87,13 @@ export interface ITtscPlugin {
|
|
|
87
87
|
* linked into the selected native host and must register through
|
|
88
88
|
* `driver.RegisterPlugin`.
|
|
89
89
|
*
|
|
90
|
-
* Relative paths are resolved from the
|
|
91
|
-
*
|
|
92
|
-
*
|
|
93
|
-
*
|
|
94
|
-
*
|
|
90
|
+
* Relative paths are resolved from the compiler's source root, including an
|
|
91
|
+
* explicit projectRoot override. This can differ from the factory's consumer
|
|
92
|
+
* directory for plugin package resolution. Package descriptors published in
|
|
93
|
+
* npm packages should normally return absolute paths based on their own
|
|
94
|
+
* descriptor directory. Derive them from a factory's `context.dirname` (the
|
|
95
|
+
* load-mode-independent replacement for `__dirname`, which is undefined when
|
|
96
|
+
* ttsc loads the descriptor through ttsx or as ESM).
|
|
95
97
|
*
|
|
96
98
|
* Common layouts:
|
|
97
99
|
*
|
|
@@ -76,8 +76,8 @@ export interface ITtscPluginFactoryContext<T = ITtscProjectPluginConfig> {
|
|
|
76
76
|
plugin: T;
|
|
77
77
|
|
|
78
78
|
/**
|
|
79
|
-
* Caller-declared
|
|
80
|
-
* `configFile` resolution.
|
|
79
|
+
* Caller-declared consumer directory for plugin package discovery, factory
|
|
80
|
+
* contexts and relative `configFile` resolution.
|
|
81
81
|
*
|
|
82
82
|
* Absent for ordinary invocations, where a factory anchors config discovery
|
|
83
83
|
* at the {@link ITtscPluginFactoryContext.tsconfig} directory. Present when
|
|
@@ -91,13 +91,14 @@ export interface ITtscPluginFactoryContext<T = ITtscProjectPluginConfig> {
|
|
|
91
91
|
pluginConfigDir?: string;
|
|
92
92
|
|
|
93
93
|
/**
|
|
94
|
-
*
|
|
95
|
-
* discovery base.
|
|
94
|
+
* Consumer directory used for plugin package discovery.
|
|
96
95
|
*
|
|
97
|
-
*
|
|
98
|
-
*
|
|
99
|
-
*
|
|
100
|
-
*
|
|
96
|
+
* This is pluginConfigDir when supplied, otherwise the directory containing
|
|
97
|
+
* the resolved tsconfig/jsconfig. A compiler projectRoot override can widen
|
|
98
|
+
* source membership without changing this package-resolution anchor.
|
|
99
|
+
* Descriptor process cwd, native plugin cwd and returned relative source
|
|
100
|
+
* paths retain the compiler's source root; return absolute source paths when
|
|
101
|
+
* those directories differ.
|
|
101
102
|
*/
|
|
102
103
|
projectRoot: string;
|
|
103
104
|
|
|
@@ -42,10 +42,14 @@ export interface TtscSingleFileEmitOptions extends TtscCommonOptions {
|
|
|
42
42
|
* this notification is not the complete compiler or project-rule input graph.
|
|
43
43
|
* The reporting load also hands over its record store, if it opened one, so the
|
|
44
44
|
* owner proves each root's state from the plugin cache's records instead of
|
|
45
|
-
* reading the sources the load is about to prove (#1728).
|
|
45
|
+
* reading the sources the load is about to prove (#1728). Asynchronous build
|
|
46
|
+
* entries await a returned promise before reading or building those sources;
|
|
47
|
+
* synchronous entries require a synchronous handler. Separate function
|
|
48
|
+
* alternatives preserve TypeScript's void-handler assignability, including
|
|
49
|
+
* ignored non-promise return values.
|
|
46
50
|
*
|
|
47
|
-
* @evidence contracts/common.md#principled-implementation Readonly roots describe the actual native-plugin sources whose later edits need observation.
|
|
48
|
-
* @evidence contracts/common.md#clear-and-simple-design
|
|
51
|
+
* @evidence contracts/common.md#principled-implementation Readonly roots describe the actual native-plugin sources whose later edits need observation; separate void and Promise function alternatives preserve existing ignored-return callback assignability while exposing asynchronous completion.
|
|
52
|
+
* @evidence contracts/common.md#clear-and-simple-design The handoff leaves watcher construction and lifetime with the invocation owner, while its completion determines when the producer may continue.
|
|
49
53
|
* @evidence contracts/common.md#prohibited-implementation-shortcuts The supported callback neither replaces foreign watchers nor fabricates fixture-specific roots.
|
|
50
54
|
* @evidence contracts/common.md#meaningful-documentation Native prose states the source population and owner before acknowledgment tags.
|
|
51
55
|
* @evidence contracts/portability.md#os-neutral-implementation Native source paths pass through without separator rewriting, alias collapse or an encoded OS-specific watcher.
|
|
@@ -53,16 +57,23 @@ export interface TtscSingleFileEmitOptions extends TtscCommonOptions {
|
|
|
53
57
|
* @evidenceExclude contracts/performance.md#efficient-algorithms A type declaration chooses no processing strategy.
|
|
54
58
|
* @evidenceExclude contracts/performance.md#reuse-equivalent-work A type declaration computes nothing, so there is no work to share.
|
|
55
59
|
*/
|
|
56
|
-
export type TtscPluginSourceInputsHandler =
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
+
export type TtscPluginSourceInputsHandler =
|
|
61
|
+
| ((
|
|
62
|
+
inputs: readonly string[],
|
|
63
|
+
identities?: PluginContentIdentities.Store,
|
|
64
|
+
) => void)
|
|
65
|
+
| ((
|
|
66
|
+
inputs: readonly string[],
|
|
67
|
+
identities?: PluginContentIdentities.Store,
|
|
68
|
+
) => Promise<void>);
|
|
60
69
|
|
|
61
70
|
/**
|
|
62
71
|
* Receive the discovered project-rule filesystem topology for the watch owner.
|
|
72
|
+
* Asynchronous build entries await a returned promise before compilation;
|
|
73
|
+
* synchronous entries require a synchronous handler.
|
|
63
74
|
*
|
|
64
75
|
* @evidence contracts/common.md#principled-implementation The snapshot retains exact, glob and reload dependencies rather than reducing them to plugin-source roots.
|
|
65
|
-
* @evidence contracts/common.md#clear-and-simple-design A separate
|
|
76
|
+
* @evidence contracts/common.md#clear-and-simple-design A separate completion-bearing notification transfers topology without assigning watcher lifetime to the emit options.
|
|
66
77
|
* @evidence contracts/common.md#prohibited-implementation-shortcuts A discovered rule snapshot crosses a supported boundary without replacing watcher internals or inventing passing inputs.
|
|
67
78
|
* @evidence contracts/common.md#meaningful-documentation Native prose identifies the project-rule payload and watch owner before the separated tags.
|
|
68
79
|
* @evidence contracts/portability.md#os-neutral-implementation The snapshot retains native paths, explicit glob grammar and declared versus physical identities without blanket case folding.
|
|
@@ -70,6 +81,6 @@ export type TtscPluginSourceInputsHandler = (
|
|
|
70
81
|
* @evidenceExclude contracts/performance.md#efficient-algorithms A type declaration chooses no processing strategy.
|
|
71
82
|
* @evidenceExclude contracts/performance.md#reuse-equivalent-work A type declaration computes nothing, so there is no work to share.
|
|
72
83
|
*/
|
|
73
|
-
export type TtscProjectInputsHandler =
|
|
74
|
-
inputs: ITtscProjectInputSnapshot
|
|
75
|
-
) => void;
|
|
84
|
+
export type TtscProjectInputsHandler =
|
|
85
|
+
| ((inputs: ITtscProjectInputSnapshot) => void)
|
|
86
|
+
| ((inputs: ITtscProjectInputSnapshot) => Promise<void>);
|