Update to refine splork

This commit is contained in:
William Moore 2023-06-06 17:22:47 -05:00
parent 0675e54647
commit 2f770a1f79
6 changed files with 13 additions and 6 deletions

1
.gitignore vendored
View File

@ -11,6 +11,7 @@ lerna-debug.log*
certs/ certs/
build/ build/
public/js/ public/js/
dist/
# Diagnostic reports (https://nodejs.org/api/report.html) # Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json

View File

@ -4,11 +4,16 @@ require('dotenv/config');
// or replace multiple strings // or replace multiple strings
function replaceTemplate() { function replaceTemplate() {
return src(['./public/js/**/*.js']) src(['./dist/js/**/*.js'])
.pipe(replace(/TEASENSE_URI/g, process.env.TEASENSE_URI)) .pipe(replace(/TEASENSE_URI/g, process.env.TEASENSE_URI))
.pipe(replace(/RAINFALL_URI/g, process.env.RAINFALL_URI)) .pipe(replace(/RAINFALL_URI/g, process.env.RAINFALL_URI))
.pipe(replace(/SPLORK_URI/g, process.env.SPLORK_URI)) .pipe(replace(/SPLORK_URI/g, process.env.SPLORK_URI))
.pipe(dest('./public/js')); .pipe(dest('./dist/js'));
return src(['./dist/**/*.html'])
.pipe(replace(/FONTAWESOME_SCRIPT_URL/g, process.env.FONTAWESOME_SCRIPT_URL))
.pipe(dest('./dist/'));
}; };
exports.default = replaceTemplate; exports.default = replaceTemplate;

View File

@ -4,8 +4,8 @@
"description": "", "description": "",
"main": "index.js", "main": "index.js",
"scripts": { "scripts": {
"start": "npx tsc && npx gulp && npx rollup -c", "start": "npx tsc && cp -R public dist && npx gulp && npx rollup -c",
"clean": "rm -rf build", "clean": "rm -rf build && rm -rf dist",
"test": "echo \"Error: no test specified\" && exit 1" "test": "echo \"Error: no test specified\" && exit 1"
}, },
"author": "", "author": "",

View File

@ -1,8 +1,10 @@
<html> <html>
<head> <head>
<script src="FONTAWESOME_SCRIPT_URL" crossorigin="anonymous"></script>
<script type="module" src="./js/Splork.js"></script> <script type="module" src="./js/Splork.js"></script>
</head> </head>
<body> <body>
<h2 style="text-align: center">Splork MOTD (<a href="https://codeberg.org/caranmegil/splork" alt="Source Code" target="_blank"><i class="fa-brands fa-square-git"></i></a>)</h2>
<lavender-splork></lavender-splork> <lavender-splork></lavender-splork>
</body> </body>
</html> </html>

View File

@ -11,7 +11,7 @@ export default {
// Entry point for application build; can specify a glob to build multiple // Entry point for application build; can specify a glob to build multiple
// HTML files for non-SPA app // HTML files for non-SPA app
html({ html({
input: 'public/**.html', input: 'dist/**.html',
}), }),
// Resolve bare module specifiers to relative paths // Resolve bare module specifiers to relative paths
resolve(), resolve(),

View File

@ -41,7 +41,6 @@ export class Splork extends LitElement {
override render() { override render() {
return html` return html`
<div class="gauge-body"> <div class="gauge-body">
<div class="gauge-label">Splork MOTD</div>
<div>${this.value}</div> <div>${this.value}</div>
</div> </div>
`; `;