@ttsc/unplugin 0.38.0 → 0.38.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 -1
- package/lib/core/bridge/HostWatchBridge.d.cts +1 -1
- package/lib/core/bridge/HostWatchBridge.d.mts +1 -1
- package/lib/core/bridge/HostWatchBridge.d.ts +1 -1
- package/lib/core/bridge/MANAGED_PROJECT_RECORDS.d.cts +2 -0
- package/lib/core/bridge/MANAGED_PROJECT_RECORDS.d.mts +2 -0
- package/lib/core/bridge/MANAGED_PROJECT_RECORDS.d.ts +2 -0
- package/lib/core/bridge/MANAGED_PROJECT_RECORDS.js +7 -0
- package/lib/core/bridge/MANAGED_PROJECT_RECORDS.js.map +1 -0
- package/lib/core/bridge/MANAGED_PROJECT_RECORDS.mjs +5 -0
- package/lib/core/bridge/MANAGED_PROJECT_RECORDS.mjs.map +1 -0
- package/lib/core/bridge/TtscProjectRecord.d.cts +9 -0
- package/lib/core/bridge/TtscProjectRecord.d.mts +9 -0
- package/lib/core/bridge/TtscProjectRecord.d.ts +9 -0
- package/lib/core/bridge/fallbackRecordStorage.d.cts +33 -0
- package/lib/core/bridge/fallbackRecordStorage.d.mts +33 -0
- package/lib/core/bridge/fallbackRecordStorage.d.ts +33 -0
- package/lib/core/bridge/fallbackRecordStorage.js +96 -0
- package/lib/core/bridge/fallbackRecordStorage.js.map +1 -0
- package/lib/core/bridge/fallbackRecordStorage.mjs +94 -0
- package/lib/core/bridge/fallbackRecordStorage.mjs.map +1 -0
- package/lib/core/bridge/fallbackToolDirectory.d.cts +11 -15
- package/lib/core/bridge/fallbackToolDirectory.d.mts +11 -15
- package/lib/core/bridge/fallbackToolDirectory.d.ts +11 -15
- package/lib/core/bridge/fallbackToolDirectory.js +19 -30
- package/lib/core/bridge/fallbackToolDirectory.js.map +1 -1
- package/lib/core/bridge/fallbackToolDirectory.mjs +19 -30
- package/lib/core/bridge/fallbackToolDirectory.mjs.map +1 -1
- package/lib/core/bridge/fallbackToolDirectoryLocation.d.cts +14 -0
- package/lib/core/bridge/fallbackToolDirectoryLocation.d.mts +14 -0
- package/lib/core/bridge/fallbackToolDirectoryLocation.d.ts +14 -0
- package/lib/core/bridge/fallbackToolDirectoryLocation.js +38 -0
- package/lib/core/bridge/fallbackToolDirectoryLocation.js.map +1 -0
- package/lib/core/bridge/fallbackToolDirectoryLocation.mjs +36 -0
- package/lib/core/bridge/fallbackToolDirectoryLocation.mjs.map +1 -0
- package/lib/core/bridge/hostToolDirectory.d.cts +13 -46
- package/lib/core/bridge/hostToolDirectory.d.mts +13 -46
- package/lib/core/bridge/hostToolDirectory.d.ts +13 -46
- package/lib/core/bridge/hostToolDirectory.js +14 -47
- package/lib/core/bridge/hostToolDirectory.js.map +1 -1
- package/lib/core/bridge/hostToolDirectory.mjs +14 -47
- package/lib/core/bridge/hostToolDirectory.mjs.map +1 -1
- package/lib/core/bridge/openHostWatchBridge.d.cts +11 -1
- package/lib/core/bridge/openHostWatchBridge.d.mts +11 -1
- package/lib/core/bridge/openHostWatchBridge.d.ts +11 -1
- package/lib/core/bridge/openHostWatchBridge.js +28 -6
- package/lib/core/bridge/openHostWatchBridge.js.map +1 -1
- package/lib/core/bridge/openHostWatchBridge.mjs +28 -6
- package/lib/core/bridge/openHostWatchBridge.mjs.map +1 -1
- package/lib/core/bridge/prepareProjectRecordDirectory.d.cts +41 -0
- package/lib/core/bridge/prepareProjectRecordDirectory.d.mts +41 -0
- package/lib/core/bridge/prepareProjectRecordDirectory.d.ts +41 -0
- package/lib/core/bridge/prepareProjectRecordDirectory.js +127 -0
- package/lib/core/bridge/prepareProjectRecordDirectory.js.map +1 -0
- package/lib/core/bridge/prepareProjectRecordDirectory.mjs +125 -0
- package/lib/core/bridge/prepareProjectRecordDirectory.mjs.map +1 -0
- package/lib/core/bridge/privateProjectRecordAvailable.d.cts +13 -0
- package/lib/core/bridge/privateProjectRecordAvailable.d.mts +13 -0
- package/lib/core/bridge/privateProjectRecordAvailable.d.ts +13 -0
- package/lib/core/bridge/privateProjectRecordAvailable.js +31 -0
- package/lib/core/bridge/privateProjectRecordAvailable.js.map +1 -0
- package/lib/core/bridge/privateProjectRecordAvailable.mjs +29 -0
- package/lib/core/bridge/privateProjectRecordAvailable.mjs.map +1 -0
- package/lib/core/bridge/projectRecordMoved.js +5 -0
- package/lib/core/bridge/projectRecordMoved.js.map +1 -1
- package/lib/core/bridge/projectRecordMoved.mjs +5 -0
- package/lib/core/bridge/projectRecordMoved.mjs.map +1 -1
- package/lib/core/bridge/projectRecordWatchInputs.js +6 -0
- package/lib/core/bridge/projectRecordWatchInputs.js.map +1 -1
- package/lib/core/bridge/projectRecordWatchInputs.mjs +6 -0
- package/lib/core/bridge/projectRecordWatchInputs.mjs.map +1 -1
- package/lib/core/bridge/readProjectRecordFile.js +23 -1
- package/lib/core/bridge/readProjectRecordFile.js.map +1 -1
- package/lib/core/bridge/readProjectRecordFile.mjs +23 -1
- package/lib/core/bridge/readProjectRecordFile.mjs.map +1 -1
- package/lib/core/bridge/refreshProjectRecordFile.d.cts +7 -2
- package/lib/core/bridge/refreshProjectRecordFile.d.mts +7 -2
- package/lib/core/bridge/refreshProjectRecordFile.d.ts +7 -2
- package/lib/core/bridge/refreshProjectRecordFile.js +24 -7
- package/lib/core/bridge/refreshProjectRecordFile.js.map +1 -1
- package/lib/core/bridge/refreshProjectRecordFile.mjs +24 -7
- package/lib/core/bridge/refreshProjectRecordFile.mjs.map +1 -1
- package/lib/core/bridge/refreshProjectRecordFiles.d.cts +7 -4
- package/lib/core/bridge/refreshProjectRecordFiles.d.mts +7 -4
- package/lib/core/bridge/refreshProjectRecordFiles.d.ts +7 -4
- package/lib/core/bridge/refreshProjectRecordFiles.js +30 -8
- package/lib/core/bridge/refreshProjectRecordFiles.js.map +1 -1
- package/lib/core/bridge/refreshProjectRecordFiles.mjs +30 -8
- package/lib/core/bridge/refreshProjectRecordFiles.mjs.map +1 -1
- package/lib/core/bridge/registerProjectRecord.js +3 -1
- package/lib/core/bridge/registerProjectRecord.js.map +1 -1
- package/lib/core/bridge/registerProjectRecord.mjs +3 -1
- package/lib/core/bridge/registerProjectRecord.mjs.map +1 -1
- package/lib/core/bridge/signalProjectRecordFile.d.cts +7 -2
- package/lib/core/bridge/signalProjectRecordFile.d.mts +7 -2
- package/lib/core/bridge/signalProjectRecordFile.d.ts +7 -2
- package/lib/core/bridge/signalProjectRecordFile.js +18 -5
- package/lib/core/bridge/signalProjectRecordFile.js.map +1 -1
- package/lib/core/bridge/signalProjectRecordFile.mjs +18 -5
- package/lib/core/bridge/signalProjectRecordFile.mjs.map +1 -1
- package/lib/core/bridge/writeProjectRecordFile.js +7 -3
- package/lib/core/bridge/writeProjectRecordFile.js.map +1 -1
- package/lib/core/bridge/writeProjectRecordFile.mjs +7 -3
- package/lib/core/bridge/writeProjectRecordFile.mjs.map +1 -1
- package/lib/core/esbuild/createEsbuildOptions.js +9 -7
- package/lib/core/esbuild/createEsbuildOptions.js.map +1 -1
- package/lib/core/esbuild/createEsbuildOptions.mjs +9 -7
- package/lib/core/esbuild/createEsbuildOptions.mjs.map +1 -1
- package/lib/core/farm/createFarmRecordUpdates.d.cts +63 -0
- package/lib/core/farm/createFarmRecordUpdates.d.mts +63 -0
- package/lib/core/farm/createFarmRecordUpdates.d.ts +63 -0
- package/lib/core/farm/createFarmRecordUpdates.js +129 -0
- package/lib/core/farm/createFarmRecordUpdates.js.map +1 -0
- package/lib/core/farm/createFarmRecordUpdates.mjs +127 -0
- package/lib/core/farm/createFarmRecordUpdates.mjs.map +1 -0
- package/lib/core/farm/farmPersistentCacheWithoutRecords.d.cts +15 -40
- package/lib/core/farm/farmPersistentCacheWithoutRecords.d.mts +15 -40
- package/lib/core/farm/farmPersistentCacheWithoutRecords.d.ts +15 -40
- package/lib/core/farm/farmPersistentCacheWithoutRecords.js +23 -56
- package/lib/core/farm/farmPersistentCacheWithoutRecords.js.map +1 -1
- package/lib/core/farm/farmPersistentCacheWithoutRecords.mjs +23 -56
- package/lib/core/farm/farmPersistentCacheWithoutRecords.mjs.map +1 -1
- package/lib/core/farm/farmRecordFallback.d.cts +15 -15
- package/lib/core/farm/farmRecordFallback.d.mts +15 -15
- package/lib/core/farm/farmRecordFallback.d.ts +15 -15
- package/lib/core/farm/farmRecordFallback.js +22 -20
- package/lib/core/farm/farmRecordFallback.js.map +1 -1
- package/lib/core/farm/farmRecordFallback.mjs +22 -20
- package/lib/core/farm/farmRecordFallback.mjs.map +1 -1
- package/lib/core/next/next.js +5 -4
- package/lib/core/next/next.js.map +1 -1
- package/lib/core/next/next.mjs +5 -4
- package/lib/core/next/next.mjs.map +1 -1
- package/lib/core/observer/InputCondition.d.cts +5 -0
- package/lib/core/observer/InputCondition.d.mts +5 -0
- package/lib/core/observer/InputCondition.d.ts +5 -0
- package/lib/core/observer/InputObserverChange.d.cts +2 -0
- package/lib/core/observer/InputObserverChange.d.mts +2 -0
- package/lib/core/observer/InputObserverChange.d.ts +2 -0
- package/lib/core/observer/createInputObserver.d.cts +3 -1
- package/lib/core/observer/createInputObserver.d.mts +3 -1
- package/lib/core/observer/createInputObserver.d.ts +3 -1
- package/lib/core/observer/createInputObserver.js +179 -26
- package/lib/core/observer/createInputObserver.js.map +1 -1
- package/lib/core/observer/createInputObserver.mjs +180 -27
- package/lib/core/observer/createInputObserver.mjs.map +1 -1
- package/lib/core/observer/ttscWriteDirectories.d.cts +31 -0
- package/lib/core/observer/ttscWriteDirectories.d.mts +31 -0
- package/lib/core/observer/ttscWriteDirectories.d.ts +31 -0
- package/lib/core/observer/ttscWriteDirectories.js +59 -0
- package/lib/core/observer/ttscWriteDirectories.js.map +1 -0
- package/lib/core/observer/ttscWriteDirectories.mjs +57 -0
- package/lib/core/observer/ttscWriteDirectories.mjs.map +1 -0
- package/lib/core/rollup/TtscRollupDelivery.d.cts +2 -0
- package/lib/core/rollup/TtscRollupDelivery.d.mts +2 -0
- package/lib/core/rollup/TtscRollupDelivery.d.ts +2 -0
- package/lib/core/rollup/createRollupCachedModuleProof.d.cts +15 -11
- package/lib/core/rollup/createRollupCachedModuleProof.d.mts +15 -11
- package/lib/core/rollup/createRollupCachedModuleProof.d.ts +15 -11
- package/lib/core/rollup/createRollupCachedModuleProof.js +62 -33
- package/lib/core/rollup/createRollupCachedModuleProof.js.map +1 -1
- package/lib/core/rollup/createRollupCachedModuleProof.mjs +62 -33
- package/lib/core/rollup/createRollupCachedModuleProof.mjs.map +1 -1
- package/lib/core/rollup/rollupDeliveryOptions.d.cts +6 -4
- package/lib/core/rollup/rollupDeliveryOptions.d.mts +6 -4
- package/lib/core/rollup/rollupDeliveryOptions.d.ts +6 -4
- package/lib/core/rollup/rollupDeliveryOptions.js +7 -4
- package/lib/core/rollup/rollupDeliveryOptions.js.map +1 -1
- package/lib/core/rollup/rollupDeliveryOptions.mjs +7 -4
- package/lib/core/rollup/rollupDeliveryOptions.mjs.map +1 -1
- package/lib/core/transform/cache/TtscCachedProjectTransform.d.cts +7 -0
- package/lib/core/transform/cache/TtscCachedProjectTransform.d.mts +7 -0
- package/lib/core/transform/cache/TtscCachedProjectTransform.d.ts +7 -0
- package/lib/core/transform/cache/selectCachedGenerationAction.d.cts +3 -1
- package/lib/core/transform/cache/selectCachedGenerationAction.d.mts +3 -1
- package/lib/core/transform/cache/selectCachedGenerationAction.d.ts +3 -1
- package/lib/core/transform/cache/selectCachedGenerationAction.js +7 -4
- package/lib/core/transform/cache/selectCachedGenerationAction.js.map +1 -1
- package/lib/core/transform/cache/selectCachedGenerationAction.mjs +7 -4
- package/lib/core/transform/cache/selectCachedGenerationAction.mjs.map +1 -1
- package/lib/core/transform/deliverCachedTransform.js +1 -0
- package/lib/core/transform/deliverCachedTransform.js.map +1 -1
- package/lib/core/transform/deliverCachedTransform.mjs +1 -0
- package/lib/core/transform/deliverCachedTransform.mjs.map +1 -1
- package/lib/core/transform/envelope/TtscEnvelopeDerivation.d.cts +6 -15
- package/lib/core/transform/envelope/TtscEnvelopeDerivation.d.mts +6 -15
- package/lib/core/transform/envelope/TtscEnvelopeDerivation.d.ts +6 -15
- package/lib/core/transform/envelope/collectDeclaredIdentities.d.cts +1 -1
- package/lib/core/transform/envelope/collectDeclaredIdentities.d.mts +1 -1
- package/lib/core/transform/envelope/collectDeclaredIdentities.d.ts +1 -1
- package/lib/core/transform/envelope/collectDeclaredIdentities.js.map +1 -1
- package/lib/core/transform/envelope/collectDeclaredIdentities.mjs.map +1 -1
- package/lib/core/transform/envelope/createEnvelopeKeyIndex.d.cts +1 -1
- package/lib/core/transform/envelope/createEnvelopeKeyIndex.d.mts +1 -1
- package/lib/core/transform/envelope/createEnvelopeKeyIndex.d.ts +1 -1
- package/lib/core/transform/envelope/createEnvelopeKeyIndex.js.map +1 -1
- package/lib/core/transform/envelope/createEnvelopeKeyIndex.mjs.map +1 -1
- package/lib/core/transform/envelope/declaresCompleteDependencies.d.cts +2 -2
- package/lib/core/transform/envelope/declaresCompleteDependencies.d.mts +2 -2
- package/lib/core/transform/envelope/declaresCompleteDependencies.d.ts +2 -2
- package/lib/core/transform/envelope/declaresCompleteDependencies.js +2 -1
- package/lib/core/transform/envelope/declaresCompleteDependencies.js.map +1 -1
- package/lib/core/transform/envelope/declaresCompleteDependencies.mjs +2 -1
- package/lib/core/transform/envelope/declaresCompleteDependencies.mjs.map +1 -1
- package/lib/core/transform/envelope/derivationIdentity.d.cts +1 -1
- package/lib/core/transform/envelope/derivationIdentity.d.mts +1 -1
- package/lib/core/transform/envelope/derivationIdentity.d.ts +1 -1
- package/lib/core/transform/envelope/derivationIdentity.js.map +1 -1
- package/lib/core/transform/envelope/derivationIdentity.mjs.map +1 -1
- package/lib/core/transform/envelope/deriveWatchInputs.js +4 -64
- package/lib/core/transform/envelope/deriveWatchInputs.js.map +1 -1
- package/lib/core/transform/envelope/deriveWatchInputs.mjs +4 -64
- package/lib/core/transform/envelope/deriveWatchInputs.mjs.map +1 -1
- package/lib/core/transform/envelope/deriveWatchInputsFromIndexes.d.cts +24 -0
- package/lib/core/transform/envelope/deriveWatchInputsFromIndexes.d.mts +24 -0
- package/lib/core/transform/envelope/deriveWatchInputsFromIndexes.d.ts +24 -0
- package/lib/core/transform/envelope/deriveWatchInputsFromIndexes.js +84 -0
- package/lib/core/transform/envelope/deriveWatchInputsFromIndexes.js.map +1 -0
- package/lib/core/transform/envelope/deriveWatchInputsFromIndexes.mjs +82 -0
- package/lib/core/transform/envelope/deriveWatchInputsFromIndexes.mjs.map +1 -0
- package/lib/core/transform/envelope/envelopeDerivation.js +1 -0
- package/lib/core/transform/envelope/envelopeDerivation.js.map +1 -1
- package/lib/core/transform/envelope/envelopeDerivation.mjs +1 -0
- package/lib/core/transform/envelope/envelopeDerivation.mjs.map +1 -1
- package/lib/core/transform/envelope/envelopeGraphIndexes.d.cts +2 -1
- package/lib/core/transform/envelope/envelopeGraphIndexes.d.mts +2 -1
- package/lib/core/transform/envelope/envelopeGraphIndexes.d.ts +2 -1
- package/lib/core/transform/envelope/envelopeGraphIndexes.js +2 -1
- package/lib/core/transform/envelope/envelopeGraphIndexes.js.map +1 -1
- package/lib/core/transform/envelope/envelopeGraphIndexes.mjs +2 -1
- package/lib/core/transform/envelope/envelopeGraphIndexes.mjs.map +1 -1
- package/lib/core/transform/envelope/isVolatileFile.d.cts +2 -2
- package/lib/core/transform/envelope/isVolatileFile.d.mts +2 -2
- package/lib/core/transform/envelope/isVolatileFile.d.ts +2 -2
- package/lib/core/transform/envelope/isVolatileFile.js +1 -1
- package/lib/core/transform/envelope/isVolatileFile.js.map +1 -1
- package/lib/core/transform/envelope/isVolatileFile.mjs +1 -1
- package/lib/core/transform/envelope/isVolatileFile.mjs.map +1 -1
- package/lib/core/transform/envelope/selectFileDependencies.d.cts +4 -5
- package/lib/core/transform/envelope/selectFileDependencies.d.mts +4 -5
- package/lib/core/transform/envelope/selectFileDependencies.d.ts +4 -5
- package/lib/core/transform/envelope/selectFileDependencies.js +3 -10
- package/lib/core/transform/envelope/selectFileDependencies.js.map +1 -1
- package/lib/core/transform/envelope/selectFileDependencies.mjs +3 -10
- package/lib/core/transform/envelope/selectFileDependencies.mjs.map +1 -1
- package/lib/core/transform/envelope/selectGraphInputs.d.cts +2 -5
- package/lib/core/transform/envelope/selectGraphInputs.d.mts +2 -5
- package/lib/core/transform/envelope/selectGraphInputs.d.ts +2 -5
- package/lib/core/transform/envelope/selectGraphInputs.js +5 -4
- package/lib/core/transform/envelope/selectGraphInputs.js.map +1 -1
- package/lib/core/transform/envelope/selectGraphInputs.mjs +5 -4
- package/lib/core/transform/envelope/selectGraphInputs.mjs.map +1 -1
- package/lib/core/transform/envelope/selectHostInputs.d.cts +1 -1
- package/lib/core/transform/envelope/selectHostInputs.d.mts +1 -1
- package/lib/core/transform/envelope/selectHostInputs.d.ts +1 -1
- package/lib/core/transform/envelope/selectHostInputs.js +4 -1
- package/lib/core/transform/envelope/selectHostInputs.js.map +1 -1
- package/lib/core/transform/envelope/selectHostInputs.mjs +4 -1
- package/lib/core/transform/envelope/selectHostInputs.mjs.map +1 -1
- package/lib/core/transform/envelope/selectNotifiableAbsentInputs.d.cts +8 -7
- package/lib/core/transform/envelope/selectNotifiableAbsentInputs.d.mts +8 -7
- package/lib/core/transform/envelope/selectNotifiableAbsentInputs.d.ts +8 -7
- package/lib/core/transform/envelope/selectNotifiableAbsentInputs.js +11 -8
- package/lib/core/transform/envelope/selectNotifiableAbsentInputs.js.map +1 -1
- package/lib/core/transform/envelope/selectNotifiableAbsentInputs.mjs +11 -8
- package/lib/core/transform/envelope/selectNotifiableAbsentInputs.mjs.map +1 -1
- package/lib/core/transform/envelope/selectReachableEdges.d.cts +1 -1
- package/lib/core/transform/envelope/selectReachableEdges.d.mts +1 -1
- package/lib/core/transform/envelope/selectReachableEdges.d.ts +1 -1
- package/lib/core/transform/envelope/selectReachableEdges.js.map +1 -1
- package/lib/core/transform/envelope/selectReachableEdges.mjs.map +1 -1
- package/lib/core/transform/envelope/selectReachableSources.d.cts +1 -1
- package/lib/core/transform/envelope/selectReachableSources.d.mts +1 -1
- package/lib/core/transform/envelope/selectReachableSources.d.ts +1 -1
- package/lib/core/transform/envelope/selectReachableSources.js.map +1 -1
- package/lib/core/transform/envelope/selectReachableSources.mjs.map +1 -1
- package/lib/core/transform/envelope/selectResolutionCandidateInputs.d.cts +1 -6
- package/lib/core/transform/envelope/selectResolutionCandidateInputs.d.mts +1 -6
- package/lib/core/transform/envelope/selectResolutionCandidateInputs.d.ts +1 -6
- package/lib/core/transform/envelope/selectResolutionCandidateInputs.js +3 -6
- package/lib/core/transform/envelope/selectResolutionCandidateInputs.js.map +1 -1
- package/lib/core/transform/envelope/selectResolutionCandidateInputs.mjs +3 -6
- package/lib/core/transform/envelope/selectResolutionCandidateInputs.mjs.map +1 -1
- package/lib/core/transform/filesystem/userStateDirectory.d.cts +22 -4
- package/lib/core/transform/filesystem/userStateDirectory.d.mts +22 -4
- package/lib/core/transform/filesystem/userStateDirectory.d.ts +22 -4
- package/lib/core/transform/filesystem/userStateDirectory.js +37 -12
- package/lib/core/transform/filesystem/userStateDirectory.js.map +1 -1
- package/lib/core/transform/filesystem/userStateDirectory.mjs +37 -12
- package/lib/core/transform/filesystem/userStateDirectory.mjs.map +1 -1
- package/lib/core/transform/generation/TtscFailedGenerationValidation.d.cts +3 -0
- package/lib/core/transform/generation/TtscFailedGenerationValidation.d.mts +3 -0
- package/lib/core/transform/generation/TtscFailedGenerationValidation.d.ts +3 -0
- package/lib/core/transform/generation/captureTransformGeneration.js +51 -13
- package/lib/core/transform/generation/captureTransformGeneration.js.map +1 -1
- package/lib/core/transform/generation/captureTransformGeneration.mjs +51 -13
- package/lib/core/transform/generation/captureTransformGeneration.mjs.map +1 -1
- package/lib/core/transform/generation/createUnstableGenerationError.d.cts +5 -3
- package/lib/core/transform/generation/createUnstableGenerationError.d.mts +5 -3
- package/lib/core/transform/generation/createUnstableGenerationError.d.ts +5 -3
- package/lib/core/transform/generation/createUnstableGenerationError.js +21 -4
- package/lib/core/transform/generation/createUnstableGenerationError.js.map +1 -1
- package/lib/core/transform/generation/createUnstableGenerationError.mjs +21 -4
- package/lib/core/transform/generation/createUnstableGenerationError.mjs.map +1 -1
- package/lib/core/transform/generation/failedGenerationEnvironmentChanged.d.cts +5 -1
- package/lib/core/transform/generation/failedGenerationEnvironmentChanged.d.mts +5 -1
- package/lib/core/transform/generation/failedGenerationEnvironmentChanged.d.ts +5 -1
- package/lib/core/transform/generation/failedGenerationEnvironmentChanged.js +13 -1
- package/lib/core/transform/generation/failedGenerationEnvironmentChanged.js.map +1 -1
- package/lib/core/transform/generation/failedGenerationEnvironmentChanged.mjs +14 -2
- package/lib/core/transform/generation/failedGenerationEnvironmentChanged.mjs.map +1 -1
- package/lib/core/transform/inputs/hostInputRealpath.d.cts +9 -8
- package/lib/core/transform/inputs/hostInputRealpath.d.mts +9 -8
- package/lib/core/transform/inputs/hostInputRealpath.d.ts +9 -8
- package/lib/core/transform/inputs/hostInputRealpath.js +12 -8
- package/lib/core/transform/inputs/hostInputRealpath.js.map +1 -1
- package/lib/core/transform/inputs/hostInputRealpath.mjs +12 -8
- package/lib/core/transform/inputs/hostInputRealpath.mjs.map +1 -1
- package/lib/core/transform/inputs/sameHostInputRealpath.d.cts +3 -2
- package/lib/core/transform/inputs/sameHostInputRealpath.d.mts +3 -2
- package/lib/core/transform/inputs/sameHostInputRealpath.d.ts +3 -2
- package/lib/core/transform/inputs/sameHostInputRealpath.js +5 -2
- package/lib/core/transform/inputs/sameHostInputRealpath.js.map +1 -1
- package/lib/core/transform/inputs/sameHostInputRealpath.mjs +5 -2
- package/lib/core/transform/inputs/sameHostInputRealpath.mjs.map +1 -1
- package/lib/core/transform/session/claimSharedCompile.js +2 -0
- package/lib/core/transform/session/claimSharedCompile.js.map +1 -1
- package/lib/core/transform/session/claimSharedCompile.mjs +2 -0
- package/lib/core/transform/session/claimSharedCompile.mjs.map +1 -1
- package/lib/core/transform/transformTtsc.d.cts +1 -1
- package/lib/core/transform/transformTtsc.d.mts +1 -1
- package/lib/core/transform/transformTtsc.d.ts +1 -1
- package/lib/core/transform/transformTtsc.js +26 -8
- package/lib/core/transform/transformTtsc.js.map +1 -1
- package/lib/core/transform/transformTtsc.mjs +26 -8
- package/lib/core/transform/transformTtsc.mjs.map +1 -1
- package/lib/core/transform/tsconfig/createTransformScratchDirectory.d.cts +11 -9
- package/lib/core/transform/tsconfig/createTransformScratchDirectory.d.mts +11 -9
- package/lib/core/transform/tsconfig/createTransformScratchDirectory.d.ts +11 -9
- package/lib/core/transform/tsconfig/createTransformScratchDirectory.js +31 -32
- package/lib/core/transform/tsconfig/createTransformScratchDirectory.js.map +1 -1
- package/lib/core/transform/tsconfig/createTransformScratchDirectory.mjs +31 -32
- package/lib/core/transform/tsconfig/createTransformScratchDirectory.mjs.map +1 -1
- package/lib/core/transform/validation/TtscGenerationProof.d.cts +19 -2
- package/lib/core/transform/validation/TtscGenerationProof.d.mts +19 -2
- package/lib/core/transform/validation/TtscGenerationProof.d.ts +19 -2
- package/lib/core/transform/validation/TtscGenerationProof.js +41 -2
- package/lib/core/transform/validation/TtscGenerationProof.js.map +1 -1
- package/lib/core/transform/validation/TtscGenerationProof.mjs +42 -3
- package/lib/core/transform/validation/TtscGenerationProof.mjs.map +1 -1
- package/lib/core/transform/validation/captureUniversalHostInputValidation.js +9 -0
- package/lib/core/transform/validation/captureUniversalHostInputValidation.js.map +1 -1
- package/lib/core/transform/validation/captureUniversalHostInputValidation.mjs +10 -1
- package/lib/core/transform/validation/captureUniversalHostInputValidation.mjs.map +1 -1
- package/lib/core/transform/validation/matchesCachedExternalInputs.d.cts +6 -2
- package/lib/core/transform/validation/matchesCachedExternalInputs.d.mts +6 -2
- package/lib/core/transform/validation/matchesCachedExternalInputs.d.ts +6 -2
- package/lib/core/transform/validation/matchesCachedExternalInputs.js +8 -2
- package/lib/core/transform/validation/matchesCachedExternalInputs.js.map +1 -1
- package/lib/core/transform/validation/matchesCachedExternalInputs.mjs +8 -2
- package/lib/core/transform/validation/matchesCachedExternalInputs.mjs.map +1 -1
- package/lib/core/transform/validation/matchesCompleteInputSnapshot.d.cts +8 -7
- package/lib/core/transform/validation/matchesCompleteInputSnapshot.d.mts +8 -7
- package/lib/core/transform/validation/matchesCompleteInputSnapshot.d.ts +8 -7
- package/lib/core/transform/validation/matchesCompleteInputSnapshot.js +19 -9
- package/lib/core/transform/validation/matchesCompleteInputSnapshot.js.map +1 -1
- package/lib/core/transform/validation/matchesCompleteInputSnapshot.mjs +19 -9
- package/lib/core/transform/validation/matchesCompleteInputSnapshot.mjs.map +1 -1
- package/lib/core/transform/validation/matchesExternalInputRealpaths.d.cts +7 -4
- package/lib/core/transform/validation/matchesExternalInputRealpaths.d.mts +7 -4
- package/lib/core/transform/validation/matchesExternalInputRealpaths.d.ts +7 -4
- package/lib/core/transform/validation/matchesExternalInputRealpaths.js +9 -4
- package/lib/core/transform/validation/matchesExternalInputRealpaths.js.map +1 -1
- package/lib/core/transform/validation/matchesExternalInputRealpaths.mjs +9 -4
- package/lib/core/transform/validation/matchesExternalInputRealpaths.mjs.map +1 -1
- package/lib/core/transform/validation/matchesNarrowPersistentInputs.d.cts +5 -2
- package/lib/core/transform/validation/matchesNarrowPersistentInputs.d.mts +5 -2
- package/lib/core/transform/validation/matchesNarrowPersistentInputs.d.ts +5 -2
- package/lib/core/transform/validation/matchesNarrowPersistentInputs.js +62 -2
- package/lib/core/transform/validation/matchesNarrowPersistentInputs.js.map +1 -1
- package/lib/core/transform/validation/matchesNarrowPersistentInputs.mjs +62 -2
- package/lib/core/transform/validation/matchesNarrowPersistentInputs.mjs.map +1 -1
- package/lib/core/transform/validation/nativeInputPredicatesHold.d.cts +7 -6
- package/lib/core/transform/validation/nativeInputPredicatesHold.d.mts +7 -6
- package/lib/core/transform/validation/nativeInputPredicatesHold.d.ts +7 -6
- package/lib/core/transform/validation/nativeInputPredicatesHold.js +16 -6
- package/lib/core/transform/validation/nativeInputPredicatesHold.js.map +1 -1
- package/lib/core/transform/validation/nativeInputPredicatesHold.mjs +16 -6
- package/lib/core/transform/validation/nativeInputPredicatesHold.mjs.map +1 -1
- package/lib/core/transform/watch/RECOVERY_TREE_DIGEST.d.cts +8 -0
- package/lib/core/transform/watch/RECOVERY_TREE_DIGEST.d.mts +8 -0
- package/lib/core/transform/watch/RECOVERY_TREE_DIGEST.d.ts +8 -0
- package/lib/core/transform/watch/RECOVERY_TREE_DIGEST.js +12 -0
- package/lib/core/transform/watch/RECOVERY_TREE_DIGEST.js.map +1 -0
- package/lib/core/transform/watch/RECOVERY_TREE_DIGEST.mjs +10 -0
- package/lib/core/transform/watch/RECOVERY_TREE_DIGEST.mjs.map +1 -0
- package/lib/core/transform/watch/TtscProjectRegistration.d.cts +3 -0
- package/lib/core/transform/watch/TtscProjectRegistration.d.mts +3 -0
- package/lib/core/transform/watch/TtscProjectRegistration.d.ts +3 -0
- package/lib/core/transform/watch/TtscProjectRegistration.js +3 -0
- package/lib/core/transform/watch/TtscProjectRegistration.js.map +1 -0
- package/lib/core/transform/watch/TtscProjectRegistration.mjs +2 -0
- package/lib/core/transform/watch/TtscProjectRegistration.mjs.map +1 -0
- package/lib/core/transform/watch/TtscTransformHooks.d.cts +33 -12
- package/lib/core/transform/watch/TtscTransformHooks.d.mts +33 -12
- package/lib/core/transform/watch/TtscTransformHooks.d.ts +33 -12
- package/lib/core/transform/watch/TtscTransformHooks.js +3 -0
- package/lib/core/transform/watch/TtscTransformHooks.js.map +1 -0
- package/lib/core/transform/watch/TtscTransformHooks.mjs +2 -0
- package/lib/core/transform/watch/TtscTransformHooks.mjs.map +1 -0
- package/lib/core/transform/watch/TtscWatchInputEvidence.d.cts +3 -0
- package/lib/core/transform/watch/TtscWatchInputEvidence.d.mts +3 -0
- package/lib/core/transform/watch/TtscWatchInputEvidence.d.ts +3 -0
- package/lib/core/transform/watch/TtscWorkspaceWatchEvidence.d.cts +14 -0
- package/lib/core/transform/watch/TtscWorkspaceWatchEvidence.d.mts +14 -0
- package/lib/core/transform/watch/TtscWorkspaceWatchEvidence.d.ts +14 -0
- package/lib/core/transform/watch/captureRecoveryTreeDigest.d.cts +26 -0
- package/lib/core/transform/watch/captureRecoveryTreeDigest.d.mts +26 -0
- package/lib/core/transform/watch/captureRecoveryTreeDigest.d.ts +26 -0
- package/lib/core/transform/watch/captureRecoveryTreeDigest.js +54 -0
- package/lib/core/transform/watch/captureRecoveryTreeDigest.js.map +1 -0
- package/lib/core/transform/watch/captureRecoveryTreeDigest.mjs +52 -0
- package/lib/core/transform/watch/captureRecoveryTreeDigest.mjs.map +1 -0
- package/lib/core/transform/watch/evidencedWatchInput.js +6 -0
- package/lib/core/transform/watch/evidencedWatchInput.js.map +1 -1
- package/lib/core/transform/watch/evidencedWatchInput.mjs +6 -0
- package/lib/core/transform/watch/evidencedWatchInput.mjs.map +1 -1
- package/lib/core/transform/watch/handWatchInputs.d.cts +4 -4
- package/lib/core/transform/watch/handWatchInputs.d.mts +4 -4
- package/lib/core/transform/watch/handWatchInputs.d.ts +4 -4
- package/lib/core/transform/watch/handWatchInputs.js +21 -5
- package/lib/core/transform/watch/handWatchInputs.js.map +1 -1
- package/lib/core/transform/watch/handWatchInputs.mjs +21 -5
- package/lib/core/transform/watch/handWatchInputs.mjs.map +1 -1
- package/lib/core/transform/watch/notifyFailedGenerationInputs.d.cts +8 -1
- package/lib/core/transform/watch/notifyFailedGenerationInputs.d.mts +8 -1
- package/lib/core/transform/watch/notifyFailedGenerationInputs.d.ts +8 -1
- package/lib/core/transform/watch/notifyFailedGenerationInputs.js +51 -9
- package/lib/core/transform/watch/notifyFailedGenerationInputs.js.map +1 -1
- package/lib/core/transform/watch/notifyFailedGenerationInputs.mjs +51 -9
- package/lib/core/transform/watch/notifyFailedGenerationInputs.mjs.map +1 -1
- package/lib/core/transform/watch/notifyProjectRecord.js +55 -20
- package/lib/core/transform/watch/notifyProjectRecord.js.map +1 -1
- package/lib/core/transform/watch/notifyProjectRecord.mjs +55 -20
- package/lib/core/transform/watch/notifyProjectRecord.mjs.map +1 -1
- package/lib/core/transform/watch/notifyRejectedGenerationInputs.js +20 -10
- package/lib/core/transform/watch/notifyRejectedGenerationInputs.js.map +1 -1
- package/lib/core/transform/watch/notifyRejectedGenerationInputs.mjs +20 -10
- package/lib/core/transform/watch/notifyRejectedGenerationInputs.mjs.map +1 -1
- package/lib/core/transform/watch/notifyVolatileDelivery.d.cts +4 -6
- package/lib/core/transform/watch/notifyVolatileDelivery.d.mts +4 -6
- package/lib/core/transform/watch/notifyVolatileDelivery.d.ts +4 -6
- package/lib/core/transform/watch/notifyVolatileDelivery.js +12 -11
- package/lib/core/transform/watch/notifyVolatileDelivery.js.map +1 -1
- package/lib/core/transform/watch/notifyVolatileDelivery.mjs +12 -11
- package/lib/core/transform/watch/notifyVolatileDelivery.mjs.map +1 -1
- package/lib/core/transform/watch/notifyWatchInputs.d.cts +6 -3
- package/lib/core/transform/watch/notifyWatchInputs.d.mts +6 -3
- package/lib/core/transform/watch/notifyWatchInputs.d.ts +6 -3
- package/lib/core/transform/watch/notifyWatchInputs.js +66 -14
- package/lib/core/transform/watch/notifyWatchInputs.js.map +1 -1
- package/lib/core/transform/watch/notifyWatchInputs.mjs +66 -14
- package/lib/core/transform/watch/notifyWatchInputs.mjs.map +1 -1
- package/lib/core/transform/watch/prepareProjectRecordDirectories.d.cts +4 -5
- package/lib/core/transform/watch/prepareProjectRecordDirectories.d.mts +4 -5
- package/lib/core/transform/watch/prepareProjectRecordDirectories.d.ts +4 -5
- package/lib/core/transform/watch/prepareProjectRecordDirectories.js +9 -16
- package/lib/core/transform/watch/prepareProjectRecordDirectories.js.map +1 -1
- package/lib/core/transform/watch/prepareProjectRecordDirectories.mjs +9 -16
- package/lib/core/transform/watch/prepareProjectRecordDirectories.mjs.map +1 -1
- package/lib/core/transform/watch/projectRecordDirectories.d.cts +18 -0
- package/lib/core/transform/watch/projectRecordDirectories.d.mts +18 -0
- package/lib/core/transform/watch/projectRecordDirectories.d.ts +18 -0
- package/lib/core/transform/watch/projectRecordDirectories.js +34 -0
- package/lib/core/transform/watch/projectRecordDirectories.js.map +1 -0
- package/lib/core/transform/watch/projectRecordDirectories.mjs +32 -0
- package/lib/core/transform/watch/projectRecordDirectories.mjs.map +1 -0
- package/lib/core/transform/watch/recordedDependencyWitnesses.js +7 -7
- package/lib/core/transform/watch/recordedDependencyWitnesses.js.map +1 -1
- package/lib/core/transform/watch/recordedDependencyWitnesses.mjs +7 -7
- package/lib/core/transform/watch/recordedDependencyWitnesses.mjs.map +1 -1
- package/lib/core/transform/watch/watchInputEvidenceMatchesBaseline.js +2 -1
- package/lib/core/transform/watch/watchInputEvidenceMatchesBaseline.js.map +1 -1
- package/lib/core/transform/watch/watchInputEvidenceMatchesBaseline.mjs +2 -1
- package/lib/core/transform/watch/watchInputEvidenceMatchesBaseline.mjs.map +1 -1
- package/lib/core/transform/watch/watchInputEvidenceMatchesDisk.js +7 -0
- package/lib/core/transform/watch/watchInputEvidenceMatchesDisk.js.map +1 -1
- package/lib/core/transform/watch/watchInputEvidenceMatchesDisk.mjs +7 -0
- package/lib/core/transform/watch/watchInputEvidenceMatchesDisk.mjs.map +1 -1
- package/lib/core/unplugin.js +43 -27
- package/lib/core/unplugin.js.map +1 -1
- package/lib/core/unplugin.mjs +43 -27
- package/lib/core/unplugin.mjs.map +1 -1
- package/lib/core/vite/ViteServeInputWatch.d.cts +17 -0
- package/lib/core/vite/ViteServeInputWatch.d.mts +17 -0
- package/lib/core/vite/ViteServeInputWatch.d.ts +17 -0
- package/lib/core/vite/createViteServeInputWatch.d.cts +5 -0
- package/lib/core/vite/createViteServeInputWatch.d.mts +5 -0
- package/lib/core/vite/createViteServeInputWatch.d.ts +5 -0
- package/lib/core/vite/createViteServeInputWatch.js +86 -10
- package/lib/core/vite/createViteServeInputWatch.js.map +1 -1
- package/lib/core/vite/createViteServeInputWatch.mjs +86 -10
- package/lib/core/vite/createViteServeInputWatch.mjs.map +1 -1
- package/lib/core/vite/createViteServeWatchHooks.d.cts +6 -5
- package/lib/core/vite/createViteServeWatchHooks.d.mts +6 -5
- package/lib/core/vite/createViteServeWatchHooks.d.ts +6 -5
- package/lib/core/vite/createViteServeWatchHooks.js +10 -4
- package/lib/core/vite/createViteServeWatchHooks.js.map +1 -1
- package/lib/core/vite/createViteServeWatchHooks.mjs +10 -4
- package/lib/core/vite/createViteServeWatchHooks.mjs.map +1 -1
- package/package.json +3 -3
- package/src/core/bridge/HostWatchBridge.ts +2 -0
- package/src/core/bridge/MANAGED_PROJECT_RECORDS.ts +2 -0
- package/src/core/bridge/TtscProjectRecord.ts +9 -0
- package/src/core/bridge/fallbackRecordStorage.ts +104 -0
- package/src/core/bridge/fallbackToolDirectory.ts +22 -38
- package/src/core/bridge/fallbackToolDirectoryLocation.ts +40 -0
- package/src/core/bridge/hostToolDirectory.ts +14 -47
- package/src/core/bridge/openHostWatchBridge.ts +48 -6
- package/src/core/bridge/prepareProjectRecordDirectory.ts +134 -0
- package/src/core/bridge/privateProjectRecordAvailable.ts +25 -0
- package/src/core/bridge/projectRecordMoved.ts +7 -0
- package/src/core/bridge/projectRecordWatchInputs.ts +6 -0
- package/src/core/bridge/readProjectRecordFile.ts +28 -1
- package/src/core/bridge/refreshProjectRecordFile.ts +40 -7
- package/src/core/bridge/refreshProjectRecordFiles.ts +44 -12
- package/src/core/bridge/registerProjectRecord.ts +2 -0
- package/src/core/bridge/signalProjectRecordFile.ts +25 -5
- package/src/core/bridge/writeProjectRecordFile.ts +10 -3
- package/src/core/esbuild/createEsbuildOptions.ts +9 -10
- package/src/core/farm/createFarmRecordUpdates.ts +167 -0
- package/src/core/farm/farmPersistentCacheWithoutRecords.ts +25 -55
- package/src/core/farm/farmRecordFallback.ts +25 -20
- package/src/core/next/next.ts +5 -3
- package/src/core/observer/InputCondition.ts +7 -0
- package/src/core/observer/InputObserverChange.ts +3 -0
- package/src/core/observer/createInputObserver.ts +186 -25
- package/src/core/observer/ttscWriteDirectories.ts +56 -0
- package/src/core/rollup/TtscRollupDelivery.ts +2 -0
- package/src/core/rollup/createRollupCachedModuleProof.ts +65 -33
- package/src/core/rollup/rollupDeliveryOptions.ts +7 -4
- package/src/core/transform/cache/TtscCachedProjectTransform.ts +6 -0
- package/src/core/transform/cache/selectCachedGenerationAction.ts +9 -4
- package/src/core/transform/deliverCachedTransform.ts +1 -0
- package/src/core/transform/envelope/TtscEnvelopeDerivation.ts +6 -17
- package/src/core/transform/envelope/collectDeclaredIdentities.ts +1 -1
- package/src/core/transform/envelope/createEnvelopeKeyIndex.ts +1 -1
- package/src/core/transform/envelope/declaresCompleteDependencies.ts +17 -7
- package/src/core/transform/envelope/derivationIdentity.ts +1 -1
- package/src/core/transform/envelope/deriveWatchInputs.ts +10 -64
- package/src/core/transform/envelope/deriveWatchInputsFromIndexes.ts +117 -0
- package/src/core/transform/envelope/envelopeDerivation.ts +1 -0
- package/src/core/transform/envelope/envelopeGraphIndexes.ts +2 -1
- package/src/core/transform/envelope/isVolatileFile.ts +12 -3
- package/src/core/transform/envelope/selectFileDependencies.ts +11 -14
- package/src/core/transform/envelope/selectGraphInputs.ts +13 -10
- package/src/core/transform/envelope/selectHostInputs.ts +11 -2
- package/src/core/transform/envelope/selectNotifiableAbsentInputs.ts +13 -8
- package/src/core/transform/envelope/selectReachableEdges.ts +2 -2
- package/src/core/transform/envelope/selectReachableSources.ts +2 -2
- package/src/core/transform/envelope/selectResolutionCandidateInputs.ts +9 -15
- package/src/core/transform/filesystem/userStateDirectory.ts +46 -15
- package/src/core/transform/generation/TtscFailedGenerationValidation.ts +5 -0
- package/src/core/transform/generation/captureTransformGeneration.ts +64 -22
- package/src/core/transform/generation/createUnstableGenerationError.ts +24 -4
- package/src/core/transform/generation/failedGenerationEnvironmentChanged.ts +18 -2
- package/src/core/transform/inputs/hostInputRealpath.ts +13 -8
- package/src/core/transform/inputs/sameHostInputRealpath.ts +4 -2
- package/src/core/transform/session/claimSharedCompile.ts +2 -0
- package/src/core/transform/transformTtsc.ts +28 -7
- package/src/core/transform/tsconfig/createTransformScratchDirectory.ts +36 -31
- package/src/core/transform/validation/TtscGenerationProof.ts +57 -2
- package/src/core/transform/validation/captureUniversalHostInputValidation.ts +12 -0
- package/src/core/transform/validation/matchesCachedExternalInputs.ts +6 -1
- package/src/core/transform/validation/matchesCompleteInputSnapshot.ts +23 -9
- package/src/core/transform/validation/matchesExternalInputRealpaths.ts +7 -3
- package/src/core/transform/validation/matchesNarrowPersistentInputs.ts +81 -2
- package/src/core/transform/validation/nativeInputPredicatesHold.ts +15 -6
- package/src/core/transform/watch/RECOVERY_TREE_DIGEST.ts +12 -0
- package/src/core/transform/watch/TtscProjectRegistration.ts +4 -0
- package/src/core/transform/watch/TtscTransformHooks.ts +40 -12
- package/src/core/transform/watch/TtscWatchInputEvidence.ts +3 -0
- package/src/core/transform/watch/TtscWorkspaceWatchEvidence.ts +17 -0
- package/src/core/transform/watch/captureRecoveryTreeDigest.ts +58 -0
- package/src/core/transform/watch/evidencedWatchInput.ts +7 -0
- package/src/core/transform/watch/handWatchInputs.ts +21 -5
- package/src/core/transform/watch/notifyFailedGenerationInputs.ts +66 -10
- package/src/core/transform/watch/notifyProjectRecord.ts +68 -25
- package/src/core/transform/watch/notifyRejectedGenerationInputs.ts +22 -9
- package/src/core/transform/watch/notifyVolatileDelivery.ts +7 -6
- package/src/core/transform/watch/notifyWatchInputs.ts +112 -14
- package/src/core/transform/watch/prepareProjectRecordDirectories.ts +14 -16
- package/src/core/transform/watch/projectRecordDirectories.ts +33 -0
- package/src/core/transform/watch/recordedDependencyWitnesses.ts +8 -9
- package/src/core/transform/watch/watchInputEvidenceMatchesBaseline.ts +2 -1
- package/src/core/transform/watch/watchInputEvidenceMatchesDisk.ts +7 -0
- package/src/core/unplugin.ts +72 -42
- package/src/core/vite/ViteServeInputWatch.ts +24 -0
- package/src/core/vite/createViteServeInputWatch.ts +98 -9
- package/src/core/vite/createViteServeWatchHooks.ts +15 -6
- package/lib/core/bridge/projectRecordDirectoryWritable.d.cts +0 -36
- package/lib/core/bridge/projectRecordDirectoryWritable.d.mts +0 -36
- package/lib/core/bridge/projectRecordDirectoryWritable.d.ts +0 -36
- package/lib/core/bridge/projectRecordDirectoryWritable.js +0 -65
- package/lib/core/bridge/projectRecordDirectoryWritable.js.map +0 -1
- package/lib/core/bridge/projectRecordDirectoryWritable.mjs +0 -63
- package/lib/core/bridge/projectRecordDirectoryWritable.mjs.map +0 -1
- package/src/core/bridge/projectRecordDirectoryWritable.ts +0 -61
|
@@ -3,6 +3,7 @@ import fs from "node:fs";
|
|
|
3
3
|
import { DEFAULT_FILESYSTEM_OPERATIONS } from "../transform/filesystem/DEFAULT_FILESYSTEM_OPERATIONS";
|
|
4
4
|
import type { TtscTransformFilesystemOperations } from "../transform/filesystem/TtscTransformFilesystemOperations";
|
|
5
5
|
import type { HostWatchBridge } from "./HostWatchBridge";
|
|
6
|
+
import { privateProjectRecordAvailable } from "./privateProjectRecordAvailable";
|
|
6
7
|
import { projectRecordArgumentsMatch } from "./projectRecordArgumentsMatch";
|
|
7
8
|
import { projectRecordMoved } from "./projectRecordMoved";
|
|
8
9
|
import { projectRecordWatchInputs } from "./projectRecordWatchInputs";
|
|
@@ -27,6 +28,9 @@ import { signalProjectRecordFile } from "./signalProjectRecordFile";
|
|
|
27
28
|
* record that cannot be read proves nothing and is moved too. A record whose
|
|
28
29
|
* tsconfig is gone is removed instead, the one move no delivery has to end.
|
|
29
30
|
*
|
|
31
|
+
* A persisted workspace replay requirement moves the record before either
|
|
32
|
+
* restoration path can use it. Opaque hosts require that move to succeed.
|
|
33
|
+
*
|
|
30
34
|
* A watching session's bridge takes the record instead
|
|
31
35
|
* (`projectRecordWatchInputs`): the bridge proves the recorded inputs as it
|
|
32
36
|
* takes them, moves a record it finds stale and again until a delivery answers,
|
|
@@ -41,6 +45,8 @@ import { signalProjectRecordFile } from "./signalProjectRecordFile";
|
|
|
41
45
|
*
|
|
42
46
|
* @param file The project record (`projectRecordFile`).
|
|
43
47
|
* @param bridge The watching session's bridge, when the host has one.
|
|
48
|
+
* @returns False when this record needs a new workspace delivery.
|
|
49
|
+
* @throws When startup requires invalidation and the record cannot be moved.
|
|
44
50
|
* @evidence contracts/common.md#principled-implementation
|
|
45
51
|
* An unreadable record proves nothing and is signaled; a vanished project is
|
|
46
52
|
* removed. Watching restoration transfers evidence to the bridge, while a
|
|
@@ -54,7 +60,7 @@ import { signalProjectRecordFile } from "./signalProjectRecordFile";
|
|
|
54
60
|
* @evidence contracts/common.md#meaningful-documentation
|
|
55
61
|
* Native paragraphs explain cached-session restoration and proof failure effects,
|
|
56
62
|
* with lifecycle comments and tag separation per documentation guidance.
|
|
57
|
-
* @evidence contracts/portability.md#os-neutral-implementation Record persistence remains on the host's native filesystem, while project existence and proof use the supplied observation view
|
|
63
|
+
* @evidence contracts/portability.md#os-neutral-implementation Record persistence remains on the host's native filesystem, while project existence and proof use the supplied observation view. Required native effects report failure to the restoring host.
|
|
58
64
|
* @evidence contracts/performance.md#bound-retention-and-release-resources It keeps no handle. A record whose tsconfig is gone is removed, which ends a record no generation will write again, and a removal another process blocks is retried by the next proof.
|
|
59
65
|
* @evidence contracts/performance.md#efficient-algorithms
|
|
60
66
|
* Record reading parses and validates byte/list populations. Detached replay
|
|
@@ -72,7 +78,17 @@ export function refreshProjectRecordFile(
|
|
|
72
78
|
bridge?: HostWatchBridge,
|
|
73
79
|
filesystem: TtscTransformFilesystemOperations = DEFAULT_FILESYSTEM_OPERATIONS,
|
|
74
80
|
compilerArgumentsIdentity?: string,
|
|
75
|
-
|
|
81
|
+
privateStorage = false,
|
|
82
|
+
required = false,
|
|
83
|
+
opaqueRestore = false,
|
|
84
|
+
): false | void {
|
|
85
|
+
if (privateStorage && !privateProjectRecordAvailable(file)) {
|
|
86
|
+
if (required)
|
|
87
|
+
throw new Error(
|
|
88
|
+
`@ttsc/unplugin: unavailable private project record prevents cache restoration: ${file}`,
|
|
89
|
+
);
|
|
90
|
+
return;
|
|
91
|
+
}
|
|
76
92
|
const record = readProjectRecordFile(file);
|
|
77
93
|
// A record that cannot be read proves nothing, and is moved as a proof that
|
|
78
94
|
// found a change is. A host may hold exactly these bytes: a signal that could
|
|
@@ -84,7 +100,7 @@ export function refreshProjectRecordFile(
|
|
|
84
100
|
// writer caught mid-write loses its bytes to the move, which its own host
|
|
85
101
|
// hears and runs on, and a record another process removed stays removed.
|
|
86
102
|
if (record === undefined) {
|
|
87
|
-
signalProjectRecordFile(file);
|
|
103
|
+
signalProjectRecordFile(file, privateStorage, required);
|
|
88
104
|
return;
|
|
89
105
|
}
|
|
90
106
|
// Nothing will write this project again: the record's own rule, that it
|
|
@@ -95,17 +111,33 @@ export function refreshProjectRecordFile(
|
|
|
95
111
|
if (!filesystem.exists(record.tsconfig)) {
|
|
96
112
|
try {
|
|
97
113
|
fs.rmSync(file, { force: true });
|
|
98
|
-
} catch {
|
|
114
|
+
} catch (cause) {
|
|
115
|
+
if (required)
|
|
116
|
+
throw new Error(
|
|
117
|
+
`@ttsc/unplugin: cannot remove project record before cache restoration: ${file}`,
|
|
118
|
+
{ cause },
|
|
119
|
+
);
|
|
99
120
|
// Held by another process; the next proof removes it.
|
|
100
121
|
}
|
|
101
122
|
return;
|
|
102
123
|
}
|
|
124
|
+
if (record.workspaceReplayRequired === true) {
|
|
125
|
+
signalProjectRecordFile(file, privateStorage, required || opaqueRestore);
|
|
126
|
+
return false;
|
|
127
|
+
}
|
|
103
128
|
if (bridge !== undefined) {
|
|
104
129
|
if (!projectRecordArgumentsMatch(record, compilerArgumentsIdentity)) {
|
|
105
|
-
signalProjectRecordFile(file);
|
|
130
|
+
signalProjectRecordFile(file, privateStorage, required);
|
|
106
131
|
return;
|
|
107
132
|
}
|
|
108
|
-
bridge.register(
|
|
133
|
+
bridge.register(
|
|
134
|
+
file,
|
|
135
|
+
projectRecordWatchInputs(record),
|
|
136
|
+
undefined,
|
|
137
|
+
undefined,
|
|
138
|
+
privateStorage || record.privateStorage === true,
|
|
139
|
+
required,
|
|
140
|
+
);
|
|
109
141
|
return;
|
|
110
142
|
}
|
|
111
143
|
// A proof that cannot run proves nothing, and the record is moved as if it
|
|
@@ -117,5 +149,6 @@ export function refreshProjectRecordFile(
|
|
|
117
149
|
} catch {
|
|
118
150
|
moved = record.root;
|
|
119
151
|
}
|
|
120
|
-
if (moved !== undefined)
|
|
152
|
+
if (moved !== undefined)
|
|
153
|
+
signalProjectRecordFile(file, privateStorage, required);
|
|
121
154
|
}
|
|
@@ -5,6 +5,8 @@ import { DEFAULT_FILESYSTEM_OPERATIONS } from "../transform/filesystem/DEFAULT_F
|
|
|
5
5
|
import type { TtscTransformFilesystemOperations } from "../transform/filesystem/TtscTransformFilesystemOperations";
|
|
6
6
|
import type { HostWatchBridge } from "./HostWatchBridge";
|
|
7
7
|
import { PROJECT_RECORD_DIRECTORY } from "./PROJECT_RECORD_DIRECTORY";
|
|
8
|
+
import { fallbackRecordStorage } from "./fallbackRecordStorage";
|
|
9
|
+
import { privateProjectRecordAvailable } from "./privateProjectRecordAvailable";
|
|
8
10
|
import { refreshProjectRecordFile } from "./refreshProjectRecordFile";
|
|
9
11
|
|
|
10
12
|
/**
|
|
@@ -23,11 +25,14 @@ import { refreshProjectRecordFile } from "./refreshProjectRecordFile";
|
|
|
23
25
|
* none.
|
|
24
26
|
*
|
|
25
27
|
* Each call enumerates the directory and refreshes each `.json` name once; host
|
|
26
|
-
* owners invoke it at their restore/start boundaries.
|
|
27
|
-
*
|
|
28
|
+
* owners invoke it at their restore/start boundaries. A managed inventory
|
|
29
|
+
* qualifies its ancestry before listing. A missing directory or a readable
|
|
30
|
+
* empty directory has no records to replay. If a stale managed record needs
|
|
31
|
+
* invalidation, startup requires the signal or removal to complete.
|
|
28
32
|
*
|
|
29
33
|
* @param toolDirectory The host's tool directory (`hostToolDirectory`).
|
|
30
34
|
* @param bridge The watching session's bridge, when the host has one.
|
|
35
|
+
* @throws When managed records cannot be enumerated or safely refreshed.
|
|
31
36
|
* @evidence contracts/common.md#principled-implementation
|
|
32
37
|
* Every persisted project record is refreshed because an opaque host cache can
|
|
33
38
|
* restore projects other than the current option's project. Absent directories
|
|
@@ -41,7 +46,7 @@ import { refreshProjectRecordFile } from "./refreshProjectRecordFile";
|
|
|
41
46
|
* @evidence contracts/common.md#meaningful-documentation
|
|
42
47
|
* Native paragraphs explain complete inventory and per-build proof cost,
|
|
43
48
|
* with parameter/tag separation following documentation guidance.
|
|
44
|
-
* @evidence contracts/portability.md#os-neutral-implementation Native
|
|
49
|
+
* @evidence contracts/portability.md#os-neutral-implementation Native ancestry proof checks managed paths before listing. Managed access or update failures prevent opaque restoration; ordinary host paths keep their existing refresh policy.
|
|
45
50
|
* @evidence contracts/performance.md#efficient-algorithms
|
|
46
51
|
* Native listing allocates N directory names; suffix tests scan their text
|
|
47
52
|
* and selected .json names pay path joins and delegated record parse/replay,
|
|
@@ -59,21 +64,48 @@ export function refreshProjectRecordFiles(
|
|
|
59
64
|
bridge?: HostWatchBridge,
|
|
60
65
|
filesystem: TtscTransformFilesystemOperations = DEFAULT_FILESYSTEM_OPERATIONS,
|
|
61
66
|
compilerArgumentsIdentity?: string,
|
|
67
|
+
privateStorage = false,
|
|
62
68
|
): void {
|
|
63
69
|
const directory = path.join(toolDirectory, PROJECT_RECORD_DIRECTORY);
|
|
70
|
+
const unsafe = () =>
|
|
71
|
+
new Error(
|
|
72
|
+
`@ttsc/unplugin: unsafe private project records prevent cache restoration: ${directory}`,
|
|
73
|
+
);
|
|
74
|
+
if (privateStorage) {
|
|
75
|
+
const inventory = fallbackRecordStorage.inventory(directory);
|
|
76
|
+
if (inventory === "missing") return;
|
|
77
|
+
if (inventory === "blocked") throw unsafe();
|
|
78
|
+
}
|
|
64
79
|
let names: string[];
|
|
65
80
|
try {
|
|
66
81
|
names = fs.readdirSync(directory);
|
|
67
|
-
} catch {
|
|
82
|
+
} catch (error) {
|
|
83
|
+
if (privateStorage)
|
|
84
|
+
throw new Error(
|
|
85
|
+
`@ttsc/unplugin: cannot inspect private project records before cache restoration: ${directory}`,
|
|
86
|
+
{ cause: error },
|
|
87
|
+
);
|
|
68
88
|
return;
|
|
69
89
|
}
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
)
|
|
90
|
+
const records = names
|
|
91
|
+
.filter((name) => name.endsWith(".json"))
|
|
92
|
+
.map((name) => path.join(directory, name));
|
|
93
|
+
if (
|
|
94
|
+
privateStorage &&
|
|
95
|
+
records.length !== 0 &&
|
|
96
|
+
(fallbackRecordStorage(directory, false) !== true ||
|
|
97
|
+
records.some((file) => !privateProjectRecordAvailable(file)))
|
|
98
|
+
)
|
|
99
|
+
throw unsafe();
|
|
100
|
+
for (const file of records) {
|
|
101
|
+
refreshProjectRecordFile(
|
|
102
|
+
file,
|
|
103
|
+
bridge,
|
|
104
|
+
filesystem,
|
|
105
|
+
compilerArgumentsIdentity,
|
|
106
|
+
privateStorage,
|
|
107
|
+
privateStorage,
|
|
108
|
+
true,
|
|
109
|
+
);
|
|
78
110
|
}
|
|
79
111
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { TtscProjectRegistration } from "../transform/watch/TtscProjectRegistration";
|
|
2
2
|
import type { HostWatchBridge } from "./HostWatchBridge";
|
|
3
|
+
import { MANAGED_PROJECT_RECORDS } from "./MANAGED_PROJECT_RECORDS";
|
|
3
4
|
|
|
4
5
|
/**
|
|
5
6
|
* Hand one delivery's project record to a build host, and its inputs to the
|
|
@@ -59,6 +60,7 @@ export function registerProjectRecord(props: {
|
|
|
59
60
|
inputs(),
|
|
60
61
|
failed,
|
|
61
62
|
props.bridge.startedAt,
|
|
63
|
+
props.registration[MANAGED_PROJECT_RECORDS],
|
|
62
64
|
);
|
|
63
65
|
props.addWatchFile(record);
|
|
64
66
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import fs from "node:fs";
|
|
2
2
|
|
|
3
|
+
import { privateProjectRecordAvailable } from "./privateProjectRecordAvailable";
|
|
3
4
|
import { readProjectRecordFile } from "./readProjectRecordFile";
|
|
4
5
|
import { writeProjectRecordFile } from "./writeProjectRecordFile";
|
|
5
6
|
|
|
@@ -24,8 +25,13 @@ let bare = 0;
|
|
|
24
25
|
*
|
|
25
26
|
* A bare signal only ever replaces a file that is there. A record is gone when
|
|
26
27
|
* its project is (`refreshProjectRecordFiles`), and writing one here would
|
|
27
|
-
* bring a project's file back for a project that has none.
|
|
28
|
+
* bring a project's file back for a project that has none. Startup can require
|
|
29
|
+
* an invalidation before the host restores cached output. A watching bridge's
|
|
30
|
+
* later signals remain retryable.
|
|
28
31
|
*
|
|
32
|
+
* @returns Whether the file moved, which a host that does not watch the record
|
|
33
|
+
* is then told (`openHostWatchBridge`).
|
|
34
|
+
* @throws When startup requires a signal and the native update fails.
|
|
29
35
|
* @evidence contracts/common.md#principled-implementation A readable record preserves its project proof while choosing a distinct finite signal even beyond safe-integer precision; an unreadable existing file receives a bare marker without creating a deleted project's file.
|
|
30
36
|
* @evidence contracts/common.md#clear-and-simple-design The operation uses the shared record writer for readable records and a bounded in-place write for an existing undecodable file.
|
|
31
37
|
* @evidence contracts/common.md#prohibited-implementation-shortcuts A failed write cannot claim invalidation success, and process-local sequencing is not presented as an atomic cross-process counter.
|
|
@@ -35,9 +41,15 @@ let bare = 0;
|
|
|
35
41
|
* @evidenceExclude contracts/performance.md#reuse-equivalent-work Each call requests a new invalidation effect, so equal return values would not permit suppressing the write as shared work.
|
|
36
42
|
* @evidence contracts/performance.md#bound-retention-and-release-resources The bare descriptor has a finally close attempt after write or truncate failure; the process marker occupies one scalar. Decoded records and serialized bytes are call-owned, and persisted record removal belongs to project refresh.
|
|
37
43
|
*/
|
|
38
|
-
export function signalProjectRecordFile(
|
|
39
|
-
|
|
44
|
+
export function signalProjectRecordFile(
|
|
45
|
+
file: string,
|
|
46
|
+
privateStorage = false,
|
|
47
|
+
required = false,
|
|
48
|
+
): boolean {
|
|
40
49
|
try {
|
|
50
|
+
if (privateStorage && !privateProjectRecordAvailable(file))
|
|
51
|
+
throw new Error(`unavailable private project record: ${file}`);
|
|
52
|
+
const record = readProjectRecordFile(file);
|
|
41
53
|
if (record === undefined) {
|
|
42
54
|
bare = bare < Number.MAX_SAFE_INTEGER ? bare + 1 : 0;
|
|
43
55
|
const text = `${process.pid}:${bare}`;
|
|
@@ -50,15 +62,23 @@ export function signalProjectRecordFile(file: string): void {
|
|
|
50
62
|
} finally {
|
|
51
63
|
fs.closeSync(handle);
|
|
52
64
|
}
|
|
53
|
-
return;
|
|
65
|
+
return true;
|
|
54
66
|
}
|
|
55
67
|
const next = record.signal + 1;
|
|
56
68
|
writeProjectRecordFile(file, {
|
|
57
69
|
...record,
|
|
70
|
+
...(privateStorage ? { privateStorage: true as const } : {}),
|
|
58
71
|
signal: Number.isFinite(next) && next !== record.signal ? next : 0,
|
|
59
72
|
});
|
|
60
|
-
|
|
73
|
+
return true;
|
|
74
|
+
} catch (cause) {
|
|
75
|
+
if (required)
|
|
76
|
+
throw new Error(
|
|
77
|
+
`@ttsc/unplugin: cannot invalidate project record before cache restoration: ${file}`,
|
|
78
|
+
{ cause },
|
|
79
|
+
);
|
|
61
80
|
// A record that cannot be written signals nothing. The host's next pass
|
|
62
81
|
// still re-proves the generation against the filesystem.
|
|
82
|
+
return false;
|
|
63
83
|
}
|
|
64
84
|
}
|
|
@@ -2,6 +2,7 @@ import fs from "node:fs";
|
|
|
2
2
|
import path from "node:path";
|
|
3
3
|
|
|
4
4
|
import type { TtscProjectRecord } from "./TtscProjectRecord";
|
|
5
|
+
import { prepareProjectRecordDirectory } from "./prepareProjectRecordDirectory";
|
|
5
6
|
import { projectRecordDigest } from "./projectRecordDigest";
|
|
6
7
|
|
|
7
8
|
/**
|
|
@@ -48,6 +49,13 @@ export function writeProjectRecordFile(
|
|
|
48
49
|
file: string,
|
|
49
50
|
record: TtscProjectRecord,
|
|
50
51
|
): string {
|
|
52
|
+
const directory = prepareProjectRecordDirectory(
|
|
53
|
+
path.dirname(file),
|
|
54
|
+
record.privateStorage === true,
|
|
55
|
+
);
|
|
56
|
+
const target = path.join(directory, path.basename(file));
|
|
57
|
+
if (fs.lstatSync(target, { throwIfNoEntry: false })?.isSymbolicLink())
|
|
58
|
+
throw new Error(`@ttsc/unplugin: unsafe project record file: ${target}`);
|
|
51
59
|
const text = JSON.stringify(record, (_key, value: unknown) =>
|
|
52
60
|
value !== null && typeof value === "object" && !Array.isArray(value)
|
|
53
61
|
? Object.fromEntries(
|
|
@@ -59,11 +67,10 @@ export function writeProjectRecordFile(
|
|
|
59
67
|
);
|
|
60
68
|
const digest = projectRecordDigest(text);
|
|
61
69
|
try {
|
|
62
|
-
if (fs.readFileSync(
|
|
70
|
+
if (fs.readFileSync(target, "utf8") === text) return digest;
|
|
63
71
|
} catch {
|
|
64
72
|
// Absent or unreadable: written below.
|
|
65
73
|
}
|
|
66
|
-
fs.mkdirSync(path.dirname(file), { recursive: true });
|
|
67
74
|
// In place, into the file the host is watching, never beside it and over
|
|
68
75
|
// it. A host watches the record by its path, and replacing the path's file
|
|
69
76
|
// detaches a watcher that holds the one behind it: Rollup's, whose own
|
|
@@ -82,6 +89,6 @@ export function writeProjectRecordFile(
|
|
|
82
89
|
// as a record whose state moved (`refreshProjectRecordFiles`), which is the
|
|
83
90
|
// answer a proof that cannot run already gives. Continued concurrent writes
|
|
84
91
|
// or failed deliveries can repeat invalidation; no one-rebuild bound exists.
|
|
85
|
-
fs.writeFileSync(
|
|
92
|
+
fs.writeFileSync(target, text);
|
|
86
93
|
return digest;
|
|
87
94
|
}
|
|
@@ -3,7 +3,8 @@ import path from "node:path";
|
|
|
3
3
|
import type { UnpluginOptions } from "unplugin";
|
|
4
4
|
|
|
5
5
|
import type { HostWatchBridge } from "../bridge/HostWatchBridge";
|
|
6
|
-
import {
|
|
6
|
+
import { MANAGED_PROJECT_RECORDS } from "../bridge/MANAGED_PROJECT_RECORDS";
|
|
7
|
+
import { fallbackToolDirectoryLocation } from "../bridge/fallbackToolDirectoryLocation";
|
|
7
8
|
import { hostToolDirectory } from "../bridge/hostToolDirectory";
|
|
8
9
|
import { openHostWatchBridge } from "../bridge/openHostWatchBridge";
|
|
9
10
|
import { registerProjectRecord } from "../bridge/registerProjectRecord";
|
|
@@ -128,6 +129,7 @@ export function createEsbuildOptions(
|
|
|
128
129
|
let errors;
|
|
129
130
|
try {
|
|
130
131
|
const source = await fs.promises.readFile(file, "utf8");
|
|
132
|
+
const fallback = fallbackToolDirectoryLocation(root);
|
|
131
133
|
const result = await transformTtsc(
|
|
132
134
|
file,
|
|
133
135
|
source,
|
|
@@ -142,7 +144,12 @@ export function createEsbuildOptions(
|
|
|
142
144
|
toolDirectory: hostToolDirectory(root),
|
|
143
145
|
// esbuild takes a record anywhere, and cannot say whether
|
|
144
146
|
// it watches (samchon/ttsc#1480).
|
|
145
|
-
...
|
|
147
|
+
...(fallback === undefined
|
|
148
|
+
? {}
|
|
149
|
+
: {
|
|
150
|
+
[MANAGED_PROJECT_RECORDS]: "fallbackToolDirectory",
|
|
151
|
+
fallbackToolDirectory: fallback,
|
|
152
|
+
}),
|
|
146
153
|
},
|
|
147
154
|
},
|
|
148
155
|
);
|
|
@@ -176,11 +183,3 @@ export function createEsbuildOptions(
|
|
|
176
183
|
},
|
|
177
184
|
};
|
|
178
185
|
}
|
|
179
|
-
|
|
180
|
-
/** The fallback record directory of a root, spread into a project hook. */
|
|
181
|
-
function fallbackRecordDirectory(root: string): {
|
|
182
|
-
fallbackToolDirectory?: string;
|
|
183
|
-
} {
|
|
184
|
-
const fallback = fallbackToolDirectory(root);
|
|
185
|
-
return fallback === undefined ? {} : { fallbackToolDirectory: fallback };
|
|
186
|
-
}
|
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Ask Farm to update the modules that depend on a project record each time the
|
|
3
|
+
* watch bridge moves it (samchon/ttsc#1942).
|
|
4
|
+
*
|
|
5
|
+
* The record lives where every host keeps it, below the root's
|
|
6
|
+
* `node_modules/.cache/ttsc/unplugin`, and Farm holds it as a watch file of
|
|
7
|
+
* each module that named it. Farm's own watcher cannot report its moves: it
|
|
8
|
+
* ignores every path below `node_modules`, and `farm watch` on Farm 2 observes
|
|
9
|
+
* no watch file outside its root either (measured on Farm 1.7.11 and 2.0.1).
|
|
10
|
+
* Farm's public update relates the record to its dependents all the same, so
|
|
11
|
+
* the adapter makes the request Farm's watcher would have made for a changed
|
|
12
|
+
* path:
|
|
13
|
+
*
|
|
14
|
+
* - A dev server (`configureServer` on Farm 2, `configureDevServer` on Farm 1)
|
|
15
|
+
* updates through its HMR engine, which also sends the result to the page;
|
|
16
|
+
* one without HMR updates nothing on a change, and neither does this.
|
|
17
|
+
* - `farm watch` updates through the compiler and writes the resources, as its
|
|
18
|
+
* loop does for a path the compiler holds a module for.
|
|
19
|
+
*
|
|
20
|
+
* Farm 2 names an update by `{ path, type }` and Farm 1 by the path. Farm 2's
|
|
21
|
+
* compiler is told apart by `waitForCompileFinish`, the public readiness method
|
|
22
|
+
* that came with the item-shaped update. A failed update is reported through
|
|
23
|
+
* Farm's logger when the compiler exposes one, as Farm's own loop reports it.
|
|
24
|
+
*
|
|
25
|
+
* Farm 1 hands its dev server only to `configureDevServer`, a key Farm 2's
|
|
26
|
+
* strict plugin schema refuses, so the plugin cannot carry it from the start.
|
|
27
|
+
* Farm 1 validates no keys, calls `configureCompiler` on the plugin object
|
|
28
|
+
* before its server exists, and later calls `configureDevServer` on that same
|
|
29
|
+
* object once its server and watcher are ready. The compiler hook therefore
|
|
30
|
+
* adds the server hook to its plugin when a Farm 1 compiler arrives, and Farm
|
|
31
|
+
* 2, which validated the plugin before handing over its compiler, never sees
|
|
32
|
+
* it.
|
|
33
|
+
*
|
|
34
|
+
* A move can be announced from inside one of Farm's own hooks, a transform that
|
|
35
|
+
* read a state already gone among them, and Farm's native compile can hold its
|
|
36
|
+
* module graph while it waits for that hook; a graph query made from it would
|
|
37
|
+
* wait on the compile in turn. A request therefore leaves the hook first and
|
|
38
|
+
* waits until the compiler is idle (`compiling`, with Farm 2's
|
|
39
|
+
* `waitForCompileFinish`). Moves of one record while it waits are one request,
|
|
40
|
+
* which reads the record as the last move left it.
|
|
41
|
+
*
|
|
42
|
+
* @evidence contracts/common.md#principled-implementation Each request is the one Farm's own watcher makes for a changed path, through the API that mode uses, so Farm's HMR, queueing and resource writing apply unchanged; it is made only once no hook of the compile is on the stack and the compiler is idle.
|
|
43
|
+
* @evidence contracts/common.md#clear-and-simple-design One owner holds the current compiler and server and turns a record move into one request; the bridge only announces moves.
|
|
44
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts No Farm watcher, event or private member is touched; only the plugin hooks and update methods Farm publishes are used, and each major receives only the hooks its plugin API defines.
|
|
45
|
+
* @evidence contracts/common.md#meaningful-documentation The comment states why Farm cannot observe the record, which API each mode uses, how the two majors are told apart, how Farm 1's server hook joins the plugin and how failures surface.
|
|
46
|
+
* @evidence contracts/portability.md#os-neutral-implementation The record is handed back in the absolute native spelling the adapter registered it under.
|
|
47
|
+
* @evidence contracts/performance.md#efficient-algorithms One feature check and one asynchronous Farm call per record once the compiler is idle; moves made while it compiles are one request, and Farm 1, which has no readiness promise, is rechecked every 10 ms only while it compiles.
|
|
48
|
+
* @evidenceExclude contracts/performance.md#reuse-equivalent-work Every move is a new change Farm has to apply.
|
|
49
|
+
* @evidence contracts/performance.md#bound-retention-and-release-resources Only the latest compiler and server are retained, replaced when Farm creates new ones, and the records awaiting an idle compiler, each released as its request is made.
|
|
50
|
+
*/
|
|
51
|
+
export function createFarmRecordUpdates(): {
|
|
52
|
+
/**
|
|
53
|
+
* The Farm plugin hooks that hand over the compiler and the dev server. The
|
|
54
|
+
* compiler hook adds Farm 1's `configureDevServer` to the plugin it is called
|
|
55
|
+
* on.
|
|
56
|
+
*/
|
|
57
|
+
hooks: {
|
|
58
|
+
configureCompiler(this: Record<string, unknown>, compiler: unknown): void;
|
|
59
|
+
configureServer(server: unknown): void;
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
/** Ask Farm to update the modules that watch a moved record. */
|
|
63
|
+
request(record: string): void;
|
|
64
|
+
} {
|
|
65
|
+
let compiler: FarmUpdateCompiler | undefined;
|
|
66
|
+
let server: FarmUpdateServer | undefined;
|
|
67
|
+
// The records whose request waits for an idle compiler.
|
|
68
|
+
const waiting = new Set<string>();
|
|
69
|
+
const keepServer = (value: unknown): void => {
|
|
70
|
+
server = value as FarmUpdateServer;
|
|
71
|
+
};
|
|
72
|
+
const dispatch = (record: string, current: FarmUpdateCompiler): void => {
|
|
73
|
+
const itemShaped = typeof current.waitForCompileFinish === "function";
|
|
74
|
+
const item = itemShaped ? { path: record, type: "updated" } : record;
|
|
75
|
+
let work: Promise<unknown> | undefined;
|
|
76
|
+
try {
|
|
77
|
+
if (server !== undefined) work = server.hmrEngine?.hmrUpdate(item);
|
|
78
|
+
else if (current.hasModule(record))
|
|
79
|
+
work = (
|
|
80
|
+
itemShaped
|
|
81
|
+
? current.update([item], true, false, false)
|
|
82
|
+
: current.update([item], true)
|
|
83
|
+
).then(() => current.writeResourcesToDisk());
|
|
84
|
+
} catch (error) {
|
|
85
|
+
work = Promise.reject(error);
|
|
86
|
+
}
|
|
87
|
+
work?.catch((error: unknown) => report(current, error));
|
|
88
|
+
};
|
|
89
|
+
return {
|
|
90
|
+
hooks: {
|
|
91
|
+
configureCompiler(value) {
|
|
92
|
+
compiler = value as FarmUpdateCompiler;
|
|
93
|
+
if (typeof compiler.waitForCompileFinish !== "function")
|
|
94
|
+
this.configureDevServer = keepServer;
|
|
95
|
+
},
|
|
96
|
+
configureServer: keepServer,
|
|
97
|
+
},
|
|
98
|
+
request: (record) => {
|
|
99
|
+
const current = compiler;
|
|
100
|
+
if (current === undefined || waiting.has(record)) return;
|
|
101
|
+
waiting.add(record);
|
|
102
|
+
untilIdle(current).then(
|
|
103
|
+
() => {
|
|
104
|
+
waiting.delete(record);
|
|
105
|
+
dispatch(record, compiler ?? current);
|
|
106
|
+
},
|
|
107
|
+
(error: unknown) => {
|
|
108
|
+
waiting.delete(record);
|
|
109
|
+
report(current, error);
|
|
110
|
+
},
|
|
111
|
+
);
|
|
112
|
+
},
|
|
113
|
+
};
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
/**
|
|
117
|
+
* Leave the hook a move may have been announced from, then wait until the
|
|
118
|
+
* compiler is idle: Farm 2 through its readiness promise, Farm 1, which has
|
|
119
|
+
* none, by rechecking its `compiling` flag.
|
|
120
|
+
*/
|
|
121
|
+
async function untilIdle(compiler: FarmUpdateCompiler): Promise<void> {
|
|
122
|
+
await new Promise((resolve) => setImmediate(resolve));
|
|
123
|
+
while (compiler.compiling === true) {
|
|
124
|
+
if (typeof compiler.waitForCompileFinish === "function")
|
|
125
|
+
await (compiler.waitForCompileFinish as () => Promise<void>)();
|
|
126
|
+
if (compiler.compiling === true)
|
|
127
|
+
await new Promise((resolve) => setTimeout(resolve, IDLE_RECHECK_MS));
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
/** Report a failed update through Farm's logger, as Farm's own loop does. */
|
|
132
|
+
function report(compiler: FarmUpdateCompiler, error: unknown): void {
|
|
133
|
+
const message = `@ttsc/unplugin: Farm update error: ${
|
|
134
|
+
error instanceof Error ? error.message : String(error)
|
|
135
|
+
}`;
|
|
136
|
+
const logger = compiler.config?.logger;
|
|
137
|
+
if (typeof logger?.error === "function")
|
|
138
|
+
logger.error(message, { exit: false });
|
|
139
|
+
else console.error(message);
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
/** How often a Farm 1 compiler, which has no readiness promise, is rechecked. */
|
|
143
|
+
const IDLE_RECHECK_MS = 10;
|
|
144
|
+
|
|
145
|
+
/** The Farm compiler members a request uses, in both majors. */
|
|
146
|
+
interface FarmUpdateCompiler {
|
|
147
|
+
hasModule(path: string): boolean;
|
|
148
|
+
update(
|
|
149
|
+
paths: unknown[],
|
|
150
|
+
sync?: boolean,
|
|
151
|
+
ignoreCompilingCheck?: boolean,
|
|
152
|
+
generateUpdateResource?: boolean,
|
|
153
|
+
): Promise<unknown>;
|
|
154
|
+
writeResourcesToDisk(): void;
|
|
155
|
+
compiling?: boolean;
|
|
156
|
+
waitForCompileFinish?: unknown;
|
|
157
|
+
config?: {
|
|
158
|
+
logger?: {
|
|
159
|
+
error?: (message: string, options?: { exit?: boolean }) => void;
|
|
160
|
+
};
|
|
161
|
+
};
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
/** The Farm dev server member a request uses, in both majors. */
|
|
165
|
+
interface FarmUpdateServer {
|
|
166
|
+
hmrEngine?: { hmrUpdate(path: unknown, force?: boolean): Promise<unknown> };
|
|
167
|
+
}
|
|
@@ -1,51 +1,25 @@
|
|
|
1
1
|
import path from "node:path";
|
|
2
2
|
|
|
3
|
-
import {
|
|
4
|
-
import { projectRecordDirectoryWritable } from "../bridge/projectRecordDirectoryWritable";
|
|
3
|
+
import { prepareProjectRecordDirectory } from "../bridge/prepareProjectRecordDirectory";
|
|
5
4
|
import { farmRecordFallback } from "./farmRecordFallback";
|
|
6
5
|
|
|
7
6
|
/**
|
|
8
|
-
* Farm's
|
|
9
|
-
*
|
|
10
|
-
*
|
|
7
|
+
* Disable Farm's persistent cache when no project record can be written: the
|
|
8
|
+
* root's own `node_modules/.cache/ttsc/unplugin` cannot hold one, and neither
|
|
9
|
+
* can the same-volume fallback (`farmRecordFallback`). Farm has no per-module
|
|
10
|
+
* persistent-cache switch, so without a record an edit made while Farm was
|
|
11
|
+
* stopped could leave an old transformed module in its cache. A record Farm
|
|
12
|
+
* holds as a watch file is revalidated when Farm starts again, below
|
|
13
|
+
* `node_modules` as anywhere else (measured on Farm 1.7.11 and 2.0.1).
|
|
11
14
|
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
* will exist: below its root (`hostToolDirectory`), or in the fallback it
|
|
21
|
-
* accepts (`farmRecordFallback`), each tested by a current write. This does not
|
|
22
|
-
* promise later write capability. Where neither can be written persistent cache
|
|
23
|
-
* use is disabled in the returned configuration, and the user is told once why,
|
|
24
|
-
* as a Node process warning, code `TTSC_PROJECT_RECORD_UNWRITABLE`.
|
|
25
|
-
*
|
|
26
|
-
* @param config Farm's user configuration, as its `config` hook receives it.
|
|
27
|
-
* @param cwd The directory Farm runs in, the root when the configuration names
|
|
28
|
-
* none.
|
|
29
|
-
* @evidence contracts/common.md#principled-implementation Current record-directory probes select whether Farm is asked to retain persistent modules; when both fail the returned config disables that cache. Later writes still need delivery-time failure handling, so a successful probe is not lifetime invalidation authority.
|
|
30
|
-
* @evidence contracts/common.md#clear-and-simple-design The configuration hook probes the two existing record locations and returns a shallow config/compilation copy changing persistentCache when needed. Other own enumerable fields and shared nested values are preserved.
|
|
31
|
-
* @evidence contracts/common.md#prohibited-implementation-shortcuts This is a host capability boundary with a stated invalidation reason, rather than a test-only bypass, patched cache implementation, or assumed writable directory.
|
|
32
|
-
* @evidence contracts/common.md#meaningful-documentation The comment explains why per-module opt-out is unavailable and why the warning and configuration-level fallback are necessary.
|
|
33
|
-
* @evidence contracts/portability.md#os-neutral-implementation Writability is proven by an actual write below the tool directory and the fallback, and the root is resolved with path.resolve against cwd, so no operating-system name, permission bit or drive layout is assumed.
|
|
34
|
-
* @evidence contracts/performance.md#efficient-algorithms
|
|
35
|
-
* At most two write probes retain native path/mkdir/write/removal work and
|
|
36
|
-
* delegated fallback naming/trust setup. Warning text follows path length;
|
|
37
|
-
* disabling cache copies the config/compilation own fields. A fixed probe
|
|
38
|
-
* count does not make native operations or field populations constant cost.
|
|
39
|
-
* @evidence contracts/performance.md#reuse-equivalent-work
|
|
40
|
-
* The WARNED set emits the unwritable-records warning once per tool
|
|
41
|
-
* directory spelling, not once per config pass. It marks before emission,
|
|
42
|
-
* so it suppresses later attempts rather than certifying user receipt. Write
|
|
43
|
-
* capability is still freshly probed instead of reused from that warning key.
|
|
44
|
-
* @evidence contracts/performance.md#bound-retention-and-release-resources
|
|
45
|
-
* WARNED retains each distinct tool-directory spelling for the process life,
|
|
46
|
-
* without eviction or a fixed string-byte bound. Probe cleanup and persistent
|
|
47
|
-
* directories belong to the write-probe helper; failed removal can leave its
|
|
48
|
-
* probe. Returned config ownership transfers to Farm.
|
|
15
|
+
* @evidence contracts/common.md#principled-implementation The configuration hook keeps persistent caching whenever the default record directory or the private fallback on Farm's volume can host an ordinary record directory; a later write retains its own error handling.
|
|
16
|
+
* @evidence contracts/common.md#clear-and-simple-design The default location's probe and the fallback query, in the order records are written, decide whether to copy the config with persistentCache disabled.
|
|
17
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts No probe file or nonignored project directory is created to test the candidate.
|
|
18
|
+
* @evidence contracts/common.md#meaningful-documentation The comment explains the host limitation, invalidation failure and configuration-level fallback.
|
|
19
|
+
* @evidence contracts/portability.md#os-neutral-implementation Native path resolution and filesystem access checks observe the candidate under the host's selected root and platform permissions.
|
|
20
|
+
* @evidence contracts/performance.md#efficient-algorithms The default location's bounded component walk runs first, and the fallback's ancestor walk only when it refuses; the disabled case copies the configuration's own properties.
|
|
21
|
+
* @evidenceExclude contracts/performance.md#reuse-equivalent-work Writability is observed afresh on each configuration pass.
|
|
22
|
+
* @evidence contracts/performance.md#bound-retention-and-release-resources The warning set retains one spelling per refused root for the process lifetime, with no fixed cap. No probe file or handle is retained.
|
|
49
23
|
*/
|
|
50
24
|
export function farmPersistentCacheWithoutRecords<
|
|
51
25
|
Config extends {
|
|
@@ -55,20 +29,16 @@ export function farmPersistentCacheWithoutRecords<
|
|
|
55
29
|
>(config: Config, cwd: string): Config {
|
|
56
30
|
if (config.compilation?.persistentCache === false) return config;
|
|
57
31
|
const root = path.resolve(cwd, config.root ?? ".");
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
32
|
+
if (
|
|
33
|
+
prepareProjectRecordDirectory.available(root) ||
|
|
34
|
+
farmRecordFallback(root) !== undefined
|
|
35
|
+
)
|
|
62
36
|
return config;
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
WARNED.add(toolDirectory);
|
|
37
|
+
if (!WARNED.has(root)) {
|
|
38
|
+
WARNED.add(root);
|
|
66
39
|
process.emitWarning(
|
|
67
|
-
`@ttsc/unplugin:
|
|
68
|
-
|
|
69
|
-
"persistent cache is turned off: it would restore a module whatever " +
|
|
70
|
-
"the types its output consulted did while Farm was stopped. Let the " +
|
|
71
|
-
`adapter write below ${toolDirectory}.`,
|
|
40
|
+
`@ttsc/unplugin: Farm's persistent cache is off for ${root}. ` +
|
|
41
|
+
"Neither its node_modules/.cache nor a writable same-volume directory can hold its project records.",
|
|
72
42
|
{ code: "TTSC_PROJECT_RECORD_UNWRITABLE" },
|
|
73
43
|
);
|
|
74
44
|
}
|
|
@@ -78,5 +48,5 @@ export function farmPersistentCacheWithoutRecords<
|
|
|
78
48
|
};
|
|
79
49
|
}
|
|
80
50
|
|
|
81
|
-
/** The
|
|
51
|
+
/** The host roots this process already warned about. */
|
|
82
52
|
const WARNED = new Set<string>();
|