Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@37bytes/prepare-environment

Package Overview
Dependencies
Maintainers
6
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@37bytes/prepare-environment - npm Package Compare versions

Comparing version 1.0.4 to 2.0.0

build/utils/checkEnvironmentExists.js

7

build/prepareEnviroment.js

@@ -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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc