@adobe/aio-lib-env
Advanced tools
Comparing version 1.0.0 to 1.1.0-pre.2022-06-06.9947571f
{ | ||
"version": "1.0.0", | ||
"version": "1.1.0-pre.2022-06-06.9947571f", | ||
"homepage": "https://github.com/adobe/aio-lib-env", | ||
@@ -13,4 +13,4 @@ "license": "Apache-2.0", | ||
"dependencies": { | ||
"@adobe/aio-lib-core-config": "^2.0.0", | ||
"@adobe/aio-lib-core-logging": "^1.2.0" | ||
"@adobe/aio-lib-core-config": "next", | ||
"@adobe/aio-lib-core-logging": "next" | ||
}, | ||
@@ -20,13 +20,13 @@ "deprecated": false, | ||
"devDependencies": { | ||
"@adobe/eslint-config-aio-lib-config": "^1.2.0", | ||
"@adobe/eslint-config-aio-lib-config": "^1.4.0", | ||
"codecov": "^3.5.0", | ||
"eslint": "^6.2.2", | ||
"eslint-config-standard": "^14.1.0", | ||
"eslint-plugin-import": "^2.18.0", | ||
"eslint-plugin-jest": "^23.1.1", | ||
"eslint-plugin-jsdoc": "^25.0.1", | ||
"eslint": "^7.32.0", | ||
"eslint-config-standard": "^16.0.3", | ||
"eslint-plugin-import": "^2.25.4", | ||
"eslint-plugin-jest": "^23.20.0", | ||
"eslint-plugin-jsdoc": "^37.5.1", | ||
"eslint-plugin-node": "^11.1.0", | ||
"eslint-plugin-promise": "^4.2.1", | ||
"eslint-plugin-promise": "^5.2.0", | ||
"eslint-plugin-standard": "^4.0.0", | ||
"jest": "^24.8.0", | ||
"jest": "^27", | ||
"jest-junit": "^10.0.0", | ||
@@ -36,3 +36,4 @@ "jsdoc": "^3.6.3", | ||
"stdout-stderr": "^0.1.9", | ||
"tsd-jsdoc": "^2.4.0" | ||
"tsd-jsdoc": "^2.4.0", | ||
"typescript": "^4.5.4" | ||
}, | ||
@@ -46,3 +47,4 @@ "engines": { | ||
"unit-tests": "jest --config test/jest.config.js --maxWorkers=2" | ||
} | ||
} | ||
}, | ||
"prereleaseSha": "9947571ff3210d6b840e7bbd3a7f2ec63b248bdf" | ||
} |
@@ -43,3 +43,4 @@ <!-- | ||
const env = getCliEnv() | ||
// getCliEnv defaults to PROD_ENV if the global config key is not set, or is set to an unknown env | ||
const env = getCliEnv() | ||
// do something based on the env - switch to prod or stage endpoints, for example | ||
@@ -46,0 +47,0 @@ ``` |
@@ -35,3 +35,5 @@ /* | ||
const configValue = config.get(DEVELOPMENT_ENVIRONMENT_KEY) | ||
// The env AIO_CLI_ENV must be read explicitly instead of via `config.get` to support the case where the var is set via webpack | ||
// after being webpack()'d the following line will look like this => const configValue = "prod" || config.get(DEVELOPMENT_ENVIRONMENT_KEY) | ||
const configValue = process.env.AIO_CLI_ENV || config.get(DEVELOPMENT_ENVIRONMENT_KEY) | ||
logger.debug(`config key value set for env: ${configValue}`) | ||
@@ -38,0 +40,0 @@ |
@@ -65,2 +65,14 @@ /* | ||
}) | ||
test('reads from process.env before aioConfig', () => { | ||
mockConfig.get.mockReturnValueOnce('some-invalid-env') | ||
process.env.AIO_CLI_ENV = 'invalid-value' | ||
expect(getCliEnv()).toEqual(DEFAULT_ENV) | ||
process.env.AIO_CLI_ENV = STAGE | ||
expect(getCliEnv()).toEqual(STAGE) | ||
delete process.env.AIO_CLI_ENV | ||
expect(getCliEnv()).toEqual(PROD) | ||
}) | ||
}) | ||
@@ -67,0 +79,0 @@ |
Sorry, the diff of this file is not supported yet
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
35255
21
204
86
17
1
7
+ Added@adobe/aio-lib-core-config@4.0.0-pre.2024-01-08.d04a66d9(transitive)
+ Added@adobe/aio-lib-core-logging@2.0.1-pre.2024-01-08.sha-cbe78b13(transitive)
+ Addedargparse@2.0.1(transitive)
+ Addeddotenv@16.3.1(transitive)
+ Addedjs-yaml@4.1.0(transitive)
- Removed@adobe/aio-lib-core-config@2.0.1(transitive)
- Removed@adobe/aio-lib-core-logging@1.2.0(transitive)
- Removedargparse@1.0.10(transitive)
- Removeddotenv@8.2.0(transitive)
- Removedesprima@4.0.1(transitive)
- Removedjs-yaml@3.14.1(transitive)
- Removedsprintf-js@1.0.3(transitive)