aboutsummaryrefslogtreecommitdiffstats
path: root/library/Sortable/scripts
diff options
context:
space:
mode:
authorMario <mario@mariovavti.com>2021-08-03 07:12:35 +0000
committerMario <mario@mariovavti.com>2021-08-03 07:12:35 +0000
commitcddc0217724f1a7661014d50e4c940e623a0c2dc (patch)
treef24595d659adbb7d1e5d2e8e6dcd829b093887bb /library/Sortable/scripts
parent571bae9d1c07bb08270163a314c91c138b42e62f (diff)
downloadvolse-hubzilla-cddc0217724f1a7661014d50e4c940e623a0c2dc.tar.gz
volse-hubzilla-cddc0217724f1a7661014d50e4c940e623a0c2dc.tar.bz2
volse-hubzilla-cddc0217724f1a7661014d50e4c940e623a0c2dc.zip
Apps drag and drop feature
Diffstat (limited to 'library/Sortable/scripts')
-rw-r--r--library/Sortable/scripts/banner.js8
-rw-r--r--library/Sortable/scripts/build.js17
-rw-r--r--library/Sortable/scripts/esm-build.js28
-rw-r--r--library/Sortable/scripts/minify.js11
-rw-r--r--library/Sortable/scripts/test-compat.js30
-rw-r--r--library/Sortable/scripts/test.js21
-rw-r--r--library/Sortable/scripts/umd-build.js15
7 files changed, 130 insertions, 0 deletions
diff --git a/library/Sortable/scripts/banner.js b/library/Sortable/scripts/banner.js
new file mode 100644
index 000000000..337928bff
--- /dev/null
+++ b/library/Sortable/scripts/banner.js
@@ -0,0 +1,8 @@
+import { version } from '../package.json';
+
+export default `/**!
+ * Sortable ${ version }
+ * @author RubaXa <trash@rubaxa.org>
+ * @author owenm <owen23355@gmail.com>
+ * @license MIT
+ */`;
diff --git a/library/Sortable/scripts/build.js b/library/Sortable/scripts/build.js
new file mode 100644
index 000000000..11cf99d35
--- /dev/null
+++ b/library/Sortable/scripts/build.js
@@ -0,0 +1,17 @@
+import babel from 'rollup-plugin-babel';
+import json from 'rollup-plugin-json';
+import resolve from 'rollup-plugin-node-resolve';
+import banner from './banner.js';
+
+
+export default {
+ output: {
+ banner,
+ name: 'Sortable'
+ },
+ plugins: [
+ json(),
+ babel(),
+ resolve()
+ ]
+};
diff --git a/library/Sortable/scripts/esm-build.js b/library/Sortable/scripts/esm-build.js
new file mode 100644
index 000000000..9caff74d0
--- /dev/null
+++ b/library/Sortable/scripts/esm-build.js
@@ -0,0 +1,28 @@
+import build from './build.js';
+
+export default ([
+ {
+ input: 'entry/entry-core.js',
+ output: Object.assign({}, build.output, {
+ file: 'modular/sortable.core.esm.js',
+ format: 'esm'
+ })
+ },
+ {
+ input: 'entry/entry-defaults.js',
+ output: Object.assign({}, build.output, {
+ file: 'modular/sortable.esm.js',
+ format: 'esm'
+ })
+ },
+ {
+ input: 'entry/entry-complete.js',
+ output: Object.assign({}, build.output, {
+ file: 'modular/sortable.complete.esm.js',
+ format: 'esm'
+ })
+ }
+]).map(config => {
+ let buildCopy = { ...build };
+ return Object.assign(buildCopy, config);
+});
diff --git a/library/Sortable/scripts/minify.js b/library/Sortable/scripts/minify.js
new file mode 100644
index 000000000..e2051a2c2
--- /dev/null
+++ b/library/Sortable/scripts/minify.js
@@ -0,0 +1,11 @@
+const UglifyJS = require('uglify-js'),
+ fs = require('fs'),
+ package = require('../package.json');
+
+const banner = `/*! Sortable ${ package.version } - ${ package.license } | ${ package.repository.url } */\n`;
+
+fs.writeFileSync(
+ `./Sortable.min.js`,
+ banner + UglifyJS.minify(fs.readFileSync(`./Sortable.js`, 'utf8')).code,
+ 'utf8'
+);
diff --git a/library/Sortable/scripts/test-compat.js b/library/Sortable/scripts/test-compat.js
new file mode 100644
index 000000000..f7408c77f
--- /dev/null
+++ b/library/Sortable/scripts/test-compat.js
@@ -0,0 +1,30 @@
+const createTestCafe = require('testcafe');
+// Testcafe cannot test on IE < 11
+// Testcafe testing on Chrome Android is currently broken (https://github.com/DevExpress/testcafe/issues/3948)
+const browsers = [
+ 'saucelabs:Internet Explorer@11.285:Windows 10',
+ 'saucelabs:MicrosoftEdge@16.16299:Windows 10',
+ 'saucelabs:iPhone XS Simulator@12.2',
+ 'saucelabs:Safari@12.0:macOS 10.14',
+ 'chrome:headless',
+ 'firefox:headless'
+];
+
+let testcafe;
+let runner;
+let failedCount;
+
+createTestCafe(null, 8000, 8001).then((tc) => {
+ testcafe = tc;
+ runner = tc.createRunner();
+ return runner
+ .src('./tests/Sortable.compat.test.js')
+ .browsers(browsers)
+ .run();
+}).then((actualFailedCount) => {
+ // https://testcafe-discuss.devexpress.com/t/why-circleci-marked-build-as-green-even-if-this-build-contain-failed-test/726/2
+ failedCount = actualFailedCount;
+ return testcafe.close();
+}).then(() => process.exit(failedCount));
+
+
diff --git a/library/Sortable/scripts/test.js b/library/Sortable/scripts/test.js
new file mode 100644
index 000000000..6c62b75ad
--- /dev/null
+++ b/library/Sortable/scripts/test.js
@@ -0,0 +1,21 @@
+const createTestCafe = require('testcafe');
+
+let testcafe;
+let runner;
+let failedCount;
+
+
+createTestCafe().then((tc) => {
+ testcafe = tc;
+ runner = tc.createRunner();
+ return runner
+ .src('./tests/Sortable.test.js')
+ .browsers('chrome:headless')
+ .concurrency(3)
+ .run();
+}).then((actualFailedCount) => {
+ failedCount = actualFailedCount;
+ console.log('FAILED COUNT', actualFailedCount)
+ return testcafe.close();
+}).then(() => process.exit(failedCount));
+
diff --git a/library/Sortable/scripts/umd-build.js b/library/Sortable/scripts/umd-build.js
new file mode 100644
index 000000000..ec179fdb9
--- /dev/null
+++ b/library/Sortable/scripts/umd-build.js
@@ -0,0 +1,15 @@
+import build from './build.js';
+
+
+export default ([
+ {
+ input: 'entry/entry-complete.js',
+ output: Object.assign({}, build.output, {
+ file: './Sortable.js',
+ format: 'umd'
+ })
+ }
+]).map(config => {
+ let buildCopy = { ...build };
+ return Object.assign(buildCopy, config);
+});