aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--Makefile4
-rw-r--r--css/style.css2
-rw-r--r--package-lock.json164
-rw-r--r--package.json31
-rw-r--r--static/index.js80
-rw-r--r--tailwind.config.js13
6 files changed, 231 insertions, 63 deletions
diff --git a/Makefile b/Makefile
index 5a1d497..f3d6c17 100644
--- a/Makefile
+++ b/Makefile
@@ -1,12 +1,14 @@
serve: build
FEEDAKA_BASE_PATH="" FEEDAKA_PORT=8080 ./feedaka
-build: fmt
+build:
+ npm run check
npm run build
go build -o feedaka main.go
fmt:
go fmt .
+ npm run fmt
docker-build: fmt
docker build -t feedaka .
diff --git a/css/style.css b/css/style.css
index d4b5078..f1d8c73 100644
--- a/css/style.css
+++ b/css/style.css
@@ -1 +1 @@
-@import 'tailwindcss';
+@import "tailwindcss";
diff --git a/package-lock.json b/package-lock.json
index 01dcbba..2113d28 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -9,6 +9,7 @@
"version": "0.1.0",
"license": "MIT",
"devDependencies": {
+ "@biomejs/biome": "2.0.4",
"@tailwindcss/cli": "^4.1.10",
"tailwindcss": "^4.1.10"
}
@@ -27,6 +28,169 @@
"node": ">=6.0.0"
}
},
+ "node_modules/@biomejs/biome": {
+ "version": "2.0.4",
+ "resolved": "https://registry.npmjs.org/@biomejs/biome/-/biome-2.0.4.tgz",
+ "integrity": "sha512-DNA++xe+E7UugTvI/HhzSFl6OwrVgU8SIV0Mb2fPtWPk2/oTr4eOSA5xy1JECrvgJeYxurmUBOS49qxv/OUkrQ==",
+ "dev": true,
+ "license": "MIT OR Apache-2.0",
+ "bin": {
+ "biome": "bin/biome"
+ },
+ "engines": {
+ "node": ">=14.21.3"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/biome"
+ },
+ "optionalDependencies": {
+ "@biomejs/cli-darwin-arm64": "2.0.4",
+ "@biomejs/cli-darwin-x64": "2.0.4",
+ "@biomejs/cli-linux-arm64": "2.0.4",
+ "@biomejs/cli-linux-arm64-musl": "2.0.4",
+ "@biomejs/cli-linux-x64": "2.0.4",
+ "@biomejs/cli-linux-x64-musl": "2.0.4",
+ "@biomejs/cli-win32-arm64": "2.0.4",
+ "@biomejs/cli-win32-x64": "2.0.4"
+ }
+ },
+ "node_modules/@biomejs/cli-darwin-arm64": {
+ "version": "2.0.4",
+ "resolved": "https://registry.npmjs.org/@biomejs/cli-darwin-arm64/-/cli-darwin-arm64-2.0.4.tgz",
+ "integrity": "sha512-r5McIUMMiedwJ2rltuXhj0+w0W7IJLpkOS+OGCVZQQOOcrGY9gUSUmOo7O6Z7P0vlv5YYZkPbi+qR9MDDWRBSw==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "license": "MIT OR Apache-2.0",
+ "optional": true,
+ "os": [
+ "darwin"
+ ],
+ "engines": {
+ "node": ">=14.21.3"
+ }
+ },
+ "node_modules/@biomejs/cli-darwin-x64": {
+ "version": "2.0.4",
+ "resolved": "https://registry.npmjs.org/@biomejs/cli-darwin-x64/-/cli-darwin-x64-2.0.4.tgz",
+ "integrity": "sha512-aV5Zc/3E3aXFbrjK1IgCMEQc+6PCkBL+NS+vtjoNM2VPFeM5OL5Q82BI4YZyPnebj+k42BPIoYtz0jJ95PGRRg==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "license": "MIT OR Apache-2.0",
+ "optional": true,
+ "os": [
+ "darwin"
+ ],
+ "engines": {
+ "node": ">=14.21.3"
+ }
+ },
+ "node_modules/@biomejs/cli-linux-arm64": {
+ "version": "2.0.4",
+ "resolved": "https://registry.npmjs.org/@biomejs/cli-linux-arm64/-/cli-linux-arm64-2.0.4.tgz",
+ "integrity": "sha512-nlJhf7DyuajMj+S7Ygum59cbrHvI/nSRvedfJcEIx4X7SsiZjpRUiC5XtEn77kg7NIKq/KqG5roQIHkmjuFHCw==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "license": "MIT OR Apache-2.0",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=14.21.3"
+ }
+ },
+ "node_modules/@biomejs/cli-linux-arm64-musl": {
+ "version": "2.0.4",
+ "resolved": "https://registry.npmjs.org/@biomejs/cli-linux-arm64-musl/-/cli-linux-arm64-musl-2.0.4.tgz",
+ "integrity": "sha512-cNukq2PthoOa7quqaKoEFz4Zd1pDPJGfTR5jVyk9Z9iFHEm6TI7+7eeIs3aYcEuuJPNFR9xhJ4Uj3E2iUWkV3A==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "license": "MIT OR Apache-2.0",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=14.21.3"
+ }
+ },
+ "node_modules/@biomejs/cli-linux-x64": {
+ "version": "2.0.4",
+ "resolved": "https://registry.npmjs.org/@biomejs/cli-linux-x64/-/cli-linux-x64-2.0.4.tgz",
+ "integrity": "sha512-jlzrNZ+OzN9wvp2RL3cl5Y4NiV7xSU+QV5A8bWXke1on3jKy7QbXajybSjVQ6aFw1gdrqkO/W8xV5HODhIMT4g==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "license": "MIT OR Apache-2.0",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=14.21.3"
+ }
+ },
+ "node_modules/@biomejs/cli-linux-x64-musl": {
+ "version": "2.0.4",
+ "resolved": "https://registry.npmjs.org/@biomejs/cli-linux-x64-musl/-/cli-linux-x64-musl-2.0.4.tgz",
+ "integrity": "sha512-oWQALSbp8xF0t/wiHU2zdkZOpIHyaI9QxQv0Ytty9GAKsCGP6pczp8qyKD/P49iGJdDozHp5KiuQPxs33APhyA==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "license": "MIT OR Apache-2.0",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=14.21.3"
+ }
+ },
+ "node_modules/@biomejs/cli-win32-arm64": {
+ "version": "2.0.4",
+ "resolved": "https://registry.npmjs.org/@biomejs/cli-win32-arm64/-/cli-win32-arm64-2.0.4.tgz",
+ "integrity": "sha512-/PbNhMJo9ONja7hOxLlifM/qgeHpRD9bF2flTz5KIrXnQqpuegaRuwP/HYdJ9TFkTKFjHkPLoE4onOz3HIT5CQ==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "license": "MIT OR Apache-2.0",
+ "optional": true,
+ "os": [
+ "win32"
+ ],
+ "engines": {
+ "node": ">=14.21.3"
+ }
+ },
+ "node_modules/@biomejs/cli-win32-x64": {
+ "version": "2.0.4",
+ "resolved": "https://registry.npmjs.org/@biomejs/cli-win32-x64/-/cli-win32-x64-2.0.4.tgz",
+ "integrity": "sha512-dIM4SgO4/Rmsb4X7fwKtciQ682SZDSC1lm42uSM9gt8zNqBIeTaqsMc6eO1DpxYWMlAb/n2SML9+HUHmCib7NA==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "license": "MIT OR Apache-2.0",
+ "optional": true,
+ "os": [
+ "win32"
+ ],
+ "engines": {
+ "node": ">=14.21.3"
+ }
+ },
"node_modules/@isaacs/fs-minipass": {
"version": "4.0.1",
"resolved": "https://registry.npmjs.org/@isaacs/fs-minipass/-/fs-minipass-4.0.1.tgz",
diff --git a/package.json b/package.json
index 2cf2bb8..a95cb6b 100644
--- a/package.json
+++ b/package.json
@@ -1,16 +1,19 @@
{
- "name": "feedaka",
- "version": "0.1.0",
- "description": "",
- "main": "index.js",
- "scripts": {
- "build": "tailwindcss -i ./css/style.css -o ./static/style.css",
- "watch": "tailwindcss -i ./css/style.css -o ./static/style.css --watch"
- },
- "author": "nsfisis",
- "license": "MIT",
- "devDependencies": {
- "@tailwindcss/cli": "^4.1.10",
- "tailwindcss": "^4.1.10"
- }
+ "name": "feedaka",
+ "version": "0.1.0",
+ "description": "",
+ "main": "index.js",
+ "scripts": {
+ "check": "biome check --write .",
+ "fmt": "biome check .",
+ "build": "tailwindcss -i ./css/style.css -o ./static/style.css",
+ "watch": "tailwindcss -i ./css/style.css -o ./static/style.css --watch"
+ },
+ "author": "nsfisis",
+ "license": "MIT",
+ "devDependencies": {
+ "@biomejs/biome": "2.0.4",
+ "@tailwindcss/cli": "^4.1.10",
+ "tailwindcss": "^4.1.10"
+ }
}
diff --git a/static/index.js b/static/index.js
index d546dba..6354bbd 100644
--- a/static/index.js
+++ b/static/index.js
@@ -1,47 +1,47 @@
const markAllArticles = (feedId, el, read) => {
- const basePath = window.BASE_PATH;
- const apiUrl = `${basePath}/api/feeds/${feedId}/${read ? 'read' : 'unread'}`;
- fetch(apiUrl, { method: 'PUT' })
- .then(_data => {
- el.parentNode.nextElementSibling.remove();
- el.parentNode.remove();
- })
- .catch(error => {
- alert(error);
- });
+ const basePath = window.BASE_PATH;
+ const apiUrl = `${basePath}/api/feeds/${feedId}/${read ? "read" : "unread"}`;
+ fetch(apiUrl, { method: "PUT" })
+ .then((_data) => {
+ el.parentNode.nextElementSibling.remove();
+ el.parentNode.remove();
+ })
+ .catch((error) => {
+ alert(error);
+ });
};
const markOneArticle = (articleId, el, read) => {
- const basePath = window.BASE_PATH;
- const apiUrl = `${basePath}/api/articles/${articleId}/${read ? 'read' : 'unread'}`;
- fetch(apiUrl, { method: 'PUT' })
- .then(_data => {
- el.parentNode.remove();
- })
- .catch(error => {
- alert(error);
- });
+ const basePath = window.BASE_PATH;
+ const apiUrl = `${basePath}/api/articles/${articleId}/${read ? "read" : "unread"}`;
+ fetch(apiUrl, { method: "PUT" })
+ .then((_data) => {
+ el.parentNode.remove();
+ })
+ .catch((error) => {
+ alert(error);
+ });
};
-document.addEventListener('DOMContentLoaded', () => {
- document.querySelectorAll('.js-unread-feed').forEach(el => {
- el.addEventListener('click', () => {
- markAllArticles(el.dataset.feedId, el, false);
- });
- });
- document.querySelectorAll('.js-unread-article').forEach(el => {
- el.addEventListener('click', () => {
- markOneArticle(el.dataset.articleId, el, false);
- });
- });
- document.querySelectorAll('.js-read-feed').forEach(el => {
- el.addEventListener('click', () => {
- markAllArticles(el.dataset.feedId, el, true);
- });
- });
- document.querySelectorAll('.js-read-article').forEach(el => {
- el.addEventListener('click', () => {
- markOneArticle(el.dataset.articleId, el, true);
- });
- });
+document.addEventListener("DOMContentLoaded", () => {
+ document.querySelectorAll(".js-unread-feed").forEach((el) => {
+ el.addEventListener("click", () => {
+ markAllArticles(el.dataset.feedId, el, false);
+ });
+ });
+ document.querySelectorAll(".js-unread-article").forEach((el) => {
+ el.addEventListener("click", () => {
+ markOneArticle(el.dataset.articleId, el, false);
+ });
+ });
+ document.querySelectorAll(".js-read-feed").forEach((el) => {
+ el.addEventListener("click", () => {
+ markAllArticles(el.dataset.feedId, el, true);
+ });
+ });
+ document.querySelectorAll(".js-read-article").forEach((el) => {
+ el.addEventListener("click", () => {
+ markOneArticle(el.dataset.articleId, el, true);
+ });
+ });
});
diff --git a/tailwind.config.js b/tailwind.config.js
index bd73443..e67c242 100644
--- a/tailwind.config.js
+++ b/tailwind.config.js
@@ -1,9 +1,8 @@
/** @type {import('tailwindcss').Config} */
module.exports = {
- content: ["./templates/**/*.html"],
- theme: {
- extend: {},
- },
- plugins: [],
-}
-
+ content: ["./templates/**/*.html"],
+ theme: {
+ extend: {},
+ },
+ plugins: [],
+};