Remove git module in favor of NPM package.
This commit is contained in:
parent
32365a9afd
commit
bb7845faef
6 changed files with 16 additions and 21 deletions
3
.gitmodules
vendored
3
.gitmodules
vendored
|
|
@ -1,3 +0,0 @@
|
||||||
[submodule "static"]
|
|
||||||
path = static
|
|
||||||
url = https://github.com/titaniumnetwork-dev/ultraviolet-site.git
|
|
||||||
10
main.sh
10
main.sh
|
|
@ -2,12 +2,4 @@
|
||||||
# Set this to 1 to automatically attempt a fix when an error occurs while running npm start.
|
# Set this to 1 to automatically attempt a fix when an error occurs while running npm start.
|
||||||
fix=0
|
fix=0
|
||||||
|
|
||||||
|
npm start || [[ $fix = 1 ]] && npm install && npm start
|
||||||
# Stuff to do at first run(submodule, npm install).
|
|
||||||
if [[ -d "static" && -n "$(find static -prune -empty 2>/dev/null)" ]] || [[ ! -d "static" ]]; then
|
|
||||||
npm install
|
|
||||||
git submodule update --init --recursive
|
|
||||||
fi
|
|
||||||
|
|
||||||
|
|
||||||
npm start || [[ $fix = 1 ]] && npm install && npm update && git submodule update --init --recursive
|
|
||||||
12
package-lock.json
generated
12
package-lock.json
generated
|
|
@ -10,7 +10,8 @@
|
||||||
"license": "GPL-3.0-or-later",
|
"license": "GPL-3.0-or-later",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@tomphttp/bare-server-node": "^1.0.2-beta-readme2",
|
"@tomphttp/bare-server-node": "^1.0.2-beta-readme2",
|
||||||
"serve-static": "^1.15.0"
|
"serve-static": "^1.15.0",
|
||||||
|
"ultraviolet-static": "https://github.com/titaniumnetwork-development/Ultraviolet-Static/releases/download/v1.0.0/ultraviolet-static-1.0.0.tgz"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"eslint": "^8.23.0",
|
"eslint": "^8.23.0",
|
||||||
|
|
@ -1525,6 +1526,11 @@
|
||||||
"url": "https://github.com/sponsors/sindresorhus"
|
"url": "https://github.com/sponsors/sindresorhus"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/ultraviolet-static": {
|
||||||
|
"version": "1.0.0",
|
||||||
|
"resolved": "https://github.com/titaniumnetwork-development/Ultraviolet-Static/releases/download/v1.0.0/ultraviolet-static-1.0.0.tgz",
|
||||||
|
"integrity": "sha512-HrgerFmdzz991mbg+PcTlv7fBsOznSF+pIY0Nmn52IhXU1i+d7tlVYt9d6gNAeU7xbhMVJ8jJjgy8ZIZ2/NIUw=="
|
||||||
|
},
|
||||||
"node_modules/uri-js": {
|
"node_modules/uri-js": {
|
||||||
"version": "4.4.1",
|
"version": "4.4.1",
|
||||||
"resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz",
|
"resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz",
|
||||||
|
|
@ -2660,6 +2666,10 @@
|
||||||
"integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==",
|
"integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
|
"ultraviolet-static": {
|
||||||
|
"version": "https://github.com/titaniumnetwork-development/Ultraviolet-Static/releases/download/v1.0.0/ultraviolet-static-1.0.0.tgz",
|
||||||
|
"integrity": "sha512-HrgerFmdzz991mbg+PcTlv7fBsOznSF+pIY0Nmn52IhXU1i+d7tlVYt9d6gNAeU7xbhMVJ8jJjgy8ZIZ2/NIUw=="
|
||||||
|
},
|
||||||
"uri-js": {
|
"uri-js": {
|
||||||
"version": "4.4.1",
|
"version": "4.4.1",
|
||||||
"resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz",
|
"resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz",
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,8 @@
|
||||||
"license": "GPL-3.0-or-later",
|
"license": "GPL-3.0-or-later",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@tomphttp/bare-server-node": "^1.0.2-beta-readme2",
|
"@tomphttp/bare-server-node": "^1.0.2-beta-readme2",
|
||||||
"serve-static": "^1.15.0"
|
"serve-static": "^1.15.0",
|
||||||
|
"ultraviolet-static": "https://github.com/titaniumnetwork-development/Ultraviolet-Static/releases/download/v1.0.0/ultraviolet-static-1.0.0.tgz"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"eslint": "^8.23.0",
|
"eslint": "^8.23.0",
|
||||||
|
|
|
||||||
|
|
@ -1,14 +1,10 @@
|
||||||
import createServer from "@tomphttp/bare-server-node";
|
import createServer from "@tomphttp/bare-server-node";
|
||||||
import { fileURLToPath } from "url";
|
|
||||||
import http from "http";
|
import http from "http";
|
||||||
import serveStatic from "serve-static";
|
import serveStatic from "serve-static";
|
||||||
|
import { publicPath } from "ultraviolet-static";
|
||||||
|
|
||||||
const bare = createServer("/bare/");
|
const bare = createServer("/bare/");
|
||||||
const serve = serveStatic(
|
const serve = serveStatic(publicPath, { fallthrough: false });
|
||||||
fileURLToPath(new URL("../static/", import.meta.url)),
|
|
||||||
{ fallthrough: false }
|
|
||||||
);
|
|
||||||
|
|
||||||
const server = http.createServer();
|
const server = http.createServer();
|
||||||
|
|
||||||
server.on("request", (req, res) => {
|
server.on("request", (req, res) => {
|
||||||
|
|
|
||||||
1
static
1
static
|
|
@ -1 +0,0 @@
|
||||||
Subproject commit f7c4f10705c228a79da350c3d311c4b1fb2f7c97
|
|
||||||
Loading…
Add table
Reference in a new issue