From 5d273491f0029370fbfd997bea463e9859d9982a Mon Sep 17 00:00:00 2001 From: Roman Petriv Date: Mon, 2 Oct 2023 15:02:13 +0300 Subject: [PATCH] fix: typo in config file name --- .gitignore | 2 +- packages/app/README.md | 6 +++--- scripts/setup-hyperchain-config.ts | 8 ++++---- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.gitignore b/.gitignore index e0365cf864..cf84bf3d88 100644 --- a/.gitignore +++ b/.gitignore @@ -56,4 +56,4 @@ lerna-debug.log* /allure-results/ # App hyperchain config -hyperchain.json +hyperchain.config.json diff --git a/packages/app/README.md b/packages/app/README.md index 0be36b6001..061fdc096a 100644 --- a/packages/app/README.md +++ b/packages/app/README.md @@ -24,13 +24,13 @@ $ npm install ``` ### Environment configs -Public environment configs are stored in `src/configs` folder and are named as `.config.ts` where `appEnvironment` is the name of the environment set in `VITE_APP_ENVIRONMENT` env variable. +Public environment configs are stored in `src/configs` folder and are named as `.config.json` where `appEnvironment` is the name of the environment set in `VITE_APP_ENVIRONMENT` env variable. Currently there are 3 different environments for the project: `local`, `staging` and `production`, each with its corresponding configuration file. ### Adding a new network to the config -In order to change the configuration for the environment, you need to change its configuration file. By default, there are 4 networks configured for the `local` environment: `local`, `stage`, `testnet` and `mainnet`. Your local network might be different from what is configured in `local.config.ts` in such case you should edit the config and set correct values for your setup. You can also add new items to the `networks` array and they will automatically appear in the networks dropdown on UI. +In order to change the configuration for the environment, you need to change its configuration file. By default, there are 4 networks configured for the `local` environment: `local`, `stage`, `testnet` and `mainnet`. Your local network might be different from what is configured in `local.config.json` in such case you should edit the config and set correct values for your setup. You can also add new items to the `networks` array and they will automatically appear in the networks dropdown on UI. -Example of `local.config.ts` extended with the new network: +Example of `local.config.json` extended with the new network: ``` import stagingConfig from "./staging.config"; diff --git a/scripts/setup-hyperchain-config.ts b/scripts/setup-hyperchain-config.ts index c1f85433f8..6b5870a5da 100644 --- a/scripts/setup-hyperchain-config.ts +++ b/scripts/setup-hyperchain-config.ts @@ -21,7 +21,7 @@ const buildAppConfig = (zkSyncEnvs: { [key: string]: string }) => ({ } }); -const buildWorkerConfig = (zkSyncEnvs) => { +const buildWorkerConfig = (zkSyncEnvs: { [key: string]: string }) => { const dbConfig = parseConnectionString(zkSyncEnvs.DATABASE_URL); return { BLOCKCHAIN_RPC_URL: zkSyncEnvs.API_WEB3_JSON_RPC_HTTP_URL || "", @@ -32,7 +32,7 @@ const buildWorkerConfig = (zkSyncEnvs) => { } }; -const buildApiConfig = (zkSyncEnvs) => { +const buildApiConfig = (zkSyncEnvs: { [key: string]: string }) => { const dbConfig = parseConnectionString(zkSyncEnvs.DATABASE_URL); return { DATABASE_URL: `postgres://${dbConfig.user}:${dbConfig.password}@${dbConfig.host}/block-explorer`, @@ -79,8 +79,8 @@ const buildEnvFileContent = (json: { [key: string]: string | number }) => Object const workerConfig = buildWorkerConfig(envs); const apiConfig = buildApiConfig(envs); - writeFileSync(path.join(__dirname, "../packages/app/src/configs/hyperchain.json"), JSON.stringify(appConfig, null, 2)); - console.log("Updated app config at app/src/configs/hyperchain.json"); + writeFileSync(path.join(__dirname, "../packages/app/src/configs/hyperchain.config.json"), JSON.stringify(appConfig, null, 2)); + console.log("Updated app config at app/src/configs/hyperchain.config.json"); writeFileSync(path.join(__dirname, "../packages/worker/.env"), buildEnvFileContent(workerConfig)); console.log("Updated worker env file at worker/.env"); writeFileSync(path.join(__dirname, "../packages/api/.env"), buildEnvFileContent(apiConfig));