diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 054ce4b..f40fa1b 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -40,6 +40,11 @@ updates: time: "09:00" timezone: "Asia/Kolkata" open-pull-requests-limit: 5 + groups: + dependencies: + update-types: + - "minor" + - "patch" commit-message: prefix: "chore(web)" include: "scope" @@ -60,6 +65,11 @@ updates: time: "09:00" timezone: "Asia/Kolkata" open-pull-requests-limit: 5 + groups: + dependencies: + update-types: + - "minor" + - "patch" commit-message: prefix: "chore(widget)" include: "scope" @@ -80,6 +90,11 @@ updates: time: "09:00" timezone: "Asia/Kolkata" open-pull-requests-limit: 5 + groups: + dependencies: + update-types: + - "minor" + - "patch" commit-message: prefix: "chore(ui)" include: "scope" diff --git a/CHANGELOG.md b/CHANGELOG.md index cebc16b..b3aa45e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,7 +7,35 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] -> Changes staged for the next release. +### Changed + +#### Production widget URL & dashboard entry point + +- Replaced the hardcoded `http://localhost:3001` widget origin with the + deployed widget URL (`https://echo-widget-steel.vercel.app`) in: + - `apps/embed/landing.html` — the embed demo page + - `apps/web/modules/integrations/constants/index.ts` — the HTML, React, + Next.js, and vanilla JS snippets shown on the dashboard's Integrations + page, so copy-pasted embed code now points at the live widget instead of + a developer's local machine + - `apps/widget/public/widget.js` — rebuilt with `VITE_WIDGET_URL` set to the + deployed origin (`apps/embed/config.ts`'s `localhost:3001` remains as the + local-development fallback only) +- `apps/web/next.config.ts` — added a redirect from `/` to `/conversations` so + the dashboard opens directly on the operator inbox instead of a blank root + +### Fixed + +#### CI: group Dependabot updates for apps/web, apps/widget, packages/ui + +- Dependabot's single-dependency PRs in this pnpm workspace never + regenerated `pnpm-lock.yaml` (only `package.json`), so every one of them + failed CI at `pnpm install --frozen-lockfile` with + `ERR_PNPM_OUTDATED_LOCKFILE`. The root workspace entry already used + `groups` and its grouped PRs correctly updated the lockfile and passed. +- Mirrored that grouping onto `apps/web`, `apps/widget`, and `packages/ui` so + future minor/patch updates land as working, grouped PRs instead of broken + single-dependency ones. --- diff --git a/apps/embed/landing.html b/apps/embed/landing.html index 1077fc1..1bb3ec0 100644 --- a/apps/embed/landing.html +++ b/apps/embed/landing.html @@ -7,7 +7,7 @@
diff --git a/apps/web/modules/integrations/constants/index.ts b/apps/web/modules/integrations/constants/index.ts index 86f5fb5..e364990 100644 --- a/apps/web/modules/integrations/constants/index.ts +++ b/apps/web/modules/integrations/constants/index.ts @@ -23,7 +23,7 @@ export const INTEGRATIONS = [ export type IntegrationId = (typeof INTEGRATIONS)[number]["id"] -export const HTML_SCRIPT = `` -export const REACT_SCRIPT = `` -export const NEXTJS_SCRIPT = `` -export const JAVASCRIPT_SCRIPT = `` +export const HTML_SCRIPT = `` +export const REACT_SCRIPT = `` +export const NEXTJS_SCRIPT = `` +export const JAVASCRIPT_SCRIPT = `` diff --git a/apps/web/next.config.ts b/apps/web/next.config.ts index e2880e5..86b0189 100644 --- a/apps/web/next.config.ts +++ b/apps/web/next.config.ts @@ -4,6 +4,15 @@ import type { NextConfig } from "next" const nextConfig: NextConfig = { transpilePackages: ["@workspace/ui"], devIndicators: false, + async redirects() { + return [ + { + source: "/", + destination: "/conversations", + permanent: false, + }, + ] + }, } export default withSentryConfig(nextConfig, { diff --git a/apps/widget/public/widget.js b/apps/widget/public/widget.js index cc5cef4..4b8928e 100644 --- a/apps/widget/public/widget.js +++ b/apps/widget/public/widget.js @@ -1,9 +1,9 @@ -(function(){"use strict";const o={WIDGET_URL:"http://localhost:3001",DEFAULT_POSITION:"bottom-right"},p=``;(function(){let n=null,t=null,e=null,d=!1,r=null,a=o.DEFAULT_POSITION;const c=document.currentScript;if(c)r=c.getAttribute("data-organization-id"),a=c.getAttribute("data-position")||o.DEFAULT_POSITION;else{const i=document.querySelectorAll('script[src*="embed"]'),s=Array.from(i).find(l=>l.hasAttribute("data-organization-id"));s&&(r=s.getAttribute("data-organization-id"),a=s.getAttribute("data-position")||o.DEFAULT_POSITION)}if(!r){console.error("Echo Widget: data-organization-id attribute is required");return}function h(){document.readyState==="loading"?document.addEventListener("DOMContentLoaded",g):g()}function g(){e=document.createElement("button"),e.id="echo-widget-button",e.innerHTML=u,e.style.cssText=` position: fixed; ${a==="bottom-right"?"right: 20px;":"left: 20px;"} bottom: 20px; @@ -40,4 +40,4 @@ width: 100%; height: 100%; border: none; - `,n.allow="microphone; clipboard-read; clipboard-write",t.appendChild(n),document.body.appendChild(t),window.addEventListener("message",f)}function w(){const i=new URLSearchParams;return i.append("organizationId",r),`${o.WIDGET_URL}?${i.toString()}`}function f(i){if(i.origin!==new URL(o.WIDGET_URL).origin)return;const{type:s,payload:l}=i.data;switch(s){case"close":u();break;case"resize":l.height&&t&&(t.style.height=`${l.height}px`);break}}function y(){d?u():m()}function m(){t&&e&&(d=!0,t.style.display="block",setTimeout(()=>{t&&(t.style.opacity="1",t.style.transform="translateY(0)")},10),e.innerHTML=b)}function u(){t&&e&&(d=!1,t.style.opacity="0",t.style.transform="translateY(10px)",setTimeout(()=>{t&&(t.style.display="none")},300),e.innerHTML=p,e.style.background="#3b82f6")}function x(){window.removeEventListener("message",f),t&&(t.remove(),t=null,n=null),e&&(e.remove(),e=null),d=!1}function v(i){x(),i.organizationId&&(r=i.organizationId),i.position&&(a=i.position),h()}window.EchoWidget={init:v,show:m,hide:u,destroy:x},h()})()})(); + `,n.allow="microphone; clipboard-read; clipboard-write",t.appendChild(n),document.body.appendChild(t),window.addEventListener("message",f)}function w(){const i=new URLSearchParams;return i.append("organizationId",r),`${o.WIDGET_URL}?${i.toString()}`}function f(i){if(i.origin!==new URL(o.WIDGET_URL).origin)return;const{type:s,payload:l}=i.data;switch(s){case"close":p();break;case"resize":l.height&&t&&(t.style.height=`${l.height}px`);break}}function y(){d?p():m()}function m(){t&&e&&(d=!0,t.style.display="block",setTimeout(()=>{t&&(t.style.opacity="1",t.style.transform="translateY(0)")},10),e.innerHTML=b)}function p(){t&&e&&(d=!1,t.style.opacity="0",t.style.transform="translateY(10px)",setTimeout(()=>{t&&(t.style.display="none")},300),e.innerHTML=u,e.style.background="#3b82f6")}function x(){window.removeEventListener("message",f),t&&(t.remove(),t=null,n=null),e&&(e.remove(),e=null),d=!1}function v(i){x(),i.organizationId&&(r=i.organizationId),i.position&&(a=i.position),h()}window.EchoWidget={init:v,show:m,hide:p,destroy:x},h()})()})();