Include to Wekan packages directory contents, so that meteor command would build all directly.

This also simplifies build scripts.

Thanks to xet7 !
This commit is contained in:
Lauri Ojansivu 2019-04-20 15:18:33 +03:00
parent 6117097a93
commit 73e265d8fd
354 changed files with 36977 additions and 106 deletions

View file

@ -0,0 +1,5 @@
<!doctype html>
<title>marked tests</title>
<p>testing...</p>
<script src="marked.js"></script>
<script src="test.js"></script>

View file

@ -0,0 +1,39 @@
var fs = require('fs'),
path = require('path');
var testMod = require('../'),
load = testMod.load;
var express = require('express'),
app = express();
var files = load();
app.use(function(req, res, next) {
var setHeader = res.setHeader;
res.setHeader = function(name) {
switch (name) {
case 'Cache-Control':
case 'Last-Modified':
case 'ETag':
return;
}
return setHeader.apply(res, arguments);
};
next();
});
app.get('/test.js', function(req, res, next) {
var test = fs.readFileSync(path.join(__dirname, 'test.js'), 'utf8');
var testScript = test.replace('__TESTS__', JSON.stringify(files))
.replace('__MAIN__', testMod.runTests + '')
.replace('__LIBS__', testMod.testFile + '');
res.contentType('.js');
res.send(testScript);
});
app.use(express.static(path.join(__dirname, '/../../lib')));
app.use(express.static(__dirname));
app.listen(8080);

View file

@ -0,0 +1,66 @@
;(function() {
var console = {},
files = __TESTS__; // eslint-disable-line no-undef
console.log = function(text) {
var args = Array.prototype.slice.call(arguments, 1),
i = 0;
text = text.replace(/%\w/g, function() {
return args[i++] || '';
});
if (window.console) window.console.log(text);
document.body.innerHTML += '<pre>' + escape(text) + '</pre>';
};
if (!Object.keys) {
Object.keys = function(obj) {
var out = [],
key;
for (key in obj) {
if (Object.prototype.hasOwnProperty.call(obj, key)) {
out.push(key);
}
}
return out;
};
}
if (!Array.prototype.forEach) {
// eslint-disable-next-line no-extend-native
Array.prototype.forEach = function(callback, context) {
for (var i = 0; i < this.length; i++) {
callback.call(context || null, this[i], i, this);
}
};
}
if (!String.prototype.trim) {
// eslint-disable-next-line no-extend-native
String.prototype.trim = function() {
return this.replace(/^\s+|\s+$/g, '');
};
}
// eslint-disable-next-line no-unused-vars
function load() {
return files;
}
function escape(html, encode) {
return html
.replace(!encode ? /&(?!#?\w+;)/g : /&/g, '&amp;')
.replace(/</g, '&lt;')
.replace(/>/g, '&gt;')
.replace(/"/g, '&quot;')
.replace(/'/g, '&#39;');
}
__LIBS__; // eslint-disable-line no-undef, no-unused-expressions
(__MAIN__)(); // eslint-disable-line no-undef
}).call(this);