Skip to content

Commit

Permalink
Deno 2 support
Browse files Browse the repository at this point in the history
Signed-off-by: Marcos Candeia <[email protected]>
  • Loading branch information
mcandeia committed Oct 16, 2024
1 parent 6fac346 commit fe69c04
Show file tree
Hide file tree
Showing 9 changed files with 21 additions and 21 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -51,4 +51,4 @@ jobs:

- name: Benchmark
continue-on-error: true
run: deno bench --lock=deno.lock --lock-write -A .
run: deno bench --lock=deno.lock --lock-write -A .
2 changes: 1 addition & 1 deletion .github/workflows/issues.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ jobs:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GH_REPO: ${{ github.repository }}
NUMBER: ${{ github.event.issue.number }}
LABELS: triage
LABELS: triage
16 changes: 8 additions & 8 deletions .github/workflows/releaser.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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: |
Expand Down Expand Up @@ -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 }}"}}'
-d '{"ref":"main", "inputs":{"tag_name":"${{ steps.determine_version.outputs.new_version }}"}}'
2 changes: 1 addition & 1 deletion posthog/components/PostHog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion smarthint/components/Click.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export const SmarthintSendEventOnClick = ({
}

elem.addEventListener("click", () => {
window.smarthint.click(event);
globalThis.smarthint.click(event);
});
},
id,
Expand Down
2 changes: 1 addition & 1 deletion smarthint/sections/Analytics/SmarthintTracking.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const listener = (
ReturnType<typeof loader>,
) => {
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 =
Expand Down
2 changes: 1 addition & 1 deletion vtex/sections/Analytics/Vtex.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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) => {
Expand Down
2 changes: 1 addition & 1 deletion wake/hooks/context.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
6 changes: 3 additions & 3 deletions website/components/Clickhouse.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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),
Expand All @@ -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(),
Expand Down

0 comments on commit fe69c04

Please sign in to comment.