From babecd7697995c0dbefad48dc6fdc9dfcc790a23 Mon Sep 17 00:00:00 2001 From: Marcos Spessatto Defendi Date: Tue, 4 Dec 2018 09:46:43 -0200 Subject: [PATCH] Convert rocketchat-slashcommands-topic to main module structure (#12826) --- packages/rocketchat-slashcommands-topic/client/index.js | 1 + .../rocketchat-slashcommands-topic/{ => lib}/topic.js | 3 ++- packages/rocketchat-slashcommands-topic/package.js | 8 +++----- packages/rocketchat-slashcommands-topic/server/index.js | 1 + 4 files changed, 7 insertions(+), 6 deletions(-) create mode 100644 packages/rocketchat-slashcommands-topic/client/index.js rename packages/rocketchat-slashcommands-topic/{ => lib}/topic.js (88%) create mode 100644 packages/rocketchat-slashcommands-topic/server/index.js diff --git a/packages/rocketchat-slashcommands-topic/client/index.js b/packages/rocketchat-slashcommands-topic/client/index.js new file mode 100644 index 000000000000..9ea49d4c9e63 --- /dev/null +++ b/packages/rocketchat-slashcommands-topic/client/index.js @@ -0,0 +1 @@ +import '../lib/topic'; diff --git a/packages/rocketchat-slashcommands-topic/topic.js b/packages/rocketchat-slashcommands-topic/lib/topic.js similarity index 88% rename from packages/rocketchat-slashcommands-topic/topic.js rename to packages/rocketchat-slashcommands-topic/lib/topic.js index 0c579f657d94..8824f3a85cc2 100644 --- a/packages/rocketchat-slashcommands-topic/topic.js +++ b/packages/rocketchat-slashcommands-topic/lib/topic.js @@ -1,5 +1,6 @@ import { Meteor } from 'meteor/meteor'; - +import { RocketChat, handleError } from 'meteor/rocketchat:lib'; +import { ChatRoom } from 'meteor/rocketchat:ui'; /* * Join is a named function that will replace /topic commands * @param {Object} message - The message object diff --git a/packages/rocketchat-slashcommands-topic/package.js b/packages/rocketchat-slashcommands-topic/package.js index 9b309961835a..209ccf9462b5 100644 --- a/packages/rocketchat-slashcommands-topic/package.js +++ b/packages/rocketchat-slashcommands-topic/package.js @@ -6,13 +6,11 @@ Package.describe({ }); Package.onUse(function(api) { - api.use([ 'rocketchat:lib', 'ecmascript', + 'rocketchat:authorization', ]); - - api.use(['rocketchat:authorization'], ['client', 'server']); - - api.addFiles('topic.js', ['client', 'server']); + api.mainModule('client/index.js', 'client'); + api.mainModule('server/index.js', 'server'); }); diff --git a/packages/rocketchat-slashcommands-topic/server/index.js b/packages/rocketchat-slashcommands-topic/server/index.js new file mode 100644 index 000000000000..9ea49d4c9e63 --- /dev/null +++ b/packages/rocketchat-slashcommands-topic/server/index.js @@ -0,0 +1 @@ +import '../lib/topic';