@commercetools-frontend/cypress-environments 0.1.3 → 0.1.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -42,7 +42,7 @@ var dotenv__default = /*#__PURE__*/_interopDefault(dotenv);
|
|
|
42
42
|
var pkgDir__default = /*#__PURE__*/_interopDefault(pkgDir);
|
|
43
43
|
|
|
44
44
|
function ownKeys(e, r) { var t = _Object$keys__default["default"](e); if (_Object$getOwnPropertySymbols__default["default"]) { var o = _Object$getOwnPropertySymbols__default["default"](e); r && (o = _filterInstanceProperty__default["default"](o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default["default"](e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
45
|
-
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var
|
|
45
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var _context3, _context4; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context3 = ownKeys(Object(t), !0)).call(_context3, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context4 = ownKeys(Object(t))).call(_context4, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
46
46
|
const cypressEnvironmentsConfigExplorer = cosmiconfig.cosmiconfig('cypress-environments', {
|
|
47
47
|
searchStrategy: 'project'
|
|
48
48
|
});
|
|
@@ -57,14 +57,14 @@ function doesFileExist(filePath) {
|
|
|
57
57
|
}
|
|
58
58
|
function getParsedEnvFileContents(envPath) {
|
|
59
59
|
if (doesFileExist(envPath)) {
|
|
60
|
-
console.log(
|
|
60
|
+
console.log(`✅ Found and loading environment variables from: '${envPath}'`);
|
|
61
61
|
const envFileContents = fs__default["default"].readFileSync(envPath, {
|
|
62
62
|
encoding: 'utf8'
|
|
63
63
|
});
|
|
64
64
|
const configuration = dotenv__default["default"].parse(envFileContents);
|
|
65
65
|
return configuration;
|
|
66
66
|
} else {
|
|
67
|
-
console.log(
|
|
67
|
+
console.log(`ℹ️ No environment variables at: '${envPath}'. If needed create it or duplicate the template file.`);
|
|
68
68
|
return null;
|
|
69
69
|
}
|
|
70
70
|
}
|
|
@@ -72,27 +72,27 @@ async function loadConfig() {
|
|
|
72
72
|
try {
|
|
73
73
|
return await cypressEnvironmentsConfigExplorer.search();
|
|
74
74
|
} catch (e) {
|
|
75
|
-
throw new Error(
|
|
75
|
+
throw new Error(`Failed loading a Cypress environments configuration. Create a cosmiconfig for 'cypress-environments' for example 'cypress-environments.config.cjs'.`);
|
|
76
76
|
}
|
|
77
77
|
}
|
|
78
78
|
async function getConfigurationForEnvironment(environmentName) {
|
|
79
|
-
var _context, _context2
|
|
79
|
+
var _context, _context2;
|
|
80
80
|
// NOTE: On CI the *.ci secrests are not excluded. Locally the are in case
|
|
81
81
|
// decrypted files are available on a developer's machine.
|
|
82
82
|
const ignoredGlobs = ['**/*.enc', '**/*.template'];
|
|
83
83
|
const ignoredCIGlobs = ['**/*.ci'];
|
|
84
84
|
const allIgnoredGlobs = isCI ? ignoredGlobs : _concatInstanceProperty__default["default"](ignoredGlobs).call(ignoredGlobs, ignoredCIGlobs);
|
|
85
85
|
if (isCI) {
|
|
86
|
-
console.log(
|
|
86
|
+
console.log(`ℹ️ 'CI' environment variable is defined. Assuming operating from a CI system.`);
|
|
87
87
|
} else {
|
|
88
|
-
console.log(
|
|
88
|
+
console.log(`ℹ️ 'CI' environment variable is not defined. Assuming you are running locally.`);
|
|
89
89
|
}
|
|
90
|
-
console.log(
|
|
90
|
+
console.log(`ℹ️ The ignored globs are: ${allIgnoredGlobs.join(', ')}.`);
|
|
91
91
|
const configResult = await loadConfig();
|
|
92
|
-
const allEnvironmentConfigs = configResult
|
|
92
|
+
const allEnvironmentConfigs = configResult?.config;
|
|
93
93
|
const configForEnvironment = _findInstanceProperty__default["default"](_context = allEnvironmentConfigs.environments).call(_context, environment => environment.name === environmentName);
|
|
94
94
|
if (!configForEnvironment) {
|
|
95
|
-
throw new Error(
|
|
95
|
+
throw new Error(`No configuration for ${environmentName} defined in cosmiconfig for 'cypress-environments'. Please make sure it exists.`);
|
|
96
96
|
}
|
|
97
97
|
const secretsFiles = await glob.glob(configForEnvironment.secrets.glob, {
|
|
98
98
|
ignore: allIgnoredGlobs
|
|
@@ -100,27 +100,27 @@ async function getConfigurationForEnvironment(environmentName) {
|
|
|
100
100
|
const configFiles = await glob.glob(configForEnvironment.config.glob, {
|
|
101
101
|
ignore: allIgnoredGlobs
|
|
102
102
|
});
|
|
103
|
-
console.log(
|
|
103
|
+
console.log(`ℹ️ Found ${secretsFiles.length} secret file(s) and ${configFiles.length} config file(s) matching the defined globs.`);
|
|
104
104
|
if (secretsFiles.length === 0 || configFiles.length === 0) {
|
|
105
|
-
console.log(
|
|
106
|
-
console.log(
|
|
105
|
+
console.log(`ℹ️ Secrets files glob is: ${configForEnvironment.secrets.glob}`);
|
|
106
|
+
console.log(`ℹ️ Config files glob is: ${configForEnvironment.config.glob}`);
|
|
107
107
|
}
|
|
108
|
-
const mergedConfigurationAndSecrests = _reduceInstanceProperty__default["default"](
|
|
108
|
+
const mergedConfigurationAndSecrests = _reduceInstanceProperty__default["default"](_context2 = [...configFiles, ...secretsFiles]).call(_context2, (previousParsedEnvFileContents, nextEnvFilePath) => {
|
|
109
109
|
const parsedEnvFileContents = getParsedEnvFileContents(nextEnvFilePath);
|
|
110
110
|
let matchingParsedEnvFileContentsForCIOrLocal = null;
|
|
111
111
|
if (!_endsWithInstanceProperty__default["default"](nextEnvFilePath).call(nextEnvFilePath, '.local') && !_endsWithInstanceProperty__default["default"](nextEnvFilePath).call(nextEnvFilePath, '.ci')) {
|
|
112
|
-
matchingParsedEnvFileContentsForCIOrLocal = isCI ? getParsedEnvFileContents(
|
|
112
|
+
matchingParsedEnvFileContentsForCIOrLocal = isCI ? getParsedEnvFileContents(`${nextEnvFilePath}.ci`) : getParsedEnvFileContents(`${nextEnvFilePath}.local`);
|
|
113
113
|
}
|
|
114
114
|
return _objectSpread(_objectSpread(_objectSpread({}, previousParsedEnvFileContents), parsedEnvFileContents), matchingParsedEnvFileContentsForCIOrLocal);
|
|
115
115
|
}, {});
|
|
116
116
|
const rootDir = await pkgDir__default["default"](__dirname);
|
|
117
117
|
let sharedEnvironmentConfiguration = null;
|
|
118
118
|
if (rootDir) {
|
|
119
|
-
const pathToSharedEnvironmentConfiguration = path__default["default"].join(rootDir, 'config',
|
|
119
|
+
const pathToSharedEnvironmentConfiguration = path__default["default"].join(rootDir, 'config', `.env.${environmentName}.config`);
|
|
120
120
|
if (doesFileExist(pathToSharedEnvironmentConfiguration)) {
|
|
121
121
|
sharedEnvironmentConfiguration = getParsedEnvFileContents(pathToSharedEnvironmentConfiguration);
|
|
122
122
|
} else {
|
|
123
|
-
console.log(
|
|
123
|
+
console.log(`ℹ️ No shared configuration for ${environmentName} defined.`);
|
|
124
124
|
}
|
|
125
125
|
}
|
|
126
126
|
return _objectSpread(_objectSpread({}, sharedEnvironmentConfiguration), mergedConfigurationAndSecrests);
|
|
@@ -42,7 +42,7 @@ var dotenv__default = /*#__PURE__*/_interopDefault(dotenv);
|
|
|
42
42
|
var pkgDir__default = /*#__PURE__*/_interopDefault(pkgDir);
|
|
43
43
|
|
|
44
44
|
function ownKeys(e, r) { var t = _Object$keys__default["default"](e); if (_Object$getOwnPropertySymbols__default["default"]) { var o = _Object$getOwnPropertySymbols__default["default"](e); r && (o = _filterInstanceProperty__default["default"](o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default["default"](e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
45
|
-
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var
|
|
45
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var _context3, _context4; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context3 = ownKeys(Object(t), !0)).call(_context3, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context4 = ownKeys(Object(t))).call(_context4, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
46
46
|
const cypressEnvironmentsConfigExplorer = cosmiconfig.cosmiconfig('cypress-environments', {
|
|
47
47
|
searchStrategy: 'project'
|
|
48
48
|
});
|
|
@@ -57,14 +57,14 @@ function doesFileExist(filePath) {
|
|
|
57
57
|
}
|
|
58
58
|
function getParsedEnvFileContents(envPath) {
|
|
59
59
|
if (doesFileExist(envPath)) {
|
|
60
|
-
console.log(
|
|
60
|
+
console.log(`✅ Found and loading environment variables from: '${envPath}'`);
|
|
61
61
|
const envFileContents = fs__default["default"].readFileSync(envPath, {
|
|
62
62
|
encoding: 'utf8'
|
|
63
63
|
});
|
|
64
64
|
const configuration = dotenv__default["default"].parse(envFileContents);
|
|
65
65
|
return configuration;
|
|
66
66
|
} else {
|
|
67
|
-
console.log(
|
|
67
|
+
console.log(`ℹ️ No environment variables at: '${envPath}'. If needed create it or duplicate the template file.`);
|
|
68
68
|
return null;
|
|
69
69
|
}
|
|
70
70
|
}
|
|
@@ -72,27 +72,27 @@ async function loadConfig() {
|
|
|
72
72
|
try {
|
|
73
73
|
return await cypressEnvironmentsConfigExplorer.search();
|
|
74
74
|
} catch (e) {
|
|
75
|
-
throw new Error(
|
|
75
|
+
throw new Error(`Failed loading a Cypress environments configuration. Create a cosmiconfig for 'cypress-environments' for example 'cypress-environments.config.cjs'.`);
|
|
76
76
|
}
|
|
77
77
|
}
|
|
78
78
|
async function getConfigurationForEnvironment(environmentName) {
|
|
79
|
-
var _context, _context2
|
|
79
|
+
var _context, _context2;
|
|
80
80
|
// NOTE: On CI the *.ci secrests are not excluded. Locally the are in case
|
|
81
81
|
// decrypted files are available on a developer's machine.
|
|
82
82
|
const ignoredGlobs = ['**/*.enc', '**/*.template'];
|
|
83
83
|
const ignoredCIGlobs = ['**/*.ci'];
|
|
84
84
|
const allIgnoredGlobs = isCI ? ignoredGlobs : _concatInstanceProperty__default["default"](ignoredGlobs).call(ignoredGlobs, ignoredCIGlobs);
|
|
85
85
|
if (isCI) {
|
|
86
|
-
console.log(
|
|
86
|
+
console.log(`ℹ️ 'CI' environment variable is defined. Assuming operating from a CI system.`);
|
|
87
87
|
} else {
|
|
88
|
-
console.log(
|
|
88
|
+
console.log(`ℹ️ 'CI' environment variable is not defined. Assuming you are running locally.`);
|
|
89
89
|
}
|
|
90
|
-
console.log(
|
|
90
|
+
console.log(`ℹ️ The ignored globs are: ${allIgnoredGlobs.join(', ')}.`);
|
|
91
91
|
const configResult = await loadConfig();
|
|
92
|
-
const allEnvironmentConfigs = configResult
|
|
92
|
+
const allEnvironmentConfigs = configResult?.config;
|
|
93
93
|
const configForEnvironment = _findInstanceProperty__default["default"](_context = allEnvironmentConfigs.environments).call(_context, environment => environment.name === environmentName);
|
|
94
94
|
if (!configForEnvironment) {
|
|
95
|
-
throw new Error(
|
|
95
|
+
throw new Error(`No configuration for ${environmentName} defined in cosmiconfig for 'cypress-environments'. Please make sure it exists.`);
|
|
96
96
|
}
|
|
97
97
|
const secretsFiles = await glob.glob(configForEnvironment.secrets.glob, {
|
|
98
98
|
ignore: allIgnoredGlobs
|
|
@@ -100,27 +100,27 @@ async function getConfigurationForEnvironment(environmentName) {
|
|
|
100
100
|
const configFiles = await glob.glob(configForEnvironment.config.glob, {
|
|
101
101
|
ignore: allIgnoredGlobs
|
|
102
102
|
});
|
|
103
|
-
console.log(
|
|
103
|
+
console.log(`ℹ️ Found ${secretsFiles.length} secret file(s) and ${configFiles.length} config file(s) matching the defined globs.`);
|
|
104
104
|
if (secretsFiles.length === 0 || configFiles.length === 0) {
|
|
105
|
-
console.log(
|
|
106
|
-
console.log(
|
|
105
|
+
console.log(`ℹ️ Secrets files glob is: ${configForEnvironment.secrets.glob}`);
|
|
106
|
+
console.log(`ℹ️ Config files glob is: ${configForEnvironment.config.glob}`);
|
|
107
107
|
}
|
|
108
|
-
const mergedConfigurationAndSecrests = _reduceInstanceProperty__default["default"](
|
|
108
|
+
const mergedConfigurationAndSecrests = _reduceInstanceProperty__default["default"](_context2 = [...configFiles, ...secretsFiles]).call(_context2, (previousParsedEnvFileContents, nextEnvFilePath) => {
|
|
109
109
|
const parsedEnvFileContents = getParsedEnvFileContents(nextEnvFilePath);
|
|
110
110
|
let matchingParsedEnvFileContentsForCIOrLocal = null;
|
|
111
111
|
if (!_endsWithInstanceProperty__default["default"](nextEnvFilePath).call(nextEnvFilePath, '.local') && !_endsWithInstanceProperty__default["default"](nextEnvFilePath).call(nextEnvFilePath, '.ci')) {
|
|
112
|
-
matchingParsedEnvFileContentsForCIOrLocal = isCI ? getParsedEnvFileContents(
|
|
112
|
+
matchingParsedEnvFileContentsForCIOrLocal = isCI ? getParsedEnvFileContents(`${nextEnvFilePath}.ci`) : getParsedEnvFileContents(`${nextEnvFilePath}.local`);
|
|
113
113
|
}
|
|
114
114
|
return _objectSpread(_objectSpread(_objectSpread({}, previousParsedEnvFileContents), parsedEnvFileContents), matchingParsedEnvFileContentsForCIOrLocal);
|
|
115
115
|
}, {});
|
|
116
116
|
const rootDir = await pkgDir__default["default"](__dirname);
|
|
117
117
|
let sharedEnvironmentConfiguration = null;
|
|
118
118
|
if (rootDir) {
|
|
119
|
-
const pathToSharedEnvironmentConfiguration = path__default["default"].join(rootDir, 'config',
|
|
119
|
+
const pathToSharedEnvironmentConfiguration = path__default["default"].join(rootDir, 'config', `.env.${environmentName}.config`);
|
|
120
120
|
if (doesFileExist(pathToSharedEnvironmentConfiguration)) {
|
|
121
121
|
sharedEnvironmentConfiguration = getParsedEnvFileContents(pathToSharedEnvironmentConfiguration);
|
|
122
122
|
} else {
|
|
123
|
-
console.log(
|
|
123
|
+
console.log(`ℹ️ No shared configuration for ${environmentName} defined.`);
|
|
124
124
|
}
|
|
125
125
|
}
|
|
126
126
|
return _objectSpread(_objectSpread({}, sharedEnvironmentConfiguration), mergedConfigurationAndSecrests);
|
|
@@ -19,7 +19,7 @@ import pkgDir from 'pkg-dir';
|
|
|
19
19
|
import { cosmiconfig } from 'cosmiconfig';
|
|
20
20
|
|
|
21
21
|
function ownKeys(e, r) { var t = _Object$keys(e); if (_Object$getOwnPropertySymbols) { var o = _Object$getOwnPropertySymbols(e); r && (o = _filterInstanceProperty(o).call(o, function (r) { return _Object$getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
22
|
-
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var
|
|
22
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var _context3, _context4; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty(_context3 = ownKeys(Object(t), !0)).call(_context3, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(e, _Object$getOwnPropertyDescriptors(t)) : _forEachInstanceProperty(_context4 = ownKeys(Object(t))).call(_context4, function (r) { _Object$defineProperty(e, r, _Object$getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
23
23
|
const cypressEnvironmentsConfigExplorer = cosmiconfig('cypress-environments', {
|
|
24
24
|
searchStrategy: 'project'
|
|
25
25
|
});
|
|
@@ -34,14 +34,14 @@ function doesFileExist(filePath) {
|
|
|
34
34
|
}
|
|
35
35
|
function getParsedEnvFileContents(envPath) {
|
|
36
36
|
if (doesFileExist(envPath)) {
|
|
37
|
-
console.log(
|
|
37
|
+
console.log(`✅ Found and loading environment variables from: '${envPath}'`);
|
|
38
38
|
const envFileContents = fs.readFileSync(envPath, {
|
|
39
39
|
encoding: 'utf8'
|
|
40
40
|
});
|
|
41
41
|
const configuration = dotenv.parse(envFileContents);
|
|
42
42
|
return configuration;
|
|
43
43
|
} else {
|
|
44
|
-
console.log(
|
|
44
|
+
console.log(`ℹ️ No environment variables at: '${envPath}'. If needed create it or duplicate the template file.`);
|
|
45
45
|
return null;
|
|
46
46
|
}
|
|
47
47
|
}
|
|
@@ -49,27 +49,27 @@ async function loadConfig() {
|
|
|
49
49
|
try {
|
|
50
50
|
return await cypressEnvironmentsConfigExplorer.search();
|
|
51
51
|
} catch (e) {
|
|
52
|
-
throw new Error(
|
|
52
|
+
throw new Error(`Failed loading a Cypress environments configuration. Create a cosmiconfig for 'cypress-environments' for example 'cypress-environments.config.cjs'.`);
|
|
53
53
|
}
|
|
54
54
|
}
|
|
55
55
|
async function getConfigurationForEnvironment(environmentName) {
|
|
56
|
-
var _context, _context2
|
|
56
|
+
var _context, _context2;
|
|
57
57
|
// NOTE: On CI the *.ci secrests are not excluded. Locally the are in case
|
|
58
58
|
// decrypted files are available on a developer's machine.
|
|
59
59
|
const ignoredGlobs = ['**/*.enc', '**/*.template'];
|
|
60
60
|
const ignoredCIGlobs = ['**/*.ci'];
|
|
61
61
|
const allIgnoredGlobs = isCI ? ignoredGlobs : _concatInstanceProperty(ignoredGlobs).call(ignoredGlobs, ignoredCIGlobs);
|
|
62
62
|
if (isCI) {
|
|
63
|
-
console.log(
|
|
63
|
+
console.log(`ℹ️ 'CI' environment variable is defined. Assuming operating from a CI system.`);
|
|
64
64
|
} else {
|
|
65
|
-
console.log(
|
|
65
|
+
console.log(`ℹ️ 'CI' environment variable is not defined. Assuming you are running locally.`);
|
|
66
66
|
}
|
|
67
|
-
console.log(
|
|
67
|
+
console.log(`ℹ️ The ignored globs are: ${allIgnoredGlobs.join(', ')}.`);
|
|
68
68
|
const configResult = await loadConfig();
|
|
69
|
-
const allEnvironmentConfigs = configResult
|
|
69
|
+
const allEnvironmentConfigs = configResult?.config;
|
|
70
70
|
const configForEnvironment = _findInstanceProperty(_context = allEnvironmentConfigs.environments).call(_context, environment => environment.name === environmentName);
|
|
71
71
|
if (!configForEnvironment) {
|
|
72
|
-
throw new Error(
|
|
72
|
+
throw new Error(`No configuration for ${environmentName} defined in cosmiconfig for 'cypress-environments'. Please make sure it exists.`);
|
|
73
73
|
}
|
|
74
74
|
const secretsFiles = await glob(configForEnvironment.secrets.glob, {
|
|
75
75
|
ignore: allIgnoredGlobs
|
|
@@ -77,27 +77,27 @@ async function getConfigurationForEnvironment(environmentName) {
|
|
|
77
77
|
const configFiles = await glob(configForEnvironment.config.glob, {
|
|
78
78
|
ignore: allIgnoredGlobs
|
|
79
79
|
});
|
|
80
|
-
console.log(
|
|
80
|
+
console.log(`ℹ️ Found ${secretsFiles.length} secret file(s) and ${configFiles.length} config file(s) matching the defined globs.`);
|
|
81
81
|
if (secretsFiles.length === 0 || configFiles.length === 0) {
|
|
82
|
-
console.log(
|
|
83
|
-
console.log(
|
|
82
|
+
console.log(`ℹ️ Secrets files glob is: ${configForEnvironment.secrets.glob}`);
|
|
83
|
+
console.log(`ℹ️ Config files glob is: ${configForEnvironment.config.glob}`);
|
|
84
84
|
}
|
|
85
|
-
const mergedConfigurationAndSecrests = _reduceInstanceProperty(
|
|
85
|
+
const mergedConfigurationAndSecrests = _reduceInstanceProperty(_context2 = [...configFiles, ...secretsFiles]).call(_context2, (previousParsedEnvFileContents, nextEnvFilePath) => {
|
|
86
86
|
const parsedEnvFileContents = getParsedEnvFileContents(nextEnvFilePath);
|
|
87
87
|
let matchingParsedEnvFileContentsForCIOrLocal = null;
|
|
88
88
|
if (!_endsWithInstanceProperty(nextEnvFilePath).call(nextEnvFilePath, '.local') && !_endsWithInstanceProperty(nextEnvFilePath).call(nextEnvFilePath, '.ci')) {
|
|
89
|
-
matchingParsedEnvFileContentsForCIOrLocal = isCI ? getParsedEnvFileContents(
|
|
89
|
+
matchingParsedEnvFileContentsForCIOrLocal = isCI ? getParsedEnvFileContents(`${nextEnvFilePath}.ci`) : getParsedEnvFileContents(`${nextEnvFilePath}.local`);
|
|
90
90
|
}
|
|
91
91
|
return _objectSpread(_objectSpread(_objectSpread({}, previousParsedEnvFileContents), parsedEnvFileContents), matchingParsedEnvFileContentsForCIOrLocal);
|
|
92
92
|
}, {});
|
|
93
93
|
const rootDir = await pkgDir(__dirname);
|
|
94
94
|
let sharedEnvironmentConfiguration = null;
|
|
95
95
|
if (rootDir) {
|
|
96
|
-
const pathToSharedEnvironmentConfiguration = path.join(rootDir, 'config',
|
|
96
|
+
const pathToSharedEnvironmentConfiguration = path.join(rootDir, 'config', `.env.${environmentName}.config`);
|
|
97
97
|
if (doesFileExist(pathToSharedEnvironmentConfiguration)) {
|
|
98
98
|
sharedEnvironmentConfiguration = getParsedEnvFileContents(pathToSharedEnvironmentConfiguration);
|
|
99
99
|
} else {
|
|
100
|
-
console.log(
|
|
100
|
+
console.log(`ℹ️ No shared configuration for ${environmentName} defined.`);
|
|
101
101
|
}
|
|
102
102
|
}
|
|
103
103
|
return _objectSpread(_objectSpread({}, sharedEnvironmentConfiguration), mergedConfigurationAndSecrests);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@commercetools-frontend/cypress-environments",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.5",
|
|
4
4
|
"description": "Cypress package to setup environment configuration using dotenv files",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"publishConfig": {
|
|
@@ -21,13 +21,13 @@
|
|
|
21
21
|
"@babel/runtime-corejs3": "^7.21.0",
|
|
22
22
|
"cosmiconfig": "9.0.0",
|
|
23
23
|
"dotenv": "16.4.5",
|
|
24
|
-
"glob": "10.4.
|
|
24
|
+
"glob": "10.4.5",
|
|
25
25
|
"pkg-dir": "5.0.0"
|
|
26
26
|
},
|
|
27
27
|
"devDependencies": {
|
|
28
28
|
"@tsconfig/node20": "20.1.4",
|
|
29
29
|
"@types/glob": "8.1.0",
|
|
30
|
-
"@types/node": "20.
|
|
30
|
+
"@types/node": "20.14.14",
|
|
31
31
|
"typescript": "5.2.2"
|
|
32
32
|
},
|
|
33
33
|
"engines": {
|