Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change VITE_PUBLIC_SLOT for landing #2627

Merged
merged 1 commit into from
Jan 7, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions client/apps/landing/.env.preview
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ VITE_LORDS_ADDRESS=0x0342ad5cc14002c005a5cedcfce2bd3af98d5e7fb79e9bf949b3a91cf14


VITE_PUBLIC_CHAIN=sepolia
VITE_PUBLIC_SLOT=

VITE_PUBLIC_CONSTRUCTION_FLAG=false
VITE_PUBLIC_HIDE_THREEJS_MENU=false
Expand Down
2 changes: 1 addition & 1 deletion client/apps/landing/.env.production
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ VITE_REALMS_ADDRESS=0x07ae27a31bb6526e3de9cf02f081f6ce0615ac12a6d7b85ee58b8ad794
VITE_LORDS_ADDRESS=0x0124aeb495b947201f5fac96fd1138e326ad86195b98df6dec9009158a533b49

VITE_PUBLIC_CHAIN=mainnet

VITE_PUBLIC_SLOT=eternum-prod

VITE_PUBLIC_CONSTRUCTION_FLAG=false
VITE_PUBLIC_HIDE_THREEJS_MENU=false
Expand Down
1 change: 1 addition & 0 deletions client/apps/landing/.env.sample
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ VITE_PUBLIC_CHAIN=local

VITE_PUBLIC_CONSTRUCTION_FLAG=false
VITE_PUBLIC_HIDE_THREEJS_MENU=false
VITE_PUBLIC_SLOT=

VITE_PUBLIC_ARK_MARKETPLACE_API=https://abc.com
VITE_PUBLIC_IMAGE_CDN_URL=https://abc.com
Expand Down
2 changes: 1 addition & 1 deletion client/apps/landing/.env.sepolia
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ VITE_REALMS_ADDRESS=0xd2674cc335684896f2b1f942e6929611acab4dc07aa03d0371226812bb
VITE_LORDS_ADDRESS=0x342ad5cc14002c005a5cedcfce2bd3af98d5e7fb79e9bf949b3a91cf145d72e

VITE_PUBLIC_CHAIN=sepolia

VITE_PUBLIC_SLOT=
Copy link
Contributor

Choose a reason for hiding this comment

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

💡 Codebase verification

⚠️ Potential issue

Empty VITE_PUBLIC_SLOT values need attention

The verification confirms that VITE_PUBLIC_SLOT is empty in multiple environments:

  • .env.sepolia: empty value
  • .env.preview: empty value
  • .env.sample: empty value

For reference, production uses the value eternum-prod, suggesting a naming pattern that could be followed (e.g., eternum-sepolia for Sepolia environment).

🔗 Analysis chain

Provide a default slot value for Sepolia environment.

The VITE_PUBLIC_SLOT is currently empty in the Sepolia environment configuration. Since this value is required for the cartridge controller configuration, please provide an appropriate default value.

Let's check the slot values across different environments:

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Compare slot values across different environments
# Expected: Each environment should have an appropriate slot value

echo "Checking slot values across environments:"
fd -e env.sepolia -e env.production -e env.preview . client/apps/landing --exec sh -c 'echo "=== {} ==="; grep "VITE_PUBLIC_SLOT" {} || echo "Not found"'

Length of output: 248


Script:

#!/bin/bash
# First, find all environment-related files
echo "=== Finding environment files ==="
fd -t f "^\.env" client/apps/landing

# Then, check content of each file for any SLOT-related variables
echo -e "\n=== Checking SLOT-related variables ==="
fd -t f "^\.env" client/apps/landing --exec sh -c 'echo "=== {} ==="; grep -i "slot" {} || echo "No SLOT variables found"'

Length of output: 751


Script:

#!/bin/bash
# Search for environment files including hidden ones
echo "=== Finding environment files ==="
fd -H -t f "^\.env" client/apps/landing

# Check content with improved error handling
echo -e "\n=== Checking SLOT-related variables ==="
fd -H -t f "^\.env" client/apps/landing --exec sh -c '
  echo "=== {} ===";
  if [ -f "{}" ]; then
    grep -i "slot" "{}" 2>/dev/null || echo "No SLOT variables found"
  else
    echo "File not readable"
  fi
'

Length of output: 811


VITE_PUBLIC_CONSTRUCTION_FLAG=false
VITE_PUBLIC_HIDE_THREEJS_MENU=false
Expand Down
2 changes: 2 additions & 0 deletions client/apps/landing/env.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ const envSchema = z.object({
VITE_PUBLIC_IMAGE_CDN_URL: z.string().url(),
VITE_PUBLIC_IMAGE_PROXY_URL: z.string().url(),
VITE_PUBLIC_IPFS_GATEWAY: z.string().url(),

VITE_PUBLIC_SLOT: z.string(),
Comment on lines +36 to +37
Copy link
Contributor

Choose a reason for hiding this comment

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

💡 Codebase verification

Environment template files missing for new VITE_PUBLIC_SLOT variable

The new environment variable has been added to the schema, but there are no template files or documentation to guide its setup. This could cause issues for:

  • New developer onboarding
  • CI/CD pipeline configuration
  • Environment setup across different stages (development, production)

Please:

  • Create a .env.example file in client/apps/landing with the expected format
  • Document the required value and its purpose in the README.md
  • Ensure all deployment environments are updated with this new variable
🔗 Analysis chain

LGTM! Verify environment configuration.

The addition of VITE_PUBLIC_SLOT to the schema is correct. Let's verify its presence across all environment files:

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check if VITE_PUBLIC_SLOT is present in all environment files
# Expected: VITE_PUBLIC_SLOT should be present in all .env files

echo "Checking .env files for VITE_PUBLIC_SLOT:"
fd -e env -e env.sample -e env.preview -e env.production -e env.sepolia . client/apps/landing --exec grep -l "VITE_PUBLIC_SLOT" {} \;

Length of output: 229


Script:

#!/bin/bash
# First, let's see what environment files actually exist
echo "Listing all environment files:"
fd -e env -e env.sample -e env.preview -e env.production -e env.sepolia . client/apps/landing

# Then, let's look at their content (excluding any sensitive values)
echo -e "\nChecking environment file contents (showing only VITE_ variables):"
fd -e env -e env.sample -e env.preview -e env.production -e env.sepolia . client/apps/landing --exec sh -c 'echo "\n=== {} ==="; grep "^VITE_" {} || true' \;

Length of output: 476


Script:

#!/bin/bash
# Look for environment template files and documentation
echo "Searching for environment templates and setup instructions:"
fd -e example -e template -e sample . client/apps/landing

echo -e "\nChecking for README files that might contain setup instructions:"
fd README -e md . client/apps/landing

echo -e "\nIf README exists, checking its content for environment setup instructions:"
fd README -e md . client/apps/landing --exec sh -c 'echo "\n=== {} ==="; cat {} | grep -A 5 -i "env" || true' \;

Length of output: 1148

});

let env: z.infer<typeof envSchema>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const otherResources = Object.entries(resourceAddresses)
.map(([_, [__, address]]) => address);

const theme: string = "eternum";
const slot: string = "realms-world-04";
const slot: string = env.VITE_PUBLIC_SLOT;
const namespace: string = "eternum";
const colorMode: ColorMode = "dark";

Expand Down
Loading