From f036326abe2561f0603efb4a73f3269775b267ec Mon Sep 17 00:00:00 2001 From: Nikita Karamov Date: Sat, 14 Aug 2021 18:33:06 +0200 Subject: [PATCH 01/18] Replace Pug with pure HTML --- gulpfile.js | 4 +- package.json | 2 - src/index.html | 106 +++++++++++++++++++ src/index.pug | 67 ------------ yarn.lock | 279 +------------------------------------------------ 5 files changed, 112 insertions(+), 346 deletions(-) create mode 100644 src/index.html delete mode 100644 src/index.pug diff --git a/gulpfile.js b/gulpfile.js index 3c1d400..0fcb857 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -1,13 +1,11 @@ const gulp = require('gulp'); const postcss = require('gulp-postcss'); -const pug = require('gulp-pug'); const { sass, sassSync } = require("@mr-hope/gulp-sass"); const terser = require('gulp-terser'); function html() { - return gulp.src('./src/index.pug') - .pipe(pug()) + return gulp.src('./src/index.html') .pipe(gulp.dest('./dist/')); } diff --git a/package.json b/package.json index a20e2be..580b197 100644 --- a/package.json +++ b/package.json @@ -17,11 +17,9 @@ "browserslist": "^4.16.6", "gulp": "^4.0.2", "gulp-postcss": "^9.0.0", - "gulp-pug": "^5.0.0", "gulp-terser": "^2.0.1", "postcss": "^8.2.15", "postcss-csso": "^5.0.1", - "pug": "^3.0.1", "sass": "^1.32.13", "sirv-cli": "^1.0.10" }, diff --git a/src/index.html b/src/index.html new file mode 100644 index 0000000..9f13894 --- /dev/null +++ b/src/index.html @@ -0,0 +1,106 @@ + + + + + + + + toot + + + + + + + + + + + + + + + +
+

+ toot +

+

+ for + Mastodon +

