diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index b7384362d..f4332c188 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -26,11 +26,11 @@ jobs: path: | /home/runner/.deno /home/runner/.cache/deno/deps/https/deno.land - - uses: denoland/setup-deno@v1 + - uses: denoland/setup-deno@v2 with: - deno-version: v1.x + deno-version: v2.x - name: Bundle Apps - run: deno run -A --lock=deno.lock --lock-write --reload scripts/start.ts + run: deno run -A --lock=deno.lock --frozen=false --reload scripts/start.ts - name: Check run: deno task check @@ -51,4 +51,4 @@ jobs: - name: Benchmark continue-on-error: true - run: deno bench --lock=deno.lock --lock-write -A . \ No newline at end of file + run: deno bench --lock=deno.lock --lock-write -A . diff --git a/.github/workflows/issues.yaml b/.github/workflows/issues.yaml index 9504b5705..d5f99f015 100644 --- a/.github/workflows/issues.yaml +++ b/.github/workflows/issues.yaml @@ -15,4 +15,4 @@ jobs: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} GH_REPO: ${{ github.repository }} NUMBER: ${{ github.event.issue.number }} - LABELS: triage \ No newline at end of file + LABELS: triage diff --git a/.github/workflows/releaser.yaml b/.github/workflows/releaser.yaml index 5584f177e..f4fb8d2a0 100644 --- a/.github/workflows/releaser.yaml +++ b/.github/workflows/releaser.yaml @@ -9,9 +9,9 @@ on: - main permissions: - contents: write # Necessary for accessing and modifying repository content - pull-requests: write # Necessary for interacting with pull requests - actions: write # Necessary for triggering other workflows + contents: write # Necessary for accessing and modifying repository content + pull-requests: write # Necessary for interacting with pull requests + actions: write # Necessary for triggering other workflows jobs: tag-discussion: @@ -21,9 +21,9 @@ jobs: - name: Checkout Code uses: actions/checkout@v3 with: - ref: ${{ github.event.pull_request.base.ref }} # Checkout the base branch (target repository) - repository: ${{ github.event.pull_request.base.repo.full_name }} # Checkout from the target repo - + ref: ${{ github.event.pull_request.base.ref }} # Checkout the base branch (target repository) + repository: ${{ github.event.pull_request.base.repo.full_name }} # Checkout from the target repo + - name: Calculate new versions id: calculate_versions run: | @@ -162,11 +162,11 @@ jobs: run: | git tag ${{ steps.determine_version.outputs.new_version }} git push origin ${{ steps.determine_version.outputs.new_version }} - + - name: Trigger Release Workflow run: | curl -X POST \ -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \ -H "Accept: application/vnd.github.everest-preview+json" \ https://api.github.com/repos/${{ github.repository }}/actions/workflows/release.yaml/dispatches \ - -d '{"ref":"main", "inputs":{"tag_name":"${{ steps.determine_version.outputs.new_version }}"}}' \ No newline at end of file + -d '{"ref":"main", "inputs":{"tag_name":"${{ steps.determine_version.outputs.new_version }}"}}' diff --git a/posthog/components/PostHog.tsx b/posthog/components/PostHog.tsx index 85178ace4..b19b9fab7 100644 --- a/posthog/components/PostHog.tsx +++ b/posthog/components/PostHog.tsx @@ -29,7 +29,7 @@ const snippet = () => { const trackPageview = () => globalThis.window.posthog?.capture("$pageview", { ...props, - "$current_url": window.location.href, + "$current_url": globalThis.location.href, }); // Attach pushState and popState listeners const originalPushState = history.pushState; diff --git a/smarthint/components/Click.tsx b/smarthint/components/Click.tsx index 07d1a8d61..899a3efba 100644 --- a/smarthint/components/Click.tsx +++ b/smarthint/components/Click.tsx @@ -21,7 +21,7 @@ export const SmarthintSendEventOnClick = ({ } elem.addEventListener("click", () => { - window.smarthint.click(event); + globalThis.smarthint.click(event); }); }, id, diff --git a/smarthint/sections/Analytics/SmarthintTracking.tsx b/smarthint/sections/Analytics/SmarthintTracking.tsx index b1abb65e3..d90c46995 100644 --- a/smarthint/sections/Analytics/SmarthintTracking.tsx +++ b/smarthint/sections/Analytics/SmarthintTracking.tsx @@ -16,7 +16,7 @@ const listener = ( ReturnType, ) => { const prodURL = new URL(publicUrl); - const url = new URL(window.location.href); + const url = new URL(globalThis.location.href); url.host = prodURL.host; url.port = ""; const pageType = diff --git a/vtex/sections/Analytics/Vtex.tsx b/vtex/sections/Analytics/Vtex.tsx index 53d75cf11..ba91361bd 100644 --- a/vtex/sections/Analytics/Vtex.tsx +++ b/vtex/sections/Analytics/Vtex.tsx @@ -15,7 +15,7 @@ interface ISCookies { session: any; } const snippet = (account: string, agent: string, cookies: ISCookies | null) => { - const url = new URL(window.location.href); + const url = new URL(globalThis.location.href); const isSearch = url.searchParams.get("q"); const apiUrl = `https://sp.vtex.com/event-api/v1/${account}/event`; const eventFetch = (props: SPEvent) => { diff --git a/wake/hooks/context.ts b/wake/hooks/context.ts index 4d3f6b1c4..0afc46a4a 100644 --- a/wake/hooks/context.ts +++ b/wake/hooks/context.ts @@ -83,7 +83,7 @@ const enqueue2 = ( return; } - const isLocalhost = window.location.hostname === "localhost"; + const isLocalhost = globalThis.location.hostname === "localhost"; if (!isLocalhost) { const url = new URL("/api/carrinho", shop.checkoutUrl); diff --git a/website/components/Clickhouse.tsx b/website/components/Clickhouse.tsx index 2e2007b2b..3e4e1d350 100644 --- a/website/components/Clickhouse.tsx +++ b/website/components/Clickhouse.tsx @@ -218,7 +218,7 @@ const snippet = ({ siteId, siteName, serviceEndpoint, userId, sessionId }: { return match ? match[1].replace("_", ".") : "Unknown"; } function getUrlParam(param: string) { - const urlParams = new URLSearchParams(window.location.search); + const urlParams = new URLSearchParams(globalThis.location.search); return urlParams.get(param); } function getReferrerSource(referrer: string) { @@ -245,7 +245,7 @@ const snippet = ({ siteId, siteName, serviceEndpoint, userId, sessionId }: { start_time: new Date().toISOString(), timestamp: undefined, // get server side pathname: globalThis.window.location.pathname + - (window.location.hash ?? ""), + (globalThis.location.hash ?? ""), navigation_from: globalThis.window.navigation.activation.from, entry_meta: { key: Object.keys(values), @@ -266,7 +266,7 @@ const snippet = ({ siteId, siteName, serviceEndpoint, userId, sessionId }: { ip_timezone: undefined, // get server side ip_lat: undefined, // get server side ip_long: undefined, // get server side - screen_size: `${window.screen.width}x${window.screen.height}`, + screen_size: `${globalThis.screen.width}x${globalThis.screen.height}`, device: getDeviceType(), operating_system: getOperatingSystem(), operating_system_version: getOSVersion(),