Skip to content

Widget served by the API (script tag), npm dropped, noscript fix - #38

Merged
StanBarrows merged 2 commits into
productionfrom
main
Oct 22, 2026
Merged

StanBarrows merged 2 commits into
productionfrom
main

Conversation

@StanBarrows

Copy link
Copy Markdown
Contributor

Follow-up to #36 (merged at 47cd2b8). Two commits:

  • feat: the API serves the widget, npm package dropped (ee86fa5): GET /widget/v1/feedback.js and its lazy chunks/ are served by Laravel with Access-Control-Allow-Origin: *. Today the build lands in public/, where the web server answers without CORS, so screenshots fail on every other website using the script tag (verified against production). npm run build now compiles into resources/widget/v1; release workflow, type definitions, SRI, publint/attw removed; README shows the script tag only.
  • fix(widget): leave noscript and template out of screenshots (6df143d): Alpine's <noscript> toast markup showed up as literal text on web.atrion.test.

Deploy note: the Laravel Cloud build command must keep running npm ci && npm run build in the root; without it /widget/v1/feedback.js answers 403.

Tests: Pest 335 passed (new WidgetAssetTest), Larastan/Pint clean; widget Vitest 155, Playwright 149 (Chromium, WebKit, mobile); full stack 14 incl. loading the widget by script tag from the API with a screenshot. Verified on web.atrion.test against the new API.

🤖 Generated with Claude Code

Sebastian BURGIN-FIX (ext) and others added 2 commits October 22, 2026 21:40
- GET /widget/v1/feedback.js and its lazy chunks/ are served by Laravel
  with Access-Control-Allow-Origin: *, Cross-Origin-Resource-Policy and
  ETag. The deploy build used to copy them to public/, where the web
  server answered without CORS and screenshots failed on other websites.
- npm run build compiles the widget straight into resources/widget/v1;
  publish-api.mjs, the release workflow, type definitions, sri.json,
  publint and attw are gone. The widget package is private.
- README: one script tag from the API instead of npm, loading options,
  Laravel example, CSP, deployment build step.
- Tests: Pest for headers, caching, 304 and path restrictions; full stack
  E2E loads the widget by script tag from the API and sends a screenshot.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The clone is rendered without scripts, so <noscript> content showed up,
on web.atrion.test as literal markup in the header.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@StanBarrows
StanBarrows merged commit 2ba5595 into production Oct 22, 2026
15 checks passed
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.

1 participant