dceky 1.0.5-beta.ky-declarations.3 → 1.0.5-beta.ky-declarations.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.
- package/lib/setup/checkRequiredFiles/index.js +6 -6
- package/lib/setup/checkRequiredFiles/index.js.map +1 -1
- package/lib/setup/genKyCommandDeclarations.js +5 -1
- package/lib/setup/genKyCommandDeclarations.js.map +1 -1
- package/lib/setup/setupCypressDependencies.js +8 -8
- package/lib/setup/setupCypressDependencies.js.map +1 -1
- package/package.json +1 -1
- package/setup/checkRequiredFiles/index.ts +6 -6
- package/setup/genKyCommandDeclarations.ts +5 -1
- package/setup/setupCypressDependencies.ts +10 -7
|
@@ -22,22 +22,22 @@ var checkRequiredFiles = function () {
|
|
|
22
22
|
var extensions = ['.js', '.ts', '.json', '.mjs', '.cjs'];
|
|
23
23
|
// Required global files
|
|
24
24
|
var requiredGlobals = [
|
|
25
|
-
'
|
|
26
|
-
'
|
|
27
|
-
'
|
|
25
|
+
'Credentials',
|
|
26
|
+
'Resources',
|
|
27
|
+
'Values',
|
|
28
28
|
];
|
|
29
29
|
// Determine profile file name (default is stage)
|
|
30
30
|
var profileName = process.env.CYPRESS_PROFILE || 'Stage';
|
|
31
31
|
var requiredProfile = "".concat(profileName, ".Profile");
|
|
32
32
|
// Check global files
|
|
33
|
-
requiredGlobals.forEach(function (
|
|
34
|
-
var filePath = path_1.default.join(globalsPath,
|
|
33
|
+
requiredGlobals.forEach(function (globalName) {
|
|
34
|
+
var filePath = path_1.default.join(globalsPath, "Global".concat(globalName, ".ts"));
|
|
35
35
|
var found = extensions.some(function (ext) {
|
|
36
36
|
return (0, fs_1.existsSync)("".concat(filePath).concat(ext));
|
|
37
37
|
});
|
|
38
38
|
if (!found) {
|
|
39
39
|
// Create the file
|
|
40
|
-
(0, genEmptyGlobalFile_1.default)(
|
|
40
|
+
(0, genEmptyGlobalFile_1.default)(globalName);
|
|
41
41
|
}
|
|
42
42
|
});
|
|
43
43
|
// Check profile file
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../setup/checkRequiredFiles/index.ts"],"names":[],"mappings":";;;;;AAAA,cAAc;AACd,yBAAgC;AAChC,8CAAwB;AAExB,wBAAwB;AACxB,uEAAiD;AACjD,4EAAsD;AACtD,8EAAwD;AAExD;;;GAGG;AACH,IAAM,kBAAkB,GAAG;IACzB,IAAM,IAAI,GAAG,IAAA,qBAAW,GAAE,CAAC;IAE3B,IAAM,WAAW,GAAG,cAAI,CAAC,IAAI,CAAC,IAAI,EAAE,iBAAiB,CAAC,CAAC;IACvD,IAAM,YAAY,GAAG,cAAI,CAAC,IAAI,CAAC,IAAI,EAAE,kBAAkB,CAAC,CAAC;IAEzD,kCAAkC;IAClC,IAAM,UAAU,GAAG,CAAC,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;IAE3D,wBAAwB;IACxB,IAAM,eAAe,GAAG;QACtB,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../setup/checkRequiredFiles/index.ts"],"names":[],"mappings":";;;;;AAAA,cAAc;AACd,yBAAgC;AAChC,8CAAwB;AAExB,wBAAwB;AACxB,uEAAiD;AACjD,4EAAsD;AACtD,8EAAwD;AAExD;;;GAGG;AACH,IAAM,kBAAkB,GAAG;IACzB,IAAM,IAAI,GAAG,IAAA,qBAAW,GAAE,CAAC;IAE3B,IAAM,WAAW,GAAG,cAAI,CAAC,IAAI,CAAC,IAAI,EAAE,iBAAiB,CAAC,CAAC;IACvD,IAAM,YAAY,GAAG,cAAI,CAAC,IAAI,CAAC,IAAI,EAAE,kBAAkB,CAAC,CAAC;IAEzD,kCAAkC;IAClC,IAAM,UAAU,GAAG,CAAC,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;IAE3D,wBAAwB;IACxB,IAAM,eAAe,GAAG;QACtB,aAAa;QACb,WAAW;QACX,QAAQ;KACT,CAAC;IAEF,iDAAiD;IACjD,IAAM,WAAW,GAAG,OAAO,CAAC,GAAG,CAAC,eAAe,IAAI,OAAO,CAAC;IAC3D,IAAM,eAAe,GAAG,UAAG,WAAW,aAAU,CAAC;IAEjD,qBAAqB;IACrB,eAAe,CAAC,OAAO,CAAC,UAAC,UAAU;QACjC,IAAM,QAAQ,GAAG,cAAI,CAAC,IAAI,CAAC,WAAW,EAAE,gBAAS,UAAU,QAAK,CAAC,CAAC;QAClE,IAAM,KAAK,GAAG,UAAU,CAAC,IAAI,CAAC,UAAC,GAAG;YAChC,OAAO,IAAA,eAAU,EAAC,UAAG,QAAQ,SAAG,GAAG,CAAE,CAAC,CAAC;QACzC,CAAC,CAAC,CAAC;QACH,IAAI,CAAC,KAAK,EAAE,CAAC;YACX,kBAAkB;YAClB,IAAA,4BAAkB,EAAC,UAAU,CAAC,CAAC;QACjC,CAAC;IACH,CAAC,CAAC,CAAC;IAEH,qBAAqB;IACrB,IAAM,eAAe,GAAG,cAAI,CAAC,IAAI,CAAC,YAAY,EAAE,eAAe,CAAC,CAAC;IACjE,IAAM,YAAY,GAAG,UAAU,CAAC,IAAI,CAAC,UAAC,GAAG;QACvC,OAAO,IAAA,eAAU,EAAC,UAAG,eAAe,SAAG,GAAG,CAAE,CAAC,CAAC;IAChD,CAAC,CAAC,CAAC;IACH,IAAI,CAAC,YAAY,EAAE,CAAC;QAClB,IAAA,6BAAmB,EAAC,WAAW,CAAC,CAAC;IACnC,CAAC;AACH,CAAC,CAAC;AAEF,kBAAe,kBAAkB,CAAC"}
|
|
@@ -25,7 +25,9 @@ var genKyCommandDeclarations = function () {
|
|
|
25
25
|
var root = (0, getRootPath_1.default)();
|
|
26
26
|
// Get paths
|
|
27
27
|
var kyCommandsDir = path_1.default.join(root, 'node_modules/dceky/src/commands');
|
|
28
|
-
var declarationsPath = path_1.default.join(root, 'cypress/
|
|
28
|
+
var declarationsPath = path_1.default.join(root, 'cypress/support/kyCommandDeclarations.ts');
|
|
29
|
+
console.log('Generating Ky command declarations file...');
|
|
30
|
+
console.log(kyCommandsDir, declarationsPath);
|
|
29
31
|
// Find all command files
|
|
30
32
|
var commandFiles = (fs_1.default
|
|
31
33
|
// Read all files in the commands directory
|
|
@@ -38,6 +40,8 @@ var genKyCommandDeclarations = function () {
|
|
|
38
40
|
.filter(function (file) {
|
|
39
41
|
return file !== 'index.ts';
|
|
40
42
|
}));
|
|
43
|
+
console.log("Found ".concat(commandFiles.length, " Ky command files."));
|
|
44
|
+
console.log(commandFiles);
|
|
41
45
|
// Read the files, extract declarations
|
|
42
46
|
var unprocessedDeclarations = [];
|
|
43
47
|
for (var i = 0; i < commandFiles.length; i += 1) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"genKyCommandDeclarations.js","sourceRoot":"","sources":["../../setup/genKyCommandDeclarations.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,kBAAkB;AAClB,0CAAoB;AACpB,8CAAwB;AAExB,wBAAwB;AACxB,sEAAgD;AAEhD;;;GAGG;AACH,IAAM,wBAAwB,GAAG;IAC/B,IAAM,IAAI,GAAG,IAAA,qBAAW,GAAE,CAAC;IAE3B,YAAY;IACZ,IAAM,aAAa,GAAG,cAAI,CAAC,IAAI,CAAC,IAAI,EAAE,iCAAiC,CAAC,CAAC;IACzE,IAAM,gBAAgB,GAAG,cAAI,CAAC,IAAI,CAAC,IAAI,EAAE,
|
|
1
|
+
{"version":3,"file":"genKyCommandDeclarations.js","sourceRoot":"","sources":["../../setup/genKyCommandDeclarations.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,kBAAkB;AAClB,0CAAoB;AACpB,8CAAwB;AAExB,wBAAwB;AACxB,sEAAgD;AAEhD;;;GAGG;AACH,IAAM,wBAAwB,GAAG;IAC/B,IAAM,IAAI,GAAG,IAAA,qBAAW,GAAE,CAAC;IAE3B,YAAY;IACZ,IAAM,aAAa,GAAG,cAA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? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
// Import libs
|
|
7
|
+
var path_1 = __importDefault(require("path"));
|
|
6
8
|
// Import shared helpers
|
|
7
9
|
var exec_1 = __importDefault(require("../start/helpers/exec"));
|
|
8
10
|
var getRootPath_1 = __importDefault(require("./helpers/getRootPath"));
|
|
@@ -19,15 +21,13 @@ var setupCypressDependencies = function () {
|
|
|
19
21
|
'mochawesome-merge',
|
|
20
22
|
'mochawesome-report-generator',
|
|
21
23
|
];
|
|
24
|
+
// Read package.json
|
|
25
|
+
// eslint-disable-next-line global-require, import/no-dynamic-require
|
|
26
|
+
var pkgJson = require(path_1.default.join(root, 'package.json'));
|
|
27
|
+
var devDeps = pkgJson.devDependencies || {};
|
|
22
28
|
var missingPkgs = requiredPkgs.filter(function (pkg) {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
require.resolve(pkg, { paths: [root] });
|
|
26
|
-
return false;
|
|
27
|
-
}
|
|
28
|
-
catch (_a) {
|
|
29
|
-
return true;
|
|
30
|
-
}
|
|
29
|
+
// Check devDependencies in top-level package.json
|
|
30
|
+
return !(pkg in devDeps);
|
|
31
31
|
});
|
|
32
32
|
// Install missing packages
|
|
33
33
|
if (missingPkgs.length > 0) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"setupCypressDependencies.js","sourceRoot":"","sources":["../../setup/setupCypressDependencies.ts"],"names":[],"mappings":";;;;;AAAA,wBAAwB;AACxB,+DAAyC;AACzC,sEAAgD;AAEhD;;;GAGG;AACH,IAAM,wBAAwB,GAAG;IAC/B,IAAM,IAAI,GAAG,IAAA,qBAAW,GAAE,CAAC;IAE3B,IAAM,YAAY,GAAG;QACnB,kBAAkB;QAClB,yBAAyB;QACzB,aAAa;QACb,mBAAmB;QACnB,8BAA8B;KAC/B,CAAC;IAEF,IAAM,
|
|
1
|
+
{"version":3,"file":"setupCypressDependencies.js","sourceRoot":"","sources":["../../setup/setupCypressDependencies.ts"],"names":[],"mappings":";;;;;AAAA,cAAc;AACd,8CAAwB;AAExB,wBAAwB;AACxB,+DAAyC;AACzC,sEAAgD;AAEhD;;;GAGG;AACH,IAAM,wBAAwB,GAAG;IAC/B,IAAM,IAAI,GAAG,IAAA,qBAAW,GAAE,CAAC;IAE3B,IAAM,YAAY,GAAG;QACnB,kBAAkB;QAClB,yBAAyB;QACzB,aAAa;QACb,mBAAmB;QACnB,8BAA8B;KAC/B,CAAC;IAEF,oBAAoB;IACpB,qEAAqE;IACrE,IAAM,OAAO,GAAG,OAAO,CAAC,cAAI,CAAC,IAAI,CAAC,IAAI,EAAE,cAAc,CAAC,CAAC,CAAC;IACzD,IAAM,OAAO,GAAG,OAAO,CAAC,eAAe,IAAI,EAAE,CAAC;IAE9C,IAAM,WAAW,GAAG,YAAY,CAAC,MAAM,CAAC,UAAC,GAAG;QAC1C,kDAAkD;QAClD,OAAO,CAAC,CAAC,GAAG,IAAI,OAAO,CAAC,CAAC;IAC3B,CAAC,CAAC,CAAC;IAEH,2BAA2B;IAC3B,IAAI,WAAW,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAC3B,iBAAiB;QACjB,sCAAsC;QACtC,OAAO,CAAC,GAAG,CAAC,8CAAuC,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,CAAE,CAAC,CAAC;QAE7E,4BAA4B;QAC5B,IAAM,UAAU,GAAG,mBAAY,WAAW,CAAC,IAAI,CAAC,GAAG,CAAC,CAAE,CAAC;QACvD,IAAA,cAAI,EAAC,UAAU,EAAE,IAAI,CAAC,CAAC;IACzB,CAAC;AACH,CAAC,CAAC;AAEF,kBAAe,wBAAwB,CAAC"}
|
package/package.json
CHANGED
|
@@ -22,9 +22,9 @@ const checkRequiredFiles = (): void => {
|
|
|
22
22
|
|
|
23
23
|
// Required global files
|
|
24
24
|
const requiredGlobals = [
|
|
25
|
-
'
|
|
26
|
-
'
|
|
27
|
-
'
|
|
25
|
+
'Credentials',
|
|
26
|
+
'Resources',
|
|
27
|
+
'Values',
|
|
28
28
|
];
|
|
29
29
|
|
|
30
30
|
// Determine profile file name (default is stage)
|
|
@@ -32,14 +32,14 @@ const checkRequiredFiles = (): void => {
|
|
|
32
32
|
const requiredProfile = `${profileName}.Profile`;
|
|
33
33
|
|
|
34
34
|
// Check global files
|
|
35
|
-
requiredGlobals.forEach((
|
|
36
|
-
const filePath = path.join(globalsPath,
|
|
35
|
+
requiredGlobals.forEach((globalName) => {
|
|
36
|
+
const filePath = path.join(globalsPath, `Global${globalName}.ts`);
|
|
37
37
|
const found = extensions.some((ext) => {
|
|
38
38
|
return existsSync(`${filePath}${ext}`);
|
|
39
39
|
});
|
|
40
40
|
if (!found) {
|
|
41
41
|
// Create the file
|
|
42
|
-
genEmptyGlobalFile(
|
|
42
|
+
genEmptyGlobalFile(globalName);
|
|
43
43
|
}
|
|
44
44
|
});
|
|
45
45
|
|
|
@@ -14,7 +14,9 @@ const genKyCommandDeclarations = () => {
|
|
|
14
14
|
|
|
15
15
|
// Get paths
|
|
16
16
|
const kyCommandsDir = path.join(root, 'node_modules/dceky/src/commands');
|
|
17
|
-
const declarationsPath = path.join(root, 'cypress/
|
|
17
|
+
const declarationsPath = path.join(root, 'cypress/support/kyCommandDeclarations.ts');
|
|
18
|
+
console.log('Generating Ky command declarations file...');
|
|
19
|
+
console.log(kyCommandsDir, declarationsPath);
|
|
18
20
|
|
|
19
21
|
// Find all command files
|
|
20
22
|
const commandFiles = (
|
|
@@ -30,6 +32,8 @@ const genKyCommandDeclarations = () => {
|
|
|
30
32
|
return file !== 'index.ts';
|
|
31
33
|
})
|
|
32
34
|
);
|
|
35
|
+
console.log(`Found ${commandFiles.length} Ky command files.`);
|
|
36
|
+
console.log(commandFiles);
|
|
33
37
|
|
|
34
38
|
// Read the files, extract declarations
|
|
35
39
|
const unprocessedDeclarations: string[] = [];
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
// Import libs
|
|
2
|
+
import path from 'path';
|
|
3
|
+
|
|
1
4
|
// Import shared helpers
|
|
2
5
|
import exec from '../start/helpers/exec';
|
|
3
6
|
import getRootPath from './helpers/getRootPath';
|
|
@@ -17,14 +20,14 @@ const setupCypressDependencies = (): void => {
|
|
|
17
20
|
'mochawesome-report-generator',
|
|
18
21
|
];
|
|
19
22
|
|
|
23
|
+
// Read package.json
|
|
24
|
+
// eslint-disable-next-line global-require, import/no-dynamic-require
|
|
25
|
+
const pkgJson = require(path.join(root, 'package.json'));
|
|
26
|
+
const devDeps = pkgJson.devDependencies || {};
|
|
27
|
+
|
|
20
28
|
const missingPkgs = requiredPkgs.filter((pkg) => {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
require.resolve(pkg, { paths: [root] });
|
|
24
|
-
return false;
|
|
25
|
-
} catch {
|
|
26
|
-
return true;
|
|
27
|
-
}
|
|
29
|
+
// Check devDependencies in top-level package.json
|
|
30
|
+
return !(pkg in devDeps);
|
|
28
31
|
});
|
|
29
32
|
|
|
30
33
|
// Install missing packages
|