|
if (!options.uri) throw new Error('[@payloadcms-vectorize/mongodb] `uri` is required') |
And couple other lines prevents using "pnpm generate:types" and "pnpm generate:importmap" without environment variables ( for example in CI ), which i think is a big issue.
For example, CI to generate payload-types and publish them as separate package - will not work with this plugin. And there is a couple other uses for it.
I understand that these variables are required, but still i don't see value in throwing errors on initialization of a plugin/adapter.
Easiest fix - replace throwing errors with payload.logger.error("...."), and/or "disable" plugin when there is no required variables.
payloadcms-vectorize/adapters/mongodb/src/index.ts
Line 20 in 27fcac2
And couple other lines prevents using "pnpm generate:types" and "pnpm generate:importmap" without environment variables ( for example in CI ), which i think is a big issue.
For example, CI to generate payload-types and publish them as separate package - will not work with this plugin. And there is a couple other uses for it.
I understand that these variables are required, but still i don't see value in throwing errors on initialization of a plugin/adapter.
Easiest fix - replace throwing errors with
payload.logger.error("...."), and/or "disable" plugin when there is no required variables.