From 9a2f71eb65aafbb4c63861fd57f901c34ff39741 Mon Sep 17 00:00:00 2001 From: Marcos Defendi Date: Fri, 16 Nov 2018 13:38:53 -0200 Subject: [PATCH 1/2] Convert rocketchat-github-enterprise to main module structure --- .../github-enterprise-login-button.css | 0 .../client/index.js | 2 ++ .../{ => lib}/common.js | 4 +++- .../rocketchat-github-enterprise/package.js | 17 ++++++++--------- .../server/index.js | 2 ++ .../{ => server}/startup.js | 2 ++ 6 files changed, 17 insertions(+), 10 deletions(-) rename packages/rocketchat-github-enterprise/{ => client}/github-enterprise-login-button.css (100%) create mode 100644 packages/rocketchat-github-enterprise/client/index.js rename packages/rocketchat-github-enterprise/{ => lib}/common.js (89%) create mode 100644 packages/rocketchat-github-enterprise/server/index.js rename packages/rocketchat-github-enterprise/{ => server}/startup.js (93%) diff --git a/packages/rocketchat-github-enterprise/github-enterprise-login-button.css b/packages/rocketchat-github-enterprise/client/github-enterprise-login-button.css similarity index 100% rename from packages/rocketchat-github-enterprise/github-enterprise-login-button.css rename to packages/rocketchat-github-enterprise/client/github-enterprise-login-button.css diff --git a/packages/rocketchat-github-enterprise/client/index.js b/packages/rocketchat-github-enterprise/client/index.js new file mode 100644 index 000000000000..7f2b10ba6e3d --- /dev/null +++ b/packages/rocketchat-github-enterprise/client/index.js @@ -0,0 +1,2 @@ +import './github-enterprise-login-button.css'; +import '../lib/common'; diff --git a/packages/rocketchat-github-enterprise/common.js b/packages/rocketchat-github-enterprise/lib/common.js similarity index 89% rename from packages/rocketchat-github-enterprise/common.js rename to packages/rocketchat-github-enterprise/lib/common.js index 39dfc05b140a..4e2a922e4481 100644 --- a/packages/rocketchat-github-enterprise/common.js +++ b/packages/rocketchat-github-enterprise/lib/common.js @@ -1,6 +1,8 @@ -/* global CustomOAuth */ import { Meteor } from 'meteor/meteor'; import { Tracker } from 'meteor/tracker'; +import { CustomOAuth } from 'meteor/rocketchat:custom-oauth'; +import { RocketChat } from 'meteor/rocketchat:lib'; +console.log(CustomOAuth) // GitHub Enterprise Server CallBack URL needs to be http(s)://{rocketchat.server}[:port]/_oauth/github_enterprise // In RocketChat -> Administration the URL needs to be http(s)://{github.enterprise.server}/ diff --git a/packages/rocketchat-github-enterprise/package.js b/packages/rocketchat-github-enterprise/package.js index a9f23a72f193..1d6fab4926de 100644 --- a/packages/rocketchat-github-enterprise/package.js +++ b/packages/rocketchat-github-enterprise/package.js @@ -5,13 +5,12 @@ Package.describe({ }); Package.onUse(function(api) { - api.use('ecmascript'); - api.use('rocketchat:lib'); - api.use('rocketchat:custom-oauth'); - - api.use('templating', 'client'); - - api.addFiles('common.js'); - api.addFiles('github-enterprise-login-button.css', 'client'); - api.addFiles('startup.js', 'server'); + api.use([ + 'ecmascript', + 'rocketchat:lib', + 'rocketchat:custom-oauth', + 'templating', + ]); + api.mainModule('client/index.js', 'client'); + api.mainModule('server/index.js', 'server'); }); diff --git a/packages/rocketchat-github-enterprise/server/index.js b/packages/rocketchat-github-enterprise/server/index.js new file mode 100644 index 000000000000..d4fffe60273a --- /dev/null +++ b/packages/rocketchat-github-enterprise/server/index.js @@ -0,0 +1,2 @@ +import './startup'; +import '../lib/common'; diff --git a/packages/rocketchat-github-enterprise/startup.js b/packages/rocketchat-github-enterprise/server/startup.js similarity index 93% rename from packages/rocketchat-github-enterprise/startup.js rename to packages/rocketchat-github-enterprise/server/startup.js index 59cdb3d0b13f..9f20e8ab0fb3 100644 --- a/packages/rocketchat-github-enterprise/startup.js +++ b/packages/rocketchat-github-enterprise/server/startup.js @@ -1,3 +1,5 @@ +import { RocketChat } from 'meteor/rocketchat:lib'; + RocketChat.settings.addGroup('OAuth', function() { this.section('GitHub Enterprise', function() { const enableQuery = { From c5b2a3ef30ada9ed5583ba5d54f8537399d345ef Mon Sep 17 00:00:00 2001 From: Marcos Defendi Date: Fri, 16 Nov 2018 14:41:43 -0200 Subject: [PATCH 2/2] Removing forgot console.log --- packages/rocketchat-github-enterprise/lib/common.js | 1 - 1 file changed, 1 deletion(-) diff --git a/packages/rocketchat-github-enterprise/lib/common.js b/packages/rocketchat-github-enterprise/lib/common.js index 4e2a922e4481..86060ab94265 100644 --- a/packages/rocketchat-github-enterprise/lib/common.js +++ b/packages/rocketchat-github-enterprise/lib/common.js @@ -2,7 +2,6 @@ import { Meteor } from 'meteor/meteor'; import { Tracker } from 'meteor/tracker'; import { CustomOAuth } from 'meteor/rocketchat:custom-oauth'; import { RocketChat } from 'meteor/rocketchat:lib'; -console.log(CustomOAuth) // GitHub Enterprise Server CallBack URL needs to be http(s)://{rocketchat.server}[:port]/_oauth/github_enterprise // In RocketChat -> Administration the URL needs to be http(s)://{github.enterprise.server}/