@commercetools-frontend/cypress-environments 0.0.8 → 0.0.9
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.
|
@@ -17,7 +17,6 @@ var _Object$defineProperties = require('@babel/runtime-corejs3/core-js-stable/ob
|
|
|
17
17
|
var _Object$defineProperty = require('@babel/runtime-corejs3/core-js-stable/object/define-property');
|
|
18
18
|
var path = require('path');
|
|
19
19
|
var fs = require('fs');
|
|
20
|
-
var util = require('util');
|
|
21
20
|
var glob = require('glob');
|
|
22
21
|
var dotenv = require('dotenv');
|
|
23
22
|
var pkgDir = require('pkg-dir');
|
|
@@ -39,7 +38,6 @@ var _Object$defineProperties__default = /*#__PURE__*/_interopDefault(_Object$def
|
|
|
39
38
|
var _Object$defineProperty__default = /*#__PURE__*/_interopDefault(_Object$defineProperty);
|
|
40
39
|
var path__default = /*#__PURE__*/_interopDefault(path);
|
|
41
40
|
var fs__default = /*#__PURE__*/_interopDefault(fs);
|
|
42
|
-
var glob__default = /*#__PURE__*/_interopDefault(glob);
|
|
43
41
|
var dotenv__default = /*#__PURE__*/_interopDefault(dotenv);
|
|
44
42
|
var pkgDir__default = /*#__PURE__*/_interopDefault(pkgDir);
|
|
45
43
|
|
|
@@ -47,7 +45,6 @@ function ownKeys(object, enumerableOnly) { var keys = _Object$keys__default["def
|
|
|
47
45
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var _context4, _context5; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context4 = ownKeys(Object(source), !0)).call(_context4, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context5 = ownKeys(Object(source))).call(_context5, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
48
46
|
const cypressEnvironmentsConfigExplorer = cosmiconfig.cosmiconfig('cypress-environments');
|
|
49
47
|
const isCI = String(process.env.CI) === 'true';
|
|
50
|
-
const promisifiedGlob = util.promisify(glob__default["default"]);
|
|
51
48
|
function getParsedEnvFileContents(envPath) {
|
|
52
49
|
if (fs__default["default"].existsSync(envPath)) {
|
|
53
50
|
console.log("\u2705 Found and loading environment variables from: '".concat(envPath, "'"));
|
|
@@ -87,10 +84,10 @@ async function getConfigurationForEnvironment(environmentName) {
|
|
|
87
84
|
if (!configForEnvironment) {
|
|
88
85
|
throw new Error("No configuration for ".concat(environmentName, " defined in cosmiconfig for 'cypress-environments'. Please make sure it exists."));
|
|
89
86
|
}
|
|
90
|
-
const secretsFiles = await
|
|
87
|
+
const secretsFiles = await glob.glob(configForEnvironment.secrets.glob, {
|
|
91
88
|
ignore: allIgnoredGlobs
|
|
92
89
|
});
|
|
93
|
-
const configFiles = await
|
|
90
|
+
const configFiles = await glob.glob(configForEnvironment.config.glob, {
|
|
94
91
|
ignore: allIgnoredGlobs
|
|
95
92
|
});
|
|
96
93
|
console.log(_concatInstanceProperty__default["default"](_context2 = "\u2139\uFE0F Found ".concat(secretsFiles.length, " secret file(s) and ")).call(_context2, configFiles.length, " config file(s) matching the defined globs."));
|
|
@@ -17,7 +17,6 @@ var _Object$defineProperties = require('@babel/runtime-corejs3/core-js-stable/ob
|
|
|
17
17
|
var _Object$defineProperty = require('@babel/runtime-corejs3/core-js-stable/object/define-property');
|
|
18
18
|
var path = require('path');
|
|
19
19
|
var fs = require('fs');
|
|
20
|
-
var util = require('util');
|
|
21
20
|
var glob = require('glob');
|
|
22
21
|
var dotenv = require('dotenv');
|
|
23
22
|
var pkgDir = require('pkg-dir');
|
|
@@ -39,7 +38,6 @@ var _Object$defineProperties__default = /*#__PURE__*/_interopDefault(_Object$def
|
|
|
39
38
|
var _Object$defineProperty__default = /*#__PURE__*/_interopDefault(_Object$defineProperty);
|
|
40
39
|
var path__default = /*#__PURE__*/_interopDefault(path);
|
|
41
40
|
var fs__default = /*#__PURE__*/_interopDefault(fs);
|
|
42
|
-
var glob__default = /*#__PURE__*/_interopDefault(glob);
|
|
43
41
|
var dotenv__default = /*#__PURE__*/_interopDefault(dotenv);
|
|
44
42
|
var pkgDir__default = /*#__PURE__*/_interopDefault(pkgDir);
|
|
45
43
|
|
|
@@ -47,7 +45,6 @@ function ownKeys(object, enumerableOnly) { var keys = _Object$keys__default["def
|
|
|
47
45
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var _context4, _context5; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context4 = ownKeys(Object(source), !0)).call(_context4, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context5 = ownKeys(Object(source))).call(_context5, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
48
46
|
const cypressEnvironmentsConfigExplorer = cosmiconfig.cosmiconfig('cypress-environments');
|
|
49
47
|
const isCI = String(process.env.CI) === 'true';
|
|
50
|
-
const promisifiedGlob = util.promisify(glob__default["default"]);
|
|
51
48
|
function getParsedEnvFileContents(envPath) {
|
|
52
49
|
if (fs__default["default"].existsSync(envPath)) {
|
|
53
50
|
console.log("\u2705 Found and loading environment variables from: '".concat(envPath, "'"));
|
|
@@ -87,10 +84,10 @@ async function getConfigurationForEnvironment(environmentName) {
|
|
|
87
84
|
if (!configForEnvironment) {
|
|
88
85
|
throw new Error("No configuration for ".concat(environmentName, " defined in cosmiconfig for 'cypress-environments'. Please make sure it exists."));
|
|
89
86
|
}
|
|
90
|
-
const secretsFiles = await
|
|
87
|
+
const secretsFiles = await glob.glob(configForEnvironment.secrets.glob, {
|
|
91
88
|
ignore: allIgnoredGlobs
|
|
92
89
|
});
|
|
93
|
-
const configFiles = await
|
|
90
|
+
const configFiles = await glob.glob(configForEnvironment.config.glob, {
|
|
94
91
|
ignore: allIgnoredGlobs
|
|
95
92
|
});
|
|
96
93
|
console.log(_concatInstanceProperty__default["default"](_context2 = "\u2139\uFE0F Found ".concat(secretsFiles.length, " secret file(s) and ")).call(_context2, configFiles.length, " config file(s) matching the defined globs."));
|
|
@@ -13,8 +13,7 @@ import _Object$defineProperties from '@babel/runtime-corejs3/core-js-stable/obje
|
|
|
13
13
|
import _Object$defineProperty from '@babel/runtime-corejs3/core-js-stable/object/define-property';
|
|
14
14
|
import path from 'path';
|
|
15
15
|
import fs from 'fs';
|
|
16
|
-
import {
|
|
17
|
-
import glob from 'glob';
|
|
16
|
+
import { glob } from 'glob';
|
|
18
17
|
import dotenv from 'dotenv';
|
|
19
18
|
import pkgDir from 'pkg-dir';
|
|
20
19
|
import { cosmiconfig } from 'cosmiconfig';
|
|
@@ -23,7 +22,6 @@ function ownKeys(object, enumerableOnly) { var keys = _Object$keys(object); if (
|
|
|
23
22
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var _context4, _context5; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context4 = ownKeys(Object(source), !0)).call(_context4, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context5 = ownKeys(Object(source))).call(_context5, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
24
23
|
const cypressEnvironmentsConfigExplorer = cosmiconfig('cypress-environments');
|
|
25
24
|
const isCI = String(process.env.CI) === 'true';
|
|
26
|
-
const promisifiedGlob = promisify(glob);
|
|
27
25
|
function getParsedEnvFileContents(envPath) {
|
|
28
26
|
if (fs.existsSync(envPath)) {
|
|
29
27
|
console.log("\u2705 Found and loading environment variables from: '".concat(envPath, "'"));
|
|
@@ -63,10 +61,10 @@ async function getConfigurationForEnvironment(environmentName) {
|
|
|
63
61
|
if (!configForEnvironment) {
|
|
64
62
|
throw new Error("No configuration for ".concat(environmentName, " defined in cosmiconfig for 'cypress-environments'. Please make sure it exists."));
|
|
65
63
|
}
|
|
66
|
-
const secretsFiles = await
|
|
64
|
+
const secretsFiles = await glob(configForEnvironment.secrets.glob, {
|
|
67
65
|
ignore: allIgnoredGlobs
|
|
68
66
|
});
|
|
69
|
-
const configFiles = await
|
|
67
|
+
const configFiles = await glob(configForEnvironment.config.glob, {
|
|
70
68
|
ignore: allIgnoredGlobs
|
|
71
69
|
});
|
|
72
70
|
console.log(_concatInstanceProperty(_context2 = "\u2139\uFE0F Found ".concat(secretsFiles.length, " secret file(s) and ")).call(_context2, configFiles.length, " config file(s) matching the defined globs."));
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { getConfigurationForEnvironment } from
|
|
1
|
+
import { getConfigurationForEnvironment } from "./environments.js";
|
|
2
2
|
export { getConfigurationForEnvironment };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@commercetools-frontend/cypress-environments",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.9",
|
|
4
4
|
"description": "Cypress package to setup environment configuration using dotenv files",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"publishConfig": {
|
|
@@ -19,16 +19,16 @@
|
|
|
19
19
|
"@babel/core": "^7.21.0",
|
|
20
20
|
"@babel/runtime": "^7.21.0",
|
|
21
21
|
"@babel/runtime-corejs3": "^7.21.0",
|
|
22
|
-
"cosmiconfig": "8.
|
|
23
|
-
"dotenv": "16.
|
|
24
|
-
"glob": "
|
|
22
|
+
"cosmiconfig": "8.2.0",
|
|
23
|
+
"dotenv": "16.3.1",
|
|
24
|
+
"glob": "10.3.0",
|
|
25
25
|
"pkg-dir": "5.0.0"
|
|
26
26
|
},
|
|
27
27
|
"devDependencies": {
|
|
28
28
|
"@tsconfig/node18": "1.0.3",
|
|
29
29
|
"@types/glob": "8.1.0",
|
|
30
|
-
"@types/node": "
|
|
31
|
-
"typescript": "^
|
|
30
|
+
"@types/node": "20.4.4",
|
|
31
|
+
"typescript": "^5.1.3"
|
|
32
32
|
},
|
|
33
33
|
"engines": {
|
|
34
34
|
"node": ">=14",
|