Skip to content

Commit

Permalink
fix: Env working locally and in prod
Browse files Browse the repository at this point in the history
  • Loading branch information
RezaRahemtola committed Dec 10, 2024
1 parent ca40a66 commit d43ece2
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 22 deletions.
18 changes: 9 additions & 9 deletions .env.example
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
# Use the testnet in development
# APP.ALEPH_API_URL=https://api.twentysix.testnet.network
# ALEPH_API_URL=https://api.twentysix.testnet.network

# WalletConnect
APP.WALLET_CONNECT_PROJECT_ID=
WALLET_CONNECT_PROJECT_ID=

# APIs
APP.LTAI_SUBSCRIPTIONS_API_URL=http://localhost:8000
APP.LTAI_AGENTS_API_URL=http://localhost:8001
LTAI_SUBSCRIPTIONS_API_URL=http://localhost:8000
LTAI_AGENTS_API_URL=http://localhost:8001

# RPCs
APP.SOLANA_RPC=
SOLANA_RPC=

# Blockchain addresses (change in development)
# APP.LTAI_BASE_ADDRESS=0x92e1d72210429Ce7eE8a0d64D526D4b9752801FF
# APP.LTAI_SOLANA_ADDRESS=5ooRTqmvm95bHwp4HMo3iszCwsEseY5hksfSa9EDVpBY
# APP.LTAI_PUBLISHER_ADDRESS=0xae92Dc50115dbBb1CF0BA848e83842daf00CE129
# APP.WAGMI_BASE_ID=84532
# LTAI_BASE_ADDRESS=0x92e1d72210429Ce7eE8a0d64D526D4b9752801FF
# LTAI_SOLANA_ADDRESS=5ooRTqmvm95bHwp4HMo3iszCwsEseY5hksfSa9EDVpBY
# LTAI_PUBLISHER_ADDRESS=0xae92Dc50115dbBb1CF0BA848e83842daf00CE129
# WAGMI_BASE_ID=84532
11 changes: 11 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 1 addition & 4 deletions quasar.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,7 @@ module.exports = configure(function (ctx) {
viteConf.plugins = [
...viteConf.plugins,
nodePolyfills(),
EnvironmentPlugin('all', {
prefix: 'APP.',
defineOn: 'import.meta.env',
}),
EnvironmentPlugin('all', { defineOn: 'import.meta.env' }),
];
if (ctx.dev) {
viteConf.define['process.browser'] = true;
Expand Down
10 changes: 1 addition & 9 deletions src/config/env.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,6 @@ const envSchema = z.object({
WAGMI_BASE_ID: z.union([z.literal(base.id), z.literal(baseSepolia.id)]).default(base.id),
});

const env = envSchema.parse(
Object.keys(import.meta.env).reduce(
(acc, key) => ({
...acc,
...{ [key.replace('APP.', '')]: import.meta.env[key] },
}),
{},
),
);
const env = envSchema.parse(import.meta.env);

export default env;

0 comments on commit d43ece2

Please sign in to comment.