chore: add back files that are needed

This commit is contained in:
David Germain
2024-05-31 17:58:14 +02:00
committed by benfurber
parent 6aff3dd24c
commit 5b6cf4b837
3 changed files with 61 additions and 0 deletions

View File

@@ -0,0 +1,30 @@
import * as path from 'path'
export const FUNCTIONS_DIR = path.resolve(__dirname, '../')
// When passing to CLI only relative folder names used
export const EMULATOR_SEED_FOLDER = 'data/seed'
export const EMULATOR_IMPORT_FOLDER = 'data/emulated'
export const EMULATOR_EXPORT_FOLDER = 'data/exported'
// For custom scripts full paths user
export const EMULATOR_SEED_PATH = path.resolve(
FUNCTIONS_DIR,
EMULATOR_SEED_FOLDER,
)
export const EMULATOR_IMPORT_PATH = path.resolve(
FUNCTIONS_DIR,
EMULATOR_IMPORT_FOLDER,
)
export const EMULATOR_EXPORT_PATH = path.resolve(
FUNCTIONS_DIR,
EMULATOR_EXPORT_FOLDER,
)
// For compiling src folder
export const PLATFORM_ROOT_PATH = path.resolve(FUNCTIONS_DIR, '..')
export const PLATFORM_LIB_PATH = path.resolve(PLATFORM_ROOT_PATH, 'lib')
export const PLATFORM_TSCONFIG_TYPES_PATH = path.resolve(
PLATFORM_ROOT_PATH,
'tsconfig.src-types.json',
)

View File

@@ -0,0 +1,24 @@
import type { configVars } from '../../src/config/config'
/** Variables populates in the same way firebase functions:config:set does for use in testing */
export const runtimeConfigTest: configVars = {
analytics: {
tracking_code: 'fake_tracking_code',
view_id: 'fake_view_id',
},
integrations: {
discord_webhook: 'https://fake_discord_webhook.local',
discord_alert_channel_webhook:
'https://fake_discord_alert_channel_webhook.local',
slack_webhook: 'https://fake_slack_webhook.local',
patreon_client_id: 'fake_patreon_client_id',
patreon_client_secret: 'fake_patreon_client_secret',
},
service: null as any,
deployment: {
site_url: 'http://localhost:4000',
},
prerender: {
api_key: 'fake_prerender_key',
},
}

View File

@@ -0,0 +1,7 @@
import { writeFileSync } from 'fs'
import { resolve } from 'path'
import { FUNCTIONS_DIR } from '../paths'
import { runtimeConfigTest } from './model'
const runtimeConfigPath = resolve(FUNCTIONS_DIR, '.runtimeconfig.json')
writeFileSync(runtimeConfigPath, JSON.stringify(runtimeConfigTest))