Skip to content

Commit 59d5527

Browse files
Revert "Set NODE_ENV on staging to staging (#3480)" (#3482)
This reverts commit 44699d4.
1 parent 44699d4 commit 59d5527

File tree

7 files changed

+9
-8
lines changed

7 files changed

+9
-8
lines changed

.github/workflows/aws-staging.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ jobs:
106106
ETHERSCAN_API_KEY: ${{ secrets.ETHERSCAN_API_KEY }}
107107
BLOCKNATIVE_API_KEY: ${{ secrets.BLOCKNATIVE_API_KEY_STAGING }}
108108
SHOW_BUILD_INFO: 1
109-
NODE_ENV: staging
109+
NODE_ENV: production
110110
NEXT_PUBLIC_SENTRY_ENV: staging
111111
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
112112
PRODUCT_HUB_KEY: ${{ secrets.PRODUCT_HUB_KEY }}

blockchain/networks/get-rpc-provider.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ export function getBackendRpcProvider(networkId: NetworkIds): JsonRpcBatchProvid
8282
skipCache: false,
8383
skipMulticall: false,
8484
skipGraph: true,
85-
stage: process.env.NODE_ENV !== 'development' ? 'prod' : 'dev',
85+
stage: process.env.NODE_ENV === 'production' ? 'prod' : 'dev',
8686
source: 'backend',
8787
}
8888

blockchain/networks/network-helpers.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import type { NetworkConfig, NetworkConfigHexId } from './networks-config'
99
import { networks, networksById } from './networks-config'
1010

1111
export const isTestnetEnabled = () => {
12-
const isDev = env.NODE_ENV === 'development'
12+
const isDev = env.NODE_ENV !== 'production'
1313
const showTestnetsParam =
1414
window && new URLSearchParams(window.location.search).get('testnets') !== null
1515
return isDev || showTestnetsParam

blockchain/networks/networks-config.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ export function contractDesc(
8383
export function emptyContractDesc(contractName: string): ContractDesc & { genesisBlock: number } {
8484
// not every contract is available on every network
8585
// hence this function is used to return an empty contract
86-
env.NODE_ENV !== 'production' && console.warn('Contract not set:', contractName)
86+
env.NODE_ENV === 'development' && console.warn('Contract not set:', contractName)
8787
return { abi: {}, address: '', genesisBlock: 0 }
8888
}
8989

contentful/api.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ export async function fetchGraphQL<T>(query: (preview: boolean) => string): Prom
66
const previewAccessToken =
77
getConfig()?.publicRuntimeConfig?.contentfulPreviewAccessToken ||
88
process.env.CONTENTFUL_PREVIEW_ACCESS_TOKEN
9-
const preview = process.env.NODE_ENV !== 'production'
9+
const preview = process.env.NODE_ENV === 'development'
1010

1111
return fetch(
1212
`https://graphql.contentful.com/content/v1/spaces/${process.env.CONTENTFUL_SPACE_ID}`,

next-i18next.config.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,12 @@ const HttpBackend = require('i18next-http-backend/cjs')
22
const HMRPlugin =
33
process.env.NODE_ENV !== 'production' ? require('i18next-hmr/plugin').HMRPlugin : undefined
44

5+
const isProd = process.env.NODE_ENV === 'production'
56
const isDev = process.env.NODE_ENV === 'development'
67
const windowDefined = typeof window !== 'undefined'
78

89
const hmrConfig =
9-
!isDev && windowDefined
10+
!isProd && windowDefined
1011
? [HttpBackend, new HMRPlugin({ webpack: { client: true } })]
1112
: [HMRPlugin ? new HMRPlugin({ webpack: { server: true } }) : undefined]
1213

@@ -24,5 +25,5 @@ module.exports = {
2425
: {}),
2526
serializeConfig: false,
2627
reloadOnPrerender: isDev,
27-
use: isDev ? hmrConfig : [],
28+
use: !isProd ? hmrConfig : [],
2829
}

server/prisma.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ type GlobalThisWithPrismaClient = typeof globalThis & {
66
}
77

88
function getPrismaClient() {
9-
if (process.env.NODE_ENV !== 'development') {
9+
if (process.env.NODE_ENV === `production`) {
1010
return new PrismaClient()
1111
} else {
1212
const newGlobalThis = globalThis as GlobalThisWithPrismaClient

0 commit comments

Comments
 (0)