mirror of
https://github.com/fergalmoran/onearmy-community-platform.git
synced 2025-12-22 09:37:54 +00:00
chore: add back files that are needed
This commit is contained in:
30
functions/scripts/paths.ts
Normal file
30
functions/scripts/paths.ts
Normal 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',
|
||||
)
|
||||
24
functions/scripts/runtimeConfig/model.ts
Normal file
24
functions/scripts/runtimeConfig/model.ts
Normal 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',
|
||||
},
|
||||
}
|
||||
7
functions/scripts/runtimeConfig/write.ts
Normal file
7
functions/scripts/runtimeConfig/write.ts
Normal 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))
|
||||
Reference in New Issue
Block a user