ttsc 0.31.4 → 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 +11 -3
- 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.d.ts +1 -0
- 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/probeLocalProcess.d.ts +5 -1
- package/lib/internal/probeLocalProcess.js +9 -7
- package/lib/internal/probeLocalProcess.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/ProcessOwnedDirectory.d.ts +2 -0
- package/lib/launcher/internal/runtime/ProcessOwnedDirectory.js +2 -1
- package/lib/launcher/internal/runtime/ProcessOwnedDirectory.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/isLocalProcessGone.d.ts +1 -1
- package/lib/launcher/internal/runtime/isLocalProcessGone.js +4 -4
- package/lib/launcher/internal/runtime/isLocalProcessGone.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/FseventsStreams.d.ts +2 -0
- package/lib/launcher/internal/watch/FseventsStreams.js +19 -0
- package/lib/launcher/internal/watch/FseventsStreams.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 +17 -9
- 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 +15 -6
- 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 +5 -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/probeLocalProcess.ts +13 -8
- 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/ProcessOwnedDirectory.ts +5 -1
- 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/isLocalProcessGone.ts +5 -3
- package/src/launcher/internal/runtime/resolveRuntimeCleanTargets.ts +17 -5
- package/src/launcher/internal/watch/FseventsStreams.ts +22 -0
- 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 +17 -3
- 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
|
@@ -139,11 +139,12 @@ var ProcessOwnedDirectory;
|
|
|
139
139
|
}
|
|
140
140
|
if (!(0, isLocalProcessGone_1.isLocalProcessGone)(owner, observe === undefined
|
|
141
141
|
? undefined
|
|
142
|
-
: (result, errorCode) => report(observe, {
|
|
142
|
+
: (result, errorCode, state) => report(observe, {
|
|
143
143
|
record: name,
|
|
144
144
|
owner,
|
|
145
145
|
result,
|
|
146
146
|
...(errorCode === undefined ? {} : { errorCode }),
|
|
147
|
+
...(state === undefined ? {} : { state }),
|
|
147
148
|
})))
|
|
148
149
|
return "live";
|
|
149
150
|
owned = true;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProcessOwnedDirectory.js","sourceRoot":"","sources":["../../../../src/launcher/internal/runtime/ProcessOwnedDirectory.ts"],"names":[],"mappings":";;;;;;AAAA,sDAAyB;AACzB,sDAAyB;AACzB,0DAA6B;AAE7B,6DAA0D;AAE1D;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,IAAiB,qBAAqB,
|
|
1
|
+
{"version":3,"file":"Proc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AE,MAAM,EAAE,gBAAgB,EAAE,CAAC,CAAC;gBAC5D,OAAO,IAAI,CAAC;YACd,CAAC;YACD,OAAO,EAAE,QAAQ,EAAE,KAAK,CAAC,QAAQ,EAAE,GAAG,EAAE,KAAK,CAAC,GAAG,EAAE,CAAC;QACtD,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,MAAM,IAAI,GAAI,KAAsC,EAAE,IAAI,CAAC;YAC3D,MAAM,CAAC,OAAO,EAAE;gBACd,MAAM,EAAE,mBAAI,CAAC,QAAQ,CAAC,IAAI,CAAC;gBAC3B,MAAM,EAAE,gBAAgB;gBACxB,GAAG,CAAC,OAAO,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;aACzD,CAAC,CAAC;YACH,OAAO,IAAI,CAAC;QACd,CAAC;IACH,CAAC;IAED,6EAA6E;IAC7E,SAAS,MAAM,CACb,OAAyD,EACzD,WAAwB;QAExB,IAAI,CAAC;YACH,OAAO,EAAE,CAAC,WAAW,CAAC,CAAC;QACzB,CAAC;QAAC,MAAM,CAAC;YACP,6BAA6B;QAC/B,CAAC;IACH,CAAC;AACH,CAAC,EA5SgB,qBAAqB,aAArB,qBAAqB,GAArB,qBAAqB,QA4SrC"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import type { RuntimeManifest } from "./RuntimeManifest";
|
|
2
|
+
/**
|
|
3
|
+
* The served source of each entry module a checked entry build emitted,
|
|
4
|
+
* prepared once.
|
|
5
|
+
*
|
|
6
|
+
* A checked entry build's emit is immutable for the run: ttsx prepares it
|
|
7
|
+
* before the program starts, and a root `ttsc/register` prepares stays
|
|
8
|
+
* registered (`RuntimeManifestRegistry`). Node 22.15 nevertheless calls the
|
|
9
|
+
* `load` hook twice for the process entry, and each call read and source-mapped
|
|
10
|
+
* the same emitted file again (samchon/ttsc#1749). A repeated entry load of one
|
|
11
|
+
* build's emitted file is answered from its first preparation. A module served
|
|
12
|
+
* by any other lane, a project build or an isolated emit of a file the program
|
|
13
|
+
* may rewrite, is prepared on every load as before, and so is a non-entry
|
|
14
|
+
* module, whose text Node already holds.
|
|
15
|
+
*
|
|
16
|
+
* @evidence contracts/common.md#principled-implementation Only an entry module's emitted file of a registered checked build, the registry's immutable premise, is remembered, keyed by that build, so a reused answer is the answer a repeated read would give.
|
|
17
|
+
* @evidence contracts/common.md#clear-and-simple-design One map per build and one accessor; the caller supplies the preparation it already performs.
|
|
18
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts Nothing about Node's loader is patched; the hook still answers every call Node makes, and lanes whose source can change are never remembered.
|
|
19
|
+
* @evidence contracts/common.md#meaningful-documentation Native prose names the repeated call, the immutable entry emit and the lanes left unaffected.
|
|
20
|
+
* @evidence contracts/portability.md#os-neutral-implementation Files are keyed by the emitted path the build's ownership index returned, under the build object that owns it.
|
|
21
|
+
* @evidence contracts/performance.md#efficient-algorithms One WeakMap and one map lookup per serve.
|
|
22
|
+
* @evidence contracts/performance.md#reuse-equivalent-work A repeated entry load of an entry build's emitted file reuses the first preparation.
|
|
23
|
+
* @evidence contracts/performance.md#bound-retention-and-release-resources One served source per entry module, held while the registry keeps its build; a run has one entry and a handful of JavaScript-to-TypeScript boundaries.
|
|
24
|
+
*/
|
|
25
|
+
export declare namespace RuntimeEntrySources {
|
|
26
|
+
/**
|
|
27
|
+
* The served source of entry module `emittedFile` from checked entry build
|
|
28
|
+
* `manifest`, prepared by `prepare` on its first serve only.
|
|
29
|
+
*
|
|
30
|
+
* @evidence contracts/common.md#principled-implementation Only an entry load of a registered checked build's emitted file asks; that emit is immutable for the run, so the first preparation is the answer a repeated one would give.
|
|
31
|
+
* @evidence contracts/common.md#clear-and-simple-design One lookup or one preparation and insertion.
|
|
32
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts The caller's own preparation runs unchanged on the first serve.
|
|
33
|
+
* @evidence contracts/common.md#meaningful-documentation Native prose states which serve prepares.
|
|
34
|
+
* @evidence contracts/portability.md#os-neutral-implementation Files are keyed by the emitted path the ownership index returned.
|
|
35
|
+
* @evidence contracts/performance.md#efficient-algorithms One WeakMap and one map lookup, and on the first serve one insertion.
|
|
36
|
+
* @evidence contracts/performance.md#reuse-equivalent-work A repeated serve returns the first preparation.
|
|
37
|
+
* @evidence contracts/performance.md#bound-retention-and-release-resources One source per entry module is retained while its build is.
|
|
38
|
+
*/
|
|
39
|
+
function serve<Source>(manifest: RuntimeManifest, emittedFile: string, prepare: () => Source): Source;
|
|
40
|
+
}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.RuntimeEntrySources = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* The served source of each entry module a checked entry build emitted,
|
|
6
|
+
* prepared once.
|
|
7
|
+
*
|
|
8
|
+
* A checked entry build's emit is immutable for the run: ttsx prepares it
|
|
9
|
+
* before the program starts, and a root `ttsc/register` prepares stays
|
|
10
|
+
* registered (`RuntimeManifestRegistry`). Node 22.15 nevertheless calls the
|
|
11
|
+
* `load` hook twice for the process entry, and each call read and source-mapped
|
|
12
|
+
* the same emitted file again (samchon/ttsc#1749). A repeated entry load of one
|
|
13
|
+
* build's emitted file is answered from its first preparation. A module served
|
|
14
|
+
* by any other lane, a project build or an isolated emit of a file the program
|
|
15
|
+
* may rewrite, is prepared on every load as before, and so is a non-entry
|
|
16
|
+
* module, whose text Node already holds.
|
|
17
|
+
*
|
|
18
|
+
* @evidence contracts/common.md#principled-implementation Only an entry module's emitted file of a registered checked build, the registry's immutable premise, is remembered, keyed by that build, so a reused answer is the answer a repeated read would give.
|
|
19
|
+
* @evidence contracts/common.md#clear-and-simple-design One map per build and one accessor; the caller supplies the preparation it already performs.
|
|
20
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts Nothing about Node's loader is patched; the hook still answers every call Node makes, and lanes whose source can change are never remembered.
|
|
21
|
+
* @evidence contracts/common.md#meaningful-documentation Native prose names the repeated call, the immutable entry emit and the lanes left unaffected.
|
|
22
|
+
* @evidence contracts/portability.md#os-neutral-implementation Files are keyed by the emitted path the build's ownership index returned, under the build object that owns it.
|
|
23
|
+
* @evidence contracts/performance.md#efficient-algorithms One WeakMap and one map lookup per serve.
|
|
24
|
+
* @evidence contracts/performance.md#reuse-equivalent-work A repeated entry load of an entry build's emitted file reuses the first preparation.
|
|
25
|
+
* @evidence contracts/performance.md#bound-retention-and-release-resources One served source per entry module, held while the registry keeps its build; a run has one entry and a handful of JavaScript-to-TypeScript boundaries.
|
|
26
|
+
*/
|
|
27
|
+
var RuntimeEntrySources;
|
|
28
|
+
(function (RuntimeEntrySources) {
|
|
29
|
+
/**
|
|
30
|
+
* The served source of entry module `emittedFile` from checked entry build
|
|
31
|
+
* `manifest`, prepared by `prepare` on its first serve only.
|
|
32
|
+
*
|
|
33
|
+
* @evidence contracts/common.md#principled-implementation Only an entry load of a registered checked build's emitted file asks; that emit is immutable for the run, so the first preparation is the answer a repeated one would give.
|
|
34
|
+
* @evidence contracts/common.md#clear-and-simple-design One lookup or one preparation and insertion.
|
|
35
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts The caller's own preparation runs unchanged on the first serve.
|
|
36
|
+
* @evidence contracts/common.md#meaningful-documentation Native prose states which serve prepares.
|
|
37
|
+
* @evidence contracts/portability.md#os-neutral-implementation Files are keyed by the emitted path the ownership index returned.
|
|
38
|
+
* @evidence contracts/performance.md#efficient-algorithms One WeakMap and one map lookup, and on the first serve one insertion.
|
|
39
|
+
* @evidence contracts/performance.md#reuse-equivalent-work A repeated serve returns the first preparation.
|
|
40
|
+
* @evidence contracts/performance.md#bound-retention-and-release-resources One source per entry module is retained while its build is.
|
|
41
|
+
*/
|
|
42
|
+
function serve(manifest, emittedFile, prepare) {
|
|
43
|
+
let files = served.get(manifest);
|
|
44
|
+
if (files === undefined) {
|
|
45
|
+
files = new Map();
|
|
46
|
+
served.set(manifest, files);
|
|
47
|
+
}
|
|
48
|
+
if (files.has(emittedFile))
|
|
49
|
+
return files.get(emittedFile);
|
|
50
|
+
const source = prepare();
|
|
51
|
+
files.set(emittedFile, source);
|
|
52
|
+
return source;
|
|
53
|
+
}
|
|
54
|
+
RuntimeEntrySources.serve = serve;
|
|
55
|
+
})(RuntimeEntrySources || (exports.RuntimeEntrySources = RuntimeEntrySources = {}));
|
|
56
|
+
const served = new WeakMap();
|
|
57
|
+
//# sourceMappingURL=RuntimeEntrySources.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RuntimeEntrySources.js","sourceRoot":"","sources":["../../../../src/launcher/internal/runtime/RuntimeEntrySources.ts"],"names":[],"mappings":";;;AAEA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,IAAiB,mBAAmB,CA6BnC;AA7BD,WAAiB,mBAAmB;IAClC;;;;;;;;;;;;OAYG;IACH,SAAgB,KAAK,CACnB,QAAyB,EACzB,WAAmB,EACnB,OAAqB;QAErB,IAAI,KAAK,GAAG,MAAM,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;QACjC,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;YACxB,KAAK,GAAG,IAAI,GAAG,EAAE,CAAC;YAClB,MAAM,CAAC,GAAG,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAC;QAC9B,CAAC;QACD,IAAI,KAAK,CAAC,GAAG,CAAC,WAAW,CAAC;YAAE,OAAO,KAAK,CAAC,GAAG,CAAC,WAAW,CAAW,CAAC;QACpE,MAAM,MAAM,GAAG,OAAO,EAAE,CAAC;QACzB,KAAK,CAAC,GAAG,CAAC,WAAW,EAAE,MAAM,CAAC,CAAC;QAC/B,OAAO,MAAM,CAAC;IAChB,CAAC;IAde,oBAAA,KAAK,QAcpB,CAAA;AACH,CAAC,EA7BgB,mBAAmB,aAAnB,mBAAmB,GAAnB,mBAAmB,QA6BnC;AAED,MAAM,MAAM,GAAG,IAAI,OAAO,EAAyC,CAAC"}
|
|
@@ -12,8 +12,8 @@
|
|
|
12
12
|
*/
|
|
13
13
|
export declare namespace RuntimeProjectOwnership {
|
|
14
14
|
/**
|
|
15
|
-
* Whether a physical source path passes through an installed directory.
|
|
16
|
-
*
|
|
15
|
+
* Whether a physical source path passes through an installed directory. A
|
|
16
|
+
* linked workspace physically outside that directory remains user source.
|
|
17
17
|
* Alternate spellings count only when the native lowercase installed spelling
|
|
18
18
|
* resolves to the same physical directory; failed identity reads prove none.
|
|
19
19
|
*
|
|
@@ -34,8 +34,9 @@ export declare namespace RuntimeProjectOwnership {
|
|
|
34
34
|
* Cached walks recheck both candidate files and the native boundary topology.
|
|
35
35
|
* Creating/deleting a config or adding/removing an installed alias therefore
|
|
36
36
|
* cannot retain an earlier consumer or isolated selection. The observer
|
|
37
|
-
* brackets config candidates and alternate directory identities for
|
|
38
|
-
* dependency recording; it does not pin the filesystem during
|
|
37
|
+
* brackets config candidates and alternate directory identities for
|
|
38
|
+
* descriptor dependency recording; it does not pin the filesystem during
|
|
39
|
+
* compilation.
|
|
39
40
|
*
|
|
40
41
|
* @evidence contracts/common.md#principled-implementation Upward traversal selects the first existing config before the installed boundary. Cache entries retain ordered candidates and their stopping boundary; current candidate and native topology checks establish whether the old selection still applies.
|
|
41
42
|
* @evidence contracts/common.md#clear-and-simple-design The same private predicate serves fresh lookup, cached topology validation and installed-source classification. One directory-keyed cache shares the walked suffix without a second casing policy.
|
|
@@ -23,8 +23,8 @@ var RuntimeProjectOwnership;
|
|
|
23
23
|
(function (RuntimeProjectOwnership) {
|
|
24
24
|
const cache = new Map();
|
|
25
25
|
/**
|
|
26
|
-
* Whether a physical source path passes through an installed directory.
|
|
27
|
-
*
|
|
26
|
+
* Whether a physical source path passes through an installed directory. A
|
|
27
|
+
* linked workspace physically outside that directory remains user source.
|
|
28
28
|
* Alternate spellings count only when the native lowercase installed spelling
|
|
29
29
|
* resolves to the same physical directory; failed identity reads prove none.
|
|
30
30
|
*
|
|
@@ -55,8 +55,9 @@ var RuntimeProjectOwnership;
|
|
|
55
55
|
* Cached walks recheck both candidate files and the native boundary topology.
|
|
56
56
|
* Creating/deleting a config or adding/removing an installed alias therefore
|
|
57
57
|
* cannot retain an earlier consumer or isolated selection. The observer
|
|
58
|
-
* brackets config candidates and alternate directory identities for
|
|
59
|
-
* dependency recording; it does not pin the filesystem during
|
|
58
|
+
* brackets config candidates and alternate directory identities for
|
|
59
|
+
* descriptor dependency recording; it does not pin the filesystem during
|
|
60
|
+
* compilation.
|
|
60
61
|
*
|
|
61
62
|
* @evidence contracts/common.md#principled-implementation Upward traversal selects the first existing config before the installed boundary. Cache entries retain ordered candidates and their stopping boundary; current candidate and native topology checks establish whether the old selection still applies.
|
|
62
63
|
* @evidence contracts/common.md#clear-and-simple-design The same private predicate serves fresh lookup, cached topology validation and installed-source classification. One directory-keyed cache shares the walked suffix without a second casing policy.
|
|
@@ -76,7 +77,8 @@ var RuntimeProjectOwnership;
|
|
|
76
77
|
const cached = cache.get(directory);
|
|
77
78
|
if (cached !== undefined) {
|
|
78
79
|
observe(cached.candidates);
|
|
79
|
-
const topologyCurrent = (cached.boundary === undefined ||
|
|
80
|
+
const topologyCurrent = (cached.boundary === undefined ||
|
|
81
|
+
isInstalledDirectory(cached.boundary, observe)) &&
|
|
80
82
|
cached.candidates.every((candidate) => !isInstalledDirectory(node_path_1.default.dirname(candidate), observe));
|
|
81
83
|
const current = nearestExisting(cached.candidates);
|
|
82
84
|
observe(cached.candidates);
|
|
@@ -106,7 +108,7 @@ var RuntimeProjectOwnership;
|
|
|
106
108
|
const inputs = [directory, lowercase];
|
|
107
109
|
observe(inputs);
|
|
108
110
|
try {
|
|
109
|
-
return node_fs_1.default.realpathSync.native(directory) === node_fs_1.default.realpathSync.native(lowercase);
|
|
111
|
+
return (node_fs_1.default.realpathSync.native(directory) === node_fs_1.default.realpathSync.native(lowercase));
|
|
110
112
|
}
|
|
111
113
|
catch {
|
|
112
114
|
return false;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RuntimeProjectOwnership.js","sourceRoot":"","sources":["../../../../src/launcher/internal/runtime/RuntimeProjectOwnership.ts"],"names":[],"mappings":";;;;;;AAAA,sDAAyB;AACzB,0DAA6B;AAE7B,2DAAwD;AAExD;;;;;;;;;;;GAWG;AACH,IAAiB,uBAAuB,
|
|
1
|
+
{"version":3,"file":"RuntimeProjectOwnership.js","sourceRoot":"","sources":["../../../../src/launcher/internal/runtime/RuntimeProjectOwnership.ts"],"names":[],"mappings":";;;;;;AAAA,sDAAyB;AACzB,0DAA6B;AAE7B,2DAAwD;AAExD;;;;;;;;;;;GAWG;AACH,IAAiB,uBAAuB,CAsIvC;AAtID,WAAiB,uBAAuB;IAMtC,MAAM,KAAK,GAAG,IAAI,GAAG,EAAkB,CAAC;IAExC;;;;;;;;;;;;;;OAcG;IACH,SAAgB,wBAAwB,CAAC,IAAY;QACnD,KAAK,IAAI,SAAS,GAAG,mBAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAM,CAAC;YAC5C,IAAI,oBAAoB,CAAC,SAAS,CAAC;gBAAE,OAAO,IAAI,CAAC;YACjD,MAAM,MAAM,GAAG,mBAAI,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;YACvC,IAAI,MAAM,KAAK,SAAS;gBAAE,OAAO,KAAK,CAAC;YACvC,SAAS,GAAG,MAAM,CAAC;QACrB,CAAC;IACH,CAAC;IAPe,wBAAA,wBAAwB,2BAOvC,CAAA;IAED;;;;;;;;;;;;;;;;;;;OAmBG;IACH,SAAgB,eAAe,CAC7B,IAAY,EACZ,OAAO,GAA4C,GAAG,EAAE,GAAE,CAAC;QAE3D,IAAI,SAAS,GAAG,mBAAI,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;QACnC,MAAM,KAAK,GAAa,EAAE,CAAC;QAC3B,SAAS,CAAC;YACR,IAAI,oBAAoB,CAAC,SAAS,EAAE,OAAO,CAAC;gBAC1C,OAAO,QAAQ,CAAC,KAAK,E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,CAAC,GAAG,IAAI,CAAC,CAAC;QAC3B,KAAK,IAAI,KAAK,GAAG,WAAW,CAAC,MAAM,GAAG,CAAC,EAAE,KAAK,IAAI,CAAC,EAAE,EAAE,KAAK,EAAE,CAAC;YAC7D,MAAM,SAAS,GAAG,WAAW,CAAC,KAAK,CAAE,CAAC;YACtC,UAAU,GAAG,CAAC,mBAAI,CAAC,IAAI,CAAC,SAAS,EAAE,eAAe,CAAC,EAAE,GAAG,UAAU,CAAC,CAAC;YACpE,KAAK,CAAC,GAAG,CAAC,SAAS,EAAE,EAAE,UAAU,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC,CAAC;QACzD,CAAC;QACD,OAAO,MAAM,CAAC;IAChB,CAAC;AACH,CAAC,EAtIgB,uBAAuB,aAAvB,uBAAuB,GAAvB,uBAAuB,QAsIvC"}
|
|
@@ -7,7 +7,8 @@
|
|
|
7
7
|
* become resolution origins. Targets are not evaluated. Failed resolution adds
|
|
8
8
|
* no names and leaves the eventual native load to report its error, whereas a
|
|
9
9
|
* reader's ownership error propagates. Root default metadata is retained for
|
|
10
|
-
* the facade's native own-property ordering; nested default is not
|
|
10
|
+
* the facade's native own-property ordering; nested default is not
|
|
11
|
+
* re-exported.
|
|
11
12
|
*
|
|
12
13
|
* @evidence contracts/common.md#principled-implementation Node createRequire resolves each edge from the physical source module using require conditions; the runtime supplies its existing source-rescue resolver on supported hook variants. Owned compiler bytes retain TypeScript elision and lowering. Static parsing discovers possible names, while the original loaded helper and facade own values and property semantics.
|
|
13
14
|
* @evidence contracts/common.md#clear-and-simple-design One traversal serves both JavaScript and TypeScript facades. A call-scoped physical seen set prevents mixed-source cycles and duplicate reads without separate emitted/source resolution policies.
|
|
@@ -17,7 +17,8 @@ const realPath_1 = require("./realPath");
|
|
|
17
17
|
* become resolution origins. Targets are not evaluated. Failed resolution adds
|
|
18
18
|
* no names and leaves the eventual native load to report its error, whereas a
|
|
19
19
|
* reader's ownership error propagates. Root default metadata is retained for
|
|
20
|
-
* the facade's native own-property ordering; nested default is not
|
|
20
|
+
* the facade's native own-property ordering; nested default is not
|
|
21
|
+
* re-exported.
|
|
21
22
|
*
|
|
22
23
|
* @evidence contracts/common.md#principled-implementation Node createRequire resolves each edge from the physical source module using require conditions; the runtime supplies its existing source-rescue resolver on supported hook variants. Owned compiler bytes retain TypeScript elision and lowering. Static parsing discovers possible names, while the original loaded helper and facade own values and property semantics.
|
|
23
24
|
* @evidence contracts/common.md#clear-and-simple-design One traversal serves both JavaScript and TypeScript facades. A call-scoped physical seen set prevents mixed-source cycles and duplicate reads without separate emitted/source resolution policies.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"commonJsExportNames.js","sourceRoot":"","sources":["../../../../src/launcher/internal/runtime/commonJsExportNames.ts"],"names":[],"mappings":";;;;;;AAAA,6CAA4C;AAC5C,0DAA6B;AAE7B,kEAA+D;AAC/D,yCAAsC;AAEtC
|
|
1
|
+
{"version":3,"file":"commonJsExportNames.js","sourceRoot":"","sources":["../../../../src/launcher/internal/runtime/commonJsExportNames.ts"],"names":[],"mappings":";;;;;;AAAA,6CAA4C;AAC5C,0DAA6B;AAE7B,kEAA+D;AAC/D,yCAAsC;AAEtC;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,6BACE,MAAc,EACd,QAAgB,EAChB,UAA2C,EAC3C,OAAO,GAAkD,CACvD,MAAM,EACN,SAAS,EACT,EAAE,CAAC,IAAA,2BAAa,EAAC,MAAM,CAAC,CAAC,OAAO,CAAC,SAAS,CAAC;IAE7C,MAAM,KAAK,GAAG,IAAI,GAAG,EAAU,CAAC;IAChC,MAAM,IAAI,GAAG,IAAI,GAAG,EAAU,CAAC;IAC/B,MAAM,KAAK,GAAG,CAAC,IAAY,EAAE,IAAY,EAAE,IAAa,EAAQ,EAAE;QAChE,MAAM,IAAI,GAAG,IAAA,mBAAQ,EAAC,IAAI,CAAC,CAAC;QAC5B,IAAI,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC;YAAE,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ource_1 = require("./OwnedProjectSource");
|
|
33
33
|
const PluginDescriptorInputObservation_1 = require("./PluginDescriptorInputObservation");
|
|
34
34
|
const RuntimeEmitProvenance_1 = require("./RuntimeEmitProvenance");
|
|
35
|
+
const RuntimeEntrySources_1 = require("./RuntimeEntrySources");
|
|
35
36
|
const RuntimeFilesystem_1 = require("./RuntimeFilesystem");
|
|
36
37
|
const RuntimeIsolatedEmit_1 = require("./RuntimeIsolatedEmit");
|
|
37
38
|
const RuntimeLoaderCapabilities_1 = require("./RuntimeLoaderCapabilities");
|
|
38
39
|
const RuntimeManifestRegistry_1 = require("./RuntimeManifestRegistry");
|
|
39
|
-
const RuntimeProjectOwnership_1 = require("./RuntimeProjectOwnership");
|
|
40
40
|
const RuntimeModuleFormat_1 = require("./RuntimeModuleFormat");
|
|
41
|
+
const RuntimeProjectOwnership_1 = require("./RuntimeProjectOwnership");
|
|
41
42
|
const checkNodeRuntimeSupport_1 = require("./checkNodeRuntimeSupport");
|
|
42
43
|
const commonJsExportNames_1 = require("./commonJsExportNames");
|
|
43
44
|
const commonJsImportFacade_1 = require("./commonJsImportFacade");
|
|
@@ -304,7 +305,9 @@ function observePluginDescriptorResolutionCandidates(specifier, parentURL) {
|
|
|
304
305
|
return {
|
|
305
306
|
commit: (selectedURL) => {
|
|
306
307
|
appendPluginDescriptorInputs(observation
|
|
307
|
-
.commit(selectedURL === undefined
|
|
308
|
+
.commit(selectedURL === undefined
|
|
309
|
+
? undefined
|
|
310
|
+
: runtimeFilePath(selectedURL))
|
|
308
311
|
.map((record) => `${JSON.stringify({ parent, ...record })}\n`));
|
|
309
312
|
},
|
|
310
313
|
};
|
|
@@ -970,20 +973,20 @@ function recordPluginDescriptorProjectInputs(inputs, unstable = false) {
|
|
|
970
973
|
*/
|
|
971
974
|
function resolveServedSource(filename, url = (0, node_url_1.pathToFileURL)(filename).href, prepareAsEntry = false) {
|
|
972
975
|
const real = (0, realPath_1.realPath)(filename);
|
|
973
|
-
let served =
|
|
976
|
+
let served = serveInlinedEntryEmit(real, prepareAsEntry);
|
|
974
977
|
if (served !== null) {
|
|
975
|
-
return
|
|
978
|
+
return served;
|
|
976
979
|
}
|
|
977
980
|
// Only the public preload can prepare a newly discovered root; direct ttsx
|
|
978
981
|
// prepared its one entry before the child started.
|
|
979
982
|
const prepareEntry = prepareAsEntry ? prepareRuntimeEntry : undefined;
|
|
980
983
|
if (prepareEntry !== undefined) {
|
|
981
984
|
RuntimeManifestRegistry_1.RuntimeManifestRegistry.registerManifest(prepareEntry(real));
|
|
982
|
-
served =
|
|
985
|
+
served = serveInlinedEntryEmit(real, true);
|
|
983
986
|
if (served === null) {
|
|
984
987
|
throw new Error(`ttsx: prepared entry emit not found for ${filename}`);
|
|
985
988
|
}
|
|
986
|
-
return
|
|
989
|
+
return served;
|
|
987
990
|
}
|
|
988
991
|
const built = serveProjectEmit(real);
|
|
989
992
|
if (built !== null) {
|
|
@@ -1398,10 +1401,28 @@ class RuntimeEmitOwnershipError extends Error {
|
|
|
1398
1401
|
* next lane and run something else.
|
|
1399
1402
|
*/
|
|
1400
1403
|
function serveEntryEmit(real) {
|
|
1404
|
+
const owner = RuntimeManifestRegistry_1.RuntimeManifestRegistry.findEntryEmit(real);
|
|
1405
|
+
return owner === null ? null : entryEmitSource(owner, real);
|
|
1406
|
+
}
|
|
1407
|
+
/**
|
|
1408
|
+
* {@link serveEntryEmit} with the emit's source map inlined, as a module load
|
|
1409
|
+
* serves it. A checked entry build's emit is immutable for the run, so an entry
|
|
1410
|
+
* load, which Node 22.15 repeats for the process entry, reads and source-maps
|
|
1411
|
+
* each emitted file once (`RuntimeEntrySources`, samchon/ttsc#1749). Other
|
|
1412
|
+
* modules are not remembered: Node keeps each loaded module, and holding every
|
|
1413
|
+
* served text beside it would retain the whole program's emit.
|
|
1414
|
+
*/
|
|
1415
|
+
function serveInlinedEntryEmit(real, entry) {
|
|
1401
1416
|
const owner = RuntimeManifestRegistry_1.RuntimeManifestRegistry.findEntryEmit(real);
|
|
1402
1417
|
if (owner === null) {
|
|
1403
1418
|
return null;
|
|
1404
1419
|
}
|
|
1420
|
+
const prepare = () => withInlineSourceMap(entryEmitSource(owner, real));
|
|
1421
|
+
return entry
|
|
1422
|
+
? RuntimeEntrySources_1.RuntimeEntrySources.serve(owner.manifest, owner.emittedFile, prepare)
|
|
1423
|
+
: prepare();
|
|
1424
|
+
}
|
|
1425
|
+
function entryEmitSource(owner, real) {
|
|
1405
1426
|
return {
|
|
1406
1427
|
emittedFile: owner.emittedFile,
|
|
1407
1428
|
moduleOptions: owner.manifest.moduleOptions ?? {},
|
|
@@ -1895,15 +1916,20 @@ function owningTsconfig(real) {
|
|
|
1895
1916
|
const nearest = RuntimeProjectOwnership_1.RuntimeProjectOwnership.nearestTsconfig(real, recordPluginDescriptorProjectInputs);
|
|
1896
1917
|
if (nearest === null)
|
|
1897
1918
|
return null;
|
|
1898
|
-
//
|
|
1899
|
-
// reference roots
|
|
1900
|
-
//
|
|
1919
|
+
// The project this selects is built once per process (`ensureProjectBuilt`),
|
|
1920
|
+
// so the reference roots that select it are kept for the process as well;
|
|
1921
|
+
// re-expanding them for every module cost a compiler run per referenced
|
|
1922
|
+
// project (samchon/ttsc#1747). A file created after an expansion is still
|
|
1923
|
+
// expanded for afresh.
|
|
1901
1924
|
return (0, resolveOwningProjectConfig_1.resolveOwningProjectConfig)({
|
|
1925
|
+
expansions: ownerExpansions,
|
|
1902
1926
|
file: real,
|
|
1903
1927
|
onConfig: (config) => recordPluginDescriptorProjectInputs([config]),
|
|
1904
1928
|
tsconfig: nearest,
|
|
1905
1929
|
});
|
|
1906
1930
|
}
|
|
1931
|
+
/** Reference roots `owningTsconfig` expanded in this process, by config. */
|
|
1932
|
+
const ownerExpansions = new Map();
|
|
1907
1933
|
function readFileOrNull(file) {
|
|
1908
1934
|
if (file === null) {
|
|
1909
1935
|
return null;
|