Project configuration improvements#60
Conversation
Wiz Scan Summary
To detect these findings earlier in the dev lifecycle, try using Wiz Code VS Code Extension. |
| /** The interval at which the processor will wait before next poll when an unexpected error occurs @default 20000ms */ | ||
| processLoopRetryIntervalMs?: number; | ||
| }; | ||
| export type ProcessorConfiguration = Partial<SimpleProcessorConfiguration> & { type?: 'simple' }; |
There was a problem hiding this comment.
i was redeclaring what was on SimpleProcessorConfiguration rather then just using the type
maiahneo
left a comment
There was a problem hiding this comment.
Great stuff here! Just one item below, not of a big deal but just want to surface the discussion.
| const _unreachable: never = processorType; | ||
|
|
||
| throw new Error(`Unknown processor type: ${processorType}`); |
There was a problem hiding this comment.
Why do we need to declare _unreachable here? Can we just simply do like below?
| const _unreachable: never = processorType; | |
| throw new Error(`Unknown processor type: ${processorType}`); | |
| throw new Error(`Unknown processor type: ${processorType}`); |
There was a problem hiding this comment.
Or I'm thinking instead of throwing we can just default to Simple processor if not provided?
There was a problem hiding this comment.
maybe we can talk about this IRL. but essentially i update code to do "exhaustive" checks. So the only way this throw is possible is if someone force passes in a "type" that does not exist
There was a problem hiding this comment.
Talked IRL - tried it in my editor and it's awesome pattern 🤯
|
|
||
| ProcessorEvents.TASK_CLAIMED; |
So this is breaking out alot of "project" improvements out of PR introducing plugin support. This PR
mongodbas dependency in chrono-mongo-datastore. We found many instances of npm/pnpm improperly resolving mongodb version if application had mongodb in dev-dependenciesisolatedDeclarationsin tsconfigOnly "publishable" change is the "mongodb" being moved to dependency. And cjs fixes in package.json