@wyw-in-js/transform 1.1.0 → 2.0.0-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm/cache.js +426 -289
- package/esm/cache.js.map +1 -1
- package/esm/debug/fileReporter.js +137 -134
- package/esm/debug/fileReporter.js.map +1 -1
- package/esm/eval/broker.js +2134 -0
- package/esm/eval/broker.js.map +1 -0
- package/esm/eval/lru.js +36 -0
- package/esm/eval/lru.js.map +1 -0
- package/esm/eval/prepareModuleOnDemand.js +21 -0
- package/esm/eval/prepareModuleOnDemand.js.map +1 -0
- package/esm/eval/protocol.js +2 -0
- package/esm/eval/protocol.js.map +1 -0
- package/esm/eval/resolverStrategy.js +51 -0
- package/esm/eval/resolverStrategy.js.map +1 -0
- package/esm/eval/runner.js +1759 -0
- package/esm/eval/runner.js.map +1 -0
- package/esm/eval/serialize.js +333 -0
- package/esm/eval/serialize.js.map +1 -0
- package/esm/eval/writeQueue.js +81 -0
- package/esm/eval/writeQueue.js.map +1 -0
- package/esm/evaluators/index.js +11 -12
- package/esm/evaluators/index.js.map +1 -1
- package/esm/index.js +25 -29
- package/esm/index.js.map +1 -1
- package/esm/module.js +896 -520
- package/esm/module.js.map +1 -1
- package/esm/shaker.js +14 -80
- package/esm/shaker.js.map +1 -1
- package/esm/transform/BaseEntrypoint.js +162 -164
- package/esm/transform/BaseEntrypoint.js.map +1 -1
- package/esm/transform/Entrypoint.helpers.js +96 -253
- package/esm/transform/Entrypoint.helpers.js.map +1 -1
- package/esm/transform/Entrypoint.js +336 -270
- package/esm/transform/Entrypoint.js.map +1 -1
- package/esm/transform/Entrypoint.types.js +1 -1
- package/esm/transform/Entrypoint.types.js.map +1 -1
- package/esm/transform/EvaluatedEntrypoint.js +10 -4
- package/esm/transform/EvaluatedEntrypoint.js.map +1 -1
- package/esm/transform/actions/AbortError.js +6 -6
- package/esm/transform/actions/AbortError.js.map +1 -1
- package/esm/transform/actions/BaseAction.js +140 -136
- package/esm/transform/actions/BaseAction.js.map +1 -1
- package/esm/transform/actions/UnprocessedEntrypointError.js +6 -6
- package/esm/transform/actions/UnprocessedEntrypointError.js.map +1 -1
- package/esm/transform/actions/actionRunner.js +63 -66
- package/esm/transform/actions/actionRunner.js.map +1 -1
- package/esm/transform/actions/types.js +1 -1
- package/esm/transform/actions/types.js.map +1 -1
- package/esm/transform/barrelManifest.types.js +2 -0
- package/esm/transform/barrelManifest.types.js.map +1 -0
- package/esm/transform/generators/baseProcessingHandlers.js +15 -17
- package/esm/transform/generators/baseProcessingHandlers.js.map +1 -1
- package/esm/transform/generators/collect.js +27 -55
- package/esm/transform/generators/collect.js.map +1 -1
- package/esm/transform/generators/createStylisPreprocessor.js +353 -321
- package/esm/transform/generators/createStylisPreprocessor.js.map +1 -1
- package/esm/transform/generators/evalFile.js +48 -47
- package/esm/transform/generators/evalFile.js.map +1 -1
- package/esm/transform/generators/extract.js +78 -90
- package/esm/transform/generators/extract.js.map +1 -1
- package/esm/transform/generators/getExports.js +57 -74
- package/esm/transform/generators/getExports.js.map +1 -1
- package/esm/transform/generators/index.js +11 -11
- package/esm/transform/generators/index.js.map +1 -1
- package/esm/transform/generators/processEntrypoint.js +78 -67
- package/esm/transform/generators/processEntrypoint.js.map +1 -1
- package/esm/transform/generators/processImports.js +102 -67
- package/esm/transform/generators/processImports.js.map +1 -1
- package/esm/transform/generators/resolveImports.js +165 -196
- package/esm/transform/generators/resolveImports.js.map +1 -1
- package/esm/transform/generators/resolveStaticOxcValues.js +2911 -0
- package/esm/transform/generators/resolveStaticOxcValues.js.map +1 -0
- package/esm/transform/generators/rewriteOxcBarrelImports.js +822 -0
- package/esm/transform/generators/rewriteOxcBarrelImports.js.map +1 -0
- package/esm/transform/generators/transform.js +239 -248
- package/esm/transform/generators/transform.js.map +1 -1
- package/esm/transform/generators/workflow.js +87 -90
- package/esm/transform/generators/workflow.js.map +1 -1
- package/esm/transform/helpers/loadWywOptions.js +154 -74
- package/esm/transform/helpers/loadWywOptions.js.map +1 -1
- package/esm/transform/helpers/withDefaultServices.js +13 -22
- package/esm/transform/helpers/withDefaultServices.js.map +1 -1
- package/esm/transform/isStaticallyEvaluatableModule.js +140 -152
- package/esm/transform/isStaticallyEvaluatableModule.js.map +1 -1
- package/esm/transform/oxcBarrelManifest.js +349 -0
- package/esm/transform/oxcBarrelManifest.js.map +1 -0
- package/esm/transform/rootLog.js +3 -3
- package/esm/transform/rootLog.js.map +1 -1
- package/esm/transform/syntax.js +2 -0
- package/esm/transform/syntax.js.map +1 -0
- package/esm/transform/types.js +2 -2
- package/esm/transform/types.js.map +1 -1
- package/esm/transform.js +123 -147
- package/esm/transform.js.map +1 -1
- package/esm/types.js +4 -1
- package/esm/types.js.map +1 -1
- package/esm/utils/EventEmitter.js +46 -48
- package/esm/utils/EventEmitter.js.map +1 -1
- package/esm/utils/ShakerMetadata.js +2 -2
- package/esm/utils/ShakerMetadata.js.map +1 -1
- package/esm/utils/TransformDiagnostics.js +9 -9
- package/esm/utils/TransformDiagnostics.js.map +1 -1
- package/esm/utils/TransformMetadata.js +24 -26
- package/esm/utils/TransformMetadata.js.map +1 -1
- package/esm/utils/applyOxcProcessors.js +1217 -0
- package/esm/utils/applyOxcProcessors.js.map +1 -0
- package/esm/utils/collectOxcExportsAndImports.js +934 -0
- package/esm/utils/collectOxcExportsAndImports.js.map +1 -0
- package/esm/utils/collectOxcRuntime.js +220 -0
- package/esm/utils/collectOxcRuntime.js.map +1 -0
- package/esm/utils/collectOxcTemplateDependencies.js +1398 -0
- package/esm/utils/collectOxcTemplateDependencies.js.map +1 -0
- package/esm/utils/dispose-polyfill.js +3 -4
- package/esm/utils/dispose-polyfill.js.map +1 -1
- package/esm/utils/getFileIdx.js +6 -6
- package/esm/utils/getFileIdx.js.map +1 -1
- package/esm/utils/getPluginKey.js +12 -12
- package/esm/utils/getPluginKey.js.map +1 -1
- package/esm/utils/getVisitorKeys.js +9 -3
- package/esm/utils/getVisitorKeys.js.map +1 -1
- package/esm/utils/hasCachedWywPrevalExport.js +23 -0
- package/esm/utils/hasCachedWywPrevalExport.js.map +1 -0
- package/esm/utils/hasWywPreval.js +5 -5
- package/esm/utils/hasWywPreval.js.map +1 -1
- package/esm/utils/importOverrides.js +75 -90
- package/esm/utils/importOverrides.js.map +1 -1
- package/esm/utils/isNode.js +2 -2
- package/esm/utils/isNode.js.map +1 -1
- package/esm/utils/isNotNull.js +2 -2
- package/esm/utils/isNotNull.js.map +1 -1
- package/esm/utils/isSerializable.js +11 -11
- package/esm/utils/isSerializable.js.map +1 -1
- package/esm/utils/oxcAstService.js +121 -0
- package/esm/utils/oxcAstService.js.map +1 -0
- package/esm/utils/oxcEmit.js +447 -0
- package/esm/utils/oxcEmit.js.map +1 -0
- package/esm/utils/oxcPreevalStage.js +97 -0
- package/esm/utils/oxcPreevalStage.js.map +1 -0
- package/esm/utils/oxcPreevalTransforms.js +1054 -0
- package/esm/utils/oxcPreevalTransforms.js.map +1 -0
- package/esm/utils/oxcShaker.js +662 -0
- package/esm/utils/oxcShaker.js.map +1 -0
- package/esm/utils/parseOxc.js +37 -0
- package/esm/utils/parseOxc.js.map +1 -0
- package/esm/utils/parseRequest.js +27 -27
- package/esm/utils/parseRequest.js.map +1 -1
- package/esm/utils/peek.js +1 -1
- package/esm/utils/peek.js.map +1 -1
- package/esm/utils/processorLookup.js +125 -0
- package/esm/utils/processorLookup.js.map +1 -0
- package/esm/utils/resolveWithConditions.js +99 -0
- package/esm/utils/resolveWithConditions.js.map +1 -0
- package/esm/vm/createVmContext.js +140 -141
- package/esm/vm/createVmContext.js.map +1 -1
- package/esm/vm/process.js +11 -13
- package/esm/vm/process.js.map +1 -1
- package/package.json +18 -26
- package/types/cache.d.ts +17 -8
- package/types/cache.js +237 -95
- package/types/debug/fileReporter.js +22 -22
- package/types/eval/broker.d.ts +88 -0
- package/types/eval/broker.js +2262 -0
- package/types/eval/lru.d.ts +10 -0
- package/types/eval/lru.js +36 -0
- package/types/eval/prepareModuleOnDemand.d.ts +7 -0
- package/types/eval/prepareModuleOnDemand.js +24 -0
- package/types/eval/protocol.d.ts +97 -0
- package/types/eval/protocol.js +1 -0
- package/types/eval/resolverStrategy.d.ts +13 -0
- package/types/eval/resolverStrategy.js +46 -0
- package/types/eval/serialize.d.ts +78 -0
- package/types/eval/serialize.js +357 -0
- package/types/eval/writeQueue.d.ts +13 -0
- package/types/eval/writeQueue.js +80 -0
- package/types/evaluators/index.d.ts +2 -2
- package/types/evaluators/index.js +6 -9
- package/types/index.d.ts +3 -6
- package/types/index.js +24 -82
- package/types/module.d.ts +35 -7
- package/types/module.js +535 -163
- package/types/shaker.d.ts +2 -10
- package/types/shaker.js +10 -100
- package/types/transform/BaseEntrypoint.js +6 -11
- package/types/transform/Entrypoint.d.ts +15 -15
- package/types/transform/Entrypoint.helpers.d.ts +2 -5
- package/types/transform/Entrypoint.helpers.js +43 -203
- package/types/transform/Entrypoint.js +130 -53
- package/types/transform/Entrypoint.types.d.ts +28 -6
- package/types/transform/Entrypoint.types.js +1 -2
- package/types/transform/EvaluatedEntrypoint.d.ts +13 -2
- package/types/transform/EvaluatedEntrypoint.js +7 -6
- package/types/transform/actions/AbortError.js +2 -7
- package/types/transform/actions/BaseAction.js +4 -8
- package/types/transform/actions/UnprocessedEntrypointError.js +2 -7
- package/types/transform/actions/actionRunner.js +8 -12
- package/types/transform/actions/types.d.ts +2 -2
- package/types/transform/actions/types.js +1 -2
- package/types/transform/{barrelManifest.d.ts → barrelManifest.types.d.ts} +0 -2
- package/types/transform/barrelManifest.types.js +1 -0
- package/types/transform/generators/baseProcessingHandlers.d.ts +4 -5
- package/types/transform/generators/baseProcessingHandlers.js +10 -14
- package/types/transform/generators/collect.js +13 -39
- package/types/transform/generators/createStylisPreprocessor.js +19 -60
- package/types/transform/generators/evalFile.d.ts +2 -2
- package/types/transform/generators/evalFile.js +26 -28
- package/types/transform/generators/extract.js +5 -8
- package/types/transform/generators/getExports.js +23 -30
- package/types/transform/generators/index.d.ts +2 -2
- package/types/transform/generators/index.js +11 -14
- package/types/transform/generators/processEntrypoint.d.ts +2 -2
- package/types/transform/generators/processEntrypoint.js +60 -26
- package/types/transform/generators/processImports.d.ts +0 -3
- package/types/transform/generators/processImports.js +60 -20
- package/types/transform/generators/resolveImports.js +18 -22
- package/types/transform/generators/resolveStaticOxcValues.d.ts +2 -0
- package/types/transform/generators/resolveStaticOxcValues.js +3235 -0
- package/types/transform/generators/{rewriteBarrelImports.d.ts → rewriteOxcBarrelImports.d.ts} +2 -3
- package/types/transform/generators/{rewriteBarrelImports.js → rewriteOxcBarrelImports.js} +282 -225
- package/types/transform/generators/transform.d.ts +3 -7
- package/types/transform/generators/transform.js +203 -199
- package/types/transform/generators/workflow.js +62 -45
- package/types/transform/helpers/loadWywOptions.js +94 -20
- package/types/transform/helpers/withDefaultServices.d.ts +1 -1
- package/types/transform/helpers/withDefaultServices.js +6 -44
- package/types/transform/isStaticallyEvaluatableModule.d.ts +1 -2
- package/types/transform/isStaticallyEvaluatableModule.js +125 -126
- package/types/transform/oxcBarrelManifest.d.ts +2 -0
- package/types/transform/{barrelManifest.js → oxcBarrelManifest.js} +156 -97
- package/types/transform/rootLog.js +2 -5
- package/types/transform/syntax.d.ts +38 -0
- package/types/transform/syntax.js +1 -0
- package/types/transform/types.d.ts +9 -6
- package/types/transform/types.js +1 -4
- package/types/transform.d.ts +2 -2
- package/types/transform.js +88 -101
- package/types/types.d.ts +0 -23
- package/types/types.js +1 -2
- package/types/utils/EventEmitter.js +3 -9
- package/types/utils/ShakerMetadata.js +1 -5
- package/types/utils/TransformDiagnostics.js +3 -7
- package/types/utils/TransformMetadata.js +8 -16
- package/types/utils/applyOxcProcessors.d.ts +16 -0
- package/types/utils/applyOxcProcessors.js +1391 -0
- package/types/utils/collectOxcExportsAndImports.d.ts +35 -0
- package/types/utils/collectOxcExportsAndImports.js +957 -0
- package/types/utils/collectOxcRuntime.d.ts +14 -0
- package/types/utils/collectOxcRuntime.js +250 -0
- package/types/utils/collectOxcTemplateDependencies.d.ts +38 -0
- package/types/utils/collectOxcTemplateDependencies.js +1580 -0
- package/types/utils/getFileIdx.js +1 -4
- package/types/utils/getPluginKey.d.ts +5 -2
- package/types/utils/getPluginKey.js +2 -6
- package/types/utils/getVisitorKeys.d.ts +4 -4
- package/types/utils/getVisitorKeys.js +9 -6
- package/types/utils/hasCachedWywPrevalExport.d.ts +14 -0
- package/types/utils/hasCachedWywPrevalExport.js +30 -0
- package/types/utils/hasWywPreval.js +1 -4
- package/types/utils/importOverrides.js +17 -27
- package/types/utils/isNode.d.ts +2 -2
- package/types/utils/isNode.js +2 -6
- package/types/utils/isNotNull.js +1 -4
- package/types/utils/isSerializable.js +3 -6
- package/types/utils/oxcAstService.d.ts +11 -0
- package/types/utils/oxcAstService.js +79 -0
- package/types/utils/oxcEmit.d.ts +19 -0
- package/types/utils/oxcEmit.js +506 -0
- package/types/utils/oxcPreevalStage.d.ts +20 -0
- package/types/utils/oxcPreevalStage.js +102 -0
- package/types/utils/oxcPreevalTransforms.d.ts +13 -0
- package/types/utils/oxcPreevalTransforms.js +1179 -0
- package/types/utils/oxcShaker.d.ts +13 -0
- package/types/utils/oxcShaker.js +751 -0
- package/types/utils/parseOxc.d.ts +11 -0
- package/types/utils/parseOxc.js +38 -0
- package/types/utils/parseRequest.js +2 -7
- package/types/utils/peek.js +1 -5
- package/types/utils/processorLookup.d.ts +8 -0
- package/types/utils/processorLookup.js +135 -0
- package/types/utils/resolveWithConditions.d.ts +12 -0
- package/types/utils/resolveWithConditions.js +103 -0
- package/types/vm/createVmContext.d.ts +2 -2
- package/types/vm/createVmContext.js +25 -62
- package/types/vm/process.js +20 -26
- package/esm/babel.js +0 -2
- package/esm/babel.js.map +0 -1
- package/esm/options/buildOptions.js +0 -168
- package/esm/options/buildOptions.js.map +0 -1
- package/esm/options/buildOptions.test.js +0 -138
- package/esm/options/buildOptions.test.js.map +0 -1
- package/esm/options/loadBabelOptions.js +0 -24
- package/esm/options/loadBabelOptions.js.map +0 -1
- package/esm/plugins/babel-transform.js +0 -53
- package/esm/plugins/babel-transform.js.map +0 -1
- package/esm/plugins/collector.js +0 -60
- package/esm/plugins/collector.js.map +0 -1
- package/esm/plugins/dynamic-import.js +0 -56
- package/esm/plugins/dynamic-import.js.map +0 -1
- package/esm/plugins/preeval.js +0 -73
- package/esm/plugins/preeval.js.map +0 -1
- package/esm/plugins/shaker.js +0 -680
- package/esm/plugins/shaker.js.map +0 -1
- package/esm/transform/barrelManifest.js +0 -291
- package/esm/transform/barrelManifest.js.map +0 -1
- package/esm/transform/generators/explodeReexports.js +0 -64
- package/esm/transform/generators/explodeReexports.js.map +0 -1
- package/esm/transform/generators/rewriteBarrelImports.js +0 -733
- package/esm/transform/generators/rewriteBarrelImports.js.map +0 -1
- package/esm/utils/addIdentifierToWywPreval.js +0 -68
- package/esm/utils/addIdentifierToWywPreval.js.map +0 -1
- package/esm/utils/collectExportsAndImports.js +0 -1157
- package/esm/utils/collectExportsAndImports.js.map +0 -1
- package/esm/utils/collectTemplateDependencies.js +0 -228
- package/esm/utils/collectTemplateDependencies.js.map +0 -1
- package/esm/utils/createId.js +0 -6
- package/esm/utils/createId.js.map +0 -1
- package/esm/utils/findIdentifiers.js +0 -62
- package/esm/utils/findIdentifiers.js.map +0 -1
- package/esm/utils/getConstantStringValue.js +0 -58
- package/esm/utils/getConstantStringValue.js.map +0 -1
- package/esm/utils/getMemberExpressionPropertyName.js +0 -11
- package/esm/utils/getMemberExpressionPropertyName.js.map +0 -1
- package/esm/utils/getScope.js +0 -6
- package/esm/utils/getScope.js.map +0 -1
- package/esm/utils/getSource.js +0 -15
- package/esm/utils/getSource.js.map +0 -1
- package/esm/utils/getTagProcessor.js +0 -404
- package/esm/utils/getTagProcessor.js.map +0 -1
- package/esm/utils/isExports.js +0 -22
- package/esm/utils/isExports.js.map +0 -1
- package/esm/utils/isGlobal.js +0 -6
- package/esm/utils/isGlobal.js.map +0 -1
- package/esm/utils/isNodePath.js +0 -4
- package/esm/utils/isNodePath.js.map +0 -1
- package/esm/utils/isRemoved.js +0 -46
- package/esm/utils/isRemoved.js.map +0 -1
- package/esm/utils/isRequire.js +0 -13
- package/esm/utils/isRequire.js.map +0 -1
- package/esm/utils/isTypedNode.js +0 -6
- package/esm/utils/isTypedNode.js.map +0 -1
- package/esm/utils/isUnnecessaryReactCall.js +0 -72
- package/esm/utils/isUnnecessaryReactCall.js.map +0 -1
- package/esm/utils/removeDangerousCode.js +0 -276
- package/esm/utils/removeDangerousCode.js.map +0 -1
- package/esm/utils/replaceImportMetaEnv.js +0 -44
- package/esm/utils/replaceImportMetaEnv.js.map +0 -1
- package/esm/utils/scopeHelpers.js +0 -527
- package/esm/utils/scopeHelpers.js.map +0 -1
- package/esm/utils/traversalCache.js +0 -23
- package/esm/utils/traversalCache.js.map +0 -1
- package/esm/utils/unwrapExpression.js +0 -18
- package/esm/utils/unwrapExpression.js.map +0 -1
- package/esm/utils/unwrapSequence.js +0 -14
- package/esm/utils/unwrapSequence.js.map +0 -1
- package/esm/utils/valueToLiteral.js +0 -59
- package/esm/utils/valueToLiteral.js.map +0 -1
- package/esm/utils/visitors/JSXElementsRemover.js +0 -51
- package/esm/utils/visitors/JSXElementsRemover.js.map +0 -1
- package/lib/babel.js +0 -2
- package/lib/babel.js.map +0 -1
- package/lib/cache.js +0 -308
- package/lib/cache.js.map +0 -1
- package/lib/debug/fileReporter.js +0 -153
- package/lib/debug/fileReporter.js.map +0 -1
- package/lib/evaluators/index.js +0 -20
- package/lib/evaluators/index.js.map +0 -1
- package/lib/index.js +0 -286
- package/lib/index.js.map +0 -1
- package/lib/module.js +0 -552
- package/lib/module.js.map +0 -1
- package/lib/options/buildOptions.js +0 -176
- package/lib/options/buildOptions.js.map +0 -1
- package/lib/options/buildOptions.test.js +0 -141
- package/lib/options/buildOptions.test.js.map +0 -1
- package/lib/options/loadBabelOptions.js +0 -31
- package/lib/options/loadBabelOptions.js.map +0 -1
- package/lib/plugins/babel-transform.js +0 -60
- package/lib/plugins/babel-transform.js.map +0 -1
- package/lib/plugins/collector.js +0 -70
- package/lib/plugins/collector.js.map +0 -1
- package/lib/plugins/dynamic-import.js +0 -61
- package/lib/plugins/dynamic-import.js.map +0 -1
- package/lib/plugins/preeval.js +0 -81
- package/lib/plugins/preeval.js.map +0 -1
- package/lib/plugins/shaker.js +0 -691
- package/lib/plugins/shaker.js.map +0 -1
- package/lib/shaker.js +0 -95
- package/lib/shaker.js.map +0 -1
- package/lib/transform/BaseEntrypoint.js +0 -179
- package/lib/transform/BaseEntrypoint.js.map +0 -1
- package/lib/transform/Entrypoint.helpers.js +0 -279
- package/lib/transform/Entrypoint.helpers.js.map +0 -1
- package/lib/transform/Entrypoint.js +0 -289
- package/lib/transform/Entrypoint.js.map +0 -1
- package/lib/transform/Entrypoint.types.js +0 -2
- package/lib/transform/Entrypoint.types.js.map +0 -1
- package/lib/transform/EvaluatedEntrypoint.js +0 -13
- package/lib/transform/EvaluatedEntrypoint.js.map +0 -1
- package/lib/transform/actions/AbortError.js +0 -16
- package/lib/transform/actions/AbortError.js.map +0 -1
- package/lib/transform/actions/BaseAction.js +0 -150
- package/lib/transform/actions/BaseAction.js.map +0 -1
- package/lib/transform/actions/UnprocessedEntrypointError.js +0 -16
- package/lib/transform/actions/UnprocessedEntrypointError.js.map +0 -1
- package/lib/transform/actions/actionRunner.js +0 -82
- package/lib/transform/actions/actionRunner.js.map +0 -1
- package/lib/transform/actions/types.js +0 -2
- package/lib/transform/actions/types.js.map +0 -1
- package/lib/transform/barrelManifest.js +0 -300
- package/lib/transform/barrelManifest.js.map +0 -1
- package/lib/transform/generators/baseProcessingHandlers.js +0 -27
- package/lib/transform/generators/baseProcessingHandlers.js.map +0 -1
- package/lib/transform/generators/collect.js +0 -66
- package/lib/transform/generators/collect.js.map +0 -1
- package/lib/transform/generators/createStylisPreprocessor.js +0 -372
- package/lib/transform/generators/createStylisPreprocessor.js.map +0 -1
- package/lib/transform/generators/evalFile.js +0 -57
- package/lib/transform/generators/evalFile.js.map +0 -1
- package/lib/transform/generators/explodeReexports.js +0 -71
- package/lib/transform/generators/explodeReexports.js.map +0 -1
- package/lib/transform/generators/extract.js +0 -102
- package/lib/transform/generators/extract.js.map +0 -1
- package/lib/transform/generators/getExports.js +0 -85
- package/lib/transform/generators/getExports.js.map +0 -1
- package/lib/transform/generators/index.js +0 -19
- package/lib/transform/generators/index.js.map +0 -1
- package/lib/transform/generators/processEntrypoint.js +0 -76
- package/lib/transform/generators/processEntrypoint.js.map +0 -1
- package/lib/transform/generators/processImports.js +0 -82
- package/lib/transform/generators/processImports.js.map +0 -1
- package/lib/transform/generators/resolveImports.js +0 -221
- package/lib/transform/generators/resolveImports.js.map +0 -1
- package/lib/transform/generators/rewriteBarrelImports.js +0 -743
- package/lib/transform/generators/rewriteBarrelImports.js.map +0 -1
- package/lib/transform/generators/transform.js +0 -272
- package/lib/transform/generators/transform.js.map +0 -1
- package/lib/transform/generators/workflow.js +0 -100
- package/lib/transform/generators/workflow.js.map +0 -1
- package/lib/transform/helpers/loadWywOptions.js +0 -88
- package/lib/transform/helpers/loadWywOptions.js.map +0 -1
- package/lib/transform/helpers/withDefaultServices.js +0 -31
- package/lib/transform/helpers/withDefaultServices.js.map +0 -1
- package/lib/transform/isStaticallyEvaluatableModule.js +0 -159
- package/lib/transform/isStaticallyEvaluatableModule.js.map +0 -1
- package/lib/transform/rootLog.js +0 -9
- package/lib/transform/rootLog.js.map +0 -1
- package/lib/transform/types.js +0 -8
- package/lib/transform/types.js.map +0 -1
- package/lib/transform.js +0 -160
- package/lib/transform.js.map +0 -1
- package/lib/types.js +0 -2
- package/lib/types.js.map +0 -1
- package/lib/utils/EventEmitter.js +0 -61
- package/lib/utils/EventEmitter.js.map +0 -1
- package/lib/utils/ShakerMetadata.js +0 -9
- package/lib/utils/ShakerMetadata.js.map +0 -1
- package/lib/utils/TransformDiagnostics.js +0 -20
- package/lib/utils/TransformDiagnostics.js.map +0 -1
- package/lib/utils/TransformMetadata.js +0 -45
- package/lib/utils/TransformMetadata.js.map +0 -1
- package/lib/utils/addIdentifierToWywPreval.js +0 -75
- package/lib/utils/addIdentifierToWywPreval.js.map +0 -1
- package/lib/utils/collectExportsAndImports.js +0 -1173
- package/lib/utils/collectExportsAndImports.js.map +0 -1
- package/lib/utils/collectTemplateDependencies.js +0 -242
- package/lib/utils/collectTemplateDependencies.js.map +0 -1
- package/lib/utils/createId.js +0 -13
- package/lib/utils/createId.js.map +0 -1
- package/lib/utils/dispose-polyfill.js +0 -9
- package/lib/utils/dispose-polyfill.js.map +0 -1
- package/lib/utils/findIdentifiers.js +0 -73
- package/lib/utils/findIdentifiers.js.map +0 -1
- package/lib/utils/getConstantStringValue.js +0 -66
- package/lib/utils/getConstantStringValue.js.map +0 -1
- package/lib/utils/getFileIdx.js +0 -16
- package/lib/utils/getFileIdx.js.map +0 -1
- package/lib/utils/getMemberExpressionPropertyName.js +0 -18
- package/lib/utils/getMemberExpressionPropertyName.js.map +0 -1
- package/lib/utils/getPluginKey.js +0 -21
- package/lib/utils/getPluginKey.js.map +0 -1
- package/lib/utils/getScope.js +0 -12
- package/lib/utils/getScope.js.map +0 -1
- package/lib/utils/getSource.js +0 -24
- package/lib/utils/getSource.js.map +0 -1
- package/lib/utils/getTagProcessor.js +0 -424
- package/lib/utils/getTagProcessor.js.map +0 -1
- package/lib/utils/getVisitorKeys.js +0 -11
- package/lib/utils/getVisitorKeys.js.map +0 -1
- package/lib/utils/hasWywPreval.js +0 -13
- package/lib/utils/hasWywPreval.js.map +0 -1
- package/lib/utils/importOverrides.js +0 -119
- package/lib/utils/importOverrides.js.map +0 -1
- package/lib/utils/isExports.js +0 -27
- package/lib/utils/isExports.js.map +0 -1
- package/lib/utils/isGlobal.js +0 -13
- package/lib/utils/isGlobal.js.map +0 -1
- package/lib/utils/isNode.js +0 -9
- package/lib/utils/isNode.js.map +0 -1
- package/lib/utils/isNodePath.js +0 -10
- package/lib/utils/isNodePath.js.map +0 -1
- package/lib/utils/isNotNull.js +0 -10
- package/lib/utils/isNotNull.js.map +0 -1
- package/lib/utils/isRemoved.js +0 -52
- package/lib/utils/isRemoved.js.map +0 -1
- package/lib/utils/isRequire.js +0 -18
- package/lib/utils/isRequire.js.map +0 -1
- package/lib/utils/isSerializable.js +0 -19
- package/lib/utils/isSerializable.js.map +0 -1
- package/lib/utils/isTypedNode.js +0 -13
- package/lib/utils/isTypedNode.js.map +0 -1
- package/lib/utils/isUnnecessaryReactCall.js +0 -81
- package/lib/utils/isUnnecessaryReactCall.js.map +0 -1
- package/lib/utils/parseRequest.js +0 -37
- package/lib/utils/parseRequest.js.map +0 -1
- package/lib/utils/peek.js +0 -9
- package/lib/utils/peek.js.map +0 -1
- package/lib/utils/removeDangerousCode.js +0 -284
- package/lib/utils/removeDangerousCode.js.map +0 -1
- package/lib/utils/replaceImportMetaEnv.js +0 -50
- package/lib/utils/replaceImportMetaEnv.js.map +0 -1
- package/lib/utils/scopeHelpers.js +0 -557
- package/lib/utils/scopeHelpers.js.map +0 -1
- package/lib/utils/traversalCache.js +0 -31
- package/lib/utils/traversalCache.js.map +0 -1
- package/lib/utils/unwrapExpression.js +0 -25
- package/lib/utils/unwrapExpression.js.map +0 -1
- package/lib/utils/unwrapSequence.js +0 -20
- package/lib/utils/unwrapSequence.js.map +0 -1
- package/lib/utils/valueToLiteral.js +0 -65
- package/lib/utils/valueToLiteral.js.map +0 -1
- package/lib/utils/visitors/JSXElementsRemover.js +0 -57
- package/lib/utils/visitors/JSXElementsRemover.js.map +0 -1
- package/lib/vm/createVmContext.js +0 -166
- package/lib/vm/createVmContext.js.map +0 -1
- package/lib/vm/process.js +0 -38
- package/lib/vm/process.js.map +0 -1
- package/types/babel.d.ts +0 -2
- package/types/babel.js +0 -2
- package/types/options/buildOptions.d.ts +0 -6
- package/types/options/buildOptions.js +0 -178
- package/types/options/loadBabelOptions.d.ts +0 -3
- package/types/options/loadBabelOptions.js +0 -26
- package/types/plugins/babel-transform.d.ts +0 -4
- package/types/plugins/babel-transform.js +0 -49
- package/types/plugins/collector.d.ts +0 -23
- package/types/plugins/collector.js +0 -62
- package/types/plugins/dynamic-import.d.ts +0 -6
- package/types/plugins/dynamic-import.js +0 -60
- package/types/plugins/preeval.d.ts +0 -16
- package/types/plugins/preeval.js +0 -69
- package/types/plugins/shaker.d.ts +0 -14
- package/types/plugins/shaker.js +0 -724
- package/types/transform/generators/explodeReexports.d.ts +0 -7
- package/types/transform/generators/explodeReexports.js +0 -65
- package/types/utils/addIdentifierToWywPreval.d.ts +0 -4
- package/types/utils/addIdentifierToWywPreval.js +0 -74
- package/types/utils/collectExportsAndImports.d.ts +0 -31
- package/types/utils/collectExportsAndImports.js +0 -1147
- package/types/utils/collectTemplateDependencies.d.ts +0 -17
- package/types/utils/collectTemplateDependencies.js +0 -220
- package/types/utils/createId.d.ts +0 -2
- package/types/utils/createId.js +0 -9
- package/types/utils/findIdentifiers.d.ts +0 -6
- package/types/utils/findIdentifiers.js +0 -67
- package/types/utils/getConstantStringValue.d.ts +0 -2
- package/types/utils/getConstantStringValue.js +0 -94
- package/types/utils/getMemberExpressionPropertyName.d.ts +0 -2
- package/types/utils/getMemberExpressionPropertyName.js +0 -46
- package/types/utils/getScope.d.ts +0 -2
- package/types/utils/getScope.js +0 -10
- package/types/utils/getSource.d.ts +0 -2
- package/types/utils/getSource.js +0 -22
- package/types/utils/getTagProcessor.d.ts +0 -13
- package/types/utils/getTagProcessor.js +0 -411
- package/types/utils/isExports.d.ts +0 -6
- package/types/utils/isExports.js +0 -19
- package/types/utils/isGlobal.d.ts +0 -2
- package/types/utils/isGlobal.js +0 -9
- package/types/utils/isNodePath.d.ts +0 -3
- package/types/utils/isNodePath.js +0 -6
- package/types/utils/isRemoved.d.ts +0 -5
- package/types/utils/isRemoved.js +0 -41
- package/types/utils/isRequire.d.ts +0 -6
- package/types/utils/isRequire.js +0 -14
- package/types/utils/isTypedNode.d.ts +0 -5
- package/types/utils/isTypedNode.js +0 -9
- package/types/utils/isUnnecessaryReactCall.d.ts +0 -3
- package/types/utils/isUnnecessaryReactCall.js +0 -75
- package/types/utils/removeDangerousCode.d.ts +0 -4
- package/types/utils/removeDangerousCode.js +0 -326
- package/types/utils/replaceImportMetaEnv.d.ts +0 -3
- package/types/utils/replaceImportMetaEnv.js +0 -39
- package/types/utils/scopeHelpers.d.ts +0 -12
- package/types/utils/scopeHelpers.js +0 -580
- package/types/utils/traversalCache.d.ts +0 -4
- package/types/utils/traversalCache.js +0 -27
- package/types/utils/unwrapExpression.d.ts +0 -2
- package/types/utils/unwrapExpression.js +0 -57
- package/types/utils/unwrapSequence.d.ts +0 -8
- package/types/utils/unwrapSequence.js +0 -16
- package/types/utils/valueToLiteral.d.ts +0 -3
- package/types/utils/valueToLiteral.js +0 -63
- package/types/utils/visitors/JSXElementsRemover.d.ts +0 -3
- package/types/utils/visitors/JSXElementsRemover.js +0 -51
|
@@ -1,18 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
};
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
const Entrypoint_helpers_1 = require("./Entrypoint.helpers");
|
|
11
|
-
const EvaluatedEntrypoint_1 = require("./EvaluatedEntrypoint");
|
|
12
|
-
const AbortError_1 = require("./actions/AbortError");
|
|
13
|
-
const BaseAction_1 = require("./actions/BaseAction");
|
|
14
|
-
const UnprocessedEntrypointError_1 = require("./actions/UnprocessedEntrypointError");
|
|
15
|
-
const parseRequest_1 = require("../utils/parseRequest");
|
|
1
|
+
import fs from 'node:fs';
|
|
2
|
+
import { invariant } from 'ts-invariant';
|
|
3
|
+
import { BaseEntrypoint } from './BaseEntrypoint';
|
|
4
|
+
import { isSuperSet, mergeOnly } from './Entrypoint.helpers';
|
|
5
|
+
import { EvaluatedEntrypoint } from './EvaluatedEntrypoint';
|
|
6
|
+
import { AbortError } from './actions/AbortError';
|
|
7
|
+
import { BaseAction } from './actions/BaseAction';
|
|
8
|
+
import { UnprocessedEntrypointError } from './actions/UnprocessedEntrypointError';
|
|
9
|
+
import { stripQueryAndHash } from '../utils/parseRequest';
|
|
16
10
|
const EMPTY_FILE = '=== empty file ===';
|
|
17
11
|
const DEFAULT_ACTION_CONTEXT = Symbol('defaultActionContext');
|
|
18
12
|
function hasLoop(name, parent, processed = []) {
|
|
@@ -27,32 +21,45 @@ function hasLoop(name, parent, processed = []) {
|
|
|
27
21
|
}
|
|
28
22
|
return false;
|
|
29
23
|
}
|
|
30
|
-
class Entrypoint extends
|
|
24
|
+
export class Entrypoint extends BaseEntrypoint {
|
|
31
25
|
initialCode;
|
|
32
26
|
resolveTasks;
|
|
33
27
|
dependencies;
|
|
34
28
|
invalidationDependencies;
|
|
35
29
|
invalidateOnDependencyChange;
|
|
30
|
+
skipCacheInvalidation;
|
|
36
31
|
evaluated = false;
|
|
37
32
|
loadedAndParsed;
|
|
38
33
|
onSupersedeHandlers = [];
|
|
39
34
|
actionsCache = new Map();
|
|
35
|
+
// Tracks how many times resolveImports has settled with `resolved: null`
|
|
36
|
+
// for a given source. Bundler resolvers can return null transiently early
|
|
37
|
+
// in a build (loader context for that file isn't registered yet); after a
|
|
38
|
+
// bounded number of retries we accept the null as authoritative.
|
|
39
|
+
#resolveTaskNullAttempts = new Map();
|
|
40
|
+
static RESOLVE_TASK_MAX_NULL_ATTEMPTS = 2;
|
|
40
41
|
#hasWywMetadata = false;
|
|
42
|
+
#hasTransformResult = false;
|
|
41
43
|
#isProcessing = false;
|
|
42
44
|
#pendingOnly = null;
|
|
45
|
+
#preevalResult = null;
|
|
46
|
+
#processingPromise = null;
|
|
47
|
+
#resolveProcessing = null;
|
|
43
48
|
#supersededWith = null;
|
|
44
49
|
#transformResultCode = null;
|
|
45
|
-
constructor(services, parents, initialCode, name, only, exports, evaluatedOnly, loadedAndParsed, resolveTasks = new Map(), dependencies = new Map(), invalidationDependencies = new Map(), invalidateOnDependencyChange = new Set(), generation = 1) {
|
|
50
|
+
constructor(services, parents, initialCode, name, only, exports, evaluatedOnly, loadedAndParsed, resolveTasks = new Map(), dependencies = new Map(), invalidationDependencies = new Map(), invalidateOnDependencyChange = new Set(), generation = 1, skipCacheInvalidation = false) {
|
|
46
51
|
super(services, evaluatedOnly, exports, generation, name, only, parents, dependencies, invalidationDependencies, invalidateOnDependencyChange);
|
|
47
52
|
this.initialCode = initialCode;
|
|
48
53
|
this.resolveTasks = resolveTasks;
|
|
49
54
|
this.dependencies = dependencies;
|
|
50
55
|
this.invalidationDependencies = invalidationDependencies;
|
|
51
56
|
this.invalidateOnDependencyChange = invalidateOnDependencyChange;
|
|
57
|
+
this.skipCacheInvalidation = skipCacheInvalidation;
|
|
52
58
|
this.loadedAndParsed =
|
|
53
59
|
loadedAndParsed ??
|
|
54
60
|
services.loadAndParseFn(services, name, initialCode, parents[0]?.log ?? services.log);
|
|
55
|
-
if (this.
|
|
61
|
+
if (!this.skipCacheInvalidation &&
|
|
62
|
+
this.loadedAndParsed.code !== undefined) {
|
|
56
63
|
services.cache.invalidateIfChanged(name, this.loadedAndParsed.code, undefined, this.initialCode === undefined ? 'fs' : 'loaded');
|
|
57
64
|
}
|
|
58
65
|
const code = this.loadedAndParsed.evaluator === 'ignored'
|
|
@@ -72,24 +79,18 @@ class Entrypoint extends BaseEntrypoint_1.BaseEntrypoint {
|
|
|
72
79
|
get transformedCode() {
|
|
73
80
|
return (this.#transformResultCode ?? this.supersededWith?.transformedCode ?? null);
|
|
74
81
|
}
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
82
|
+
get transformed() {
|
|
83
|
+
return (this.#hasTransformResult || this.supersededWith?.transformed || false);
|
|
84
|
+
}
|
|
85
|
+
get isProcessing() {
|
|
86
|
+
return this.#isProcessing;
|
|
87
|
+
}
|
|
88
|
+
static createRoot(services, name, only, loadedCode, options = {}) {
|
|
89
|
+
const created = Entrypoint.create(services, null, name, only, loadedCode, options);
|
|
90
|
+
invariant(created !== 'loop', 'loop detected');
|
|
78
91
|
return created;
|
|
79
92
|
}
|
|
80
|
-
|
|
81
|
-
* Creates an entrypoint for the specified file.
|
|
82
|
-
* If there is already an entrypoint for this file, there will be four possible outcomes:
|
|
83
|
-
* 1. If `loadedCode` is specified and is different from the one that was used to create the existing entrypoint,
|
|
84
|
-
* the existing entrypoint will be superseded by a new one and all cached results for it will be invalidated.
|
|
85
|
-
* It can happen if the file was changed and the watcher notified us about it, or we received a new version
|
|
86
|
-
* of the file from a loader whereas the previous one was loaded from the filesystem.
|
|
87
|
-
* The new entrypoint will be returned.
|
|
88
|
-
* 2. If `only` is subset of the existing entrypoint's `only`, the existing entrypoint will be returned.
|
|
89
|
-
* 3. If `only` is superset of the existing entrypoint's `only`, the existing entrypoint will be superseded and the new one will be returned.
|
|
90
|
-
* 4. If a loop is detected, 'ignored' will be returned, the existing entrypoint will be superseded or not depending on the `only` value.
|
|
91
|
-
*/
|
|
92
|
-
static create(services, parent, name, only, loadedCode) {
|
|
93
|
+
static create(services, parent, name, only, loadedCode, options = {}) {
|
|
93
94
|
const { cache, eventEmitter } = services;
|
|
94
95
|
return eventEmitter.perf('createEntrypoint', () => {
|
|
95
96
|
const [status, entrypoint] = Entrypoint.innerCreate(services, parent
|
|
@@ -100,14 +101,14 @@ class Entrypoint extends BaseEntrypoint_1.BaseEntrypoint {
|
|
|
100
101
|
parents: parent.parents,
|
|
101
102
|
seqId: parent.seqId,
|
|
102
103
|
}
|
|
103
|
-
: null, name, only, loadedCode);
|
|
104
|
+
: null, name, only, loadedCode, options);
|
|
104
105
|
if (status !== 'cached') {
|
|
105
106
|
cache.add('entrypoints', name, entrypoint);
|
|
106
107
|
}
|
|
107
108
|
return status === 'loop' ? 'loop' : entrypoint;
|
|
108
109
|
});
|
|
109
110
|
}
|
|
110
|
-
static innerCreate(services, parent, name, only, loadedCode) {
|
|
111
|
+
static innerCreate(services, parent, name, only, loadedCode, options) {
|
|
111
112
|
const { cache } = services;
|
|
112
113
|
const cached = cache.get('entrypoints', name);
|
|
113
114
|
let changed = false;
|
|
@@ -116,7 +117,7 @@ class Entrypoint extends BaseEntrypoint_1.BaseEntrypoint {
|
|
|
116
117
|
}
|
|
117
118
|
else if (cached && cached.initialCode === undefined) {
|
|
118
119
|
try {
|
|
119
|
-
changed = cache.invalidateIfChanged(name,
|
|
120
|
+
changed = cache.invalidateIfChanged(name, fs.readFileSync(stripQueryAndHash(name), 'utf8'), undefined, 'fs');
|
|
120
121
|
}
|
|
121
122
|
catch {
|
|
122
123
|
changed = false;
|
|
@@ -127,10 +128,28 @@ class Entrypoint extends BaseEntrypoint_1.BaseEntrypoint {
|
|
|
127
128
|
}
|
|
128
129
|
const exports = cached?.exports;
|
|
129
130
|
const evaluatedOnly = changed ? [] : cached?.evaluatedOnly ?? [];
|
|
130
|
-
const mergedOnly =
|
|
131
|
+
const mergedOnly = options.mergeCachedOnly !== false && cached?.only
|
|
132
|
+
? mergeOnly(cached.only, only)
|
|
133
|
+
: [...only];
|
|
134
|
+
const reusableEvaluatedState = !changed && cached?.evaluated && cached.loadedAndParsed !== undefined;
|
|
135
|
+
const canReuseEvaluatedTransformResult = reusableEvaluatedState &&
|
|
136
|
+
isSuperSet(cached.evaluatedOnly, mergedOnly) &&
|
|
137
|
+
cached.hasTransformResult &&
|
|
138
|
+
cached.loadedAndParsed !== undefined;
|
|
131
139
|
if (cached?.evaluated) {
|
|
132
140
|
cached.log('is already evaluated with', cached.evaluatedOnly);
|
|
133
141
|
}
|
|
142
|
+
if (canReuseEvaluatedTransformResult) {
|
|
143
|
+
const isLoop = parent && hasLoop(name, parent);
|
|
144
|
+
const reusedEntrypoint = new Entrypoint(services, parent ? [parent] : [], loadedCode, name, mergedOnly, exports, evaluatedOnly, cached.loadedAndParsed, undefined, cached.dependencies, cached.invalidationDependencies, cached.invalidateOnDependencyChange, cached.generation + 1, true);
|
|
145
|
+
reusedEntrypoint.reuseTransformResult(cached.transformResultCode, cached.hasWywMetadata);
|
|
146
|
+
if ('preevalResult' in cached &&
|
|
147
|
+
cached.preevalResult !== null &&
|
|
148
|
+
cached.preevalResult !== undefined) {
|
|
149
|
+
reusedEntrypoint.setPreevalResult(cached.preevalResult);
|
|
150
|
+
}
|
|
151
|
+
return [isLoop ? 'loop' : 'cached', reusedEntrypoint];
|
|
152
|
+
}
|
|
134
153
|
if (!changed && cached && !cached.evaluated) {
|
|
135
154
|
const isLoop = parent && hasLoop(name, parent);
|
|
136
155
|
if (isLoop) {
|
|
@@ -139,23 +158,33 @@ class Entrypoint extends BaseEntrypoint_1.BaseEntrypoint {
|
|
|
139
158
|
if (parent && !cached.parents.map((p) => p.name).includes(parent.name)) {
|
|
140
159
|
cached.parents.push(parent);
|
|
141
160
|
}
|
|
142
|
-
if (
|
|
161
|
+
if (isSuperSet(cached.only, mergedOnly)) {
|
|
143
162
|
cached.log('is cached', name);
|
|
144
163
|
return [isLoop ? 'loop' : 'cached', cached];
|
|
145
164
|
}
|
|
146
165
|
cached.log('is cached, but with different `only` %o (the cached one %o)', only, cached?.only);
|
|
147
166
|
if (cached.#isProcessing) {
|
|
167
|
+
if (parent === null) {
|
|
168
|
+
cached.log('is being processed during root request, supersede immediately (%o -> %o)', cached.only, mergedOnly);
|
|
169
|
+
return [isLoop ? 'loop' : 'created', cached.supersede(mergedOnly)];
|
|
170
|
+
}
|
|
148
171
|
cached.deferOnlySupersede(mergedOnly);
|
|
149
172
|
cached.log('is being processed, defer supersede (%o -> %o)', cached.only, mergedOnly);
|
|
150
173
|
return [isLoop ? 'loop' : 'cached', cached];
|
|
151
174
|
}
|
|
152
175
|
return [isLoop ? 'loop' : 'created', cached.supersede(mergedOnly)];
|
|
153
176
|
}
|
|
154
|
-
const newEntrypoint = new Entrypoint(services, parent ? [parent] : [], loadedCode, name, mergedOnly, exports, evaluatedOnly, undefined, cached && 'resolveTasks' in cached ? cached.resolveTasks : undefined, cached && 'dependencies' in cached ? cached.dependencies : undefined, cached && 'invalidationDependencies' in cached
|
|
177
|
+
const newEntrypoint = new Entrypoint(services, parent ? [parent] : [], loadedCode, name, mergedOnly, exports, evaluatedOnly, reusableEvaluatedState ? cached.loadedAndParsed : undefined, cached && 'resolveTasks' in cached ? cached.resolveTasks : undefined, cached && 'dependencies' in cached ? cached.dependencies : undefined, cached && 'invalidationDependencies' in cached
|
|
155
178
|
? cached.invalidationDependencies
|
|
156
179
|
: undefined, cached && 'invalidateOnDependencyChange' in cached
|
|
157
180
|
? cached.invalidateOnDependencyChange
|
|
158
181
|
: undefined, cached ? cached.generation + 1 : 1);
|
|
182
|
+
if (reusableEvaluatedState &&
|
|
183
|
+
'preevalResult' in cached &&
|
|
184
|
+
cached.preevalResult !== null &&
|
|
185
|
+
cached.preevalResult !== undefined) {
|
|
186
|
+
newEntrypoint.setPreevalResult(cached.preevalResult);
|
|
187
|
+
}
|
|
159
188
|
if (cached && !cached.evaluated) {
|
|
160
189
|
cached.log('is cached, but with different code');
|
|
161
190
|
cached.supersede(newEntrypoint);
|
|
@@ -171,15 +200,32 @@ class Entrypoint extends BaseEntrypoint_1.BaseEntrypoint {
|
|
|
171
200
|
this.invalidationDependencies.set(dependency.source, dependency);
|
|
172
201
|
}
|
|
173
202
|
addResolveTask(name, dependency) {
|
|
174
|
-
|
|
203
|
+
// Bounded retry of transient null resolutions. The first time a
|
|
204
|
+
// resolveTask settles to null, evict it from the cache so the next
|
|
205
|
+
// consumer re-attempts the resolver. After RESOLVE_TASK_MAX_NULL_ATTEMPTS
|
|
206
|
+
// failures the entry stays cached so we don't thrash. Successful (non-null)
|
|
207
|
+
// resolutions remain cached normally; this branch only ever fires for null.
|
|
208
|
+
const tracked = dependency.then((resolved) => {
|
|
209
|
+
if (resolved.resolved !== null) {
|
|
210
|
+
return resolved;
|
|
211
|
+
}
|
|
212
|
+
const attempts = (this.#resolveTaskNullAttempts.get(name) ?? 0) + 1;
|
|
213
|
+
this.#resolveTaskNullAttempts.set(name, attempts);
|
|
214
|
+
if (attempts < Entrypoint.RESOLVE_TASK_MAX_NULL_ATTEMPTS &&
|
|
215
|
+
this.resolveTasks.get(name) === tracked) {
|
|
216
|
+
this.resolveTasks.delete(name);
|
|
217
|
+
}
|
|
218
|
+
return resolved;
|
|
219
|
+
});
|
|
220
|
+
this.resolveTasks.set(name, tracked);
|
|
175
221
|
}
|
|
176
222
|
applyDeferredSupersede() {
|
|
177
223
|
if (this.#supersededWith || this.#pendingOnly === null) {
|
|
178
224
|
return null;
|
|
179
225
|
}
|
|
180
|
-
const mergedOnly =
|
|
226
|
+
const mergedOnly = mergeOnly(this.only, this.#pendingOnly);
|
|
181
227
|
this.#pendingOnly = null;
|
|
182
|
-
if (
|
|
228
|
+
if (isSuperSet(this.only, mergedOnly)) {
|
|
183
229
|
return null;
|
|
184
230
|
}
|
|
185
231
|
this.log('apply deferred supersede (%o -> %o)', this.only, mergedOnly);
|
|
@@ -190,17 +236,22 @@ class Entrypoint extends BaseEntrypoint_1.BaseEntrypoint {
|
|
|
190
236
|
assertNotSuperseded() {
|
|
191
237
|
if (this.supersededWith) {
|
|
192
238
|
this.log('superseded');
|
|
193
|
-
throw new
|
|
239
|
+
throw new AbortError('superseded');
|
|
194
240
|
}
|
|
195
241
|
}
|
|
196
242
|
assertTransformed() {
|
|
197
243
|
if (this.transformedCode === null) {
|
|
198
244
|
this.log('not transformed');
|
|
199
|
-
throw new
|
|
245
|
+
throw new UnprocessedEntrypointError(this.supersededWith ?? this);
|
|
200
246
|
}
|
|
201
247
|
}
|
|
202
248
|
beginProcessing() {
|
|
203
249
|
this.#isProcessing = true;
|
|
250
|
+
if (!this.#processingPromise) {
|
|
251
|
+
this.#processingPromise = new Promise((resolve) => {
|
|
252
|
+
this.#resolveProcessing = resolve;
|
|
253
|
+
});
|
|
254
|
+
}
|
|
204
255
|
}
|
|
205
256
|
createAction(actionType, data, abortSignal = null, actionContext = DEFAULT_ACTION_CONTEXT) {
|
|
206
257
|
if (!this.actionsCache.has(actionType)) {
|
|
@@ -215,7 +266,7 @@ class Entrypoint extends BaseEntrypoint_1.BaseEntrypoint {
|
|
|
215
266
|
if (cached && !cached.abortSignal?.aborted) {
|
|
216
267
|
return cached;
|
|
217
268
|
}
|
|
218
|
-
const newAction = new
|
|
269
|
+
const newAction = new BaseAction(actionType, this.services, this, data, abortSignal, actionContext);
|
|
219
270
|
cache.set(data, newAction);
|
|
220
271
|
this.services.eventEmitter.entrypointEvent(this.seqId, {
|
|
221
272
|
type: 'actionCreated',
|
|
@@ -228,18 +279,29 @@ class Entrypoint extends BaseEntrypoint_1.BaseEntrypoint {
|
|
|
228
279
|
return Entrypoint.create(this.services, this, name, only, loadedCode);
|
|
229
280
|
}
|
|
230
281
|
createEvaluated() {
|
|
231
|
-
const evaluatedOnly =
|
|
282
|
+
const evaluatedOnly = mergeOnly(this.evaluatedOnly, this.only);
|
|
232
283
|
this.log('create EvaluatedEntrypoint for %o', evaluatedOnly);
|
|
233
|
-
const evaluated = new
|
|
284
|
+
const evaluated = new EvaluatedEntrypoint(this.services, evaluatedOnly, this.exportsProxy, this.generation + 1, this.name, this.only, this.parents, this.dependencies, this.invalidationDependencies, this.invalidateOnDependencyChange);
|
|
234
285
|
evaluated.initialCode = this.initialCode;
|
|
286
|
+
evaluated.hasTransformResult = this.#hasTransformResult;
|
|
287
|
+
evaluated.hasWywMetadata = this.#hasWywMetadata;
|
|
288
|
+
evaluated.loadedAndParsed = this.loadedAndParsed;
|
|
289
|
+
evaluated.preevalResult = this.#preevalResult;
|
|
290
|
+
evaluated.transformResultCode = this.#transformResultCode;
|
|
235
291
|
return evaluated;
|
|
236
292
|
}
|
|
237
293
|
endProcessing() {
|
|
238
294
|
this.#isProcessing = false;
|
|
295
|
+
this.#resolveProcessing?.();
|
|
296
|
+
this.#resolveProcessing = null;
|
|
297
|
+
this.#processingPromise = null;
|
|
239
298
|
}
|
|
240
299
|
getDependency(name) {
|
|
241
300
|
return this.dependencies.get(name);
|
|
242
301
|
}
|
|
302
|
+
getPreevalResult() {
|
|
303
|
+
return this.#preevalResult;
|
|
304
|
+
}
|
|
243
305
|
getInvalidationDependency(name) {
|
|
244
306
|
return this.invalidationDependencies.get(name);
|
|
245
307
|
}
|
|
@@ -252,6 +314,14 @@ class Entrypoint extends BaseEntrypoint_1.BaseEntrypoint {
|
|
|
252
314
|
hasWywMetadata() {
|
|
253
315
|
return this.#hasWywMetadata;
|
|
254
316
|
}
|
|
317
|
+
waitForProcessing() {
|
|
318
|
+
return this.#processingPromise ?? Promise.resolve();
|
|
319
|
+
}
|
|
320
|
+
reuseTransformResult(code, hasWywMetadata) {
|
|
321
|
+
this.#hasTransformResult = true;
|
|
322
|
+
this.#hasWywMetadata = hasWywMetadata;
|
|
323
|
+
this.#transformResultCode = code;
|
|
324
|
+
}
|
|
255
325
|
onSupersede(callback) {
|
|
256
326
|
if (this.#supersededWith) {
|
|
257
327
|
callback(this.#supersededWith);
|
|
@@ -266,6 +336,7 @@ class Entrypoint extends BaseEntrypoint_1.BaseEntrypoint {
|
|
|
266
336
|
};
|
|
267
337
|
}
|
|
268
338
|
setTransformResult(res) {
|
|
339
|
+
this.#hasTransformResult = true;
|
|
269
340
|
this.#hasWywMetadata = Boolean(res?.metadata);
|
|
270
341
|
this.#transformResultCode = res?.code ?? null;
|
|
271
342
|
this.services.eventEmitter.entrypointEvent(this.seqId, {
|
|
@@ -273,24 +344,30 @@ class Entrypoint extends BaseEntrypoint_1.BaseEntrypoint {
|
|
|
273
344
|
type: 'setTransformResult',
|
|
274
345
|
});
|
|
275
346
|
}
|
|
347
|
+
setPreevalResult(result) {
|
|
348
|
+
this.#preevalResult = result;
|
|
349
|
+
}
|
|
276
350
|
deferOnlySupersede(only) {
|
|
277
351
|
this.#pendingOnly = this.#pendingOnly
|
|
278
|
-
?
|
|
352
|
+
? mergeOnly(this.#pendingOnly, only)
|
|
279
353
|
: [...only];
|
|
280
354
|
}
|
|
281
355
|
supersede(newOnlyOrEntrypoint) {
|
|
282
356
|
this.#pendingOnly = null;
|
|
283
|
-
const
|
|
284
|
-
|
|
285
|
-
|
|
357
|
+
const widensOnly = !(newOnlyOrEntrypoint instanceof Entrypoint);
|
|
358
|
+
const newEntrypoint = widensOnly
|
|
359
|
+
? new Entrypoint(this.services, this.parents, this.initialCode, this.name, newOnlyOrEntrypoint, this.exports, this.evaluatedOnly, this.loadedAndParsed, this.resolveTasks, this.dependencies, this.invalidationDependencies, this.invalidateOnDependencyChange, this.generation + 1)
|
|
360
|
+
: newOnlyOrEntrypoint;
|
|
286
361
|
this.services.eventEmitter.entrypointEvent(this.seqId, {
|
|
287
362
|
type: 'superseded',
|
|
288
363
|
with: newEntrypoint.seqId,
|
|
289
364
|
});
|
|
290
365
|
this.log('superseded by %s (%o -> %o)', newEntrypoint.name, this.only, newEntrypoint.only);
|
|
366
|
+
if (widensOnly) {
|
|
367
|
+
newEntrypoint.#preevalResult = this.#preevalResult;
|
|
368
|
+
}
|
|
291
369
|
this.#supersededWith = newEntrypoint;
|
|
292
370
|
this.onSupersedeHandlers.forEach((handler) => handler(newEntrypoint));
|
|
293
371
|
return newEntrypoint;
|
|
294
372
|
}
|
|
295
373
|
}
|
|
296
|
-
exports.Entrypoint = Entrypoint;
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type { File } from '@babel/types';
|
|
3
|
-
import type { Debugger, Evaluator } from '@wyw-in-js/shared';
|
|
1
|
+
import type { Debugger, Evaluator, TransformEngineOptions } from '@wyw-in-js/shared';
|
|
4
2
|
import type { Services } from './types';
|
|
3
|
+
import type { WYWTransformMetadata } from '../utils/TransformMetadata';
|
|
4
|
+
export type ParsedAst = unknown;
|
|
5
5
|
export interface IEntrypointCode {
|
|
6
|
-
readonly ast:
|
|
6
|
+
readonly ast: ParsedAst;
|
|
7
7
|
code: string;
|
|
8
|
-
evalConfig:
|
|
8
|
+
evalConfig: TransformEngineOptions;
|
|
9
9
|
evaluator: Evaluator;
|
|
10
10
|
}
|
|
11
11
|
export interface IIgnoredEntrypoint {
|
|
12
|
-
readonly ast?:
|
|
12
|
+
readonly ast?: ParsedAst;
|
|
13
13
|
readonly code?: string;
|
|
14
14
|
evaluator: 'ignored';
|
|
15
15
|
reason: 'extension' | 'rule';
|
|
@@ -19,4 +19,26 @@ export interface IEntrypointDependency {
|
|
|
19
19
|
resolved: string | null;
|
|
20
20
|
source: string;
|
|
21
21
|
}
|
|
22
|
+
export interface IPreevalResult {
|
|
23
|
+
ast: ParsedAst | null;
|
|
24
|
+
baseCode?: string;
|
|
25
|
+
code: string;
|
|
26
|
+
dependencyNames?: string[];
|
|
27
|
+
evalCode?: string;
|
|
28
|
+
metadata: WYWTransformMetadata | null;
|
|
29
|
+
staticSideEffectImportLocals?: string[];
|
|
30
|
+
staticDependencies?: string[];
|
|
31
|
+
staticNullWYWMetaExtendsHelpers?: string[];
|
|
32
|
+
staticValueCache?: Map<string, unknown>;
|
|
33
|
+
staticValueCandidates?: Array<{
|
|
34
|
+
imports: Array<{
|
|
35
|
+
imported: 'default' | string;
|
|
36
|
+
importLocal?: string;
|
|
37
|
+
local: string;
|
|
38
|
+
source: string;
|
|
39
|
+
}>;
|
|
40
|
+
name: string;
|
|
41
|
+
source: string;
|
|
42
|
+
}>;
|
|
43
|
+
}
|
|
22
44
|
export type LoadAndParseFn = (services: Services, name: string, loadedCode: string | undefined, log: Debugger) => IEntrypointCode | IIgnoredEntrypoint;
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1
|
+
export {};
|
|
@@ -1,21 +1,32 @@
|
|
|
1
1
|
import type { Debugger } from '@wyw-in-js/shared';
|
|
2
2
|
import { BaseEntrypoint } from './BaseEntrypoint';
|
|
3
|
-
import type { IEntrypointDependency } from './Entrypoint.types';
|
|
4
|
-
|
|
3
|
+
import type { IEntrypointCode, IIgnoredEntrypoint, IEntrypointDependency, IPreevalResult } from './Entrypoint.types';
|
|
4
|
+
import type { ParentEntrypoint } from '../types';
|
|
5
|
+
export interface IEvaluatedEntrypoint extends ParentEntrypoint {
|
|
5
6
|
dependencies: Map<string, IEntrypointDependency>;
|
|
6
7
|
evaluated: true;
|
|
7
8
|
evaluatedOnly: string[];
|
|
8
9
|
exports: Record<string | symbol, unknown>;
|
|
9
10
|
generation: number;
|
|
11
|
+
hasTransformResult: boolean;
|
|
12
|
+
hasWywMetadata: boolean;
|
|
10
13
|
ignored: false;
|
|
11
14
|
initialCode?: string;
|
|
12
15
|
invalidationDependencies: Map<string, IEntrypointDependency>;
|
|
13
16
|
invalidateOnDependencyChange: Set<string>;
|
|
17
|
+
loadedAndParsed?: IEntrypointCode | IIgnoredEntrypoint;
|
|
14
18
|
log: Debugger;
|
|
15
19
|
only: string[];
|
|
20
|
+
preevalResult: IPreevalResult | null;
|
|
21
|
+
transformResultCode: string | null;
|
|
16
22
|
}
|
|
17
23
|
export declare class EvaluatedEntrypoint extends BaseEntrypoint implements IEvaluatedEntrypoint {
|
|
18
24
|
readonly evaluated = true;
|
|
19
25
|
readonly ignored = false;
|
|
26
|
+
hasTransformResult: boolean;
|
|
27
|
+
hasWywMetadata: boolean;
|
|
20
28
|
initialCode?: string;
|
|
29
|
+
loadedAndParsed?: IEntrypointCode | IIgnoredEntrypoint;
|
|
30
|
+
preevalResult: IPreevalResult | null;
|
|
31
|
+
transformResultCode: string | null;
|
|
21
32
|
}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
exports.EvaluatedEntrypoint = void 0;
|
|
4
|
-
const BaseEntrypoint_1 = require("./BaseEntrypoint");
|
|
5
|
-
class EvaluatedEntrypoint extends BaseEntrypoint_1.BaseEntrypoint {
|
|
1
|
+
import { BaseEntrypoint } from './BaseEntrypoint';
|
|
2
|
+
export class EvaluatedEntrypoint extends BaseEntrypoint {
|
|
6
3
|
evaluated = true;
|
|
7
4
|
ignored = false;
|
|
5
|
+
hasTransformResult = false;
|
|
6
|
+
hasWywMetadata = false;
|
|
8
7
|
initialCode;
|
|
8
|
+
loadedAndParsed;
|
|
9
|
+
preevalResult = null;
|
|
10
|
+
transformResultCode = null;
|
|
9
11
|
}
|
|
10
|
-
exports.EvaluatedEntrypoint = EvaluatedEntrypoint;
|
|
@@ -1,12 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.isAborted = exports.AbortError = void 0;
|
|
4
|
-
class AbortError extends Error {
|
|
1
|
+
export class AbortError extends Error {
|
|
5
2
|
constructor(reason) {
|
|
6
3
|
super(reason);
|
|
7
4
|
this.name = 'AbortError';
|
|
8
5
|
}
|
|
9
6
|
}
|
|
10
|
-
|
|
11
|
-
const isAborted = (value) => value instanceof AbortError;
|
|
12
|
-
exports.isAborted = isAborted;
|
|
7
|
+
export const isAborted = (value) => value instanceof AbortError;
|
|
@@ -1,11 +1,8 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.BaseAction = void 0;
|
|
4
1
|
/* eslint-disable no-plusplus */
|
|
5
|
-
|
|
6
|
-
|
|
2
|
+
import '../../utils/dispose-polyfill';
|
|
3
|
+
import { Pending } from '../types';
|
|
7
4
|
let actionIdx = 0;
|
|
8
|
-
class BaseAction {
|
|
5
|
+
export class BaseAction {
|
|
9
6
|
type;
|
|
10
7
|
services;
|
|
11
8
|
entrypoint;
|
|
@@ -13,7 +10,7 @@ class BaseAction {
|
|
|
13
10
|
abortSignal;
|
|
14
11
|
actionContext;
|
|
15
12
|
idx;
|
|
16
|
-
result =
|
|
13
|
+
result = Pending;
|
|
17
14
|
activeScenario = null;
|
|
18
15
|
activeScenarioError;
|
|
19
16
|
activeScenarioNextResults = [];
|
|
@@ -153,4 +150,3 @@ class BaseAction {
|
|
|
153
150
|
throw this.activeScenarioError;
|
|
154
151
|
}
|
|
155
152
|
}
|
|
156
|
-
exports.BaseAction = BaseAction;
|
|
@@ -1,13 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.isUnprocessedEntrypointError = exports.UnprocessedEntrypointError = void 0;
|
|
4
|
-
class UnprocessedEntrypointError extends Error {
|
|
1
|
+
export class UnprocessedEntrypointError extends Error {
|
|
5
2
|
entrypoint;
|
|
6
3
|
constructor(entrypoint) {
|
|
7
4
|
super(`Entrypoint ${entrypoint.idx} is not processed and can't be evaluated`);
|
|
8
5
|
this.entrypoint = entrypoint;
|
|
9
6
|
}
|
|
10
7
|
}
|
|
11
|
-
|
|
12
|
-
const isUnprocessedEntrypointError = (value) => value instanceof UnprocessedEntrypointError;
|
|
13
|
-
exports.isUnprocessedEntrypointError = isUnprocessedEntrypointError;
|
|
8
|
+
export const isUnprocessedEntrypointError = (value) => value instanceof UnprocessedEntrypointError;
|
|
@@ -1,9 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
exports.asyncActionRunner = asyncActionRunner;
|
|
4
|
-
exports.syncActionRunner = syncActionRunner;
|
|
5
|
-
const types_1 = require("../types");
|
|
6
|
-
const AbortError_1 = require("./AbortError");
|
|
1
|
+
import { Pending } from '../types';
|
|
2
|
+
import { AbortError } from './AbortError';
|
|
7
3
|
function getHandler(action, actionHandlers) {
|
|
8
4
|
const handler = actionHandlers[action.type];
|
|
9
5
|
if (!handler) {
|
|
@@ -15,8 +11,8 @@ function getHandler(action, actionHandlers) {
|
|
|
15
11
|
const getActionRef = (type, entrypoint) => `${type}@${entrypoint.ref}`;
|
|
16
12
|
const ACTION_ERROR = Symbol('ACTION_ERROR');
|
|
17
13
|
const isActionError = (e) => Array.isArray(e) && e[0] === ACTION_ERROR;
|
|
18
|
-
async function asyncActionRunner(action, actionHandlers, stack = [getActionRef(action.type, action.entrypoint)]) {
|
|
19
|
-
if (action.result !==
|
|
14
|
+
export async function asyncActionRunner(action, actionHandlers, stack = [getActionRef(action.type, action.entrypoint)]) {
|
|
15
|
+
if (action.result !== Pending) {
|
|
20
16
|
action.log('result is cached');
|
|
21
17
|
return action.result;
|
|
22
18
|
}
|
|
@@ -27,7 +23,7 @@ async function asyncActionRunner(action, actionHandlers, stack = [getActionRef(a
|
|
|
27
23
|
while (true) {
|
|
28
24
|
if (action.abortSignal?.aborted) {
|
|
29
25
|
action.log('action is aborted');
|
|
30
|
-
generator.throw(new
|
|
26
|
+
generator.throw(new AbortError(stack[0]));
|
|
31
27
|
}
|
|
32
28
|
const result = await (isActionError(actionResult)
|
|
33
29
|
? generator.throw(actionResult[1])
|
|
@@ -49,8 +45,8 @@ async function asyncActionRunner(action, actionHandlers, stack = [getActionRef(a
|
|
|
49
45
|
}
|
|
50
46
|
}
|
|
51
47
|
}
|
|
52
|
-
function syncActionRunner(action, actionHandlers, stack = [getActionRef(action.type, action.entrypoint)]) {
|
|
53
|
-
if (action.result !==
|
|
48
|
+
export function syncActionRunner(action, actionHandlers, stack = [getActionRef(action.type, action.entrypoint)]) {
|
|
49
|
+
if (action.result !== Pending) {
|
|
54
50
|
action.log('result is cached');
|
|
55
51
|
return action.result;
|
|
56
52
|
}
|
|
@@ -61,7 +57,7 @@ function syncActionRunner(action, actionHandlers, stack = [getActionRef(action.t
|
|
|
61
57
|
while (true) {
|
|
62
58
|
if (action.abortSignal?.aborted) {
|
|
63
59
|
action.log('action is aborted');
|
|
64
|
-
generator.throw(new
|
|
60
|
+
generator.throw(new AbortError(stack[0]));
|
|
65
61
|
}
|
|
66
62
|
const result = isActionError(actionResult)
|
|
67
63
|
? generator.throw(actionResult[1])
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { BabelFileResult } from '@babel/core';
|
|
2
1
|
import type { Replacements, Rules } from '@wyw-in-js/shared';
|
|
2
|
+
import type { RawSourceMap } from 'source-map';
|
|
3
3
|
import type { WYWTransformDiagnostic } from '../../utils/TransformDiagnostics';
|
|
4
4
|
import type { WYWTransformResultMetadata } from '../../utils/TransformMetadata';
|
|
5
5
|
export interface IExtracted {
|
|
@@ -10,7 +10,7 @@ export interface IExtracted {
|
|
|
10
10
|
}
|
|
11
11
|
export interface IWorkflowActionNonLinariaResult {
|
|
12
12
|
code: string;
|
|
13
|
-
sourceMap:
|
|
13
|
+
sourceMap: RawSourceMap | null | undefined;
|
|
14
14
|
}
|
|
15
15
|
export interface IWorkflowActionLinariaResult extends IExtracted, IWorkflowActionNonLinariaResult {
|
|
16
16
|
dependencies: string[];
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1
|
+
export {};
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import type { File } from '@babel/types';
|
|
2
1
|
export type BarrelSkipReason = 'custom-evaluator' | 'empty' | 'ignored' | 'impure' | 'namespace-barrel' | 'unknown-star';
|
|
3
2
|
export type BarrelBlockedReason = 'ambiguous' | 'cycle' | 'namespace-barrel' | 'unknown-star' | 'unresolved';
|
|
4
3
|
export type BarrelResolvedBinding = {
|
|
@@ -39,4 +38,3 @@ export type RawBarrelManifest = {
|
|
|
39
38
|
kind: 'barrel';
|
|
40
39
|
reexports: RawBarrelReexport[];
|
|
41
40
|
};
|
|
42
|
-
export declare function analyzeBarrelFile(ast: File): BarrelManifestCacheEntry | RawBarrelManifest;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,17 +1,16 @@
|
|
|
1
|
-
import type { SyncScenarioForAction, ICollectAction, IEvalAction, IExtractAction, IWorkflowAction } from '../types';
|
|
2
|
-
import { explodeReexports } from './explodeReexports';
|
|
1
|
+
import type { SyncScenarioForAction, ICollectAction, IEvalAction, IExplodeReexportsAction, IExtractAction, IWorkflowAction } from '../types';
|
|
3
2
|
import { getExports } from './getExports';
|
|
4
|
-
import {
|
|
3
|
+
import { processEntrypointAsync } from './processEntrypoint';
|
|
5
4
|
import { processImports } from './processImports';
|
|
6
5
|
import { transform } from './transform';
|
|
7
6
|
export declare const baseProcessingHandlers: {
|
|
8
7
|
collect: (this: ICollectAction) => SyncScenarioForAction<ICollectAction>;
|
|
9
8
|
evalFile: (this: IEvalAction) => SyncScenarioForAction<IEvalAction>;
|
|
9
|
+
explodeReexports: (this: IExplodeReexportsAction) => SyncScenarioForAction<IExplodeReexportsAction>;
|
|
10
10
|
extract: (this: IExtractAction) => SyncScenarioForAction<IExtractAction>;
|
|
11
11
|
workflow: (this: IWorkflowAction) => SyncScenarioForAction<IWorkflowAction>;
|
|
12
|
-
explodeReexports: typeof explodeReexports;
|
|
13
12
|
getExports: typeof getExports;
|
|
14
|
-
processEntrypoint: typeof
|
|
13
|
+
processEntrypoint: typeof processEntrypointAsync;
|
|
15
14
|
processImports: typeof processImports;
|
|
16
15
|
transform: typeof transform;
|
|
17
16
|
};
|