From a5bb8900670017bc8216f969d00967f0e7942e23 Mon Sep 17 00:00:00 2001 From: Shaun Johnston Date: Sun, 28 Dec 2025 06:57:23 +1000 Subject: [PATCH] nested pipes --- .gitignore | 15 +++++++++++++++ js/{config.js => config.js.example} | 2 ++ js/friendly_pipe.js | 15 ++++++++++++++- 3 files changed, 31 insertions(+), 1 deletion(-) create mode 100644 .gitignore rename js/{config.js => config.js.example} (74%) diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..3bf8754 --- /dev/null +++ b/.gitignore @@ -0,0 +1,15 @@ +# Config file (use config.js.example as template) +js/config.js + +# Python +__pycache__/ +*.py[cod] +*$py.class + +# IDE +.vscode/ +.idea/ + +# OS +.DS_Store +Thumbs.db diff --git a/js/config.js b/js/config.js.example similarity index 74% rename from js/config.js rename to js/config.js.example index 990b6a2..58084de 100644 --- a/js/config.js +++ b/js/config.js.example @@ -1,4 +1,6 @@ // Configuration for Friendly Pipe extension +// Copy this file to config.js and modify as needed + export const config = { // Set to true to enable debug logging in the browser console debug: false, diff --git a/js/friendly_pipe.js b/js/friendly_pipe.js index e4a8bf1..1ddcaf7 100644 --- a/js/friendly_pipe.js +++ b/js/friendly_pipe.js @@ -1,5 +1,18 @@ import { app } from "../../scripts/app.js"; -import { config } from "./config.js"; + +// Default configuration +const defaultConfig = { + debug: false, +}; + +// Try to load config, fall back to defaults if not found +let config = defaultConfig; +try { + const configModule = await import("./config.js"); + config = { ...defaultConfig, ...configModule.config }; +} catch (e) { + // config.js doesn't exist, use defaults +} // Debug logging helper function debugLog(...args) {