+
+
+
+
+ + +
+
+ + + +
+
+ + +
+
+ +
+
+
+ + + + diff --git a/src/index.pug b/src/index.pug deleted file mode 100644 index 7bc4cac..0000000 --- a/src/index.pug +++ /dev/null @@ -1,67 +0,0 @@ -//- - toot - Cross-instance share page for Mastodon - Copyright (C) 2020-2021 Nikita Karamov - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU Affero General Public License as published - by the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU Affero General Public License for more details. - - You should have received a copy of the GNU Affero General Public License - along with this program. If not, see . - - -html(lang="en") - head - meta(charset="UTF-8") - meta(name="viewport", content="width=device-width, initial-scale=1.0") - title toot - - link(rel="stylesheet", href="main.css") - link(rel="preconnect", href="https://fonts.gstatic.com" crossorigin) - - link(href="https://fonts.googleapis.com/css2?family=Roboto:wght@400;500&display=swap" rel="preload" as="style") - link(href="https://fonts.googleapis.com/css2?family=Roboto:wght@400;500&display=swap" rel="stylesheet" media="print" onload="this.media='all'") - noscript - link(href="https://fonts.googleapis.com/css2?family=Roboto:wght@400;500&display=swap" rel="stylesheet") - - link(rel='icon' href='/favicon.ico') - link(rel='icon' type='image/svg+xml' href='/apple-touch-icon.png') - link(rel='apple-touch-icon' href='./icons/apple-touch-icon.png') - link(rel='manifest' href='/site.webmanifest') - meta(name='theme-color' content='#3088d4') - body - header - h1 - img(src="/icon.svg" width=72 height=72 alt="toot") - p - | for - img(src="/mastodon.svg" width=95.5 height=27) - main - form#form - section - label(for="text") Post text - textarea#text(rows=6, name="text", placeholder="What's on your mind?",required) - section - datalist#instances_list - label(for="choose_instance") Choose your Mastodon instance - input#instance(type="url", name="instance", placeholder="https://", list="instances_list", required) - - section.remember - input#remember(type="checkbox", name="remember") - label(for="remember") Remember my instance on this device - - section.submit - input(type="submit", value="TOOT!") - footer - section - a(href="https://joinmastodon.org/") What is Mastodon? - section - a(href="https://github.com/NickKaramoff/toot") toot on GitHub - - script(src="index.js") diff --git a/yarn.lock b/yarn.lock index 3cd1bc6..c507d23 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2,24 +2,6 @@ # yarn lockfile v1 -"@babel/helper-validator-identifier@^7.14.9": - version "7.14.9" - resolved "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.14.9.tgz#6654d171b2024f6d8ee151bf2509699919131d48" - integrity sha512-pQYxPY0UP6IHISRitNe8bsijHex4TWZXi2HwKVsjPiltzlhse2znVcm9Ace510VT1kxIHjGJCZZQBX2gJDbo0g== - -"@babel/parser@^7.6.0", "@babel/parser@^7.9.6": - version "7.15.3" - resolved "https://registry.npmjs.org/@babel/parser/-/parser-7.15.3.tgz#3416d9bea748052cfcb63dbcc27368105b1ed862" - integrity sha512-O0L6v/HvqbdJawj0iBEfVQMc3/6WP+AeOsovsIgBFyJaG+W2w7eqvZB7puddATmWuARlm1SX7DwxJ/JJUnDpEA== - -"@babel/types@^7.6.1", "@babel/types@^7.9.6": - version "7.15.0" - resolved "https://registry.npmjs.org/@babel/types/-/types-7.15.0.tgz#61af11f2286c4e9c69ca8deb5f4375a73c72dcbd" - integrity sha512-OBvfqnllOIdX4ojTHpwZbpvz4j3EWyjkZEdmjH0/cgsd6QOdSgU8rLSk6ard/pcW7rlmjdVSX/AWOaORR1uNOQ== - dependencies: - "@babel/helper-validator-identifier" "^7.14.9" - to-fast-properties "^2.0.0" - "@mr-hope/gulp-sass@^2.0.0": version "2.0.0" resolved "https://registry.npmjs.org/@mr-hope/gulp-sass/-/gulp-sass-2.0.0.tgz#c4e3904ffb1610f4b3349f20efdc1a8a903140a8" @@ -63,11 +45,6 @@ dependencies: "@types/node" "*" -acorn@^7.1.1: - version "7.4.1" - resolved "https://registry.npmjs.org/acorn/-/acorn-7.4.1.tgz#feaed255973d2e77555b83dbc08851a6c63520fa" - integrity sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A== - ansi-colors@^1.0.1: version "1.1.0" resolved "https://registry.npmjs.org/ansi-colors/-/ansi-colors-1.1.0.tgz#6374b4dd5d4718ff3ce27a671a3b1cad077132a9" @@ -207,16 +184,6 @@ array-unique@^0.3.2: resolved "https://registry.npmjs.org/array-unique/-/array-unique-0.3.2.tgz#a894b75d4bc4f6cd679ef3244a9fd8f46ae2d428" integrity sha1-qJS3XUvE9s1nnvMkSp/Y9Gri1Cg= -asap@~2.0.3: - version "2.0.6" - resolved "https://registry.npmjs.org/asap/-/asap-2.0.6.tgz#e50347611d7e690943208bbdafebcbc2fb866d46" - integrity sha1-5QNHYR1+aQlDIIu9r+vLwvuGbUY= - -assert-never@^1.2.1: - version "1.2.1" - resolved "https://registry.npmjs.org/assert-never/-/assert-never-1.2.1.tgz#11f0e363bf146205fb08193b5c7b90f4d1cf44fe" - integrity sha512-TaTivMB6pYI1kXwrFlEhLeGfOqoDNdTxjCdwRfFFkEA30Eu+k48W34nlok2EYWJfFFzqaEmichdNM7th6M5HNw== - assign-symbols@^1.0.0: version "1.0.0" resolved "https://registry.npmjs.org/assign-symbols/-/assign-symbols-1.0.0.tgz#59667f41fadd4f20ccbc2bb96b8d4f7f78ec0367" @@ -261,13 +228,6 @@ autoprefixer@^10.2.4: normalize-range "^0.1.2" postcss-value-parser "^4.1.0" -babel-walk@3.0.0-canary-5: - version "3.0.0-canary-5" - resolved "https://registry.npmjs.org/babel-walk/-/babel-walk-3.0.0-canary-5.tgz#f66ecd7298357aee44955f235a6ef54219104b11" - integrity sha512-GAwkz0AihzY5bkwIY5QDR+LvsRQgB/B+1foMPvi0FZPMl5fjD7ICiznUiBdLYMH1QYe6vqu4gWYytZOccLouFw== - dependencies: - "@babel/types" "^7.9.6" - bach@^1.0.0: version "1.2.0" resolved "https://registry.npmjs.org/bach/-/bach-1.2.0.tgz#4b3ce96bf27134f79a1b414a51c14e34c3bd9880" @@ -318,13 +278,6 @@ bindings@^1.5.0: dependencies: file-uri-to-path "1.0.0" -bl@^3.0.0: - version "3.0.1" - resolved "https://registry.npmjs.org/bl/-/bl-3.0.1.tgz#1cbb439299609e419b5a74d7fce2f8b37d8e5c6f" - integrity sha512-jrCW5ZhfQ/Vt07WX1Ngs+yn9BDqPL/gw28S7s9H6QK/gupnizNzJAss5akW20ISgOrbLTlXOOCTJeNUQqruAWQ== - dependencies: - readable-stream "^3.0.1" - brace-expansion@^1.1.7: version "1.1.11" resolved "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd" @@ -392,7 +345,7 @@ cache-base@^1.0.1: union-value "^1.0.0" unset-value "^1.0.0" -call-bind@^1.0.0, call-bind@^1.0.2: +call-bind@^1.0.0: version "1.0.2" resolved "https://registry.npmjs.org/call-bind/-/call-bind-1.0.2.tgz#b1d4e89e688119c3c9a903ad30abb2f6a919be3c" integrity sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA== @@ -437,13 +390,6 @@ chalk@^4.1.0: ansi-styles "^4.1.0" supports-color "^7.1.0" -character-parser@^2.2.0: - version "2.2.0" - resolved "https://registry.npmjs.org/character-parser/-/character-parser-2.2.0.tgz#c7ce28f36d4bcd9744e5ffc2c5fcde1c73261fc0" - integrity sha1-x84o821LzZdE5f/CxfzeHHMmH8A= - dependencies: - is-regex "^1.0.3" - "chokidar@>=3.0.0 <4.0.0": version "3.5.2" resolved "https://registry.npmjs.org/chokidar/-/chokidar-3.5.2.tgz#dba3976fcadb016f66fd365021d91600d01c1e75" @@ -595,14 +541,6 @@ console-clear@^1.1.0: resolved "https://registry.npmjs.org/console-clear/-/console-clear-1.1.1.tgz#995e20cbfbf14dd792b672cde387bd128d674bf7" integrity sha512-pMD+MVR538ipqkG5JXeOEbKWS5um1H4LUUccUQG68qpeqBYbzYy79Gh55jkd2TtPdRfUaLWdv6LPP//5Zt0aPQ== -constantinople@^4.0.1: - version "4.0.1" - resolved "https://registry.npmjs.org/constantinople/-/constantinople-4.0.1.tgz#0def113fa0e4dc8de83331a5cf79c8b325213151" - integrity sha512-vCrqcSIq4//Gx74TXXCGnHpulY1dskqLTFGDmhrGxzeXL8lF8kvXv6mpNWlJj1uD4DW23D4ljAqbY4RRaaUZIw== - dependencies: - "@babel/parser" "^7.6.0" - "@babel/types" "^7.6.1" - convert-source-map@^1.5.0: version "1.8.0" resolved "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.8.0.tgz#f3373c32d21b4d780dd8004514684fb791ca4369" @@ -724,11 +662,6 @@ detect-file@^1.0.0: resolved "https://registry.npmjs.org/detect-file/-/detect-file-1.0.0.tgz#f0d66d03672a825cb1b73bdb3fe62310c8e552b7" integrity sha1-8NZtA2cqglyxtzvbP+YjEMjlUrc= -doctypes@^1.1.0: - version "1.1.0" - resolved "https://registry.npmjs.org/doctypes/-/doctypes-1.1.0.tgz#ea80b106a87538774e8a3a4a5afe293de489e0a9" - integrity sha1-6oCxBqh1OHdOijpKWv4pPeSJ4Kk= - duplexify@^3.6.0: version "3.7.1" resolved "https://registry.npmjs.org/duplexify/-/duplexify-3.7.1.tgz#2a4df5317f6ccfd91f86d6fd25d8d8a103b88309" @@ -1163,18 +1096,6 @@ gulp-postcss@^9.0.0: postcss-load-config "^2.1.1" vinyl-sourcemaps-apply "^0.2.1" -gulp-pug@^5.0.0: - version "5.0.0" - resolved "https://registry.npmjs.org/gulp-pug/-/gulp-pug-5.0.0.tgz#012e7c55463d66c8eb4503d63da53f3bc02dd129" - integrity sha512-NPnuj9hw35s78X/6Ho0vieKT/ipa0rh8cEAq3R4RWybZ7XEFPNez0O6kcxJipOLp3U6gjglsU1yiAR28bkuFkA== - dependencies: - fancy-log "^1.3.3" - plugin-error "^1.0.1" - pug "^3.0.2" - replace-ext "^2.0.0" - through2 "^4.0.2" - vinyl-contents "^1.0.0" - gulp-terser@^2.0.1: version "2.0.1" resolved "https://registry.npmjs.org/gulp-terser/-/gulp-terser-2.0.1.tgz#5f8f4fc54588b79519243809cc8eef4936286d0d" @@ -1207,18 +1128,11 @@ has-flag@^4.0.0: resolved "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz#944771fd9c81c81265c4d6941860da06bb59479b" integrity sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ== -has-symbols@^1.0.1, has-symbols@^1.0.2: +has-symbols@^1.0.1: version "1.0.2" resolved "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.2.tgz#165d3070c00309752a1236a479331e3ac56f1423" integrity sha512-chXa79rL/UC2KlX17jo3vRGz0azaWEx5tGqZg5pO3NUyEJVB17dMruQlzCCOfUvElghKcm5194+BCRvi2Rv/Gw== -has-tostringtag@^1.0.0: - version "1.0.0" - resolved "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.0.tgz#7e133818a7d394734f941e73c3d3f9291e658b25" - integrity sha512-kFjcSNhnlGV1kyoGk7OXKSawH5JOb/LzUc5w9B02hOTO0dfFRjbHQKvg1d6cf3HbeUmtU9VbbV3qzZ2Teh97WQ== - dependencies: - has-symbols "^1.0.2" - has-value@^0.3.1: version "0.3.1" resolved "https://registry.npmjs.org/has-value/-/has-value-0.3.1.tgz#7b1f58bada62ca827ec0a2078025654845995e1f" @@ -1409,14 +1323,6 @@ is-directory@^0.3.1: resolved "https://registry.npmjs.org/is-directory/-/is-directory-0.3.1.tgz#61339b6f2475fc772fd9c9d83f5c8575dc154ae1" integrity sha1-YTObbyR1/Hcv2cnYP1yFddwVSuE= -is-expression@^4.0.0: - version "4.0.0" - resolved "https://registry.npmjs.org/is-expression/-/is-expression-4.0.0.tgz#c33155962abf21d0afd2552514d67d2ec16fd2ab" - integrity sha512-zMIXX63sxzG3XrkHkrAPvm/OVZVSCPNkwMHU8oTX7/U3AL78I0QXCEICXUM13BIa8TYGZ68PiTKfQz3yaTNr4A== - dependencies: - acorn "^7.1.1" - object-assign "^4.1.1" - is-extendable@^0.1.0, is-extendable@^0.1.1: version "0.1.1" resolved "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz#62b110e289a471418e3ec36a617d472e301dfc89" @@ -1489,19 +1395,6 @@ is-plain-object@^5.0.0: resolved "https://registry.npmjs.org/is-plain-object/-/is-plain-object-5.0.0.tgz#4427f50ab3429e9025ea7d52e9043a9ef4159344" integrity sha512-VRSzKkbMm5jMDoKLbltAkFQ5Qr7VDiTFGXxYFXXowVj387GeGNOCsOH6Msy00SGZ3Fp84b1Naa1psqgcCIEP5Q== -is-promise@^2.0.0: - version "2.2.2" - resolved "https://registry.npmjs.org/is-promise/-/is-promise-2.2.2.tgz#39ab959ccbf9a774cf079f7b40c7a26f763135f1" - integrity sha512-+lP4/6lKUBfQjZ2pdxThZvLUAafmZb8OAxFb8XXtiQmS35INgr85hdOGoEs124ez1FCnZJt6jau/T+alh58QFQ== - -is-regex@^1.0.3: - version "1.1.4" - resolved "https://registry.npmjs.org/is-regex/-/is-regex-1.1.4.tgz#eef5663cd59fa4c0ae339505323df6854bb15958" - integrity sha512-kvRdxDsxZjhzUX07ZnLydzS1TU/TJlTUHHY4YLL87e37oUA49DfkLqgy+VjFocowy29cKvcSiu+kIv728jTTVg== - dependencies: - call-bind "^1.0.2" - has-tostringtag "^1.0.0" - is-relative@^1.0.0: version "1.0.0" resolved "https://registry.npmjs.org/is-relative/-/is-relative-1.0.0.tgz#a1bb6935ce8c5dba1e8b9754b9b2dcc020e2260d" @@ -1553,11 +1446,6 @@ isobject@^3.0.0, isobject@^3.0.1: resolved "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz#4e431e92b11a9731636aa1f9c8d1ccbcfdab78df" integrity sha1-TkMekrEalzFjaqH5yNHMvP2reN8= -js-stringify@^1.0.2: - version "1.0.2" - resolved "https://registry.npmjs.org/js-stringify/-/js-stringify-1.0.2.tgz#1736fddfd9724f28a3682adc6230ae7e4e9679db" - integrity sha1-Fzb939lyTyijaCrcYjCufk6Weds= - js-yaml@^3.13.1: version "3.14.1" resolved "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.1.tgz#dae812fdb3825fa306609a8717383c50c36a0537" @@ -1576,14 +1464,6 @@ json-stable-stringify-without-jsonify@^1.0.1: resolved "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz#9db7b59496ad3f3cfef30a75142d2d930ad72651" integrity sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE= -jstransformer@1.0.0: - version "1.0.0" - resolved "https://registry.npmjs.org/jstransformer/-/jstransformer-1.0.0.tgz#ed8bf0921e2f3f1ed4d5c1a44f68709ed24722c3" - integrity sha1-7Yvwkh4vPx7U1cGkT2hwntJHIsM= - dependencies: - is-promise "^2.0.0" - promise "^7.0.1" - just-debounce@^1.0.0: version "1.1.0" resolved "https://registry.npmjs.org/just-debounce/-/just-debounce-1.1.0.tgz#2f81a3ad4121a76bc7cb45dbf704c0d76a8e5ddf" @@ -1846,11 +1726,6 @@ number-is-nan@^1.0.0: resolved "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz#097b602b53422a522c1afb8790318336941a011d" integrity sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0= -object-assign@^4.1.1: - version "4.1.1" - resolved "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863" - integrity sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM= - object-copy@^0.1.0: version "0.1.0" resolved "https://registry.npmjs.org/object-copy/-/object-copy-0.1.0.tgz#7e7d858b781bd7c991a41ba975ed3812754e998c" @@ -2094,116 +1969,6 @@ process-nextick-args@^2.0.0, process-nextick-args@~2.0.0: resolved "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz#7820d9b16120cc55ca9ae7792680ae7dba6d7fe2" integrity sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag== -promise@^7.0.1: - version "7.3.1" - resolved "https://registry.npmjs.org/promise/-/promise-7.3.1.tgz#064b72602b18f90f29192b8b1bc418ffd1ebd3bf" - integrity sha512-nolQXZ/4L+bP/UGlkfaIujX9BKxGwmQ9OT4mOt5yvy8iK1h3wqTEJCijzGANTCCl9nWjY41juyAn2K3Q1hLLTg== - dependencies: - asap "~2.0.3" - -pug-attrs@^3.0.0: - version "3.0.0" - resolved "https://registry.npmjs.org/pug-attrs/-/pug-attrs-3.0.0.tgz#b10451e0348165e31fad1cc23ebddd9dc7347c41" - integrity sha512-azINV9dUtzPMFQktvTXciNAfAuVh/L/JCl0vtPCwvOA21uZrC08K/UnmrL+SXGEVc1FwzjW62+xw5S/uaLj6cA== - dependencies: - constantinople "^4.0.1" - js-stringify "^1.0.2" - pug-runtime "^3.0.0" - -pug-code-gen@^3.0.2: - version "3.0.2" - resolved "https://registry.npmjs.org/pug-code-gen/-/pug-code-gen-3.0.2.tgz#ad190f4943133bf186b60b80de483100e132e2ce" - integrity sha512-nJMhW16MbiGRiyR4miDTQMRWDgKplnHyeLvioEJYbk1RsPI3FuA3saEP8uwnTb2nTJEKBU90NFVWJBk4OU5qyg== - dependencies: - constantinople "^4.0.1" - doctypes "^1.1.0" - js-stringify "^1.0.2" - pug-attrs "^3.0.0" - pug-error "^2.0.0" - pug-runtime "^3.0.0" - void-elements "^3.1.0" - with "^7.0.0" - -pug-error@^2.0.0: - version "2.0.0" - resolved "https://registry.npmjs.org/pug-error/-/pug-error-2.0.0.tgz#5c62173cb09c34de2a2ce04f17b8adfec74d8ca5" - integrity sha512-sjiUsi9M4RAGHktC1drQfCr5C5eriu24Lfbt4s+7SykztEOwVZtbFk1RRq0tzLxcMxMYTBR+zMQaG07J/btayQ== - -pug-filters@^4.0.0: - version "4.0.0" - resolved "https://registry.npmjs.org/pug-filters/-/pug-filters-4.0.0.tgz#d3e49af5ba8472e9b7a66d980e707ce9d2cc9b5e" - integrity sha512-yeNFtq5Yxmfz0f9z2rMXGw/8/4i1cCFecw/Q7+D0V2DdtII5UvqE12VaZ2AY7ri6o5RNXiweGH79OCq+2RQU4A== - dependencies: - constantinople "^4.0.1" - jstransformer "1.0.0" - pug-error "^2.0.0" - pug-walk "^2.0.0" - resolve "^1.15.1" - -pug-lexer@^5.0.1: - version "5.0.1" - resolved "https://registry.npmjs.org/pug-lexer/-/pug-lexer-5.0.1.tgz#ae44628c5bef9b190b665683b288ca9024b8b0d5" - integrity sha512-0I6C62+keXlZPZkOJeVam9aBLVP2EnbeDw3An+k0/QlqdwH6rv8284nko14Na7c0TtqtogfWXcRoFE4O4Ff20w== - dependencies: - character-parser "^2.2.0" - is-expression "^4.0.0" - pug-error "^2.0.0" - -pug-linker@^4.0.0: - version "4.0.0" - resolved "https://registry.npmjs.org/pug-linker/-/pug-linker-4.0.0.tgz#12cbc0594fc5a3e06b9fc59e6f93c146962a7708" - integrity sha512-gjD1yzp0yxbQqnzBAdlhbgoJL5qIFJw78juN1NpTLt/mfPJ5VgC4BvkoD3G23qKzJtIIXBbcCt6FioLSFLOHdw== - dependencies: - pug-error "^2.0.0" - pug-walk "^2.0.0" - -pug-load@^3.0.0: - version "3.0.0" - resolved "https://registry.npmjs.org/pug-load/-/pug-load-3.0.0.tgz#9fd9cda52202b08adb11d25681fb9f34bd41b662" - integrity sha512-OCjTEnhLWZBvS4zni/WUMjH2YSUosnsmjGBB1An7CsKQarYSWQ0GCVyd4eQPMFJqZ8w9xgs01QdiZXKVjk92EQ== - dependencies: - object-assign "^4.1.1" - pug-walk "^2.0.0" - -pug-parser@^6.0.0: - version "6.0.0" - resolved "https://registry.npmjs.org/pug-parser/-/pug-parser-6.0.0.tgz#a8fdc035863a95b2c1dc5ebf4ecf80b4e76a1260" - integrity sha512-ukiYM/9cH6Cml+AOl5kETtM9NR3WulyVP2y4HOU45DyMim1IeP/OOiyEWRr6qk5I5klpsBnbuHpwKmTx6WURnw== - dependencies: - pug-error "^2.0.0" - token-stream "1.0.0" - -pug-runtime@^3.0.0, pug-runtime@^3.0.1: - version "3.0.1" - resolved "https://registry.npmjs.org/pug-runtime/-/pug-runtime-3.0.1.tgz#f636976204723f35a8c5f6fad6acda2a191b83d7" - integrity sha512-L50zbvrQ35TkpHwv0G6aLSuueDRwc/97XdY8kL3tOT0FmhgG7UypU3VztfV/LATAvmUfYi4wNxSajhSAeNN+Kg== - -pug-strip-comments@^2.0.0: - version "2.0.0" - resolved "https://registry.npmjs.org/pug-strip-comments/-/pug-strip-comments-2.0.0.tgz#f94b07fd6b495523330f490a7f554b4ff876303e" - integrity sha512-zo8DsDpH7eTkPHCXFeAk1xZXJbyoTfdPlNR0bK7rpOMuhBYb0f5qUVCO1xlsitYd3w5FQTK7zpNVKb3rZoUrrQ== - dependencies: - pug-error "^2.0.0" - -pug-walk@^2.0.0: - version "2.0.0" - resolved "https://registry.npmjs.org/pug-walk/-/pug-walk-2.0.0.tgz#417aabc29232bb4499b5b5069a2b2d2a24d5f5fe" - integrity sha512-yYELe9Q5q9IQhuvqsZNwA5hfPkMJ8u92bQLIMcsMxf/VADjNtEYptU+inlufAFYcWdHlwNfZOEnOOQrZrcyJCQ== - -pug@^3.0.1, pug@^3.0.2: - version "3.0.2" - resolved "https://registry.npmjs.org/pug/-/pug-3.0.2.tgz#f35c7107343454e43bc27ae0ff76c731b78ea535" - integrity sha512-bp0I/hiK1D1vChHh6EfDxtndHji55XP/ZJKwsRqrz6lRia6ZC2OZbdAymlxdVFwd1L70ebrVJw4/eZ79skrIaw== - dependencies: - pug-code-gen "^3.0.2" - pug-filters "^4.0.0" - pug-lexer "^5.0.1" - pug-linker "^4.0.0" - pug-load "^3.0.0" - pug-parser "^6.0.0" - pug-runtime "^3.0.1" - pug-strip-comments "^2.0.0" - pump@^2.0.0: version "2.0.1" resolved "https://registry.npmjs.org/pump/-/pump-2.0.1.tgz#12399add6e4cf7526d973cbc8b5ce2e2908b3909" @@ -2238,7 +2003,7 @@ read-pkg@^1.0.0: normalize-package-data "^2.3.2" path-type "^1.0.0" -readable-stream@3, readable-stream@^3.0.1, readable-stream@^3.3.0: +readable-stream@3: version "3.6.0" resolved "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz#337bbda3adc0706bd3e024426a286d4b4b2c9198" integrity sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA== @@ -2377,7 +2142,7 @@ resolve-url@^0.2.1: resolved "https://registry.npmjs.org/resolve-url/-/resolve-url-0.2.1.tgz#2c637fe77c893afd2a663fe21aa9080068e2052a" integrity sha1-LGN/53yJOv0qZj/iGqkIAGjiBSo= -resolve@^1.1.6, resolve@^1.1.7, resolve@^1.10.0, resolve@^1.15.1, resolve@^1.4.0: +resolve@^1.1.6, resolve@^1.1.7, resolve@^1.10.0, resolve@^1.4.0: version "1.20.0" resolved "https://registry.npmjs.org/resolve/-/resolve-1.20.0.tgz#629a013fb3f70755d6f0b7935cc1c2c5378b1975" integrity sha512-wENBPt4ySzg4ybFQW2TT1zMQucPK95HSh/nq2CFTZVOGut2+pQvSsgtda4d26YrYcr067wjbmzOG8byDPBX63A== @@ -2725,11 +2490,6 @@ to-absolute-glob@^2.0.0: is-absolute "^1.0.0" is-negated-glob "^1.0.0" -to-fast-properties@^2.0.0: - version "2.0.0" - resolved "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz#dc5e698cbd079265bc73e0377681a4e4e83f616e" - integrity sha1-3F5pjL0HkmW8c+A3doGk5Og/YW4= - to-object-path@^0.3.0: version "0.3.0" resolved "https://registry.npmjs.org/to-object-path/-/to-object-path-0.3.0.tgz#297588b7b0e7e0ac08e04e672f85c1f4999e17af" @@ -2769,11 +2529,6 @@ to-through@^2.0.0: dependencies: through2 "^2.0.3" -token-stream@1.0.0: - version "1.0.0" - resolved "https://registry.npmjs.org/token-stream/-/token-stream-1.0.0.tgz#cc200eab2613f4166d27ff9afc7ca56d49df6eb4" - integrity sha1-zCAOqyYT9BZtJ/+a/HylbUnfbrQ= - totalist@^1.0.0: version "1.1.0" resolved "https://registry.npmjs.org/totalist/-/totalist-1.1.0.tgz#a4d65a3e546517701e3e5c37a47a70ac97fe56df" @@ -2886,15 +2641,6 @@ value-or-function@^3.0.0: resolved "https://registry.npmjs.org/value-or-function/-/value-or-function-3.0.0.tgz#1c243a50b595c1be54a754bfece8563b9ff8d813" integrity sha1-HCQ6ULWVwb5Up1S/7OhWO5/42BM= -vinyl-contents@^1.0.0: - version "1.0.0" - resolved "https://registry.npmjs.org/vinyl-contents/-/vinyl-contents-1.0.0.tgz#f8f3456fe2dfb208a62c85653c2b682f87b5a2d5" - integrity sha512-xBH8ZUy8IK7K06eCBmd2GGjdf1EqNEGPNfRP2VsrCvSvsOggywGCGZg435WZiG/kcyCdXc1CZXCf4pUJ2EuEsg== - dependencies: - bl "^3.0.0" - readable-stream "^3.3.0" - vinyl "^2.2.0" - vinyl-fs@^3.0.0: version "3.0.3" resolved "https://registry.npmjs.org/vinyl-fs/-/vinyl-fs-3.0.3.tgz#c85849405f67428feabbbd5c5dbdd64f47d31bc7" @@ -2938,7 +2684,7 @@ vinyl-sourcemaps-apply@^0.2.1: dependencies: source-map "^0.5.1" -vinyl@^2.0.0, vinyl@^2.2.0: +vinyl@^2.0.0: version "2.2.1" resolved "https://registry.npmjs.org/vinyl/-/vinyl-2.2.1.tgz#23cfb8bbab5ece3803aa2c0a1eb28af7cbba1974" integrity sha512-LII3bXRFBZLlezoG5FfZVcXflZgWP/4dCwKtxd5ky9+LOtM4CS3bIRQsmR1KMnMW07jpE8fqR2lcxPZ+8sJIcw== @@ -2950,11 +2696,6 @@ vinyl@^2.0.0, vinyl@^2.2.0: remove-trailing-separator "^1.0.1" replace-ext "^1.0.0" -void-elements@^3.1.0: - version "3.1.0" - resolved "https://registry.npmjs.org/void-elements/-/void-elements-3.1.0.tgz#614f7fbf8d801f0bb5f0661f5b2f5785750e4f09" - integrity sha1-YU9/v42AHwu18GYfWy9XhXUOTwk= - which-module@^1.0.0: version "1.0.0" resolved "https://registry.npmjs.org/which-module/-/which-module-1.0.0.tgz#bba63ca861948994ff307736089e3b96026c2a4f" @@ -2967,16 +2708,6 @@ which@^1.2.14: dependencies: isexe "^2.0.0" -with@^7.0.0: - version "7.0.2" - resolved "https://registry.npmjs.org/with/-/with-7.0.2.tgz#ccee3ad542d25538a7a7a80aad212b9828495bac" - integrity sha512-RNGKj82nUPg3g5ygxkQl0R937xLyho1J24ItRCBTr/m1YnZkzJy1hUiHUJrc/VlsDQzsCnInEGSg3bci0Lmd4w== - dependencies: - "@babel/parser" "^7.9.6" - "@babel/types" "^7.9.6" - assert-never "^1.2.1" - babel-walk "3.0.0-canary-5" - wrap-ansi@^2.0.0: version "2.1.0" resolved "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-2.1.0.tgz#d8fc3d284dd05794fe84973caecdd1cf824fdd85" From d9dca764cc68701eb9d8fdb0647c32add1ec0734 Mon Sep 17 00:00:00 2001 From: Nikita Karamov Date: Sat, 14 Aug 2021 18:49:32 +0200 Subject: [PATCH 02/18] Update styles pipeline --- gulpfile.js | 11 +- package.json | 5 +- src/index.html | 2 +- src/{style => scss}/_variables.scss | 0 src/{style/main.scss => scss/style.scss} | 2 +- yarn.lock | 278 +++++++++++++++++++---- 6 files changed, 246 insertions(+), 52 deletions(-) rename src/{style => scss}/_variables.scss (100%) rename src/{style/main.scss => scss/style.scss} (99%) diff --git a/gulpfile.js b/gulpfile.js index 0fcb857..812ed1d 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -1,6 +1,7 @@ const gulp = require('gulp'); const postcss = require('gulp-postcss'); -const { sass, sassSync } = require("@mr-hope/gulp-sass"); +const sass = require('gulp-sass')(require('sass')); +const sourcemaps = require('gulp-sourcemaps'); const terser = require('gulp-terser'); @@ -10,9 +11,11 @@ function html() { } function css() { - return gulp.src('./src/style/*.scss') - .pipe(sassSync().on('error', sass.logError)) - .pipe(postcss([require('autoprefixer'), require('postcss-csso')])) + return gulp.src('./src/scss/*.scss') + .pipe(sourcemaps.init()) + .pipe(sass.sync().on('error', sass.logError)) + .pipe(postcss([require("autoprefixer"), require("postcss-csso")])) + .pipe(sourcemaps.write('.')) .pipe(gulp.dest('./dist/')); } diff --git a/package.json b/package.json index 580b197..362eb93 100644 --- a/package.json +++ b/package.json @@ -12,15 +12,16 @@ "serve": "sirv dist/ --dev" }, "devDependencies": { - "@mr-hope/gulp-sass": "^2.0.0", "autoprefixer": "^10.2.4", "browserslist": "^4.16.6", "gulp": "^4.0.2", "gulp-postcss": "^9.0.0", + "gulp-sass": "^5.0.0", + "gulp-sourcemaps": "^3.0.0", "gulp-terser": "^2.0.1", "postcss": "^8.2.15", "postcss-csso": "^5.0.1", - "sass": "^1.32.13", + "sass": "^1.37.5", "sirv-cli": "^1.0.10" }, "engines": { diff --git a/src/index.html b/src/index.html index 9f13894..49bd8d5 100644 --- a/src/index.html +++ b/src/index.html @@ -23,7 +23,7 @@ toot - + diff --git a/yarn.lock b/yarn.lock index c507d23..109882c 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2,48 +2,34 @@ # yarn lockfile v1 -"@mr-hope/gulp-sass@^2.0.0": - version "2.0.0" - resolved "https://registry.npmjs.org/@mr-hope/gulp-sass/-/gulp-sass-2.0.0.tgz#c4e3904ffb1610f4b3349f20efdc1a8a903140a8" - integrity sha512-tBqLw6CZ2OJMPybAiiOA65Y/5NdWRK4x29u7Qwd8as8dJPM7lQaFyemU41FbuSMc4lpuDfGp9gPB9YktGGy8XQ== +"@gulp-sourcemaps/identity-map@^2.0.1": + version "2.0.1" + resolved "https://registry.npmjs.org/@gulp-sourcemaps/identity-map/-/identity-map-2.0.1.tgz#a6e8b1abec8f790ec6be2b8c500e6e68037c0019" + integrity sha512-Tb+nSISZku+eQ4X1lAkevcQa+jknn/OVUgZ3XCxEKIsLsqYuPoJwJOPQeaOk75X3WPftb29GWY1eqE7GLsXb1Q== dependencies: - "@types/lodash" "^4.14.168" - "@types/node" "^14.14.31" - "@types/sass" "^1.16.0" - chalk "^4.1.0" - lodash "^4.17.21" - plugin-error "^1.0.1" - replace-ext "^2.0.0" - sass "^1.32.8" - strip-ansi "^6.0.0" - vinyl-sourcemaps-apply "^0.2.1" + acorn "^6.4.1" + normalize-path "^3.0.0" + postcss "^7.0.16" + source-map "^0.6.0" + through2 "^3.0.1" + +"@gulp-sourcemaps/map-sources@^1.0.0": + version "1.0.0" + resolved "https://registry.npmjs.org/@gulp-sourcemaps/map-sources/-/map-sources-1.0.0.tgz#890ae7c5d8c877f6d384860215ace9d7ec945bda" + integrity sha1-iQrnxdjId/bThIYCFazp1+yUW9o= + dependencies: + normalize-path "^2.0.1" + through2 "^2.0.3" "@polka/url@^1.0.0-next.17": version "1.0.0-next.17" resolved "https://registry.npmjs.org/@polka/url/-/url-1.0.0-next.17.tgz#25fdbdfd282c2f86ddf3fcefbd98be99cd2627e2" integrity sha512-0p1rCgM3LLbAdwBnc7gqgnvjHg9KpbhcSphergHShlkWz8EdPawoMJ3/VbezI0mGC5eKCDzMaPgF9Yca6cKvrg== -"@types/lodash@^4.14.168": - version "4.14.172" - resolved "https://registry.npmjs.org/@types/lodash/-/lodash-4.14.172.tgz#aad774c28e7bfd7a67de25408e03ee5a8c3d028a" - integrity sha512-/BHF5HAx3em7/KkzVKm3LrsD6HZAXuXO1AJZQ3cRRBZj4oHZDviWPYu0aEplAqDFNHZPW6d3G7KN+ONcCCC7pw== - -"@types/node@*": - version "16.6.1" - resolved "https://registry.npmjs.org/@types/node/-/node-16.6.1.tgz#aee62c7b966f55fc66c7b6dfa1d58db2a616da61" - integrity sha512-Sr7BhXEAer9xyGuCN3Ek9eg9xPviCF2gfu9kTfuU2HkTVAMYSDeX40fvpmo72n5nansg3nsBjuQBrsS28r+NUw== - -"@types/node@^14.14.31": - version "14.17.9" - resolved "https://registry.npmjs.org/@types/node/-/node-14.17.9.tgz#b97c057e6138adb7b720df2bd0264b03c9f504fd" - integrity sha512-CMjgRNsks27IDwI785YMY0KLt3co/c0cQ5foxHYv/shC2w8oOnVwz5Ubq1QG5KzrcW+AXk6gzdnxIkDnTvzu3g== - -"@types/sass@^1.16.0": - version "1.16.1" - resolved "https://registry.npmjs.org/@types/sass/-/sass-1.16.1.tgz#cf465bd1fea486d0331f760db023de14daf4980d" - integrity sha512-iZUcRrGuz/Tbg3loODpW7vrQJkUtpY2fFSf4ELqqkApcS2TkZ1msk7ie8iZPB86lDOP8QOTTmuvWjc5S0R9OjQ== - dependencies: - "@types/node" "*" +acorn@^6.4.1: + version "6.4.2" + resolved "https://registry.npmjs.org/acorn/-/acorn-6.4.2.tgz#35866fd710528e92de10cf06016498e47e39e1e6" + integrity sha512-XtGIhXwF8YM8bJhGxG5kXgjkEuNGLTkoYqVE+KMR+aspr4KGYmKYg7yUe3KghyQ9yheNwLnjmzh/7+gfDBmHCQ== ansi-colors@^1.0.1: version "1.1.0" @@ -69,6 +55,13 @@ ansi-regex@^5.0.0: resolved "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz#388539f55179bf39339c81af30a654d69f87cb75" integrity sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg== +ansi-styles@^3.2.1: + version "3.2.1" + resolved "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz#41fbb20243e50b12be0f04b8dedbf07520ce841d" + integrity sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA== + dependencies: + color-convert "^1.9.0" + ansi-styles@^4.1.0: version "4.3.0" resolved "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz#edd803628ae71c04c85ae7a0906edad34b648937" @@ -382,7 +375,16 @@ caniuse-lite@^1.0.30001243, caniuse-lite@^1.0.30001248: resolved "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001251.tgz#6853a606ec50893115db660f82c094d18f096d85" integrity sha512-HOe1r+9VkU4TFmnU70z+r7OLmtR+/chB1rdcJUeQlAinjEeb0cKL20tlAtOagNZhbrtLnCvV19B4FmF1rgzl6A== -chalk@^4.1.0: +chalk@^2.4.2: + version "2.4.2" + resolved "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz#cd42541677a54333cf541a49108c1432b44c9424" + integrity sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ== + dependencies: + ansi-styles "^3.2.1" + escape-string-regexp "^1.0.5" + supports-color "^5.3.0" + +chalk@^4.1.1: version "4.1.2" resolved "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz#aac4e2b7734a740867aeb16bf02aad556a1e7a01" integrity sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA== @@ -489,6 +491,13 @@ collection-visit@^1.0.0: map-visit "^1.0.0" object-visit "^1.0.0" +color-convert@^1.9.0: + version "1.9.3" + resolved "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz#bb71850690e1f136567de629d2d5471deda4c1e8" + integrity sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg== + dependencies: + color-name "1.1.3" + color-convert@^2.0.1: version "2.0.1" resolved "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz#72d3a68d598c9bdb3af2ad1e84f21d896abd4de3" @@ -496,6 +505,11 @@ color-convert@^2.0.1: dependencies: color-name "~1.1.4" +color-name@1.1.3: + version "1.1.3" + resolved "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz#a7d0558bd89c42f795dd42328f740831ca53bc25" + integrity sha1-p9BVi9icQveV3UIyj3QIMcpTvCU= + color-name@~1.1.4: version "1.1.4" resolved "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz#c2a09a87acbde69543de6f63fa3995c826c536a2" @@ -541,7 +555,7 @@ console-clear@^1.1.0: resolved "https://registry.npmjs.org/console-clear/-/console-clear-1.1.1.tgz#995e20cbfbf14dd792b672cde387bd128d674bf7" integrity sha512-pMD+MVR538ipqkG5JXeOEbKWS5um1H4LUUccUQG68qpeqBYbzYy79Gh55jkd2TtPdRfUaLWdv6LPP//5Zt0aPQ== -convert-source-map@^1.5.0: +convert-source-map@^1.0.0, convert-source-map@^1.5.0: version "1.8.0" resolved "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.8.0.tgz#f3373c32d21b4d780dd8004514684fb791ca4369" integrity sha512-+OQdjP49zViI/6i7nIJpA8rAl4sV/JdPfU9nZs3VqOwGIgizICvuN2ru6fMd+4llL0tar18UYJXfZ/TWtmhUjA== @@ -584,6 +598,15 @@ css-tree@^1.1.2: mdn-data "2.0.14" source-map "^0.6.1" +css@^3.0.0: + version "3.0.0" + resolved "https://registry.npmjs.org/css/-/css-3.0.0.tgz#4447a4d58fdd03367c516ca9f64ae365cee4aa5d" + integrity sha512-DG9pFfwOrzc+hawpmqX/dHYHJG+Bsdb0klhyi1sDneOgGOXy9wQIC8hzyVp1e4NRYDBdxcylvywPkkXCHAzTyQ== + dependencies: + inherits "^2.0.4" + source-map "^0.6.1" + source-map-resolve "^0.6.0" + csso@^4.0.2: version "4.2.0" resolved "https://registry.npmjs.org/csso/-/csso-4.2.0.tgz#ea3a561346e8dc9f546d6febedd50187cf389529" @@ -599,6 +622,22 @@ d@1, d@^1.0.1: es5-ext "^0.10.50" type "^1.0.1" +debug-fabulous@^1.0.0: + version "1.1.0" + resolved "https://registry.npmjs.org/debug-fabulous/-/debug-fabulous-1.1.0.tgz#af8a08632465224ef4174a9f06308c3c2a1ebc8e" + integrity sha512-GZqvGIgKNlUnHUPQhepnUZFIMoi3dgZKQBzKDeL2g7oJF9SNAji/AAu36dusFUas0O+pae74lNeoIPHqXWDkLg== + dependencies: + debug "3.X" + memoizee "0.4.X" + object-assign "4.X" + +debug@3.X: + version "3.2.7" + resolved "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz#72580b7e9145fb39b6676f9c5e5fb100b934179a" + integrity sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ== + dependencies: + ms "^2.1.1" + debug@^2.2.0, debug@^2.3.3: version "2.6.9" resolved "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz#5d128515df134ff327e90a4c93f4e077a536341f" @@ -662,6 +701,11 @@ detect-file@^1.0.0: resolved "https://registry.npmjs.org/detect-file/-/detect-file-1.0.0.tgz#f0d66d03672a825cb1b73bdb3fe62310c8e552b7" integrity sha1-8NZtA2cqglyxtzvbP+YjEMjlUrc= +detect-newline@^2.0.0: + version "2.1.0" + resolved "https://registry.npmjs.org/detect-newline/-/detect-newline-2.1.0.tgz#f41f1c10be4b00e87b5f13da680759f2c5bfd3e2" + integrity sha1-9B8cEL5LAOh7XxPaaAdZ8sW/0+I= + duplexify@^3.6.0: version "3.7.1" resolved "https://registry.npmjs.org/duplexify/-/duplexify-3.7.1.tgz#2a4df5317f6ccfd91f86d6fd25d8d8a103b88309" @@ -699,7 +743,7 @@ error-ex@^1.2.0, error-ex@^1.3.1: dependencies: is-arrayish "^0.2.1" -es5-ext@^0.10.35, es5-ext@^0.10.46, es5-ext@^0.10.50: +es5-ext@^0.10.35, es5-ext@^0.10.46, es5-ext@^0.10.50, es5-ext@^0.10.53, es5-ext@~0.10.14, es5-ext@~0.10.2, es5-ext@~0.10.46: version "0.10.53" resolved "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.53.tgz#93c5a3acfdbef275220ad72644ad02ee18368de1" integrity sha512-Xs2Stw6NiNHWypzRTY1MtaG/uJlwCk8kH81920ma8mvN8Xq1gsfhZvpkImLQArw8AHnv8MT2I45J3c0R8slE+Q== @@ -725,7 +769,7 @@ es6-symbol@^3.1.1, es6-symbol@~3.1.3: d "^1.0.1" ext "^1.1.2" -es6-weak-map@^2.0.1: +es6-weak-map@^2.0.1, es6-weak-map@^2.0.3: version "2.0.3" resolved "https://registry.npmjs.org/es6-weak-map/-/es6-weak-map-2.0.3.tgz#b6da1f16cc2cc0d9be43e6bdbfc5e7dfcdf31d53" integrity sha512-p5um32HOTO1kP+w7PRnB+5lQ43Z6muuMuIMffvDN8ZB4GcnjLBV6zGStpbASIMk4DCAvEaamhe2zhyCb/QXXsA== @@ -740,11 +784,24 @@ escalade@^3.1.1: resolved "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz#d8cfdc7000965c5a0174b4a82eaa5c0552742e40" integrity sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw== +escape-string-regexp@^1.0.5: + version "1.0.5" + resolved "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" + integrity sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ= + esprima@^4.0.0: version "4.0.1" resolved "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz#13b04cdb3e6c5d19df91ab6987a8695619b0aa71" integrity sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A== +event-emitter@^0.3.5: + version "0.3.5" + resolved "https://registry.npmjs.org/event-emitter/-/event-emitter-0.3.5.tgz#df8c69eef1647923c7157b9ce83840610b02cc39" + integrity sha1-34xp7vFkeSPHFXuc6DhAYQsCzDk= + dependencies: + d "1" + es5-ext "~0.10.14" + expand-brackets@^2.1.4: version "2.1.4" resolved "https://registry.npmjs.org/expand-brackets/-/expand-brackets-2.1.4.tgz#b77735e315ce30f6b6eff0f83b04151a22449622" @@ -1096,6 +1153,36 @@ gulp-postcss@^9.0.0: postcss-load-config "^2.1.1" vinyl-sourcemaps-apply "^0.2.1" +gulp-sass@^5.0.0: + version "5.0.0" + resolved "https://registry.npmjs.org/gulp-sass/-/gulp-sass-5.0.0.tgz#c338fc021e450a51ae977fea9014eda331ce66b7" + integrity sha512-J0aH0/2N4+2szGCeut0ktGHK0Wg8L9uWivuigrl7xv+nhxozBQRAKLrhnDDaTa3FeUWYtgT8w4RlgdhRy5v16w== + dependencies: + chalk "^4.1.1" + lodash "^4.17.20" + plugin-error "^1.0.1" + replace-ext "^2.0.0" + strip-ansi "^6.0.0" + transfob "^1.0.0" + vinyl-sourcemaps-apply "^0.2.1" + +gulp-sourcemaps@^3.0.0: + version "3.0.0" + resolved "https://registry.npmjs.org/gulp-sourcemaps/-/gulp-sourcemaps-3.0.0.tgz#2e154e1a2efed033c0e48013969e6f30337b2743" + integrity sha512-RqvUckJkuYqy4VaIH60RMal4ZtG0IbQ6PXMNkNsshEGJ9cldUPRb/YCgboYae+CLAs1HQNb4ADTKCx65HInquQ== + dependencies: + "@gulp-sourcemaps/identity-map" "^2.0.1" + "@gulp-sourcemaps/map-sources" "^1.0.0" + acorn "^6.4.1" + convert-source-map "^1.0.0" + css "^3.0.0" + debug-fabulous "^1.0.0" + detect-newline "^2.0.0" + graceful-fs "^4.0.0" + source-map "^0.6.0" + strip-bom-string "^1.0.0" + through2 "^2.0.0" + gulp-terser@^2.0.1: version "2.0.1" resolved "https://registry.npmjs.org/gulp-terser/-/gulp-terser-2.0.1.tgz#5f8f4fc54588b79519243809cc8eef4936286d0d" @@ -1123,6 +1210,11 @@ gulplog@^1.0.0: dependencies: glogg "^1.0.0" +has-flag@^3.0.0: + version "3.0.0" + resolved "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz#b5d454dc2199ae225699f3467e5a07f3b955bafd" + integrity sha1-tdRU3CGZriJWmfNGfloH87lVuv0= + has-flag@^4.0.0: version "4.0.0" resolved "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz#944771fd9c81c81265c4d6941860da06bb59479b" @@ -1213,7 +1305,7 @@ inflight@^1.0.4: once "^1.3.0" wrappy "1" -inherits@2, inherits@^2.0.1, inherits@^2.0.3, inherits@~2.0.3: +inherits@2, inherits@^2.0.1, inherits@^2.0.3, inherits@^2.0.4, inherits@~2.0.3: version "2.0.4" resolved "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c" integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ== @@ -1395,6 +1487,11 @@ is-plain-object@^5.0.0: resolved "https://registry.npmjs.org/is-plain-object/-/is-plain-object-5.0.0.tgz#4427f50ab3429e9025ea7d52e9043a9ef4159344" integrity sha512-VRSzKkbMm5jMDoKLbltAkFQ5Qr7VDiTFGXxYFXXowVj387GeGNOCsOH6Msy00SGZ3Fp84b1Naa1psqgcCIEP5Q== +is-promise@^2.2.2: + version "2.2.2" + resolved "https://registry.npmjs.org/is-promise/-/is-promise-2.2.2.tgz#39ab959ccbf9a774cf079f7b40c7a26f763135f1" + integrity sha512-+lP4/6lKUBfQjZ2pdxThZvLUAafmZb8OAxFb8XXtiQmS35INgr85hdOGoEs124ez1FCnZJt6jau/T+alh58QFQ== + is-relative@^1.0.0: version "1.0.0" resolved "https://registry.npmjs.org/is-relative/-/is-relative-1.0.0.tgz#a1bb6935ce8c5dba1e8b9754b9b2dcc020e2260d" @@ -1557,11 +1654,18 @@ local-access@^1.0.1: resolved "https://registry.npmjs.org/local-access/-/local-access-1.1.0.tgz#e007c76ba2ca83d5877ba1a125fc8dfe23ba4798" integrity sha512-XfegD5pyTAfb+GY6chk283Ox5z8WexG56OvM06RWLpAc/UHozO8X6xAxEkIitZOtsSMM1Yr3DkHgW5W+onLhCw== -lodash@^4.17.21: +lodash@^4.17.20: version "4.17.21" resolved "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c" integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg== +lru-queue@^0.1.0: + version "0.1.0" + resolved "https://registry.npmjs.org/lru-queue/-/lru-queue-0.1.0.tgz#2738bd9f0d3cf4f84490c5736c48699ac632cda3" + integrity sha1-Jzi9nw089PhEkMVzbEhpmsYyzaM= + dependencies: + es5-ext "~0.10.2" + make-iterator@^1.0.0: version "1.0.1" resolved "https://registry.npmjs.org/make-iterator/-/make-iterator-1.0.1.tgz#29b33f312aa8f547c4a5e490f56afcec99133ad6" @@ -1596,6 +1700,20 @@ mdn-data@2.0.14: resolved "https://registry.npmjs.org/mdn-data/-/mdn-data-2.0.14.tgz#7113fc4281917d63ce29b43446f701e68c25ba50" integrity sha512-dn6wd0uw5GsdswPFfsgMp5NSB0/aDe6fK94YJV/AJDYXL6HVLWBsxeq7js7Ad+mU2K9LAlwpk6kN2D5mwCPVow== +memoizee@0.4.X: + version "0.4.15" + resolved "https://registry.npmjs.org/memoizee/-/memoizee-0.4.15.tgz#e6f3d2da863f318d02225391829a6c5956555b72" + integrity sha512-UBWmJpLZd5STPm7PMUlOw/TSy972M+z8gcyQ5veOnSDRREz/0bmpyTfKt3/51DhEBqCZQn1udM/5flcSPYhkdQ== + dependencies: + d "^1.0.1" + es5-ext "^0.10.53" + es6-weak-map "^2.0.3" + event-emitter "^0.3.5" + is-promise "^2.2.2" + lru-queue "^0.1.0" + next-tick "^1.1.0" + timers-ext "^0.1.7" + micromatch@^3.0.4, micromatch@^3.1.10, micromatch@^3.1.4: version "3.1.10" resolved "https://registry.npmjs.org/micromatch/-/micromatch-3.1.10.tgz#70859bc95c9840952f359a068a3fc49f9ecfac23" @@ -1645,6 +1763,11 @@ ms@2.0.0: resolved "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8" integrity sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g= +ms@^2.1.1: + version "2.1.3" + resolved "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz#574c8138ce1d2b5861f0b44579dbadd60c6615b2" + integrity sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA== + mute-stdout@^1.0.0: version "1.0.1" resolved "https://registry.npmjs.org/mute-stdout/-/mute-stdout-1.0.1.tgz#acb0300eb4de23a7ddeec014e3e96044b3472331" @@ -1677,6 +1800,11 @@ nanomatch@^1.2.9: snapdragon "^0.8.1" to-regex "^3.0.1" +next-tick@1, next-tick@^1.1.0: + version "1.1.0" + resolved "https://registry.npmjs.org/next-tick/-/next-tick-1.1.0.tgz#1836ee30ad56d67ef281b22bd199f709449b35eb" + integrity sha512-CXdUiJembsNjuToQvxayPZF9Vqht7hewsvy2sOWafLvi2awflj9mOC6bHIg50orX8IJvWKY9wYQ/zB2kogPslQ== + next-tick@~1.0.0: version "1.0.0" resolved "https://registry.npmjs.org/next-tick/-/next-tick-1.0.0.tgz#ca86d1fe8828169b0120208e3dc8424b9db8342c" @@ -1697,7 +1825,7 @@ normalize-package-data@^2.3.2: semver "2 || 3 || 4 || 5" validate-npm-package-license "^3.0.1" -normalize-path@^2.1.1: +normalize-path@^2.0.1, normalize-path@^2.1.1: version "2.1.1" resolved "https://registry.npmjs.org/normalize-path/-/normalize-path-2.1.1.tgz#1ab28b556e198363a8c1a6f7e6fa20137fe6aed9" integrity sha1-GrKLVW4Zg2Oowab35vogE3/mrtk= @@ -1726,6 +1854,11 @@ number-is-nan@^1.0.0: resolved "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz#097b602b53422a522c1afb8790318336941a011d" integrity sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0= +object-assign@4.X: + version "4.1.1" + resolved "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863" + integrity sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM= + object-copy@^0.1.0: version "0.1.0" resolved "https://registry.npmjs.org/object-copy/-/object-copy-0.1.0.tgz#7e7d858b781bd7c991a41ba975ed3812754e998c" @@ -1950,6 +2083,15 @@ postcss-value-parser@^4.1.0: resolved "https://registry.npmjs.org/postcss-value-parser/-/postcss-value-parser-4.1.0.tgz#443f6a20ced6481a2bda4fa8532a6e55d789a2cb" integrity sha512-97DXOFbQJhk71ne5/Mt6cOu6yxsSfM0QGQyl0L25Gca4yGWEGJaig7l7gbCX623VqTBNGLRLaVUCnNkcedlRSQ== +postcss@^7.0.16: + version "7.0.36" + resolved "https://registry.npmjs.org/postcss/-/postcss-7.0.36.tgz#056f8cffa939662a8f5905950c07d5285644dfcb" + integrity sha512-BebJSIUMwJHRH0HAQoxN4u1CN86glsrwsW0q7T+/m44eXOUAxSNdHRkNZPYz5vVUbg17hFgOQDE7fZk7li3pZw== + dependencies: + chalk "^2.4.2" + source-map "^0.6.1" + supports-color "^6.1.0" + postcss@^8.2.15: version "8.3.6" resolved "https://registry.npmjs.org/postcss/-/postcss-8.3.6.tgz#2730dd76a97969f37f53b9a6096197be311cc4ea" @@ -2003,7 +2145,7 @@ read-pkg@^1.0.0: normalize-package-data "^2.3.2" path-type "^1.0.0" -readable-stream@3: +"readable-stream@2 || 3", readable-stream@3: version "3.6.0" resolved "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz#337bbda3adc0706bd3e024426a286d4b4b2c9198" integrity sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA== @@ -2179,7 +2321,7 @@ safe-regex@^1.1.0: dependencies: ret "~0.1.10" -sass@^1.32.13, sass@^1.32.8: +sass@^1.37.5: version "1.37.5" resolved "https://registry.npmjs.org/sass/-/sass-1.37.5.tgz#f6838351f7cc814c4fcfe1d9a20e0cabbd1e7b3c" integrity sha512-Cx3ewxz9QB/ErnVIiWg2cH0kiYZ0FPvheDTVC6BsiEGBTZKKZJ1Gq5Kq6jy3PKtL6+EJ8NIoaBW/RSd2R6cZOA== @@ -2287,6 +2429,14 @@ source-map-resolve@^0.5.0: source-map-url "^0.4.0" urix "^0.1.0" +source-map-resolve@^0.6.0: + version "0.6.0" + resolved "https://registry.npmjs.org/source-map-resolve/-/source-map-resolve-0.6.0.tgz#3d9df87e236b53f16d01e58150fc7711138e5ed2" + integrity sha512-KXBr9d/fO/bWo97NXsPIAW1bFSBOuCnjbNTBMO7N59hsv5i9yzRDfcYwwt0l04+VqnKC+EwzvJZIP/qkuMgR/w== + dependencies: + atob "^2.1.2" + decode-uri-component "^0.2.0" + source-map-support@~0.5.19: version "0.5.19" resolved "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.19.tgz#a98b62f86dcaf4f67399648c085291ab9e8fed61" @@ -2418,6 +2568,11 @@ strip-ansi@^6.0.0: dependencies: ansi-regex "^5.0.0" +strip-bom-string@^1.0.0: + version "1.0.0" + resolved "https://registry.npmjs.org/strip-bom-string/-/strip-bom-string-1.0.0.tgz#e5211e9224369fbb81d633a2f00044dc8cedad92" + integrity sha1-5SEekiQ2n7uB1jOi8ABE3IztrZI= + strip-bom@^2.0.0: version "2.0.0" resolved "https://registry.npmjs.org/strip-bom/-/strip-bom-2.0.0.tgz#6219a85616520491f35788bdbf1447a99c7e6b0e" @@ -2425,6 +2580,20 @@ strip-bom@^2.0.0: dependencies: is-utf8 "^0.2.0" +supports-color@^5.3.0: + version "5.5.0" + resolved "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz#e2e69a44ac8772f78a1ec0b35b689df6530efc8f" + integrity sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow== + dependencies: + has-flag "^3.0.0" + +supports-color@^6.1.0: + version "6.1.0" + resolved "https://registry.npmjs.org/supports-color/-/supports-color-6.1.0.tgz#0764abc69c63d5ac842dd4867e8d025e880df8f3" + integrity sha512-qe1jfm1Mg7Nq/NSh6XE24gPXROEVsWHxC1LIx//XNlD9iw7YZQGjZNjYN7xGaEG6iKdA8EtNFW6R0gjnVXp+wQ== + dependencies: + has-flag "^3.0.0" + supports-color@^7.1.0: version "7.2.0" resolved "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz#1b7dcdcb32b8138801b3e478ba6a51caa89648da" @@ -2465,6 +2634,14 @@ through2@^2.0.0, through2@^2.0.3, through2@~2.0.0: readable-stream "~2.3.6" xtend "~4.0.1" +through2@^3.0.1: + version "3.0.2" + resolved "https://registry.npmjs.org/through2/-/through2-3.0.2.tgz#99f88931cfc761ec7678b41d5d7336b5b6a07bf4" + integrity sha512-enaDQ4MUyP2W6ZyT6EsMzqBPZaM/avg8iuo+l2d3QCs0J+6RaqkHV/2/lOwDTueBHeJ/2LG9lrLW3d5rWPucuQ== + dependencies: + inherits "^2.0.4" + readable-stream "2 || 3" + through2@^4.0.2: version "4.0.2" resolved "https://registry.npmjs.org/through2/-/through2-4.0.2.tgz#a7ce3ac2a7a8b0b966c80e7c49f0484c3b239764" @@ -2477,6 +2654,14 @@ time-stamp@^1.0.0: resolved "https://registry.npmjs.org/time-stamp/-/time-stamp-1.1.0.tgz#764a5a11af50561921b133f3b44e618687e0f5c3" integrity sha1-dkpaEa9QVhkhsTPztE5hhofg9cM= +timers-ext@^0.1.7: + version "0.1.7" + resolved "https://registry.npmjs.org/timers-ext/-/timers-ext-0.1.7.tgz#6f57ad8578e07a3fb9f91d9387d65647555e25c6" + integrity sha512-b85NUNzTSdodShTIbky6ZF02e8STtVVfD+fu4aXXShEELpozH+bCpJLYMPZbsABN2wDH7fJpqIoXxJpzbf0NqQ== + dependencies: + es5-ext "~0.10.46" + next-tick "1" + tinydate@^1.0.0: version "1.3.0" resolved "https://registry.npmjs.org/tinydate/-/tinydate-1.3.0.tgz#e6ca8e5a22b51bb4ea1c3a2a4fd1352dbd4c57fb" @@ -2534,6 +2719,11 @@ totalist@^1.0.0: resolved "https://registry.npmjs.org/totalist/-/totalist-1.1.0.tgz#a4d65a3e546517701e3e5c37a47a70ac97fe56df" integrity sha512-gduQwd1rOdDMGxFG1gEvhV88Oirdo2p+KjoYFU7k2g+i7n6AFFbDQ5kMPUsW0pNbfQsB/cwXvT1i4Bue0s9g5g== +transfob@^1.0.0: + version "1.0.0" + resolved "https://registry.npmjs.org/transfob/-/transfob-1.0.0.tgz#c7fc27a5b5430ad486267ae666d923f74a0ab320" + integrity sha1-x/wnpbVDCtSGJnrmZtkj90oKsyA= + type@^1.0.1: version "1.2.0" resolved "https://registry.npmjs.org/type/-/type-1.2.0.tgz#848dd7698dafa3e54a6c479e759c4bc3f18847a0" From d16f5ffa2710874cee209b0a52bc62ae3b695d39 Mon Sep 17 00:00:00 2001 From: Nikita Karamov Date: Sat, 14 Aug 2021 18:54:32 +0200 Subject: [PATCH 03/18] Update JS pipeline --- gulpfile.js | 4 +++- src/index.html | 2 +- src/{script/index.js => main.js} | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) rename src/{script/index.js => main.js} (99%) diff --git a/gulpfile.js b/gulpfile.js index 812ed1d..09634e2 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -20,8 +20,10 @@ function css() { } function js() { - return gulp.src('./src/script/index.js') + return gulp.src('./src/main.js') + .pipe(sourcemaps.init()) .pipe(terser({ ecma: 5 })) + .pipe(sourcemaps.write('.')) .pipe(gulp.dest('./dist/')); } diff --git a/src/index.html b/src/index.html index 49bd8d5..3cffec0 100644 --- a/src/index.html +++ b/src/index.html @@ -101,6 +101,6 @@ toot on GitHub - + diff --git a/src/script/index.js b/src/main.js similarity index 99% rename from src/script/index.js rename to src/main.js index 60f2417..04c8182 100644 --- a/src/script/index.js +++ b/src/main.js @@ -1,4 +1,4 @@ -/* +/*! toot - Cross-instance share page for Mastodon Copyright (C) 2020-2021 Nikita Karamov From 7b976026a42e0ceb228556f1987f882e123d477f Mon Sep 17 00:00:00 2001 From: Nikita Karamov Date: Sat, 14 Aug 2021 19:01:37 +0200 Subject: [PATCH 04/18] Update package.json --- package.json | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index 362eb93..cd63997 100644 --- a/package.json +++ b/package.json @@ -1,11 +1,15 @@ { "name": "toot", "version": "1.2.2", - "main": "src/index.pug", - "repository": "git@github.com:NickKaramoff/toot.git", + "description": "Cross-instance share page for Mastodon", + "license": "AGPL-3.0-or-later", "author": "Nikita Karamov ", - "license": "AGPL-3.0-only", - "private": "true", + "homepage": "https://toot.karamoff.dev/", + "repository": { + "type": "git", + "url": "https://github.com/NickKaramoff/toot.git" + }, + "private": true, "scripts": { "build": "gulp", "dev": "gulp watch", From 55c1e677e023b9b54db211f08bd54a6a5fad1ae8 Mon Sep 17 00:00:00 2001 From: Nikita Karamov Date: Sat, 14 Aug 2021 19:03:29 +0200 Subject: [PATCH 05/18] Remove old logo.svg --- src/logo.svg | 5 ----- 1 file changed, 5 deletions(-) delete mode 100644 src/logo.svg diff --git a/src/logo.svg b/src/logo.svg deleted file mode 100644 index c41ed9b..0000000 --- a/src/logo.svg +++ /dev/null @@ -1,5 +0,0 @@ - - - - - From 67808803a403fe4ae4e3c4d3d3a448b24991378f Mon Sep 17 00:00:00 2001 From: Nikita Karamov Date: Sat, 14 Aug 2021 19:12:42 +0200 Subject: [PATCH 06/18] Use Prettier to format files --- .prettierignore | 2 ++ .prettierrc.json | 1 + gulpfile.js | 43 ++++++++++++++-------------- package.json | 7 +++-- src/main.js | 60 +++++++++++++++++++--------------------- src/scss/_variables.scss | 6 ++-- src/scss/style.scss | 8 +++--- yarn.lock | 5 ++++ 8 files changed, 68 insertions(+), 64 deletions(-) create mode 100644 .prettierignore create mode 100644 .prettierrc.json diff --git a/.prettierignore b/.prettierignore new file mode 100644 index 0000000..86b67dc --- /dev/null +++ b/.prettierignore @@ -0,0 +1,2 @@ +dist +*.md diff --git a/.prettierrc.json b/.prettierrc.json new file mode 100644 index 0000000..0967ef4 --- /dev/null +++ b/.prettierrc.json @@ -0,0 +1 @@ +{} diff --git a/gulpfile.js b/gulpfile.js index 09634e2..4776daf 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -1,42 +1,41 @@ -const gulp = require('gulp'); -const postcss = require('gulp-postcss'); -const sass = require('gulp-sass')(require('sass')); -const sourcemaps = require('gulp-sourcemaps'); -const terser = require('gulp-terser'); - +const gulp = require("gulp"); +const postcss = require("gulp-postcss"); +const sass = require("gulp-sass")(require("sass")); +const sourcemaps = require("gulp-sourcemaps"); +const terser = require("gulp-terser"); function html() { - return gulp.src('./src/index.html') - .pipe(gulp.dest('./dist/')); + return gulp.src("./src/index.html").pipe(gulp.dest("./dist/")); } function css() { - return gulp.src('./src/scss/*.scss') + return gulp + .src("./src/scss/*.scss") .pipe(sourcemaps.init()) - .pipe(sass.sync().on('error', sass.logError)) + .pipe(sass.sync().on("error", sass.logError)) .pipe(postcss([require("autoprefixer"), require("postcss-csso")])) - .pipe(sourcemaps.write('.')) - .pipe(gulp.dest('./dist/')); + .pipe(sourcemaps.write(".")) + .pipe(gulp.dest("./dist/")); } function js() { - return gulp.src('./src/main.js') + return gulp + .src("./src/main.js") .pipe(sourcemaps.init()) .pipe(terser({ ecma: 5 })) - .pipe(sourcemaps.write('.')) - .pipe(gulp.dest('./dist/')); + .pipe(sourcemaps.write(".")) + .pipe(gulp.dest("./dist/")); } function static() { - return gulp.src('./src/static/**/*') - .pipe(gulp.dest('./dist/')); + return gulp.src("./src/static/**/*").pipe(gulp.dest("./dist/")); } exports.default = gulp.parallel(html, css, js, static); exports.watch = () => { - gulp.watch('./src/index.pug', html); - gulp.watch('./src/style/*.scss', css); - gulp.watch('./src/script/index.js', js); - gulp.watch('./src/static/*', static); -} + gulp.watch("./src/index.pug", html); + gulp.watch("./src/style/*.scss", css); + gulp.watch("./src/script/index.js", js); + gulp.watch("./src/static/*", static); +}; diff --git a/package.json b/package.json index cd63997..6da603a 100644 --- a/package.json +++ b/package.json @@ -6,9 +6,9 @@ "author": "Nikita Karamov ", "homepage": "https://toot.karamoff.dev/", "repository": { - "type": "git", - "url": "https://github.com/NickKaramoff/toot.git" - }, + "type": "git", + "url": "https://github.com/NickKaramoff/toot.git" + }, "private": true, "scripts": { "build": "gulp", @@ -25,6 +25,7 @@ "gulp-terser": "^2.0.1", "postcss": "^8.2.15", "postcss-csso": "^5.0.1", + "prettier": "2.3.2", "sass": "^1.37.5", "sirv-cli": "^1.0.10" }, diff --git a/src/main.js b/src/main.js index 04c8182..b527f1c 100644 --- a/src/main.js +++ b/src/main.js @@ -20,32 +20,30 @@ function normalizeUrl(url) { if (url.indexOf("http://") == -1 && url.indexOf("https://") == -1) { url = "https://" + url; } - if (url.charAt(url.length - 1) !== '/'){ + if (url.charAt(url.length - 1) !== "/") { url = url + "/"; } return url; } -const instance = document.getElementById('instance'); -const instances_list = document.getElementById('instances_list'); +const instance = document.getElementById("instance"); +const instances_list = document.getElementById("instances_list"); -var prefillInstance = window.localStorage.getItem('mastodon_instance'); +var prefillInstance = window.localStorage.getItem("mastodon_instance"); -var paramPairs = window.location.search.substr(1).split('&'); +var paramPairs = window.location.search.substr(1).split("&"); var paramPairsLength = paramPairs.length; for (var i = 0; i < paramPairsLength; i++) { - var paramPair = paramPairs[i].split('='); - if (paramPair[0] === 'text') { - document.getElementById('text').value = decodeURIComponent(paramPair[1]); - } else if (paramPair[0] === 'instance') { + var paramPair = paramPairs[i].split("="); + if (paramPair[0] === "text") { + document.getElementById("text").value = decodeURIComponent(paramPair[1]); + } else if (paramPair[0] === "instance") { prefillInstance = decodeURIComponent(paramPair[1]); } } -delete i -delete paramPair function instances_loading_error() { - console.error('Failed to fetch servers list from joinmastodon.'); + console.error("Failed to fetch servers list from joinmastodon."); } function instances_loaded() { @@ -57,14 +55,14 @@ function instances_loaded() { const servers = JSON.parse(this.responseText); const chosen_instance = instance.value; - const domains = servers.map(obj => obj.domain); + const domains = servers.map((obj) => obj.domain); if (chosen_instance && domains.indexOf(chosen_instance) === -1) { domains.push(chosen_instance); } domains.sort(); for (const domain of domains) { - const opt = document.createElement('option'); + const opt = document.createElement("option"); opt.value = normalizeUrl(domain); instances_list.appendChild(opt); } @@ -74,28 +72,26 @@ if (prefillInstance != null) { instance.value = normalizeUrl(prefillInstance); } -instance.addEventListener('focus', function (e) { +instance.addEventListener("focus", function (e) { if (instances_list.children.length === 0) { const req = new XMLHttpRequest(); - req.addEventListener('load', instances_loaded); - req.addEventListener('error', instances_loading_error); - req.open('GET', 'https://api.joinmastodon.org/servers'); + req.addEventListener("load", instances_loaded); + req.addEventListener("error", instances_loading_error); + req.open("GET", "https://api.joinmastodon.org/servers"); req.send(); } -}) +}); -document - .getElementById('form') - .addEventListener('submit', function (e) { - e.preventDefault(); - var text = e.target.elements['text'].value; - var instance = normalizeUrl(e.target.elements['instance'].value); - var remember = e.target.elements['remember'].checked; +document.getElementById("form").addEventListener("submit", function (e) { + e.preventDefault(); + var text = e.target.elements["text"].value; + var instance = normalizeUrl(e.target.elements["instance"].value); + var remember = e.target.elements["remember"].checked; - if (remember) { - window.localStorage.setItem('mastodon_instance', instance); - } + if (remember) { + window.localStorage.setItem("mastodon_instance", instance); + } - var shareUrl = instance + "share?text=" + encodeURIComponent(text); - window.location.href = shareUrl; - }) + var shareUrl = instance + "share?text=" + encodeURIComponent(text); + window.location.href = shareUrl; +}); diff --git a/src/scss/_variables.scss b/src/scss/_variables.scss index e24079f..6a6000d 100644 --- a/src/scss/_variables.scss +++ b/src/scss/_variables.scss @@ -16,11 +16,11 @@ along with this program. If not, see . */ -$text-font: 'Roboto', sans-serif; +$text-font: "Roboto", sans-serif; -$bg: #1F232B; +$bg: #1f232b; $text: #9baec8; -$title:#d9e1e8; +$title: #d9e1e8; $button-bg: #2b90d9; $button-hover-bg: #56a7e1; diff --git a/src/scss/style.scss b/src/scss/style.scss index 8ba1837..3607e94 100644 --- a/src/scss/style.scss +++ b/src/scss/style.scss @@ -101,11 +101,11 @@ main { font-size: 1rem; border-radius: 4px; - &[type=checkbox] { + &[type="checkbox"] { margin-right: 8px; } - &[type=submit] { + &[type="submit"] { display: inline-block; text-align: center; background-color: $button-bg; @@ -127,7 +127,7 @@ main { } textarea, - input[type=url] { + input[type="url"] { color: inherit; width: 100%; outline: 0; @@ -162,7 +162,7 @@ footer { flex-wrap: wrap; section { - margin: .5rem 1rem; + margin: 0.5rem 1rem; a { color: inherit; diff --git a/yarn.lock b/yarn.lock index 109882c..c6cf772 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2101,6 +2101,11 @@ postcss@^8.2.15: nanoid "^3.1.23" source-map-js "^0.6.2" +prettier@2.3.2: + version "2.3.2" + resolved "https://registry.npmjs.org/prettier/-/prettier-2.3.2.tgz#ef280a05ec253712e486233db5c6f23441e7342d" + integrity sha512-lnJzDfJ66zkMy58OL5/NY5zp70S7Nz6KqcKkXYzn2tMVrNxvbqaBpg7H3qHaLxCJ5lNMsGuM8+ohS7cZrthdLQ== + pretty-hrtime@^1.0.0: version "1.0.3" resolved "https://registry.npmjs.org/pretty-hrtime/-/pretty-hrtime-1.0.3.tgz#b7e3ea42435a4c9b2759d99e0f201eb195802ee1" From 1e0469ebee1f20f68fd7aeca48c4bd653a4790f8 Mon Sep 17 00:00:00 2001 From: Nikita Karamov Date: Sat, 14 Aug 2021 19:12:50 +0200 Subject: [PATCH 07/18] Update robots.txt --- src/static/robots.txt | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/static/robots.txt b/src/static/robots.txt index e223f09..c2a49f4 100644 --- a/src/static/robots.txt +++ b/src/static/robots.txt @@ -1,3 +1,2 @@ User-agent: * -Allow: /$ -Disallow: / +Allow: / From 2636bedd3742e3c4eb22e524e46cd19d9b7d9e59 Mon Sep 17 00:00:00 2001 From: Nikita Karamov Date: Sat, 14 Aug 2021 21:56:01 +0200 Subject: [PATCH 08/18] Fix paths in Gulpfile --- gulpfile.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/gulpfile.js b/gulpfile.js index 4776daf..61e4abd 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -34,8 +34,8 @@ function static() { exports.default = gulp.parallel(html, css, js, static); exports.watch = () => { - gulp.watch("./src/index.pug", html); - gulp.watch("./src/style/*.scss", css); - gulp.watch("./src/script/index.js", js); + gulp.watch("./src/index.html", html); + gulp.watch("./src/scss/*.scss", css); + gulp.watch("./src/main.js", js); gulp.watch("./src/static/*", static); }; From 4b545f4a14a59686db7bacd7efabe56416eb0318 Mon Sep 17 00:00:00 2001 From: Nikita Karamov Date: Sat, 14 Aug 2021 21:56:17 +0200 Subject: [PATCH 09/18] Clean up JS code --- src/index.html | 4 +- src/main.js | 104 ++++++++++++++++++++++++++----------------------- 2 files changed, 58 insertions(+), 50 deletions(-) diff --git a/src/index.html b/src/index.html index 3cffec0..ed44418 100644 --- a/src/index.html +++ b/src/index.html @@ -73,14 +73,14 @@ >
- +
diff --git a/src/main.js b/src/main.js index b527f1c..50f31cf 100644 --- a/src/main.js +++ b/src/main.js @@ -16,6 +16,18 @@ along with this program. If not, see . */ +const INSTANCE_LIST_URL = "https://api.joinmastodon.org/servers"; + +const $instance = document.getElementById("instance"); +const $instanceDatalist = document.getElementById("instanceDatalist"); +const $form = document.getElementById("form"); + +/** + * Adds missing "https://" and ending slash to the URL + * + * @param {string} url URL to normalize + * @return {string} normalized URL + */ function normalizeUrl(url) { if (url.indexOf("http://") == -1 && url.indexOf("https://") == -1) { url = "https://" + url; @@ -26,72 +38,68 @@ function normalizeUrl(url) { return url; } -const instance = document.getElementById("instance"); -const instances_list = document.getElementById("instances_list"); +function onLoadInstancesError() { + console.error("Couldn't load instance list"); +} -var prefillInstance = window.localStorage.getItem("mastodon_instance"); +function onLoadInstancesSuccess() { + if (this.status >= 400) { + return onLoadInstancesError(); + } -var paramPairs = window.location.search.substr(1).split("&"); -var paramPairsLength = paramPairs.length; -for (var i = 0; i < paramPairsLength; i++) { - var paramPair = paramPairs[i].split("="); - if (paramPair[0] === "text") { - document.getElementById("text").value = decodeURIComponent(paramPair[1]); - } else if (paramPair[0] === "instance") { - prefillInstance = decodeURIComponent(paramPair[1]); + const currentInstance = $instance.value; + const instanceDomains = JSON.parse(this.responseText).map((i) => i.domain); + if (currentInstance && instanceDomains.indexOf(currentInstance) < 0) { + instanceDomains.push(currentInstance); + } + instanceDomains.sort(); + + for (let i = 0; i < instanceDomains.length; i++) { + const $option = document.createElement("option"); + $option.value = normalizeUrl(instanceDomains[i]); + $instanceDatalist.appendChild($option); } } -function instances_loading_error() { - console.error("Failed to fetch servers list from joinmastodon."); +function loadInstances() { + if ($instanceDatalist.children.length === 0) { + const request = new XMLHttpRequest(); + + request.addEventListener("load", onLoadInstancesSuccess); + request.addEventListener("error", onLoadInstancesError); + + request.open("GET", INSTANCE_LIST_URL); + request.send(); + } } -function instances_loaded() { - if (this.status !== 200) { - instances_loading_error(); - return; - } +const prefillInstance = window.localStorage.getItem("mastodon_instance"); - const servers = JSON.parse(this.responseText); - - const chosen_instance = instance.value; - const domains = servers.map((obj) => obj.domain); - if (chosen_instance && domains.indexOf(chosen_instance) === -1) { - domains.push(chosen_instance); - } - domains.sort(); - - for (const domain of domains) { - const opt = document.createElement("option"); - opt.value = normalizeUrl(domain); - instances_list.appendChild(opt); +const URLParams = window.location.search.substr(1).split("&"); +for (let i = 0; i < URLParams.length; i++) { + const URLParamPair = URLParams[i].split("="); + if (URLParamPair[0] === "text") { + document.getElementById("text").value = decodeURIComponent(URLParamPair[1]); + } else if (URLParamPair[0] === "instance") { + prefillInstance = decodeURIComponent(URLParamPair[1]); } } if (prefillInstance != null) { - instance.value = normalizeUrl(prefillInstance); + $instance.value = normalizeUrl(prefillInstance); } -instance.addEventListener("focus", function (e) { - if (instances_list.children.length === 0) { - const req = new XMLHttpRequest(); - req.addEventListener("load", instances_loaded); - req.addEventListener("error", instances_loading_error); - req.open("GET", "https://api.joinmastodon.org/servers"); - req.send(); - } -}); +$instance.addEventListener("focus", loadInstances); -document.getElementById("form").addEventListener("submit", function (e) { +$form.addEventListener("submit", function (e) { e.preventDefault(); - var text = e.target.elements["text"].value; - var instance = normalizeUrl(e.target.elements["instance"].value); - var remember = e.target.elements["remember"].checked; + const text = e.target.elements["text"].value; + const instanceURL = normalizeUrl(e.target.elements["instance"].value); + const remember = e.target.elements["remember"].checked; if (remember) { - window.localStorage.setItem("mastodon_instance", instance); + window.localStorage.setItem("mastodon_instance", instanceURL); } - var shareUrl = instance + "share?text=" + encodeURIComponent(text); - window.location.href = shareUrl; + window.location.href = instanceURL + "share?text=" + encodeURIComponent(text); }); From 7839dfa6fffa8664c5e6651c1db3e37f00d86d13 Mon Sep 17 00:00:00 2001 From: Nikita Karamov Date: Fri, 27 Aug 2021 15:03:24 +0200 Subject: [PATCH 10/18] Replace JS on form with a POST request Closes #12 --- api/toot.js | 35 +++++++++++++++++++++++++++++++++++ src/index.html | 2 +- src/main.js | 14 -------------- 3 files changed, 36 insertions(+), 15 deletions(-) create mode 100644 api/toot.js diff --git a/api/toot.js b/api/toot.js new file mode 100644 index 0000000..4b822e0 --- /dev/null +++ b/api/toot.js @@ -0,0 +1,35 @@ +/*! + toot - Cross-instance share page for Mastodon + Copyright (C) 2020-2021 Nikita Karamov + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as published + by the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Affero General Public License for more details. + + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see . +*/ + +module.exports = function (req, res) { + let text = ""; + let instanceURL = "https://mastodon.social/"; + if (req.body) { + if (req.body.text) { + text = req.body.text; + } + if (req.body.instance) { + instanceURL = req.body.instance; + } + } + + return res.redirect( + 303, + instanceURL + "share?text=" + encodeURIComponent(text) + ); +}; diff --git a/src/index.html b/src/index.html index ed44418..33b65e7 100644 --- a/src/index.html +++ b/src/index.html @@ -61,7 +61,7 @@

-
+