Browse Source

chore: Loosen semver check for plugin compatibility

Michael Bromley 2 years ago
parent
commit
c75296ff15

+ 1 - 1
packages/core/src/bootstrap.ts

@@ -172,7 +172,7 @@ function checkPluginCompatibility(config: RuntimeVendureConfig): void {
                 `The plugin "${pluginName}" does not specify a compatibility range, so it is not guaranteed to be compatible with this version of Vendure.`,
             );
         } else {
-            if (!satisfies(VENDURE_VERSION, compatibility)) {
+            if (!satisfies(VENDURE_VERSION, compatibility, { loose: true, includePrerelease: true })) {
                 Logger.error(
                     `Plugin "${pluginName}" is not compatible with this version of Vendure. ` +
                         `It specifies a semver range of "${compatibility}" but the current version is "${VENDURE_VERSION}".`,

+ 1 - 1
packages/core/src/plugin/default-job-queue-plugin/default-job-queue-plugin.ts

@@ -188,7 +188,7 @@ export interface DefaultJobQueueOptions {
         }
         return config;
     },
-    compatibility: '*',
+    compatibility: '>0.0.0',
 })
 export class DefaultJobQueuePlugin {
     /** @internal */

+ 1 - 1
packages/core/src/plugin/default-search-plugin/default-search-plugin.ts

@@ -90,7 +90,7 @@ export interface DefaultSearchReindexResponse extends SearchReindexResponse {
         resolvers: [ShopFulltextSearchResolver],
     },
     entities: [SearchIndexItem],
-    compatibility: '*',
+    compatibility: '>0.0.0',
 })
 export class DefaultSearchPlugin implements OnApplicationBootstrap, OnApplicationShutdown {
     static options: DefaultSearchPluginInitOptions = {};

+ 1 - 1
packages/core/src/plugin/vendure-plugin.ts

@@ -52,7 +52,7 @@ export interface VendurePluginMetadata extends ModuleMetadata {
      * If a plugin does not define this property, a message will be logged on bootstrap that the plugin is not
      * guaranteed to be compatible with the current version of Vendure.
      *
-     * To effectively disable this check for a plugin, you can use an overly-permissive string such as `*`.
+     * To effectively disable this check for a plugin, you can use an overly-permissive string such as `>0.0.0`.
      *
      * @example
      * ```typescript