Publish pentest-calculator to npm with ESM exports and branding control#3
Merged
Merged
Conversation
…ELOG, gitignore, smoke test
…f", npm install docs - hailbytes-pentest-calculator.js - Add 'branding' to observedAttributes - Add a real in-component footer with link to https://hailbytes.com/asm (previously there was only a non-clickable badge in the H1) - CSS rule :host([branding=off]) .hb-branding, .hailbytes-badge { display:none } - Add ESM exports (default + named class); previously only side-effect - README.md - Replace "no npm install" with npm install + npm-CDN snippets - Document branding="off" - Add "See also" cross-link to sibling @hailbytes/* packages - Repoint built-by line to /asm
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR prepares the pentest-calculator web component for npm publication as
@hailbytes/pentest-calculator, adding proper ESM exports, TypeScript declarations, a white-label branding toggle, and CI/CD workflows.Key Changes
package.jsonwith proper ESM exports, type declarations, and metadata for public npm publicationexport defaultand named exports tohailbytes-pentest-calculator.jsso the component class can be imported directly (previously only side-effect registration was available)branding="off"attribute support to hide the "by HailBytes" footer and header badge for white-label embedsobservedAttributesto include'branding'.hb-brandingand.hailbytes-badgewhen attribute is setindex.d.tswith full type definitions forPentestInputs,PentestResult, and theHailbytesPentestCalculatorclass, plus global type augmentation for custom eventsREADME.mdwith npm install instructions, usage examples for both bundlers and script tags, and links to related HailBytes calculator packages.github/workflows/ci.ymlfor testing on Node 18, 20, 22.github/workflows/publish.ymlfor automated npm publishing with provenance on git tagstest/smoke.test.mjswith minimal DOM shim to verify module exports and observed attributesCHANGELOG.md,.gitignore, and updated footer brandingImplementation Details
<script>tag usage works unchangedbranding="off"attribute is CSS-only (no JavaScript logic needed)node:testmodule with zero dev dependenciesprovenance: truefor supply chain securityhttps://claude.ai/code/session_01HevhhhYskCrTDfb2oxg7NK