@commercetools-frontend/cypress-environments 0.0.5 → 0.0.7
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.
|
@@ -3,8 +3,6 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
var _defineProperty = require('@babel/runtime-corejs3/helpers/defineProperty');
|
|
6
|
-
var _toConsumableArray = require('@babel/runtime-corejs3/helpers/toConsumableArray');
|
|
7
|
-
var _asyncToGenerator = require('@babel/runtime-corejs3/helpers/asyncToGenerator');
|
|
8
6
|
var _concatInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/concat');
|
|
9
7
|
var _findInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/find');
|
|
10
8
|
var _reduceInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/reduce');
|
|
@@ -17,7 +15,6 @@ var _forEachInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/in
|
|
|
17
15
|
var _Object$getOwnPropertyDescriptors = require('@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptors');
|
|
18
16
|
var _Object$defineProperties = require('@babel/runtime-corejs3/core-js-stable/object/define-properties');
|
|
19
17
|
var _Object$defineProperty = require('@babel/runtime-corejs3/core-js-stable/object/define-property');
|
|
20
|
-
var _regeneratorRuntime = require('@babel/runtime-corejs3/regenerator');
|
|
21
18
|
var path = require('path');
|
|
22
19
|
var fs = require('fs');
|
|
23
20
|
var util = require('util');
|
|
@@ -40,7 +37,6 @@ var _forEachInstanceProperty__default = /*#__PURE__*/_interopDefault(_forEachIns
|
|
|
40
37
|
var _Object$getOwnPropertyDescriptors__default = /*#__PURE__*/_interopDefault(_Object$getOwnPropertyDescriptors);
|
|
41
38
|
var _Object$defineProperties__default = /*#__PURE__*/_interopDefault(_Object$defineProperties);
|
|
42
39
|
var _Object$defineProperty__default = /*#__PURE__*/_interopDefault(_Object$defineProperty);
|
|
43
|
-
var _regeneratorRuntime__default = /*#__PURE__*/_interopDefault(_regeneratorRuntime);
|
|
44
40
|
var path__default = /*#__PURE__*/_interopDefault(path);
|
|
45
41
|
var fs__default = /*#__PURE__*/_interopDefault(fs);
|
|
46
42
|
var glob__default = /*#__PURE__*/_interopDefault(glob);
|
|
@@ -48,129 +44,79 @@ var dotenv__default = /*#__PURE__*/_interopDefault(dotenv);
|
|
|
48
44
|
var pkgDir__default = /*#__PURE__*/_interopDefault(pkgDir);
|
|
49
45
|
|
|
50
46
|
function ownKeys(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
51
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
47
|
+
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
|
+
const cypressEnvironmentsConfigExplorer = cosmiconfig.cosmiconfig('cypress-environments');
|
|
49
|
+
const isCI = String(process.env.CI) === 'true';
|
|
50
|
+
const promisifiedGlob = util.promisify(glob__default["default"]);
|
|
55
51
|
function getParsedEnvFileContents(envPath) {
|
|
56
52
|
if (fs__default["default"].existsSync(envPath)) {
|
|
57
53
|
console.log("\u2705 Found and loading environment variables from: '".concat(envPath, "'"));
|
|
58
|
-
|
|
54
|
+
const envFileContents = fs__default["default"].readFileSync(envPath, {
|
|
59
55
|
encoding: 'utf8'
|
|
60
56
|
});
|
|
61
|
-
|
|
57
|
+
const configuration = dotenv__default["default"].parse(envFileContents);
|
|
62
58
|
return configuration;
|
|
63
59
|
} else {
|
|
64
60
|
console.log("\u2139\uFE0F No environment variables at: '".concat(envPath, "'. If needed create it or duplicate the template file."));
|
|
65
61
|
return null;
|
|
66
62
|
}
|
|
67
63
|
}
|
|
68
|
-
function loadConfig() {
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
while (1) switch (_context.prev = _context.next) {
|
|
75
|
-
case 0:
|
|
76
|
-
_context.prev = 0;
|
|
77
|
-
_context.next = 3;
|
|
78
|
-
return cypressEnvironmentsConfigExplorer.search();
|
|
79
|
-
case 3:
|
|
80
|
-
return _context.abrupt("return", _context.sent);
|
|
81
|
-
case 6:
|
|
82
|
-
_context.prev = 6;
|
|
83
|
-
_context.t0 = _context["catch"](0);
|
|
84
|
-
throw new Error("Failed loading a Cypress environments configuration. Create a cosmiconfig for 'cypress-environments' for example 'cypress-environments.config.cjs'.");
|
|
85
|
-
case 9:
|
|
86
|
-
case "end":
|
|
87
|
-
return _context.stop();
|
|
88
|
-
}
|
|
89
|
-
}, _callee, null, [[0, 6]]);
|
|
90
|
-
}));
|
|
91
|
-
return _loadConfig.apply(this, arguments);
|
|
92
|
-
}
|
|
93
|
-
function getConfigurationForEnvironment(_x) {
|
|
94
|
-
return _getConfigurationForEnvironment.apply(this, arguments);
|
|
64
|
+
async function loadConfig() {
|
|
65
|
+
try {
|
|
66
|
+
return await cypressEnvironmentsConfigExplorer.search();
|
|
67
|
+
} catch (e) {
|
|
68
|
+
throw new Error("Failed loading a Cypress environments configuration. Create a cosmiconfig for 'cypress-environments' for example 'cypress-environments.config.cjs'.");
|
|
69
|
+
}
|
|
95
70
|
}
|
|
96
|
-
function
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
mergedConfigurationAndSecrests = _reduceInstanceProperty__default["default"](_context4 = _concatInstanceProperty__default["default"](_context5 = []).call(_context5, _toConsumableArray(configFiles), _toConsumableArray(secretsFiles))).call(_context4, function (previousParsedEnvFileContents, nextEnvFilePath) {
|
|
146
|
-
var parsedEnvFileContents = getParsedEnvFileContents(nextEnvFilePath);
|
|
147
|
-
var matchingParsedEnvFileContentsForCIOrLocal = null;
|
|
148
|
-
if (!_endsWithInstanceProperty__default["default"](nextEnvFilePath).call(nextEnvFilePath, '.local') && !_endsWithInstanceProperty__default["default"](nextEnvFilePath).call(nextEnvFilePath, '.ci')) {
|
|
149
|
-
matchingParsedEnvFileContentsForCIOrLocal = isCI ? getParsedEnvFileContents("".concat(nextEnvFilePath, ".ci")) : getParsedEnvFileContents("".concat(nextEnvFilePath, ".local"));
|
|
150
|
-
}
|
|
151
|
-
return _objectSpread(_objectSpread(_objectSpread({}, previousParsedEnvFileContents), parsedEnvFileContents), matchingParsedEnvFileContentsForCIOrLocal);
|
|
152
|
-
}, {});
|
|
153
|
-
_context6.next = 23;
|
|
154
|
-
return pkgDir__default["default"](__dirname);
|
|
155
|
-
case 23:
|
|
156
|
-
rootDir = _context6.sent;
|
|
157
|
-
sharedEnvironmentConfiguration = null;
|
|
158
|
-
if (rootDir) {
|
|
159
|
-
pathToSharedEnvironmentConfiguration = path__default["default"].join(rootDir, 'config', ".env.".concat(environmentName, ".config"));
|
|
160
|
-
if (fs__default["default"].existsSync(pathToSharedEnvironmentConfiguration)) {
|
|
161
|
-
sharedEnvironmentConfiguration = getParsedEnvFileContents(pathToSharedEnvironmentConfiguration);
|
|
162
|
-
} else {
|
|
163
|
-
console.log("\u2139\uFE0F No shared configuration for ".concat(environmentName, " defined."));
|
|
164
|
-
}
|
|
165
|
-
}
|
|
166
|
-
return _context6.abrupt("return", _objectSpread(_objectSpread({}, sharedEnvironmentConfiguration), mergedConfigurationAndSecrests));
|
|
167
|
-
case 27:
|
|
168
|
-
case "end":
|
|
169
|
-
return _context6.stop();
|
|
170
|
-
}
|
|
171
|
-
}, _callee2);
|
|
172
|
-
}));
|
|
173
|
-
return _getConfigurationForEnvironment.apply(this, arguments);
|
|
71
|
+
async function getConfigurationForEnvironment(environmentName) {
|
|
72
|
+
var _context, _context2, _context3;
|
|
73
|
+
// NOTE: On CI the *.ci secrests are not excluded. Locally the are in case
|
|
74
|
+
// decrypted files are available on a developer's machine.
|
|
75
|
+
const ignoredGlobs = ['**/*.enc', '**/*.template'];
|
|
76
|
+
const ignoredCIGlobs = ['**/*.ci'];
|
|
77
|
+
const allIgnoredGlobs = isCI ? ignoredGlobs : _concatInstanceProperty__default["default"](ignoredGlobs).call(ignoredGlobs, ignoredCIGlobs);
|
|
78
|
+
if (isCI) {
|
|
79
|
+
console.log("\u2139\uFE0F 'CI' environment variable is defined. Assuming operating from a CI system.");
|
|
80
|
+
} else {
|
|
81
|
+
console.log("\u2139\uFE0F 'CI' environment variable is not defined. Assuming you are running locally.");
|
|
82
|
+
}
|
|
83
|
+
console.log("\u2139\uFE0F The ignored globs are: ".concat(allIgnoredGlobs.join(', '), "."));
|
|
84
|
+
const configResult = await loadConfig();
|
|
85
|
+
const allEnvironmentConfigs = configResult === null || configResult === void 0 ? void 0 : configResult.config;
|
|
86
|
+
const configForEnvironment = _findInstanceProperty__default["default"](_context = allEnvironmentConfigs.environments).call(_context, environment => environment.name === environmentName);
|
|
87
|
+
if (!configForEnvironment) {
|
|
88
|
+
throw new Error("No configuration for ".concat(environmentName, " defined in cosmiconfig for 'cypress-environments'. Please make sure it exists."));
|
|
89
|
+
}
|
|
90
|
+
const secretsFiles = await promisifiedGlob(configForEnvironment.secrets.glob, {
|
|
91
|
+
ignore: allIgnoredGlobs
|
|
92
|
+
});
|
|
93
|
+
const configFiles = await promisifiedGlob(configForEnvironment.config.glob, {
|
|
94
|
+
ignore: allIgnoredGlobs
|
|
95
|
+
});
|
|
96
|
+
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."));
|
|
97
|
+
if (secretsFiles.length === 0 || configFiles.length === 0) {
|
|
98
|
+
console.log("\u2139\uFE0F Secrets files glob is: ".concat(configForEnvironment.secrets.glob));
|
|
99
|
+
console.log("\u2139\uFE0F Config files glob is: ".concat(configForEnvironment.config.glob));
|
|
100
|
+
}
|
|
101
|
+
const mergedConfigurationAndSecrests = _reduceInstanceProperty__default["default"](_context3 = [...configFiles, ...secretsFiles]).call(_context3, (previousParsedEnvFileContents, nextEnvFilePath) => {
|
|
102
|
+
const parsedEnvFileContents = getParsedEnvFileContents(nextEnvFilePath);
|
|
103
|
+
let matchingParsedEnvFileContentsForCIOrLocal = null;
|
|
104
|
+
if (!_endsWithInstanceProperty__default["default"](nextEnvFilePath).call(nextEnvFilePath, '.local') && !_endsWithInstanceProperty__default["default"](nextEnvFilePath).call(nextEnvFilePath, '.ci')) {
|
|
105
|
+
matchingParsedEnvFileContentsForCIOrLocal = isCI ? getParsedEnvFileContents("".concat(nextEnvFilePath, ".ci")) : getParsedEnvFileContents("".concat(nextEnvFilePath, ".local"));
|
|
106
|
+
}
|
|
107
|
+
return _objectSpread(_objectSpread(_objectSpread({}, previousParsedEnvFileContents), parsedEnvFileContents), matchingParsedEnvFileContentsForCIOrLocal);
|
|
108
|
+
}, {});
|
|
109
|
+
const rootDir = await pkgDir__default["default"](__dirname);
|
|
110
|
+
let sharedEnvironmentConfiguration = null;
|
|
111
|
+
if (rootDir) {
|
|
112
|
+
const pathToSharedEnvironmentConfiguration = path__default["default"].join(rootDir, 'config', ".env.".concat(environmentName, ".config"));
|
|
113
|
+
if (fs__default["default"].existsSync(pathToSharedEnvironmentConfiguration)) {
|
|
114
|
+
sharedEnvironmentConfiguration = getParsedEnvFileContents(pathToSharedEnvironmentConfiguration);
|
|
115
|
+
} else {
|
|
116
|
+
console.log("\u2139\uFE0F No shared configuration for ".concat(environmentName, " defined."));
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
return _objectSpread(_objectSpread({}, sharedEnvironmentConfiguration), mergedConfigurationAndSecrests);
|
|
174
120
|
}
|
|
175
121
|
|
|
176
122
|
exports.getConfigurationForEnvironment = getConfigurationForEnvironment;
|
|
@@ -3,8 +3,6 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
var _defineProperty = require('@babel/runtime-corejs3/helpers/defineProperty');
|
|
6
|
-
var _toConsumableArray = require('@babel/runtime-corejs3/helpers/toConsumableArray');
|
|
7
|
-
var _asyncToGenerator = require('@babel/runtime-corejs3/helpers/asyncToGenerator');
|
|
8
6
|
var _concatInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/concat');
|
|
9
7
|
var _findInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/find');
|
|
10
8
|
var _reduceInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/reduce');
|
|
@@ -17,7 +15,6 @@ var _forEachInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/in
|
|
|
17
15
|
var _Object$getOwnPropertyDescriptors = require('@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptors');
|
|
18
16
|
var _Object$defineProperties = require('@babel/runtime-corejs3/core-js-stable/object/define-properties');
|
|
19
17
|
var _Object$defineProperty = require('@babel/runtime-corejs3/core-js-stable/object/define-property');
|
|
20
|
-
var _regeneratorRuntime = require('@babel/runtime-corejs3/regenerator');
|
|
21
18
|
var path = require('path');
|
|
22
19
|
var fs = require('fs');
|
|
23
20
|
var util = require('util');
|
|
@@ -40,7 +37,6 @@ var _forEachInstanceProperty__default = /*#__PURE__*/_interopDefault(_forEachIns
|
|
|
40
37
|
var _Object$getOwnPropertyDescriptors__default = /*#__PURE__*/_interopDefault(_Object$getOwnPropertyDescriptors);
|
|
41
38
|
var _Object$defineProperties__default = /*#__PURE__*/_interopDefault(_Object$defineProperties);
|
|
42
39
|
var _Object$defineProperty__default = /*#__PURE__*/_interopDefault(_Object$defineProperty);
|
|
43
|
-
var _regeneratorRuntime__default = /*#__PURE__*/_interopDefault(_regeneratorRuntime);
|
|
44
40
|
var path__default = /*#__PURE__*/_interopDefault(path);
|
|
45
41
|
var fs__default = /*#__PURE__*/_interopDefault(fs);
|
|
46
42
|
var glob__default = /*#__PURE__*/_interopDefault(glob);
|
|
@@ -48,129 +44,79 @@ var dotenv__default = /*#__PURE__*/_interopDefault(dotenv);
|
|
|
48
44
|
var pkgDir__default = /*#__PURE__*/_interopDefault(pkgDir);
|
|
49
45
|
|
|
50
46
|
function ownKeys(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
51
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
47
|
+
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
|
+
const cypressEnvironmentsConfigExplorer = cosmiconfig.cosmiconfig('cypress-environments');
|
|
49
|
+
const isCI = String(process.env.CI) === 'true';
|
|
50
|
+
const promisifiedGlob = util.promisify(glob__default["default"]);
|
|
55
51
|
function getParsedEnvFileContents(envPath) {
|
|
56
52
|
if (fs__default["default"].existsSync(envPath)) {
|
|
57
53
|
console.log("\u2705 Found and loading environment variables from: '".concat(envPath, "'"));
|
|
58
|
-
|
|
54
|
+
const envFileContents = fs__default["default"].readFileSync(envPath, {
|
|
59
55
|
encoding: 'utf8'
|
|
60
56
|
});
|
|
61
|
-
|
|
57
|
+
const configuration = dotenv__default["default"].parse(envFileContents);
|
|
62
58
|
return configuration;
|
|
63
59
|
} else {
|
|
64
60
|
console.log("\u2139\uFE0F No environment variables at: '".concat(envPath, "'. If needed create it or duplicate the template file."));
|
|
65
61
|
return null;
|
|
66
62
|
}
|
|
67
63
|
}
|
|
68
|
-
function loadConfig() {
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
while (1) switch (_context.prev = _context.next) {
|
|
75
|
-
case 0:
|
|
76
|
-
_context.prev = 0;
|
|
77
|
-
_context.next = 3;
|
|
78
|
-
return cypressEnvironmentsConfigExplorer.search();
|
|
79
|
-
case 3:
|
|
80
|
-
return _context.abrupt("return", _context.sent);
|
|
81
|
-
case 6:
|
|
82
|
-
_context.prev = 6;
|
|
83
|
-
_context.t0 = _context["catch"](0);
|
|
84
|
-
throw new Error("Failed loading a Cypress environments configuration. Create a cosmiconfig for 'cypress-environments' for example 'cypress-environments.config.cjs'.");
|
|
85
|
-
case 9:
|
|
86
|
-
case "end":
|
|
87
|
-
return _context.stop();
|
|
88
|
-
}
|
|
89
|
-
}, _callee, null, [[0, 6]]);
|
|
90
|
-
}));
|
|
91
|
-
return _loadConfig.apply(this, arguments);
|
|
92
|
-
}
|
|
93
|
-
function getConfigurationForEnvironment(_x) {
|
|
94
|
-
return _getConfigurationForEnvironment.apply(this, arguments);
|
|
64
|
+
async function loadConfig() {
|
|
65
|
+
try {
|
|
66
|
+
return await cypressEnvironmentsConfigExplorer.search();
|
|
67
|
+
} catch (e) {
|
|
68
|
+
throw new Error("Failed loading a Cypress environments configuration. Create a cosmiconfig for 'cypress-environments' for example 'cypress-environments.config.cjs'.");
|
|
69
|
+
}
|
|
95
70
|
}
|
|
96
|
-
function
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
mergedConfigurationAndSecrests = _reduceInstanceProperty__default["default"](_context4 = _concatInstanceProperty__default["default"](_context5 = []).call(_context5, _toConsumableArray(configFiles), _toConsumableArray(secretsFiles))).call(_context4, function (previousParsedEnvFileContents, nextEnvFilePath) {
|
|
146
|
-
var parsedEnvFileContents = getParsedEnvFileContents(nextEnvFilePath);
|
|
147
|
-
var matchingParsedEnvFileContentsForCIOrLocal = null;
|
|
148
|
-
if (!_endsWithInstanceProperty__default["default"](nextEnvFilePath).call(nextEnvFilePath, '.local') && !_endsWithInstanceProperty__default["default"](nextEnvFilePath).call(nextEnvFilePath, '.ci')) {
|
|
149
|
-
matchingParsedEnvFileContentsForCIOrLocal = isCI ? getParsedEnvFileContents("".concat(nextEnvFilePath, ".ci")) : getParsedEnvFileContents("".concat(nextEnvFilePath, ".local"));
|
|
150
|
-
}
|
|
151
|
-
return _objectSpread(_objectSpread(_objectSpread({}, previousParsedEnvFileContents), parsedEnvFileContents), matchingParsedEnvFileContentsForCIOrLocal);
|
|
152
|
-
}, {});
|
|
153
|
-
_context6.next = 23;
|
|
154
|
-
return pkgDir__default["default"](__dirname);
|
|
155
|
-
case 23:
|
|
156
|
-
rootDir = _context6.sent;
|
|
157
|
-
sharedEnvironmentConfiguration = null;
|
|
158
|
-
if (rootDir) {
|
|
159
|
-
pathToSharedEnvironmentConfiguration = path__default["default"].join(rootDir, 'config', ".env.".concat(environmentName, ".config"));
|
|
160
|
-
if (fs__default["default"].existsSync(pathToSharedEnvironmentConfiguration)) {
|
|
161
|
-
sharedEnvironmentConfiguration = getParsedEnvFileContents(pathToSharedEnvironmentConfiguration);
|
|
162
|
-
} else {
|
|
163
|
-
console.log("\u2139\uFE0F No shared configuration for ".concat(environmentName, " defined."));
|
|
164
|
-
}
|
|
165
|
-
}
|
|
166
|
-
return _context6.abrupt("return", _objectSpread(_objectSpread({}, sharedEnvironmentConfiguration), mergedConfigurationAndSecrests));
|
|
167
|
-
case 27:
|
|
168
|
-
case "end":
|
|
169
|
-
return _context6.stop();
|
|
170
|
-
}
|
|
171
|
-
}, _callee2);
|
|
172
|
-
}));
|
|
173
|
-
return _getConfigurationForEnvironment.apply(this, arguments);
|
|
71
|
+
async function getConfigurationForEnvironment(environmentName) {
|
|
72
|
+
var _context, _context2, _context3;
|
|
73
|
+
// NOTE: On CI the *.ci secrests are not excluded. Locally the are in case
|
|
74
|
+
// decrypted files are available on a developer's machine.
|
|
75
|
+
const ignoredGlobs = ['**/*.enc', '**/*.template'];
|
|
76
|
+
const ignoredCIGlobs = ['**/*.ci'];
|
|
77
|
+
const allIgnoredGlobs = isCI ? ignoredGlobs : _concatInstanceProperty__default["default"](ignoredGlobs).call(ignoredGlobs, ignoredCIGlobs);
|
|
78
|
+
if (isCI) {
|
|
79
|
+
console.log("\u2139\uFE0F 'CI' environment variable is defined. Assuming operating from a CI system.");
|
|
80
|
+
} else {
|
|
81
|
+
console.log("\u2139\uFE0F 'CI' environment variable is not defined. Assuming you are running locally.");
|
|
82
|
+
}
|
|
83
|
+
console.log("\u2139\uFE0F The ignored globs are: ".concat(allIgnoredGlobs.join(', '), "."));
|
|
84
|
+
const configResult = await loadConfig();
|
|
85
|
+
const allEnvironmentConfigs = configResult === null || configResult === void 0 ? void 0 : configResult.config;
|
|
86
|
+
const configForEnvironment = _findInstanceProperty__default["default"](_context = allEnvironmentConfigs.environments).call(_context, environment => environment.name === environmentName);
|
|
87
|
+
if (!configForEnvironment) {
|
|
88
|
+
throw new Error("No configuration for ".concat(environmentName, " defined in cosmiconfig for 'cypress-environments'. Please make sure it exists."));
|
|
89
|
+
}
|
|
90
|
+
const secretsFiles = await promisifiedGlob(configForEnvironment.secrets.glob, {
|
|
91
|
+
ignore: allIgnoredGlobs
|
|
92
|
+
});
|
|
93
|
+
const configFiles = await promisifiedGlob(configForEnvironment.config.glob, {
|
|
94
|
+
ignore: allIgnoredGlobs
|
|
95
|
+
});
|
|
96
|
+
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."));
|
|
97
|
+
if (secretsFiles.length === 0 || configFiles.length === 0) {
|
|
98
|
+
console.log("\u2139\uFE0F Secrets files glob is: ".concat(configForEnvironment.secrets.glob));
|
|
99
|
+
console.log("\u2139\uFE0F Config files glob is: ".concat(configForEnvironment.config.glob));
|
|
100
|
+
}
|
|
101
|
+
const mergedConfigurationAndSecrests = _reduceInstanceProperty__default["default"](_context3 = [...configFiles, ...secretsFiles]).call(_context3, (previousParsedEnvFileContents, nextEnvFilePath) => {
|
|
102
|
+
const parsedEnvFileContents = getParsedEnvFileContents(nextEnvFilePath);
|
|
103
|
+
let matchingParsedEnvFileContentsForCIOrLocal = null;
|
|
104
|
+
if (!_endsWithInstanceProperty__default["default"](nextEnvFilePath).call(nextEnvFilePath, '.local') && !_endsWithInstanceProperty__default["default"](nextEnvFilePath).call(nextEnvFilePath, '.ci')) {
|
|
105
|
+
matchingParsedEnvFileContentsForCIOrLocal = isCI ? getParsedEnvFileContents("".concat(nextEnvFilePath, ".ci")) : getParsedEnvFileContents("".concat(nextEnvFilePath, ".local"));
|
|
106
|
+
}
|
|
107
|
+
return _objectSpread(_objectSpread(_objectSpread({}, previousParsedEnvFileContents), parsedEnvFileContents), matchingParsedEnvFileContentsForCIOrLocal);
|
|
108
|
+
}, {});
|
|
109
|
+
const rootDir = await pkgDir__default["default"](__dirname);
|
|
110
|
+
let sharedEnvironmentConfiguration = null;
|
|
111
|
+
if (rootDir) {
|
|
112
|
+
const pathToSharedEnvironmentConfiguration = path__default["default"].join(rootDir, 'config', ".env.".concat(environmentName, ".config"));
|
|
113
|
+
if (fs__default["default"].existsSync(pathToSharedEnvironmentConfiguration)) {
|
|
114
|
+
sharedEnvironmentConfiguration = getParsedEnvFileContents(pathToSharedEnvironmentConfiguration);
|
|
115
|
+
} else {
|
|
116
|
+
console.log("\u2139\uFE0F No shared configuration for ".concat(environmentName, " defined."));
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
return _objectSpread(_objectSpread({}, sharedEnvironmentConfiguration), mergedConfigurationAndSecrests);
|
|
174
120
|
}
|
|
175
121
|
|
|
176
122
|
exports.getConfigurationForEnvironment = getConfigurationForEnvironment;
|
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
import _defineProperty from '@babel/runtime-corejs3/helpers/esm/defineProperty';
|
|
2
|
-
import _toConsumableArray from '@babel/runtime-corejs3/helpers/esm/toConsumableArray';
|
|
3
|
-
import _asyncToGenerator from '@babel/runtime-corejs3/helpers/esm/asyncToGenerator';
|
|
4
2
|
import _concatInstanceProperty from '@babel/runtime-corejs3/core-js-stable/instance/concat';
|
|
5
3
|
import _findInstanceProperty from '@babel/runtime-corejs3/core-js-stable/instance/find';
|
|
6
4
|
import _reduceInstanceProperty from '@babel/runtime-corejs3/core-js-stable/instance/reduce';
|
|
@@ -13,7 +11,6 @@ import _forEachInstanceProperty from '@babel/runtime-corejs3/core-js-stable/inst
|
|
|
13
11
|
import _Object$getOwnPropertyDescriptors from '@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptors';
|
|
14
12
|
import _Object$defineProperties from '@babel/runtime-corejs3/core-js-stable/object/define-properties';
|
|
15
13
|
import _Object$defineProperty from '@babel/runtime-corejs3/core-js-stable/object/define-property';
|
|
16
|
-
import _regeneratorRuntime from '@babel/runtime-corejs3/regenerator';
|
|
17
14
|
import path from 'path';
|
|
18
15
|
import fs from 'fs';
|
|
19
16
|
import { promisify } from 'util';
|
|
@@ -23,129 +20,79 @@ import pkgDir from 'pkg-dir';
|
|
|
23
20
|
import { cosmiconfig } from 'cosmiconfig';
|
|
24
21
|
|
|
25
22
|
function ownKeys(object, enumerableOnly) { var keys = _Object$keys(object); if (_Object$getOwnPropertySymbols) { var symbols = _Object$getOwnPropertySymbols(object); enumerableOnly && (symbols = _filterInstanceProperty(symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
26
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
23
|
+
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
|
+
const cypressEnvironmentsConfigExplorer = cosmiconfig('cypress-environments');
|
|
25
|
+
const isCI = String(process.env.CI) === 'true';
|
|
26
|
+
const promisifiedGlob = promisify(glob);
|
|
30
27
|
function getParsedEnvFileContents(envPath) {
|
|
31
28
|
if (fs.existsSync(envPath)) {
|
|
32
29
|
console.log("\u2705 Found and loading environment variables from: '".concat(envPath, "'"));
|
|
33
|
-
|
|
30
|
+
const envFileContents = fs.readFileSync(envPath, {
|
|
34
31
|
encoding: 'utf8'
|
|
35
32
|
});
|
|
36
|
-
|
|
33
|
+
const configuration = dotenv.parse(envFileContents);
|
|
37
34
|
return configuration;
|
|
38
35
|
} else {
|
|
39
36
|
console.log("\u2139\uFE0F No environment variables at: '".concat(envPath, "'. If needed create it or duplicate the template file."));
|
|
40
37
|
return null;
|
|
41
38
|
}
|
|
42
39
|
}
|
|
43
|
-
function loadConfig() {
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
while (1) switch (_context.prev = _context.next) {
|
|
50
|
-
case 0:
|
|
51
|
-
_context.prev = 0;
|
|
52
|
-
_context.next = 3;
|
|
53
|
-
return cypressEnvironmentsConfigExplorer.search();
|
|
54
|
-
case 3:
|
|
55
|
-
return _context.abrupt("return", _context.sent);
|
|
56
|
-
case 6:
|
|
57
|
-
_context.prev = 6;
|
|
58
|
-
_context.t0 = _context["catch"](0);
|
|
59
|
-
throw new Error("Failed loading a Cypress environments configuration. Create a cosmiconfig for 'cypress-environments' for example 'cypress-environments.config.cjs'.");
|
|
60
|
-
case 9:
|
|
61
|
-
case "end":
|
|
62
|
-
return _context.stop();
|
|
63
|
-
}
|
|
64
|
-
}, _callee, null, [[0, 6]]);
|
|
65
|
-
}));
|
|
66
|
-
return _loadConfig.apply(this, arguments);
|
|
67
|
-
}
|
|
68
|
-
function getConfigurationForEnvironment(_x) {
|
|
69
|
-
return _getConfigurationForEnvironment.apply(this, arguments);
|
|
40
|
+
async function loadConfig() {
|
|
41
|
+
try {
|
|
42
|
+
return await cypressEnvironmentsConfigExplorer.search();
|
|
43
|
+
} catch (e) {
|
|
44
|
+
throw new Error("Failed loading a Cypress environments configuration. Create a cosmiconfig for 'cypress-environments' for example 'cypress-environments.config.cjs'.");
|
|
45
|
+
}
|
|
70
46
|
}
|
|
71
|
-
function
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
mergedConfigurationAndSecrests = _reduceInstanceProperty(_context4 = _concatInstanceProperty(_context5 = []).call(_context5, _toConsumableArray(configFiles), _toConsumableArray(secretsFiles))).call(_context4, function (previousParsedEnvFileContents, nextEnvFilePath) {
|
|
121
|
-
var parsedEnvFileContents = getParsedEnvFileContents(nextEnvFilePath);
|
|
122
|
-
var matchingParsedEnvFileContentsForCIOrLocal = null;
|
|
123
|
-
if (!_endsWithInstanceProperty(nextEnvFilePath).call(nextEnvFilePath, '.local') && !_endsWithInstanceProperty(nextEnvFilePath).call(nextEnvFilePath, '.ci')) {
|
|
124
|
-
matchingParsedEnvFileContentsForCIOrLocal = isCI ? getParsedEnvFileContents("".concat(nextEnvFilePath, ".ci")) : getParsedEnvFileContents("".concat(nextEnvFilePath, ".local"));
|
|
125
|
-
}
|
|
126
|
-
return _objectSpread(_objectSpread(_objectSpread({}, previousParsedEnvFileContents), parsedEnvFileContents), matchingParsedEnvFileContentsForCIOrLocal);
|
|
127
|
-
}, {});
|
|
128
|
-
_context6.next = 23;
|
|
129
|
-
return pkgDir(__dirname);
|
|
130
|
-
case 23:
|
|
131
|
-
rootDir = _context6.sent;
|
|
132
|
-
sharedEnvironmentConfiguration = null;
|
|
133
|
-
if (rootDir) {
|
|
134
|
-
pathToSharedEnvironmentConfiguration = path.join(rootDir, 'config', ".env.".concat(environmentName, ".config"));
|
|
135
|
-
if (fs.existsSync(pathToSharedEnvironmentConfiguration)) {
|
|
136
|
-
sharedEnvironmentConfiguration = getParsedEnvFileContents(pathToSharedEnvironmentConfiguration);
|
|
137
|
-
} else {
|
|
138
|
-
console.log("\u2139\uFE0F No shared configuration for ".concat(environmentName, " defined."));
|
|
139
|
-
}
|
|
140
|
-
}
|
|
141
|
-
return _context6.abrupt("return", _objectSpread(_objectSpread({}, sharedEnvironmentConfiguration), mergedConfigurationAndSecrests));
|
|
142
|
-
case 27:
|
|
143
|
-
case "end":
|
|
144
|
-
return _context6.stop();
|
|
145
|
-
}
|
|
146
|
-
}, _callee2);
|
|
147
|
-
}));
|
|
148
|
-
return _getConfigurationForEnvironment.apply(this, arguments);
|
|
47
|
+
async function getConfigurationForEnvironment(environmentName) {
|
|
48
|
+
var _context, _context2, _context3;
|
|
49
|
+
// NOTE: On CI the *.ci secrests are not excluded. Locally the are in case
|
|
50
|
+
// decrypted files are available on a developer's machine.
|
|
51
|
+
const ignoredGlobs = ['**/*.enc', '**/*.template'];
|
|
52
|
+
const ignoredCIGlobs = ['**/*.ci'];
|
|
53
|
+
const allIgnoredGlobs = isCI ? ignoredGlobs : _concatInstanceProperty(ignoredGlobs).call(ignoredGlobs, ignoredCIGlobs);
|
|
54
|
+
if (isCI) {
|
|
55
|
+
console.log("\u2139\uFE0F 'CI' environment variable is defined. Assuming operating from a CI system.");
|
|
56
|
+
} else {
|
|
57
|
+
console.log("\u2139\uFE0F 'CI' environment variable is not defined. Assuming you are running locally.");
|
|
58
|
+
}
|
|
59
|
+
console.log("\u2139\uFE0F The ignored globs are: ".concat(allIgnoredGlobs.join(', '), "."));
|
|
60
|
+
const configResult = await loadConfig();
|
|
61
|
+
const allEnvironmentConfigs = configResult === null || configResult === void 0 ? void 0 : configResult.config;
|
|
62
|
+
const configForEnvironment = _findInstanceProperty(_context = allEnvironmentConfigs.environments).call(_context, environment => environment.name === environmentName);
|
|
63
|
+
if (!configForEnvironment) {
|
|
64
|
+
throw new Error("No configuration for ".concat(environmentName, " defined in cosmiconfig for 'cypress-environments'. Please make sure it exists."));
|
|
65
|
+
}
|
|
66
|
+
const secretsFiles = await promisifiedGlob(configForEnvironment.secrets.glob, {
|
|
67
|
+
ignore: allIgnoredGlobs
|
|
68
|
+
});
|
|
69
|
+
const configFiles = await promisifiedGlob(configForEnvironment.config.glob, {
|
|
70
|
+
ignore: allIgnoredGlobs
|
|
71
|
+
});
|
|
72
|
+
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."));
|
|
73
|
+
if (secretsFiles.length === 0 || configFiles.length === 0) {
|
|
74
|
+
console.log("\u2139\uFE0F Secrets files glob is: ".concat(configForEnvironment.secrets.glob));
|
|
75
|
+
console.log("\u2139\uFE0F Config files glob is: ".concat(configForEnvironment.config.glob));
|
|
76
|
+
}
|
|
77
|
+
const mergedConfigurationAndSecrests = _reduceInstanceProperty(_context3 = [...configFiles, ...secretsFiles]).call(_context3, (previousParsedEnvFileContents, nextEnvFilePath) => {
|
|
78
|
+
const parsedEnvFileContents = getParsedEnvFileContents(nextEnvFilePath);
|
|
79
|
+
let matchingParsedEnvFileContentsForCIOrLocal = null;
|
|
80
|
+
if (!_endsWithInstanceProperty(nextEnvFilePath).call(nextEnvFilePath, '.local') && !_endsWithInstanceProperty(nextEnvFilePath).call(nextEnvFilePath, '.ci')) {
|
|
81
|
+
matchingParsedEnvFileContentsForCIOrLocal = isCI ? getParsedEnvFileContents("".concat(nextEnvFilePath, ".ci")) : getParsedEnvFileContents("".concat(nextEnvFilePath, ".local"));
|
|
82
|
+
}
|
|
83
|
+
return _objectSpread(_objectSpread(_objectSpread({}, previousParsedEnvFileContents), parsedEnvFileContents), matchingParsedEnvFileContentsForCIOrLocal);
|
|
84
|
+
}, {});
|
|
85
|
+
const rootDir = await pkgDir(__dirname);
|
|
86
|
+
let sharedEnvironmentConfiguration = null;
|
|
87
|
+
if (rootDir) {
|
|
88
|
+
const pathToSharedEnvironmentConfiguration = path.join(rootDir, 'config', ".env.".concat(environmentName, ".config"));
|
|
89
|
+
if (fs.existsSync(pathToSharedEnvironmentConfiguration)) {
|
|
90
|
+
sharedEnvironmentConfiguration = getParsedEnvFileContents(pathToSharedEnvironmentConfiguration);
|
|
91
|
+
} else {
|
|
92
|
+
console.log("\u2139\uFE0F No shared configuration for ".concat(environmentName, " defined."));
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
return _objectSpread(_objectSpread({}, sharedEnvironmentConfiguration), mergedConfigurationAndSecrests);
|
|
149
96
|
}
|
|
150
97
|
|
|
151
98
|
export { getConfigurationForEnvironment };
|
package/package.json
CHANGED
|
@@ -1,14 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@commercetools-frontend/cypress-environments",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.7",
|
|
4
4
|
"description": "Cypress package to setup environment configuration using dotenv files",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"publishConfig": {
|
|
7
7
|
"access": "public"
|
|
8
8
|
},
|
|
9
|
-
"scripts": {
|
|
10
|
-
"typecheck": "tsc --noEmit"
|
|
11
|
-
},
|
|
12
9
|
"main": "dist/commercetools-frontend-cypress-environments.cjs.js",
|
|
13
10
|
"module": "dist/commercetools-frontend-cypress-environments.esm.js",
|
|
14
11
|
"files": [
|
|
@@ -19,9 +16,10 @@
|
|
|
19
16
|
"README.md"
|
|
20
17
|
],
|
|
21
18
|
"dependencies": {
|
|
19
|
+
"@babel/core": "^7.21.0",
|
|
22
20
|
"@babel/runtime": "^7.21.0",
|
|
23
21
|
"@babel/runtime-corejs3": "^7.21.0",
|
|
24
|
-
"cosmiconfig": "8.1.
|
|
22
|
+
"cosmiconfig": "8.1.3",
|
|
25
23
|
"dotenv": "16.0.3",
|
|
26
24
|
"glob": "8.1.0",
|
|
27
25
|
"pkg-dir": "5.0.0"
|
|
@@ -29,11 +27,14 @@
|
|
|
29
27
|
"devDependencies": {
|
|
30
28
|
"@tsconfig/node18": "1.0.1",
|
|
31
29
|
"@types/glob": "8.1.0",
|
|
32
|
-
"@types/node": "18.
|
|
30
|
+
"@types/node": "18.15.10",
|
|
33
31
|
"typescript": "^4.9.5"
|
|
34
32
|
},
|
|
35
33
|
"engines": {
|
|
36
34
|
"node": ">=14",
|
|
37
35
|
"npm": ">=5"
|
|
36
|
+
},
|
|
37
|
+
"scripts": {
|
|
38
|
+
"typecheck": "tsc --noEmit"
|
|
38
39
|
}
|
|
39
|
-
}
|
|
40
|
+
}
|