@37bytes/prepare-environment
Advanced tools
Comparing version 1.0.4 to 2.0.0
@@ -9,2 +9,3 @@ "use strict"; | ||
var ProcessArgument_1 = __importDefault(require("./constants/ProcessArgument")); | ||
var checkEnvironmentExists_1 = __importDefault(require("./utils/checkEnvironmentExists")); | ||
var KEY_ENV_NAME = 'ENV_NAME'; | ||
@@ -19,3 +20,3 @@ var KEY_CAL_VAR = 'CAL_VER'; | ||
var configData = _a.configData, cliArguments = _a.cliArguments, appName = _a.appName; | ||
var variablePrefix = configData.variablePrefix, allowedEnvironments = configData.allowedEnvironments, environmentsFolder = configData.environmentsFolder, resultConfig = configData.resultConfig; | ||
var variablePrefix = configData.variablePrefix, environmentsFolder = configData.environmentsFolder, resultConfig = configData.resultConfig; | ||
// region константы | ||
@@ -67,4 +68,4 @@ var pathToResultConfig = path_1.default.resolve(process.cwd(), resultConfig); | ||
var targetEnvironment = scriptArguments[KEY_ENV_NAME]; | ||
if (!targetEnvironment || !allowedEnvironments.includes(targetEnvironment)) { | ||
throw new Error("targetEnvironment unknown, current value is \"".concat(targetEnvironment, "\", available values is [").concat(allowedEnvironments, "]")); | ||
if (!(0, checkEnvironmentExists_1.default)(targetEnvironment, pathToEnvironmentsFolder)) { | ||
throw new Error("targetEnvironment is unknown, current value is \"".concat(targetEnvironment, "\", available values are [").concat(fs_1.default.readdirSync(pathToEnvironmentsFolder), "]")); | ||
} | ||
@@ -71,0 +72,0 @@ console.log("target environment found! ".concat(targetEnvironment)); |
{ | ||
"name": "@37bytes/prepare-environment", | ||
"version": "1.0.4", | ||
"version": "2.0.0", | ||
"description": "Utility to prepare the environment for a React application. Useful for CI.", | ||
@@ -5,0 +5,0 @@ "repository": "https://github.com/37bytes/public-packages/tree/master/packages/prepare-environment", |
@@ -23,2 +23,7 @@ | ||
2.0.0 | ||
- Elimination of allowedEnvironments. Instead, available environments are computed from the environments folder. | ||
- Added 'isEnvironmentExists' function in utils. The function takes parameters: targetEnvironment - the name of the environment, and pathToEnvironmentsFolder - the path to the folder containing the environments. The function checks for the presence of the .env.targetEnvironment file in the environments folder. | ||
- fix for environment name check | ||
1.0.4 | ||
@@ -25,0 +30,0 @@ - refactoring the script version |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
16484
12
291
42
3
1