docs: add CONTRIBUTING.md, CHANGELOG.md, and JSDoc to entire codebase
CI / Build & Test (push) Successful in 2m54s

Add docs/CONTRIBUTING.md covering the build system, dev workflow, all
npm scripts, how to add new native host message types, code style, and
debugging guidance.

Add CHANGELOG.md at the project root documenting all features and fixes
across the 1.0.0 release.

Add JSDoc (@param, @returns) to all previously undocumented exported
functions across 35 JS files:
- native-host/holesail-manager/ (index, virtual-hosts, service-tunnels,
  servers, port-allocator)
- native-host top-level managers (startup, connect-proxy, https-proxy,
  certificate-authority, ssh-manager, rdp-manager)
- extension/background/ (logs, native-messaging, proxy, message-router)
- extension/dashboard/core/ (utils, navigation, init)
- extension/dashboard/ui/ (modal, toast, state-tag)
- extension/dashboard/pages/ (all 10 page files)
- extension/dashboard/refresh.js, events.js
- extension/dashboard/data/hostname-validator.js
- scripts/ (build-host, run-install)
This commit is contained in:
Raven Scott
2026-03-01 00:40:53 -05:00
parent f0917a2d31
commit f1e98a7edd
38 changed files with 1018 additions and 41 deletions
+17 -2
View File
@@ -1,5 +1,9 @@
// Depends on: core/utils.js ($, escapeHtml), core/utils.js (timeAgo),
// ui/toast.js (showToast), ui/modal.js (openModal, closeModal, showModalError)
/**
* Backups page — lists backup archives with size/date, and wires up
* create/restore/delete operations via native host messages.
* Depends on: core/utils.js ($, escapeHtml, timeAgo),
* ui/toast.js (showToast), ui/modal.js (openModal, closeModal, showModalError)
*/
let pendingRestoreFilename = null;
let pendingDeleteFilename = null;
@@ -10,6 +14,10 @@ function formatBytes(bytes) {
return (bytes / (1024 * 1024)).toFixed(2) + ' MB';
}
/**
* Re-render the backups table with the provided list of backup entries.
* @param {Array<{filename: string, size: number, createdAt: number}>} backups
*/
function updateBackupsTable(backups) {
const tbody = $('backupsTable');
if (!tbody) return;
@@ -41,6 +49,9 @@ function updateBackupsTable(backups) {
}).join('');
}
/**
* Fetch the current backup list from the native host and re-render the table.
*/
function refreshBackups() {
chrome.runtime.sendMessage(
{ target: 'holesail-native', action: 'send', payload: { type: 'listBackups' } },
@@ -53,6 +64,10 @@ function refreshBackups() {
);
}
/**
* Attach all event listeners for the Backups page.
* Called once during dashboard initialisation.
*/
function setupBackupEvents() {
$('btnTakeBackup')?.addEventListener('click', () => {
const btn = $('btnTakeBackup');