Skip to content

Standardize package structure and naming conventions#1

Merged
liampmccabe merged 3 commits intomainfrom
copilot/ensure-consistent-package-structure
Jan 9, 2026
Merged

Standardize package structure and naming conventions#1
liampmccabe merged 3 commits intomainfrom
copilot/ensure-consistent-package-structure

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Jan 9, 2026

The three BLX packages (TOC, Inline SVG, Modal) had inconsistent headers, naming conventions, and initialization patterns.

Changes

Headers: Unified format across all packages

  • TOC/Inline SVG: Already correct
  • Modal: Removed file path comment, changed v1.0.6Version: 1.0.6

Global naming: Standardized to window.BLX_[UPPERCASE]

  • Inline SVG: window.BLX.inlineSVGwindow.BLX_INLINE_SVG

Initialization: Unified to readyState check pattern

  • Inline SVG: Added readyState check (was DOMContentLoaded-only)
  • Modal: Removed __BLX_MODAL_INITIALISED__ guard (unnecessary)

Global loader: Updated function calls and added optional chaining

Documentation: Added PACKAGE_STRUCTURE.md with format guidelines

Standard format

// BLX [Package Name]
// Version: X.Y.Z

(() => {
  // Reusable function — exposed globally
  window.BLX_[UPPERCASE] = function () { /* ... */ };

  // Run once on initial page load (even if script injected late)
  if (document.readyState === 'loading') {
    document.addEventListener('DOMContentLoaded', window.BLX_[UPPERCASE]);
  } else {
    window.BLX_[UPPERCASE]();
  }
})();
Original prompt

Can you make you make sure each package follows the same format/structure, I'd like to maintain some consistency across packages.


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI and others added 2 commits January 9, 2026 09:54
Co-authored-by: liampmccabe <3018957+liampmccabe@users.noreply.github.com>
Co-authored-by: liampmccabe <3018957+liampmccabe@users.noreply.github.com>
Copilot AI changed the title [WIP] Ensure each package follows consistent format and structure Standardize package structure and naming conventions Jan 9, 2026
Copilot AI requested a review from liampmccabe January 9, 2026 09:57
@liampmccabe liampmccabe marked this pull request as ready for review January 9, 2026 10:15
@liampmccabe liampmccabe merged commit 4a7ad87 into main Jan 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants