@fougere/core 0.5.0-alpha.1 → 0.7.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/README.md +1 -1
- package/dist/boot/Emissions.d.ts +14 -91
- package/dist/boot/Emissions.d.ts.map +1 -1
- package/dist/boot/Emissions.js +21 -118
- package/dist/boot/Emissions.js.map +1 -1
- package/dist/boot/ambient-port.d.ts +3 -24
- package/dist/boot/ambient-port.d.ts.map +1 -1
- package/dist/boot/ambient.als.d.ts.map +1 -1
- package/dist/boot/ambient.als.js +7 -12
- package/dist/boot/ambient.als.js.map +1 -1
- package/dist/boot/ambient.queue.d.ts +2 -5
- package/dist/boot/ambient.queue.d.ts.map +1 -1
- package/dist/boot/ambient.queue.js.map +1 -1
- package/dist/boot/apply.d.ts +1 -13
- package/dist/boot/apply.d.ts.map +1 -1
- package/dist/boot/apply.js +3 -15
- package/dist/boot/apply.js.map +1 -1
- package/dist/boot/auth.d.ts +6 -16
- package/dist/boot/auth.d.ts.map +1 -1
- package/dist/boot/boot.d.ts +5 -18
- package/dist/boot/boot.d.ts.map +1 -1
- package/dist/boot/boot.js +4 -11
- package/dist/boot/boot.js.map +1 -1
- package/dist/boot/bootstrap.d.ts.map +1 -1
- package/dist/boot/bootstrap.js +106 -163
- package/dist/boot/bootstrap.js.map +1 -1
- package/dist/boot/card.d.ts +5 -0
- package/dist/boot/card.d.ts.map +1 -0
- package/dist/boot/card.js +71 -0
- package/dist/boot/card.js.map +1 -0
- package/dist/boot/frame.d.ts +8 -32
- package/dist/boot/frame.d.ts.map +1 -1
- package/dist/boot/frame.js +23 -57
- package/dist/boot/frame.js.map +1 -1
- package/dist/boot/hosted.d.ts +3 -19
- package/dist/boot/hosted.d.ts.map +1 -1
- package/dist/boot/hosted.js +12 -17
- package/dist/boot/hosted.js.map +1 -1
- package/dist/boot/ownership.d.ts +5 -36
- package/dist/boot/ownership.d.ts.map +1 -1
- package/dist/boot/ownership.js +9 -49
- package/dist/boot/ownership.js.map +1 -1
- package/dist/boot/ports.d.ts +2 -15
- package/dist/boot/ports.d.ts.map +1 -1
- package/dist/boot/ports.js +1 -14
- package/dist/boot/ports.js.map +1 -1
- package/dist/boot/remote.d.ts +5 -38
- package/dist/boot/remote.d.ts.map +1 -1
- package/dist/boot/remote.js +8 -41
- package/dist/boot/remote.js.map +1 -1
- package/dist/boot/runner.d.ts +11 -0
- package/dist/boot/runner.d.ts.map +1 -0
- package/dist/boot/runner.js +13 -0
- package/dist/boot/runner.js.map +1 -0
- package/dist/boot/seed.d.ts +5 -32
- package/dist/boot/seed.d.ts.map +1 -1
- package/dist/boot/seed.js +10 -41
- package/dist/boot/seed.js.map +1 -1
- package/dist/boot/statement-drift.d.ts +4 -22
- package/dist/boot/statement-drift.d.ts.map +1 -1
- package/dist/boot/statement-drift.js +4 -9
- package/dist/boot/statement-drift.js.map +1 -1
- package/dist/boot/together.d.ts +8 -12
- package/dist/boot/together.d.ts.map +1 -1
- package/dist/boot/together.js +28 -65
- package/dist/boot/together.js.map +1 -1
- package/dist/boot/types.d.ts +36 -180
- package/dist/boot/types.d.ts.map +1 -1
- package/dist/builtin/config.d.ts +7 -0
- package/dist/builtin/config.d.ts.map +1 -0
- package/dist/builtin/config.js +15 -0
- package/dist/builtin/config.js.map +1 -0
- package/dist/{builtins → builtin}/logger.d.ts +4 -25
- package/dist/builtin/logger.d.ts.map +1 -0
- package/dist/{builtins → builtin}/logger.js +5 -32
- package/dist/builtin/logger.js.map +1 -0
- package/dist/config-loader.d.ts +9 -67
- package/dist/config-loader.d.ts.map +1 -1
- package/dist/config-loader.js +5 -18
- package/dist/config-loader.js.map +1 -1
- package/dist/contract.d.ts +13 -31
- package/dist/contract.d.ts.map +1 -1
- package/dist/contract.js +10 -26
- package/dist/contract.js.map +1 -1
- package/dist/crypto/encoding.d.ts +2 -15
- package/dist/crypto/encoding.d.ts.map +1 -1
- package/dist/crypto/encoding.js +2 -15
- package/dist/crypto/encoding.js.map +1 -1
- package/dist/crypto/node.d.ts.map +1 -1
- package/dist/crypto/node.js +1 -7
- package/dist/crypto/node.js.map +1 -1
- package/dist/crypto/port.d.ts +2 -18
- package/dist/crypto/port.d.ts.map +1 -1
- package/dist/crypto/port.js +1 -17
- package/dist/crypto/port.js.map +1 -1
- package/dist/crypto/webcrypto.d.ts.map +1 -1
- package/dist/crypto/webcrypto.js +1 -12
- package/dist/crypto/webcrypto.js.map +1 -1
- package/dist/declare.d.ts +41 -0
- package/dist/declare.d.ts.map +1 -0
- package/dist/{scan/declare.js → declare.js} +6 -31
- package/dist/declare.js.map +1 -0
- package/dist/define.d.ts +2 -3
- package/dist/define.d.ts.map +1 -1
- package/dist/define.js +2 -3
- package/dist/define.js.map +1 -1
- package/dist/descriptor/Fronds.d.ts +19 -0
- package/dist/descriptor/Fronds.d.ts.map +1 -0
- package/dist/descriptor/Fronds.js +40 -0
- package/dist/descriptor/Fronds.js.map +1 -0
- package/dist/descriptor/frond.d.ts +135 -0
- package/dist/descriptor/frond.d.ts.map +1 -0
- package/dist/{scan → descriptor}/frond.js.map +1 -1
- package/dist/dispatch/ArgumentResolver.d.ts +6 -3
- package/dist/dispatch/ArgumentResolver.d.ts.map +1 -1
- package/dist/dispatch/ArgumentResolver.js +48 -3
- package/dist/dispatch/ArgumentResolver.js.map +1 -1
- package/dist/dispatch/DispatchEvent.d.ts +2 -2
- package/dist/dispatch/DispatchEvent.d.ts.map +1 -1
- package/dist/dispatch/DispatchLifecycle.d.ts +1 -7
- package/dist/dispatch/DispatchLifecycle.d.ts.map +1 -1
- package/dist/dispatch/DispatchLifecycle.js +1 -7
- package/dist/dispatch/DispatchLifecycle.js.map +1 -1
- package/dist/dispatch/DispatchPort.d.ts +1 -1
- package/dist/dispatch/DispatchPort.d.ts.map +1 -1
- package/dist/dispatch/Dispatcher.d.ts +1 -1
- package/dist/dispatch/Dispatcher.d.ts.map +1 -1
- package/dist/dispatch/Dispatcher.js +2 -2
- package/dist/dispatch/Dispatcher.js.map +1 -1
- package/dist/{boot → dispatch}/HandlerFacade.d.ts +25 -38
- package/dist/dispatch/HandlerFacade.d.ts.map +1 -0
- package/dist/{boot → dispatch}/HandlerFacade.js +65 -74
- package/dist/dispatch/HandlerFacade.js.map +1 -0
- package/dist/dispatch/LocalRoutePolicy.d.ts +1 -1
- package/dist/dispatch/LocalRoutePolicy.d.ts.map +1 -1
- package/dist/dispatch/LocalRoutePolicy.js +4 -4
- package/dist/dispatch/LocalRoutePolicy.js.map +1 -1
- package/dist/dispatch/OperationRoute.d.ts +2 -2
- package/dist/dispatch/OperationRoute.d.ts.map +1 -1
- package/dist/dispatch/OutputView.d.ts +3 -2
- package/dist/dispatch/OutputView.d.ts.map +1 -1
- package/dist/dispatch/OutputView.js +19 -1
- package/dist/dispatch/OutputView.js.map +1 -1
- package/dist/dispatch/Route.d.ts +2 -3
- package/dist/dispatch/Route.d.ts.map +1 -1
- package/dist/dispatch/RoutePolicy.d.ts +1 -1
- package/dist/dispatch/RoutePolicy.d.ts.map +1 -1
- package/dist/dispatch/RouteRegistry.d.ts +1 -1
- package/dist/dispatch/RouteRegistry.d.ts.map +1 -1
- package/dist/dispatch/RouteRegistry.js +2 -2
- package/dist/dispatch/RouteRegistry.js.map +1 -1
- package/dist/dispatch/RouteResolver.d.ts +2 -4
- package/dist/dispatch/RouteResolver.d.ts.map +1 -1
- package/dist/dispatch/StorageGuard.d.ts +9 -8
- package/dist/dispatch/StorageGuard.d.ts.map +1 -1
- package/dist/dispatch/StorageGuard.js +66 -23
- package/dist/dispatch/StorageGuard.js.map +1 -1
- package/dist/dispatch/presenterArguments.d.ts +7 -0
- package/dist/dispatch/presenterArguments.d.ts.map +1 -0
- package/dist/dispatch/presenterArguments.js +12 -0
- package/dist/dispatch/presenterArguments.js.map +1 -0
- package/dist/dispatch/remoteRoutes.d.ts +7 -0
- package/dist/dispatch/remoteRoutes.d.ts.map +1 -0
- package/dist/dispatch/{RemoteRouteResolver.js → remoteRoutes.js} +6 -10
- package/dist/dispatch/remoteRoutes.js.map +1 -0
- package/dist/dispatch/routeNotFound.d.ts +9 -0
- package/dist/dispatch/routeNotFound.d.ts.map +1 -0
- package/dist/dispatch/routeNotFound.js +21 -0
- package/dist/dispatch/routeNotFound.js.map +1 -0
- package/dist/dispatch/validateInput.d.ts +5 -0
- package/dist/dispatch/validateInput.d.ts.map +1 -0
- package/dist/dispatch/validateInput.js +20 -0
- package/dist/dispatch/validateInput.js.map +1 -0
- package/dist/effective-operation.d.ts +6 -3
- package/dist/effective-operation.d.ts.map +1 -1
- package/dist/effective-operation.js +49 -27
- package/dist/effective-operation.js.map +1 -1
- package/dist/emit.d.ts +4 -42
- package/dist/emit.d.ts.map +1 -1
- package/dist/emit.js +3 -39
- package/dist/emit.js.map +1 -1
- package/dist/entry/facade.d.ts +8 -0
- package/dist/entry/facade.d.ts.map +1 -0
- package/dist/entry/facade.js +28 -0
- package/dist/entry/facade.js.map +1 -0
- package/dist/entry/transport.d.ts +5 -0
- package/dist/entry/transport.d.ts.map +1 -0
- package/dist/entry/transport.js +11 -0
- package/dist/entry/transport.js.map +1 -0
- package/dist/frond-config.d.ts +8 -71
- package/dist/frond-config.d.ts.map +1 -1
- package/dist/frond-config.js +1 -9
- package/dist/frond-config.js.map +1 -1
- package/dist/graph.d.ts +1 -1
- package/dist/graph.d.ts.map +1 -1
- package/dist/identity-keys.d.ts +2 -5
- package/dist/identity-keys.d.ts.map +1 -1
- package/dist/identity-keys.js +3 -16
- package/dist/identity-keys.js.map +1 -1
- package/dist/identity.d.ts +4 -30
- package/dist/identity.d.ts.map +1 -1
- package/dist/identity.js +11 -73
- package/dist/identity.js.map +1 -1
- package/dist/imports.d.ts +2 -8
- package/dist/imports.d.ts.map +1 -1
- package/dist/imports.js +1 -7
- package/dist/imports.js.map +1 -1
- package/dist/index.d.ts +28 -30
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +17 -22
- package/dist/index.js.map +1 -1
- package/dist/loader.d.ts +1 -8
- package/dist/loader.d.ts.map +1 -1
- package/dist/loader.js +1 -8
- package/dist/loader.js.map +1 -1
- package/dist/node.d.ts +2 -11
- package/dist/node.d.ts.map +1 -1
- package/dist/node.js +2 -11
- package/dist/node.js.map +1 -1
- package/dist/prefab/collector.d.ts +1 -22
- package/dist/prefab/collector.d.ts.map +1 -1
- package/dist/prefab/collector.js +1 -22
- package/dist/prefab/collector.js.map +1 -1
- package/dist/prefab/crud.d.ts +19 -35
- package/dist/prefab/crud.d.ts.map +1 -1
- package/dist/prefab/crud.js +39 -66
- package/dist/prefab/crud.js.map +1 -1
- package/dist/prefab/mirror.d.ts +5 -27
- package/dist/prefab/mirror.d.ts.map +1 -1
- package/dist/prefab/mirror.js +6 -24
- package/dist/prefab/mirror.js.map +1 -1
- package/dist/prefab/prefab.d.ts +1 -7
- package/dist/prefab/prefab.d.ts.map +1 -1
- package/dist/prefab/prefab.js +1 -7
- package/dist/prefab/prefab.js.map +1 -1
- package/dist/prefab/presenter.d.ts +2 -36
- package/dist/prefab/presenter.d.ts.map +1 -1
- package/dist/prefab/presenter.js +2 -36
- package/dist/prefab/presenter.js.map +1 -1
- package/dist/prefab/repository.d.ts +12 -80
- package/dist/prefab/repository.d.ts.map +1 -1
- package/dist/prefab/repository.js +22 -35
- package/dist/prefab/repository.js.map +1 -1
- package/dist/scan/adapters.d.ts +3 -0
- package/dist/scan/adapters.d.ts.map +1 -0
- package/dist/scan/adapters.js +25 -0
- package/dist/scan/adapters.js.map +1 -0
- package/dist/scan/bundling.d.ts +1 -12
- package/dist/scan/bundling.d.ts.map +1 -1
- package/dist/scan/bundling.js +1 -12
- package/dist/scan/bundling.js.map +1 -1
- package/dist/scan/conventions.d.ts +6 -40
- package/dist/scan/conventions.d.ts.map +1 -1
- package/dist/scan/conventions.js +5 -34
- package/dist/scan/conventions.js.map +1 -1
- package/dist/scan/emit.d.ts +2 -6
- package/dist/scan/emit.d.ts.map +1 -1
- package/dist/scan/emit.js +5 -39
- package/dist/scan/emit.js.map +1 -1
- package/dist/scan/handler-parser.d.ts +9 -76
- package/dist/scan/handler-parser.d.ts.map +1 -1
- package/dist/scan/handler-parser.js +28 -85
- package/dist/scan/handler-parser.js.map +1 -1
- package/dist/scan/result.d.ts +28 -0
- package/dist/scan/result.d.ts.map +1 -0
- package/dist/scan/result.js +2 -0
- package/dist/scan/result.js.map +1 -0
- package/dist/scan/scanner.d.ts +3 -28
- package/dist/scan/scanner.d.ts.map +1 -1
- package/dist/scan/scanner.js +36 -135
- package/dist/scan/scanner.js.map +1 -1
- package/dist/scan/statement.d.ts +1 -1
- package/dist/scan/statement.d.ts.map +1 -1
- package/dist/scan/statement.js +4 -30
- package/dist/scan/statement.js.map +1 -1
- package/dist/source.d.ts +41 -0
- package/dist/source.d.ts.map +1 -0
- package/dist/source.js +10 -0
- package/dist/source.js.map +1 -0
- package/dist/storage.d.ts +92 -0
- package/dist/storage.d.ts.map +1 -0
- package/dist/storage.js +50 -0
- package/dist/storage.js.map +1 -0
- package/dist/store.d.ts +18 -0
- package/dist/store.d.ts.map +1 -0
- package/dist/store.js +146 -0
- package/dist/store.js.map +1 -0
- package/dist/verify.d.ts +6 -39
- package/dist/verify.d.ts.map +1 -1
- package/dist/verify.js +19 -39
- package/dist/verify.js.map +1 -1
- package/dist/wire/CallLog.d.ts +32 -0
- package/dist/wire/CallLog.d.ts.map +1 -0
- package/dist/{contract → wire}/CallLog.js.map +1 -1
- package/dist/wire/Invocation.d.ts +32 -0
- package/dist/wire/Invocation.d.ts.map +1 -0
- package/dist/wire/Invocation.js +66 -0
- package/dist/wire/Invocation.js.map +1 -0
- package/dist/wire/RouteAddress.d.ts +24 -0
- package/dist/wire/RouteAddress.d.ts.map +1 -0
- package/dist/{contract → wire}/RouteAddress.js +7 -0
- package/dist/wire/RouteAddress.js.map +1 -0
- package/dist/wire/binding.d.ts +36 -0
- package/dist/wire/binding.d.ts.map +1 -0
- package/dist/{boot → wire}/binding.js +5 -62
- package/dist/wire/binding.js.map +1 -0
- package/dist/wire/call.d.ts +25 -172
- package/dist/wire/call.d.ts.map +1 -1
- package/dist/wire/call.js +15 -166
- package/dist/wire/call.js.map +1 -1
- package/dist/wire/drift.d.ts +3 -28
- package/dist/wire/drift.d.ts.map +1 -1
- package/dist/wire/drift.js +4 -23
- package/dist/wire/drift.js.map +1 -1
- package/dist/wire/errors.d.ts +4 -24
- package/dist/wire/errors.d.ts.map +1 -1
- package/dist/wire/errors.js +4 -24
- package/dist/wire/errors.js.map +1 -1
- package/dist/wire/http-error.d.ts +2 -13
- package/dist/wire/http-error.d.ts.map +1 -1
- package/dist/wire/http-error.js +5 -19
- package/dist/wire/http-error.js.map +1 -1
- package/dist/wire/loggerMiddleware.d.ts +2 -8
- package/dist/wire/loggerMiddleware.d.ts.map +1 -1
- package/dist/wire/loggerMiddleware.js +1 -7
- package/dist/wire/loggerMiddleware.js.map +1 -1
- package/dist/wire/middleware.d.ts +3 -7
- package/dist/wire/middleware.d.ts.map +1 -1
- package/dist/wire/middleware.js +1 -5
- package/dist/wire/middleware.js.map +1 -1
- package/dist/wire/operation.d.ts +12 -74
- package/dist/wire/operation.d.ts.map +1 -1
- package/dist/wire/operation.js +4 -66
- package/dist/wire/operation.js.map +1 -1
- package/dist/wire/signature.d.ts +37 -0
- package/dist/wire/signature.d.ts.map +1 -0
- package/dist/wire/signature.js +2 -0
- package/dist/wire/signature.js.map +1 -0
- package/package.json +3 -3
- package/src/boot/Emissions.ts +22 -119
- package/src/boot/ambient-port.ts +3 -24
- package/src/boot/ambient.als.ts +7 -12
- package/src/boot/ambient.queue.ts +2 -5
- package/src/boot/apply.ts +3 -15
- package/src/boot/auth.ts +6 -16
- package/src/boot/boot.ts +8 -23
- package/src/boot/bootstrap.ts +117 -173
- package/src/boot/card.ts +84 -0
- package/src/boot/frame.ts +31 -65
- package/src/boot/hosted.ts +15 -40
- package/src/boot/ownership.ts +14 -49
- package/src/boot/ports.ts +2 -15
- package/src/boot/remote.ts +11 -58
- package/src/boot/runner.ts +17 -0
- package/src/boot/seed.ts +11 -42
- package/src/boot/statement-drift.ts +10 -28
- package/src/boot/together.ts +38 -72
- package/src/boot/types.ts +36 -180
- package/src/{builtins → builtin}/config.ts +1 -7
- package/src/{builtins → builtin}/logger.ts +6 -39
- package/src/config-loader.ts +12 -71
- package/src/contract.ts +15 -39
- package/src/crypto/encoding.ts +2 -15
- package/src/crypto/node.ts +1 -7
- package/src/crypto/port.ts +2 -18
- package/src/crypto/webcrypto.ts +1 -12
- package/src/{scan/declare.ts → declare.ts} +11 -42
- package/src/define.ts +2 -3
- package/src/descriptor/Fronds.ts +47 -0
- package/src/descriptor/frond.ts +145 -0
- package/src/dispatch/ArgumentResolver.ts +54 -8
- package/src/dispatch/DispatchEvent.ts +2 -2
- package/src/dispatch/DispatchLifecycle.ts +1 -7
- package/src/dispatch/DispatchPort.ts +1 -1
- package/src/dispatch/Dispatcher.ts +3 -3
- package/src/dispatch/HandlerFacade.ts +231 -0
- package/src/dispatch/LocalRoutePolicy.ts +4 -4
- package/src/dispatch/OperationRoute.ts +2 -2
- package/src/dispatch/OutputView.ts +24 -2
- package/src/dispatch/Route.ts +2 -4
- package/src/dispatch/RoutePolicy.ts +1 -1
- package/src/dispatch/RouteRegistry.ts +2 -2
- package/src/dispatch/RouteResolver.ts +2 -4
- package/src/dispatch/StorageGuard.ts +75 -23
- package/src/dispatch/presenterArguments.ts +25 -0
- package/src/dispatch/{RemoteRouteResolver.ts → remoteRoutes.ts} +7 -9
- package/src/dispatch/routeNotFound.ts +33 -0
- package/src/dispatch/validateInput.ts +28 -0
- package/src/effective-operation.ts +60 -37
- package/src/emit.ts +5 -63
- package/src/entry/facade.ts +44 -0
- package/src/entry/transport.ts +16 -0
- package/src/frond-config.ts +8 -71
- package/src/graph.ts +1 -1
- package/src/identity-keys.ts +3 -16
- package/src/identity.ts +12 -80
- package/src/imports.ts +3 -32
- package/src/index.ts +28 -33
- package/src/loader.ts +2 -16
- package/src/node.ts +2 -11
- package/src/prefab/collector.ts +1 -22
- package/src/prefab/crud.ts +51 -90
- package/src/prefab/mirror.ts +9 -49
- package/src/prefab/prefab.ts +2 -21
- package/src/prefab/presenter.ts +2 -36
- package/src/prefab/repository.ts +32 -108
- package/src/scan/adapters.ts +32 -0
- package/src/scan/bundling.ts +1 -12
- package/src/scan/conventions.ts +6 -40
- package/src/scan/emit.ts +7 -43
- package/src/scan/handler-parser.ts +41 -163
- package/src/scan/result.ts +29 -0
- package/src/scan/scanner.ts +40 -138
- package/src/scan/statement.ts +6 -31
- package/src/source.ts +44 -0
- package/src/storage.ts +141 -0
- package/src/store.ts +152 -0
- package/src/verify.ts +19 -60
- package/src/wire/CallLog.ts +30 -0
- package/src/{contract → wire}/Invocation.ts +24 -17
- package/src/{contract → wire}/RouteAddress.ts +10 -0
- package/src/wire/binding.ts +102 -0
- package/src/wire/call.ts +30 -261
- package/src/wire/drift.ts +5 -30
- package/src/wire/errors.ts +4 -24
- package/src/wire/http-error.ts +5 -19
- package/src/wire/loggerMiddleware.ts +2 -8
- package/src/wire/middleware.ts +3 -7
- package/src/wire/operation.ts +13 -110
- package/src/wire/signature.ts +38 -0
- package/dist/boot/HandlerFacade.d.ts.map +0 -1
- package/dist/boot/HandlerFacade.js.map +0 -1
- package/dist/boot/binding.d.ts +0 -60
- package/dist/boot/binding.d.ts.map +0 -1
- package/dist/boot/binding.js.map +0 -1
- package/dist/builtins/config.d.ts +0 -13
- package/dist/builtins/config.d.ts.map +0 -1
- package/dist/builtins/config.js +0 -21
- package/dist/builtins/config.js.map +0 -1
- package/dist/builtins/logger.d.ts.map +0 -1
- package/dist/builtins/logger.js.map +0 -1
- package/dist/contract/Call.d.ts +0 -10
- package/dist/contract/Call.d.ts.map +0 -1
- package/dist/contract/Call.js +0 -15
- package/dist/contract/Call.js.map +0 -1
- package/dist/contract/CallLog.d.ts +0 -57
- package/dist/contract/CallLog.d.ts.map +0 -1
- package/dist/contract/Invocation.d.ts +0 -27
- package/dist/contract/Invocation.d.ts.map +0 -1
- package/dist/contract/Invocation.js +0 -59
- package/dist/contract/Invocation.js.map +0 -1
- package/dist/contract/RouteAddress.d.ts +0 -17
- package/dist/contract/RouteAddress.d.ts.map +0 -1
- package/dist/contract/RouteAddress.js.map +0 -1
- package/dist/dispatch/InputValidator.d.ts +0 -7
- package/dist/dispatch/InputValidator.d.ts.map +0 -1
- package/dist/dispatch/InputValidator.js +0 -22
- package/dist/dispatch/InputValidator.js.map +0 -1
- package/dist/dispatch/OperationExecutor.d.ts +0 -25
- package/dist/dispatch/OperationExecutor.d.ts.map +0 -1
- package/dist/dispatch/OperationExecutor.js +0 -32
- package/dist/dispatch/OperationExecutor.js.map +0 -1
- package/dist/dispatch/OutputProjector.d.ts +0 -12
- package/dist/dispatch/OutputProjector.d.ts.map +0 -1
- package/dist/dispatch/OutputProjector.js +0 -30
- package/dist/dispatch/OutputProjector.js.map +0 -1
- package/dist/dispatch/PresenterArgumentResolver.d.ts +0 -12
- package/dist/dispatch/PresenterArgumentResolver.d.ts.map +0 -1
- package/dist/dispatch/PresenterArgumentResolver.js +0 -20
- package/dist/dispatch/PresenterArgumentResolver.js.map +0 -1
- package/dist/dispatch/RemoteRouteResolver.d.ts +0 -13
- package/dist/dispatch/RemoteRouteResolver.d.ts.map +0 -1
- package/dist/dispatch/RemoteRouteResolver.js.map +0 -1
- package/dist/dispatch/RouteNotFoundError.d.ts +0 -10
- package/dist/dispatch/RouteNotFoundError.d.ts.map +0 -1
- package/dist/dispatch/RouteNotFoundError.js +0 -24
- package/dist/dispatch/RouteNotFoundError.js.map +0 -1
- package/dist/entry/DynamicFacade.d.ts +0 -10
- package/dist/entry/DynamicFacade.d.ts.map +0 -1
- package/dist/entry/DynamicFacade.js +0 -27
- package/dist/entry/DynamicFacade.js.map +0 -1
- package/dist/entry/FacadeEntry.d.ts +0 -11
- package/dist/entry/FacadeEntry.d.ts.map +0 -1
- package/dist/entry/FacadeEntry.js +0 -26
- package/dist/entry/FacadeEntry.js.map +0 -1
- package/dist/entry/TransportEntry.d.ts +0 -13
- package/dist/entry/TransportEntry.d.ts.map +0 -1
- package/dist/entry/TransportEntry.js +0 -24
- package/dist/entry/TransportEntry.js.map +0 -1
- package/dist/orm.d.ts +0 -207
- package/dist/orm.d.ts.map +0 -1
- package/dist/orm.js +0 -66
- package/dist/orm.js.map +0 -1
- package/dist/scan/Fronds.d.ts +0 -45
- package/dist/scan/Fronds.d.ts.map +0 -1
- package/dist/scan/Fronds.js +0 -66
- package/dist/scan/Fronds.js.map +0 -1
- package/dist/scan/declare.d.ts +0 -71
- package/dist/scan/declare.d.ts.map +0 -1
- package/dist/scan/declare.js.map +0 -1
- package/dist/scan/frond.d.ts +0 -224
- package/dist/scan/frond.d.ts.map +0 -1
- package/src/boot/HandlerFacade.ts +0 -242
- package/src/boot/binding.ts +0 -182
- package/src/contract/Call.ts +0 -18
- package/src/contract/CallLog.ts +0 -55
- package/src/dispatch/InputValidator.ts +0 -28
- package/src/dispatch/OperationExecutor.ts +0 -60
- package/src/dispatch/OutputProjector.ts +0 -32
- package/src/dispatch/PresenterArgumentResolver.ts +0 -25
- package/src/dispatch/RouteNotFoundError.ts +0 -29
- package/src/entry/DynamicFacade.ts +0 -28
- package/src/entry/FacadeEntry.ts +0 -32
- package/src/entry/TransportEntry.ts +0 -30
- package/src/orm.ts +0 -252
- package/src/scan/Fronds.ts +0 -73
- package/src/scan/frond.ts +0 -235
- /package/dist/{scan → descriptor}/frond.js +0 -0
- /package/dist/{contract → wire}/CallLog.js +0 -0
|
@@ -1,9 +1,5 @@
|
|
|
1
|
-
/**
|
|
2
|
-
|
|
3
|
-
*
|
|
4
|
-
* The AST says what the author declared; TypeScript's checker says what those types mean.
|
|
5
|
-
* TypeScript is lazy-loaded to avoid bundling the compiler in production builds.
|
|
6
|
-
*/
|
|
1
|
+
/** Handler signature parser — extracts method signatures from handler source files. */
|
|
2
|
+
import type { TypeRef, Param, Signature } from '../wire/signature.js';
|
|
7
3
|
import type ts from '@typescript/typescript6';
|
|
8
4
|
import { readFileSync, existsSync, statSync } from 'node:fs';
|
|
9
5
|
import { join, dirname, resolve as resolvePath } from 'node:path';
|
|
@@ -25,26 +21,11 @@ interface TypeProject {
|
|
|
25
21
|
program: ts.Program;
|
|
26
22
|
}
|
|
27
23
|
|
|
28
|
-
/**
|
|
29
|
-
* One checked program per project/configuration during a scan.
|
|
30
|
-
*
|
|
31
|
-
* A checker is a project reader, not a file parser: creating one per handler would reopen
|
|
32
|
-
* the standard library and every imported declaration for each method. `scanProject`
|
|
33
|
-
* resets this map at the start of a run, so an edited source can never meet a program from
|
|
34
|
-
* the previous run.
|
|
35
|
-
*/
|
|
24
|
+
/** One checked program per project/configuration during a scan. */
|
|
36
25
|
const typeProjects = new Map<string, TypeProject>();
|
|
37
26
|
const compilerProjects = new Map<string, { key: string; roots: string[]; options: ts.CompilerOptions }>();
|
|
38
27
|
|
|
39
|
-
/**
|
|
40
|
-
* What survives a run: the parsed declarations, and the program built over them.
|
|
41
|
-
*
|
|
42
|
-
* Rebuilding a program re-reads `lib.d.ts` and every imported `.d.ts`, and that is FIXED
|
|
43
|
-
* work — measured, a second scan in one process cost the same at 16 frond files as at 406.
|
|
44
|
-
* The mtime is the guard, so a run still cannot see a stale type: a file that moved is
|
|
45
|
-
* re-read and TypeScript invalidates it and everything depending on it, which is a
|
|
46
|
-
* narrower rule than discarding the program and not a weaker one.
|
|
47
|
-
*/
|
|
28
|
+
/** What survives a run. */
|
|
48
29
|
const sourceFiles = new Map<string, { mtime: number; file: ts.SourceFile }>();
|
|
49
30
|
const retained = new Map<string, { host: ts.CompilerHost; program: ts.Program }>();
|
|
50
31
|
|
|
@@ -60,8 +41,8 @@ export function forgetParsedSources(): void {
|
|
|
60
41
|
}
|
|
61
42
|
|
|
62
43
|
function keptHost(key: string, options: ts.CompilerOptions): ts.CompilerHost {
|
|
63
|
-
const
|
|
64
|
-
if (
|
|
44
|
+
const cached = retained.get(key);
|
|
45
|
+
if (cached) return cached.host;
|
|
65
46
|
const typescript = getTS();
|
|
66
47
|
const base = typescript.createCompilerHost(options);
|
|
67
48
|
const host: ts.CompilerHost = {
|
|
@@ -137,13 +118,7 @@ function compilerProjectOf(filePath: string, projectRoot?: string): { key: strin
|
|
|
137
118
|
return configured;
|
|
138
119
|
}
|
|
139
120
|
|
|
140
|
-
/**
|
|
141
|
-
* Declare every file a run will read, so one program covers it.
|
|
142
|
-
*
|
|
143
|
-
* `checkedSourceOf` rebuilds whenever it meets a root it has not seen, and a frond lives
|
|
144
|
-
* outside its project's tsconfig `include`, so every declaration was a new root: 44 files
|
|
145
|
-
* cost 7.3 s that way against 0.34 s for one program.
|
|
146
|
-
*/
|
|
121
|
+
/** Declare every file a run will read, so one program covers it. */
|
|
147
122
|
export async function seedTypeProgram(filePaths: readonly string[], projectRoot?: string): Promise<void> {
|
|
148
123
|
const typescript = await loadTS();
|
|
149
124
|
const grouped = new Map<string, { options: ts.CompilerOptions; paths: string[] }>();
|
|
@@ -151,9 +126,9 @@ export async function seedTypeProgram(filePaths: readonly string[], projectRoot?
|
|
|
151
126
|
for (const filePath of filePaths) {
|
|
152
127
|
const absolute = resolvePath(filePath);
|
|
153
128
|
const configured = compilerProjectOf(absolute, projectRoot);
|
|
154
|
-
const
|
|
155
|
-
|
|
156
|
-
grouped.set(configured.key,
|
|
129
|
+
const group = grouped.get(configured.key) ?? { options: configured.options, paths: [] };
|
|
130
|
+
group.paths.push(absolute);
|
|
131
|
+
grouped.set(configured.key, group);
|
|
157
132
|
}
|
|
158
133
|
|
|
159
134
|
for (const [key, { options, paths }] of grouped) {
|
|
@@ -167,25 +142,25 @@ function checkedSourceOf(filePath: string, projectRoot?: string): { source: ts.S
|
|
|
167
142
|
const typescript = getTS();
|
|
168
143
|
const absolute = resolvePath(filePath);
|
|
169
144
|
const configured = compilerProjectOf(absolute, projectRoot);
|
|
170
|
-
let
|
|
145
|
+
let project = typeProjects.get(configured.key);
|
|
171
146
|
|
|
172
|
-
if (!
|
|
147
|
+
if (!project) {
|
|
173
148
|
// `path.resolve` is variadic, so handing it directly to `map` also passed the
|
|
174
149
|
// index and the whole roots array as path segments. A fixture without a warm scan
|
|
175
150
|
// cache exposed that first-run-only failure.
|
|
176
151
|
const roots = new Set(configured.roots.map((root) => resolvePath(root)));
|
|
177
152
|
roots.add(absolute);
|
|
178
153
|
const program = builtProgram(configured.key, [...roots], configured.options);
|
|
179
|
-
|
|
180
|
-
typeProjects.set(configured.key,
|
|
181
|
-
} else if (!
|
|
182
|
-
|
|
183
|
-
|
|
154
|
+
project = { roots, options: configured.options, program };
|
|
155
|
+
typeProjects.set(configured.key, project);
|
|
156
|
+
} else if (!project.roots.has(absolute)) {
|
|
157
|
+
project.roots.add(absolute);
|
|
158
|
+
project.program = builtProgram(configured.key, [...project.roots], project.options);
|
|
184
159
|
}
|
|
185
160
|
|
|
186
|
-
const source =
|
|
161
|
+
const source = project.program.getSourceFile(absolute);
|
|
187
162
|
if (!source) throw new Error(`TypeScript did not include '${absolute}' in its program.`);
|
|
188
|
-
return { source, checker:
|
|
163
|
+
return { source, checker: project.program.getTypeChecker() };
|
|
189
164
|
}
|
|
190
165
|
|
|
191
166
|
/** A file, opened. Five places read and parsed one, each spelling the same two calls. */
|
|
@@ -195,7 +170,7 @@ function sourceOf(filePath: string): ts.SourceFile {
|
|
|
195
170
|
}
|
|
196
171
|
|
|
197
172
|
/** One declared parameter — a constructor's and a method's are read the same way. */
|
|
198
|
-
function parsedParam(param: ts.ParameterDeclaration, source: ts.SourceFile, checker?: ts.TypeChecker):
|
|
173
|
+
function parsedParam(param: ts.ParameterDeclaration, source: ts.SourceFile, checker?: ts.TypeChecker): Param {
|
|
199
174
|
const ts = getTS();
|
|
200
175
|
const type = param.type ? parseTypeNode(param.type, source, checker) : { raw: 'unknown', name: 'unknown' };
|
|
201
176
|
return {
|
|
@@ -207,63 +182,9 @@ function parsedParam(param: ts.ParameterDeclaration, source: ts.SourceFile, chec
|
|
|
207
182
|
};
|
|
208
183
|
}
|
|
209
184
|
|
|
210
|
-
/** A parsed type reference — supports primitives, entities, arrays, generics. */
|
|
211
|
-
export interface ParsedType {
|
|
212
|
-
/** Raw type text as written in source (e.g. 'Pagination<Post>'). */
|
|
213
|
-
raw: string;
|
|
214
|
-
/** Base type name (e.g. 'Pagination', 'string', 'Post'). */
|
|
215
|
-
name: string;
|
|
216
|
-
/** Whether this is an array (T[] or Array<T>) — true at any depth. */
|
|
217
|
-
array?: boolean;
|
|
218
|
-
/**
|
|
219
|
-
* How MANY array levels: `string[]` is 1, `string[][]` is 2. `array` only ever said
|
|
220
|
-
* "at least one", which sufficed while one level meant one thing. It stopped sufficing
|
|
221
|
-
* when a presenter method started taking the page — there the outer level IS the page
|
|
222
|
-
* and what remains is the field, so telling `string[]` from `string[][]` is telling a
|
|
223
|
-
* computed string from a computed list.
|
|
224
|
-
*/
|
|
225
|
-
arrayDepth?: number;
|
|
226
|
-
/** Generic type arguments (e.g. for Pagination<Post> → [{ name: 'Post' }]). */
|
|
227
|
-
generics?: ParsedType[];
|
|
228
|
-
/** Whether `null` belongs to the type. */
|
|
229
|
-
nullable?: boolean;
|
|
230
|
-
/** Whether absence (`undefined` or `void`) belongs to the type. */
|
|
231
|
-
undefined?: boolean;
|
|
232
|
-
/** Whether this is a Promise wrapper (unwrapped in output). */
|
|
233
|
-
promise?: boolean;
|
|
234
|
-
}
|
|
235
|
-
|
|
236
|
-
/** A parsed method parameter. */
|
|
237
|
-
export interface ParsedParam {
|
|
238
|
-
name: string;
|
|
239
|
-
type: ParsedType;
|
|
240
|
-
optional?: boolean;
|
|
241
|
-
}
|
|
242
185
|
|
|
243
|
-
/**
|
|
244
|
-
|
|
245
|
-
name: string;
|
|
246
|
-
params: ParsedParam[];
|
|
247
|
-
returnType?: ParsedType;
|
|
248
|
-
/**
|
|
249
|
-
* Came from a base class, not from the file being scanned. What a prefab
|
|
250
|
-
* handler declares about its own ops beats this — the scan reads a signature
|
|
251
|
-
* and guesses, the builder knows.
|
|
252
|
-
*/
|
|
253
|
-
inherited?: boolean;
|
|
254
|
-
/**
|
|
255
|
-
* The operation in words — the first sentence of the method's doc comment.
|
|
256
|
-
*
|
|
257
|
-
* Not a new thing to write: handlers already carry it (`/** Judge: the author,
|
|
258
|
-
* a draft… */`), the AST already holds it, and nothing read it. A caller that
|
|
259
|
-
* discovers an operation over the wire has its name and its schema; what the
|
|
260
|
-
* operation is FOR lived only in the source.
|
|
261
|
-
*/
|
|
262
|
-
description?: string;
|
|
263
|
-
}
|
|
264
|
-
|
|
265
|
-
/** Parse a TypeScript type node into a ParsedType. */
|
|
266
|
-
function parseTypeNode(node: ts.TypeNode, source: ts.SourceFile, checker?: ts.TypeChecker): ParsedType {
|
|
186
|
+
/** Parse a TypeScript type node into a TypeRef. */
|
|
187
|
+
function parseTypeNode(node: ts.TypeNode, source: ts.SourceFile, checker?: ts.TypeChecker): TypeRef {
|
|
267
188
|
const ts = getTS();
|
|
268
189
|
const raw = node.getText(source);
|
|
269
190
|
|
|
@@ -373,7 +294,7 @@ function meaningfulSymbolName(type: ts.Type, checker: ts.TypeChecker): string {
|
|
|
373
294
|
}
|
|
374
295
|
|
|
375
296
|
/** Turn a checked TypeScript type into the small, serializable vocabulary the runtime reads. */
|
|
376
|
-
function parseCheckedType(type: ts.Type, raw: string, checker: ts.TypeChecker, depth = 0):
|
|
297
|
+
function parseCheckedType(type: ts.Type, raw: string, checker: ts.TypeChecker, depth = 0): TypeRef {
|
|
377
298
|
const typescript = getTS();
|
|
378
299
|
if (depth > 12) return { raw, name: checker.typeToString(type) };
|
|
379
300
|
|
|
@@ -481,20 +402,7 @@ function resolveSpecifier(specifier: string, fromFile: string, projectRoot: stri
|
|
|
481
402
|
|
|
482
403
|
// ── Mixin / heritage parsing ─────────────────
|
|
483
404
|
|
|
484
|
-
/**
|
|
485
|
-
* The class a returned expression carries, however it is wrapped.
|
|
486
|
-
*
|
|
487
|
-
* A mixin does not always hand its class back bare. `Crud` returns
|
|
488
|
-
* `asCrudConstructor(class CrudHandler { … })` — one assertion helper standing between
|
|
489
|
-
* `return` and the class — and a parser accepting only a bare `return class` found
|
|
490
|
-
* nothing there, silently: the five inherited CRUD ops stopped being derived, and a warm
|
|
491
|
-
* scan cache kept answering the old parse for weeks (`scan-cache.ts` keys on source, not
|
|
492
|
-
* on parser version).
|
|
493
|
-
*
|
|
494
|
-
* So unwrap rather than match one shape: descend through call arguments, `as` and
|
|
495
|
-
* `satisfies` assertions, and parentheses. What is looked for is a class; where the
|
|
496
|
-
* author put it is their business.
|
|
497
|
-
*/
|
|
405
|
+
/** The class a returned expression carries, however it is wrapped. */
|
|
498
406
|
function classInExpression(expr: ts.Node, depth = 0): ts.ClassExpression | undefined {
|
|
499
407
|
const ts = getTS();
|
|
500
408
|
if (depth > 8) return undefined;
|
|
@@ -545,9 +453,9 @@ function extractClassMethods(
|
|
|
545
453
|
source: ts.SourceFile,
|
|
546
454
|
skip: Set<string>,
|
|
547
455
|
checker?: ts.TypeChecker,
|
|
548
|
-
):
|
|
456
|
+
): Signature[] {
|
|
549
457
|
const ts = getTS();
|
|
550
|
-
const results:
|
|
458
|
+
const results: Signature[] = [];
|
|
551
459
|
|
|
552
460
|
for (const member of cls.members) {
|
|
553
461
|
if (!ts.isMethodDeclaration(member)) continue;
|
|
@@ -555,7 +463,7 @@ function extractClassMethods(
|
|
|
555
463
|
// `private`/`protected` is a statement about the surface, and the AST carries it —
|
|
556
464
|
// it was read past. Every helper a handler names by intent (`mustOwn`, `readMany`,
|
|
557
465
|
// `refuse`) became a callable op: measured on the bench, `list.readMany` executed
|
|
558
|
-
// and `list.mayPublish`
|
|
466
|
+
// and `list.mayPublish` validated its argument. A door is what the author declares
|
|
559
467
|
// public, and TypeScript already has the word for it. `#name` is private too, but
|
|
560
468
|
// it is not an identifier, so it never reached here in the first place.
|
|
561
469
|
if (member.modifiers?.some((m) => m.kind === ts.SyntaxKind.PrivateKeyword || m.kind === ts.SyntaxKind.ProtectedKeyword)) continue;
|
|
@@ -574,14 +482,7 @@ function extractClassMethods(
|
|
|
574
482
|
return results;
|
|
575
483
|
}
|
|
576
484
|
|
|
577
|
-
/**
|
|
578
|
-
* The first sentence of a member's doc comment, or nothing.
|
|
579
|
-
*
|
|
580
|
-
* One sentence on purpose: what a caller needs to choose an operation is a claim,
|
|
581
|
-
* not an essay, and the rest of the comment addresses whoever edits the method.
|
|
582
|
-
* Reads the leading trivia rather than `ts.getJSDocTags` — the comment is what the
|
|
583
|
-
* author wrote, tags are a schema they never agreed to.
|
|
584
|
-
*/
|
|
485
|
+
/** The first sentence of a member's doc comment, or nothing. */
|
|
585
486
|
function docSentenceOf(member: ts.Node, source: ts.SourceFile): string | undefined {
|
|
586
487
|
const ts = getTS();
|
|
587
488
|
const ranges = ts.getLeadingCommentRanges(source.text, member.pos) ?? [];
|
|
@@ -604,11 +505,7 @@ function docSentenceOf(member: ts.Node, source: ts.SourceFile): string | undefin
|
|
|
604
505
|
* Parse inherited methods from a class's heritage clause.
|
|
605
506
|
* Handles both `extends Crud(Entity)` (mixin) and `extends BaseClass` patterns.
|
|
606
507
|
*/
|
|
607
|
-
/**
|
|
608
|
-
* Where a name used here is declared. The checker follows the import, the re-export chain
|
|
609
|
-
* and an installed package's types — the three cases three hand-rolled functions treated
|
|
610
|
-
* separately.
|
|
611
|
-
*/
|
|
508
|
+
/** Where a name used here is declared. */
|
|
612
509
|
function declarationFileOf(node: ts.Node, checker: ts.TypeChecker): string | undefined {
|
|
613
510
|
const typescript = getTS();
|
|
614
511
|
let symbol = checker.getSymbolAtLocation(node);
|
|
@@ -617,20 +514,14 @@ function declarationFileOf(node: ts.Node, checker: ts.TypeChecker): string | und
|
|
|
617
514
|
return symbol.declarations?.[0]?.getSourceFile().fileName;
|
|
618
515
|
}
|
|
619
516
|
|
|
620
|
-
/**
|
|
621
|
-
* The methods a base class contributes, read from the INSTANTIATED type.
|
|
622
|
-
*
|
|
623
|
-
* `extends Crud(Post)` gives `create(input: Partial<Post>)` directly: the checker has
|
|
624
|
-
* already substituted the mixin's type parameter. The three functions this replaces
|
|
625
|
-
* detected the generic names and mapped them to the mixin's arguments by position.
|
|
626
|
-
*/
|
|
517
|
+
/** The methods a base class contributes, read from the INSTANTIATED type. */
|
|
627
518
|
function inheritedFromBase(
|
|
628
519
|
base: ts.ExpressionWithTypeArguments,
|
|
629
520
|
checker: ts.TypeChecker,
|
|
630
521
|
skip: Set<string>,
|
|
631
|
-
):
|
|
522
|
+
): Signature[] {
|
|
632
523
|
const typescript = getTS();
|
|
633
|
-
const results:
|
|
524
|
+
const results: Signature[] = [];
|
|
634
525
|
|
|
635
526
|
for (const property of checker.getPropertiesOfType(checker.getTypeAtLocation(base))) {
|
|
636
527
|
if (skip.has(property.name)) continue;
|
|
@@ -670,13 +561,11 @@ function parseInheritedMethods(
|
|
|
670
561
|
checker: ts.TypeChecker,
|
|
671
562
|
skip: Set<string>,
|
|
672
563
|
/**
|
|
673
|
-
* Base classes this pass could not open — an INSTALLED one, typically, whose
|
|
674
|
-
*
|
|
675
|
-
* method": the two used to be the same answer, so an op inherited from a
|
|
676
|
-
* published base class was absent from the façade without a word.
|
|
564
|
+
* Base classes this pass could not open — an INSTALLED one, typically, whose source is not in
|
|
565
|
+
* the workspace.
|
|
677
566
|
*/
|
|
678
567
|
unresolved: string[],
|
|
679
|
-
):
|
|
568
|
+
): Signature[] {
|
|
680
569
|
const ts = getTS();
|
|
681
570
|
if (!cls.heritageClauses) return [];
|
|
682
571
|
|
|
@@ -738,16 +627,9 @@ function findDefaultClass(source: ts.SourceFile): ts.ClassDeclaration | undefine
|
|
|
738
627
|
return undefined;
|
|
739
628
|
}
|
|
740
629
|
|
|
741
|
-
/**
|
|
742
|
-
* What a handler file yielded — its methods, AND what the pass could not open.
|
|
743
|
-
*
|
|
744
|
-
* The second half is why this is a pair rather than an array: an unresolvable base
|
|
745
|
-
* class used to give the same answer as a base class with no method, so an op
|
|
746
|
-
* inherited from an installed package was missing from the façade in silence. The
|
|
747
|
-
* pair travels through the scan cache, which is why {@link PARSER_VERSION} moved.
|
|
748
|
-
*/
|
|
630
|
+
/** What a handler file yielded — its methods, AND what the pass could not open. */
|
|
749
631
|
export interface HandlerParse {
|
|
750
|
-
methods:
|
|
632
|
+
methods: Signature[];
|
|
751
633
|
/** Base classes whose source this pass could not open. Empty is a claim. */
|
|
752
634
|
unresolvedHeritage: string[];
|
|
753
635
|
}
|
|
@@ -761,12 +643,8 @@ export async function parseAllHandlerMethods(filePath: string, projectRoot?: str
|
|
|
761
643
|
return parseClassMethods(filePath, CONSTRUCTOR_ONLY, projectRoot);
|
|
762
644
|
}
|
|
763
645
|
|
|
764
|
-
/**
|
|
765
|
-
|
|
766
|
-
*
|
|
767
|
-
* Returns all methods (no CRUD filtering) — each method is a computed field.
|
|
768
|
-
*/
|
|
769
|
-
export async function parsePresenterMethods(filePath: string, projectRoot?: string): Promise<ParsedMethod[]> {
|
|
646
|
+
/** Parse a presenter source file and extract all method signatures. */
|
|
647
|
+
export async function parsePresenterMethods(filePath: string, projectRoot?: string): Promise<Signature[]> {
|
|
770
648
|
await loadTS();
|
|
771
649
|
// No `projectRoot`, so no heritage pass and nothing to report: a presenter's
|
|
772
650
|
// computed fields are its own methods.
|
|
@@ -775,9 +653,9 @@ export async function parsePresenterMethods(filePath: string, projectRoot?: stri
|
|
|
775
653
|
|
|
776
654
|
/**
|
|
777
655
|
* Parse constructor parameter types from a source file's default class.
|
|
778
|
-
* Returns type names (e.g. ['
|
|
656
|
+
* Returns type names (e.g. ['PostStorage', 'Logger']) for DI resolution.
|
|
779
657
|
*/
|
|
780
|
-
export async function parseConstructorParams(filePath: string, projectRoot?: string): Promise<
|
|
658
|
+
export async function parseConstructorParams(filePath: string, projectRoot?: string): Promise<Param[]> {
|
|
781
659
|
const ts = await loadTS();
|
|
782
660
|
const { source, checker } = checkedSourceOf(filePath, projectRoot);
|
|
783
661
|
const cls = findDefaultClass(source);
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { Fronds } from '../descriptor/Fronds.js';
|
|
2
|
+
|
|
3
|
+
/** Result of scanning a project directory. */
|
|
4
|
+
/** Something the scan could NOT do — recorded instead of swallowed. */
|
|
5
|
+
export interface ScanDiagnostic {
|
|
6
|
+
/**
|
|
7
|
+
* `blocking` — the app now serves less than its source declares, and no caller can know it: a
|
|
8
|
+
* handler that failed to parse contributes zero operations.
|
|
9
|
+
*/
|
|
10
|
+
severity: 'blocking' | 'warning';
|
|
11
|
+
/** Stable rule name — `handler-parse-failed`, `directory-unreadable`. */
|
|
12
|
+
code: string;
|
|
13
|
+
/** Absolute path of what could not be read. */
|
|
14
|
+
filePath: string;
|
|
15
|
+
/** The frond it belongs to, when the scan got far enough to know. */
|
|
16
|
+
frond?: string;
|
|
17
|
+
/** The declaration the diagnostic is about — e.g. `PostHandler.publish`. */
|
|
18
|
+
subject?: string;
|
|
19
|
+
/** What could not be done, and what it costs. One sentence, for a human. */
|
|
20
|
+
message: string;
|
|
21
|
+
/** The underlying failure, kept whole. */
|
|
22
|
+
cause?: unknown;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export interface ScanResult {
|
|
26
|
+
fronds: Fronds;
|
|
27
|
+
/** What the scan could not do. Empty is a claim, not a default — see {@link ScanDiagnostic}. */
|
|
28
|
+
diagnostics: ScanDiagnostic[];
|
|
29
|
+
}
|