Skip to content

Commit

Permalink
Revert "Set NODE_ENV on staging to staging (#3480)" (#3482)
Browse files Browse the repository at this point in the history
This reverts commit 44699d4.
  • Loading branch information
piotrkonowrocki authored Feb 2, 2024
1 parent 44699d4 commit 59d5527
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/aws-staging.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ jobs:
ETHERSCAN_API_KEY: ${{ secrets.ETHERSCAN_API_KEY }}
BLOCKNATIVE_API_KEY: ${{ secrets.BLOCKNATIVE_API_KEY_STAGING }}
SHOW_BUILD_INFO: 1
NODE_ENV: staging
NODE_ENV: production
NEXT_PUBLIC_SENTRY_ENV: staging
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
PRODUCT_HUB_KEY: ${{ secrets.PRODUCT_HUB_KEY }}
Expand Down
2 changes: 1 addition & 1 deletion blockchain/networks/get-rpc-provider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ export function getBackendRpcProvider(networkId: NetworkIds): JsonRpcBatchProvid
skipCache: false,
skipMulticall: false,
skipGraph: true,
stage: process.env.NODE_ENV !== 'development' ? 'prod' : 'dev',
stage: process.env.NODE_ENV === 'production' ? 'prod' : 'dev',
source: 'backend',
}

Expand Down
2 changes: 1 addition & 1 deletion blockchain/networks/network-helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import type { NetworkConfig, NetworkConfigHexId } from './networks-config'
import { networks, networksById } from './networks-config'

export const isTestnetEnabled = () => {
const isDev = env.NODE_ENV === 'development'
const isDev = env.NODE_ENV !== 'production'
const showTestnetsParam =
window && new URLSearchParams(window.location.search).get('testnets') !== null
return isDev || showTestnetsParam
Expand Down
2 changes: 1 addition & 1 deletion blockchain/networks/networks-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ export function contractDesc(
export function emptyContractDesc(contractName: string): ContractDesc & { genesisBlock: number } {
// not every contract is available on every network
// hence this function is used to return an empty contract
env.NODE_ENV !== 'production' && console.warn('Contract not set:', contractName)
env.NODE_ENV === 'development' && console.warn('Contract not set:', contractName)
return { abi: {}, address: '', genesisBlock: 0 }
}

Expand Down
2 changes: 1 addition & 1 deletion contentful/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export async function fetchGraphQL<T>(query: (preview: boolean) => string): Prom
const previewAccessToken =
getConfig()?.publicRuntimeConfig?.contentfulPreviewAccessToken ||
process.env.CONTENTFUL_PREVIEW_ACCESS_TOKEN
const preview = process.env.NODE_ENV !== 'production'
const preview = process.env.NODE_ENV === 'development'

return fetch(
`https://graphql.contentful.com/content/v1/spaces/${process.env.CONTENTFUL_SPACE_ID}`,
Expand Down
5 changes: 3 additions & 2 deletions next-i18next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@ const HttpBackend = require('i18next-http-backend/cjs')
const HMRPlugin =
process.env.NODE_ENV !== 'production' ? require('i18next-hmr/plugin').HMRPlugin : undefined

const isProd = process.env.NODE_ENV === 'production'
const isDev = process.env.NODE_ENV === 'development'
const windowDefined = typeof window !== 'undefined'

const hmrConfig =
!isDev && windowDefined
!isProd && windowDefined
? [HttpBackend, new HMRPlugin({ webpack: { client: true } })]
: [HMRPlugin ? new HMRPlugin({ webpack: { server: true } }) : undefined]

Expand All @@ -24,5 +25,5 @@ module.exports = {
: {}),
serializeConfig: false,
reloadOnPrerender: isDev,
use: isDev ? hmrConfig : [],
use: !isProd ? hmrConfig : [],
}
2 changes: 1 addition & 1 deletion server/prisma.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ type GlobalThisWithPrismaClient = typeof globalThis & {
}

function getPrismaClient() {
if (process.env.NODE_ENV !== 'development') {
if (process.env.NODE_ENV === `production`) {
return new PrismaClient()
} else {
const newGlobalThis = globalThis as GlobalThisWithPrismaClient
Expand Down

0 comments on commit 59d5527

Please sign in to comment.