From d1288d202aecbe46417e6978615e21ba3c74c8cf Mon Sep 17 00:00:00 2001 From: Alexander Petros Date: Tue, 19 Sep 2023 12:07:24 -0400 Subject: Remove old tests from the website (#1733) The website used to host every past test suite, copied into the www directory. We no longer need that on the website (and it makes the codebase impossible to search) so I removed all the old tests and the new tests are hosted simply at /test. I also replaced the www.js script with a simpler www.sh one (since we no longer need to do anything besides copying, really), which allowed me to remove a node dependency that was only used in that script. --- scripts/www.js | 33 --------------------------------- scripts/www.sh | 17 +++++++++++++++++ 2 files changed, 17 insertions(+), 33 deletions(-) delete mode 100644 scripts/www.js create mode 100755 scripts/www.sh (limited to 'scripts') diff --git a/scripts/www.js b/scripts/www.js deleted file mode 100644 index a2d99d27..00000000 --- a/scripts/www.js +++ /dev/null @@ -1,33 +0,0 @@ -var config = require('../package.json'); -var fs = require('fs-extra'); - -console.log(config.version) - -var testRoot = "www/static/test/"; -var currentReleaseRoot = testRoot + config.version; -fs.ensureDirSync(currentReleaseRoot); - -// copy over all test support files -fs.copySync("node_modules/mocha/mocha.js", currentReleaseRoot + "/node_modules/mocha/mocha.js"); -fs.copySync("node_modules/mocha/mocha.css", currentReleaseRoot + "/node_modules/mocha/mocha.css"); -fs.copySync("node_modules/chai/chai.js", currentReleaseRoot + "/node_modules/chai/chai.js"); -fs.copySync("node_modules/chai-dom/chai-dom.js", currentReleaseRoot + "/node_modules/chai-dom/chai-dom.js"); -fs.copySync("node_modules/sinon/pkg/sinon.js", currentReleaseRoot + "/node_modules/sinon/pkg/sinon.js"); -fs.copySync("node_modules/mock-socket/dist/mock-socket.js", currentReleaseRoot + "/node_modules/mock-socket/dist/mock-socket.js"); -fs.copySync("test/", currentReleaseRoot + "/test"); -fs.copySync("src/", currentReleaseRoot + "/src"); - -// update the test index file to include a link for all releases -var testHTML = "

HTMX TESTS

" -fs.writeFileSync(testRoot + "/index.html", testHTML); - -// copy the current htmx to the main website -fs.copySync("src/htmx.js", "www/themes/htmx-theme/static/js/htmx.js"); -fs.copySync("src/ext/class-tools.js", "www/themes/htmx-theme/static/js/class-tools.js"); -fs.copySync("src/ext/preload.js", "www/themes/htmx-theme/static/js/preload.js"); diff --git a/scripts/www.sh b/scripts/www.sh new file mode 100755 index 00000000..0601c181 --- /dev/null +++ b/scripts/www.sh @@ -0,0 +1,17 @@ +#!/bin/bash +set -euo pipefail + +STATIC_ROOT="www/static" +PACKAGE_VERSION=$(cat package.json | grep version | cut -d '"' -f 4) + + +cp node_modules/mocha/mocha.js "$STATIC_ROOT/node_modules/mocha/mocha.js" +cp node_modules/mocha/mocha.css "$STATIC_ROOT/node_modules/mocha/mocha.css" +cp node_modules/chai/chai.js "$STATIC_ROOT/node_modules/chai/chai.js" +cp node_modules/chai-dom/chai-dom.js "$STATIC_ROOT/node_modules/chai-dom/chai-dom.js" +cp node_modules/sinon/pkg/sinon.js "$STATIC_ROOT/node_modules/sinon/pkg/sinon.js" +cp node_modules/mock-socket/dist/mock-socket.js "$STATIC_ROOT/node_modules/mock-socket/dist/mock-socket.js" + +rm -rf "$STATIC_ROOT/test" "$STATIC_ROOT/src" +cp -r "./test" "$STATIC_ROOT/test" +cp -r "./src" "$STATIC_ROOT/src" -- cgit v1.2.3