@ttsc/unplugin 0.36.3 → 0.37.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/api.js +5 -2
- package/lib/api.js.map +1 -1
- package/lib/api.mjs +1 -1
- package/lib/core/bridge/TtscProjectRecord.d.cts +7 -0
- package/lib/core/bridge/TtscProjectRecord.d.mts +7 -0
- package/lib/core/bridge/TtscProjectRecord.d.ts +7 -0
- package/lib/core/bridge/projectRecordArgumentsMatch.d.cts +8 -5
- package/lib/core/bridge/projectRecordArgumentsMatch.d.mts +8 -5
- package/lib/core/bridge/projectRecordArgumentsMatch.d.ts +8 -5
- package/lib/core/bridge/projectRecordArgumentsMatch.js +15 -8
- package/lib/core/bridge/projectRecordArgumentsMatch.js.map +1 -1
- package/lib/core/bridge/projectRecordArgumentsMatch.mjs +15 -8
- package/lib/core/bridge/projectRecordArgumentsMatch.mjs.map +1 -1
- package/lib/core/bridge/readProjectRecordFile.js +8 -1
- package/lib/core/bridge/readProjectRecordFile.js.map +1 -1
- package/lib/core/bridge/readProjectRecordFile.mjs +8 -1
- package/lib/core/bridge/readProjectRecordFile.mjs.map +1 -1
- package/lib/core/index.js +5 -2
- package/lib/core/index.js.map +1 -1
- package/lib/core/index.mjs +1 -1
- package/lib/core/next/next.js +2 -2
- package/lib/core/next/next.js.map +1 -1
- package/lib/core/next/next.mjs +1 -1
- package/lib/core/rollup/rollupDeliveryOptions.js +2 -2
- package/lib/core/rollup/rollupDeliveryOptions.js.map +1 -1
- package/lib/core/rollup/rollupDeliveryOptions.mjs +1 -1
- package/lib/core/transform/cache/selectCachedGenerationAction.d.cts +12 -4
- package/lib/core/transform/cache/selectCachedGenerationAction.d.mts +12 -4
- package/lib/core/transform/cache/selectCachedGenerationAction.d.ts +12 -4
- package/lib/core/transform/cache/selectCachedGenerationAction.js +16 -9
- package/lib/core/transform/cache/selectCachedGenerationAction.js.map +1 -1
- package/lib/core/transform/cache/selectCachedGenerationAction.mjs +16 -9
- package/lib/core/transform/cache/selectCachedGenerationAction.mjs.map +1 -1
- package/lib/core/transform/clock/filesystemListingDevices.d.cts +24 -0
- package/lib/core/transform/clock/filesystemListingDevices.d.mts +24 -0
- package/lib/core/transform/clock/filesystemListingDevices.d.ts +24 -0
- package/lib/core/transform/clock/filesystemListingDevices.js +36 -0
- package/lib/core/transform/clock/filesystemListingDevices.js.map +1 -0
- package/lib/core/transform/clock/filesystemListingDevices.mjs +34 -0
- package/lib/core/transform/clock/filesystemListingDevices.mjs.map +1 -0
- package/lib/core/transform/clock/refreshFilesystemClockReference.d.cts +10 -4
- package/lib/core/transform/clock/refreshFilesystemClockReference.d.mts +10 -4
- package/lib/core/transform/clock/refreshFilesystemClockReference.d.ts +10 -4
- package/lib/core/transform/clock/refreshFilesystemClockReference.js +40 -4
- package/lib/core/transform/clock/refreshFilesystemClockReference.js.map +1 -1
- package/lib/core/transform/clock/refreshFilesystemClockReference.mjs +40 -4
- package/lib/core/transform/clock/refreshFilesystemClockReference.mjs.map +1 -1
- package/lib/core/transform/generation/captureTransformGeneration.js +8 -2
- package/lib/core/transform/generation/captureTransformGeneration.js.map +1 -1
- package/lib/core/transform/generation/captureTransformGeneration.mjs +8 -2
- package/lib/core/transform/generation/captureTransformGeneration.mjs.map +1 -1
- package/lib/core/transform/inputs/pluginSourceFilesDigest.d.cts +7 -1
- package/lib/core/transform/inputs/pluginSourceFilesDigest.d.mts +7 -1
- package/lib/core/transform/inputs/pluginSourceFilesDigest.d.ts +7 -1
- package/lib/core/transform/inputs/pluginSourceFilesDigest.js +66 -4
- package/lib/core/transform/inputs/pluginSourceFilesDigest.js.map +1 -1
- package/lib/core/transform/inputs/pluginSourceFilesDigest.mjs +66 -4
- package/lib/core/transform/inputs/pluginSourceFilesDigest.mjs.map +1 -1
- package/lib/core/transform/session/claimSharedCompile.d.cts +12 -1
- package/lib/core/transform/session/claimSharedCompile.d.mts +12 -1
- package/lib/core/transform/session/claimSharedCompile.d.ts +12 -1
- package/lib/core/transform/session/claimSharedCompile.js +22 -4
- package/lib/core/transform/session/claimSharedCompile.js.map +1 -1
- package/lib/core/transform/session/claimSharedCompile.mjs +22 -4
- package/lib/core/transform/session/claimSharedCompile.mjs.map +1 -1
- package/lib/core/transform/transformTtsc.js +3 -2
- package/lib/core/transform/transformTtsc.js.map +1 -1
- package/lib/core/transform/transformTtsc.mjs +2 -1
- package/lib/core/transform/transformTtsc.mjs.map +1 -1
- package/lib/core/transform/tsconfig/resolveCompilerEnvironment.d.cts +1 -17
- package/lib/core/transform/tsconfig/resolveCompilerEnvironment.d.mts +1 -17
- package/lib/core/transform/tsconfig/resolveCompilerEnvironment.d.ts +1 -17
- package/lib/core/transform/tsconfig/resolveCompilerEnvironment.js +7 -53
- package/lib/core/transform/tsconfig/resolveCompilerEnvironment.js.map +1 -1
- package/lib/core/transform/tsconfig/resolveCompilerEnvironment.mjs +1 -54
- package/lib/core/transform/tsconfig/resolveCompilerEnvironment.mjs.map +1 -1
- package/lib/core/transform/validation/captureUniversalHostInputValidation.d.cts +10 -2
- package/lib/core/transform/validation/captureUniversalHostInputValidation.d.mts +10 -2
- package/lib/core/transform/validation/captureUniversalHostInputValidation.d.ts +10 -2
- package/lib/core/transform/validation/captureUniversalHostInputValidation.js +19 -2
- package/lib/core/transform/validation/captureUniversalHostInputValidation.js.map +1 -1
- package/lib/core/transform/validation/captureUniversalHostInputValidation.mjs +19 -2
- package/lib/core/transform/validation/captureUniversalHostInputValidation.mjs.map +1 -1
- package/lib/core/transform/validation/environmentInputMismatch.d.cts +23 -0
- package/lib/core/transform/validation/environmentInputMismatch.d.mts +23 -0
- package/lib/core/transform/validation/environmentInputMismatch.d.ts +23 -0
- package/lib/core/transform/validation/environmentInputMismatch.js +46 -0
- package/lib/core/transform/validation/environmentInputMismatch.js.map +1 -0
- package/lib/core/transform/validation/environmentInputMismatch.mjs +44 -0
- package/lib/core/transform/validation/environmentInputMismatch.mjs.map +1 -0
- package/lib/core/transform/validation/isEnvironmentInputs.d.cts +15 -0
- package/lib/core/transform/validation/isEnvironmentInputs.d.mts +15 -0
- package/lib/core/transform/validation/isEnvironmentInputs.d.ts +15 -0
- package/lib/core/transform/validation/isEnvironmentInputs.js +26 -0
- package/lib/core/transform/validation/isEnvironmentInputs.js.map +1 -0
- package/lib/core/transform/validation/isEnvironmentInputs.mjs +24 -0
- package/lib/core/transform/validation/isEnvironmentInputs.mjs.map +1 -0
- package/lib/core/transform/watch/TtscTransformHooks.d.cts +6 -4
- package/lib/core/transform/watch/TtscTransformHooks.d.mts +6 -4
- package/lib/core/transform/watch/TtscTransformHooks.d.ts +6 -4
- package/lib/core/transform/watch/handWatchInputs.d.cts +3 -1
- package/lib/core/transform/watch/handWatchInputs.d.mts +3 -1
- package/lib/core/transform/watch/handWatchInputs.d.ts +3 -1
- package/lib/core/transform/watch/handWatchInputs.js +7 -2
- package/lib/core/transform/watch/handWatchInputs.js.map +1 -1
- package/lib/core/transform/watch/handWatchInputs.mjs +7 -2
- package/lib/core/transform/watch/handWatchInputs.mjs.map +1 -1
- package/lib/core/transform/watch/notifyFailedGenerationInputs.js +3 -1
- package/lib/core/transform/watch/notifyFailedGenerationInputs.js.map +1 -1
- package/lib/core/transform/watch/notifyFailedGenerationInputs.mjs +3 -1
- package/lib/core/transform/watch/notifyFailedGenerationInputs.mjs.map +1 -1
- package/lib/core/transform/watch/notifyProjectRecord.js +4 -0
- package/lib/core/transform/watch/notifyProjectRecord.js.map +1 -1
- package/lib/core/transform/watch/notifyProjectRecord.mjs +4 -0
- package/lib/core/transform/watch/notifyProjectRecord.mjs.map +1 -1
- package/lib/core/transform/watch/notifyWatchInputs.js +3 -1
- package/lib/core/transform/watch/notifyWatchInputs.js.map +1 -1
- package/lib/core/transform/watch/notifyWatchInputs.mjs +3 -1
- package/lib/core/transform/watch/notifyWatchInputs.mjs.map +1 -1
- package/lib/core/turbopack/turbopack.js +2 -2
- package/lib/core/turbopack/turbopack.js.map +1 -1
- package/lib/core/turbopack/turbopack.mjs +1 -1
- package/lib/core/unplugin.js +3 -3
- package/lib/core/unplugin.js.map +1 -1
- package/lib/core/unplugin.mjs +1 -1
- package/package.json +3 -3
- package/src/core/bridge/TtscProjectRecord.ts +8 -0
- package/src/core/bridge/projectRecordArgumentsMatch.ts +19 -7
- package/src/core/bridge/readProjectRecordFile.ts +8 -1
- package/src/core/transform/cache/selectCachedGenerationAction.ts +19 -4
- package/src/core/transform/clock/filesystemListingDevices.ts +38 -0
- package/src/core/transform/clock/refreshFilesystemClockReference.ts +42 -4
- package/src/core/transform/generation/captureTransformGeneration.ts +8 -1
- package/src/core/transform/inputs/pluginSourceFilesDigest.ts +73 -5
- package/src/core/transform/session/claimSharedCompile.ts +35 -5
- package/src/core/transform/transformTtsc.ts +1 -0
- package/src/core/transform/tsconfig/resolveCompilerEnvironment.ts +1 -61
- package/src/core/transform/validation/captureUniversalHostInputValidation.ts +21 -1
- package/src/core/transform/validation/environmentInputMismatch.ts +43 -0
- package/src/core/transform/validation/isEnvironmentInputs.ts +28 -0
- package/src/core/transform/watch/TtscTransformHooks.ts +6 -3
- package/src/core/transform/watch/handWatchInputs.ts +5 -1
- package/src/core/transform/watch/notifyFailedGenerationInputs.ts +3 -0
- package/src/core/transform/watch/notifyProjectRecord.ts +5 -0
- package/src/core/transform/watch/notifyWatchInputs.ts +8 -1
|
@@ -21,6 +21,7 @@ import { pluginSourceHolds } from "../inputs/pluginSourceHolds";
|
|
|
21
21
|
import { usesPreparedPluginBuildEnvironments } from "../inputs/preparePluginBuildEnvironments";
|
|
22
22
|
import { sameHostInputRealpath } from "../inputs/sameHostInputRealpath";
|
|
23
23
|
import type { TtscHostInputValidation } from "./TtscHostInputValidation";
|
|
24
|
+
import { environmentInputMismatch } from "./environmentInputMismatch";
|
|
24
25
|
import { matchesRecordedInput } from "./matchesRecordedInput";
|
|
25
26
|
|
|
26
27
|
/**
|
|
@@ -36,7 +37,13 @@ import { matchesRecordedInput } from "./matchesRecordedInput";
|
|
|
36
37
|
* callers retain the original native observation API; result identity records
|
|
37
38
|
* async execution ownership even when preparation fails.
|
|
38
39
|
*
|
|
39
|
-
*
|
|
40
|
+
* Recorded environment reads are universal inputs too. Each must still have its
|
|
41
|
+
* recorded value, or stay unset, in `environment`, the compiler environment the
|
|
42
|
+
* generation is admitted under; an adopted publication recorded under another
|
|
43
|
+
* value fails here like a changed host input. They need no manifest entry:
|
|
44
|
+
* delivery compares them against its own snapshot.
|
|
45
|
+
*
|
|
46
|
+
* @evidence contracts/common.md#principled-implementation Evaluation-time content and physical-target witnesses and recorded environment values must agree with the generation snapshot before reuse; explicit producer observation unavailability remains distinct from changed, contradictory or unexplained missing proof, and every input is checked before classifying the attempt.
|
|
40
47
|
* @evidence contracts/common.md#clear-and-simple-design One admission operation builds the manifest; per-entry, grouped or exact-native absence and tree validators own its subsequent checks.
|
|
41
48
|
* @evidence contracts/common.md#prohibited-implementation-shortcuts A missing publication witness declines narrow reuse instead of certifying an input from a convenient newer read.
|
|
42
49
|
* @evidence contracts/common.md#meaningful-documentation Native prose explains failed admission and successful generation attachment; inline comments justify readable-state, blocker and tree distinctions.
|
|
@@ -48,6 +55,8 @@ import { matchesRecordedInput } from "./matchesRecordedInput";
|
|
|
48
55
|
export function captureUniversalHostInputValidation(
|
|
49
56
|
cached: TtscCachedProjectTransform,
|
|
50
57
|
currentFile: string,
|
|
58
|
+
/** Compiler environment the generation is admitted under. */
|
|
59
|
+
environment: NodeJS.ProcessEnv,
|
|
51
60
|
): {
|
|
52
61
|
/** Classified reasons why universal input authority could not be admitted. */
|
|
53
62
|
failures: TtscGenerationProofFailures;
|
|
@@ -81,6 +90,17 @@ export function captureUniversalHostInputValidation(
|
|
|
81
90
|
detail: "observer-incomplete",
|
|
82
91
|
});
|
|
83
92
|
}
|
|
93
|
+
const environmentChanged = environmentInputMismatch(
|
|
94
|
+
result.type === "exception" ? undefined : result.environmentInputs,
|
|
95
|
+
environment,
|
|
96
|
+
);
|
|
97
|
+
if (environmentChanged !== undefined) {
|
|
98
|
+
recordGenerationProofFailure(failures, {
|
|
99
|
+
domain: "host",
|
|
100
|
+
kind: "environment-changed",
|
|
101
|
+
detail: environmentChanged,
|
|
102
|
+
});
|
|
103
|
+
}
|
|
84
104
|
for (const [input, reason] of Object.entries(proofFailures ?? {})) {
|
|
85
105
|
recordGenerationProofFailure(failures, {
|
|
86
106
|
domain: "host",
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Name the first recorded environment read that no longer has its recorded
|
|
3
|
+
* value, or stays unset, in `environment`; `undefined` when every read holds.
|
|
4
|
+
*
|
|
5
|
+
* Native plugins record each variable they read through `ctx.Env` in the
|
|
6
|
+
* envelope's `environmentInputs`, which generations, publications and project
|
|
7
|
+
* records carry. Output is reusable only under an environment that would make
|
|
8
|
+
* every such read return what it returned, so callers compare against the
|
|
9
|
+
* compiler environment snapshot (`resolveCompilerEnvironment`) a recompile
|
|
10
|
+
* would run under. A cache key cannot carry these names: only the compile
|
|
11
|
+
* discovers them. An absent record, from an exception or from plugins that read
|
|
12
|
+
* no variable, always holds.
|
|
13
|
+
*
|
|
14
|
+
* @evidence contracts/common.md#principled-implementation Equality of each recorded value or absence with the supplied snapshot is exactly the condition under which the plugin's reads would repeat; unrecorded variables are not inputs and are ignored.
|
|
15
|
+
* @evidence contracts/common.md#clear-and-simple-design One predicate over the recorded map serves cached delivery, capture admission, shared-store adoption and persistent project records.
|
|
16
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts No variable list, prefix or consumer name is special-cased; the recorded names alone decide what is compared.
|
|
17
|
+
* @evidence contracts/common.md#meaningful-documentation Native paragraphs state the returned name, the comparison environment, why a key cannot replace this proof and the empty case.
|
|
18
|
+
* @evidence contracts/portability.md#os-neutral-implementation Windows variable names compare case-insensitively against the snapshot, choosing the lexically first spelling as ttsc's sidecar environment does; other platforms compare names exactly.
|
|
19
|
+
* @evidence contracts/performance.md#efficient-algorithms One lookup per recorded name; on Windows each lookup scans the snapshot's names, O(recorded × environment) with both small.
|
|
20
|
+
* @evidenceExclude contracts/performance.md#reuse-equivalent-work The predicate decides reuse for its caller and retains no verdict.
|
|
21
|
+
* @evidence contracts/performance.md#bound-retention-and-release-resources Entry and Windows key arrays are call-local; no environment, verdict or native handle is retained.
|
|
22
|
+
*/
|
|
23
|
+
export function environmentInputMismatch(
|
|
24
|
+
recorded: Readonly<Record<string, string | null>> | undefined,
|
|
25
|
+
environment: NodeJS.ProcessEnv,
|
|
26
|
+
): string | undefined {
|
|
27
|
+
for (const [name, value] of Object.entries(recorded ?? {})) {
|
|
28
|
+
let current: string | undefined;
|
|
29
|
+
if (process.platform === "win32") {
|
|
30
|
+
const identity = name.toUpperCase();
|
|
31
|
+
let selected: string | undefined;
|
|
32
|
+
for (const key of Object.keys(environment))
|
|
33
|
+
if (
|
|
34
|
+
key.toUpperCase() === identity &&
|
|
35
|
+
(selected === undefined || key < selected)
|
|
36
|
+
)
|
|
37
|
+
selected = key;
|
|
38
|
+
current = selected === undefined ? undefined : environment[selected];
|
|
39
|
+
} else if (Object.hasOwn(environment, name)) current = environment[name];
|
|
40
|
+
if ((current ?? null) !== value) return name;
|
|
41
|
+
}
|
|
42
|
+
return undefined;
|
|
43
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Validate a persisted plugin environment-read map before it can authorize
|
|
3
|
+
* reuse. Optional-field omission belongs to the reader; a present field must
|
|
4
|
+
* contain nonempty names and string values or null for recorded absence.
|
|
5
|
+
*
|
|
6
|
+
* @evidence contracts/common.md#principled-implementation The complete dictionary must satisfy the native envelope's name/value contract before equality can prove its reads. Arrays and primitive whole fields cannot become an empty dependency set.
|
|
7
|
+
* @evidence contracts/common.md#clear-and-simple-design Shared-publication and project-record readers use one predicate for their common environment witness while retaining ownership of their surrounding schemas.
|
|
8
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts Invalid records are rejected whole without dropping entries, coercing values or reconstructing an earlier observation from the current environment.
|
|
9
|
+
* @evidence contracts/common.md#meaningful-documentation Native prose distinguishes reader-owned omission from a present dictionary and explains null absence.
|
|
10
|
+
* @evidenceExclude contracts/portability.md#os-neutral-implementation This checks decoded JSON names and values without reading native environment state or normalizing platform aliases.
|
|
11
|
+
* @evidence contracts/performance.md#efficient-algorithms Object.entries visits own dictionary entries once; the temporary array grows with the number of recorded reads, and no value bytes are copied or hashed.
|
|
12
|
+
* @evidenceExclude contracts/performance.md#reuse-equivalent-work Each reader validates its newly decoded record; this predicate retains no prior schema verdict.
|
|
13
|
+
* @evidenceExclude contracts/performance.md#bound-retention-and-release-resources The call borrows its value and retains no state, handle or history.
|
|
14
|
+
*/
|
|
15
|
+
export function isEnvironmentInputs(
|
|
16
|
+
value: unknown,
|
|
17
|
+
): value is Record<string, string | null> {
|
|
18
|
+
return (
|
|
19
|
+
typeof value === "object" &&
|
|
20
|
+
value !== null &&
|
|
21
|
+
!Array.isArray(value) &&
|
|
22
|
+
Object.entries(value).every(
|
|
23
|
+
([name, recorded]) =>
|
|
24
|
+
name.length !== 0 &&
|
|
25
|
+
(recorded === null || typeof recorded === "string"),
|
|
26
|
+
)
|
|
27
|
+
);
|
|
28
|
+
}
|
|
@@ -61,7 +61,9 @@ export interface TtscTransformHooks {
|
|
|
61
61
|
* once per delivered module and does not call `addWatchFile` for that module.
|
|
62
62
|
* `failed` marks a recovery batch: a failed compiler can omit inputs from its
|
|
63
63
|
* previous successful result, so replacing hosts should retain those
|
|
64
|
-
* spellings until the next successful delivery.
|
|
64
|
+
* spellings until the next successful delivery. The third argument carries
|
|
65
|
+
* the generation's environment reads for hosts that include non-file inputs
|
|
66
|
+
* in their persistent keys.
|
|
65
67
|
*/
|
|
66
68
|
addWatchFiles?: TtscAddWatchFiles;
|
|
67
69
|
|
|
@@ -163,9 +165,9 @@ export type TtscAddWatchFile = (
|
|
|
163
165
|
) => void;
|
|
164
166
|
|
|
165
167
|
/**
|
|
166
|
-
* Receive a readonly input batch
|
|
168
|
+
* Receive a readonly input batch and its recorded environment reads.
|
|
167
169
|
*
|
|
168
|
-
* @evidence contracts/common.md#principled-implementation The batch and optional failure flag express replacement versus recovery delivery
|
|
170
|
+
* @evidence contracts/common.md#principled-implementation The batch and optional failure flag express replacement versus recovery delivery; optional environment reads retain non-file inputs for persistent keys.
|
|
169
171
|
* @evidence contracts/common.md#clear-and-simple-design A single named function signature preserves the optional flag and original function-property assignability.
|
|
170
172
|
* @evidence contracts/common.md#prohibited-implementation-shortcuts Recovery is an explicit host contract rather than successful evidence manufactured for a failed compile.
|
|
171
173
|
* @evidence contracts/common.md#meaningful-documentation Native prose and the owning member explain readonly batching and failed retention; separated tags follow documentation guidance.
|
|
@@ -183,6 +185,7 @@ export type TtscAddWatchFile = (
|
|
|
183
185
|
export type TtscAddWatchFiles = (
|
|
184
186
|
inputs: readonly TtscWatchInput[],
|
|
185
187
|
failed?: boolean,
|
|
188
|
+
environmentInputs?: Readonly<Record<string, string | null>>,
|
|
186
189
|
) => void;
|
|
187
190
|
|
|
188
191
|
/**
|
|
@@ -25,6 +25,8 @@ import type { TtscWatchInput } from "./TtscWatchInput";
|
|
|
25
25
|
* @param hooks The host's hooks; nothing is handed when it takes no inputs.
|
|
26
26
|
* @param inputs The inputs in the order they were derived.
|
|
27
27
|
* @param failed Whether they are a failed generation's, for a batching host.
|
|
28
|
+
* @param environmentInputs Generation-time environment reads for a batching
|
|
29
|
+
* host's persistent key, including recorded absences.
|
|
28
30
|
* @evidence contracts/common.md#principled-implementation Exact registration spellings are deduplicated with membership preferred over ordinary evidence and evidence over a recovery-only path; equal-ranked entries retain the first observation.
|
|
29
31
|
* @evidence contracts/common.md#clear-and-simple-design One precedence pass feeds either the batch callback or individual callbacks, leaving evidence derivation and bundler policy with their owners.
|
|
30
32
|
* @evidence contracts/common.md#prohibited-implementation-shortcuts Contract-defined precedence keeps the strongest available input meaning without inventing facts, and batch preference follows the supported callback contract.
|
|
@@ -38,6 +40,7 @@ export function handWatchInputs(
|
|
|
38
40
|
hooks: TtscTransformHooks | undefined,
|
|
39
41
|
inputs: readonly TtscWatchInput[],
|
|
40
42
|
failed?: boolean,
|
|
43
|
+
environmentInputs?: Readonly<Record<string, string | null>>,
|
|
41
44
|
): void {
|
|
42
45
|
const addWatchFile = hooks?.addWatchFile;
|
|
43
46
|
const addWatchFiles = hooks?.addWatchFiles;
|
|
@@ -51,7 +54,8 @@ export function handWatchInputs(
|
|
|
51
54
|
}
|
|
52
55
|
const distinct = [...chosen.values()];
|
|
53
56
|
if (addWatchFiles !== undefined) {
|
|
54
|
-
addWatchFiles(distinct, failed);
|
|
57
|
+
if (environmentInputs === undefined) addWatchFiles(distinct, failed);
|
|
58
|
+
else addWatchFiles(distinct, failed, environmentInputs);
|
|
55
59
|
return;
|
|
56
60
|
}
|
|
57
61
|
for (const input of distinct) addWatchFile!(input.file, input.evidence);
|
|
@@ -226,11 +226,16 @@ function recordOf(
|
|
|
226
226
|
inputs: readonly TtscWatchInput[],
|
|
227
227
|
): TtscProjectRecord {
|
|
228
228
|
const dependencies = cached.externalDependencyInputs ?? [];
|
|
229
|
+
const environmentInputs =
|
|
230
|
+
cached.result.type === "exception"
|
|
231
|
+
? undefined
|
|
232
|
+
: cached.result.environmentInputs;
|
|
229
233
|
const record: TtscProjectRecord = {
|
|
230
234
|
...(cached.compilerArguments === undefined
|
|
231
235
|
? {}
|
|
232
236
|
: { compilerArguments: cached.compilerArguments }),
|
|
233
237
|
...(dependencies.length === 0 ? {} : { dependencies }),
|
|
238
|
+
...(environmentInputs === undefined ? {} : { environmentInputs }),
|
|
234
239
|
inputs: {},
|
|
235
240
|
membership:
|
|
236
241
|
cached.projectDirectories === undefined
|
|
@@ -98,5 +98,12 @@ export function notifyWatchInputs(
|
|
|
98
98
|
file: spell(input.file),
|
|
99
99
|
})))
|
|
100
100
|
inputs.push(entryToAppend);
|
|
101
|
-
handWatchInputs(
|
|
101
|
+
handWatchInputs(
|
|
102
|
+
hooks,
|
|
103
|
+
inputs,
|
|
104
|
+
undefined,
|
|
105
|
+
cached.result.type === "exception"
|
|
106
|
+
? undefined
|
|
107
|
+
: cached.result.environmentInputs,
|
|
108
|
+
);
|
|
102
109
|
}
|