From 95a3ec42c23e4a867bf77564018018cf7e975cb9 Mon Sep 17 00:00:00 2001 From: Pavel Djundik Date: Fri, 5 Jul 2019 10:26:22 +0300 Subject: [PATCH] Add a message about experimental API --- src/plugins/packages/index.js | 7 +++++++ test/plugins/packages/indexTest.js | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/plugins/packages/index.js b/src/plugins/packages/index.js index de456888..fece7bb8 100644 --- a/src/plugins/packages/index.js +++ b/src/plugins/packages/index.js @@ -46,6 +46,7 @@ function getPackage(name) { function loadPackages(clientManager) { const packageJson = path.join(Helper.getPackagesPath(), "package.json"); let packages; + let anyPlugins = false; try { packages = Object.keys(require(packageJson).dependencies); @@ -77,6 +78,8 @@ function loadPackages(clientManager) { if (packageInfo.type === "theme") { themes.addTheme(packageName, packageInfo); + } else { + anyPlugins = true; } if (packageFile.onServerStart) { @@ -85,4 +88,8 @@ function loadPackages(clientManager) { log.info(`Package ${colors.bold(packageName)} loaded`); }); + + if (anyPlugins) { + log.info("There are packages using the experimental plugin API. Be aware that this API is not yet stable and may change in future The Lounge releases."); + } } diff --git a/test/plugins/packages/indexTest.js b/test/plugins/packages/indexTest.js index 5239a617..8aed62ea 100644 --- a/test/plugins/packages/indexTest.js +++ b/test/plugins/packages/indexTest.js @@ -55,7 +55,7 @@ describe("packages", function() { packages.loadPackages(); - expect(stdout).to.deep.equal("Package thelounge-package-foo loaded\n"); + expect(stdout).to.deep.equal("Package thelounge-package-foo loaded\nThere are packages using the experimental plugin API. Be aware that this API is not yet stable and may change in future The Lounge releases.\n"); }); }); });