From a9213a34c1248051dd92cae0a8f5e5c7647e1cec Mon Sep 17 00:00:00 2001 From: Marcos Spessatto Defendi Date: Mon, 3 Dec 2018 11:04:51 -0200 Subject: [PATCH] Convert rocketchat-markdown to main module structure (#12755) * Convert rocketchat-markdown to main module structure * fix wrong path in tests --- packages/rocketchat-markdown/client/index.js | 1 + packages/rocketchat-markdown/{ => lib}/markdown.js | 0 .../rocketchat-markdown/{ => lib}/parser/marked/marked.js | 0 .../rocketchat-markdown/{ => lib}/parser/original/code.js | 0 .../{ => lib}/parser/original/markdown.js | 0 .../{ => lib}/parser/original/original.js | 0 packages/rocketchat-markdown/package.js | 5 ++--- packages/rocketchat-markdown/server/index.js | 2 ++ packages/rocketchat-markdown/{ => server}/settings.js | 0 packages/rocketchat-markdown/tests/client.tests.js | 2 +- 10 files changed, 6 insertions(+), 4 deletions(-) create mode 100644 packages/rocketchat-markdown/client/index.js rename packages/rocketchat-markdown/{ => lib}/markdown.js (100%) rename packages/rocketchat-markdown/{ => lib}/parser/marked/marked.js (100%) rename packages/rocketchat-markdown/{ => lib}/parser/original/code.js (100%) rename packages/rocketchat-markdown/{ => lib}/parser/original/markdown.js (100%) rename packages/rocketchat-markdown/{ => lib}/parser/original/original.js (100%) create mode 100644 packages/rocketchat-markdown/server/index.js rename packages/rocketchat-markdown/{ => server}/settings.js (100%) diff --git a/packages/rocketchat-markdown/client/index.js b/packages/rocketchat-markdown/client/index.js new file mode 100644 index 000000000000..c73efc672f25 --- /dev/null +++ b/packages/rocketchat-markdown/client/index.js @@ -0,0 +1 @@ +import '../lib/markdown'; diff --git a/packages/rocketchat-markdown/markdown.js b/packages/rocketchat-markdown/lib/markdown.js similarity index 100% rename from packages/rocketchat-markdown/markdown.js rename to packages/rocketchat-markdown/lib/markdown.js diff --git a/packages/rocketchat-markdown/parser/marked/marked.js b/packages/rocketchat-markdown/lib/parser/marked/marked.js similarity index 100% rename from packages/rocketchat-markdown/parser/marked/marked.js rename to packages/rocketchat-markdown/lib/parser/marked/marked.js diff --git a/packages/rocketchat-markdown/parser/original/code.js b/packages/rocketchat-markdown/lib/parser/original/code.js similarity index 100% rename from packages/rocketchat-markdown/parser/original/code.js rename to packages/rocketchat-markdown/lib/parser/original/code.js diff --git a/packages/rocketchat-markdown/parser/original/markdown.js b/packages/rocketchat-markdown/lib/parser/original/markdown.js similarity index 100% rename from packages/rocketchat-markdown/parser/original/markdown.js rename to packages/rocketchat-markdown/lib/parser/original/markdown.js diff --git a/packages/rocketchat-markdown/parser/original/original.js b/packages/rocketchat-markdown/lib/parser/original/original.js similarity index 100% rename from packages/rocketchat-markdown/parser/original/original.js rename to packages/rocketchat-markdown/lib/parser/original/original.js diff --git a/packages/rocketchat-markdown/package.js b/packages/rocketchat-markdown/package.js index 024f3b567e4c..c7283d5d87c8 100644 --- a/packages/rocketchat-markdown/package.js +++ b/packages/rocketchat-markdown/package.js @@ -11,7 +11,6 @@ Package.onUse(function(api) { 'templating', 'rocketchat:lib', ]); - - api.addFiles('settings.js', 'server'); - api.mainModule('markdown.js'); + api.mainModule('client/index.js', 'client'); + api.mainModule('server/index.js', 'server'); }); diff --git a/packages/rocketchat-markdown/server/index.js b/packages/rocketchat-markdown/server/index.js new file mode 100644 index 000000000000..a385a44d9a79 --- /dev/null +++ b/packages/rocketchat-markdown/server/index.js @@ -0,0 +1,2 @@ +import './settings'; +import '../lib/markdown'; diff --git a/packages/rocketchat-markdown/settings.js b/packages/rocketchat-markdown/server/settings.js similarity index 100% rename from packages/rocketchat-markdown/settings.js rename to packages/rocketchat-markdown/server/settings.js diff --git a/packages/rocketchat-markdown/tests/client.tests.js b/packages/rocketchat-markdown/tests/client.tests.js index 184bbf17ed76..8f7e5d94c374 100644 --- a/packages/rocketchat-markdown/tests/client.tests.js +++ b/packages/rocketchat-markdown/tests/client.tests.js @@ -2,7 +2,7 @@ import 'babel-polyfill'; import assert from 'assert'; import './client.mocks.js'; -import { original } from '../parser/original/original'; +import { original } from '../lib/parser/original/original'; // import {marked} from '../parser/marked/marked'; const wrapper = (text, tag) => `${ tag }${ text }${ tag }`;