From 97f7df8302cb4e645f74f442baf1613d5e0283fe Mon Sep 17 00:00:00 2001 From: Raymond Jacobson Date: Mon, 22 Jan 2024 18:03:41 -0800 Subject: [PATCH] Remove adroll, fix local ga-measurement, and env loading --- .circleci/src/jobs/@web-jobs.yml | 8 ++-- packages/common/src/services/env.ts | 6 +-- packages/mobile/.env.dev | 3 +- packages/mobile/.env.prod | 3 +- packages/mobile/.env.stage | 3 +- .../xcshareddata/xcschemes/Dev.xcscheme | 2 +- .../xcshareddata/xcschemes/Staging.xcscheme | 2 +- packages/mobile/src/env/env.dev.ts | 7 ++- packages/mobile/src/env/env.prod.ts | 4 +- packages/mobile/src/env/env.stage.ts | 6 +-- packages/web/.gitignore | 2 +- packages/web/index.html | 48 ++----------------- packages/web/package.json | 14 +++--- packages/web/scripts/writeSHA.sh | 4 +- packages/web/src/services/env/env.dev.ts | 4 +- packages/web/src/services/env/env.prod.ts | 2 - packages/web/src/services/env/env.stage.ts | 4 +- packages/web/vite.config.ts | 13 +++-- 18 files changed, 45 insertions(+), 90 deletions(-) diff --git a/.circleci/src/jobs/@web-jobs.yml b/.circleci/src/jobs/@web-jobs.yml index fe6a447c50d..ae6d69b0d44 100644 --- a/.circleci/src/jobs/@web-jobs.yml +++ b/.circleci/src/jobs/@web-jobs.yml @@ -51,15 +51,15 @@ web-build-demo: - run: name: build-demo no_output_timeout: 30m - # Set the branch name as the VITE_PUBLIC_URL so that relative paths work, e.g. + # Set the branch name as the VITE_BASENAME so that relative paths work, e.g. # demo.audius.co/some-branch/handle/track resolves as /handle/track would at audius.co command: | cd packages/web - cp ./.env/.env.stage ./.env/.env.stage.tmp - echo -e "\nVITE_PUBLIC_URL=/${CIRCLE_BRANCH}" >> ./.env/.env.stage + cp ./env/.env.stage ./env/.env.stage.tmp + echo -e "\nVITE_BASENAME=/${CIRCLE_BRANCH}" >> ./env/.env.stage CI=false npm run build:stage -w audius-client mv build-staging build-demo - cp ./.env/.env.stage.tmp ./.env/.env.stage + cp ./env/.env.stage.tmp ./env/.env.stage - persist_to_workspace: root: ./ paths: diff --git a/packages/common/src/services/env.ts b/packages/common/src/services/env.ts index 1e043af1002..3dff3318b3c 100644 --- a/packages/common/src/services/env.ts +++ b/packages/common/src/services/env.ts @@ -4,8 +4,6 @@ export type Environment = 'development' | 'staging' | 'production' export type Env = { AAO_ENDPOINT: string - ADROLL_AVD_ID: Nullable - ADROLL_PIX_ID: Nullable AMPLITUDE_API_KEY: Nullable AMPLITUDE_PROXY: Nullable AMPLITUDE_WRITE_KEY: Nullable @@ -36,7 +34,7 @@ export type Env = { FINGERPRINT_ENDPOINT: Nullable FINGERPRINT_PUBLIC_API_KEY: Nullable GA_HOSTNAME: string - GA_MEASUREMENT_ID: Nullable + GA_MEASUREMENT_ID: string GENERAL_ADMISSION: string HCAPTCHA_BASE_URL: string HCAPTCHA_SITE_KEY: string @@ -73,7 +71,7 @@ export type Env = { TRPC_ENDPOINT: string USDC_MINT_ADDRESS: string USER_NODE: string - USE_HASH_ROUTING: Nullable + USE_HASH_ROUTING: boolean WAUDIO_MINT_ADDRESS: string WEB3_NETWORK_ID: string WEB3_PROVIDER_URL: string diff --git a/packages/mobile/.env.dev b/packages/mobile/.env.dev index 4082e2c155e..a67e869d6a5 100644 --- a/packages/mobile/.env.dev +++ b/packages/mobile/.env.dev @@ -1 +1,2 @@ -ENVIRONMENT=development \ No newline at end of file +ENVIRONMENT=development +TIKTOK_APP_ID=awlrj83t4nx6qc5a \ No newline at end of file diff --git a/packages/mobile/.env.prod b/packages/mobile/.env.prod index 5c603b7019d..9569ac667cd 100644 --- a/packages/mobile/.env.prod +++ b/packages/mobile/.env.prod @@ -1 +1,2 @@ -ENVIRONMENT=production \ No newline at end of file +ENVIRONMENT=production +TIKTOK_APP_ID=awa9re2w7ec3xrn6 \ No newline at end of file diff --git a/packages/mobile/.env.stage b/packages/mobile/.env.stage index 6673ee28668..cefa07bf10a 100644 --- a/packages/mobile/.env.stage +++ b/packages/mobile/.env.stage @@ -1 +1,2 @@ -ENVIRONMENT=staging \ No newline at end of file +ENVIRONMENT=staging +TIKTOK_APP_ID=awlrj83t4nx6qc5a \ No newline at end of file diff --git a/packages/mobile/ios/AudiusReactNative.xcodeproj/xcshareddata/xcschemes/Dev.xcscheme b/packages/mobile/ios/AudiusReactNative.xcodeproj/xcshareddata/xcschemes/Dev.xcscheme index 706c4e810c1..4676fb051bd 100644 --- a/packages/mobile/ios/AudiusReactNative.xcodeproj/xcshareddata/xcschemes/Dev.xcscheme +++ b/packages/mobile/ios/AudiusReactNative.xcodeproj/xcshareddata/xcschemes/Dev.xcscheme @@ -10,7 +10,7 @@ ActionType = "Xcode.IDEStandardExecutionActionsCore.ExecutionActionType.ShellScriptAction"> + scriptText = "# Type a script or drag a script file from your workspace to insert its path."> diff --git a/packages/mobile/ios/AudiusReactNative.xcodeproj/xcshareddata/xcschemes/Staging.xcscheme b/packages/mobile/ios/AudiusReactNative.xcodeproj/xcshareddata/xcschemes/Staging.xcscheme index b3706d3646a..dd649564dc1 100644 --- a/packages/mobile/ios/AudiusReactNative.xcodeproj/xcshareddata/xcschemes/Staging.xcscheme +++ b/packages/mobile/ios/AudiusReactNative.xcodeproj/xcshareddata/xcschemes/Staging.xcscheme @@ -10,7 +10,7 @@ ActionType = "Xcode.IDEStandardExecutionActionsCore.ExecutionActionType.ShellScriptAction"> + scriptText = "# Type a script or drag a script file from your workspace to insert its path."> diff --git a/packages/mobile/src/env/env.dev.ts b/packages/mobile/src/env/env.dev.ts index ce31c16ed32..6d630b5a266 100644 --- a/packages/mobile/src/env/env.dev.ts +++ b/packages/mobile/src/env/env.dev.ts @@ -1,9 +1,8 @@ import type { Env } from '@audius/common' +import Config from 'react-native-config' export const env: Env = { AAO_ENDPOINT: 'http://audius-protocol-anti-abuse-oracle-1', - ADROLL_AVD_ID: null, - ADROLL_PIX_ID: null, AMPLITUDE_API_KEY: null, AMPLITUDE_PROXY: null, AMPLITUDE_WRITE_KEY: null, @@ -36,7 +35,7 @@ export const env: Env = { FINGERPRINT_ENDPOINT: null, FINGERPRINT_PUBLIC_API_KEY: null, GA_HOSTNAME: 'staging.audius.co', - GA_MEASUREMENT_ID: null, + GA_MEASUREMENT_ID: 'G-XXXXX', GENERAL_ADMISSION: 'http://audius-protocol-general-admission-1', HCAPTCHA_BASE_URL: 'https://staging.audius.co', HCAPTCHA_SITE_KEY: '2abe61f1-af6e-4707-be19-a9a4146a9bea', @@ -72,7 +71,7 @@ export const env: Env = { SOLANA_WEB3_CLUSTER: 'devnet', SUGGESTED_FOLLOW_HANDLES: 'https://download.staging.audius.co/static-resources/signup-follows.json', - TIKTOK_APP_ID: 'awlrj83t4nx6qc5a', + TIKTOK_APP_ID: Config.TIKTOK_APP_ID!, TRPC_ENDPOINT: 'http://localhost:2022/trpc', USDC_MINT_ADDRESS: '26Q7gP8UfkDzi7GMFEQxTJaNJ8D2ybCUjex58M5MLu8y', USER_NODE: 'http://audius-protocol-creator-node-1', diff --git a/packages/mobile/src/env/env.prod.ts b/packages/mobile/src/env/env.prod.ts index 11733d65e3e..8ce424675f6 100644 --- a/packages/mobile/src/env/env.prod.ts +++ b/packages/mobile/src/env/env.prod.ts @@ -3,8 +3,6 @@ import Config from 'react-native-config' export const env: Env = { AAO_ENDPOINT: 'https://antiabuseoracle.audius.co', - ADROLL_AVD_ID: 'SDJ23TS7DBFPLMXRDF6JQY', - ADROLL_PIX_ID: 'JZSZK5GWHBFL3FQ3NRFPNY', AMPLITUDE_API_KEY: '86760558b8bb1b3aae61656efd4ddacb', AMPLITUDE_PROXY: 'https://gain.audius.co', AMPLITUDE_WRITE_KEY: Config.AMPLITUDE_WRITE_KEY as string, @@ -74,7 +72,7 @@ export const env: Env = { SOLANA_WEB3_CLUSTER: 'mainnet-beta', SUGGESTED_FOLLOW_HANDLES: 'https://download.audius.co/static-resources/signup-follows.json', - TIKTOK_APP_ID: 'awa9re2w7ec3xrn6', + TIKTOK_APP_ID: Config.TIKTOK_APP_ID!, TRPC_ENDPOINT: 'https://discoveryprovider3.audius.co/trpc/trpc', USDC_MINT_ADDRESS: 'EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v', USER_NODE: 'https://usermetadata.audius.co', diff --git a/packages/mobile/src/env/env.stage.ts b/packages/mobile/src/env/env.stage.ts index fdc038bf31f..7ec0533b7c6 100644 --- a/packages/mobile/src/env/env.stage.ts +++ b/packages/mobile/src/env/env.stage.ts @@ -3,8 +3,6 @@ import Config from 'react-native-config' export const env: Env = { AAO_ENDPOINT: 'https://antiabuseoracle.staging.audius.co', - ADROLL_AVD_ID: null, - ADROLL_PIX_ID: null, AMPLITUDE_API_KEY: '72a58ce4ad1f9bafcba0b92bedb6c33d', AMPLITUDE_PROXY: 'https://gain.audius.co', AMPLITUDE_WRITE_KEY: Config.AMPLITUDE_WRITE_KEY as string, @@ -39,7 +37,7 @@ export const env: Env = { FINGERPRINT_ENDPOINT: 'https://fp.staging.audius.co', FINGERPRINT_PUBLIC_API_KEY: 'Rz2A3Y5YGSg9K80VgKPi', GA_HOSTNAME: 'staging.audius.co', - GA_MEASUREMENT_ID: null, + GA_MEASUREMENT_ID: 'G-CH6BY2X2WL', GENERAL_ADMISSION: 'https://general-admission.staging.audius.co', HCAPTCHA_BASE_URL: 'https://staging.audius.co', HCAPTCHA_SITE_KEY: '2abe61f1-af6e-4707-be19-a9a4146a9bea', @@ -74,7 +72,7 @@ export const env: Env = { SOLANA_WEB3_CLUSTER: 'mainnet-beta', SUGGESTED_FOLLOW_HANDLES: 'https://download.staging.audius.co/static-resources/signup-follows.json', - TIKTOK_APP_ID: 'awlrj83t4nx6qc5a', + TIKTOK_APP_ID: Config.TIKTOK_APP_ID!, TRPC_ENDPOINT: 'https://discoveryprovider3.staging.audius.co/trpc/trpc', USDC_MINT_ADDRESS: 'EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v', USER_NODE: 'https://usermetadata.staging.audius.co', diff --git a/packages/web/.gitignore b/packages/web/.gitignore index fb103863500..a48ee82c4b3 100644 --- a/packages/web/.gitignore +++ b/packages/web/.gitignore @@ -8,7 +8,7 @@ !/public/scripts/sw.js # env -.env/.env.dev.local +env/.env.dev.local # testing /coverage diff --git a/packages/web/index.html b/packages/web/index.html index 4ac098d181f..d90c58b927e 100644 --- a/packages/web/index.html +++ b/packages/web/index.html @@ -71,7 +71,7 @@ // Account recovery try { const urlParams = new URLSearchParams(window.location.search) - const useHashRouting = !!'%USE_HASH_ROUTING%' + const useHashRouting = '%USE_HASH_ROUTING%' const login = urlParams.get('login') const warning = urlParams.get('warning') @@ -114,51 +114,13 @@ > - - - -