@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,153 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.createFileReporter = void 0;
|
|
7
|
-
var _fs = require("fs");
|
|
8
|
-
var _path = _interopRequireDefault(require("path"));
|
|
9
|
-
var _EventEmitter = require("../utils/EventEmitter");
|
|
10
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
11
|
-
/* eslint-disable no-console */
|
|
12
|
-
|
|
13
|
-
const workingDir = process.cwd();
|
|
14
|
-
function replacer(_key, value) {
|
|
15
|
-
if (typeof value === 'string' && _path.default.isAbsolute(value)) {
|
|
16
|
-
return _path.default.relative(workingDir, value);
|
|
17
|
-
}
|
|
18
|
-
if (value instanceof Map) {
|
|
19
|
-
return Array.from(value.entries()).reduce((obj, [k, v]) => {
|
|
20
|
-
const key = replacer(k, k);
|
|
21
|
-
return {
|
|
22
|
-
...obj,
|
|
23
|
-
[key]: replacer(key, v)
|
|
24
|
-
};
|
|
25
|
-
}, {});
|
|
26
|
-
}
|
|
27
|
-
return value;
|
|
28
|
-
}
|
|
29
|
-
function printTimings(timings, startedAt, sourceRoot) {
|
|
30
|
-
if (timings.size === 0) {
|
|
31
|
-
return;
|
|
32
|
-
}
|
|
33
|
-
console.log(`\nTimings:`);
|
|
34
|
-
console.log(` Total: ${(performance.now() - startedAt).toFixed()}ms`);
|
|
35
|
-
Array.from(timings.entries()).forEach(([label, byLabel]) => {
|
|
36
|
-
console.log(`\n By ${label}:`);
|
|
37
|
-
const array = Array.from(byLabel.entries());
|
|
38
|
-
// array.sort(([, a], [, b]) => b - a);
|
|
39
|
-
array.sort(([a], [b]) => a.localeCompare(b)).forEach(([value, time]) => {
|
|
40
|
-
const name = value.startsWith(sourceRoot) ? _path.default.relative(sourceRoot, value) : value;
|
|
41
|
-
console.log(` ${name}: ${time}ms`);
|
|
42
|
-
});
|
|
43
|
-
});
|
|
44
|
-
}
|
|
45
|
-
const writeJSONl = (stream, data) => {
|
|
46
|
-
stream.write(`${JSON.stringify(data, replacer)}\n`);
|
|
47
|
-
};
|
|
48
|
-
const createFileReporter = (options = false) => {
|
|
49
|
-
if (!options || !options.dir) {
|
|
50
|
-
return {
|
|
51
|
-
emitter: _EventEmitter.EventEmitter.dummy,
|
|
52
|
-
onDone: () => {}
|
|
53
|
-
};
|
|
54
|
-
}
|
|
55
|
-
const reportFolder = (0, _fs.existsSync)(options.dir) ? options.dir : (0, _fs.mkdirSync)(options.dir, {
|
|
56
|
-
recursive: true
|
|
57
|
-
});
|
|
58
|
-
if (!reportFolder) {
|
|
59
|
-
throw new Error(`Could not create directory ${options.dir}`);
|
|
60
|
-
}
|
|
61
|
-
const actionStream = (0, _fs.createWriteStream)(_path.default.join(options.dir, 'actions.jsonl'));
|
|
62
|
-
const dependenciesStream = (0, _fs.createWriteStream)(_path.default.join(options.dir, 'dependencies.jsonl'));
|
|
63
|
-
const entrypointStream = (0, _fs.createWriteStream)(_path.default.join(options.dir, 'entrypoints.jsonl'));
|
|
64
|
-
const startedAt = performance.now();
|
|
65
|
-
const timings = new Map();
|
|
66
|
-
const addTiming = (label, key, value) => {
|
|
67
|
-
if (!timings.has(label)) {
|
|
68
|
-
timings.set(label, new Map());
|
|
69
|
-
}
|
|
70
|
-
const forLabel = timings.get(label);
|
|
71
|
-
forLabel.set(key, Math.round((forLabel.get(key) || 0) + value));
|
|
72
|
-
};
|
|
73
|
-
const processDependencyEvent = ({
|
|
74
|
-
file,
|
|
75
|
-
only,
|
|
76
|
-
imports,
|
|
77
|
-
fileIdx
|
|
78
|
-
}) => {
|
|
79
|
-
writeJSONl(dependenciesStream, {
|
|
80
|
-
file,
|
|
81
|
-
only,
|
|
82
|
-
imports,
|
|
83
|
-
fileIdx
|
|
84
|
-
});
|
|
85
|
-
};
|
|
86
|
-
const processSingleEvent = meta => {
|
|
87
|
-
if (meta.type === 'dependency') {
|
|
88
|
-
processDependencyEvent(meta);
|
|
89
|
-
}
|
|
90
|
-
};
|
|
91
|
-
const startTimes = new Map();
|
|
92
|
-
const onEvent = (meta, type) => {
|
|
93
|
-
if (type === 'single') {
|
|
94
|
-
processSingleEvent(meta);
|
|
95
|
-
return;
|
|
96
|
-
}
|
|
97
|
-
if (type === 'start') {
|
|
98
|
-
Object.entries(meta).forEach(([label, value]) => {
|
|
99
|
-
startTimes.set(`${label}\0${value}`, performance.now());
|
|
100
|
-
});
|
|
101
|
-
} else {
|
|
102
|
-
Object.entries(meta).forEach(([label, value]) => {
|
|
103
|
-
const startTime = startTimes.get(`${label}\0${value}`);
|
|
104
|
-
if (startTime) {
|
|
105
|
-
addTiming(label, String(value), performance.now() - startTime);
|
|
106
|
-
}
|
|
107
|
-
});
|
|
108
|
-
}
|
|
109
|
-
};
|
|
110
|
-
let actionId = 0;
|
|
111
|
-
const onAction = (...args) => {
|
|
112
|
-
if ((0, _EventEmitter.isOnActionStartArgs)(args)) {
|
|
113
|
-
const [, timestamp, type, idx, entrypointRef] = args;
|
|
114
|
-
writeJSONl(actionStream, {
|
|
115
|
-
actionId,
|
|
116
|
-
entrypointRef,
|
|
117
|
-
idx,
|
|
118
|
-
startedAt: timestamp,
|
|
119
|
-
type
|
|
120
|
-
});
|
|
121
|
-
|
|
122
|
-
// eslint-disable-next-line no-plusplus
|
|
123
|
-
return actionId++;
|
|
124
|
-
}
|
|
125
|
-
const [result, timestamp, id, isAsync, error] = args;
|
|
126
|
-
writeJSONl(actionStream, {
|
|
127
|
-
actionId: id,
|
|
128
|
-
error,
|
|
129
|
-
finishedAt: timestamp,
|
|
130
|
-
isAsync,
|
|
131
|
-
result: `${result}ed`
|
|
132
|
-
});
|
|
133
|
-
return id;
|
|
134
|
-
};
|
|
135
|
-
const onEntrypointEvent = (emitterId, timestamp, event) => {
|
|
136
|
-
entrypointStream.write(`${JSON.stringify([emitterId, timestamp, event])}\n`);
|
|
137
|
-
};
|
|
138
|
-
const emitter = new _EventEmitter.EventEmitter(onEvent, onAction, onEntrypointEvent);
|
|
139
|
-
return {
|
|
140
|
-
emitter,
|
|
141
|
-
onDone: sourceRoot => {
|
|
142
|
-
if (options.print) {
|
|
143
|
-
printTimings(timings, startedAt, sourceRoot);
|
|
144
|
-
console.log('\nMemory usage:', process.memoryUsage());
|
|
145
|
-
}
|
|
146
|
-
actionStream.end();
|
|
147
|
-
dependenciesStream.end();
|
|
148
|
-
timings.clear();
|
|
149
|
-
}
|
|
150
|
-
};
|
|
151
|
-
};
|
|
152
|
-
exports.createFileReporter = createFileReporter;
|
|
153
|
-
//# sourceMappingURL=fileReporter.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"fileReporter.js","names":["_fs","require","_path","_interopRequireDefault","_EventEmitter","e","__esModule","default","workingDir","process","cwd","replacer","_key","value","path","isAbsolute","relative","Map","Array","from","entries","reduce","obj","k","v","key","printTimings","timings","startedAt","sourceRoot","size","console","log","performance","now","toFixed","forEach","label","byLabel","array","sort","a","b","localeCompare","time","name","startsWith","writeJSONl","stream","data","write","JSON","stringify","createFileReporter","options","dir","emitter","EventEmitter","dummy","onDone","reportFolder","existsSync","mkdirSync","recursive","Error","actionStream","createWriteStream","join","dependenciesStream","entrypointStream","addTiming","has","set","forLabel","get","Math","round","processDependencyEvent","file","only","imports","fileIdx","processSingleEvent","meta","type","startTimes","onEvent","Object","startTime","String","actionId","onAction","args","isOnActionStartArgs","timestamp","idx","entrypointRef","result","id","isAsync","error","finishedAt","onEntrypointEvent","emitterId","event","print","memoryUsage","end","clear","exports"],"sources":["../../src/debug/fileReporter.ts"],"sourcesContent":["/* eslint-disable no-console */\nimport { createWriteStream, existsSync, mkdirSync } from 'fs';\nimport path from 'path';\n\nimport type {\n OnAction,\n OnEvent,\n OnActionFinishArgs,\n OnActionStartArgs,\n OnEntrypointEvent,\n} from '../utils/EventEmitter';\nimport { EventEmitter, isOnActionStartArgs } from '../utils/EventEmitter';\n\ntype Timings = Map<string, Map<string, number>>;\n\nexport interface IFileReporterOptions {\n dir?: string;\n print?: boolean;\n}\n\nexport interface IProcessedEvent {\n file: string;\n fileIdx: string;\n imports: { from: string; what: string[] }[];\n only: string[];\n phase?: 'initial' | 'rewritten';\n type: 'dependency';\n}\n\nexport interface IQueueActionEvent {\n action: string;\n args?: string[];\n datetime: Date;\n file: string;\n queueIdx: string;\n type: 'queue-action';\n}\n\nconst workingDir = process.cwd();\n\nfunction replacer(_key: string, value: unknown): unknown {\n if (typeof value === 'string' && path.isAbsolute(value)) {\n return path.relative(workingDir, value);\n }\n\n if (value instanceof Map) {\n return Array.from(value.entries()).reduce((obj, [k, v]) => {\n const key = replacer(k, k) as string;\n return {\n ...obj,\n [key]: replacer(key, v),\n };\n }, {});\n }\n\n return value;\n}\n\nfunction printTimings(timings: Timings, startedAt: number, sourceRoot: string) {\n if (timings.size === 0) {\n return;\n }\n\n console.log(`\\nTimings:`);\n console.log(` Total: ${(performance.now() - startedAt).toFixed()}ms`);\n\n Array.from(timings.entries()).forEach(([label, byLabel]) => {\n console.log(`\\n By ${label}:`);\n\n const array = Array.from(byLabel.entries());\n // array.sort(([, a], [, b]) => b - a);\n array\n .sort(([a], [b]) => a.localeCompare(b))\n .forEach(([value, time]) => {\n const name = value.startsWith(sourceRoot)\n ? path.relative(sourceRoot, value)\n : value;\n console.log(` ${name}: ${time}ms`);\n });\n });\n}\n\nconst writeJSONl = (stream: NodeJS.WritableStream, data: unknown) => {\n stream.write(`${JSON.stringify(data, replacer)}\\n`);\n};\n\nexport const createFileReporter = (\n options: IFileReporterOptions | false = false\n) => {\n if (!options || !options.dir) {\n return {\n emitter: EventEmitter.dummy,\n onDone: () => {},\n };\n }\n\n const reportFolder = existsSync(options.dir)\n ? options.dir\n : mkdirSync(options.dir, {\n recursive: true,\n });\n\n if (!reportFolder) {\n throw new Error(`Could not create directory ${options.dir}`);\n }\n\n const actionStream = createWriteStream(\n path.join(options.dir, 'actions.jsonl')\n );\n\n const dependenciesStream = createWriteStream(\n path.join(options.dir, 'dependencies.jsonl')\n );\n\n const entrypointStream = createWriteStream(\n path.join(options.dir, 'entrypoints.jsonl')\n );\n\n const startedAt = performance.now();\n const timings: Timings = new Map();\n const addTiming = (label: string, key: string, value: number) => {\n if (!timings.has(label)) {\n timings.set(label, new Map());\n }\n\n const forLabel = timings.get(label)!;\n forLabel.set(key, Math.round((forLabel.get(key) || 0) + value));\n };\n\n const processDependencyEvent = ({\n file,\n only,\n imports,\n fileIdx,\n }: IProcessedEvent) => {\n writeJSONl(dependenciesStream, {\n file,\n only,\n imports,\n fileIdx,\n });\n };\n\n const processSingleEvent = (\n meta: Record<string, unknown> | IProcessedEvent | IQueueActionEvent\n ) => {\n if (meta.type === 'dependency') {\n processDependencyEvent(meta as IProcessedEvent);\n }\n };\n\n const startTimes = new Map<string, number>();\n\n const onEvent: OnEvent = (meta, type) => {\n if (type === 'single') {\n processSingleEvent(meta);\n return;\n }\n\n if (type === 'start') {\n Object.entries(meta).forEach(([label, value]) => {\n startTimes.set(`${label}\\0${value}`, performance.now());\n });\n } else {\n Object.entries(meta).forEach(([label, value]) => {\n const startTime = startTimes.get(`${label}\\0${value}`);\n if (startTime) {\n addTiming(label, String(value), performance.now() - startTime);\n }\n });\n }\n };\n\n let actionId = 0;\n const onAction: OnAction = (\n ...args: OnActionStartArgs | OnActionFinishArgs\n ) => {\n if (isOnActionStartArgs(args)) {\n const [, timestamp, type, idx, entrypointRef] = args;\n writeJSONl(actionStream, {\n actionId,\n entrypointRef,\n idx,\n startedAt: timestamp,\n type,\n });\n\n // eslint-disable-next-line no-plusplus\n return actionId++;\n }\n\n const [result, timestamp, id, isAsync, error] = args;\n writeJSONl(actionStream, {\n actionId: id,\n error,\n finishedAt: timestamp,\n isAsync,\n result: `${result}ed`,\n });\n\n return id;\n };\n\n const onEntrypointEvent: OnEntrypointEvent = (\n emitterId,\n timestamp,\n event\n ) => {\n entrypointStream.write(\n `${JSON.stringify([emitterId, timestamp, event])}\\n`\n );\n };\n\n const emitter = new EventEmitter(onEvent, onAction, onEntrypointEvent);\n\n return {\n emitter,\n onDone: (sourceRoot: string) => {\n if (options.print) {\n printTimings(timings, startedAt, sourceRoot);\n\n console.log('\\nMemory usage:', process.memoryUsage());\n }\n\n actionStream.end();\n dependenciesStream.end();\n timings.clear();\n },\n };\n};\n"],"mappings":";;;;;;AACA,IAAAA,GAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAC,sBAAA,CAAAF,OAAA;AASA,IAAAG,aAAA,GAAAH,OAAA;AAA0E,SAAAE,uBAAAE,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAX1E;;AAsCA,MAAMG,UAAU,GAAGC,OAAO,CAACC,GAAG,CAAC,CAAC;AAEhC,SAASC,QAAQA,CAACC,IAAY,EAAEC,KAAc,EAAW;EACvD,IAAI,OAAOA,KAAK,KAAK,QAAQ,IAAIC,aAAI,CAACC,UAAU,CAACF,KAAK,CAAC,EAAE;IACvD,OAAOC,aAAI,CAACE,QAAQ,CAACR,UAAU,EAAEK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GAAGA,MAAM;IACnB,CAAC,CAAC;IAEF,OAAOC,EAAE;EACX,CAAC;EAED,MAAMI,iBAAoC,GAAGA,CAC3CC,SAAS,EACTT,SAAS,EACTU,KAAK,KACF;IACHnC,gBAAgB,CAACnB,KAAK,CACpB,GAAGC,IAAI,CAACC,SAAS,CAAC,CAACmD,SAAS,EAAET,SAAS,EAAEU,KAAK,CAAC,CAAC,IAClD,CAAC;EACH,CAAC;EAED,MAAMhD,OAAO,GAAG,IAAIC,0BAAY,CAAC6B,OAAO,EAAEK,QAAQ,EAAEW,iBAAiB,CAAC;EAEtE,OAAO;IACL9C,OAAO;IACPG,MAAM,EAAG9B,UAAkB,IAAK;MAC9B,IAAIyB,OAAO,CAACmD,KAAK,EAAE;QACjB/E,YAAY,CAACC,OAAO,EAAEC,SAAS,EAAEC,UAAU,CAAC;QAE5CE,OAAO,CAACC,GAAG,CAAC,iBAAiB,EAAEvB,OAAO,CAACiG,WAAW,CAAC,CAAC,CAAC;MACvD;MAEAzC,YAAY,CAAC0C,GAAG,CAAC,CAAC;MAClBvC,kBAAkB,CAACuC,GAAG,CAAC,CAAC;MACxBhF,OAAO,CAACiF,KAAK,CAAC,CAAC;IACjB;EACF,CAAC;AACH,CAAC;AAACC,OAAA,CAAAxD,kBAAA,GAAAA,kBAAA","ignoreList":[]}
|
package/lib/evaluators/index.js
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = evaluate;
|
|
7
|
-
var _module = require("../module");
|
|
8
|
-
/**
|
|
9
|
-
* This file is an entry point for module evaluation for getting lazy dependencies.
|
|
10
|
-
*/
|
|
11
|
-
|
|
12
|
-
function evaluate(services, entrypoint) {
|
|
13
|
-
const m = new _module.Module(services, entrypoint);
|
|
14
|
-
m.evaluate();
|
|
15
|
-
return {
|
|
16
|
-
value: entrypoint.exports,
|
|
17
|
-
dependencies: m.dependencies
|
|
18
|
-
};
|
|
19
|
-
}
|
|
20
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["_module","require","evaluate","services","entrypoint","m","Module","value","exports","dependencies"],"sources":["../../src/evaluators/index.ts"],"sourcesContent":["/**\n * This file is an entry point for module evaluation for getting lazy dependencies.\n */\n\nimport { Module } from '../module';\nimport type { Entrypoint } from '../transform/Entrypoint';\nimport type { Services } from '../transform/types';\n\nexport interface IEvaluateResult {\n dependencies: string[];\n value: Record<string | symbol, unknown>;\n}\n\nexport default function evaluate(\n services: Services,\n entrypoint: Entrypoint\n): IEvaluateResult {\n const m = new Module(services, entrypoint);\n\n m.evaluate();\n\n return {\n value: entrypoint.exports,\n dependencies: m.dependencies,\n };\n}\n"],"mappings":";;;;;;AAIA,IAAAA,OAAA,GAAAC,OAAA;AAJA;AACA;AACA;;AAWe,SAASC,QAAQA,CAC9BC,QAAkB,EAClBC,UAAsB,EACL;EACjB,MAAMC,CAAC,GAAG,IAAIC,cAAM,CAACH,QAAQ,EAAEC,UAAU,CAAC;EAE1CC,CAAC,CAACH,QAAQ,CAAC,CAAC;EAEZ,OAAO;IACLK,KAAK,EAAEH,UAAU,CAACI,OAAO;IACzBC,YAAY,EAAEJ,CAAC,CAACI;EAClB,CAAC;AACH","ignoreList":[]}
|
package/lib/index.js
DELETED
|
@@ -1,286 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
var _exportNames = {
|
|
7
|
-
slugify: true,
|
|
8
|
-
createFileReporter: true,
|
|
9
|
-
babelTransformPlugin: true,
|
|
10
|
-
preeval: true,
|
|
11
|
-
createTransformManifest: true,
|
|
12
|
-
getTransformMetadata: true,
|
|
13
|
-
stringifyTransformManifest: true,
|
|
14
|
-
toTransformResultMetadata: true,
|
|
15
|
-
withTransformMetadata: true,
|
|
16
|
-
collectTransformDiagnostics: true,
|
|
17
|
-
Module: true,
|
|
18
|
-
DefaultModuleImplementation: true,
|
|
19
|
-
shaker: true,
|
|
20
|
-
transform: true,
|
|
21
|
-
isUnprocessedEntrypointError: true,
|
|
22
|
-
UnprocessedEntrypointError: true,
|
|
23
|
-
EvaluatedEntrypoint: true,
|
|
24
|
-
parseFile: true,
|
|
25
|
-
baseHandlers: true,
|
|
26
|
-
prepareCode: true,
|
|
27
|
-
Entrypoint: true,
|
|
28
|
-
transformUrl: true,
|
|
29
|
-
asyncResolveImports: true,
|
|
30
|
-
syncResolveImports: true,
|
|
31
|
-
loadWywOptions: true,
|
|
32
|
-
withDefaultServices: true,
|
|
33
|
-
EventEmitter: true,
|
|
34
|
-
isNode: true,
|
|
35
|
-
getFileIdx: true,
|
|
36
|
-
applyProcessors: true,
|
|
37
|
-
getVisitorKeys: true,
|
|
38
|
-
peek: true,
|
|
39
|
-
TransformCacheCollection: true,
|
|
40
|
-
findIdentifiers: true
|
|
41
|
-
};
|
|
42
|
-
Object.defineProperty(exports, "DefaultModuleImplementation", {
|
|
43
|
-
enumerable: true,
|
|
44
|
-
get: function () {
|
|
45
|
-
return _module.DefaultModuleImplementation;
|
|
46
|
-
}
|
|
47
|
-
});
|
|
48
|
-
Object.defineProperty(exports, "Entrypoint", {
|
|
49
|
-
enumerable: true,
|
|
50
|
-
get: function () {
|
|
51
|
-
return _Entrypoint2.Entrypoint;
|
|
52
|
-
}
|
|
53
|
-
});
|
|
54
|
-
Object.defineProperty(exports, "EvaluatedEntrypoint", {
|
|
55
|
-
enumerable: true,
|
|
56
|
-
get: function () {
|
|
57
|
-
return _EvaluatedEntrypoint.EvaluatedEntrypoint;
|
|
58
|
-
}
|
|
59
|
-
});
|
|
60
|
-
Object.defineProperty(exports, "EventEmitter", {
|
|
61
|
-
enumerable: true,
|
|
62
|
-
get: function () {
|
|
63
|
-
return _EventEmitter.EventEmitter;
|
|
64
|
-
}
|
|
65
|
-
});
|
|
66
|
-
Object.defineProperty(exports, "Module", {
|
|
67
|
-
enumerable: true,
|
|
68
|
-
get: function () {
|
|
69
|
-
return _module.Module;
|
|
70
|
-
}
|
|
71
|
-
});
|
|
72
|
-
Object.defineProperty(exports, "TransformCacheCollection", {
|
|
73
|
-
enumerable: true,
|
|
74
|
-
get: function () {
|
|
75
|
-
return _cache.TransformCacheCollection;
|
|
76
|
-
}
|
|
77
|
-
});
|
|
78
|
-
Object.defineProperty(exports, "UnprocessedEntrypointError", {
|
|
79
|
-
enumerable: true,
|
|
80
|
-
get: function () {
|
|
81
|
-
return _UnprocessedEntrypointError.UnprocessedEntrypointError;
|
|
82
|
-
}
|
|
83
|
-
});
|
|
84
|
-
Object.defineProperty(exports, "applyProcessors", {
|
|
85
|
-
enumerable: true,
|
|
86
|
-
get: function () {
|
|
87
|
-
return _getTagProcessor.applyProcessors;
|
|
88
|
-
}
|
|
89
|
-
});
|
|
90
|
-
Object.defineProperty(exports, "asyncResolveImports", {
|
|
91
|
-
enumerable: true,
|
|
92
|
-
get: function () {
|
|
93
|
-
return _resolveImports.asyncResolveImports;
|
|
94
|
-
}
|
|
95
|
-
});
|
|
96
|
-
Object.defineProperty(exports, "babelTransformPlugin", {
|
|
97
|
-
enumerable: true,
|
|
98
|
-
get: function () {
|
|
99
|
-
return _babelTransform.default;
|
|
100
|
-
}
|
|
101
|
-
});
|
|
102
|
-
Object.defineProperty(exports, "baseHandlers", {
|
|
103
|
-
enumerable: true,
|
|
104
|
-
get: function () {
|
|
105
|
-
return _generators.baseHandlers;
|
|
106
|
-
}
|
|
107
|
-
});
|
|
108
|
-
Object.defineProperty(exports, "collectTransformDiagnostics", {
|
|
109
|
-
enumerable: true,
|
|
110
|
-
get: function () {
|
|
111
|
-
return _TransformDiagnostics.collectTransformDiagnostics;
|
|
112
|
-
}
|
|
113
|
-
});
|
|
114
|
-
Object.defineProperty(exports, "createFileReporter", {
|
|
115
|
-
enumerable: true,
|
|
116
|
-
get: function () {
|
|
117
|
-
return _fileReporter.createFileReporter;
|
|
118
|
-
}
|
|
119
|
-
});
|
|
120
|
-
Object.defineProperty(exports, "createTransformManifest", {
|
|
121
|
-
enumerable: true,
|
|
122
|
-
get: function () {
|
|
123
|
-
return _TransformMetadata.createTransformManifest;
|
|
124
|
-
}
|
|
125
|
-
});
|
|
126
|
-
Object.defineProperty(exports, "findIdentifiers", {
|
|
127
|
-
enumerable: true,
|
|
128
|
-
get: function () {
|
|
129
|
-
return _findIdentifiers.findIdentifiers;
|
|
130
|
-
}
|
|
131
|
-
});
|
|
132
|
-
Object.defineProperty(exports, "getFileIdx", {
|
|
133
|
-
enumerable: true,
|
|
134
|
-
get: function () {
|
|
135
|
-
return _getFileIdx.getFileIdx;
|
|
136
|
-
}
|
|
137
|
-
});
|
|
138
|
-
Object.defineProperty(exports, "getTransformMetadata", {
|
|
139
|
-
enumerable: true,
|
|
140
|
-
get: function () {
|
|
141
|
-
return _TransformMetadata.getTransformMetadata;
|
|
142
|
-
}
|
|
143
|
-
});
|
|
144
|
-
Object.defineProperty(exports, "getVisitorKeys", {
|
|
145
|
-
enumerable: true,
|
|
146
|
-
get: function () {
|
|
147
|
-
return _getVisitorKeys.getVisitorKeys;
|
|
148
|
-
}
|
|
149
|
-
});
|
|
150
|
-
Object.defineProperty(exports, "isNode", {
|
|
151
|
-
enumerable: true,
|
|
152
|
-
get: function () {
|
|
153
|
-
return _isNode.isNode;
|
|
154
|
-
}
|
|
155
|
-
});
|
|
156
|
-
Object.defineProperty(exports, "isUnprocessedEntrypointError", {
|
|
157
|
-
enumerable: true,
|
|
158
|
-
get: function () {
|
|
159
|
-
return _UnprocessedEntrypointError.isUnprocessedEntrypointError;
|
|
160
|
-
}
|
|
161
|
-
});
|
|
162
|
-
Object.defineProperty(exports, "loadWywOptions", {
|
|
163
|
-
enumerable: true,
|
|
164
|
-
get: function () {
|
|
165
|
-
return _loadWywOptions.loadWywOptions;
|
|
166
|
-
}
|
|
167
|
-
});
|
|
168
|
-
Object.defineProperty(exports, "parseFile", {
|
|
169
|
-
enumerable: true,
|
|
170
|
-
get: function () {
|
|
171
|
-
return _Entrypoint.parseFile;
|
|
172
|
-
}
|
|
173
|
-
});
|
|
174
|
-
Object.defineProperty(exports, "peek", {
|
|
175
|
-
enumerable: true,
|
|
176
|
-
get: function () {
|
|
177
|
-
return _peek.peek;
|
|
178
|
-
}
|
|
179
|
-
});
|
|
180
|
-
Object.defineProperty(exports, "preeval", {
|
|
181
|
-
enumerable: true,
|
|
182
|
-
get: function () {
|
|
183
|
-
return _preeval.default;
|
|
184
|
-
}
|
|
185
|
-
});
|
|
186
|
-
Object.defineProperty(exports, "prepareCode", {
|
|
187
|
-
enumerable: true,
|
|
188
|
-
get: function () {
|
|
189
|
-
return _transform2.prepareCode;
|
|
190
|
-
}
|
|
191
|
-
});
|
|
192
|
-
Object.defineProperty(exports, "shaker", {
|
|
193
|
-
enumerable: true,
|
|
194
|
-
get: function () {
|
|
195
|
-
return _shaker.default;
|
|
196
|
-
}
|
|
197
|
-
});
|
|
198
|
-
Object.defineProperty(exports, "slugify", {
|
|
199
|
-
enumerable: true,
|
|
200
|
-
get: function () {
|
|
201
|
-
return _shared.slugify;
|
|
202
|
-
}
|
|
203
|
-
});
|
|
204
|
-
Object.defineProperty(exports, "stringifyTransformManifest", {
|
|
205
|
-
enumerable: true,
|
|
206
|
-
get: function () {
|
|
207
|
-
return _TransformMetadata.stringifyTransformManifest;
|
|
208
|
-
}
|
|
209
|
-
});
|
|
210
|
-
Object.defineProperty(exports, "syncResolveImports", {
|
|
211
|
-
enumerable: true,
|
|
212
|
-
get: function () {
|
|
213
|
-
return _resolveImports.syncResolveImports;
|
|
214
|
-
}
|
|
215
|
-
});
|
|
216
|
-
Object.defineProperty(exports, "toTransformResultMetadata", {
|
|
217
|
-
enumerable: true,
|
|
218
|
-
get: function () {
|
|
219
|
-
return _TransformMetadata.toTransformResultMetadata;
|
|
220
|
-
}
|
|
221
|
-
});
|
|
222
|
-
Object.defineProperty(exports, "transform", {
|
|
223
|
-
enumerable: true,
|
|
224
|
-
get: function () {
|
|
225
|
-
return _transform.transform;
|
|
226
|
-
}
|
|
227
|
-
});
|
|
228
|
-
Object.defineProperty(exports, "transformUrl", {
|
|
229
|
-
enumerable: true,
|
|
230
|
-
get: function () {
|
|
231
|
-
return _createStylisPreprocessor.transformUrl;
|
|
232
|
-
}
|
|
233
|
-
});
|
|
234
|
-
Object.defineProperty(exports, "withDefaultServices", {
|
|
235
|
-
enumerable: true,
|
|
236
|
-
get: function () {
|
|
237
|
-
return _withDefaultServices.withDefaultServices;
|
|
238
|
-
}
|
|
239
|
-
});
|
|
240
|
-
Object.defineProperty(exports, "withTransformMetadata", {
|
|
241
|
-
enumerable: true,
|
|
242
|
-
get: function () {
|
|
243
|
-
return _TransformMetadata.withTransformMetadata;
|
|
244
|
-
}
|
|
245
|
-
});
|
|
246
|
-
var _shared = require("@wyw-in-js/shared");
|
|
247
|
-
var _fileReporter = require("./debug/fileReporter");
|
|
248
|
-
var _babelTransform = _interopRequireDefault(require("./plugins/babel-transform"));
|
|
249
|
-
var _preeval = _interopRequireDefault(require("./plugins/preeval"));
|
|
250
|
-
var _TransformMetadata = require("./utils/TransformMetadata");
|
|
251
|
-
var _TransformDiagnostics = require("./utils/TransformDiagnostics");
|
|
252
|
-
var _module = require("./module");
|
|
253
|
-
var _shaker = _interopRequireDefault(require("./shaker"));
|
|
254
|
-
var _transform = require("./transform");
|
|
255
|
-
var _UnprocessedEntrypointError = require("./transform/actions/UnprocessedEntrypointError");
|
|
256
|
-
var _types = require("./types");
|
|
257
|
-
Object.keys(_types).forEach(function (key) {
|
|
258
|
-
if (key === "default" || key === "__esModule") return;
|
|
259
|
-
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
260
|
-
if (key in exports && exports[key] === _types[key]) return;
|
|
261
|
-
Object.defineProperty(exports, key, {
|
|
262
|
-
enumerable: true,
|
|
263
|
-
get: function () {
|
|
264
|
-
return _types[key];
|
|
265
|
-
}
|
|
266
|
-
});
|
|
267
|
-
});
|
|
268
|
-
var _EvaluatedEntrypoint = require("./transform/EvaluatedEntrypoint");
|
|
269
|
-
var _Entrypoint = require("./transform/Entrypoint.helpers");
|
|
270
|
-
var _generators = require("./transform/generators");
|
|
271
|
-
var _transform2 = require("./transform/generators/transform");
|
|
272
|
-
var _Entrypoint2 = require("./transform/Entrypoint");
|
|
273
|
-
var _createStylisPreprocessor = require("./transform/generators/createStylisPreprocessor");
|
|
274
|
-
var _resolveImports = require("./transform/generators/resolveImports");
|
|
275
|
-
var _loadWywOptions = require("./transform/helpers/loadWywOptions");
|
|
276
|
-
var _withDefaultServices = require("./transform/helpers/withDefaultServices");
|
|
277
|
-
var _EventEmitter = require("./utils/EventEmitter");
|
|
278
|
-
var _isNode = require("./utils/isNode");
|
|
279
|
-
var _getFileIdx = require("./utils/getFileIdx");
|
|
280
|
-
var _getTagProcessor = require("./utils/getTagProcessor");
|
|
281
|
-
var _getVisitorKeys = require("./utils/getVisitorKeys");
|
|
282
|
-
var _peek = require("./utils/peek");
|
|
283
|
-
var _cache = require("./cache");
|
|
284
|
-
var _findIdentifiers = require("./utils/findIdentifiers");
|
|
285
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
286
|
-
//# sourceMappingURL=index.js.map
|
package/lib/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["_shared","require","_fileReporter","_babelTransform","_interopRequireDefault","_preeval","_TransformMetadata","_TransformDiagnostics","_module","_shaker","_transform","_UnprocessedEntrypointError","_types","Object","keys","forEach","key","prototype","hasOwnProperty","call","_exportNames","exports","defineProperty","enumerable","get","_EvaluatedEntrypoint","_Entrypoint","_generators","_transform2","_Entrypoint2","_createStylisPreprocessor","_resolveImports","_loadWywOptions","_withDefaultServices","_EventEmitter","_isNode","_getFileIdx","_getTagProcessor","_getVisitorKeys","_peek","_cache","_findIdentifiers","e","__esModule","default"],"sources":["../src/index.ts"],"sourcesContent":["export { slugify } from '@wyw-in-js/shared';\n\nexport { createFileReporter } from './debug/fileReporter';\nexport type { IFileReporterOptions } from './debug/fileReporter';\nexport { default as babelTransformPlugin } from './plugins/babel-transform';\nexport { default as preeval } from './plugins/preeval';\nexport {\n createTransformManifest,\n getTransformMetadata,\n stringifyTransformManifest,\n toTransformResultMetadata,\n withTransformMetadata,\n} from './utils/TransformMetadata';\nexport type {\n WYWTransformManifest,\n WYWTransformMetadata,\n WYWTransformProcessorMetadata,\n WYWTransformResultMetadata,\n} from './utils/TransformMetadata';\nexport { collectTransformDiagnostics } from './utils/TransformDiagnostics';\nexport type { WYWTransformDiagnostic } from './utils/TransformDiagnostics';\nexport { Module, DefaultModuleImplementation } from './module';\nexport { default as shaker } from './shaker';\nexport { transform } from './transform';\nexport {\n isUnprocessedEntrypointError,\n UnprocessedEntrypointError,\n} from './transform/actions/UnprocessedEntrypointError';\nexport * from './types';\nexport { EvaluatedEntrypoint } from './transform/EvaluatedEntrypoint';\nexport type { IEvaluatedEntrypoint } from './transform/EvaluatedEntrypoint';\nexport { parseFile } from './transform/Entrypoint.helpers';\nexport type { LoadAndParseFn } from './transform/Entrypoint.types';\nexport { baseHandlers } from './transform/generators';\nexport { prepareCode } from './transform/generators/transform';\nexport { Entrypoint } from './transform/Entrypoint';\nexport { transformUrl } from './transform/generators/createStylisPreprocessor';\nexport {\n asyncResolveImports,\n syncResolveImports,\n} from './transform/generators/resolveImports';\nexport { loadWywOptions } from './transform/helpers/loadWywOptions';\nexport { withDefaultServices } from './transform/helpers/withDefaultServices';\nexport type { Services } from './transform/types';\nexport { EventEmitter } from './utils/EventEmitter';\nexport type {\n EntrypointEvent,\n OnEvent,\n OnActionStartArgs,\n OnActionFinishArgs,\n} from './utils/EventEmitter';\nexport { isNode } from './utils/isNode';\nexport { getFileIdx } from './utils/getFileIdx';\nexport { applyProcessors } from './utils/getTagProcessor';\nexport { getVisitorKeys } from './utils/getVisitorKeys';\nexport type { VisitorKeys } from './utils/getVisitorKeys';\nexport { peek } from './utils/peek';\nexport { TransformCacheCollection } from './cache';\nexport { findIdentifiers } from './utils/findIdentifiers';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AAEA,IAAAC,aAAA,GAAAD,OAAA;AAEA,IAAAE,eAAA,GAAAC,sBAAA,CAAAH,OAAA;AACA,IAAAI,QAAA,GAAAD,sBAAA,CAAAH,OAAA;AACA,IAAAK,kBAAA,GAAAL,OAAA;AAaA,IAAAM,qBAAA,GAAAN,OAAA;AAEA,IAAAO,OAAA,GAAAP,OAAA;AACA,IAAAQ,OAAA,GAAAL,sBAAA,CAAAH,OAAA;AACA,IAAAS,UAAA,GAAAT,OAAA;AACA,IAAAU,2BAAA,GAAAV,OAAA;AAIA,IAAAW,MAAA,GAAAX,OAAA;AAAAY,MAAA,CAAAC,IAAA,CAAAF,MAAA,EAAAG,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAC,YAAA,EAAAJ,GAAA;EAAA,IAAAA,GAAA,IAAAK,OAAA,IAAAA,OAAA,CAAAL,GAAA,MAAAJ,MAAA,CAAAI,GAAA;EAAAH,MAAA,CAAAS,cAAA,CAAAD,OAAA,EAAAL,GAAA;IAAAO,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAZ,MAAA,CAAAI,GAAA;IA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