ttsc 0.31.5 → 0.32.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/cmd/ttsc/compiler_argument_cwd_test.go +38 -38
- package/cmd/ttscserver/main.go +2 -12
- package/cmd/ttscserver/resolve_launch_uses_native_flag_authority_test.go +7 -7
- package/driver/lsp.go +4 -43
- package/driver/rewrite.go +1 -1
- package/internal/e2etrace/completion_hints.go +3 -3
- package/internal/e2etrace/completion_hints_test.go +26 -12
- package/internal/graph/build.go +5 -6
- package/internal/graph/graph.go +3 -3
- package/internal/graph/line_model.go +2 -35
- package/internal/lspserver/lsp_clean_didopen_refreshes_compiler_state_test.go +13 -36
- package/internal/lspserver/lsp_hints_refresh_ignores_a_superseded_generation_test.go +9 -3
- package/internal/lspserver/lsp_plugin.go +19 -0
- package/internal/lspserver/lsp_proxy.go +9 -129
- package/internal/lspserver/lsp_server.go +0 -8
- package/internal/lspserver/lsp_watched_file_changes_reach_compiler_caches_test.go +6 -36
- package/internal/sourceprocess/windows_target_owns_suspended_admission_test.go +5 -5
- package/lib/compiler/internal/build/BuildExecution.js +1 -1
- package/lib/compiler/internal/build/BuildExecution.js.map +1 -1
- package/lib/compiler/internal/build/TsgoArguments.js.map +1 -1
- package/lib/compiler/internal/project/CompilerProjectSelection.d.ts +9 -8
- package/lib/compiler/internal/project/CompilerProjectSelection.js +11 -9
- package/lib/compiler/internal/project/CompilerProjectSelection.js.map +1 -1
- package/lib/compiler/internal/project/resolveOwningProjectConfig.d.ts +20 -8
- package/lib/compiler/internal/project/resolveOwningProjectConfig.js +21 -12
- package/lib/compiler/internal/project/resolveOwningProjectConfig.js.map +1 -1
- package/lib/compiler/internal/runSingleFileEmit.d.ts +5 -4
- package/lib/compiler/internal/runSingleFileEmit.js +5 -4
- package/lib/compiler/internal/runSingleFileEmit.js.map +1 -1
- package/lib/flags/ParseOptions.d.ts +2 -2
- package/lib/internal/E2ETrace.js.map +1 -1
- package/lib/internal/OwnedNativeProcess.d.ts +2 -2
- package/lib/internal/OwnedNativeProcess.js +2 -2
- package/lib/internal/SourceNativeRetirement.d.ts +8 -7
- package/lib/internal/SourceNativeRetirement.js +19 -10
- package/lib/internal/SourceNativeRetirement.js.map +1 -1
- package/lib/internal/TtsxNodeOptions.d.ts +79 -0
- package/lib/internal/TtsxNodeOptions.js +121 -0
- package/lib/internal/TtsxNodeOptions.js.map +1 -0
- package/lib/internal/javascriptRuntimeCapabilities.js +4 -1
- package/lib/internal/javascriptRuntimeCapabilities.js.map +1 -1
- package/lib/internal/parseWindowsDirectoryCaseSensitivity.d.ts +5 -5
- package/lib/internal/parseWindowsDirectoryCaseSensitivity.js +5 -5
- package/lib/internal/pathIdentity/createCaseSensitivityObservations.d.ts +35 -0
- package/lib/internal/pathIdentity/createCaseSensitivityObservations.js +209 -0
- package/lib/internal/pathIdentity/createCaseSensitivityObservations.js.map +1 -0
- package/lib/internal/pathIdentity/createFilesystemPathIdentityContext.js +2 -143
- package/lib/internal/pathIdentity/createFilesystemPathIdentityContext.js.map +1 -1
- package/lib/internal/projectInputPathIdentity.d.ts +1 -0
- package/lib/internal/projectInputPathIdentity.js +1 -0
- package/lib/internal/projectInputPathIdentity.js.map +1 -1
- package/lib/launcher/internal/parseTtsxCLI.d.ts +5 -4
- package/lib/launcher/internal/parseTtsxCLI.js +5 -4
- package/lib/launcher/internal/parseTtsxCLI.js.map +1 -1
- package/lib/launcher/internal/prepareExecution.js.map +1 -1
- package/lib/launcher/internal/resolveSingleFileOutput.d.ts +8 -9
- package/lib/launcher/internal/resolveSingleFileOutput.js +8 -9
- package/lib/launcher/internal/resolveSingleFileOutput.js.map +1 -1
- package/lib/launcher/internal/runTtsc.js +5 -5
- package/lib/launcher/internal/runTtsx.js +5 -2
- package/lib/launcher/internal/runTtsx.js.map +1 -1
- package/lib/launcher/internal/runtime/RuntimeEntrySources.d.ts +40 -0
- package/lib/launcher/internal/runtime/RuntimeEntrySources.js +57 -0
- package/lib/launcher/internal/runtime/RuntimeEntrySources.js.map +1 -0
- package/lib/launcher/internal/runtime/RuntimeProjectOwnership.d.ts +5 -4
- package/lib/launcher/internal/runtime/RuntimeProjectOwnership.js +8 -6
- package/lib/launcher/internal/runtime/RuntimeProjectOwnership.js.map +1 -1
- package/lib/launcher/internal/runtime/commonJsExportNames.d.ts +2 -1
- package/lib/launcher/internal/runtime/commonJsExportNames.js +2 -1
- package/lib/launcher/internal/runtime/commonJsExportNames.js.map +1 -1
- package/lib/launcher/internal/runtime/installRuntimeHooks.js +35 -9
- package/lib/launcher/internal/runtime/installRuntimeHooks.js.map +1 -1
- package/lib/launcher/internal/runtime/resolveRuntimeCleanTargets.js +3 -1
- package/lib/launcher/internal/runtime/resolveRuntimeCleanTargets.js.map +1 -1
- package/lib/launcher/internal/watch/WatchTopology.d.ts +74 -12
- package/lib/launcher/internal/watch/WatchTopology.js +301 -92
- package/lib/launcher/internal/watch/WatchTopology.js.map +1 -1
- package/lib/launcher/internal/watch/projectInputReloadEventShouldNotify.d.ts +4 -1
- package/lib/launcher/internal/watch/projectInputReloadEventShouldNotify.js +3 -2
- package/lib/launcher/internal/watch/projectInputReloadEventShouldNotify.js.map +1 -1
- package/lib/plugin/internal/load/loadProjectPlugins.js +13 -7
- package/lib/plugin/internal/load/loadProjectPlugins.js.map +1 -1
- package/lib/plugin/internal/load/resolveNativeSource.js +2 -3
- package/lib/plugin/internal/load/resolveNativeSource.js.map +1 -1
- package/lib/plugin/internal/source/pluginModuleReplaceDirectories.d.ts +4 -1
- package/lib/plugin/internal/source/pluginModuleReplaceDirectories.js +9 -2
- package/lib/plugin/internal/source/pluginModuleReplaceDirectories.js.map +1 -1
- package/lib/structures/internal/TtscCommonOptions.d.ts +2 -2
- package/package.json +9 -9
- package/src/compiler/internal/build/BuildExecution.ts +5 -2
- package/src/compiler/internal/build/TsgoArguments.ts +4 -1
- package/src/compiler/internal/project/CompilerProjectSelection.ts +14 -14
- package/src/compiler/internal/project/resolveOwningProjectConfig.ts +29 -14
- package/src/compiler/internal/runSingleFileEmit.ts +11 -7
- package/src/flags/ParseOptions.ts +2 -2
- package/src/internal/E2ETrace.ts +3 -1
- package/src/internal/OwnedNativeProcess.ts +2 -2
- package/src/internal/SourceNativeRetirement.ts +42 -19
- package/src/internal/TtsxNodeOptions.ts +124 -0
- package/src/internal/javascriptRuntimeCapabilities.ts +6 -1
- package/src/internal/parseWindowsDirectoryCaseSensitivity.ts +5 -5
- package/src/internal/pathIdentity/createCaseSensitivityObservations.ts +242 -0
- package/src/internal/pathIdentity/createFilesystemPathIdentityContext.ts +2 -169
- package/src/internal/projectInputPathIdentity.ts +1 -0
- package/src/launcher/internal/parseTtsxCLI.ts +5 -4
- package/src/launcher/internal/prepareExecution.ts +4 -1
- package/src/launcher/internal/resolveSingleFileOutput.ts +8 -9
- package/src/launcher/internal/runTtsc.ts +5 -5
- package/src/launcher/internal/runTtsx.ts +17 -8
- package/src/launcher/internal/runtime/RuntimeEntrySources.ts +57 -0
- package/src/launcher/internal/runtime/RuntimeProjectOwnership.ts +23 -10
- package/src/launcher/internal/runtime/commonJsExportNames.ts +11 -4
- package/src/launcher/internal/runtime/installRuntimeHooks.ts +55 -13
- package/src/launcher/internal/runtime/resolveRuntimeCleanTargets.ts +17 -5
- package/src/launcher/internal/watch/WatchTopology.ts +387 -99
- package/src/launcher/internal/watch/projectInputReloadEventShouldNotify.ts +14 -9
- package/src/plugin/internal/load/loadProjectPlugins.ts +13 -1
- package/src/plugin/internal/load/resolveNativeSource.ts +10 -4
- package/src/plugin/internal/source/pluginModuleReplaceDirectories.ts +10 -1
- package/src/structures/internal/TtscCommonOptions.ts +2 -2
- package/internal/graphsymbols/position_helpers_follow_ecma_line_terminators_test.go +0 -78
- package/internal/graphsymbols/provider.go +0 -650
- package/internal/lspserver/lsp_symbols.go +0 -212
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The `NODE_OPTIONS` a ttsx run received, beside the value it gave its program
|
|
3
|
+
* after appending its own preloads.
|
|
4
|
+
*
|
|
5
|
+
* Ttsx appends its runtime preloads (`register.js`, `runtimeOwnerPreload.js`,
|
|
6
|
+
* `runtimeHookPreload.js`) to the program's `NODE_OPTIONS`, so every process
|
|
7
|
+
* the program starts inherits the source loader. ttsc's own helper processes,
|
|
8
|
+
* the runtime capability probe and the plugin descriptor evaluator, are not the
|
|
9
|
+
* program's. They must neither run those preloads nor count them as a user's
|
|
10
|
+
* startup code: both helpers refuse their caches for any non-empty
|
|
11
|
+
* `NODE_OPTIONS`, so ttsx's own preloads re-probed Node and re-evaluated every
|
|
12
|
+
* descriptor on every plugin load of a run (samchon/ttsc#1740). A user's own
|
|
13
|
+
* `NODE_OPTIONS` still reaches the helpers and still disables both caches.
|
|
14
|
+
*
|
|
15
|
+
* The record travels to every descendant of the program, and a descendant may
|
|
16
|
+
* set its own `NODE_OPTIONS`. So the received value is restored only while
|
|
17
|
+
* `NODE_OPTIONS` is still exactly the value ttsx gave; any other value is the
|
|
18
|
+
* process's own and reaches its helpers unchanged.
|
|
19
|
+
*
|
|
20
|
+
* @evidence contracts/common.md#principled-implementation The received and given values are recorded together before the program starts, and the received value is restored only while the given one is still in force, so helpers see exactly the options their process was started with by its user.
|
|
21
|
+
* @evidence contracts/common.md#clear-and-simple-design One channel, one producer for launchers, one reader for nested launchers and one environment projection for helpers.
|
|
22
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts No option string is parsed or filtered; values are carried and compared verbatim.
|
|
23
|
+
* @evidence contracts/common.md#meaningful-documentation Native prose names the preloads, the helpers, the cache refusals, the descendant case and the user case that stays conservative.
|
|
24
|
+
* @evidence contracts/portability.md#os-neutral-implementation Reads and writes go through SidecarEnvironment, which applies Windows' case-insensitive variable identity.
|
|
25
|
+
* @evidence contracts/performance.md#efficient-algorithms Each call reads at most two variables, decodes one short JSON pair and copies one environment.
|
|
26
|
+
* @evidence contracts/performance.md#reuse-equivalent-work Restoring the user's options is what lets the helpers' existing caches serve a ttsx run.
|
|
27
|
+
* @evidenceExclude contracts/performance.md#bound-retention-and-release-resources Nothing is retained; the returned environment belongs to the caller.
|
|
28
|
+
*/
|
|
29
|
+
export declare namespace TtsxNodeOptions {
|
|
30
|
+
/** The channel carrying `[received, given]` as JSON. */
|
|
31
|
+
const RECORD = "TTSX_NODE_OPTIONS_RECORD";
|
|
32
|
+
/**
|
|
33
|
+
* The variables a ttsx run gives its program: `given` as `NODE_OPTIONS` and
|
|
34
|
+
* the record of what it received from `env`.
|
|
35
|
+
*
|
|
36
|
+
* @evidence contracts/common.md#principled-implementation The record pairs the value received before any preload with the exact value given, so later readers can tell whether ttsx's value is still in force.
|
|
37
|
+
* @evidence contracts/common.md#clear-and-simple-design One call returns both variables a launcher spreads into its child environment.
|
|
38
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts Both values are recorded verbatim; nothing is parsed or filtered.
|
|
39
|
+
* @evidence contracts/common.md#meaningful-documentation Native prose names both returned variables and where the received value comes from.
|
|
40
|
+
* @evidence contracts/portability.md#os-neutral-implementation The received value is read through `received`, which uses SidecarEnvironment's Windows-aware variable identity.
|
|
41
|
+
* @evidence contracts/performance.md#efficient-algorithms One read through `received` and one JSON encoding of two strings.
|
|
42
|
+
* @evidenceExclude contracts/performance.md#reuse-equivalent-work A launcher calls it once per child; there is no work to share.
|
|
43
|
+
* @evidenceExclude contracts/performance.md#bound-retention-and-release-resources The returned variables belong to the caller; nothing is retained.
|
|
44
|
+
*/
|
|
45
|
+
function give(env: NodeJS.ProcessEnv, given: string): {
|
|
46
|
+
NODE_OPTIONS: string;
|
|
47
|
+
[RECORD]: string;
|
|
48
|
+
};
|
|
49
|
+
/**
|
|
50
|
+
* The `NODE_OPTIONS` a process received from its user: an enclosing ttsx
|
|
51
|
+
* run's received value while its given value is still in force, else the
|
|
52
|
+
* process's own.
|
|
53
|
+
*
|
|
54
|
+
* @evidence contracts/common.md#principled-implementation The enclosing record answers only while its given value equals the current one; any other value is the process's own.
|
|
55
|
+
* @evidence contracts/common.md#clear-and-simple-design One comparison selects between the record and the current value.
|
|
56
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts A malformed record is ignored rather than repaired.
|
|
57
|
+
* @evidence contracts/common.md#meaningful-documentation Native prose states both outcomes.
|
|
58
|
+
* @evidence contracts/portability.md#os-neutral-implementation Variables are read through SidecarEnvironment, which applies Windows' case-insensitive variable identity.
|
|
59
|
+
* @evidence contracts/performance.md#efficient-algorithms Two variable reads and one JSON decode of a short pair.
|
|
60
|
+
* @evidenceExclude contracts/performance.md#reuse-equivalent-work Each call answers from the given environment; there is nothing to share.
|
|
61
|
+
* @evidenceExclude contracts/performance.md#bound-retention-and-release-resources Nothing is retained.
|
|
62
|
+
*/
|
|
63
|
+
function received(env: NodeJS.ProcessEnv): string;
|
|
64
|
+
/**
|
|
65
|
+
* The environment for a ttsc helper process: `NODE_OPTIONS` restored to the
|
|
66
|
+
* received value while an enclosing ttsx run's given value is in force,
|
|
67
|
+
* unchanged anywhere else.
|
|
68
|
+
*
|
|
69
|
+
* @evidence contracts/common.md#principled-implementation Only ttsx's own appended preloads are withdrawn, and only while ttsx's value is in force; a user's or descendant's value reaches the helper.
|
|
70
|
+
* @evidence contracts/common.md#clear-and-simple-design One projection returns either the input environment or one copy with a single variable replaced.
|
|
71
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts No option string is edited; the received value replaces the given one whole.
|
|
72
|
+
* @evidence contracts/common.md#meaningful-documentation Native prose states when the environment is changed and when it is returned unchanged.
|
|
73
|
+
* @evidence contracts/portability.md#os-neutral-implementation SidecarEnvironment reads and writes the variable under Windows' case-insensitive identity.
|
|
74
|
+
* @evidence contracts/performance.md#efficient-algorithms Two variable reads, one JSON decode and at most one environment copy.
|
|
75
|
+
* @evidence contracts/performance.md#reuse-equivalent-work Restoring the user's options lets the probe and descriptor caches serve a ttsx run.
|
|
76
|
+
* @evidenceExclude contracts/performance.md#bound-retention-and-release-resources The returned environment belongs to the caller; nothing is retained.
|
|
77
|
+
*/
|
|
78
|
+
function forHelpers(env: NodeJS.ProcessEnv): NodeJS.ProcessEnv;
|
|
79
|
+
}
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TtsxNodeOptions = void 0;
|
|
4
|
+
const SidecarEnvironment_1 = require("../compiler/internal/sharedHost/SidecarEnvironment");
|
|
5
|
+
/**
|
|
6
|
+
* The `NODE_OPTIONS` a ttsx run received, beside the value it gave its program
|
|
7
|
+
* after appending its own preloads.
|
|
8
|
+
*
|
|
9
|
+
* Ttsx appends its runtime preloads (`register.js`, `runtimeOwnerPreload.js`,
|
|
10
|
+
* `runtimeHookPreload.js`) to the program's `NODE_OPTIONS`, so every process
|
|
11
|
+
* the program starts inherits the source loader. ttsc's own helper processes,
|
|
12
|
+
* the runtime capability probe and the plugin descriptor evaluator, are not the
|
|
13
|
+
* program's. They must neither run those preloads nor count them as a user's
|
|
14
|
+
* startup code: both helpers refuse their caches for any non-empty
|
|
15
|
+
* `NODE_OPTIONS`, so ttsx's own preloads re-probed Node and re-evaluated every
|
|
16
|
+
* descriptor on every plugin load of a run (samchon/ttsc#1740). A user's own
|
|
17
|
+
* `NODE_OPTIONS` still reaches the helpers and still disables both caches.
|
|
18
|
+
*
|
|
19
|
+
* The record travels to every descendant of the program, and a descendant may
|
|
20
|
+
* set its own `NODE_OPTIONS`. So the received value is restored only while
|
|
21
|
+
* `NODE_OPTIONS` is still exactly the value ttsx gave; any other value is the
|
|
22
|
+
* process's own and reaches its helpers unchanged.
|
|
23
|
+
*
|
|
24
|
+
* @evidence contracts/common.md#principled-implementation The received and given values are recorded together before the program starts, and the received value is restored only while the given one is still in force, so helpers see exactly the options their process was started with by its user.
|
|
25
|
+
* @evidence contracts/common.md#clear-and-simple-design One channel, one producer for launchers, one reader for nested launchers and one environment projection for helpers.
|
|
26
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts No option string is parsed or filtered; values are carried and compared verbatim.
|
|
27
|
+
* @evidence contracts/common.md#meaningful-documentation Native prose names the preloads, the helpers, the cache refusals, the descendant case and the user case that stays conservative.
|
|
28
|
+
* @evidence contracts/portability.md#os-neutral-implementation Reads and writes go through SidecarEnvironment, which applies Windows' case-insensitive variable identity.
|
|
29
|
+
* @evidence contracts/performance.md#efficient-algorithms Each call reads at most two variables, decodes one short JSON pair and copies one environment.
|
|
30
|
+
* @evidence contracts/performance.md#reuse-equivalent-work Restoring the user's options is what lets the helpers' existing caches serve a ttsx run.
|
|
31
|
+
* @evidenceExclude contracts/performance.md#bound-retention-and-release-resources Nothing is retained; the returned environment belongs to the caller.
|
|
32
|
+
*/
|
|
33
|
+
var TtsxNodeOptions;
|
|
34
|
+
(function (TtsxNodeOptions) {
|
|
35
|
+
/** The channel carrying `[received, given]` as JSON. */
|
|
36
|
+
TtsxNodeOptions.RECORD = "TTSX_NODE_OPTIONS_RECORD";
|
|
37
|
+
/**
|
|
38
|
+
* The variables a ttsx run gives its program: `given` as `NODE_OPTIONS` and
|
|
39
|
+
* the record of what it received from `env`.
|
|
40
|
+
*
|
|
41
|
+
* @evidence contracts/common.md#principled-implementation The record pairs the value received before any preload with the exact value given, so later readers can tell whether ttsx's value is still in force.
|
|
42
|
+
* @evidence contracts/common.md#clear-and-simple-design One call returns both variables a launcher spreads into its child environment.
|
|
43
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts Both values are recorded verbatim; nothing is parsed or filtered.
|
|
44
|
+
* @evidence contracts/common.md#meaningful-documentation Native prose names both returned variables and where the received value comes from.
|
|
45
|
+
* @evidence contracts/portability.md#os-neutral-implementation The received value is read through `received`, which uses SidecarEnvironment's Windows-aware variable identity.
|
|
46
|
+
* @evidence contracts/performance.md#efficient-algorithms One read through `received` and one JSON encoding of two strings.
|
|
47
|
+
* @evidenceExclude contracts/performance.md#reuse-equivalent-work A launcher calls it once per child; there is no work to share.
|
|
48
|
+
* @evidenceExclude contracts/performance.md#bound-retention-and-release-resources The returned variables belong to the caller; nothing is retained.
|
|
49
|
+
*/
|
|
50
|
+
function give(env, given) {
|
|
51
|
+
return {
|
|
52
|
+
NODE_OPTIONS: given,
|
|
53
|
+
[TtsxNodeOptions.RECORD]: JSON.stringify([received(env), given]),
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
TtsxNodeOptions.give = give;
|
|
57
|
+
/**
|
|
58
|
+
* The `NODE_OPTIONS` a process received from its user: an enclosing ttsx
|
|
59
|
+
* run's received value while its given value is still in force, else the
|
|
60
|
+
* process's own.
|
|
61
|
+
*
|
|
62
|
+
* @evidence contracts/common.md#principled-implementation The enclosing record answers only while its given value equals the current one; any other value is the process's own.
|
|
63
|
+
* @evidence contracts/common.md#clear-and-simple-design One comparison selects between the record and the current value.
|
|
64
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts A malformed record is ignored rather than repaired.
|
|
65
|
+
* @evidence contracts/common.md#meaningful-documentation Native prose states both outcomes.
|
|
66
|
+
* @evidence contracts/portability.md#os-neutral-implementation Variables are read through SidecarEnvironment, which applies Windows' case-insensitive variable identity.
|
|
67
|
+
* @evidence contracts/performance.md#efficient-algorithms Two variable reads and one JSON decode of a short pair.
|
|
68
|
+
* @evidenceExclude contracts/performance.md#reuse-equivalent-work Each call answers from the given environment; there is nothing to share.
|
|
69
|
+
* @evidenceExclude contracts/performance.md#bound-retention-and-release-resources Nothing is retained.
|
|
70
|
+
*/
|
|
71
|
+
function received(env) {
|
|
72
|
+
const current = SidecarEnvironment_1.SidecarEnvironment.read(env, "NODE_OPTIONS") ?? "";
|
|
73
|
+
const record = readRecord(env);
|
|
74
|
+
return record !== undefined && record.given === current
|
|
75
|
+
? record.received
|
|
76
|
+
: current;
|
|
77
|
+
}
|
|
78
|
+
TtsxNodeOptions.received = received;
|
|
79
|
+
/**
|
|
80
|
+
* The environment for a ttsc helper process: `NODE_OPTIONS` restored to the
|
|
81
|
+
* received value while an enclosing ttsx run's given value is in force,
|
|
82
|
+
* unchanged anywhere else.
|
|
83
|
+
*
|
|
84
|
+
* @evidence contracts/common.md#principled-implementation Only ttsx's own appended preloads are withdrawn, and only while ttsx's value is in force; a user's or descendant's value reaches the helper.
|
|
85
|
+
* @evidence contracts/common.md#clear-and-simple-design One projection returns either the input environment or one copy with a single variable replaced.
|
|
86
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts No option string is edited; the received value replaces the given one whole.
|
|
87
|
+
* @evidence contracts/common.md#meaningful-documentation Native prose states when the environment is changed and when it is returned unchanged.
|
|
88
|
+
* @evidence contracts/portability.md#os-neutral-implementation SidecarEnvironment reads and writes the variable under Windows' case-insensitive identity.
|
|
89
|
+
* @evidence contracts/performance.md#efficient-algorithms Two variable reads, one JSON decode and at most one environment copy.
|
|
90
|
+
* @evidence contracts/performance.md#reuse-equivalent-work Restoring the user's options lets the probe and descriptor caches serve a ttsx run.
|
|
91
|
+
* @evidenceExclude contracts/performance.md#bound-retention-and-release-resources The returned environment belongs to the caller; nothing is retained.
|
|
92
|
+
*/
|
|
93
|
+
function forHelpers(env) {
|
|
94
|
+
const record = readRecord(env);
|
|
95
|
+
const current = SidecarEnvironment_1.SidecarEnvironment.read(env, "NODE_OPTIONS") ?? "";
|
|
96
|
+
if (record === undefined || record.given !== current)
|
|
97
|
+
return env;
|
|
98
|
+
const helper = { ...env };
|
|
99
|
+
SidecarEnvironment_1.SidecarEnvironment.write(helper, "NODE_OPTIONS", record.received.trim() === "" ? undefined : record.received);
|
|
100
|
+
return helper;
|
|
101
|
+
}
|
|
102
|
+
TtsxNodeOptions.forHelpers = forHelpers;
|
|
103
|
+
function readRecord(env) {
|
|
104
|
+
const text = SidecarEnvironment_1.SidecarEnvironment.read(env, TtsxNodeOptions.RECORD);
|
|
105
|
+
if (text === undefined)
|
|
106
|
+
return undefined;
|
|
107
|
+
try {
|
|
108
|
+
const value = JSON.parse(text);
|
|
109
|
+
return Array.isArray(value) &&
|
|
110
|
+
value.length === 2 &&
|
|
111
|
+
typeof value[0] === "string" &&
|
|
112
|
+
typeof value[1] === "string"
|
|
113
|
+
? { given: value[1], received: value[0] }
|
|
114
|
+
: undefined;
|
|
115
|
+
}
|
|
116
|
+
catch {
|
|
117
|
+
return undefined;
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
})(TtsxNodeOptions || (exports.TtsxNodeOptions = TtsxNodeOptions = {}));
|
|
121
|
+
//# sourceMappingURL=TtsxNodeOptions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TtsxNodeOptions.js","sourceRoot":"","sources":["../../src/internal/TtsxNodeOptions.ts"],"names":[],"mappings":";;;AAAA,2FAAwF;AAExF;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,IAAiB,eAAe,CA6F/B;AA7FD,WAAiB,eAAe;IAC9B,wDAAwD;IAC3C,sBAAM,GAAG,0BAA0B,CAAC;IAEjD;;;;;;;;;;;;OAYG;IACH,SAAgB,IAAI,CAClB,GAAsB,EACtB,KAAa;QAEb,OAAO;YACL,YAAY,EAAE,KAAK;YACnB,CAAC,sBAAM,CAAC,EAAE,IAAI,CAAC,SAAS,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,KAAK,CAAC,CAAC;SACjD,CAAC;IACJ,CAAC;IARe,gBAAA,IAAI,OAQnB,CAAA;IAED;;;;;;;;;;;;;OAaG;IACH,SAAgB,QAAQ,CAAC,GAAsB;QAC7C,MAAM,OAAO,GAAG,uCAAkB,CAAC,IAAI,CAAC,GAAG,EAAE,cAAc,CAAC,IAAI,EAAE,CAAC;QACnE,MAAM,MAAM,GAAG,UAAU,CAAC,GAAG,CAAC,CAAC;QAC/B,OAAO,MAAM,KAAK,SAAS,IAAI,MAAM,CAAC,KAAK,KAAK,OAAO;YACrD,CAAC,CAAC,MAAM,CAAC,QAAQ;YACjB,CAAC,CAAC,OAAO,CAAC;IACd,CAAC;IANe,gBAAA,QAAQ,WAMvB,CAAA;IAED;;;;;;;;;;;;;OAaG;IACH,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C,EA7FgB,eAAe,aAAf,eAAe,GAAf,eAAe,QA6F/B"}
|
|
@@ -12,6 +12,7 @@ const SidecarEnvironment_1 = require("../compiler/internal/sharedHost/SidecarEnv
|
|
|
12
12
|
const PluginLoadAnswers_1 = require("../plugin/internal/source/PluginLoadAnswers");
|
|
13
13
|
const E2ETrace_1 = require("./E2ETrace");
|
|
14
14
|
const OwnedSynchronousProcess_1 = require("./OwnedSynchronousProcess");
|
|
15
|
+
const TtsxNodeOptions_1 = require("./TtsxNodeOptions");
|
|
15
16
|
const isSpawnSyncFdExhaustion_1 = require("./isSpawnSyncFdExhaustion");
|
|
16
17
|
const runtimeExecutableIdentity_1 = require("./runtimeExecutableIdentity");
|
|
17
18
|
const spawnSyncWithLowDescriptors_1 = require("./spawnSyncWithLowDescriptors");
|
|
@@ -42,7 +43,9 @@ const spawnSyncWithLowDescriptors_1 = require("./spawnSyncWithLowDescriptors");
|
|
|
42
43
|
* @evidence contracts/performance.md#bound-retention-and-release-resources The synchronous probe owns child completion and fallback captures; finally attempts capture close/removal, whose helper suppresses cleanup failures, so native/file release is unconfirmed on failure. Capability entries retain absolute spellings and path/identity text with no eviction quota; failed identity validation can remove an entry. Returned capability copies transfer to callers.
|
|
43
44
|
*/
|
|
44
45
|
function javascriptRuntimeCapabilities(runtime, env, cwd, identities) {
|
|
45
|
-
|
|
46
|
+
// Inside a ttsx run this is the user's NODE_OPTIONS, not ttsx's preloads,
|
|
47
|
+
// which would refuse the cache and run in the probe (#1740).
|
|
48
|
+
const effectiveEnv = TtsxNodeOptions_1.TtsxNodeOptions.forHelpers(SidecarEnvironment_1.SidecarEnvironment.merge(process.env, env));
|
|
46
49
|
const cacheKey = runtimeCapabilityCacheKey(runtime, effectiveEnv);
|
|
47
50
|
const beforeIdentity = cacheKey === undefined
|
|
48
51
|
? undefined
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"javascriptRuntimeCapabilities.js","sourceRoot":"","sources":["../../src/internal/javascriptRuntimeCapabilities.ts"],"names":[],"mappings":";;;;;;AAAA,4EAA8C;AAC9C,sDAAyB;AACzB,0DAA6B;AAE7B,oFAAiF;AACjF,2FAAwF;AAExF,mFAAgF;AAChF,yCAAsC;AAEtC,uEAAoE;AACpE,uEAAoE;AACpE,2EAAwE;AACxE,+EAA4E;AAE5E;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,uCACE,OAAe,EACf,GAAsB,EACtB,GAAW,EACX,UAA0C;IAE1C,MAAM,YAAY,GAAG,uCAAkB,CAAC,KAAK,CAAC,OAAO,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"javascriptRuntimeCapabilities.js","sourceRoot":"","sources":["../../src/internal/javascriptRuntimeCapabilities.ts"],"names":[],"mappings":";;;;;;AAAA,4EAA8C;AAC9C,sDAAyB;AACzB,0DAA6B;AAE7B,oFAAiF;AACjF,2FAAwF;AAExF,mFAAgF;AAChF,yCAAsC;AAEtC,uEAAoE;AACpE,uDAAoD;AACpD,uEAAoE;AACpE,2EAAwE;AACxE,+EAA4E;AAE5E;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,uCACE,OAAe,EACf,GAAsB,EACtB,GAAW,EACX,UAA0C;IAE1C,0EAA0E;IAC1E,6DAA6D;IAC7D,MAAM,YAAY,GAAG,iCAAe,CAAC,UAAU,CAC7C,uCAAkB,CAAC,KAAK,CAAC,OAAO,CAAC,GAAG,EAAE,GAAG,CAAC,CAC3C,CAAC;IACF,MAAM,QAAQ,GAAG,yBAAyB,CAAC,OAAO,EAAE,YAAY,CAAC,CAAC;IAClE,MAAM,cAAc,GAClB,QAAQ,KAAK,SAAS;QACpB,CAAC,CAAC,SAAS;QACX,CAAC,CAAC,IAAA,qDAAyB,EAAC,OAAO,EAAE,UAAU,CAAC,CAAC;IACrD,IAAI,QAAQ,KAAK,SAAS,IAAI,cAAc,KAAK,SAAS,EAAE,CAAC;QAC3D,MAAM,MAAM,GAAG,sBAAsB,C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3
3
|
* language.
|
|
4
4
|
*
|
|
5
|
-
* English messages identify the state in the final field of the complete
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
5
|
+
* English messages identify the state in the final field of the complete native
|
|
6
|
+
* message. The echoed directory path supplies no status evidence. For every
|
|
7
|
+
* other locale, the volume-root query supplies the raw localized suffix for the
|
|
8
|
+
* ordinary disabled state. A target with that suffix is insensitive; a
|
|
9
|
+
* different successful message is the enabled state.
|
|
10
10
|
*
|
|
11
11
|
* Inputs must be successful fsutil query responses. The opaque comparison
|
|
12
12
|
* assumes the volume-root response represents the ordinary disabled state;
|
|
@@ -5,11 +5,11 @@ exports.parseWindowsDirectoryCaseSensitivity = parseWindowsDirectoryCaseSensitiv
|
|
|
5
5
|
* Interpret fsutil's case-sensitivity query without assuming a display
|
|
6
6
|
* language.
|
|
7
7
|
*
|
|
8
|
-
* English messages identify the state in the final field of the complete
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
8
|
+
* English messages identify the state in the final field of the complete native
|
|
9
|
+
* message. The echoed directory path supplies no status evidence. For every
|
|
10
|
+
* other locale, the volume-root query supplies the raw localized suffix for the
|
|
11
|
+
* ordinary disabled state. A target with that suffix is insensitive; a
|
|
12
|
+
* different successful message is the enabled state.
|
|
13
13
|
*
|
|
14
14
|
* Inputs must be successful fsutil query responses. The opaque comparison
|
|
15
15
|
* assumes the volume-root response represents the ordinary disabled state;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { FilesystemPathIdentityOperations } from "./FilesystemPathIdentityOperations";
|
|
2
|
+
/**
|
|
3
|
+
* Create one unit of work's directory case-policy observations: a function that
|
|
4
|
+
* answers whether a directory's names are case-sensitive, asking the filesystem
|
|
5
|
+
* once per directory for as long as the unit keeps it.
|
|
6
|
+
*
|
|
7
|
+
* An identity context memoizes case answers for itself, but a unit of work that
|
|
8
|
+
* creates several contexts, such as one watch decision, asked each directory
|
|
9
|
+
* once per context. On Windows an inconclusive directory, one that is empty or
|
|
10
|
+
* whose names carry no ASCII case, costs an `fsutil` process per question, and
|
|
11
|
+
* one decision asked the same directory up to seventeen times
|
|
12
|
+
* (samchon/ttsc#1742). Contexts created with this function as their
|
|
13
|
+
* `caseSensitive` operation share its answers.
|
|
14
|
+
*
|
|
15
|
+
* The answers are observations of the moment they were asked, like a context's
|
|
16
|
+
* own. The unit's owner chooses their lifetime; a later unit creates new
|
|
17
|
+
* observations rather than reusing these. A directory's flag can change while
|
|
18
|
+
* it is empty, so an answer outliving its unit could be stale.
|
|
19
|
+
*
|
|
20
|
+
* Unavailable evidence is `undefined`: an unreadable directory, a failed query,
|
|
21
|
+
* or a platform without a read-only probe for an inconclusive directory. Only
|
|
22
|
+
* observed insensitivity permits ASCII folding.
|
|
23
|
+
*
|
|
24
|
+
* @param operations Replaceable filesystem primitives; omitted members use the
|
|
25
|
+
* host's own.
|
|
26
|
+
* @evidence contracts/common.md#principled-implementation Alternate-name observations decide first; a rejected alternate is conclusive only while its original exists. Darwin walks same-device names for its volume-wide policy and Windows asks fsutil's read-only per-directory flag. Failed observation stays unknown.
|
|
27
|
+
* @evidence contracts/common.md#clear-and-simple-design One returned function owns the probe and its per-unit memo; identity resolution stays with the contexts that call it.
|
|
28
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts No answer is inferred from the OS name, and no answer is carried beyond the unit that observed it.
|
|
29
|
+
* @evidence contracts/common.md#meaningful-documentation Native paragraphs explain sharing, lifetime, the empty-directory hazard and unknown evidence, with tags separated.
|
|
30
|
+
* @evidence contracts/portability.md#os-neutral-implementation Native realpath, lstat and readdir observe alternate names; darwin and win32 select their read-only volume or directory probes, and the platform's path dialect keys the memo.
|
|
31
|
+
* @evidence contracts/performance.md#efficient-algorithms A miss enumerates the directory's immediate entries and stops at the first conclusive alternate; darwin can walk same-device ancestors and Windows can launch directory and volume fsutil queries. A hit is one map lookup.
|
|
32
|
+
* @evidence contracts/performance.md#reuse-equivalent-work Every context of one unit shares each directory's answer, so a unit asks the filesystem once per directory instead of once per context.
|
|
33
|
+
* @evidence contracts/performance.md#bound-retention-and-release-resources The memo holds one entry per queried directory without eviction for the unit's lifetime; releasing the returned function releases it. Probes hold no handle after returning, and a Windows query has no explicit timeout.
|
|
34
|
+
*/
|
|
35
|
+
export declare function createCaseSensitivityObservations(operations?: Partial<Pick<FilesystemPathIdentityOperations, "lstat" | "platform" | "readdir" | "realpath">>): (directory: string) => boolean | undefined;
|
|
@@ -0,0 +1,209 @@
|
|
|
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.createCaseSensitivityObservations = createCaseSensitivityObservations;
|
|
7
|
+
const node_child_process_1 = __importDefault(require("node:child_process"));
|
|
8
|
+
const node_fs_1 = __importDefault(require("node:fs"));
|
|
9
|
+
const node_path_1 = __importDefault(require("node:path"));
|
|
10
|
+
const E2ETrace_1 = require("../E2ETrace");
|
|
11
|
+
const OwnedSynchronousProcess_1 = require("../OwnedSynchronousProcess");
|
|
12
|
+
const parseWindowsDirectoryCaseSensitivity_1 = require("../parseWindowsDirectoryCaseSensitivity");
|
|
13
|
+
const resolveFilesystemPath_1 = require("./resolveFilesystemPath");
|
|
14
|
+
/**
|
|
15
|
+
* Create one unit of work's directory case-policy observations: a function that
|
|
16
|
+
* answers whether a directory's names are case-sensitive, asking the filesystem
|
|
17
|
+
* once per directory for as long as the unit keeps it.
|
|
18
|
+
*
|
|
19
|
+
* An identity context memoizes case answers for itself, but a unit of work that
|
|
20
|
+
* creates several contexts, such as one watch decision, asked each directory
|
|
21
|
+
* once per context. On Windows an inconclusive directory, one that is empty or
|
|
22
|
+
* whose names carry no ASCII case, costs an `fsutil` process per question, and
|
|
23
|
+
* one decision asked the same directory up to seventeen times
|
|
24
|
+
* (samchon/ttsc#1742). Contexts created with this function as their
|
|
25
|
+
* `caseSensitive` operation share its answers.
|
|
26
|
+
*
|
|
27
|
+
* The answers are observations of the moment they were asked, like a context's
|
|
28
|
+
* own. The unit's owner chooses their lifetime; a later unit creates new
|
|
29
|
+
* observations rather than reusing these. A directory's flag can change while
|
|
30
|
+
* it is empty, so an answer outliving its unit could be stale.
|
|
31
|
+
*
|
|
32
|
+
* Unavailable evidence is `undefined`: an unreadable directory, a failed query,
|
|
33
|
+
* or a platform without a read-only probe for an inconclusive directory. Only
|
|
34
|
+
* observed insensitivity permits ASCII folding.
|
|
35
|
+
*
|
|
36
|
+
* @param operations Replaceable filesystem primitives; omitted members use the
|
|
37
|
+
* host's own.
|
|
38
|
+
* @evidence contracts/common.md#principled-implementation Alternate-name observations decide first; a rejected alternate is conclusive only while its original exists. Darwin walks same-device names for its volume-wide policy and Windows asks fsutil's read-only per-directory flag. Failed observation stays unknown.
|
|
39
|
+
* @evidence contracts/common.md#clear-and-simple-design One returned function owns the probe and its per-unit memo; identity resolution stays with the contexts that call it.
|
|
40
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts No answer is inferred from the OS name, and no answer is carried beyond the unit that observed it.
|
|
41
|
+
* @evidence contracts/common.md#meaningful-documentation Native paragraphs explain sharing, lifetime, the empty-directory hazard and unknown evidence, with tags separated.
|
|
42
|
+
* @evidence contracts/portability.md#os-neutral-implementation Native realpath, lstat and readdir observe alternate names; darwin and win32 select their read-only volume or directory probes, and the platform's path dialect keys the memo.
|
|
43
|
+
* @evidence contracts/performance.md#efficient-algorithms A miss enumerates the directory's immediate entries and stops at the first conclusive alternate; darwin can walk same-device ancestors and Windows can launch directory and volume fsutil queries. A hit is one map lookup.
|
|
44
|
+
* @evidence contracts/performance.md#reuse-equivalent-work Every context of one unit shares each directory's answer, so a unit asks the filesystem once per directory instead of once per context.
|
|
45
|
+
* @evidence contracts/performance.md#bound-retention-and-release-resources The memo holds one entry per queried directory without eviction for the unit's lifetime; releasing the returned function releases it. Probes hold no handle after returning, and a Windows query has no explicit timeout.
|
|
46
|
+
*/
|
|
47
|
+
function createCaseSensitivityObservations(operations = {}) {
|
|
48
|
+
const platform = operations.platform ?? process.platform;
|
|
49
|
+
const probes = {
|
|
50
|
+
lstat: operations.lstat ?? node_fs_1.default.lstatSync,
|
|
51
|
+
readdir: operations.readdir ?? node_fs_1.default.readdirSync,
|
|
52
|
+
realpath: operations.realpath ?? physicalRealpath,
|
|
53
|
+
};
|
|
54
|
+
const answers = new Map();
|
|
55
|
+
return (directory) => {
|
|
56
|
+
const key = (0, resolveFilesystemPath_1.resolveFilesystemPath)(directory, platform);
|
|
57
|
+
if (answers.has(key))
|
|
58
|
+
return answers.get(key);
|
|
59
|
+
let answer;
|
|
60
|
+
try {
|
|
61
|
+
answer = filesystemDirectoryIsCaseSensitive(key, platform, probes);
|
|
62
|
+
}
|
|
63
|
+
catch {
|
|
64
|
+
// A failed capability observation is unknown. This does not suppress
|
|
65
|
+
// strict physical identity errors in a context's realpath resolver.
|
|
66
|
+
answer = undefined;
|
|
67
|
+
}
|
|
68
|
+
answers.set(key, answer);
|
|
69
|
+
return answer;
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
function physicalRealpath(location) {
|
|
73
|
+
return node_fs_1.default.realpathSync.native?.(location) ?? node_fs_1.default.realpathSync(location);
|
|
74
|
+
}
|
|
75
|
+
function filesystemDirectoryIsCaseSensitive(directory, platform, operations) {
|
|
76
|
+
const pathApi = platform === "win32" ? node_path_1.default.win32 : node_path_1.default.posix;
|
|
77
|
+
let entries;
|
|
78
|
+
try {
|
|
79
|
+
entries = operations.readdir(directory);
|
|
80
|
+
}
|
|
81
|
+
catch {
|
|
82
|
+
return undefined;
|
|
83
|
+
}
|
|
84
|
+
const foldedNames = new Map();
|
|
85
|
+
for (const name of entries) {
|
|
86
|
+
const folded = foldAsciiCase(name);
|
|
87
|
+
const previous = foldedNames.get(folded);
|
|
88
|
+
if (previous !== undefined && previous !== name)
|
|
89
|
+
return true;
|
|
90
|
+
foldedNames.set(folded, name);
|
|
91
|
+
}
|
|
92
|
+
for (const name of entries) {
|
|
93
|
+
const alternate = alternateCase(name);
|
|
94
|
+
if (alternate === name)
|
|
95
|
+
continue;
|
|
96
|
+
try {
|
|
97
|
+
operations.lstat(pathApi.join(directory, alternate));
|
|
98
|
+
}
|
|
99
|
+
catch (error) {
|
|
100
|
+
if (isMissingFilesystemEntry(error)) {
|
|
101
|
+
// Enumeration is not an atomic snapshot. An absent alternate proves
|
|
102
|
+
// sensitivity only if the original spelling still names an entry.
|
|
103
|
+
try {
|
|
104
|
+
operations.lstat(pathApi.join(directory, name));
|
|
105
|
+
return true;
|
|
106
|
+
}
|
|
107
|
+
catch (originalError) {
|
|
108
|
+
if (isMissingFilesystemEntry(originalError) === false)
|
|
109
|
+
throw originalError;
|
|
110
|
+
}
|
|
111
|
+
continue;
|
|
112
|
+
}
|
|
113
|
+
throw error;
|
|
114
|
+
}
|
|
115
|
+
try {
|
|
116
|
+
const actual = (0, resolveFilesystemPath_1.resolveFilesystemPath)(operations.realpath(pathApi.join(directory, name)), platform);
|
|
117
|
+
const alias = (0, resolveFilesystemPath_1.resolveFilesystemPath)(operations.realpath(pathApi.join(directory, alternate)), platform);
|
|
118
|
+
return actual !== alias;
|
|
119
|
+
}
|
|
120
|
+
catch (error) {
|
|
121
|
+
if (isMissingFilesystemEntry(error) === false)
|
|
122
|
+
throw error;
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
if (platform === "darwin") {
|
|
126
|
+
// APFS/HFS case semantics are volume-wide. An empty directory has no child
|
|
127
|
+
// name to probe, so ask the same read-only question of its existing name in
|
|
128
|
+
// the parent and walk upward until a name with ASCII case is available.
|
|
129
|
+
// This avoids a write probe while still distinguishing default APFS from a
|
|
130
|
+
// case-sensitive volume.
|
|
131
|
+
let current = (0, resolveFilesystemPath_1.resolveFilesystemPath)(directory, platform);
|
|
132
|
+
while (true) {
|
|
133
|
+
const parent = pathApi.dirname(current);
|
|
134
|
+
if (parent === current)
|
|
135
|
+
break;
|
|
136
|
+
// Names are interpreted by their parent; another mount is not evidence
|
|
137
|
+
// of the directory's own volume case policy.
|
|
138
|
+
if (operations.lstat(current).dev !== operations.lstat(parent).dev)
|
|
139
|
+
return undefined;
|
|
140
|
+
const name = pathApi.basename(current);
|
|
141
|
+
const alternate = alternateCase(name);
|
|
142
|
+
if (alternate !== name) {
|
|
143
|
+
try {
|
|
144
|
+
const actual = (0, resolveFilesystemPath_1.resolveFilesystemPath)(operations.realpath(current), platform);
|
|
145
|
+
const alias = (0, resolveFilesystemPath_1.resolveFilesystemPath)(operations.realpath(pathApi.join(parent, alternate)), platform);
|
|
146
|
+
return actual !== alias;
|
|
147
|
+
}
|
|
148
|
+
catch (error) {
|
|
149
|
+
if (isMissingFilesystemEntry(error) === false)
|
|
150
|
+
throw error;
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
current = parent;
|
|
154
|
+
}
|
|
155
|
+
return undefined;
|
|
156
|
+
}
|
|
157
|
+
if (platform !== "win32")
|
|
158
|
+
return undefined;
|
|
159
|
+
// Node does not expose the Windows per-directory flag. Prefer fsutil's
|
|
160
|
+
// read-only answer; unavailable capability remains unknown.
|
|
161
|
+
const queried = queryWindowsDirectoryCaseSensitivity(directory);
|
|
162
|
+
if (queried !== undefined)
|
|
163
|
+
return queried;
|
|
164
|
+
return undefined;
|
|
165
|
+
}
|
|
166
|
+
/**
|
|
167
|
+
* Read the per-directory flag without depending on fsutil's display language.
|
|
168
|
+
*
|
|
169
|
+
* English output is cheap to recognize directly. Other Windows locales write
|
|
170
|
+
* console-code-page bytes that Node cannot reliably decode, so their raw
|
|
171
|
+
* message is interpreted against the volume-root query.
|
|
172
|
+
*/
|
|
173
|
+
function queryWindowsDirectoryCaseSensitivity(directory) {
|
|
174
|
+
const result = queryWindowsDirectoryCaseSensitivityBytes(directory);
|
|
175
|
+
if (result === undefined)
|
|
176
|
+
return undefined;
|
|
177
|
+
const volumeRoot = node_path_1.default.win32.parse(directory).root;
|
|
178
|
+
const direct = (0, parseWindowsDirectoryCaseSensitivity_1.parseWindowsDirectoryCaseSensitivity)(result, undefined, volumeRoot);
|
|
179
|
+
if (direct !== undefined)
|
|
180
|
+
return direct;
|
|
181
|
+
const volume = queryWindowsDirectoryCaseSensitivityBytes(volumeRoot);
|
|
182
|
+
return (0, parseWindowsDirectoryCaseSensitivity_1.parseWindowsDirectoryCaseSensitivity)(result, volume, volumeRoot);
|
|
183
|
+
}
|
|
184
|
+
function queryWindowsDirectoryCaseSensitivityBytes(directory) {
|
|
185
|
+
const args = ["file", "queryCaseSensitiveInfo", directory];
|
|
186
|
+
const result = E2ETrace_1.E2ETrace.synchronous("fsutil.exe", args, {}, "path-case-probe", () => OwnedSynchronousProcess_1.OwnedSynchronousProcess.launch("fsutil.exe", args, {
|
|
187
|
+
windowsHide: true,
|
|
188
|
+
}) ?? node_child_process_1.default.spawnSync("fsutil.exe", args, { windowsHide: true }));
|
|
189
|
+
return result.error === undefined &&
|
|
190
|
+
result.status === 0 &&
|
|
191
|
+
Buffer.isBuffer(result.stdout)
|
|
192
|
+
? result.stdout
|
|
193
|
+
: undefined;
|
|
194
|
+
}
|
|
195
|
+
function alternateCase(value) {
|
|
196
|
+
return value.replace(/[A-Za-z]/g, (character) => character === character.toLowerCase()
|
|
197
|
+
? character.toUpperCase()
|
|
198
|
+
: character.toLowerCase());
|
|
199
|
+
}
|
|
200
|
+
/** ASCII folding is the case equivalence observed by the read-only probes. */
|
|
201
|
+
function foldAsciiCase(value) {
|
|
202
|
+
return value.replace(/[A-Z]/g, (character) => character.toLowerCase());
|
|
203
|
+
}
|
|
204
|
+
function isMissingFilesystemEntry(error) {
|
|
205
|
+
return (error instanceof Error &&
|
|
206
|
+
"code" in error &&
|
|
207
|
+
(error.code === "ENOENT" || error.code === "ENOTDIR"));
|
|
208
|
+
}
|
|
209
|
+
//# sourceMappingURL=createCaseSensitivityObservations.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createCaseSensitivityObservations.js","sourceRoot":"","sources":["../../../src/internal/pathIdentity/createCaseSensitivityObservations.ts"],"names":[],"mappings":";;;;;;AAAA,4EAA8C;AAC9C,sDAAyB;AACzB,0DAA6B;AAE7B,0CAAuC;AACvC,wEAAqE;AACrE,kGAA+F;AAE/F,mEAAgE;AAEhE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,2CACE,UAAU,GAKN,EAAE;IAEN,MAAM,QAAQ,GAAG,UAAU,CAAC,QAAQ,IAAI,OAAO,CAAC,QAAQ,CAAC;IACzD,MAAM,MAAM,GAAG;QACb,KAAK,EAAE,UAAU,CAAC,KAAK,IAAI,iBAAE,CAAC,SAAS;QACvC,OAAO,EAAE,UAAU,CAAC,OAAO,IAAI,iBAAE,CAAC,WAAW;QAC7C,QAAQ,EAAE,UAAU,CAAC,QAAQ,IAAI,gBAAgB;KAClD,CAAC;IACF,MAAM,OAAO,GAAG,IAAI,GAAG,EAA+B,CAAC;IACvD,OAAO,CAAC,SAAS,EAAE,EAAE;QACnB,MAAM,GAAG,GAAG,IAAA,6CAAqB,EAAC,SAAS,EAAE,QAAQ,CAAC,CAAC;QACvD,IAAI,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC;YAAE,OAAO,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;QAC9C,IAAI,MAA2B,CAAC;QAChC,IAAI,CAAC;YACH,MAAM,GAAG,kCAAkC,CAAC,GAAG,EAAE,QAAQ,EAAE,MAAM,CAAC,CAAC;QACrE,CAAC;QAAC,MAAM,CAAC;YACP,qEAAqE;YACrE,oEAAoE;YACpE,MAAM,GAAG,SAAS,CAAC;QACrB,CAAC;QACD,OAAO,CAAC,GAAG,CAAC,GAAG,EAAE,MAAM,CAAC,CAAC;QACzB,OAAO,MAAM,CAAC;IAChB,CAAC,CAAC;AACJ,CAAC;AAED,SAAS,gBAAgB,CAAC,QAAgB;IACxC,OA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