@ttsc/unplugin 0.34.0 → 0.34.2
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/README.md +1 -0
- package/lib/api.js +4 -0
- package/lib/api.js.map +1 -1
- package/lib/api.mjs +2 -0
- package/lib/api.mjs.map +1 -1
- package/lib/core/bridge/TtscProjectRecord.d.cts +4 -1
- package/lib/core/bridge/TtscProjectRecord.d.mts +4 -1
- package/lib/core/bridge/TtscProjectRecord.d.ts +4 -1
- package/lib/core/bridge/projectRecordArgumentsMatch.d.cts +18 -0
- package/lib/core/bridge/projectRecordArgumentsMatch.d.mts +18 -0
- package/lib/core/bridge/projectRecordArgumentsMatch.d.ts +18 -0
- package/lib/core/bridge/projectRecordArgumentsMatch.js +36 -0
- package/lib/core/bridge/projectRecordArgumentsMatch.js.map +1 -0
- package/lib/core/bridge/projectRecordArgumentsMatch.mjs +34 -0
- package/lib/core/bridge/projectRecordArgumentsMatch.mjs.map +1 -0
- package/lib/core/bridge/projectRecordMoved.d.cts +14 -12
- package/lib/core/bridge/projectRecordMoved.d.mts +14 -12
- package/lib/core/bridge/projectRecordMoved.d.ts +14 -12
- package/lib/core/bridge/projectRecordMoved.js +17 -12
- package/lib/core/bridge/projectRecordMoved.js.map +1 -1
- package/lib/core/bridge/projectRecordMoved.mjs +17 -12
- package/lib/core/bridge/projectRecordMoved.mjs.map +1 -1
- package/lib/core/bridge/readProjectRecordFile.d.cts +4 -3
- package/lib/core/bridge/readProjectRecordFile.d.mts +4 -3
- package/lib/core/bridge/readProjectRecordFile.d.ts +4 -3
- package/lib/core/bridge/readProjectRecordFile.js +26 -3
- package/lib/core/bridge/readProjectRecordFile.js.map +1 -1
- package/lib/core/bridge/readProjectRecordFile.mjs +26 -3
- package/lib/core/bridge/readProjectRecordFile.mjs.map +1 -1
- package/lib/core/bridge/refreshProjectRecordFile.d.cts +3 -2
- package/lib/core/bridge/refreshProjectRecordFile.d.mts +3 -2
- package/lib/core/bridge/refreshProjectRecordFile.d.ts +3 -2
- package/lib/core/bridge/refreshProjectRecordFile.js +9 -3
- package/lib/core/bridge/refreshProjectRecordFile.js.map +1 -1
- package/lib/core/bridge/refreshProjectRecordFile.mjs +9 -3
- package/lib/core/bridge/refreshProjectRecordFile.mjs.map +1 -1
- package/lib/core/bridge/refreshProjectRecordFiles.d.cts +1 -1
- package/lib/core/bridge/refreshProjectRecordFiles.d.mts +1 -1
- package/lib/core/bridge/refreshProjectRecordFiles.d.ts +1 -1
- package/lib/core/bridge/refreshProjectRecordFiles.js +2 -2
- package/lib/core/bridge/refreshProjectRecordFiles.js.map +1 -1
- package/lib/core/bridge/refreshProjectRecordFiles.mjs +2 -2
- package/lib/core/bridge/refreshProjectRecordFiles.mjs.map +1 -1
- package/lib/core/index.d.cts +2 -0
- package/lib/core/index.d.mts +2 -0
- package/lib/core/index.d.ts +2 -0
- package/lib/core/index.js +4 -0
- package/lib/core/index.js.map +1 -1
- package/lib/core/index.mjs +2 -0
- package/lib/core/index.mjs.map +1 -1
- package/lib/core/next/next.js +5 -2
- package/lib/core/next/next.js.map +1 -1
- package/lib/core/next/next.mjs +5 -2
- package/lib/core/next/next.mjs.map +1 -1
- package/lib/core/options/ResolvedTtscUnpluginOptions.d.cts +2 -0
- package/lib/core/options/ResolvedTtscUnpluginOptions.d.mts +2 -0
- package/lib/core/options/ResolvedTtscUnpluginOptions.d.ts +2 -0
- package/lib/core/options/TtscUnpluginOptions.d.cts +8 -0
- package/lib/core/options/TtscUnpluginOptions.d.mts +8 -0
- package/lib/core/options/TtscUnpluginOptions.d.ts +8 -0
- package/lib/core/options/resolveOptions.d.cts +4 -3
- package/lib/core/options/resolveOptions.d.mts +4 -3
- package/lib/core/options/resolveOptions.d.ts +4 -3
- package/lib/core/options/resolveOptions.js +5 -3
- package/lib/core/options/resolveOptions.js.map +1 -1
- package/lib/core/options/resolveOptions.mjs +5 -3
- package/lib/core/options/resolveOptions.mjs.map +1 -1
- package/lib/core/rollup/rollupDeliveryOptions.d.cts +6 -6
- package/lib/core/rollup/rollupDeliveryOptions.d.mts +6 -6
- package/lib/core/rollup/rollupDeliveryOptions.d.ts +6 -6
- package/lib/core/rollup/rollupDeliveryOptions.js +9 -6
- package/lib/core/rollup/rollupDeliveryOptions.js.map +1 -1
- package/lib/core/rollup/rollupDeliveryOptions.mjs +9 -6
- package/lib/core/rollup/rollupDeliveryOptions.mjs.map +1 -1
- package/lib/core/transform/cache/TRANSFORM_CACHE_MEMBERSHIP_POLICIES.d.cts +10 -0
- package/lib/core/transform/cache/TRANSFORM_CACHE_MEMBERSHIP_POLICIES.d.mts +10 -0
- package/lib/core/transform/cache/TRANSFORM_CACHE_MEMBERSHIP_POLICIES.d.ts +10 -0
- package/lib/core/transform/cache/TRANSFORM_CACHE_MEMBERSHIP_POLICIES.js +13 -0
- package/lib/core/transform/cache/TRANSFORM_CACHE_MEMBERSHIP_POLICIES.js.map +1 -0
- package/lib/core/transform/cache/TRANSFORM_CACHE_MEMBERSHIP_POLICIES.mjs +11 -0
- package/lib/core/transform/cache/TRANSFORM_CACHE_MEMBERSHIP_POLICIES.mjs.map +1 -0
- package/lib/core/transform/cache/TtscCachedProjectTransform.d.cts +6 -0
- package/lib/core/transform/cache/TtscCachedProjectTransform.d.mts +6 -0
- package/lib/core/transform/cache/TtscCachedProjectTransform.d.ts +6 -0
- package/lib/core/transform/cache/createTransformCacheKey.d.cts +11 -8
- package/lib/core/transform/cache/createTransformCacheKey.d.mts +11 -8
- package/lib/core/transform/cache/createTransformCacheKey.d.ts +11 -8
- package/lib/core/transform/cache/createTransformCacheKey.js +11 -8
- package/lib/core/transform/cache/createTransformCacheKey.js.map +1 -1
- package/lib/core/transform/cache/createTransformCacheKey.mjs +11 -8
- package/lib/core/transform/cache/createTransformCacheKey.mjs.map +1 -1
- package/lib/core/transform/generation/TtscCompilerMembershipHint.d.cts +20 -0
- package/lib/core/transform/generation/TtscCompilerMembershipHint.d.mts +20 -0
- package/lib/core/transform/generation/TtscCompilerMembershipHint.d.ts +20 -0
- package/lib/core/transform/generation/applyCompilerMembership.d.cts +15 -0
- package/lib/core/transform/generation/applyCompilerMembership.d.mts +15 -0
- package/lib/core/transform/generation/applyCompilerMembership.d.ts +15 -0
- package/lib/core/transform/generation/applyCompilerMembership.js +41 -0
- package/lib/core/transform/generation/applyCompilerMembership.js.map +1 -0
- package/lib/core/transform/generation/applyCompilerMembership.mjs +39 -0
- package/lib/core/transform/generation/applyCompilerMembership.mjs.map +1 -0
- package/lib/core/transform/generation/captureTransformGeneration.d.cts +7 -0
- package/lib/core/transform/generation/captureTransformGeneration.d.mts +7 -0
- package/lib/core/transform/generation/captureTransformGeneration.d.ts +7 -0
- package/lib/core/transform/generation/captureTransformGeneration.js +20 -7
- package/lib/core/transform/generation/captureTransformGeneration.js.map +1 -1
- package/lib/core/transform/generation/captureTransformGeneration.mjs +20 -7
- package/lib/core/transform/generation/captureTransformGeneration.mjs.map +1 -1
- package/lib/core/transform/generation/onlyLearnedCompileFacts.d.cts +5 -5
- package/lib/core/transform/generation/onlyLearnedCompileFacts.d.mts +5 -5
- package/lib/core/transform/generation/onlyLearnedCompileFacts.d.ts +5 -5
- package/lib/core/transform/generation/onlyLearnedCompileFacts.js +7 -5
- package/lib/core/transform/generation/onlyLearnedCompileFacts.js.map +1 -1
- package/lib/core/transform/generation/onlyLearnedCompileFacts.mjs +7 -5
- package/lib/core/transform/generation/onlyLearnedCompileFacts.mjs.map +1 -1
- package/lib/core/transform/generation/primeCompilerMembership.d.cts +22 -0
- package/lib/core/transform/generation/primeCompilerMembership.d.mts +22 -0
- package/lib/core/transform/generation/primeCompilerMembership.d.ts +22 -0
- package/lib/core/transform/generation/primeCompilerMembership.js +32 -0
- package/lib/core/transform/generation/primeCompilerMembership.js.map +1 -0
- package/lib/core/transform/generation/primeCompilerMembership.mjs +30 -0
- package/lib/core/transform/generation/primeCompilerMembership.mjs.map +1 -0
- package/lib/core/transform/generation/selectReportedMembershipPolicy.d.cts +7 -7
- package/lib/core/transform/generation/selectReportedMembershipPolicy.d.mts +7 -7
- package/lib/core/transform/generation/selectReportedMembershipPolicy.d.ts +7 -7
- package/lib/core/transform/generation/selectReportedMembershipPolicy.js +43 -9
- package/lib/core/transform/generation/selectReportedMembershipPolicy.js.map +1 -1
- package/lib/core/transform/generation/selectReportedMembershipPolicy.mjs +43 -9
- package/lib/core/transform/generation/selectReportedMembershipPolicy.mjs.map +1 -1
- package/lib/core/transform/generation/transformProject.d.cts +7 -0
- package/lib/core/transform/generation/transformProject.d.mts +7 -0
- package/lib/core/transform/generation/transformProject.d.ts +7 -0
- package/lib/core/transform/generation/transformProject.js +3 -0
- package/lib/core/transform/generation/transformProject.js.map +1 -1
- package/lib/core/transform/generation/transformProject.mjs +3 -0
- package/lib/core/transform/generation/transformProject.mjs.map +1 -1
- package/lib/core/transform/project/isPossibleProgramFileName.d.cts +13 -11
- package/lib/core/transform/project/isPossibleProgramFileName.d.mts +13 -11
- package/lib/core/transform/project/isPossibleProgramFileName.d.ts +13 -11
- package/lib/core/transform/project/isPossibleProgramFileName.js +21 -13
- package/lib/core/transform/project/isPossibleProgramFileName.js.map +1 -1
- package/lib/core/transform/project/isPossibleProgramFileName.mjs +21 -13
- package/lib/core/transform/project/isPossibleProgramFileName.mjs.map +1 -1
- package/lib/core/transform/session/sharedCompileIdentity.d.cts +8 -5
- package/lib/core/transform/session/sharedCompileIdentity.d.mts +8 -5
- package/lib/core/transform/session/sharedCompileIdentity.d.ts +8 -5
- package/lib/core/transform/session/sharedCompileIdentity.js +8 -5
- package/lib/core/transform/session/sharedCompileIdentity.js.map +1 -1
- package/lib/core/transform/session/sharedCompileIdentity.mjs +8 -5
- package/lib/core/transform/session/sharedCompileIdentity.mjs.map +1 -1
- package/lib/core/transform/transformTtsc.js +18 -0
- package/lib/core/transform/transformTtsc.js.map +1 -1
- package/lib/core/transform/transformTtsc.mjs +18 -0
- package/lib/core/transform/transformTtsc.mjs.map +1 -1
- package/lib/core/transform/tsconfig/TtscCompilerArgumentsWitness.d.cts +19 -0
- package/lib/core/transform/tsconfig/TtscCompilerArgumentsWitness.d.mts +19 -0
- package/lib/core/transform/tsconfig/TtscCompilerArgumentsWitness.d.ts +19 -0
- package/lib/core/transform/tsconfig/captureCompilerArguments.d.cts +14 -0
- package/lib/core/transform/tsconfig/captureCompilerArguments.d.mts +14 -0
- package/lib/core/transform/tsconfig/captureCompilerArguments.d.ts +14 -0
- package/lib/core/transform/tsconfig/captureCompilerArguments.js +26 -0
- package/lib/core/transform/tsconfig/captureCompilerArguments.js.map +1 -0
- package/lib/core/transform/tsconfig/captureCompilerArguments.mjs +24 -0
- package/lib/core/transform/tsconfig/captureCompilerArguments.mjs.map +1 -0
- package/lib/core/transform/tsconfig/compilerEnvironmentIdentity.d.cts +13 -0
- package/lib/core/transform/tsconfig/compilerEnvironmentIdentity.d.mts +13 -0
- package/lib/core/transform/tsconfig/compilerEnvironmentIdentity.d.ts +13 -0
- package/lib/core/transform/tsconfig/compilerEnvironmentIdentity.js +23 -0
- package/lib/core/transform/tsconfig/compilerEnvironmentIdentity.js.map +1 -0
- package/lib/core/transform/tsconfig/compilerEnvironmentIdentity.mjs +21 -0
- package/lib/core/transform/tsconfig/compilerEnvironmentIdentity.mjs.map +1 -0
- package/lib/core/transform/tsconfig/resolveCompilerEnvironment.d.cts +17 -0
- package/lib/core/transform/tsconfig/resolveCompilerEnvironment.d.mts +17 -0
- package/lib/core/transform/tsconfig/resolveCompilerEnvironment.d.ts +17 -0
- package/lib/core/transform/tsconfig/resolveCompilerEnvironment.js +57 -0
- package/lib/core/transform/tsconfig/resolveCompilerEnvironment.js.map +1 -0
- package/lib/core/transform/tsconfig/resolveCompilerEnvironment.mjs +55 -0
- package/lib/core/transform/tsconfig/resolveCompilerEnvironment.mjs.map +1 -0
- package/lib/core/transform/tsconfig/transformScratchEnvironment.d.cts +6 -6
- package/lib/core/transform/tsconfig/transformScratchEnvironment.d.mts +6 -6
- package/lib/core/transform/tsconfig/transformScratchEnvironment.d.ts +6 -6
- package/lib/core/transform/tsconfig/transformScratchEnvironment.js +7 -7
- package/lib/core/transform/tsconfig/transformScratchEnvironment.js.map +1 -1
- package/lib/core/transform/tsconfig/transformScratchEnvironment.mjs +7 -7
- package/lib/core/transform/tsconfig/transformScratchEnvironment.mjs.map +1 -1
- package/lib/core/transform/watch/notifyProjectRecord.js +3 -0
- package/lib/core/transform/watch/notifyProjectRecord.js.map +1 -1
- package/lib/core/transform/watch/notifyProjectRecord.mjs +3 -0
- package/lib/core/transform/watch/notifyProjectRecord.mjs.map +1 -1
- package/lib/core/tsconfig/ITtscProjectMembershipPolicy.d.cts +14 -1
- package/lib/core/tsconfig/ITtscProjectMembershipPolicy.d.mts +14 -1
- package/lib/core/tsconfig/ITtscProjectMembershipPolicy.d.ts +14 -1
- package/lib/core/tsconfig/mergeMembershipPolicyOverlay.d.cts +4 -3
- package/lib/core/tsconfig/mergeMembershipPolicyOverlay.d.mts +4 -3
- package/lib/core/tsconfig/mergeMembershipPolicyOverlay.d.ts +4 -3
- package/lib/core/tsconfig/mergeMembershipPolicyOverlay.js +36 -6
- package/lib/core/tsconfig/mergeMembershipPolicyOverlay.js.map +1 -1
- package/lib/core/tsconfig/mergeMembershipPolicyOverlay.mjs +36 -6
- package/lib/core/tsconfig/mergeMembershipPolicyOverlay.mjs.map +1 -1
- package/lib/core/tsconfig/readProjectMembershipPolicy.d.cts +3 -2
- package/lib/core/tsconfig/readProjectMembershipPolicy.d.mts +3 -2
- package/lib/core/tsconfig/readProjectMembershipPolicy.d.ts +3 -2
- package/lib/core/tsconfig/readProjectMembershipPolicy.js +49 -15
- package/lib/core/tsconfig/readProjectMembershipPolicy.js.map +1 -1
- package/lib/core/tsconfig/readProjectMembershipPolicy.mjs +49 -15
- package/lib/core/tsconfig/readProjectMembershipPolicy.mjs.map +1 -1
- package/lib/core/tsconfig/resolveMembershipInputExtensions.d.cts +16 -0
- package/lib/core/tsconfig/resolveMembershipInputExtensions.d.mts +16 -0
- package/lib/core/tsconfig/resolveMembershipInputExtensions.d.ts +16 -0
- package/lib/core/tsconfig/resolveMembershipInputExtensions.js +45 -0
- package/lib/core/tsconfig/resolveMembershipInputExtensions.js.map +1 -0
- package/lib/core/tsconfig/resolveMembershipInputExtensions.mjs +43 -0
- package/lib/core/tsconfig/resolveMembershipInputExtensions.mjs.map +1 -0
- package/lib/core/turbopack/turbopack.d.cts +2 -2
- package/lib/core/turbopack/turbopack.d.mts +2 -2
- package/lib/core/turbopack/turbopack.d.ts +2 -2
- package/lib/core/turbopack/turbopack.js +15 -7
- package/lib/core/turbopack/turbopack.js.map +1 -1
- package/lib/core/turbopack/turbopack.mjs +15 -7
- package/lib/core/turbopack/turbopack.mjs.map +1 -1
- package/lib/core/unplugin.js +21 -8
- package/lib/core/unplugin.js.map +1 -1
- package/lib/core/unplugin.mjs +21 -8
- package/lib/core/unplugin.mjs.map +1 -1
- package/package.json +3 -3
- package/src/core/bridge/TtscProjectRecord.ts +4 -1
- package/src/core/bridge/projectRecordArgumentsMatch.ts +37 -0
- package/src/core/bridge/projectRecordMoved.ts +17 -11
- package/src/core/bridge/readProjectRecordFile.ts +39 -3
- package/src/core/bridge/refreshProjectRecordFile.ts +9 -2
- package/src/core/bridge/refreshProjectRecordFiles.ts +7 -1
- package/src/core/index.ts +2 -0
- package/src/core/next/next.ts +18 -2
- package/src/core/options/ResolvedTtscUnpluginOptions.ts +3 -0
- package/src/core/options/TtscUnpluginOptions.ts +9 -0
- package/src/core/options/resolveOptions.ts +5 -3
- package/src/core/rollup/rollupDeliveryOptions.ts +9 -5
- package/src/core/transform/cache/TRANSFORM_CACHE_MEMBERSHIP_POLICIES.ts +14 -0
- package/src/core/transform/cache/TtscCachedProjectTransform.ts +7 -0
- package/src/core/transform/cache/createTransformCacheKey.ts +13 -8
- package/src/core/transform/generation/TtscCompilerMembershipHint.ts +24 -0
- package/src/core/transform/generation/applyCompilerMembership.ts +44 -0
- package/src/core/transform/generation/captureTransformGeneration.ts +43 -10
- package/src/core/transform/generation/onlyLearnedCompileFacts.ts +7 -5
- package/src/core/transform/generation/primeCompilerMembership.ts +39 -0
- package/src/core/transform/generation/selectReportedMembershipPolicy.ts +59 -13
- package/src/core/transform/generation/transformProject.ts +12 -0
- package/src/core/transform/project/isPossibleProgramFileName.ts +28 -15
- package/src/core/transform/session/sharedCompileIdentity.ts +10 -5
- package/src/core/transform/transformTtsc.ts +21 -0
- package/src/core/transform/tsconfig/TtscCompilerArgumentsWitness.ts +19 -0
- package/src/core/transform/tsconfig/captureCompilerArguments.ts +25 -0
- package/src/core/transform/tsconfig/compilerEnvironmentIdentity.ts +20 -0
- package/src/core/transform/tsconfig/resolveCompilerEnvironment.ts +61 -0
- package/src/core/transform/tsconfig/transformScratchEnvironment.ts +7 -6
- package/src/core/transform/watch/notifyProjectRecord.ts +3 -0
- package/src/core/tsconfig/ITtscProjectMembershipPolicy.ts +15 -1
- package/src/core/tsconfig/mergeMembershipPolicyOverlay.ts +31 -6
- package/src/core/tsconfig/readProjectMembershipPolicy.ts +61 -17
- package/src/core/tsconfig/resolveMembershipInputExtensions.ts +45 -0
- package/src/core/turbopack/turbopack.ts +27 -7
- package/src/core/unplugin.ts +34 -9
|
@@ -1,27 +1,27 @@
|
|
|
1
1
|
import type { ITtscCompilerTransformation } from "ttsc";
|
|
2
2
|
import type { ITtscProjectMembershipPolicy } from "../../tsconfig/ITtscProjectMembershipPolicy";
|
|
3
3
|
/**
|
|
4
|
-
* Replace
|
|
4
|
+
* Replace provisional root settings and comparison rules with native reports.
|
|
5
5
|
*
|
|
6
6
|
* Capture supplies an explicit priming answer before walking. An exception or
|
|
7
|
-
* an envelope without
|
|
7
|
+
* an envelope without reports leaves that same policy intact. A differing
|
|
8
8
|
* report marks the old walk for refusal; this operation neither performs the
|
|
9
9
|
* walk nor establishes that a predicted answer matched the native compiler.
|
|
10
10
|
*
|
|
11
|
-
* @evidence contracts/common.md#principled-implementation
|
|
11
|
+
* @evidence contracts/common.md#principled-implementation Native case, suffix and output settings replace provisional answers; set equality determines whether a fresh walk is needed. Missing reports preserve the original policy identity and explicit excludes retain authored provenance.
|
|
12
12
|
* @evidence contracts/common.md#clear-and-simple-design One report-selection operation returns the policy and changed-rule fact; capture retains ownership of enumeration authority and proof refusal.
|
|
13
13
|
* @evidence contracts/common.md#prohibited-implementation-shortcuts No OS label or filesystem probe substitutes for a compiler report, and no report supplies missing walk evidence.
|
|
14
14
|
* @evidence contracts/common.md#meaningful-documentation Native prose states the explicit primer requirement, missing-report identity and changed-policy refusal boundary.
|
|
15
|
-
* @evidence contracts/portability.md#os-neutral-implementation
|
|
16
|
-
* @evidence contracts/performance.md#efficient-algorithms
|
|
15
|
+
* @evidence contracts/portability.md#os-neutral-implementation Native path grammar resolves directory spelling; component-boundary prefixes map only observed project root aliases to a shared anchor. Insensitive reports permit ASCII case equivalence, while non-ASCII spellings stay conservatively distinct instead of colliding through full lowercasing or Windows path.relative.
|
|
16
|
+
* @evidence contracts/performance.md#efficient-algorithms Available settings copy extension/exclusion populations; Set comparisons visit their text. At most three observed anchors are resolved once and each exclusion compares their component-boundary prefixes. Temporary storage follows those populations and path lengths; no filesystem query runs here.
|
|
17
17
|
* @evidenceExclude contracts/performance.md#reuse-equivalent-work Selects this envelope's reported rule without retaining a memo or certifying reuse of the primed walk.
|
|
18
18
|
* @evidenceExclude contracts/performance.md#bound-retention-and-release-resources Borrows the primer or returns a shallow policy object; capture owns retained policy and observer lifetimes, with no handle or historical state acquired here.
|
|
19
19
|
*/
|
|
20
20
|
export declare function selectReportedMembershipPolicy(primed: ITtscProjectMembershipPolicy & {
|
|
21
21
|
useCaseSensitiveFileNames: boolean;
|
|
22
22
|
}, result: ITtscCompilerTransformation): {
|
|
23
|
-
/** Borrowed primer or
|
|
23
|
+
/** Borrowed primer or native settings overlay for this capture's validators. */
|
|
24
24
|
membershipPolicy: ITtscProjectMembershipPolicy;
|
|
25
25
|
/** Whether the primed walk used a different rule from this compiler report. */
|
|
26
|
-
|
|
26
|
+
membershipPolicyLearned: boolean;
|
|
27
27
|
};
|
|
@@ -1,19 +1,22 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
+
var path = require('node:path');
|
|
4
|
+
var applyCompilerMembership = require('./applyCompilerMembership.js');
|
|
5
|
+
|
|
3
6
|
/**
|
|
4
|
-
* Replace
|
|
7
|
+
* Replace provisional root settings and comparison rules with native reports.
|
|
5
8
|
*
|
|
6
9
|
* Capture supplies an explicit priming answer before walking. An exception or
|
|
7
|
-
* an envelope without
|
|
10
|
+
* an envelope without reports leaves that same policy intact. A differing
|
|
8
11
|
* report marks the old walk for refusal; this operation neither performs the
|
|
9
12
|
* walk nor establishes that a predicted answer matched the native compiler.
|
|
10
13
|
*
|
|
11
|
-
* @evidence contracts/common.md#principled-implementation
|
|
14
|
+
* @evidence contracts/common.md#principled-implementation Native case, suffix and output settings replace provisional answers; set equality determines whether a fresh walk is needed. Missing reports preserve the original policy identity and explicit excludes retain authored provenance.
|
|
12
15
|
* @evidence contracts/common.md#clear-and-simple-design One report-selection operation returns the policy and changed-rule fact; capture retains ownership of enumeration authority and proof refusal.
|
|
13
16
|
* @evidence contracts/common.md#prohibited-implementation-shortcuts No OS label or filesystem probe substitutes for a compiler report, and no report supplies missing walk evidence.
|
|
14
17
|
* @evidence contracts/common.md#meaningful-documentation Native prose states the explicit primer requirement, missing-report identity and changed-policy refusal boundary.
|
|
15
|
-
* @evidence contracts/portability.md#os-neutral-implementation
|
|
16
|
-
* @evidence contracts/performance.md#efficient-algorithms
|
|
18
|
+
* @evidence contracts/portability.md#os-neutral-implementation Native path grammar resolves directory spelling; component-boundary prefixes map only observed project root aliases to a shared anchor. Insensitive reports permit ASCII case equivalence, while non-ASCII spellings stay conservatively distinct instead of colliding through full lowercasing or Windows path.relative.
|
|
19
|
+
* @evidence contracts/performance.md#efficient-algorithms Available settings copy extension/exclusion populations; Set comparisons visit their text. At most three observed anchors are resolved once and each exclusion compares their component-boundary prefixes. Temporary storage follows those populations and path lengths; no filesystem query runs here.
|
|
17
20
|
* @evidenceExclude contracts/performance.md#reuse-equivalent-work Selects this envelope's reported rule without retaining a memo or certifying reuse of the primed walk.
|
|
18
21
|
* @evidenceExclude contracts/performance.md#bound-retention-and-release-resources Borrows the primer or returns a shallow policy object; capture owns retained policy and observer lifetimes, with no handle or historical state acquired here.
|
|
19
22
|
*/
|
|
@@ -21,11 +24,42 @@ function selectReportedMembershipPolicy(primed, result) {
|
|
|
21
24
|
const reported = result.type === "exception"
|
|
22
25
|
? undefined
|
|
23
26
|
: result.graph?.useCaseSensitiveFileNames;
|
|
27
|
+
const rootReport = result.type === "exception" ? undefined : result.graph?.membership;
|
|
28
|
+
const policy = applyCompilerMembership.applyCompilerMembership(reported === undefined
|
|
29
|
+
? primed
|
|
30
|
+
: { ...primed, useCaseSensitiveFileNames: reported }, rootReport);
|
|
31
|
+
// ASCII equivalence cannot introduce Unicode expansion collisions. Other
|
|
32
|
+
// spelling changes conservatively require a fresh walk under the report.
|
|
33
|
+
const asciiFold = (value) => value.replace(/[A-Z]/g, (character) => character.toLowerCase());
|
|
34
|
+
const canonical = (value) => policy.useCaseSensitiveFileNames === false ? asciiFold(value) : value;
|
|
35
|
+
const root = primed.rootFileSpecs?.root;
|
|
36
|
+
const anchors = root === undefined
|
|
37
|
+
? []
|
|
38
|
+
: [root.path, root.realpath, root.nativepath]
|
|
39
|
+
.filter((anchor) => anchor !== undefined)
|
|
40
|
+
.map((anchor) => canonical(path.resolve(anchor)));
|
|
41
|
+
const directoryKey = (directory) => {
|
|
42
|
+
const target = canonical(path.resolve(directory));
|
|
43
|
+
for (const anchor of anchors) {
|
|
44
|
+
if (target === anchor)
|
|
45
|
+
return "root:";
|
|
46
|
+
const prefix = anchor.endsWith(path.sep) ? anchor : anchor + path.sep;
|
|
47
|
+
if (target.startsWith(prefix))
|
|
48
|
+
return "root:" + target.slice(prefix.length);
|
|
49
|
+
}
|
|
50
|
+
return "absolute:" + target;
|
|
51
|
+
};
|
|
52
|
+
const sameSet = (left, right, key) => {
|
|
53
|
+
const a = new Set(left.map(key));
|
|
54
|
+
const b = new Set(right.map(key));
|
|
55
|
+
return a.size === b.size && [...a].every((entry) => b.has(entry));
|
|
56
|
+
};
|
|
24
57
|
return {
|
|
25
|
-
membershipPolicy:
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
58
|
+
membershipPolicy: policy,
|
|
59
|
+
membershipPolicyLearned: (reported !== undefined &&
|
|
60
|
+
reported !== primed.useCaseSensitiveFileNames) ||
|
|
61
|
+
!sameSet(primed.inputExtensions, policy.inputExtensions, asciiFold) ||
|
|
62
|
+
!sameSet(primed.excludedDirectories, policy.excludedDirectories, directoryKey),
|
|
29
63
|
};
|
|
30
64
|
}
|
|
31
65
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"selectReportedMembershipPolicy.js","sources":["../../../../src/core/transform/generation/selectReportedMembershipPolicy.ts"],"sourcesContent":[null],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"selectReportedMembershipPolicy.js","sources":["../../../../src/core/transform/generation/selectReportedMembershipPolicy.ts"],"sourcesContent":[null],"names":["applyCompilerMembership"],"mappings":";;;;;AAMA;;;;;;;;;;;;;;;;AAgBG;AACG,SAAU,8BAA8B,CAC5C,MAA6E,EAC7E,MAAmC,EAAA;AAQnC,IAAA,MAAM,QAAQ,GACZ,MAAM,CAAC,IAAI,KAAK;AACd,UAAE;AACF,UAAE,MAAM,CAAC,KAAK,EAAE,yBAAyB;AAC7C,IAAA,MAAM,UAAU,GACd,MAAM,CAAC,IAAI,KAAK,WAAW,GAAG,SAAS,GAAG,MAAM,CAAC,KAAK,EAAE,UAAU;AACpE,IAAA,MAAM,MAAM,GAAGA,+CAAuB,CACpC,QAAQ,KAAK;AACX,UAAE;AACF,UAAE,EAAE,GAAG,MAAM,EAAE,yBAAyB,EAAE,QAAQ,EAAE,EACtD,UAAU,CACX;;;IAGD,MAAM,SAAS,GAAG,CAAC,KAAa,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,CAAC,GAAG,CAAC,CAAC;AAChC,QAAA,MAAM,CAAC,GAAG,IAAI,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;QACjC,OAAO,CAAC,CAAC,IAAI,KAAK,CAAC,CAAC,IAAI,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,KAAK,KAAK,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;AACnE,IAAA,CAAC;IACD,OAAO;AACL,QAAA,gBAAgB,EAAE,MAAM;AACxB,QAAA,uBAAuB,EACrB,CAAC,QAAQ,KAAK,SAAS;AACrB,YAAA,QAAQ,KAAK,MAAM,CAAC,yBAAyB;YAC/C,CAAC,OAAO,CAAC,MAAM,CAAC,eAAe,EAAE,MAAM,CAAC,eAAe,EAAE,SAAS,CAAC;YACnE,CAAC,OAAO,CACN,MAAM,CAAC,mBAAmB,EAC1B,MAAM,CAAC,mBAAmB,EAC1B,YAAY,CACb;KACJ;AACH;;;;"}
|
|
@@ -1,17 +1,20 @@
|
|
|
1
|
+
import path from 'node:path';
|
|
2
|
+
import { applyCompilerMembership } from './applyCompilerMembership.mjs';
|
|
3
|
+
|
|
1
4
|
/**
|
|
2
|
-
* Replace
|
|
5
|
+
* Replace provisional root settings and comparison rules with native reports.
|
|
3
6
|
*
|
|
4
7
|
* Capture supplies an explicit priming answer before walking. An exception or
|
|
5
|
-
* an envelope without
|
|
8
|
+
* an envelope without reports leaves that same policy intact. A differing
|
|
6
9
|
* report marks the old walk for refusal; this operation neither performs the
|
|
7
10
|
* walk nor establishes that a predicted answer matched the native compiler.
|
|
8
11
|
*
|
|
9
|
-
* @evidence contracts/common.md#principled-implementation
|
|
12
|
+
* @evidence contracts/common.md#principled-implementation Native case, suffix and output settings replace provisional answers; set equality determines whether a fresh walk is needed. Missing reports preserve the original policy identity and explicit excludes retain authored provenance.
|
|
10
13
|
* @evidence contracts/common.md#clear-and-simple-design One report-selection operation returns the policy and changed-rule fact; capture retains ownership of enumeration authority and proof refusal.
|
|
11
14
|
* @evidence contracts/common.md#prohibited-implementation-shortcuts No OS label or filesystem probe substitutes for a compiler report, and no report supplies missing walk evidence.
|
|
12
15
|
* @evidence contracts/common.md#meaningful-documentation Native prose states the explicit primer requirement, missing-report identity and changed-policy refusal boundary.
|
|
13
|
-
* @evidence contracts/portability.md#os-neutral-implementation
|
|
14
|
-
* @evidence contracts/performance.md#efficient-algorithms
|
|
16
|
+
* @evidence contracts/portability.md#os-neutral-implementation Native path grammar resolves directory spelling; component-boundary prefixes map only observed project root aliases to a shared anchor. Insensitive reports permit ASCII case equivalence, while non-ASCII spellings stay conservatively distinct instead of colliding through full lowercasing or Windows path.relative.
|
|
17
|
+
* @evidence contracts/performance.md#efficient-algorithms Available settings copy extension/exclusion populations; Set comparisons visit their text. At most three observed anchors are resolved once and each exclusion compares their component-boundary prefixes. Temporary storage follows those populations and path lengths; no filesystem query runs here.
|
|
15
18
|
* @evidenceExclude contracts/performance.md#reuse-equivalent-work Selects this envelope's reported rule without retaining a memo or certifying reuse of the primed walk.
|
|
16
19
|
* @evidenceExclude contracts/performance.md#bound-retention-and-release-resources Borrows the primer or returns a shallow policy object; capture owns retained policy and observer lifetimes, with no handle or historical state acquired here.
|
|
17
20
|
*/
|
|
@@ -19,11 +22,42 @@ function selectReportedMembershipPolicy(primed, result) {
|
|
|
19
22
|
const reported = result.type === "exception"
|
|
20
23
|
? undefined
|
|
21
24
|
: result.graph?.useCaseSensitiveFileNames;
|
|
25
|
+
const rootReport = result.type === "exception" ? undefined : result.graph?.membership;
|
|
26
|
+
const policy = applyCompilerMembership(reported === undefined
|
|
27
|
+
? primed
|
|
28
|
+
: { ...primed, useCaseSensitiveFileNames: reported }, rootReport);
|
|
29
|
+
// ASCII equivalence cannot introduce Unicode expansion collisions. Other
|
|
30
|
+
// spelling changes conservatively require a fresh walk under the report.
|
|
31
|
+
const asciiFold = (value) => value.replace(/[A-Z]/g, (character) => character.toLowerCase());
|
|
32
|
+
const canonical = (value) => policy.useCaseSensitiveFileNames === false ? asciiFold(value) : value;
|
|
33
|
+
const root = primed.rootFileSpecs?.root;
|
|
34
|
+
const anchors = root === undefined
|
|
35
|
+
? []
|
|
36
|
+
: [root.path, root.realpath, root.nativepath]
|
|
37
|
+
.filter((anchor) => anchor !== undefined)
|
|
38
|
+
.map((anchor) => canonical(path.resolve(anchor)));
|
|
39
|
+
const directoryKey = (directory) => {
|
|
40
|
+
const target = canonical(path.resolve(directory));
|
|
41
|
+
for (const anchor of anchors) {
|
|
42
|
+
if (target === anchor)
|
|
43
|
+
return "root:";
|
|
44
|
+
const prefix = anchor.endsWith(path.sep) ? anchor : anchor + path.sep;
|
|
45
|
+
if (target.startsWith(prefix))
|
|
46
|
+
return "root:" + target.slice(prefix.length);
|
|
47
|
+
}
|
|
48
|
+
return "absolute:" + target;
|
|
49
|
+
};
|
|
50
|
+
const sameSet = (left, right, key) => {
|
|
51
|
+
const a = new Set(left.map(key));
|
|
52
|
+
const b = new Set(right.map(key));
|
|
53
|
+
return a.size === b.size && [...a].every((entry) => b.has(entry));
|
|
54
|
+
};
|
|
22
55
|
return {
|
|
23
|
-
membershipPolicy:
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
56
|
+
membershipPolicy: policy,
|
|
57
|
+
membershipPolicyLearned: (reported !== undefined &&
|
|
58
|
+
reported !== primed.useCaseSensitiveFileNames) ||
|
|
59
|
+
!sameSet(primed.inputExtensions, policy.inputExtensions, asciiFold) ||
|
|
60
|
+
!sameSet(primed.excludedDirectories, policy.excludedDirectories, directoryKey),
|
|
27
61
|
};
|
|
28
62
|
}
|
|
29
63
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"selectReportedMembershipPolicy.mjs","sources":["../../../../src/core/transform/generation/selectReportedMembershipPolicy.ts"],"sourcesContent":[null],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"selectReportedMembershipPolicy.mjs","sources":["../../../../src/core/transform/generation/selectReport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options/ResolvedTtscUnpluginOptions.cjs";
|
|
2
2
|
import type { TtscCachedProjectTransform } from "../cache/TtscCachedProjectTransform.cjs";
|
|
3
3
|
import type { TtscTransformFilesystemOperations } from "../filesystem/TtscTransformFilesystemOperations.cjs";
|
|
4
|
+
import type { TtscCompilerMembershipHint } from "./TtscCompilerMembershipHint.cjs";
|
|
4
5
|
/**
|
|
5
6
|
* Compile one whole project generation, retrying within a bound while its proof
|
|
6
7
|
* is lost to a filesystem race.
|
|
@@ -76,6 +77,12 @@ export declare function transformProject(props: {
|
|
|
76
77
|
aliasPaths: Record<string, string[]>;
|
|
77
78
|
/** Compiler-option overlay, preserving the underlying config semantics. */
|
|
78
79
|
compilerOptions: Record<string, unknown>;
|
|
80
|
+
/** Detached environment selected before this generation's cache lookup. */
|
|
81
|
+
compilerEnvironment?: NodeJS.ProcessEnv;
|
|
82
|
+
/** Explicit override retained with persisted invocation proof. */
|
|
83
|
+
runExternalCode?: boolean;
|
|
84
|
+
/** Previous native root policy; the new compiler report can refute it. */
|
|
85
|
+
compilerMembership?: TtscCompilerMembershipHint;
|
|
79
86
|
/** Native path of the module whose delivery initiated this capture. */
|
|
80
87
|
currentFile: string;
|
|
81
88
|
/** Delivered module text compared against the compiler's disk observation. */
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { ResolvedTtscUnpluginOptions } from "../../options/ResolvedTtscUnpluginOptions.mjs";
|
|
2
2
|
import type { TtscCachedProjectTransform } from "../cache/TtscCachedProjectTransform.mjs";
|
|
3
3
|
import type { TtscTransformFilesystemOperations } from "../filesystem/TtscTransformFilesystemOperations.mjs";
|
|
4
|
+
import type { TtscCompilerMembershipHint } from "./TtscCompilerMembershipHint.mjs";
|
|
4
5
|
/**
|
|
5
6
|
* Compile one whole project generation, retrying within a bound while its proof
|
|
6
7
|
* is lost to a filesystem race.
|
|
@@ -76,6 +77,12 @@ export declare function transformProject(props: {
|
|
|
76
77
|
aliasPaths: Record<string, string[]>;
|
|
77
78
|
/** Compiler-option overlay, preserving the underlying config semantics. */
|
|
78
79
|
compilerOptions: Record<string, unknown>;
|
|
80
|
+
/** Detached environment selected before this generation's cache lookup. */
|
|
81
|
+
compilerEnvironment?: NodeJS.ProcessEnv;
|
|
82
|
+
/** Explicit override retained with persisted invocation proof. */
|
|
83
|
+
runExternalCode?: boolean;
|
|
84
|
+
/** Previous native root policy; the new compiler report can refute it. */
|
|
85
|
+
compilerMembership?: TtscCompilerMembershipHint;
|
|
79
86
|
/** Native path of the module whose delivery initiated this capture. */
|
|
80
87
|
currentFile: string;
|
|
81
88
|
/** Delivered module text compared against the compiler's disk observation. */
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { ResolvedTtscUnpluginOptions } from "../../options/ResolvedTtscUnpluginOptions";
|
|
2
2
|
import type { TtscCachedProjectTransform } from "../cache/TtscCachedProjectTransform";
|
|
3
3
|
import type { TtscTransformFilesystemOperations } from "../filesystem/TtscTransformFilesystemOperations";
|
|
4
|
+
import type { TtscCompilerMembershipHint } from "./TtscCompilerMembershipHint";
|
|
4
5
|
/**
|
|
5
6
|
* Compile one whole project generation, retrying within a bound while its proof
|
|
6
7
|
* is lost to a filesystem race.
|
|
@@ -76,6 +77,12 @@ export declare function transformProject(props: {
|
|
|
76
77
|
aliasPaths: Record<string, string[]>;
|
|
77
78
|
/** Compiler-option overlay, preserving the underlying config semantics. */
|
|
78
79
|
compilerOptions: Record<string, unknown>;
|
|
80
|
+
/** Detached environment selected before this generation's cache lookup. */
|
|
81
|
+
compilerEnvironment?: NodeJS.ProcessEnv;
|
|
82
|
+
/** Explicit override retained with persisted invocation proof. */
|
|
83
|
+
runExternalCode?: boolean;
|
|
84
|
+
/** Previous native root policy; the new compiler report can refute it. */
|
|
85
|
+
compilerMembership?: TtscCompilerMembershipHint;
|
|
79
86
|
/** Native path of the module whose delivery initiated this capture. */
|
|
80
87
|
currentFile: string;
|
|
81
88
|
/** Delivered module text compared against the compiler's disk observation. */
|
|
@@ -88,9 +88,11 @@ async function transformProject(props) {
|
|
|
88
88
|
let moved = 0;
|
|
89
89
|
let witnessed = new Set(props.witnessedDependencies);
|
|
90
90
|
let useCaseSensitiveFileNames = props.useCaseSensitiveFileNames;
|
|
91
|
+
let compilerMembership = props.compilerMembership;
|
|
91
92
|
for (let attempt = 0;; attempt += 1) {
|
|
92
93
|
const cached = await captureTransformGeneration.captureTransformGeneration({
|
|
93
94
|
...props,
|
|
95
|
+
compilerMembership,
|
|
94
96
|
rejected,
|
|
95
97
|
useCaseSensitiveFileNames,
|
|
96
98
|
witnessedDependencies: [...witnessed],
|
|
@@ -144,6 +146,7 @@ async function transformProject(props) {
|
|
|
144
146
|
const nextInputs = carryTransformAttemptInputs.carryTransformAttemptInputs(witnessed, useCaseSensitiveFileNames, cached);
|
|
145
147
|
witnessed = nextInputs.witnessed;
|
|
146
148
|
useCaseSensitiveFileNames = nextInputs.useCaseSensitiveFileNames;
|
|
149
|
+
compilerMembership = cached.compilerMembership;
|
|
147
150
|
// A publication refuted here would be found again by a retry for the same
|
|
148
151
|
// state, which therefore compiles and replaces it. A retry whose project
|
|
149
152
|
// moved to another state claims that state's publication, and adopts it:
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transformProject.js","sources":["../../../../src/core/transform/generation/transformProject.ts"],"sourcesContent":[null],"names":["traceInvocation","captureTransformGeneration","selectTransformAttemptDisposition","TRANSFORM_GENERATION_FAILURES","TRANSFORM_ADOPTED_RESULTS","carryTransformAttemptInputs","TRANSFORM_FAILED_GENERATION_VALIDATIONS","disposeCachedTransform","createUnstableGenerationError"],"mappings":";;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"transformProject.js","sources":["../../../../src/core/transform/generation/transformProject.ts"],"sourcesContent":[null],"names":["traceInvocation","captureTransformGeneration","selectTransformAttemptDisposition","TRANSFORM_GENERATION_FAILURES","TRANSFORM_ADOPTED_RESULTS","carryTransformAttemptInputs","TRANSFORM_FAILED_GENERATION_VALIDATIONS","disposeCachedT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ACnC,MAAM,UAAU,GAAGC,uDAA2B,CAC5C,SAAS,EACT,yBAAyB,EACzB,MAAM,CACP;AACD,QAAA,SAAS,GAAG,UAAU,CAAC,SAAS;AAChC,QAAA,yBAAyB,GAAG,UAAU,CAAC,yBAAyB;AAChE,QAAA,kBAAkB,GAAG,MAAM,CAAC,kBAAkB;;;;;;;;AAQ9C,QAAA,QAAQ,GAAG,WAAW,CAAC,QAAQ;AAC/B,QAAA,KAAK,GAAG,WAAW,CAAC,KAAK;;;AAGzB,QAAA,IAAI,WAAW,CAAC,IAAI,KAAK,YAAY,EAAE;AACrC,YAAA,OAAO,MAAM;QACf;AACA,QAAA,IAAI,WAAW,CAAC,IAAI,KAAK,UAAU,EAAE;YACnC,MAAM,UAAU,GAAGC,+EAAuC,CAAC,GAAG,CAC5D,MAAM,CAAC,MAAM,CACd;AACD,YAAA,IAAI,UAAU,KAAK,SAAS,EAAE;gBAC5BC,6CAAsB,CAAC,MAAM,CAAC;AAC9B,gBAAA,MAAM,IAAI,KAAK,CACb,oEAAoE,CACrE;YACH;AACA,YAAA,MAAMC,2DAA6B,CACjC,KAAK,CAAC,WAAW,IAAI,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,QAAQ,CAAC,EACjD,QAAQ,EACR,UAAU,CACX;QACH;QACAD,6CAAsB,CAAC,MAAM,CAAC;IAChC;AACF;;;;"}
|
|
@@ -86,9 +86,11 @@ async function transformProject(props) {
|
|
|
86
86
|
let moved = 0;
|
|
87
87
|
let witnessed = new Set(props.witnessedDependencies);
|
|
88
88
|
let useCaseSensitiveFileNames = props.useCaseSensitiveFileNames;
|
|
89
|
+
let compilerMembership = props.compilerMembership;
|
|
89
90
|
for (let attempt = 0;; attempt += 1) {
|
|
90
91
|
const cached = await captureTransformGeneration({
|
|
91
92
|
...props,
|
|
93
|
+
compilerMembership,
|
|
92
94
|
rejected,
|
|
93
95
|
useCaseSensitiveFileNames,
|
|
94
96
|
witnessedDependencies: [...witnessed],
|
|
@@ -142,6 +144,7 @@ async function transformProject(props) {
|
|
|
142
144
|
const nextInputs = carryTransformAttemptInputs(witnessed, useCaseSensitiveFileNames, cached);
|
|
143
145
|
witnessed = nextInputs.witnessed;
|
|
144
146
|
useCaseSensitiveFileNames = nextInputs.useCaseSensitiveFileNames;
|
|
147
|
+
compilerMembership = cached.compilerMembership;
|
|
145
148
|
// A publication refuted here would be found again by a retry for the same
|
|
146
149
|
// state, which therefore compiles and replaces it. A retry whose project
|
|
147
150
|
// moved to another state claims that state's publication, and adopts it:
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transformProject.mjs","sources":["../../../../src/core/transform/generation/transformProject.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"transformProject.mjs","sources":["../../../../src/core/transform/generation/transformProject.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;;;;;;;;AAiBA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqEG;AACI,eAAe,gBAAgB,CAAC,KA6EtC,EAAA;AACC,IAAA,MAAM,YAAY,GAAG,eAAe,EAAE;IACtC,MAAM,QAAQ,GAAkC,EAAE;AAClD,IAAA,IAAI,QAA4B;IAChC,IAAI,KAAK,GAAG,CAAC;IACb,IAAI,SAAS,GAAG,IAAI,GAAG,CAAC,KAAK,CAAC,qBAAqB,CAAC;AACpD,IAAA,IAAI,yBAAyB,GAAG,KAAK,CAAC,yBAAyB;AAC/D,IAAA,IAAI,kBAAkB,GAAG,KAAK,CAAC,kBAAkB;IACjD,KAAK,IAAI,OAAO,GAAG,CAAC,GAAI,OAAO,IAAI,CAAC,EAAE;AACpC,QAAA,MAAM,MAAM,GAAG,MAAM,0BAA0B,CAAC;AAC9C,YAAA,GAAG,KAAK;YACR,kBAAkB;YAClB,QAAQ;YACR,yBAAyB;AACzB,YAAA,qBAAqB,EAAE,CAAC,GAAG,SAAS,CAAC;AAC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,OAAO,CAAC,KAAK,CAAC,QAAQ,CAAC,EACjD,QAAQ,EACR,UAAU,CACX;QACH;QACA,sBAAsB,CAAC,MAAM,CAAC;IAChC;AACF;;;;"}
|
|
@@ -2,19 +2,21 @@ import type { ITtscProjectMembershipPolicy } from "../../tsconfig/ITtscProjectMe
|
|
|
2
2
|
/**
|
|
3
3
|
* Whether a bare filename has an extension admitted by the project policy.
|
|
4
4
|
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
5
|
+
* Literal expressions preserve Unicode simple case folding without expanding or
|
|
6
|
+
* contextually lowercasing either operand. This remains conservative root
|
|
7
|
+
* eligibility, independently of filesystem identity or compiler enumeration.
|
|
8
|
+
*
|
|
9
|
+
* @evidence contracts/common.md#principled-implementation Escaped literal suffixes use Unicode simple folding and a strict end boundary; this preserves dotted I and contextual sigma without treating mapper punctuation as regex grammar.
|
|
10
|
+
* @evidence contracts/common.md#clear-and-simple-design One weakly owned expression list per immutable policy serves an early-terminating suffix scan without filesystem work.
|
|
7
11
|
* @evidence contracts/common.md#prohibited-implementation-shortcuts The predicate uses compiler-derived extension policy rather than selected test filenames or bundler output-directory exceptions.
|
|
8
12
|
* @evidence contracts/common.md#meaningful-documentation The native comment states the bare-name input and policy boundary, avoiding an ambiguous reference to another helper's question.
|
|
9
|
-
* @evidenceExclude contracts/portability.md#os-neutral-implementation Compares
|
|
13
|
+
* @evidenceExclude contracts/portability.md#os-neutral-implementation Compares basename text using literal Unicode suffixes; it reads no filesystem or OS-name policy.
|
|
10
14
|
* @evidence contracts/performance.md#efficient-algorithms
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
* suffix
|
|
14
|
-
*
|
|
15
|
-
* @
|
|
16
|
-
*
|
|
17
|
-
* @evidenceExclude contracts/performance.md#bound-retention-and-release-resources
|
|
18
|
-
* Acquires no handle, timer or retained state of its own.
|
|
15
|
+
* A cold policy compiles its suffix text once. Queries scan the supplied
|
|
16
|
+
* expressions until a match, with literal search work following filename
|
|
17
|
+
* length and suffix text; no authored wildcard or repeated pattern activates
|
|
18
|
+
* backtracking partitions. Retained expression text follows the suffix list.
|
|
19
|
+
* @evidence contracts/performance.md#reuse-equivalent-work Compiled literal expressions are shared only by the same immutable policy identity; changing its suffix list requires a new policy, as other membership matchers require.
|
|
20
|
+
* @evidence contracts/performance.md#bound-retention-and-release-resources The WeakMap retains expressions while their policy remains reachable and does not pin discarded policies; there are no filename histories, handles or timers.
|
|
19
21
|
*/
|
|
20
22
|
export declare function isPossibleProgramFileName(name: string, policy: ITtscProjectMembershipPolicy): boolean;
|
|
@@ -2,19 +2,21 @@ import type { ITtscProjectMembershipPolicy } from "../../tsconfig/ITtscProjectMe
|
|
|
2
2
|
/**
|
|
3
3
|
* Whether a bare filename has an extension admitted by the project policy.
|
|
4
4
|
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
5
|
+
* Literal expressions preserve Unicode simple case folding without expanding or
|
|
6
|
+
* contextually lowercasing either operand. This remains conservative root
|
|
7
|
+
* eligibility, independently of filesystem identity or compiler enumeration.
|
|
8
|
+
*
|
|
9
|
+
* @evidence contracts/common.md#principled-implementation Escaped literal suffixes use Unicode simple folding and a strict end boundary; this preserves dotted I and contextual sigma without treating mapper punctuation as regex grammar.
|
|
10
|
+
* @evidence contracts/common.md#clear-and-simple-design One weakly owned expression list per immutable policy serves an early-terminating suffix scan without filesystem work.
|
|
7
11
|
* @evidence contracts/common.md#prohibited-implementation-shortcuts The predicate uses compiler-derived extension policy rather than selected test filenames or bundler output-directory exceptions.
|
|
8
12
|
* @evidence contracts/common.md#meaningful-documentation The native comment states the bare-name input and policy boundary, avoiding an ambiguous reference to another helper's question.
|
|
9
|
-
* @evidenceExclude contracts/portability.md#os-neutral-implementation Compares
|
|
13
|
+
* @evidenceExclude contracts/portability.md#os-neutral-implementation Compares basename text using literal Unicode suffixes; it reads no filesystem or OS-name policy.
|
|
10
14
|
* @evidence contracts/performance.md#efficient-algorithms
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
* suffix
|
|
14
|
-
*
|
|
15
|
-
* @
|
|
16
|
-
*
|
|
17
|
-
* @evidenceExclude contracts/performance.md#bound-retention-and-release-resources
|
|
18
|
-
* Acquires no handle, timer or retained state of its own.
|
|
15
|
+
* A cold policy compiles its suffix text once. Queries scan the supplied
|
|
16
|
+
* expressions until a match, with literal search work following filename
|
|
17
|
+
* length and suffix text; no authored wildcard or repeated pattern activates
|
|
18
|
+
* backtracking partitions. Retained expression text follows the suffix list.
|
|
19
|
+
* @evidence contracts/performance.md#reuse-equivalent-work Compiled literal expressions are shared only by the same immutable policy identity; changing its suffix list requires a new policy, as other membership matchers require.
|
|
20
|
+
* @evidence contracts/performance.md#bound-retention-and-release-resources The WeakMap retains expressions while their policy remains reachable and does not pin discarded policies; there are no filename histories, handles or timers.
|
|
19
21
|
*/
|
|
20
22
|
export declare function isPossibleProgramFileName(name: string, policy: ITtscProjectMembershipPolicy): boolean;
|
|
@@ -2,19 +2,21 @@ import type { ITtscProjectMembershipPolicy } from "../../tsconfig/ITtscProjectMe
|
|
|
2
2
|
/**
|
|
3
3
|
* Whether a bare filename has an extension admitted by the project policy.
|
|
4
4
|
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
5
|
+
* Literal expressions preserve Unicode simple case folding without expanding or
|
|
6
|
+
* contextually lowercasing either operand. This remains conservative root
|
|
7
|
+
* eligibility, independently of filesystem identity or compiler enumeration.
|
|
8
|
+
*
|
|
9
|
+
* @evidence contracts/common.md#principled-implementation Escaped literal suffixes use Unicode simple folding and a strict end boundary; this preserves dotted I and contextual sigma without treating mapper punctuation as regex grammar.
|
|
10
|
+
* @evidence contracts/common.md#clear-and-simple-design One weakly owned expression list per immutable policy serves an early-terminating suffix scan without filesystem work.
|
|
7
11
|
* @evidence contracts/common.md#prohibited-implementation-shortcuts The predicate uses compiler-derived extension policy rather than selected test filenames or bundler output-directory exceptions.
|
|
8
12
|
* @evidence contracts/common.md#meaningful-documentation The native comment states the bare-name input and policy boundary, avoiding an ambiguous reference to another helper's question.
|
|
9
|
-
* @evidenceExclude contracts/portability.md#os-neutral-implementation Compares
|
|
13
|
+
* @evidenceExclude contracts/portability.md#os-neutral-implementation Compares basename text using literal Unicode suffixes; it reads no filesystem or OS-name policy.
|
|
10
14
|
* @evidence contracts/performance.md#efficient-algorithms
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
* suffix
|
|
14
|
-
*
|
|
15
|
-
* @
|
|
16
|
-
*
|
|
17
|
-
* @evidenceExclude contracts/performance.md#bound-retention-and-release-resources
|
|
18
|
-
* Acquires no handle, timer or retained state of its own.
|
|
15
|
+
* A cold policy compiles its suffix text once. Queries scan the supplied
|
|
16
|
+
* expressions until a match, with literal search work following filename
|
|
17
|
+
* length and suffix text; no authored wildcard or repeated pattern activates
|
|
18
|
+
* backtracking partitions. Retained expression text follows the suffix list.
|
|
19
|
+
* @evidence contracts/performance.md#reuse-equivalent-work Compiled literal expressions are shared only by the same immutable policy identity; changing its suffix list requires a new policy, as other membership matchers require.
|
|
20
|
+
* @evidence contracts/performance.md#bound-retention-and-release-resources The WeakMap retains expressions while their policy remains reachable and does not pin discarded policies; there are no filename histories, handles or timers.
|
|
19
21
|
*/
|
|
20
22
|
export declare function isPossibleProgramFileName(name: string, policy: ITtscProjectMembershipPolicy): boolean;
|
|
@@ -3,25 +3,33 @@
|
|
|
3
3
|
/**
|
|
4
4
|
* Whether a bare filename has an extension admitted by the project policy.
|
|
5
5
|
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
6
|
+
* Literal expressions preserve Unicode simple case folding without expanding or
|
|
7
|
+
* contextually lowercasing either operand. This remains conservative root
|
|
8
|
+
* eligibility, independently of filesystem identity or compiler enumeration.
|
|
9
|
+
*
|
|
10
|
+
* @evidence contracts/common.md#principled-implementation Escaped literal suffixes use Unicode simple folding and a strict end boundary; this preserves dotted I and contextual sigma without treating mapper punctuation as regex grammar.
|
|
11
|
+
* @evidence contracts/common.md#clear-and-simple-design One weakly owned expression list per immutable policy serves an early-terminating suffix scan without filesystem work.
|
|
8
12
|
* @evidence contracts/common.md#prohibited-implementation-shortcuts The predicate uses compiler-derived extension policy rather than selected test filenames or bundler output-directory exceptions.
|
|
9
13
|
* @evidence contracts/common.md#meaningful-documentation The native comment states the bare-name input and policy boundary, avoiding an ambiguous reference to another helper's question.
|
|
10
|
-
* @evidenceExclude contracts/portability.md#os-neutral-implementation Compares
|
|
14
|
+
* @evidenceExclude contracts/portability.md#os-neutral-implementation Compares basename text using literal Unicode suffixes; it reads no filesystem or OS-name policy.
|
|
11
15
|
* @evidence contracts/performance.md#efficient-algorithms
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
* suffix
|
|
15
|
-
*
|
|
16
|
-
* @
|
|
17
|
-
*
|
|
18
|
-
* @evidenceExclude contracts/performance.md#bound-retention-and-release-resources
|
|
19
|
-
* Acquires no handle, timer or retained state of its own.
|
|
16
|
+
* A cold policy compiles its suffix text once. Queries scan the supplied
|
|
17
|
+
* expressions until a match, with literal search work following filename
|
|
18
|
+
* length and suffix text; no authored wildcard or repeated pattern activates
|
|
19
|
+
* backtracking partitions. Retained expression text follows the suffix list.
|
|
20
|
+
* @evidence contracts/performance.md#reuse-equivalent-work Compiled literal expressions are shared only by the same immutable policy identity; changing its suffix list requires a new policy, as other membership matchers require.
|
|
21
|
+
* @evidence contracts/performance.md#bound-retention-and-release-resources The WeakMap retains expressions while their policy remains reachable and does not pin discarded policies; there are no filename histories, handles or timers.
|
|
20
22
|
*/
|
|
21
23
|
function isPossibleProgramFileName(name, policy) {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
+
let patterns = compiled.get(policy);
|
|
25
|
+
if (patterns === undefined) {
|
|
26
|
+
patterns = policy.inputExtensions.map((extension) => new RegExp(`${extension.replace(/[\\^$.*+?()[\]{}|]/g, "\\$&")}(?![\\s\\S])`, "iu"));
|
|
27
|
+
compiled.set(policy, patterns);
|
|
28
|
+
}
|
|
29
|
+
return patterns.some((pattern) => pattern.test(name));
|
|
24
30
|
}
|
|
31
|
+
/** Literal suffix expressions owned weakly by immutable membership policy. */
|
|
32
|
+
const compiled = new WeakMap();
|
|
25
33
|
|
|
26
34
|
exports.isPossibleProgramFileName = isPossibleProgramFileName;
|
|
27
35
|
//# sourceMappingURL=isPossibleProgramFileName.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"isPossibleProgramFileName.js","sources":["../../../../src/core/transform/project/isPossibleProgramFileName.ts"],"sourcesContent":[null],"names":[],"mappings":";;AAEA
|
|
1
|
+
{"version":3,"file":"isPossibleProgramFileName.js","sources":["../../../../src/core/transform/project/isPossibleProgramFileName.ts"],"sourcesContent":[null],"names":[],"mappings":";;AAEA;;;;;;;;;;;;;;;;;;;AAmBG;AACG,SAAU,yBAAyB,CACvC,IAAY,EACZ,MAAoC,EAAA;IAEpC,IAAI,QAAQ,GAAG,QAAQ,CAAC,GAAG,CAAC,MAAM,CAAC;AACnC,IAAA,IAAI,QAAQ,KAAK,SAAS,EAAE;AAC1B,QAAA,QAAQ,GAAG,MAAM,CAAC,eAAe,CAAC,GAAG,CACnC,CAAC,SAAS,KACR,IAAI,MAAM,CACR,CAAA,EAAG,SAAS,CAAC,OAAO,CAAC,qBAAqB,EAAE,MAAM,CAAC,CAAA,YAAA,CAAc,EACjE,IAAI,CACL,CACJ;AACD,QAAA,QAAQ,CAAC,GAAG,CAAC,MAAM,EAAE,QAAQ,CAAC;IAChC;AACA,IAAA,OAAO,QAAQ,CAAC,IAAI,CAAC,CAAC,OAAO,KAAK,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACvD;AAEA;AACA,MAAM,QAAQ,GAAG,IAAI,OAAO,EAAmD;;;;"}
|
|
@@ -1,25 +1,33 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Whether a bare filename has an extension admitted by the project policy.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
4
|
+
* Literal expressions preserve Unicode simple case folding without expanding or
|
|
5
|
+
* contextually lowercasing either operand. This remains conservative root
|
|
6
|
+
* eligibility, independently of filesystem identity or compiler enumeration.
|
|
7
|
+
*
|
|
8
|
+
* @evidence contracts/common.md#principled-implementation Escaped literal suffixes use Unicode simple folding and a strict end boundary; this preserves dotted I and contextual sigma without treating mapper punctuation as regex grammar.
|
|
9
|
+
* @evidence contracts/common.md#clear-and-simple-design One weakly owned expression list per immutable policy serves an early-terminating suffix scan without filesystem work.
|
|
6
10
|
* @evidence contracts/common.md#prohibited-implementation-shortcuts The predicate uses compiler-derived extension policy rather than selected test filenames or bundler output-directory exceptions.
|
|
7
11
|
* @evidence contracts/common.md#meaningful-documentation The native comment states the bare-name input and policy boundary, avoiding an ambiguous reference to another helper's question.
|
|
8
|
-
* @evidenceExclude contracts/portability.md#os-neutral-implementation Compares
|
|
12
|
+
* @evidenceExclude contracts/portability.md#os-neutral-implementation Compares basename text using literal Unicode suffixes; it reads no filesystem or OS-name policy.
|
|
9
13
|
* @evidence contracts/performance.md#efficient-algorithms
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
* suffix
|
|
13
|
-
*
|
|
14
|
-
* @
|
|
15
|
-
*
|
|
16
|
-
* @evidenceExclude contracts/performance.md#bound-retention-and-release-resources
|
|
17
|
-
* Acquires no handle, timer or retained state of its own.
|
|
14
|
+
* A cold policy compiles its suffix text once. Queries scan the supplied
|
|
15
|
+
* expressions until a match, with literal search work following filename
|
|
16
|
+
* length and suffix text; no authored wildcard or repeated pattern activates
|
|
17
|
+
* backtracking partitions. Retained expression text follows the suffix list.
|
|
18
|
+
* @evidence contracts/performance.md#reuse-equivalent-work Compiled literal expressions are shared only by the same immutable policy identity; changing its suffix list requires a new policy, as other membership matchers require.
|
|
19
|
+
* @evidence contracts/performance.md#bound-retention-and-release-resources The WeakMap retains expressions while their policy remains reachable and does not pin discarded policies; there are no filename histories, handles or timers.
|
|
18
20
|
*/
|
|
19
21
|
function isPossibleProgramFileName(name, policy) {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
+
let patterns = compiled.get(policy);
|
|
23
|
+
if (patterns === undefined) {
|
|
24
|
+
patterns = policy.inputExtensions.map((extension) => new RegExp(`${extension.replace(/[\\^$.*+?()[\]{}|]/g, "\\$&")}(?![\\s\\S])`, "iu"));
|
|
25
|
+
compiled.set(policy, patterns);
|
|
26
|
+
}
|
|
27
|
+
return patterns.some((pattern) => pattern.test(name));
|
|
22
28
|
}
|
|
29
|
+
/** Literal suffix expressions owned weakly by immutable membership policy. */
|
|
30
|
+
const compiled = new WeakMap();
|
|
23
31
|
|
|
24
32
|
export { isPossibleProgramFileName };
|
|
25
33
|
//# sourceMappingURL=isPossibleProgramFileName.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"isPossibleProgramFileName.mjs","sources":["../../../../src/core/transform/project/isPossibleProgramFileName.ts"],"sourcesContent":[null],"names":[],"mappings":"AAEA
|
|
1
|
+
{"version":3,"file":"isPossibleProgramFileName.mjs","sources":["../../../../src/core/transform/project/isPossibleProgramFileName.ts"],"sourcesContent":[null],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;AAmBG;AACG,SAAU,yBAAyB,CACvC,IAAY,EACZ,MAAoC,EAAA;IAEpC,IAAI,QAAQ,GAAG,QAAQ,CAAC,GAAG,CAAC,MAAM,CAAC;AACnC,IAAA,IAAI,QAAQ,KAAK,SAAS,EAAE;AAC1B,QAAA,QAAQ,GAAG,MAAM,CAAC,eAAe,CAAC,GAAG,CACnC,CAAC,SAAS,KACR,IAAI,MAAM,CACR,CAAA,EAAG,SAAS,CAAC,OAAO,CAAC,qBAAqB,EAAE,MAAM,CAAC,CAAA,YAAA,CAAc,EACjE,IAAI,CACL,CACJ;AACD,QAAA,QAAQ,CAAC,GAAG,CAAC,MAAM,EAAE,QAAQ,CAAC;IAChC;AACA,IAAA,OAAO,QAAQ,CAAC,IAAI,CAAC,CAAC,OAAO,KAAK,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACvD;AAEA;AACA,MAAM,QAAQ,GAAG,IAAI,OAAO,EAAmD;;;;"}
|