Skip to content

Conversation

@MananTank
Copy link
Member

@MananTank MananTank commented Oct 2, 2024

Problem solved

Short description of the bug fixed or feature added


PR-Codex overview

This PR focuses on refactoring the API server URL usage across multiple files in the dashboard application. It introduces a new constant, API_SERVER_URL, to centralize the management of the API endpoint, replacing direct references to the environment variable.

Detailed summary

  • Added API_SERVER_URL constant in env.ts.
  • Replaced direct environment variable references with API_SERVER_URL in:
    • getAccount.ts
    • fetchEcosystemList.ts
    • fetchEcosystem.ts
    • team-members.ts
    • get-auth-token/route.ts
    • getAPIKeys.ts
    • ensure-login/route.ts
    • server-proxy/api/[...paths].tsx
    • team.ts
    • projects.ts
    • create-ticket.action.ts
    • auth-actions.ts
    • utils.ts
  • Updated fetch requests to use API_SERVER_URL for consistency and maintainability.

✨ Ask PR-Codex anything about this PR by commenting with /codex {your question}

@changeset-bot
Copy link

changeset-bot bot commented Oct 2, 2024

⚠️ No Changeset found

Latest commit: 025c581

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@github-actions github-actions bot added the Dashboard Involves changes to the Dashboard. label Oct 2, 2024
Copy link
Member Author

MananTank commented Oct 2, 2024

This stack of pull requests is managed by Graphite. Learn more about stacking.

Join @MananTank and the rest of your teammates on Graphite Graphite

@vercel
Copy link

vercel bot commented Oct 2, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
thirdweb-www ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 2, 2024 5:42pm
3 Skipped Deployments
Name Status Preview Comments Updated (UTC)
docs-v2 ⬜️ Skipped (Inspect) Oct 2, 2024 5:42pm
thirdweb_playground ⬜️ Skipped (Inspect) Oct 2, 2024 5:42pm
wallet-ui ⬜️ Skipped (Inspect) Oct 2, 2024 5:42pm

@vercel vercel bot temporarily deployed to Preview – docs-v2 October 2, 2024 15:29 Inactive
@vercel vercel bot temporarily deployed to Preview – wallet-ui October 2, 2024 15:29 Inactive
@vercel vercel bot temporarily deployed to Preview – thirdweb_playground October 2, 2024 15:29 Inactive
@MananTank MananTank marked this pull request as ready for review October 2, 2024 15:30
@codecov
Copy link

codecov bot commented Oct 2, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 47.60%. Comparing base (522968a) to head (025c581).
Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #4887   +/-   ##
=======================================
  Coverage   47.60%   47.60%           
=======================================
  Files        1054     1054           
  Lines       57164    57164           
  Branches     3917     3917           
=======================================
  Hits        27212    27212           
  Misses      29263    29263           
  Partials      689      689           
Flag Coverage Δ *Carryforward flag
legacy_packages 65.68% <ø> (ø) Carriedforward from 522968a
packages 43.35% <ø> (ø)

*This pull request uses carry forward flags. Click here to find out more.

@github-actions
Copy link
Contributor

github-actions bot commented Oct 2, 2024

size-limit report 📦

Path Size Loading time (3g) Running time (snapdragon) Total time
thirdweb (esm) 41.98 KB (0%) 840 ms (0%) 561 ms (+81.32% 🔺) 1.4 s
thirdweb (cjs) 101.58 KB (0%) 2.1 s (0%) 936 ms (+0.07% 🔺) 3 s
thirdweb (minimal + tree-shaking) 4.82 KB (0%) 97 ms (0%) 96 ms (+273.65% 🔺) 192 ms
thirdweb/chains (tree-shaking) 498 B (0%) 10 ms (0%) 22 ms (+119.82% 🔺) 32 ms
thirdweb/react (minimal + tree-shaking) 16.75 KB (0%) 335 ms (0%) 111 ms (-22.19% 🔽) 446 ms

@graphite-app
Copy link
Contributor

graphite-app bot commented Oct 2, 2024

Your org has enabled the Graphite merge queue for merging into main

Add the label “merge-queue” to the PR and Graphite will automatically add it to the merge queue when it’s ready to merge. Or use the label “hotfix” to add to the merge queue as a hot fix.

You must have a Graphite account and log in to Graphite in order to use the merge queue. Sign up using this link.

process.env.NEXT_PUBLIC_DASHBOARD_UPLOAD_SERVER ||
"https://storage.thirdweb.com";

export const API_SERVER_URL =
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as long as we're clear that this is only supposed to be used in backend functions and never directly from the client this is fine.

@graphite-app
Copy link
Contributor

graphite-app bot commented Oct 2, 2024

Merge activity

## Problem solved

Short description of the bug fixed or feature added

<!-- start pr-codex -->

---

## PR-Codex overview
This PR introduces a new constant, `API_SERVER_URL`, to centralize the API server URL configuration. It replaces instances of `process.env.NEXT_PUBLIC_THIRDWEB_API_HOST` throughout the codebase, enhancing maintainability and readability.

### Detailed summary
- Added `API_SERVER_URL` in `env.ts`.
- Replaced `process.env.NEXT_PUBLIC_THIRDWEB_API_HOST` with `API_SERVER_URL` in multiple files:
  - `getAccount.ts`
  - `fetchEcosystemList.ts`
  - `fetchEcosystem.ts`
  - `team-members.ts`
  - `get-auth-token/route.ts`
  - `getAPIKeys.ts`
  - `ensure-login/route.ts`
  - `server-proxy/api/[...paths].tsx`
  - `team.ts`
  - `projects.ts`
  - `create-ticket.action.ts`
  - `auth-actions.ts`
  - `utils.ts`
- Updated fetch requests to use `API_SERVER_URL` for consistent API endpoint access.

> ✨ Ask PR-Codex anything about this PR by commenting with `/codex {your question}`

<!-- end pr-codex -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Dashboard Involves changes to the Dashboard.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants