From d8027cf19bb86dcb51ca66e5c8953af348ef5628 Mon Sep 17 00:00:00 2001 From: Bauke Date: Mon, 3 Aug 2020 14:50:45 +0200 Subject: [PATCH] Replace the dodgy submodules thing with git npm dependencies. --- .gitignore | 3 -- README.md | 2 - package.json | 9 ++-- source/userscripts.js | 7 +-- source/userstyles.js | 7 +-- submodules/update.sh | 38 ------------- yarn.lock | 120 ++++++++++++++++++++++++------------------ 7 files changed, 78 insertions(+), 108 deletions(-) delete mode 100755 submodules/update.sh diff --git a/.gitignore b/.gitignore index d5e123b..f535651 100644 --- a/.gitignore +++ b/.gitignore @@ -105,6 +105,3 @@ dist # Build directory. public/ - -submodules/* -!submodules/update.sh diff --git a/README.md b/README.md index bcfde1c..61bef62 100644 --- a/README.md +++ b/README.md @@ -8,8 +8,6 @@ To build the site [Node](https://nodejs.org) and [Yarn](https://yarnpkg.com) are required. -Make sure the dependencies are installed in the project root and the submodules with `yarn --silent`. For more information see the [`.gitkeep` file in `submodules/`](https://git.holllo.cc/Bauke/bauke.xyz/src/branch/main/submodules/.gitkeep). - Then, run `yarn build`. The site will be built to the `public/` directory. ## License diff --git a/package.json b/package.json index 3057334..e33cff5 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "bauke.xyz", "description": "My personal website.", - "version": "0.1.7", + "version": "0.1.8", "author": "Bauke ", "homepage": "https://bauke.xyz", "repository": "https://git.holllo.cc/Bauke/bauke.xyz", @@ -18,7 +18,9 @@ "deploy:netlify": "netlify deploy --prod --dir 'public/' -s 37bb1f7c-2abb-419f-9a31-a4b72209c1c8" }, "dependencies": { - "modern-normalize": "^0.7.0" + "modern-normalize": "^0.7.0", + "userscripts": "git+https://git.holllo.cc/Bauke/userscripts.git", + "userstyles": "git+https://git.holllo.cc/Bauke/userstyles.git" }, "devDependencies": { "cpy-cli": "^3.1.1", @@ -39,9 +41,6 @@ } }, "xo": { - "ignores": [ - "submodules/**/*.js" - ], "prettier": true, "rules": { "no-await-in-loop": "off" diff --git a/source/userscripts.js b/source/userscripts.js index fb88a75..f6174f8 100644 --- a/source/userscripts.js +++ b/source/userscripts.js @@ -2,10 +2,7 @@ const {promises: fsp} = require('fs'); const nunjucks = require('nunjucks'); const {join} = require('path'); -const { - readScriptMetadata, - scripts -} = require('../submodules/userscripts/source'); +const {readScriptMetadata, scripts} = require('userscripts'); async function main() { // Make sure the `public/userscripts` directory exists. @@ -22,7 +19,7 @@ async function main() { const scriptMetadatas = []; // Define the source directory where the userscripts are located. - const sourceDir = join(__dirname, '../submodules/userscripts/source/'); + const sourceDir = join(__dirname, '../node_modules/userscripts/source/'); for (const script of scripts) { // Read the script metadata and add it to our array. diff --git a/source/userstyles.js b/source/userstyles.js index 1343c22..ddd0d4c 100644 --- a/source/userstyles.js +++ b/source/userstyles.js @@ -2,10 +2,7 @@ const {promises: fsp} = require('fs'); const nunjucks = require('nunjucks'); const {join} = require('path'); -const {build} = require('../submodules/userstyles/source'); -const { - readStyleMetadata -} = require('../submodules/userstyles/source/utilities'); +const {build, readStyleMetadata} = require('userstyles'); async function main() { // Make sure the `public/userstyles` directory exists. @@ -22,7 +19,7 @@ async function main() { await build(); // Define the build directory where the userstyles will be built to. - const buildDir = join(__dirname, '../submodules/userstyles/build/'); + const buildDir = join(__dirname, '../node_modules/userstyles/build/'); // Read and sort the files in the build directory. const styles = await fsp.readdir(buildDir); diff --git a/submodules/update.sh b/submodules/update.sh deleted file mode 100755 index 3f35e00..0000000 --- a/submodules/update.sh +++ /dev/null @@ -1,38 +0,0 @@ -#!/usr/bin/env bash - -set -e - -# This `submodules` directory exists to hold external projects, but without using -# Git's submodule functionality (because they're kind of a pain in the ass to use). - -# To initialize the submodules needed to build the website, just execute -# this file from the directory it's in with `./update.sh`. -# Then, if they ever need to be updated, just execute this file again. - -update() { - repo=$1 - directory=$2 - - echo "[$directory] $repo" - - if [ -d "$directory" ]; then - echo "[$directory] Pulling Git commits." - cd $directory - git pull - else - echo "[$directory] Cloning Git repository." - git clone $repo $directory - cd $directory - fi - - echo "[$directory] Installing Yarn dependencies." - yarn --silent - cd .. - - echo -} - -update "git@git.holllo.cc:Bauke/userscripts.git" "userscripts" -update "git@git.holllo.cc:Bauke/userstyles.git" "userstyles" - -echo "All done!" diff --git a/yarn.lock b/yarn.lock index b360855..63f58c4 100644 --- a/yarn.lock +++ b/yarn.lock @@ -350,9 +350,9 @@ yargs "^15.3.0" "@netlify/config@^2.0.3": - version "2.0.7" - resolved "https://registry.yarnpkg.com/@netlify/config/-/config-2.0.7.tgz#4389d02e0525be1349aea6e61bdba0f555c86c16" - integrity sha512-NeISOnfqrGKq5wtRvFCjzhEIFdecKej2QSAoeGXAEFPaJqtNEwpg1jhJWeTYVE5rbJZpJ3cKt56nxwHJEAQJ4A== + version "2.0.8" + resolved "https://registry.yarnpkg.com/@netlify/config/-/config-2.0.8.tgz#adb634ed11494b39570c572e18dc4ce37c734f2c" + integrity sha512-Q5/gT5ee+Q+LbIaA3peZ5D3zcXmXQ3WyWjRcAMfbLBp5fBJhE5qG/Nyb0swPN4hsrqHDFw+ttdxcJVny+a4A5g== dependencies: array-flat-polyfill "^1.0.1" chalk "^3.0.0" @@ -365,7 +365,7 @@ indent-string "^4.0.0" is-plain-obj "^2.1.0" js-yaml "^3.14.0" - netlify "^4.3.8" + netlify "^4.3.9" p-locate "^4.1.0" path-exists "^4.0.0" path-type "^4.0.0" @@ -375,11 +375,11 @@ yargs "^15.3.0" "@netlify/functions-utils@^1.2.0": - version "1.2.4" - resolved "https://registry.yarnpkg.com/@netlify/functions-utils/-/functions-utils-1.2.4.tgz#52286d50cafca843cc5c5c19953f231c09e18160" - integrity sha512-0eElq3Wv4TC15L+5s0/16YH8jBJ6XkZ6zPrS8/co2kmHqVstjkaWD0DqJUz6GX791j2P0GEHV6KEG7GjJ3gGUA== + version "1.2.5" + resolved "https://registry.yarnpkg.com/@netlify/functions-utils/-/functions-utils-1.2.5.tgz#f3f9a2e7b7e5256b95440f39d0a095fcc9ad404e" + integrity sha512-zx43sBkj4IRa19enklzISW9WK+Vz4ZSXx/bAhQO0YPc+TjtJSxBEnZqky1XkqHFde5l1cxBQt9vHfhVE3jrKXQ== dependencies: - "@netlify/zip-it-and-ship-it" "^1.3.7" + "@netlify/zip-it-and-ship-it" "^1.3.8" cpy "^8.1.0" path-exists "^4.0.0" @@ -406,10 +406,10 @@ dependencies: execa "^3.4.0" -"@netlify/zip-it-and-ship-it@^1.3.2", "@netlify/zip-it-and-ship-it@^1.3.7": - version "1.3.7" - resolved "https://registry.yarnpkg.com/@netlify/zip-it-and-ship-it/-/zip-it-and-ship-it-1.3.7.tgz#19173daeceae06e0b0cb0708fb672c2286029072" - integrity sha512-QV0N2bqpLmIvxs4Abrgwj8fTI2RJAs5/QbuH5cGi28vic0OJD8TpEWDtz+BSSIRDl4PlnShLYvcxU76ysq96Ow== +"@netlify/zip-it-and-ship-it@^1.3.2", "@netlify/zip-it-and-ship-it@^1.3.8": + version "1.3.8" + resolved "https://registry.yarnpkg.com/@netlify/zip-it-and-ship-it/-/zip-it-and-ship-it-1.3.8.tgz#33e2da13b3feaeea08cc33049214fa594f46db62" + integrity sha512-26MDfXGf5LbUM/CsVqGJ+d8JbbB0EhKGJiBGJLKRTDEiCWuO9qd7ZnRQJSnl83RTtXedSOxM3VZ2Ft7SpQiSDA== dependencies: archiver "^4.0.0" common-path-prefix "^2.0.0" @@ -948,9 +948,9 @@ acorn-jsx@^5.2.0: integrity sha512-HiUX/+K2YpkpJ+SzBffkM/AQ2YE03S0U1kjTLVpoJdhZMOWy8qvXVN9JdLqv2QsaQ6MPYQIuNmwD8zOiYUofLQ== acorn@^7.3.1: - version "7.3.1" - resolved "https://registry.yarnpkg.com/acorn/-/acorn-7.3.1.tgz#85010754db53c3fbaf3b9ea3e083aa5c5d147ffd" - integrity sha512-tLc0wSnatxAQHVHUapaHdz72pi9KUyHjq5KyHjGg9Y8Ifdc79pTh2XvI6I1/chZbnM7QtNKzh66ooDogPZSleA== + version "7.4.0" + resolved "https://registry.yarnpkg.com/acorn/-/acorn-7.4.0.tgz#e1ad486e6c54501634c6c397c5c121daa383607c" + integrity sha512-+G7P8jJmCHr+S+cLfQxygbWhXy+8YTVGzAkpEbcLo2mLoL7tij/VG41QSHACSf5QgYRhMZYHuNc6drJaO0Da+w== aggregate-error@^3.0.0: version "3.0.1" @@ -1273,9 +1273,9 @@ autoprefixer@^9.8.0: postcss-value-parser "^4.1.0" aws-sdk@^2.689.0: - version "2.724.0" - resolved "https://registry.yarnpkg.com/aws-sdk/-/aws-sdk-2.724.0.tgz#30e18c62930a17b5b0b5ec43f53e82996008b54d" - integrity sha512-XfTPfNAkpLn/RE9ODMs8PDoZ1cI5npeS4p452mDKWUGqdr8DthdQ+6QU786KSzBRB9Bs+k5MCXI62Nv//aLFZA== + version "2.725.0" + resolved "https://registry.yarnpkg.com/aws-sdk/-/aws-sdk-2.725.0.tgz#287ef3b55aa66f10c88671ec62300e96015aaf6a" + integrity sha512-Qd/MlxfQC9NpTxFUQ7u2BdsjiwNtbn5oVp04NPfXEc0xyT216TtcIs+jNyiJ9WaH7AgkHouU1BbBcReO8byYzg== dependencies: buffer "4.9.2" events "1.1.1" @@ -1770,7 +1770,7 @@ chardet@^0.7.0: resolved "https://registry.yarnpkg.com/chardet/-/chardet-0.7.0.tgz#90094849f0937f2eedc2425d0d28a9e5f0cbad9e" integrity sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA== -chokidar@^3.0.2, chokidar@^3.2.2, chokidar@^3.3.0: +"chokidar@>=2.0.0 <4.0.0", chokidar@^3.0.2, chokidar@^3.2.2, chokidar@^3.3.0: version "3.4.1" resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-3.4.1.tgz#e905bdecf10eaa0a0b1db0c664481cc4cbc22ba1" integrity sha512-TQTJyr2stihpC4Sya9hs2Xh+O2wf+igjL36Y75xx2WdHuiICcn/XJza46Jwt0eT5hVpQOzo3FpY3cj3RVYLX0g== @@ -2046,7 +2046,7 @@ combined-stream@^1.0.8: dependencies: delayed-stream "~1.0.0" -commander@^2.20.3, commander@^2.3.0: +commander@^2.20.3, commander@^2.3.0, commander@^2.8.1: version "2.20.3" resolved "https://registry.yarnpkg.com/commander/-/commander-2.20.3.tgz#fd485e84c03eb4881c20722ba48035e8531aeb33" integrity sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ== @@ -2061,13 +2061,6 @@ commander@^5.1.0: resolved "https://registry.yarnpkg.com/commander/-/commander-5.1.0.tgz#46abbd1652f8e059bddaef99bbdcb2ad9cf179ae" integrity sha512-P0CysNDQ7rtVw4QIQtm+MRxV66vKFSvlsQvGYXZWR3qFU0jlMKHZZZgw8e+8DSah4UDKMqnknRDQz+xuQXQ/Zg== -commander@~2.8.1: - version "2.8.1" - resolved "https://registry.yarnpkg.com/commander/-/commander-2.8.1.tgz#06be367febfda0c330aa1e2a072d3dc9762425d4" - integrity sha1-Br42f+v9oMMwqh4qBy09yXYkJdQ= - dependencies: - graceful-readlink ">= 1.0.0" - common-path-prefix@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/common-path-prefix/-/common-path-prefix-2.0.0.tgz#25b0265f318bf093a6ec630813aac97b29dea230" @@ -2830,9 +2823,9 @@ ee-first@1.1.1: integrity sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0= electron-to-chromium@^1.3.488: - version "1.3.515" - resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.515.tgz#96683d2c2be9bf83f6cca75d504a7b443d763c08" - integrity sha512-C9h2yLQwNSK/GTtWQsA9O6mLKv0ubmiAQgmz1HvHnAIH8g5Sje1shWxcooumbGiwgqvZ9yrTYULe4seMTgMYqQ== + version "1.3.516" + resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.516.tgz#03ec071b061e462b786bf7e7ce226fd7ab7cf1f6" + integrity sha512-WDM5AAQdOrvLqSX8g3Zd5AujBXfMxf96oeZkff0U2HF5op3tjShE+on2yay3r1UD4M9I3p0iHpAS4+yV8U8A9A== elf-tools@^1.1.1: version "1.1.2" @@ -4183,11 +4176,6 @@ graceful-fs@^4.1.10, graceful-fs@^4.1.11, graceful-fs@^4.1.15, graceful-fs@^4.1. resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.4.tgz#2256bde14d3632958c465ebc96dc467ca07a29fb" integrity sha512-WjKPNJF79dtJAVniUlGGWHYGz2jWxT6VhN/4m1NdkbZ2nOsEF+cI1Edgql5zCRhs/VsQYRvrXctxktVXZUkixw== -"graceful-readlink@>= 1.0.0": - version "1.0.1" - resolved "https://registry.yarnpkg.com/graceful-readlink/-/graceful-readlink-1.0.1.tgz#4cafad76bc62f02fa039b2f94e9a3dd3a391a725" - integrity sha1-TK+tdrxi8C+gObL5Tpo906ORpyU= - hard-rejection@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/hard-rejection/-/hard-rejection-2.1.0.tgz#1c6eda5c1685c63942766d79bb40ae773cecd883" @@ -4734,9 +4722,9 @@ is-docker@^1.1.0: integrity sha1-8EN01O7lMQ6ajhE78UlUEeRhdqE= is-docker@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/is-docker/-/is-docker-2.0.0.tgz#2cb0df0e75e2d064fe1864c37cdeacb7b2dcf25b" - integrity sha512-pJEdRugimx4fBMra5z2/5iRdZ63OhYV0vr0Dwm5+xtW4D1FvRkB8hamMIhnWfyJeDdyr/aa7BDyNbtG38VxgoQ== + version "2.1.0" + resolved "https://registry.yarnpkg.com/is-docker/-/is-docker-2.1.0.tgz#25dc043e4fdc3cf969d622735e05a86ba9952e2b" + integrity sha512-mB2WygGsSeoXtLKpSYzP6sa0Z9DyU9ZyKlnvuZWxCociaI0qsF8u12sR72DFTX236g1u6oWSWYFuUk09nGQEjg== is-error@^2.2.0: version "2.2.2" @@ -6064,13 +6052,13 @@ netlify-redirector@^0.2.0: resolved "https://registry.yarnpkg.com/netlify-redirector/-/netlify-redirector-0.2.0.tgz#2037bf92520459277c9ae17f46e4df56104cd787" integrity sha512-5SSUu++MXvE/tik90Hx7lzISBHCl5k4TqpVeTuBEoHp5K7uWitY7c3MjPNiY3kB83GSZiTNLbuIY7bo6mpyU3Q== -netlify@^4.1.7, netlify@^4.3.5, netlify@^4.3.8: - version "4.3.8" - resolved "https://registry.yarnpkg.com/netlify/-/netlify-4.3.8.tgz#6fdca3846e5d1c7b02787e443c5547d85e474398" - integrity sha512-O+tqZaV0oOpThKKV/k4LzIicPJkCT6wEEmcZTVrPi0YGN/KTYinEfpoeuD2g48agbQfuj47qhXrBc6xuKEa9HQ== +netlify@^4.1.7, netlify@^4.3.5, netlify@^4.3.9: + version "4.3.9" + resolved "https://registry.yarnpkg.com/netlify/-/netlify-4.3.9.tgz#62ce0fd5c909c53ec88cdd5b69e32b420ce5b9d7" + integrity sha512-0Q0qBTmTknyK32BNg6sE/L+cagNUvqyAMPNxlDAKqDKeML5w6VOhxX9CXSEtC0wq83qNfZXr8uidYfRyI48TNw== dependencies: "@netlify/open-api" "^0.15.0" - "@netlify/zip-it-and-ship-it" "^1.3.7" + "@netlify/zip-it-and-ship-it" "^1.3.8" backoff "^2.5.0" clean-deep "^3.3.0" filter-obj "^2.0.1" @@ -6400,9 +6388,9 @@ onetime@^2.0.0: mimic-fn "^1.0.0" onetime@^5.1.0: - version "5.1.0" - resolved "https://registry.yarnpkg.com/onetime/-/onetime-5.1.0.tgz#fff0f3c91617fe62bb50189636e99ac8a6df7be5" - integrity sha512-5NcSkPHhwTVFIQN+TUqXoS5+dlElHXdpAWu9I0HP20YOtIi+aZ0Ct82jdlILDxjLEAWwvm+qj1m6aEtsDVmm6Q== + version "5.1.1" + resolved "https://registry.yarnpkg.com/onetime/-/onetime-5.1.1.tgz#5c8016847b0d67fcedb7eef254751cfcdc7e9418" + integrity sha512-ZpZpjcJeugQfWsfyQlshVoowIIQ1qBGSVll4rfDq6JJVO//fesjoX808hXWfBjY+ROZgpKDI5TRSRBSoJiZ8eg== dependencies: mimic-fn "^2.1.0" @@ -7673,6 +7661,13 @@ safe-regex@^2.1.1: resolved "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a" integrity sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg== +sass@^1.26.10: + version "1.26.10" + resolved "https://registry.yarnpkg.com/sass/-/sass-1.26.10.tgz#851d126021cdc93decbf201d1eca2a20ee434760" + integrity sha512-bzN0uvmzfsTvjz0qwccN1sPm2HxxpNI/Xa+7PlUEMS+nQvbyuEK7Y0qFqxlPHhiNHb1Ze8WQJtU31olMObkAMw== + dependencies: + chokidar ">=2.0.0 <4.0.0" + sax@1.2.1: version "1.2.1" resolved "https://registry.yarnpkg.com/sax/-/sax-1.2.1.tgz#7b8e656190b228e81a66aea748480d828cd2d37a" @@ -7684,11 +7679,11 @@ sax@>=0.6.0: integrity sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw== seek-bzip@^1.0.5: - version "1.0.5" - resolved "https://registry.yarnpkg.com/seek-bzip/-/seek-bzip-1.0.5.tgz#cfe917cb3d274bcffac792758af53173eb1fabdc" - integrity sha1-z+kXyz0nS8/6x5J1ivUxc+sfq9w= + version "1.0.6" + resolved "https://registry.yarnpkg.com/seek-bzip/-/seek-bzip-1.0.6.tgz#35c4171f55a680916b52a07859ecf3b5857f21c4" + integrity sha512-e1QtP3YL5tWww8uKaOCQ18UxIT2laNBXHjV/S2WYCiK4udiv8lkG89KRIoCjUagnAmCBurjF4zEVX2ByBbnCjQ== dependencies: - commander "~2.8.1" + commander "^2.8.1" semver-compare@^1.0.0: version "1.0.0" @@ -8951,6 +8946,31 @@ use@^3.1.0: resolved "https://registry.yarnpkg.com/use/-/use-3.1.1.tgz#d50c8cac79a19fbc20f2911f56eb973f4e10070f" integrity sha512-cwESVXlO3url9YWlFW/TA9cshCEhtu7IKJ/p5soJ/gGpj7vbvFrAY/eIioQ6Dw23KjZhYgiIo8HOs1nQ2vr/oQ== +usercss-meta@^0.9.0: + version "0.9.0" + resolved "https://registry.yarnpkg.com/usercss-meta/-/usercss-meta-0.9.0.tgz#f37746ed706c541dc5593ceb96ff5404060493e1" + integrity sha512-S6AuhI11jc2xh6DIx3xR+4EU5/YiV0lLIvDhJgE5BTJTkcBEXrScJUIKVvzApGRou3lSLV0Qi4fVbSsN9BR6Ig== + dependencies: + semver-regex "^2.0.0" + +userscript-parser@^2.2.2: + version "2.2.2" + resolved "https://registry.yarnpkg.com/userscript-parser/-/userscript-parser-2.2.2.tgz#b841747361a460647f2e850daa74785ba4b34a2a" + integrity sha512-EX3iD3WnBX+6OzKCDJ9yj0YGegvyjKdYtJDowddcUZFGr0GBWCCGa7QpaH5Nn3Uafk/oft0M/Dm5oqqFURo5rA== + +"userscripts@git+https://git.holllo.cc/Bauke/userscripts.git": + version "0.1.1" + resolved "git+https://git.holllo.cc/Bauke/userscripts.git#4f28f8e30d527d8cded485e86c18b77e2e780fa2" + dependencies: + userscript-parser "^2.2.2" + +"userstyles@git+https://git.holllo.cc/Bauke/userstyles.git": + version "0.1.1" + resolved "git+https://git.holllo.cc/Bauke/userstyles.git#3393883c52f81c779d542e630ed4595ece2e8449" + dependencies: + sass "^1.26.10" + usercss-meta "^0.9.0" + util-deprecate@^1.0.1, util-deprecate@~1.0.1: version "1.0.2" resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf"