diff --git a/.babelrc b/.babelrc deleted file mode 100644 index c591efcc..00000000 --- a/.babelrc +++ /dev/null @@ -1,13 +0,0 @@ -{ - "presets": [ - ["@babel/env", { - "targets": { - "ios": "10.3", - "chrome": "60" - }, - "useBuiltIns": "usage", - "corejs": 3 - }] - ], - "plugins": ["@babel/plugin-proposal-object-rest-spread"] -} diff --git a/.gitignore b/.gitignore index a619f6df..40ce7479 100644 --- a/.gitignore +++ b/.gitignore @@ -1,14 +1,4 @@ -node_modules -dist -app/LICENSE -app/assets/fonts/* -app/assets/*.css* -app/assets/*.png -app/client/*.js* -app/launcher/*.js* -app/server/* -app/docs/* -!app/docs/.htaccess -!app/server/.keep -app/package.json +node_modules/ +dist/ +/app/ *.pyc diff --git a/app/assets/themes/.gitignore b/app/assets/themes/.gitignore deleted file mode 100644 index d6b7ef32..00000000 --- a/app/assets/themes/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -* -!.gitignore diff --git a/app/client/.gitignore b/app/client/.gitignore deleted file mode 100644 index d6b7ef32..00000000 --- a/app/client/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -* -!.gitignore diff --git a/app/docs/.htaccess b/app/docs/.htaccess deleted file mode 100644 index de377bfe..00000000 --- a/app/docs/.htaccess +++ /dev/null @@ -1 +0,0 @@ -ErrorDocument 404 /404.html diff --git a/app/launcher/.gitignore b/app/launcher/.gitignore deleted file mode 100644 index d6b7ef32..00000000 --- a/app/launcher/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -* -!.gitignore diff --git a/app/server/.keep b/app/server/.keep deleted file mode 100644 index e69de29b..00000000 diff --git a/package.json b/package.json index ada8292c..76033892 100644 --- a/package.json +++ b/package.json @@ -21,17 +21,18 @@ "license": "GPL-3.0", "dependencies": { "@babel/core": "7.18.0", - "@babel/eslint-parser": "7.17.0", - "@babel/plugin-proposal-object-rest-spread": "7.18.0", - "@babel/polyfill": "7.12.1", "@babel/preset-env": "7.18.0", "@electron/remote": "2.0.8", + "@rollup/plugin-babel": "^6.0.4", + "@rollup/plugin-commonjs": "^28.0.6", + "@rollup/plugin-json": "^6.1.0", + "@rollup/plugin-node-resolve": "^16.0.1", + "@rollup/plugin-terser": "^0.4.4", "ace-builds": "1.39.0", "ansi-html": "0.0.9", "babelify": "10.0.0", "balanced-match": "2.0.0", "bonjour": "github:jean-emmanuel/bonjour", - "browserify": "17.0.0", "chokidar": "3.5.3", "chroma-js": "2.4.2", "core-js": "3.22.5", @@ -65,6 +66,10 @@ "python-shell": "3.0.1", "qrcode": "1.5.1", "replacestream": "4.0.3", + "rollup": "4.50.1", + "rollup-plugin-copy": "3.5.0", + "rollup-plugin-license": "^3.6.0", + "rollup-plugin-node-externals": "^8.1.1", "sanitize-html": "1.27.5", "sass": "1.89.2", "scope-css": "1.2.1", @@ -74,9 +79,6 @@ "sortablejs": "1.15.0", "source-map-support": "0.5.21", "stacktrace-js": "2.0.2", - "through": "2.3.8", - "uglifyify": "5.0.2", - "webworkify": "1.5.0", "ws": "8.6.0", "yargs": "17.5.1" }, @@ -88,21 +90,20 @@ "scripts": { "postinstall": "echo '\\033[36m=> Dependencies installed successfully. Run \"npm run build\" to build the assets.\\033[0m\n'", "start": "electron app/", - "build": "npm run build-css && npm run build-js && node scripts/copy-assets.js && echo '\\033[36m=> JS and CSS assets built successfully. Run \"npm run package\" to build an executable or \"npm start\" to run the app.\\033[0m\n'", + "build": "npm run build-css && npm run build-js && echo '\\033[36m=> JS and CSS assets built successfully. Run \"npm run package\" to build an executable or \"npm start\" to run the app.\\033[0m\n'", "package": "node scripts/package.js", "package-node": "node scripts/package-node.js", "deb64": "electron-installer-debian --src dist/open-stage-control-linux-x64/ --arch amd64 --dest dist/open-stage-control-linux-x64/ --icon resources/images/logo.png", "rpm64": "electron-installer-redhat --src dist/open-stage-control-linux-x64/ --arch x86_64 --dest dist/open-stage-control-linux-x64/ --icon resources/images/logo.png", "build-css": "node scripts/build-css.js", - "build-js": "npm run build-launcher-js && npm run build-client-js && npm run build-server-js", - "build-client-js": "node scripts/build-client.js", - "build-launcher-js": "node scripts/build-launcher.js", - "build-server-js": "node scripts/build-server.js", - "watch-client": "npm run build-client-js -- --watch", - "watch-browser": "npm run build-client-js -- --watch", "watch-css": "nodemon --watch src/scss -e scss -x \"npm run build-css -- --reload\"", - "watch-server": "nodemon --watch src/server/ -e js -x \"npm run build-server-js\"", - "watch-launcher": "nodemon --watch src/launcher/ -e js -x \"npm run build-launcher-js\"", + "build-js": "npm run build-launcher-js && npm run build-client-js && npm run build-server-js", + "build-client-js": "rollup -c scripts/client.rollup.config.js", + "watch-client": "npm run build-client-js -- --watch", + "build-server-js": "rollup -c scripts/server.rollup.config.js", + "watch-server": "npm run build-server-js -- --watch", + "build-launcher-js": "rollup -c scripts/launcher.rollup.config.js", + "watch-launcher": "npm run build-launcherr-js -- --watch", "build-docs": "node scripts/build-widgets-reference.js > resources/docs/docs/widgets/properties-reference.md && cd resources && python3 -m mkdocs build", "test": "eslint src && npm run build && node tests/test.js" }, diff --git a/scripts/build-client.js b/scripts/build-client.js deleted file mode 100644 index f6e4b64b..00000000 --- a/scripts/build-client.js +++ /dev/null @@ -1,98 +0,0 @@ -var build = require('./build'), - path = require('path'), - babelify = require('babelify'), - nanohtml = require('nanohtml'), - watch = process.argv.includes('--watch'), - through = require('through'), - minimatch = require('minimatch') - - -var ignores = ['**/*.min.js', '**/jquery.ui.js', 'gyronorm.complete.min.js'], - transformWrapper = function(transform){ - return function(file, opts){ - if (ignores.some(pattern => minimatch(file, pattern))) { - return through() - } else { - return transform(file, opts) - } - } - } - -var transforms = [ - [transformWrapper(nanohtml)], - [transformWrapper(babelify)] -] - -console.warn('\033[36m=> Building compressed client scripts...\033[0m') -transforms.push([transformWrapper(require('uglifyify')), {global: true, safari10: true}]) - -var bundle = build({ - input: '../src/client/index.js', - output: '../app/client/open-stage-control-client.js', - options: { - debug: true, - insertGlobals: false, - noParse: ['**/*.min.js', '**/jquery.ui.js'], - cache: {}, - packageCache: {}, - }, - plugins: watch ? [require('watchify')] : [], - transforms: transforms, - ignore: [ - 'postcss' // only needed by sanitize-html if