Skip to content
Snippets Groups Projects
Unverified Commit 81adb674 authored by Diego Sampaio's avatar Diego Sampaio
Browse files

Move livechat bundled assets to root app

parent 506c64df
No related branches found
No related tags found
No related merge requests found
Showing
with 1100 additions and 38 deletions
......@@ -69,3 +69,4 @@ ecosystem.json
pm2.json
settings.json
build.sh
/public/livechat
public/
.npm/
\ No newline at end of file
/public/
.npm/
......@@ -8,7 +8,7 @@ base64@1.0.9
binary-heap@1.0.9
blaze@2.1.9
blaze-tools@1.0.10
boilerplate-generator@1.0.9
boilerplate-generator@1.0.10
caching-compiler@1.1.7
caching-html-compiler@1.0.7
callback-hook@1.0.9
......
This diff is collapsed.
/* globals Autolinker */
import Autolinker from 'autolinker';
this.livechatAutolinker = new Autolinker({
twitter: false,
phone: false
......
{
"name": "rocketchat-livechat",
"version": "1.0.0",
"description": "Livechat app from Rocket.Chat",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "Rocket.Chat",
"license": "MIT",
"dependencies": {
"autolinker": "^1.1.0"
}
}
File added
This diff is collapsed.
File added
File added
File added
......@@ -3,25 +3,28 @@
WebApp = Package.webapp.WebApp;
const Autoupdate = Package.autoupdate.Autoupdate;
WebApp.connectHandlers.use('/livechat/', (req, res/*, next*/) => {
WebApp.connectHandlers.use('/livechat/', Meteor.bindEnvironment((req, res, next) => {
if (req.url !== '/') {
return next();
}
res.setHeader('content-type', 'text/html; charset=utf-8');
const head = Assets.getText('public/head.html');
const html = `<html>
<head>
<link rel="stylesheet" type="text/css" class="__meteor-css__" href="/packages/rocketchat_livechat/public/livechat.css?_dc=${Autoupdate.autoupdateVersion}">
<link rel="stylesheet" type="text/css" class="__meteor-css__" href="/livechat/livechat.css?_dc=${Autoupdate.autoupdateVersion}">
<script type="text/javascript">
__meteor_runtime_config__ = ${JSON.stringify(__meteor_runtime_config__)};
</script>
<script type="text/javascript" src="/packages/rocketchat_livechat/public/livechat.jsi?_dc=${Autoupdate.autoupdateVersion}"></script>
${head}
</head>
<body>
<script type="text/javascript" src="/livechat/livechat.js?_dc=${Autoupdate.autoupdateVersion}"></script>
</body>
</html>`;
res.write(html);
res.end();
});
}));
......@@ -195,7 +195,5 @@ Package.onUse(function(api) {
// livechat app
api.addAssets('assets/demo.html', 'client');
api.addAssets('assets/rocket-livechat.js', 'client');
api.addAssets('public/livechat.css', 'client');
api.addAssets('public/livechat.jsi', 'client');
api.addAssets('public/head.html', 'server');
});
@echo off
cd packages/rocketchat-livechat/app
call meteor build .meteor/build/ --directory
call meteor npm install
call meteor build --directory .meteor/build/
cd ..
mkdir public
SET LIVECHAT_DIR="../../../public/livechat"
SET BUILD_DIR=".meteor/build/bundle/programs/web.browser"
del /q "public/*"
mkdir ..\public
del /q /s ..\public\*
cd "app/.meteor/build/bundle/programs/web.browser/"
xcopy /y "*.css" "../../../../../../public/livechat.css*"
xcopy /y "*.js" "../../../../../../public/livechat.jsi*"
xcopy /y "head.html" "../../../../../../public/head.html*"
rmdir /q /s %LIVECHAT_DIR%
mkdir %LIVECHAT_DIR%
::echo "body {background-color: red;}" > livechat.css
xcopy /y %BUILD_DIR%\*.css %LIVECHAT_DIR%\livechat.css*
xcopy /y %BUILD_DIR%\*.js %LIVECHAT_DIR%\livechat.js*
xcopy /y /s /e /i %BUILD_DIR%\app\* %LIVECHAT_DIR%\*
xcopy /y %BUILD_DIR%\head.html ..\public\head.html*
cd "../../../../../.."
rmdir /s /q "app/.meteor/build/"
rmdir /s /q .meteor\build\
cd packages/rocketchat-livechat/app
meteor build .meteor/build/ --directory
meteor npm install
meteor build --directory .meteor/build/
mkdir -p ../public
LIVECHAT_DIR="../../../public/livechat"
BUILD_DIR=".meteor/build/bundle/programs/web.browser"
rm -rf ../public/*
mkdir -p ../public/
cp .meteor/build/bundle/programs/web.browser/*.css ../public/livechat.css
cp .meteor/build/bundle/programs/web.browser/*.js ../public/livechat.jsi
cp .meteor/build/bundle/programs/web.browser/head.html ../public/head.html
rm -rf $LIVECHAT_DIR
mkdir -p $LIVECHAT_DIR/fonts
# echo "body {background-color: red;}" > livechat.css
cp $BUILD_DIR/*.css $LIVECHAT_DIR/livechat.css
cp $BUILD_DIR/*.js $LIVECHAT_DIR/livechat.js
cp -r $BUILD_DIR/app/* $LIVECHAT_DIR/
cp $BUILD_DIR/head.html ../public/head.html
rm -rf .meteor/build/
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment