From a81008e6be653361b87174328e3c474e4e4e16f2 Mon Sep 17 00:00:00 2001 From: Tyler Vigario Date: Sun, 21 Jun 2020 20:12:03 -0700 Subject: [PATCH] Cleanup artifacts from node build flow --- README.md | 3 +++ web/{src => }/js/app.mjs | 0 web/{src => }/js/main.mjs | 6 +++--- web/{src => }/js/theme.mjs | 0 web/{src => }/js/util.js | 2 +- web/package-lock.json | 28 ++++++++++++------------- web/package.json | 6 +++--- web/{src => }/sass/app-dark.scss | 0 web/{src => }/sass/app.scss | 0 web/{src => }/sass/main.scss | 0 web/scripts/build-css.js | 21 ------------------- web/{src => }/templates/index.html | 0 web/{src => }/templates/need_token.html | 0 web/webpack.config.cjs | 10 ++++----- 14 files changed, 29 insertions(+), 47 deletions(-) rename web/{src => }/js/app.mjs (100%) rename web/{src => }/js/main.mjs (99%) rename web/{src => }/js/theme.mjs (100%) rename web/{src => }/js/util.js (91%) rename web/{src => }/sass/app-dark.scss (100%) rename web/{src => }/sass/app.scss (100%) rename web/{src => }/sass/main.scss (100%) delete mode 100644 web/scripts/build-css.js rename web/{src => }/templates/index.html (100%) rename web/{src => }/templates/need_token.html (100%) diff --git a/README.md b/README.md index 6fb2ac1..e2f5bd6 100644 --- a/README.md +++ b/README.md @@ -69,6 +69,9 @@ cd botamusique python3 -m venv venv venv/bin/pip install wheel venv/bin/pip install -r requirements.txt +cd web +npm install +npm run build ``` diff --git a/web/src/js/app.mjs b/web/js/app.mjs similarity index 100% rename from web/src/js/app.mjs rename to web/js/app.mjs diff --git a/web/src/js/main.mjs b/web/js/main.mjs similarity index 99% rename from web/src/js/main.mjs rename to web/js/main.mjs index a7ddb88..4dc2a38 100644 --- a/web/src/js/main.mjs +++ b/web/js/main.mjs @@ -4,7 +4,7 @@ import Popper from 'popper.js/dist/esm/popper'; import { Modal, Toast, - Tooltip + Tooltip, } from 'bootstrap/js/src/index'; import { isOverflown, @@ -1184,7 +1184,7 @@ playerBarBox.addEventListener('mousedown', function() { playerBarBox.addEventListener('mouseup', function(event) { playerBarBox.removeEventListener('mousemove', playheadDragged); - const percent = (event.clientX - playerBarBox.getBoundingClientRect().x) / playerBarBox.clientWidth; + const percent = (event.clientX - playerBarBox.getBoundingClientRect().x) / playerBarBox.clientWidth; request('post', { move_playhead: percent * currentPlayingItem.duration, }); @@ -1192,7 +1192,7 @@ playerBarBox.addEventListener('mouseup', function(event) { }); function playheadDragged(event) { - const percent = (event.clientX - playerBarBox.getBoundingClientRect().x) / playerBarBox.clientWidth; + const percent = (event.clientX - playerBarBox.getBoundingClientRect().x) / playerBarBox.clientWidth; setProgressBar(playerBar, percent, secondsToStr(percent * currentPlayingItem.duration)); } diff --git a/web/src/js/theme.mjs b/web/js/theme.mjs similarity index 100% rename from web/src/js/theme.mjs rename to web/js/theme.mjs diff --git a/web/src/js/util.js b/web/js/util.js similarity index 91% rename from web/src/js/util.js rename to web/js/util.js index c6a2408..e25813f 100644 --- a/web/src/js/util.js +++ b/web/js/util.js @@ -6,7 +6,7 @@ export function setProgressBar(bar, progress, text = '') { const progPos = (-1 * (1 - progress) * bar.scrollWidth).toString(); const progStr = (progress * 100).toString(); bar.setAttribute('aria-valuenow', progStr); - bar.style.transform = "translateX(" + progPos + "px)"; + bar.style.transform = 'translateX(' + progPos + 'px)'; bar.textContent = text; } diff --git a/web/package-lock.json b/web/package-lock.json index 0319696..e335ce5 100644 --- a/web/package-lock.json +++ b/web/package-lock.json @@ -2177,9 +2177,9 @@ "dev": true }, "autoprefixer": { - "version": "9.8.1", - "resolved": "https://registry.npmjs.org/autoprefixer/-/autoprefixer-9.8.1.tgz", - "integrity": "sha512-zDw9+mkCdWZHloBIGrOgMq1tTUed4qy6ZgNAe2Ze2xERZA7CyTgW5Bw3XZbwSeJe8lfDHZIkw8Hwd/6hI3p0NQ==", + "version": "9.8.2", + "resolved": "https://registry.npmjs.org/autoprefixer/-/autoprefixer-9.8.2.tgz", + "integrity": "sha512-9UwMMU8Rg7Fj0c55mbOpXrr/2WrRqoOwOlLNTyyYt+nhiyQdIBWipp5XWzt+Lge8r3DK5y+EHMc1OBf8VpZA6Q==", "dev": true, "requires": { "browserslist": "^4.12.0", @@ -3733,17 +3733,17 @@ } }, "eslint-plugin-jsdoc": { - "version": "27.1.2", - "resolved": "https://registry.npmjs.org/eslint-plugin-jsdoc/-/eslint-plugin-jsdoc-27.1.2.tgz", - "integrity": "sha512-iWrG2ZK4xrxamoMkoyzgkukdmfqWc5Ncd6K+CnwRgxrbwjQQpzmt5Kl8GB0l12R0oUK2AF+9tGFJKNGzuyz79Q==", + "version": "28.0.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-jsdoc/-/eslint-plugin-jsdoc-28.0.0.tgz", + "integrity": "sha512-Etne7B8AQcgXrnDPXdfV4x+szHVEP+JVZ2cYNfZGn+HoaZigIOzxxJGU+QUhymz6vuz0fpzFM6fTt64XOvw69w==", "dev": true, "requires": { "comment-parser": "^0.7.5", "debug": "^4.1.1", - "jsdoctypeparser": "^6.1.0", + "jsdoctypeparser": "^7.0.0", "lodash": "^4.17.15", "regextras": "^0.7.1", - "semver": "^6.3.0", + "semver": "^7.3.2", "spdx-expression-parse": "^3.0.1" }, "dependencies": { @@ -3763,9 +3763,9 @@ "dev": true }, "semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "version": "7.3.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.2.tgz", + "integrity": "sha512-OrOb32TeeambH6UrhtShmF7CRDqhL6/5XpPNp2DuRH6+9QLw/orhp72j87v8Qa1ScDkvrrBNpZcDejAirJmfXQ==", "dev": true } } @@ -4955,9 +4955,9 @@ } }, "jsdoctypeparser": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/jsdoctypeparser/-/jsdoctypeparser-6.1.0.tgz", - "integrity": "sha512-UCQBZ3xCUBv/PLfwKAJhp6jmGOSLFNKzrotXGNgbKhWvz27wPsCsVeP7gIcHPElQw2agBmynAitXqhxR58XAmA==", + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/jsdoctypeparser/-/jsdoctypeparser-7.0.0.tgz", + "integrity": "sha512-6vWPn5qSy+MbgCVjXsQKVkRywhs+IxFU7Chw72DKsWoGueYp6QX8eTc55+EA0yPGYfhmglb1gfi283asXirfGQ==", "dev": true }, "jsesc": { diff --git a/web/package.json b/web/package.json index 4556967..27b8019 100644 --- a/web/package.json +++ b/web/package.json @@ -3,7 +3,7 @@ "private": true, "type": "module", "scripts": { - "lint": "eslint --config .eslintrc.json src/js/ --ext .mjs", + "lint": "eslint --config .eslintrc.json js/ --ext .mjs", "lint:fix": "npm run lint -- --fix", "build": "webpack --config webpack.config.cjs --progress", "test": "echo \"Error: no test specified\" && exit 1" @@ -22,7 +22,7 @@ "@babel/core": "^7.10.3", "@babel/plugin-proposal-class-properties": "^7.10.1", "@babel/preset-env": "^7.10.3", - "autoprefixer": "^9.8.1", + "autoprefixer": "^9.8.2", "babel-eslint": "^10.1.0", "babel-loader": "^8.1.0", "core-js": "^3.6.5", @@ -30,7 +30,7 @@ "eslint": "^7.3.0", "eslint-config-google": "^0.14.0", "eslint-plugin-import": "^2.21.2", - "eslint-plugin-jsdoc": "^27.1.2", + "eslint-plugin-jsdoc": "^28.0.0", "eslint-plugin-node": "^11.1.0", "html-webpack-plugin": "^4.3.0", "mini-css-extract-plugin": "^0.9.0", diff --git a/web/src/sass/app-dark.scss b/web/sass/app-dark.scss similarity index 100% rename from web/src/sass/app-dark.scss rename to web/sass/app-dark.scss diff --git a/web/src/sass/app.scss b/web/sass/app.scss similarity index 100% rename from web/src/sass/app.scss rename to web/sass/app.scss diff --git a/web/src/sass/main.scss b/web/sass/main.scss similarity index 100% rename from web/src/sass/main.scss rename to web/sass/main.scss diff --git a/web/scripts/build-css.js b/web/scripts/build-css.js deleted file mode 100644 index 8bb435e..0000000 --- a/web/scripts/build-css.js +++ /dev/null @@ -1,21 +0,0 @@ -const sass = require('node-sass'); -const fs = require('fs'); - -sass.render({ - file: './src/sass/main.scss', - outFile: './build/assets/css/main.min.css', - outputStyle: 'compressed', -}, function (error, result) { - if (error) { - console.error(error); - } - - // No errors during compilation, write the result to disk - fs.writeFile('./build/assets/css/main.min.css', result.css, function (err) { - if (err) { - console.error(err); - } - - console.info('CSS compiled.'); - }); -}); \ No newline at end of file diff --git a/web/src/templates/index.html b/web/templates/index.html similarity index 100% rename from web/src/templates/index.html rename to web/templates/index.html diff --git a/web/src/templates/need_token.html b/web/templates/need_token.html similarity index 100% rename from web/src/templates/need_token.html rename to web/templates/need_token.html diff --git a/web/webpack.config.cjs b/web/webpack.config.cjs index ef4da11..67cc231 100644 --- a/web/webpack.config.cjs +++ b/web/webpack.config.cjs @@ -6,11 +6,11 @@ module.exports = { mode: 'production', entry: { main: [ - './src/js/app.mjs', - './src/sass/app.scss', + './js/app.mjs', + './sass/app.scss', ], dark: [ - './src/sass/app-dark.scss', + './sass/app-dark.scss', ], }, devtool: 'source-map', @@ -30,12 +30,12 @@ module.exports = { }), new HtmlWebpackPlugin({ filename: 'templates/index.html', - template: './src/templates/index.html', + template: './templates/index.html', inject: false, }), new HtmlWebpackPlugin({ filename: 'templates/need_token.html', - template: './src/templates/need_token.html', + template: './templates/need_token.html', inject: false, }), ],