-
Notifications
You must be signed in to change notification settings - Fork 1
Chore/worker convert #46
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR streamlines the deployment process and improves type safety in the codebase by removing legacy configuration files and enhancing API response typings. Key changes include:
- Consolidating legacy environment configurations into a unified wrangler.jsonc file.
- Updating deployment scripts and removing obsolete files.
- Adding explicit TypeScript type annotations in API response handling to improve clarity and safety.
Reviewed Changes
Copilot reviewed 13 out of 18 changed files in this pull request and generated 2 comments.
Show a summary per file
File | Description |
---|---|
src/features/staking/lib/utils/keybase-client.ts | Added explicit type annotation for the API response (using any). |
src/features/staking/lib/core/gas.ts | Introduced explicit typing for the gas API response. |
src/features/staking/lib/core/base.ts | Added type annotations for API responses in getInflation and getDistributionParams. |
src/config.ts | Removed unused testnet configuration. |
server/index.ts | Added a default 404 response handler. |
postcss.config.js | Reordered plugin configuration for readability. |
next.config.mjs | Simplified configuration by removing legacy proxy setup and development-only logic. |
.deploy/testnet2/wrangler.toml | Removed legacy deployment config file. |
.deploy/testnet/wrangler.toml | Removed legacy deployment config file. |
.deploy/mainnet/wrangler.toml | Removed legacy deployment config file. |
Files not reviewed (5)
- .deploy/mainnet/.env: Language not supported
- .deploy/testnet/.env: Language not supported
- .deploy/testnet2/.env: Language not supported
- package.json: Language not supported
- wrangler.jsonc: Language not supported
Comments suppressed due to low confidence (1)
src/features/staking/lib/core/base.ts:144
- Avoid double-casting the JSON response. Instead, create a dedicated interface for the distribution parameters response to improve clarity and enforce type checks.
const data = await response.json() as unknown as { params: { base_proposer_reward: string; bonus_proposer_reward: string; community_tax: string; withdraw_addr_enabled: boolean; }; };
Deploying with
|
Status | Name | Latest Commit | Updated (UTC) |
---|---|---|---|
✅ Deployment successful! View logs |
staking-mainnet | bb3a461 | Apr 30 2025, 10:28 PM |
Deploying staking-mainnet with
|
Latest commit: |
bb3a461
|
Status: | ✅ Deploy successful! |
Preview URL: | https://ba6a85c7.staking-mainnet-8sr.pages.dev |
Branch Preview URL: | https://chore-worker-convert.staking-mainnet-8sr.pages.dev |
Deploying staking-testnet with
|
Latest commit: |
bb3a461
|
Status: | ✅ Deploy successful! |
Preview URL: | https://17351bc1.staking-testnet.pages.dev |
Branch Preview URL: | https://chore-worker-convert.staking-testnet.pages.dev |
Deploying staking-testnet2 with
|
Latest commit: |
bb3a461
|
Status: | ✅ Deploy successful! |
Preview URL: | https://c5904a49.staking-testnet2.pages.dev |
Branch Preview URL: | https://chore-worker-convert.staking-testnet2.pages.dev |
This pull request introduces significant changes to streamline the deployment process, remove deprecated configurations, and improve type safety in the codebase. The most notable updates include the removal of configurations for the
xion-testnet-1
environment, the migration of deployment settings to a newwrangler.jsonc
file, and updates to type annotations for improved type safety.Deployment and Configuration Updates:
.env
andwrangler.toml
files formainnet
,testnet
, andtestnet2
deployments, consolidating configuration management. (.deploy/mainnet/.env
,.deploy/mainnet/wrangler.toml
,.deploy/testnet/.env
,.deploy/testnet/wrangler.toml
,.deploy/testnet2/.env
,.deploy/testnet2/wrangler.toml
) [1] [2] [3] [4] [5] [6]wrangler.jsonc
file to centralize deployment settings, including environment-specific variables and routes formainnet
andtestnet
.Codebase Simplification:
package.json
. Updated deployment scripts to usewrangler
directly. (package.json
) [1] [2] [3]next.config.mjs
by removing proxy-related rewrites and unusedsetupDevPlatform
initialization. (next.config.mjs
) [1] [2]Type Safety Improvements:
getInflation
,getDistributionParams
, andestimateGasViaRest
to reduce runtime errors. (src/features/staking/lib/core/base.ts
,src/features/staking/lib/core/gas.ts
) [1] [2] [3]getIdentityLogo
function to use a typedid
parameter for better clarity. (src/features/staking/lib/utils/keybase-client.ts
)Environment Cleanup:
xion-testnet-1
environment, including its chain ID, RPC URLs, and asset endpoints. (src/config.ts
) [1] [2] [3] [4]These changes collectively simplify the deployment process, improve maintainability, and enhance code reliability.