diff --git a/packages/rocketchat-drupal/client/index.js b/packages/rocketchat-drupal/client/index.js new file mode 100644 index 000000000000..f463af1d622d --- /dev/null +++ b/packages/rocketchat-drupal/client/index.js @@ -0,0 +1,2 @@ +import './login-button.css'; +import '../lib/common'; diff --git a/packages/rocketchat-drupal/login-button.css b/packages/rocketchat-drupal/client/login-button.css similarity index 100% rename from packages/rocketchat-drupal/login-button.css rename to packages/rocketchat-drupal/client/login-button.css diff --git a/packages/rocketchat-drupal/common.js b/packages/rocketchat-drupal/lib/common.js similarity index 90% rename from packages/rocketchat-drupal/common.js rename to packages/rocketchat-drupal/lib/common.js index c18895806e41..6386d9de4061 100644 --- a/packages/rocketchat-drupal/common.js +++ b/packages/rocketchat-drupal/lib/common.js @@ -1,6 +1,7 @@ -/* global CustomOAuth */ import { Meteor } from 'meteor/meteor'; import { Tracker } from 'meteor/tracker'; +import { RocketChat } from 'meteor/rocketchat:lib'; +import { CustomOAuth } from 'meteor/rocketchat:custom-oauth'; // Drupal Server CallBack URL needs to be http(s)://{rocketchat.server}[:port]/_oauth/drupal // In RocketChat -> Administration the URL needs to be http(s)://{drupal.server}/ diff --git a/packages/rocketchat-drupal/package.js b/packages/rocketchat-drupal/package.js index e84e9c543c83..bd9e2d51ee3b 100644 --- a/packages/rocketchat-drupal/package.js +++ b/packages/rocketchat-drupal/package.js @@ -6,17 +6,14 @@ Package.describe({ Package.onUse(function(api) { api.versionsFrom('1.0'); - api.use('ecmascript'); - api.use('service-configuration'); - api.use('rocketchat:lib@0.0.1'); - api.use('rocketchat:custom-oauth'); - - // api.use('templating', 'client'); - - api.addFiles('common.js'); - api.addFiles('login-button.css', 'client'); - api.addFiles('startup.js', 'server'); - - api.use('templating', 'client'); + api.use([ + 'ecmascript', + 'service-configuration', + 'rocketchat:lib@0.0.1', + 'rocketchat:custom-oauth', + 'templating', + ]); + api.mainModule('client/index.js', 'client'); + api.mainModule('server/index.js', 'server'); }); diff --git a/packages/rocketchat-drupal/server/index.js b/packages/rocketchat-drupal/server/index.js new file mode 100644 index 000000000000..d4fffe60273a --- /dev/null +++ b/packages/rocketchat-drupal/server/index.js @@ -0,0 +1,2 @@ +import './startup'; +import '../lib/common'; diff --git a/packages/rocketchat-drupal/startup.js b/packages/rocketchat-drupal/server/startup.js similarity index 92% rename from packages/rocketchat-drupal/startup.js rename to packages/rocketchat-drupal/server/startup.js index 21bc942a3d06..389c2d06dbf1 100644 --- a/packages/rocketchat-drupal/startup.js +++ b/packages/rocketchat-drupal/server/startup.js @@ -1,3 +1,5 @@ +import { RocketChat } from 'meteor/rocketchat:lib'; + RocketChat.settings.addGroup('OAuth', function() { this.section('Drupal', function() { const enableQuery = {