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/
build/
public/js/
dist/
# Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json

View File

@ -4,11 +4,16 @@ require('dotenv/config');
// or replace multiple strings
function replaceTemplate() {
return src(['./public/js/**/*.js'])
src(['./dist/js/**/*.js'])
.pipe(replace(/TEASENSE_URI/g, process.env.TEASENSE_URI))
.pipe(replace(/RAINFALL_URI/g, process.env.RAINFALL_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;

View File

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

View File

@ -1,8 +1,10 @@
<html>
<head>
<script src="FONTAWESOME_SCRIPT_URL" crossorigin="anonymous"></script>
<script type="module" src="./js/Splork.js"></script>
</head>
<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>
</body>
</html>

View File

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

View File

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