feat: astro integration package, initial import#20
Open
a-d-j-i wants to merge 3 commits into
Open
Conversation
Collaborator
a-d-j-i
commented
May 29, 2026
- Adds packages/astro-integration/ a new @dappfence/astro npm package that wires DappFence into Astro projects as a first-class integration. On astro build, the integration: copies dappfence.js from @dappfence/core into the output dir, injects the <script> tag into every HTML file, hashes all tracked assets, and writes a signed integrity-manifest.json
- Derives the manifest signer identity automatically from secretKey (or DAPPFENCE_SECRET_KEY env var), so users never need to supply the Ethereum address separately
- Intentionally a no-op in astro dev. Vite transforms files at request time, so hash verification against a static manifest is not meaningful in dev
- Current limitations: Static sites only.
Astro's SSG pipeline bypasses Vite's transformIndexHtml, so the plugin never fired in production. Script injection is handled in astro:build:done via injectScriptTag. Dev mode intentionally has no DappFence presence.
27626a4 to
69cb844
Compare
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.