Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: missing beacon network configuration + docs for env vars #232

Merged
merged 2 commits into from
Nov 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 16 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,21 @@ it directly.
## Prerequisites:
- Node Package Manager

## Translations in dev mode
## Development

### Adding a new environment configuration variable

Any new environment / configuration variable must be registered in several places:

1. [`./create_config_prod.js`](./create_config_prod.js): mapping the environment variable to a config object entry for
production.
2. [`./webpack.config.js`](./webpack.config.js): setting a default value for the environment variable; used in Webpack development
builds.
3. [`./src/public/config.js`](./src/public/config.js): creating the shape of the global config object (using the config object entry key,
mapped to in 1.)
4. [`./src/js/config.ts`](./src/js/config.ts): loading from the global config object (production) via key or from the
environment variable directly, through Webpack replacement (development).

### Translations in dev mode
Add your English to French translations in `dist/public/locales/fr/translation_fr.json` for them to appear on the
website.
1 change: 1 addition & 0 deletions create_config_prod.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ const siteConfig = {
TRANSLATED: parseBoolean(process.env.BENTO_PUBLIC_TRANSLATED),
BEACON_URL: process.env.BEACON_URL || null,
BEACON_UI_ENABLED: parseBoolean(process.env.BENTO_BEACON_UI_ENABLED),
BEACON_NETWORK_ENABLED: parseBoolean(process.env.BENTO_BEACON_NETWORK_ENABLED),

// Authentication
PUBLIC_URL: process.env.BENTO_PUBLIC_URL || null,
Expand Down
1 change: 1 addition & 0 deletions src/public/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ BENTO_PUBLIC_CONFIG = {
TRANSLATED: null,
BEACON_URL: null,
BEACON_UI_ENABLED: null,
BEACON_NETWORK_ENABLED: null,
// Authentication
PUBLIC_URL: null,
CLIENT_ID: null,
Expand Down