Add a message about experimental API

This commit is contained in:
Pavel Djundik 2019-07-05 10:26:22 +03:00
parent bac95325dc
commit 95a3ec42c2
2 changed files with 8 additions and 1 deletions

View File

@ -46,6 +46,7 @@ function getPackage(name) {
function loadPackages(clientManager) { function loadPackages(clientManager) {
const packageJson = path.join(Helper.getPackagesPath(), "package.json"); const packageJson = path.join(Helper.getPackagesPath(), "package.json");
let packages; let packages;
let anyPlugins = false;
try { try {
packages = Object.keys(require(packageJson).dependencies); packages = Object.keys(require(packageJson).dependencies);
@ -77,6 +78,8 @@ function loadPackages(clientManager) {
if (packageInfo.type === "theme") { if (packageInfo.type === "theme") {
themes.addTheme(packageName, packageInfo); themes.addTheme(packageName, packageInfo);
} else {
anyPlugins = true;
} }
if (packageFile.onServerStart) { if (packageFile.onServerStart) {
@ -85,4 +88,8 @@ function loadPackages(clientManager) {
log.info(`Package ${colors.bold(packageName)} loaded`); 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.");
}
} }

View File

@ -55,7 +55,7 @@ describe("packages", function() {
packages.loadPackages(); 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");
}); });
}); });
}); });