This repository was archived by the owner on Aug 5, 2026. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
'Generate ENS referral link' form refinement #60
Merged
Y3drk
merged 16 commits into
main
from
y3drk/feat/generate-referral-link-form-refinement
Nov 24, 2025
Merged
Changes from 14 commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
cc88e93
'Generate ENS referral link' form refinement
Y3drk 03746fa
Formatting & linting (1)
Y3drk 0f51120
Redistribution of env vars access functions
Y3drk b560b6f
Fix astro-related dependency vulnerabilities
Y3drk 5f51058
Fixing the typecheck workflow-only error -> attempt 1
Y3drk 7d89879
Partial application of 11/20/25 GitHub review feedback
Y3drk 2f5ec66
Application of 11/21/25 GitHub review feedback
Y3drk 6bbfea0
Resolving conflicts with main
Y3drk c3aba6a
Formatting & linting (2)
Y3drk 526dd1e
refine resolution logic
lightwalker-eth 30130b5
refine comments
lightwalker-eth 40f93a0
Refine comments
lightwalker-eth 2b22943
refine ReferralLinkForm.tsx
lightwalker-eth 3cc00cf
Update ReferralLinkForm.tsx
lightwalker-eth 4e75ac6
Replace vitest specific env variable with the public one -> local [x]…
Y3drk cc620a7
Replace vitest specific env variable with the public one -> local [x]…
Y3drk File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,8 +1,15 @@ | ||
| # The ENSAdmin public service URL | ||
| # Link to the ENSNode instance available across the whole app. | ||
| # If not provided, the default public URL will point to | ||
| # the publicly hosted Alpha ENSNode instance. | ||
| ENSNODE_URL=https://api.alpha.ensnode.io/ | ||
| # URL of the ENSNode instance to fetch ENS data from. | ||
| # This URL is used for all ENSNode connections across the whole app, excluding only unit test files. | ||
| # NOTE: This value is publicly exposed to anyone loading the app as it is made available to | ||
| # client-side components running in the browser. | ||
| # Optional. If not set, defaults to `DEFAULT_ENSNODE_URL` (https://api.alpha.ensnode.io/). | ||
| PUBLIC_ENSNODE_URL=https://api.alpha.ensnode.io/ | ||
|
|
||
| # The ENSAdmin public service URL specifically for testing, | ||
| # Contract data validation | ||
| # The ENSNode public service URL specifically for validating that for all contracts stored in @/data/contracts.ts | ||
| # their cached ENS identity matches the current state in ENS. | ||
| # Used only in @/data/contracts.test.ts. | ||
| # Available only in server-side code or Astro build configuration. Not exposed to the browser. | ||
| # Separated from PUBLIC_ENSNODE_URL to facilitate integration with Vitest. | ||
| # Optional. If not set, defaults to `DEFAULT_ENSNODE_URL` (https://api.alpha.ensnode.io/). | ||
| VITE_ENSNODE_URL=https://api.alpha.ensnode.io/ | ||
|
Y3drk marked this conversation as resolved.
Outdated
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -6,4 +6,5 @@ export interface FormField { | |
| label: string; | ||
| type: "text" | "url"; | ||
| required: boolean; | ||
| placeholder?: string; | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| interface ImportMetaEnv { | ||
| readonly PUBLIC_ENSNODE_URL: string; | ||
| } | ||
|
|
||
| interface ImportMeta { | ||
| readonly env: ImportMetaEnv; | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| /** | ||
| * Default ENSNode API endpoint URL | ||
| */ | ||
| export const DEFAULT_ENSNODE_URL = "https://api.alpha.ensnode.io" as const; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| import { DEFAULT_ENSNODE_URL } from "@/utils/env/index.ts"; | ||
|
|
||
| /** | ||
| * Returns the ENSNode public URL defined in the .env file | ||
| * | ||
| * If the env variable is undefined returns a default fallback. | ||
| * | ||
| * @throws if the value set for PUBLIC_ENSNODE_URL cannot be converted to a `URL`. | ||
| */ | ||
|
Y3drk marked this conversation as resolved.
Outdated
|
||
| export const getENSNodeUrl = (): URL => { | ||
| const maybeEnvVariableURL = import.meta.env.PUBLIC_ENSNODE_URL; | ||
|
|
||
| // Check for empty string is necessary due to GitHub's fallback mechanism | ||
| // https://docs.github.com/en/actions/reference/workflows-and-actions/contexts | ||
| if (maybeEnvVariableURL === undefined || maybeEnvVariableURL === "") { | ||
| return new URL(DEFAULT_ENSNODE_URL); | ||
| } | ||
|
|
||
| return new URL(maybeEnvVariableURL); | ||
| }; | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| import { DEFAULT_ENSNODE_URL } from "@/utils/env/index.ts"; | ||
|
|
||
| /** | ||
| * Returns the ENSNode public URL defined in the .env file | ||
| * specifically for unit testing. | ||
| * | ||
| * If the env variable is undefined returns a default fallback. | ||
| * | ||
| * @throws if the value set for VITE_ENSNODE_URL cannot be converted to a `URL`. | ||
| */ | ||
| export const getENSNodeUrlForTests = (): URL => { | ||
| const maybeEnvVariableURL = process.env.VITE_ENSNODE_URL; | ||
|
Y3drk marked this conversation as resolved.
Outdated
|
||
|
|
||
| // Check for empty string is necessary due to GitHub's fallback mechanism | ||
| // https://docs.github.com/en/actions/reference/workflows-and-actions/contexts | ||
| if (maybeEnvVariableURL === undefined || maybeEnvVariableURL === "") { | ||
| return new URL(DEFAULT_ENSNODE_URL); | ||
| } | ||
|
|
||
| return new URL(maybeEnvVariableURL); | ||
| }; | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.