Skip to content
This repository has been archived by the owner on May 3, 2024. It is now read-only.

Commit

Permalink
fix(env): add ONE_ prefix to env var
Browse files Browse the repository at this point in the history
  • Loading branch information
Matthew-Mallimo committed Oct 22, 2021
1 parent bbbdf19 commit 8c0acbc
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions __tests__/server/utils/onModuleLoad.spec.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -253,8 +253,8 @@ describe('onModuleLoad', () => {
expect(() => onModuleLoad({ module: { [CONFIGURATION_KEY]: configuration, [META_DATA_KEY]: { version: '1.0.11' } }, moduleName: 'my-awesome-module' })).toThrowErrorMatchingSnapshot();
});

it('logs a warning if the root module provides an incompatible version of a required external and DANGEROUSLY_ACCEPT_BREAKING_EXTERNALS is set to true', () => {
process.env.DANGEROUSLY_ACCEPT_BREAKING_EXTERNALS = true;
it('logs a warning if the root module provides an incompatible version of a required external and ONE_DANGEROUSLY_ACCEPT_BREAKING_EXTERNALS is set to true', () => {
process.env.ONE_DANGEROUSLY_ACCEPT_BREAKING_EXTERNALS = true;
RootModule[CONFIGURATION_KEY].providedExternals = {
'dep-a': { version: '2.1.0', module: () => 0 },
};
Expand Down
10 changes: 5 additions & 5 deletions docs/api/server/Environment-Variables.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ One App can be configured via Environment Variables:
* [`NODE_ENV`](#node_env) ⚠️
* [`ONE_CLIENT_ROOT_MODULE_NAME`](#one_client_root_module_name) ⚠️
* [`ONE_CONFIG_ENV`](#one_config_env) ⚠️
* [`DANGEROUSLY_ACCEPT_BREAKING_EXTERNALS`](#dangerously_accept_breaking_externals)
* [`ONE_DANGEROUSLY_ACCEPT_BREAKING_EXTERNALS`](#ONE_DANGEROUSLY_ACCEPT_BREAKING_EXTERNALS)
* Server Settings
* [`HOLOCRON_SERVER_MAX_MODULES_RETRY`](#holocron_server_max_modules_retry)
* [`HOLOCRON_SERVER_MAX_SIM_MODULES_FETCH`](#holocron_server_max_sim_modules_fetch)
Expand Down Expand Up @@ -511,7 +511,7 @@ ONE_CONFIG_ENV=staging
ONE_CONFIG_ENV=undefined
```
## `DANGEROUSLY_ACCEPT_BREAKING_EXTERNALS`
## `ONE_DANGEROUSLY_ACCEPT_BREAKING_EXTERNALS`
**Runs In**
* ✅ Production
Expand All @@ -522,17 +522,17 @@ This flag is meant to ease the transition to newer versions of externals. It sho
**Shape**
```bash
DANGEROUSLY_ACCEPT_BREAKING_EXTERNALS=true
ONE_DANGEROUSLY_ACCEPT_BREAKING_EXTERNALS=true
```
**Example**
```bash
DANGEROUSLY_ACCEPT_BREAKING_EXTERNALS=true
ONE_DANGEROUSLY_ACCEPT_BREAKING_EXTERNALS=true
```
**Default Value**
```bash
DANGEROUSLY_ACCEPT_BREAKING_EXTERNALS=undefined
ONE_DANGEROUSLY_ACCEPT_BREAKING_EXTERNALS=undefined
```
Expand Down
2 changes: 1 addition & 1 deletion src/server/utils/onModuleLoad.js
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ export default function onModuleLoad({
messages.push(`External '${externalName}' is required by ${moduleName}, but is not provided by the root module`);
} else if (!semver.satisfies(providedExternal.version, requestedExternalVersion)) {
const failedExternalMessage = `${externalName}@${requestedExternalVersion} is required by ${moduleName}, but the root module provides ${providedExternal.version}`;
if (process.env.DANGEROUSLY_ACCEPT_BREAKING_EXTERNALS) {
if (process.env.ONE_DANGEROUSLY_ACCEPT_BREAKING_EXTERNALS) {
console.warn(failedExternalMessage);
} else {
messages.push(failedExternalMessage);
Expand Down

0 comments on commit 8c0acbc

Please sign in to comment.