dceky 1.1.1 → 1.1.3
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/docs/commands.html +961 -0
- package/genDocs/index.ts +322 -0
- package/lib/genDocs/index.d.ts +1 -0
- package/lib/genDocs/index.js +285 -0
- package/lib/genDocs/index.js.map +1 -0
- package/lib/postinstall/helpers/getRootPath.js +3 -3
- package/lib/postinstall/helpers/getRootPath.js.map +1 -1
- package/lib/postinstall/index.js +6 -6
- package/lib/postinstall/index.js.map +1 -1
- package/lib/preinstall/helpers/getRootPath.js +3 -3
- package/lib/preinstall/helpers/getRootPath.js.map +1 -1
- package/lib/preinstall/index.js +6 -6
- package/lib/preinstall/index.js.map +1 -1
- package/lib/setup/addToGitIgnore.js +13 -13
- package/lib/setup/addToGitIgnore.js.map +1 -1
- package/lib/setup/checkRequiredFiles/genEmptyGlobalFile.js +12 -12
- package/lib/setup/checkRequiredFiles/genEmptyGlobalFile.js.map +1 -1
- package/lib/setup/checkRequiredFiles/genEmptyProfileFile.js +23 -13
- package/lib/setup/checkRequiredFiles/genEmptyProfileFile.js.map +1 -1
- package/lib/setup/checkRequiredFiles/genExampleTest.js +8 -8
- package/lib/setup/checkRequiredFiles/genExampleTest.js.map +1 -1
- package/lib/setup/checkRequiredFiles/index.js +21 -21
- package/lib/setup/checkRequiredFiles/index.js.map +1 -1
- package/lib/setup/genCommandImportFile.js +24 -24
- package/lib/setup/genCommandImportFile.js.map +1 -1
- package/lib/setup/genDynamicConfigFile.js +8 -8
- package/lib/setup/genDynamicConfigFile.js.map +1 -1
- package/lib/setup/genE2ELaunchFile.js +8 -8
- package/lib/setup/genE2ELaunchFile.js.map +1 -1
- package/lib/setup/genKyCommandDeclarations.js +24 -24
- package/lib/setup/genKyCommandDeclarations.js.map +1 -1
- package/lib/setup/genTsConfigFile.js +9 -8
- package/lib/setup/genTsConfigFile.js.map +1 -1
- package/lib/setup/helpers/getRootPath.js +3 -3
- package/lib/setup/helpers/getRootPath.js.map +1 -1
- package/lib/setup/index.js +8 -8
- package/lib/setup/index.js.map +1 -1
- package/lib/setup/setupCypressDependencies.js +11 -11
- package/lib/setup/setupCypressDependencies.js.map +1 -1
- package/lib/src/commands/assertDoesNotHaveClass.js +3 -3
- package/lib/src/commands/assertDoesNotHaveClass.js.map +1 -1
- package/lib/src/commands/assertHasClass.js +3 -3
- package/lib/src/commands/assertHasClass.js.map +1 -1
- package/lib/src/commands/assertNumElements.js +3 -3
- package/lib/src/commands/assertNumElements.js.map +1 -1
- package/lib/src/commands/checkIfElementExists.js +3 -3
- package/lib/src/commands/checkIfElementExists.js.map +1 -1
- package/lib/src/commands/extractDataFromClass.js +8 -8
- package/lib/src/commands/extractDataFromClass.js.map +1 -1
- package/lib/src/commands/extractDataFromClassByContents.js +8 -8
- package/lib/src/commands/extractDataFromClassByContents.js.map +1 -1
- package/lib/src/commands/genTextOfLength.js +6 -6
- package/lib/src/commands/genTextOfLength.js.map +1 -1
- package/lib/src/commands/getAttribute.js +4 -4
- package/lib/src/commands/getAttribute.js.map +1 -1
- package/lib/src/commands/getClassName.js +3 -3
- package/lib/src/commands/getClassName.js.map +1 -1
- package/lib/src/commands/getCredentialValue.js +3 -4
- package/lib/src/commands/getCredentialValue.js.map +1 -1
- package/lib/src/commands/getCredentialValues.js +2 -2
- package/lib/src/commands/getCredentialValues.js.map +1 -1
- package/lib/src/commands/getCurrentDateInfo.js +4 -4
- package/lib/src/commands/getCurrentDateInfo.js.map +1 -1
- package/lib/src/commands/getId.js +3 -3
- package/lib/src/commands/getId.js.map +1 -1
- package/lib/src/commands/getJSON.js +2 -2
- package/lib/src/commands/getJSON.js.map +1 -1
- package/lib/src/commands/getNumElements.js +4 -4
- package/lib/src/commands/getNumElements.js.map +1 -1
- package/lib/src/commands/getProfileValue.js +1 -1
- package/lib/src/commands/getProfileValue.js.map +1 -1
- package/lib/src/commands/getSpecialChars.js +2 -2
- package/lib/src/commands/getSpecialChars.js.map +1 -1
- package/lib/src/commands/getTitle.js +3 -3
- package/lib/src/commands/getTitle.js.map +1 -1
- package/lib/src/commands/handleHarvardKey.js +12 -12
- package/lib/src/commands/handleHarvardKey.js.map +1 -1
- package/lib/src/commands/helpers/getFormData.js +13 -13
- package/lib/src/commands/helpers/getFormData.js.map +1 -1
- package/lib/src/commands/index.js +34 -34
- package/lib/src/commands/index.js.map +1 -1
- package/lib/src/commands/launchAs.js +25 -26
- package/lib/src/commands/launchAs.js.map +1 -1
- package/lib/src/commands/listSelectLabels.js +6 -6
- package/lib/src/commands/listSelectLabels.js.map +1 -1
- package/lib/src/commands/listSelectValues.js +7 -7
- package/lib/src/commands/listSelectValues.js.map +1 -1
- package/lib/src/commands/logIntoPorta.js +21 -31
- package/lib/src/commands/logIntoPorta.js.map +1 -1
- package/lib/src/commands/navigateToHref.js +7 -7
- package/lib/src/commands/navigateToHref.js.map +1 -1
- package/lib/src/commands/padWithZeros.js +6 -6
- package/lib/src/commands/padWithZeros.js.map +1 -1
- package/lib/src/commands/runScript.js +4 -4
- package/lib/src/commands/runScript.js.map +1 -1
- package/lib/src/commands/tap.js +2 -2
- package/lib/src/commands/tap.js.map +1 -1
- package/lib/src/commands/tapInIFrame.js +2 -2
- package/lib/src/commands/tapInIFrame.js.map +1 -1
- package/lib/src/commands/typeInto.js +9 -9
- package/lib/src/commands/typeInto.js.map +1 -1
- package/lib/src/commands/uniquify.js +7 -7
- package/lib/src/commands/uniquify.js.map +1 -1
- package/lib/src/commands/visitCanvasEndpoint.js +7 -18
- package/lib/src/commands/visitCanvasEndpoint.js.map +1 -1
- package/lib/src/commands/waitForAtLeastOneElementPresent.js +9 -9
- package/lib/src/commands/waitForAtLeastOneElementPresent.js.map +1 -1
- package/lib/src/commands/waitForElementVisible.js +4 -4
- package/lib/src/commands/waitForElementVisible.js.map +1 -1
- package/lib/src/genConfiguration/helpers/getRootPath.js +3 -3
- package/lib/src/genConfiguration/helpers/getRootPath.js.map +1 -1
- package/lib/src/genConfiguration/helpers/resolveDependents.js +8 -9
- package/lib/src/genConfiguration/helpers/resolveDependents.js.map +1 -1
- package/lib/src/genConfiguration/helpers/splitEnv.js +5 -6
- package/lib/src/genConfiguration/helpers/splitEnv.js.map +1 -1
- package/lib/src/genConfiguration/index.js +36 -44
- package/lib/src/genConfiguration/index.js.map +1 -1
- package/lib/src/index.js +1 -1
- package/lib/src/index.js.map +1 -1
- package/lib/start/constants/AVAILABLE_BROWSERS.js +1 -1
- package/lib/start/constants/AVAILABLE_BROWSERS.js.map +1 -1
- package/lib/start/constants/DEFAULT_THREADS_PER_COMBO.js +1 -1
- package/lib/start/constants/DEFAULT_THREADS_PER_COMBO.js.map +1 -1
- package/lib/start/helpers/collectPngFiles.js +8 -9
- package/lib/start/helpers/collectPngFiles.js.map +1 -1
- package/lib/start/helpers/exec.js +2 -2
- package/lib/start/helpers/exec.js.map +1 -1
- package/lib/start/helpers/executeAllHeadlessCombinations.js +58 -89
- package/lib/start/helpers/executeAllHeadlessCombinations.js.map +1 -1
- package/lib/start/helpers/executeCypress.js +32 -73
- package/lib/start/helpers/executeCypress.js.map +1 -1
- package/lib/start/helpers/extractArgValue.js +7 -7
- package/lib/start/helpers/extractArgValue.js.map +1 -1
- package/lib/start/helpers/findProfilesByNames.js +7 -7
- package/lib/start/helpers/findProfilesByNames.js.map +1 -1
- package/lib/start/helpers/generateHtmlReport.js +19 -19
- package/lib/start/helpers/generateHtmlReport.js.map +1 -1
- package/lib/start/helpers/generateReportHomepage.js +49 -68
- package/lib/start/helpers/generateReportHomepage.js.map +1 -1
- package/lib/start/helpers/generateReporterConfig.js +4 -4
- package/lib/start/helpers/generateReporterConfig.js.map +1 -1
- package/lib/start/helpers/getDateLabeledDir.js +17 -17
- package/lib/start/helpers/getDateLabeledDir.js.map +1 -1
- package/lib/start/helpers/getRootPath.js +3 -3
- package/lib/start/helpers/getRootPath.js.map +1 -1
- package/lib/start/helpers/mergeAllReportsAndGenerateHtml.js +29 -29
- package/lib/start/helpers/mergeAllReportsAndGenerateHtml.js.map +1 -1
- package/lib/start/helpers/mergeReports.js +22 -22
- package/lib/start/helpers/mergeReports.js.map +1 -1
- package/lib/start/helpers/parseCommaSeparated.js +3 -3
- package/lib/start/helpers/parseCommaSeparated.js.map +1 -1
- package/lib/start/helpers/print.js +19 -19
- package/lib/start/helpers/print.js.map +1 -1
- package/lib/start/helpers/prompt.js +5 -5
- package/lib/start/helpers/prompt.js.map +1 -1
- package/lib/start/helpers/runCypressHeadless.js +41 -52
- package/lib/start/helpers/runCypressHeadless.js.map +1 -1
- package/lib/start/helpers/runCypressVisible.js +13 -24
- package/lib/start/helpers/runCypressVisible.js.map +1 -1
- package/lib/start/helpers/showChooser.js +27 -38
- package/lib/start/helpers/showChooser.js.map +1 -1
- package/lib/start/helpers/validateBrowsers.js +8 -8
- package/lib/start/helpers/validateBrowsers.js.map +1 -1
- package/lib/start/index.js +58 -60
- package/lib/start/index.js.map +1 -1
- package/package.json +5 -2
- package/setup/checkRequiredFiles/genEmptyProfileFile.ts +15 -1
- package/setup/genTsConfigFile.ts +1 -0
- package/src/genConfiguration/index.ts +3 -1
- package/tsconfig.json +5 -3
|
@@ -8,19 +8,19 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
8
8
|
* @param argName the argument name to look for (e.g., '--profile' or '--headless')
|
|
9
9
|
* @returns the argument value if found, empty string if flag exists without value, undefined otherwise
|
|
10
10
|
*/
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
args.some(
|
|
14
|
-
|
|
11
|
+
const extractArgValue = (args, argName) => {
|
|
12
|
+
let matchedValue;
|
|
13
|
+
args.some((rawArg, index) => {
|
|
14
|
+
const normalizedArg = rawArg.toLowerCase();
|
|
15
15
|
// Case 1: flag and value combined, e.g. "--profile=stage"
|
|
16
|
-
if (normalizedArg.startsWith(
|
|
17
|
-
|
|
16
|
+
if (normalizedArg.startsWith(`${argName}=`)) {
|
|
17
|
+
const [, value] = rawArg.split('=');
|
|
18
18
|
matchedValue = value;
|
|
19
19
|
return true; // stop scanning
|
|
20
20
|
}
|
|
21
21
|
// Case 2: flag by itself, possibly followed by a separate value
|
|
22
22
|
if (normalizedArg === argName) {
|
|
23
|
-
|
|
23
|
+
const nextArg = args[index + 1];
|
|
24
24
|
// If the next token exists and isn't another flag, treat it as the value
|
|
25
25
|
if (nextArg && !nextArg.startsWith('--')) {
|
|
26
26
|
matchedValue = nextArg;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"extractArgValue.js","sourceRoot":"","sources":["../../../start/helpers/extractArgValue.ts"],"names":[],"mappings":";;AAAA;;;;;;;GAOG;AACH,
|
|
1
|
+
{"version":3,"file":"extractArgValue.js","sourceRoot":"","sources":["../../../start/helpers/extractArgValue.ts"],"names":[],"mappings":";;AAAA;;;;;;;GAOG;AACH,MAAM,eAAe,GAAG,CAAC,IAAc,EAAE,OAAe,EAAsB,EAAE;IAC9E,IAAI,YAAgC,CAAC;IACrC,IAAI,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,KAAK,EAAE,EAAE;QAC1B,MAAM,aAAa,GAAG,MAAM,CAAC,WAAW,EAAE,CAAC;QAE3C,0DAA0D;QAC1D,IAAI,aAAa,CAAC,UAAU,CAAC,GAAG,OAAO,GAAG,CAAC,EAAE,CAAC;YAC5C,MAAM,CAAC,EAAE,KAAK,CAAC,GAAG,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;YACpC,YAAY,GAAG,KAAK,CAAC;YACrB,OAAO,IAAI,CAAC,CAAC,gBAAgB;QAC/B,CAAC;QAED,gEAAgE;QAChE,IAAI,aAAa,KAAK,OAAO,EAAE,CAAC;YAC9B,MAAM,OAAO,GAAG,IAAI,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC;YAEhC,yEAAyE;YACzE,IAAI,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE,CAAC;gBACzC,YAAY,GAAG,OAAO,CAAC;YACzB,CAAC;iBAAM,CAAC;gBACN,0EAA0E;gBAC1E,YAAY,GAAG,EAAE,CAAC;YACpB,CAAC;YAED,OAAO,IAAI,CAAC,CAAC,gBAAgB;QAC/B,CAAC;QAED,OAAO,KAAK,CAAC;IACf,CAAC,CAAC,CAAC;IAEH,OAAO,YAAY,CAAC;AACtB,CAAC,CAAC;AAEF,kBAAe,eAAe,CAAC"}
|
|
@@ -8,13 +8,13 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
8
8
|
* @param profiles array of available profiles
|
|
9
9
|
* @returns array of found profiles
|
|
10
10
|
*/
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
names.forEach(
|
|
15
|
-
|
|
11
|
+
const findProfilesByNames = (names, profiles) => {
|
|
12
|
+
const found = [];
|
|
13
|
+
const notFound = [];
|
|
14
|
+
names.forEach((name) => {
|
|
15
|
+
const target = name.toLowerCase();
|
|
16
16
|
// Find matching profile (case-insensitive)
|
|
17
|
-
|
|
17
|
+
const match = profiles.find((p) => {
|
|
18
18
|
return p.profileName.toLowerCase() === target;
|
|
19
19
|
});
|
|
20
20
|
if (match) {
|
|
@@ -26,7 +26,7 @@ var findProfilesByNames = function (names, profiles) {
|
|
|
26
26
|
});
|
|
27
27
|
if (notFound.length > 0) {
|
|
28
28
|
// eslint-disable-next-line no-console
|
|
29
|
-
console.error(
|
|
29
|
+
console.error(`Profile(s) not found: ${notFound.join(', ')}. Available profiles: ${profiles.map((p) => { return p.profileName; }).join(', ')}`);
|
|
30
30
|
process.exit(1);
|
|
31
31
|
}
|
|
32
32
|
return found;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"findProfilesByNames.js","sourceRoot":"","sources":["../../../start/helpers/findProfilesByNames.ts"],"names":[],"mappings":";;AAAA;;;;;;;GAOG;AACH,
|
|
1
|
+
{"version":3,"file":"findProfilesByNames.js","sourceRoot":"","sources":["../../../start/helpers/findProfilesByNames.ts"],"names":[],"mappings":";;AAAA;;;;;;;GAOG;AACH,MAAM,mBAAmB,GAAG,CAC1B,KAAe,EACf,QAAsD,EACR,EAAE;IAChD,MAAM,KAAK,GAAiD,EAAE,CAAC;IAC/D,MAAM,QAAQ,GAAa,EAAE,CAAC;IAE9B,KAAK,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE;QACrB,MAAM,MAAM,GAAG,IAAI,CAAC,WAAW,EAAE,CAAC;QAElC,2CAA2C;QAC3C,MAAM,KAAK,GAAG,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE;YAChC,OAAO,CAAC,CAAC,WAAW,CAAC,WAAW,EAAE,KAAK,MAAM,CAAC;QAChD,CAAC,CAAC,CAAC;QACH,IAAI,KAAK,EAAE,CAAC;YACV,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QACpB,CAAC;aAAM,CAAC;YACN,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACtB,CAAC;IACH,CAAC,CAAC,CAAC;IAEH,IAAI,QAAQ,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACxB,sCAAsC;QACtC,OAAO,CAAC,KAAK,CAAC,yBAAyB,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,yBAAyB,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,GAAG,OAAO,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QAChJ,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;IAED,OAAO,KAAK,CAAC;AACf,CAAC,CAAC;AAEF,kBAAe,mBAAmB,CAAC"}
|
|
@@ -4,10 +4,10 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
/* eslint-disable no-console */
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
7
|
+
const child_process_1 = require("child_process");
|
|
8
|
+
const path_1 = __importDefault(require("path"));
|
|
9
|
+
const fs_1 = require("fs");
|
|
10
|
+
const getRootPath_1 = __importDefault(require("./getRootPath"));
|
|
11
11
|
/**
|
|
12
12
|
* Generate HTML report from merged JSON report using mochawesome-report-generator (marge)
|
|
13
13
|
* @author Yuen Ler Chow
|
|
@@ -16,37 +16,37 @@ var getRootPath_1 = __importDefault(require("./getRootPath"));
|
|
|
16
16
|
* @param opts.profileName - Profile name
|
|
17
17
|
* @param opts.browserName - Browser name
|
|
18
18
|
*/
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
console.log(
|
|
25
|
-
console.log(
|
|
26
|
-
console.log(
|
|
19
|
+
const generateHtmlReport = (opts) => {
|
|
20
|
+
const { resultsDir, profileName, browserName } = opts;
|
|
21
|
+
const reportDataPath = path_1.default.join(resultsDir, `${profileName}-${browserName}`, 'report-data.json');
|
|
22
|
+
const reportDir = path_1.default.join(resultsDir, `${profileName}-${browserName}`, 'report');
|
|
23
|
+
const expectedHtmlPath = path_1.default.join(reportDir, 'report-data.html');
|
|
24
|
+
console.log(`\n📄 Generate HTML Report Debug for ${profileName} + ${browserName}:`);
|
|
25
|
+
console.log(` Report data path: ${reportDataPath}`);
|
|
26
|
+
console.log(` Report output dir: ${reportDir}`);
|
|
27
27
|
if (!(0, fs_1.existsSync)(reportDataPath)) {
|
|
28
|
-
|
|
28
|
+
const errorMsg = `❌ ERROR: Report data JSON does not exist: ${reportDataPath}`;
|
|
29
29
|
console.error(errorMsg);
|
|
30
30
|
throw new Error(errorMsg);
|
|
31
31
|
}
|
|
32
32
|
try {
|
|
33
|
-
|
|
34
|
-
console.log(
|
|
35
|
-
console.log(
|
|
33
|
+
const command = `npx marge "${reportDataPath}" --reportDir "${reportDir}"`;
|
|
34
|
+
console.log(` Running: ${command}`);
|
|
35
|
+
console.log(`Generating HTML report for ${profileName} + ${browserName}...`);
|
|
36
36
|
(0, child_process_1.execSync)(command, {
|
|
37
37
|
stdio: 'inherit',
|
|
38
38
|
cwd: (0, getRootPath_1.default)(),
|
|
39
39
|
});
|
|
40
40
|
// Verify the HTML report was created
|
|
41
41
|
if (!(0, fs_1.existsSync)(expectedHtmlPath)) {
|
|
42
|
-
|
|
42
|
+
const errorMsg = `❌ ERROR: HTML report was not created at: ${expectedHtmlPath}`;
|
|
43
43
|
console.error(errorMsg);
|
|
44
44
|
throw new Error(errorMsg);
|
|
45
45
|
}
|
|
46
|
-
console.log(
|
|
46
|
+
console.log(` ✅ HTML report generated successfully at: ${expectedHtmlPath}`);
|
|
47
47
|
}
|
|
48
48
|
catch (e) {
|
|
49
|
-
console.error(
|
|
49
|
+
console.error(`Error generating HTML report for ${profileName} + ${browserName}:`, e);
|
|
50
50
|
throw e;
|
|
51
51
|
}
|
|
52
52
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generateHtmlReport.js","sourceRoot":"","sources":["../../../start/helpers/generateHtmlReport.ts"],"names":[],"mappings":";;;;;AAAA,+BAA+B;AAC/B
|
|
1
|
+
{"version":3,"file":"generateHtmlReport.js","sourceRoot":"","sources":["../../../start/helpers/generateHtmlReport.ts"],"names":[],"mappings":";;;;;AAAA,+BAA+B;AAC/B,iDAAyC;AACzC,gDAAwB;AACxB,2BAAgC;AAChC,gEAAwC;AAExC;;;;;;;GAOG;AACH,MAAM,kBAAkB,GAAG,CACzB,IAIC,EACK,EAAE;IACR,MAAM,EAAE,UAAU,EAAE,WAAW,EAAE,WAAW,EAAE,GAAG,IAAI,CAAC;IAEtD,MAAM,cAAc,GAAG,cAAI,CAAC,IAAI,CAC9B,UAAU,EACV,GAAG,WAAW,IAAI,WAAW,EAAE,EAC/B,kBAAkB,CACnB,CAAC;IACF,MAAM,SAAS,GAAG,cAAI,CAAC,IAAI,CACzB,UAAU,EACV,GAAG,WAAW,IAAI,WAAW,EAAE,EAC/B,QAAQ,CACT,CAAC;IACF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M,WAAW,GAAG,EAAE,CAAC,CAAC,CAAC;QACtF,MAAM,CAAC,CAAC;IACV,CAAC;AACH,CAAC,CAAC;AAEF,kBAAe,kBAAkB,CAAC"}
|
|
@@ -1,53 +1,33 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __assign = (this && this.__assign) || function () {
|
|
3
|
-
__assign = Object.assign || function(t) {
|
|
4
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
-
s = arguments[i];
|
|
6
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
-
t[p] = s[p];
|
|
8
|
-
}
|
|
9
|
-
return t;
|
|
10
|
-
};
|
|
11
|
-
return __assign.apply(this, arguments);
|
|
12
|
-
};
|
|
13
|
-
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
14
|
-
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
15
|
-
if (ar || !(i in from)) {
|
|
16
|
-
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
17
|
-
ar[i] = from[i];
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
return to.concat(ar || Array.prototype.slice.call(from));
|
|
21
|
-
};
|
|
22
2
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
23
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
24
4
|
};
|
|
25
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
6
|
/* eslint-disable no-console */
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
7
|
+
const fs_1 = __importDefault(require("fs"));
|
|
8
|
+
const path_1 = __importDefault(require("path"));
|
|
9
|
+
const ejs_1 = __importDefault(require("ejs"));
|
|
30
10
|
// Import helpers
|
|
31
|
-
|
|
11
|
+
const collectPngFiles_1 = __importDefault(require("./collectPngFiles"));
|
|
32
12
|
/**
|
|
33
13
|
* Generate an HTML homepage that links to all reports
|
|
34
14
|
* @author Yuen Ler Chow
|
|
35
15
|
* @param reports - Array of report information
|
|
36
16
|
* @param outputDir - The directory where the homepage should be created
|
|
37
17
|
*/
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
18
|
+
const generateReportHomepage = (reports, outputDir) => {
|
|
19
|
+
const homepagePath = path_1.default.join(outputDir, 'index.html');
|
|
20
|
+
const combinedReportPath = path_1.default.join(outputDir, 'all-runs.html');
|
|
21
|
+
const combinedJsonPath = path_1.default.join(outputDir, 'all-report-data.json');
|
|
22
|
+
const hasCombinedReport = fs_1.default.existsSync(combinedReportPath);
|
|
43
23
|
// Try to read combined stats from all-report-data.json
|
|
44
|
-
|
|
45
|
-
|
|
24
|
+
let combinedTotalTests = null;
|
|
25
|
+
let combinedPassedTests = null;
|
|
46
26
|
if (fs_1.default.existsSync(combinedJsonPath)) {
|
|
47
27
|
try {
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
28
|
+
const raw = fs_1.default.readFileSync(combinedJsonPath, 'utf-8');
|
|
29
|
+
const data = JSON.parse(raw);
|
|
30
|
+
const stats = (data && data.stats) || null;
|
|
51
31
|
if (stats && typeof stats.tests === 'number' && typeof stats.passes === 'number') {
|
|
52
32
|
combinedTotalTests = stats.tests;
|
|
53
33
|
combinedPassedTests = stats.passes;
|
|
@@ -59,15 +39,15 @@ var generateReportHomepage = function (reports, outputDir) {
|
|
|
59
39
|
}
|
|
60
40
|
}
|
|
61
41
|
// Try to read per-combination stats from each combo's report-data.json
|
|
62
|
-
reports.forEach(
|
|
63
|
-
|
|
42
|
+
reports.forEach((report) => {
|
|
43
|
+
const comboJsonPath = path_1.default.join(outputDir, `${report.profileName}-${report.browser}`, 'report-data.json');
|
|
64
44
|
if (!fs_1.default.existsSync(comboJsonPath)) {
|
|
65
45
|
return;
|
|
66
46
|
}
|
|
67
47
|
try {
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
48
|
+
const raw = fs_1.default.readFileSync(comboJsonPath, 'utf-8');
|
|
49
|
+
const data = JSON.parse(raw);
|
|
50
|
+
const stats = (data && data.stats) || null;
|
|
71
51
|
if (stats && typeof stats.tests === 'number' && typeof stats.passes === 'number') {
|
|
72
52
|
// eslint-disable-next-line no-param-reassign
|
|
73
53
|
report.totalTests = stats.tests;
|
|
@@ -77,66 +57,67 @@ var generateReportHomepage = function (reports, outputDir) {
|
|
|
77
57
|
}
|
|
78
58
|
catch (err) {
|
|
79
59
|
// File exists but couldn't be read/parsed - log warning
|
|
80
|
-
console.warn(
|
|
60
|
+
console.warn(`⚠️ Could not read stats for ${report.profileName}-${report.browser}:`, err);
|
|
81
61
|
}
|
|
82
62
|
});
|
|
83
63
|
// Sort reports by profile name, then browser
|
|
84
|
-
|
|
64
|
+
const sortedReports = [...reports].sort((a, b) => {
|
|
85
65
|
if (a.profileName !== b.profileName) {
|
|
86
66
|
return a.profileName.localeCompare(b.profileName);
|
|
87
67
|
}
|
|
88
68
|
return a.browser.localeCompare(b.browser);
|
|
89
69
|
});
|
|
90
70
|
// Prepare reports with computed fields for the template
|
|
91
|
-
|
|
71
|
+
const templateReports = sortedReports.map((report) => {
|
|
92
72
|
// Compute relative report path
|
|
93
|
-
|
|
73
|
+
let relativeReportPath = null;
|
|
94
74
|
if (report.reportPath && fs_1.default.existsSync(report.reportPath)) {
|
|
95
75
|
relativeReportPath = path_1.default.relative(outputDir, report.reportPath).replace(/\\/g, '/');
|
|
96
76
|
}
|
|
97
77
|
// Collect screenshots
|
|
98
|
-
|
|
99
|
-
|
|
78
|
+
const screenshots = [];
|
|
79
|
+
const comboScreenshotsDir = path_1.default.join(outputDir, `${report.profileName}-${report.browser}`, 'screenshots');
|
|
100
80
|
if (fs_1.default.existsSync(comboScreenshotsDir)) {
|
|
101
|
-
|
|
102
|
-
pngFiles.forEach(
|
|
103
|
-
|
|
81
|
+
const pngFiles = (0, collectPngFiles_1.default)(comboScreenshotsDir);
|
|
82
|
+
pngFiles.forEach((rel) => {
|
|
83
|
+
const href = path_1.default
|
|
104
84
|
.relative(outputDir, path_1.default.join(comboScreenshotsDir, rel))
|
|
105
85
|
.replace(/\\/g, '/');
|
|
106
|
-
screenshots.push({ href
|
|
86
|
+
screenshots.push({ href, name: rel });
|
|
107
87
|
});
|
|
108
88
|
}
|
|
109
|
-
return
|
|
89
|
+
return Object.assign(Object.assign({}, report), { relativeReportPath,
|
|
90
|
+
screenshots });
|
|
110
91
|
});
|
|
111
92
|
// Group by profile
|
|
112
|
-
|
|
113
|
-
templateReports.forEach(
|
|
93
|
+
const reportsByProfile = {};
|
|
94
|
+
templateReports.forEach((report) => {
|
|
114
95
|
if (!reportsByProfile[report.profileName]) {
|
|
115
96
|
reportsByProfile[report.profileName] = [];
|
|
116
97
|
}
|
|
117
98
|
reportsByProfile[report.profileName].push(report);
|
|
118
99
|
});
|
|
119
100
|
// Calculate summary stats
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
101
|
+
const totalRuns = reports.length;
|
|
102
|
+
const passedRuns = reports.filter((r) => { return r.success; }).length;
|
|
103
|
+
const failedRuns = reports.filter((r) => { return !r.success; }).length;
|
|
104
|
+
const profileCount = Object.keys(reportsByProfile).length;
|
|
124
105
|
// Load and render EJS template
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
hasCombinedReport
|
|
129
|
-
combinedTotalTests
|
|
130
|
-
combinedPassedTests
|
|
131
|
-
totalRuns
|
|
132
|
-
passedRuns
|
|
133
|
-
failedRuns
|
|
134
|
-
profileCount
|
|
135
|
-
reportsByProfile
|
|
106
|
+
const templatePath = path_1.default.join(__dirname, 'reportHomepage.ejs');
|
|
107
|
+
const templateFile = fs_1.default.readFileSync(templatePath, 'utf-8');
|
|
108
|
+
const html = ejs_1.default.render(templateFile, {
|
|
109
|
+
hasCombinedReport,
|
|
110
|
+
combinedTotalTests,
|
|
111
|
+
combinedPassedTests,
|
|
112
|
+
totalRuns,
|
|
113
|
+
passedRuns,
|
|
114
|
+
failedRuns,
|
|
115
|
+
profileCount,
|
|
116
|
+
reportsByProfile,
|
|
136
117
|
});
|
|
137
118
|
// Write the HTML file
|
|
138
119
|
fs_1.default.writeFileSync(homepagePath, html, 'utf-8');
|
|
139
|
-
console.log(
|
|
120
|
+
console.log(`\n📄 Report homepage generated: ${homepagePath}`);
|
|
140
121
|
};
|
|
141
122
|
exports.default = generateReportHomepage;
|
|
142
123
|
//# sourceMappingURL=generateReportHomepage.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generateReportHomepage.js","sourceRoot":"","sources":["../../../start/helpers/generateReportHomepage.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"generateReportHomepage.js","sourceRoot":"","sources":["../../../start/helpers/generateReportHomepage.ts"],"names":[],"mappings":";;;;;AAAA,+BAA+B;AAC/B,4CAAoB;AACpB,gDAAwB;AACxB,8CAAsB;AAEtB,iBAAiB;AACjB,wEAAgD;AAOhD;;;;;GAKG;AACH,MAAM,sBAAsB,GAAG,CAC7B,OAAqB,EACrB,SAAiB,EACX,EAAE;IACR,MAAM,YAAY,GAAG,cAAI,CAAC,IAAI,CAAC,SAAS,EAAE,YAAY,CAAC,CAAC;IACxD,MAAM,kBAAkB,GAAG,cAAI,CAAC,IAAI,CAAC,SAAS,EAAE,eAAe,CAAC,CAAC;IACjE,MAAM,gBAAgB,GAAG,cAAI,CAAC,IAAI,CAAC,SAAS,EAAE,sBAAsB,CAAC,CAAC;IAEtE,MAAM,iBAAiB,GAAG,YAAE,CAAC,UAAU,CAAC,kBAAkB,CAAC,CAAC;IAE5D,uDAAuD;IACvD,IAAI,kBAAkB,GAAkB,IAAI,CAAC;IAC7C,IAAI,mBAAmB,GAAkB,IAAI,CAAC;IAC9C,IAAI,YAAE,CAAC,UAAU,CAAC,gBAAgB,CAAC,EAAE,CAAC;QACpC,IAAI,CAAC;YACH,MAAM,GAAG,GAAG,YAAE,CAAC,YAAY,CAAC,gBAAgB,EAAE,OAAO,CAAC,C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AO,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC;IACxE,MAAM,YAAY,GAAG,MAAM,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC,MAAM,CAAC;IAE1D,+BAA+B;IAC/B,MAAM,YAAY,GAAG,cAAI,CAAC,IAAI,CAAC,SAAS,EAAE,oBAAoB,CAAC,CAAC;IAChE,MAAM,YAAY,GAAG,YAAE,CAAC,YAAY,CAAC,YAAY,EAAE,OAAO,CAAC,CAAC;IAC5D,MAAM,IAAI,GAAG,aAAG,CAAC,MAAM,CAAC,YAAY,EAAE;QACpC,iBAAiB;QACjB,kBAAkB;QAClB,mBAAmB;QACnB,SAAS;QACT,UAAU;QACV,UAAU;QACV,YAAY;QACZ,gBAAgB;KACjB,CAAC,CAAC;IAEH,sBAAsB;IACtB,YAAE,CAAC,aAAa,CAAC,YAAY,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC;IAC9C,OAAO,CAAC,GAAG,CAAC,mCAAmC,YAAY,EAAE,CAAC,CAAC;AACjE,CAAC,CAAC;AAEF,kBAAe,sBAAsB,CAAC"}
|
|
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
|
|
6
|
+
const path_1 = __importDefault(require("path"));
|
|
7
7
|
/**
|
|
8
8
|
* Generate inline reporter configuration for cypress-multi-reporters
|
|
9
9
|
* that produces granular mochawesome JSON per spec
|
|
@@ -14,9 +14,9 @@ var path_1 = __importDefault(require("path"));
|
|
|
14
14
|
* @param opts.browserName - Browser name
|
|
15
15
|
* @returns Reporter config object
|
|
16
16
|
*/
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
17
|
+
const generateReporterConfig = (opts) => {
|
|
18
|
+
const { resultsDir, profileName, browserName } = opts;
|
|
19
|
+
const granularResultsDir = path_1.default.join(resultsDir, `${profileName}-${browserName}`, 'granular-results');
|
|
20
20
|
return {
|
|
21
21
|
reporterEnabled: 'mochawesome',
|
|
22
22
|
mochawesomeReporterOptions: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generateReporterConfig.js","sourceRoot":"","sources":["../../../start/helpers/generateReporterConfig.ts"],"names":[],"mappings":";;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"generateReporterConfig.js","sourceRoot":"","sources":["../../../start/helpers/generateReporterConfig.ts"],"names":[],"mappings":";;;;;AAAA,gDAAwB;AAGxB;;;;;;;;;GASG;AACH,MAAM,sBAAsB,GAAG,CAAC,IAI/B,EAA6B,EAAE;IAC9B,MAAM,EAAE,UAAU,EAAE,WAAW,EAAE,WAAW,EAAE,GAAG,IAAI,CAAC;IAEtD,MAAM,kBAAkB,GAAG,cAAI,CAAC,IAAI,CAClC,UAAU,EACV,GAAG,WAAW,IAAI,WAAW,EAAE,EAC/B,kBAAkB,CACnB,CAAC;IAEF,OAAO;QACL,eAAe,EAAE,aAAa;QAC9B,0BAA0B,EAAE;YAC1B,SAAS,EAAE,kBAAkB;YAC7B,cAAc,EAAE,aAAa;YAC7B,SAAS,EAAE,KAAK;YAChB,IAAI,EAAE,KAAK;YACX,IAAI,EAAE,IAAI;SACX;KACF,CAAC;AACJ,CAAC,CAAC;AAEF,kBAAe,sBAAsB,CAAC"}
|
|
@@ -3,35 +3,35 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
const path_1 = __importDefault(require("path"));
|
|
7
|
+
const getRootPath_1 = __importDefault(require("./getRootPath"));
|
|
8
8
|
/**
|
|
9
9
|
* Get a date-labeled directory path for results using Eastern Time
|
|
10
10
|
* @author Yuen Ler Chow
|
|
11
11
|
* @returns path to date-labeled directory (e.g., cypress-results/2024-1-15_3-05pm)
|
|
12
12
|
*/
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
const getDateLabeledDir = () => {
|
|
14
|
+
const root = (0, getRootPath_1.default)();
|
|
15
|
+
const now = new Date();
|
|
16
16
|
// Format date in Eastern Time
|
|
17
|
-
|
|
17
|
+
const str = now.toLocaleString('en-US', // Using US encoding (it's the only one installed on containers)
|
|
18
18
|
{ timeZone: 'America/New_York' });
|
|
19
19
|
// Parse the string for the date/time info
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
20
|
+
const [dateStr, timeStr] = str.split(', '); // Format: MM/DD/YYYY, HH:MM:SS AM
|
|
21
|
+
const [monthStr, dayStr, yearStr] = dateStr.split('/'); // Format: MM/DD/YYYY
|
|
22
|
+
const [hourStr, minStr, ending] = timeStr.split(':'); // Format: HH:MM:SS AM
|
|
23
23
|
// Create all time numbers
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
24
|
+
const year = Number.parseInt(yearStr, 10);
|
|
25
|
+
const month = Number.parseInt(monthStr, 10);
|
|
26
|
+
const day = Number.parseInt(dayStr, 10);
|
|
27
|
+
const minute = Number.parseInt(minStr, 10);
|
|
28
|
+
const hour12 = Number.parseInt(hourStr, 10);
|
|
29
29
|
// Determine AM/PM
|
|
30
|
-
|
|
30
|
+
const isAM = ending.toLowerCase().includes('am');
|
|
31
31
|
// Pad minute with leading zero if needed
|
|
32
|
-
|
|
32
|
+
const minutePadded = minute.toString().padStart(2, '0');
|
|
33
33
|
// Build formatted date string: YYYY-M-D_H-MMam/pm (no spaces for shell compatibility)
|
|
34
|
-
|
|
34
|
+
const formattedDate = `${year}-${month}-${day}_${hour12}-${minutePadded}${isAM ? 'am' : 'pm'}`;
|
|
35
35
|
return path_1.default.join(root, 'cypress-results', formattedDate);
|
|
36
36
|
};
|
|
37
37
|
exports.default = getDateLabeledDir;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getDateLabeledDir.js","sourceRoot":"","sources":["../../../start/helpers/getDateLabeledDir.ts"],"names":[],"mappings":";;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"getDateLabeledDir.js","sourceRoot":"","sources":["../../../start/helpers/getDateLabeledDir.ts"],"names":[],"mappings":";;;;;AAAA,gDAAwB;AACxB,gEAAwC;AAExC;;;;GAIG;AACH,MAAM,iBAAiB,GAAG,GAAW,EAAE;IACrC,MAAM,IAAI,GAAG,IAAA,qBAAW,GAAE,CAAC;IAC3B,MAAM,GAAG,GAAG,IAAI,IAAI,EAAE,CAAC;IAEvB,8BAA8B;IAC9B,MAAM,GAAG,GAAG,GAAG,CAAC,cAAc,CAC5B,OAAO,EAAE,gEAAgE;IACzE,EAAE,QAAQ,EAAE,kBAAkB,EAAE,CACjC,CAAC;IAEF,0CAA0C;IAC1C,MAAM,CAAC,OAAO,EAAE,OAAO,CAAC,GAAG,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,kCAAkC;IAC9E,MAAM,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,CAAC,GAAG,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,qBAAqB;IAC7E,MAAM,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,CAAC,GAAG,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,sBAAsB;IAE5E,0BAA0B;IAC1B,MAAM,IAAI,GAAG,MAAM,CAAC,QAAQ,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC;IAC1C,MAAM,KAAK,GAAG,MAAM,CAAC,QAAQ,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC;IAC5C,MAAM,GAAG,GAAG,MAAM,CAAC,QAAQ,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;IACxC,MAAM,MAAM,GAAG,MAAM,CAAC,QAAQ,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;IAC3C,MAAM,MAAM,GAAG,MAAM,CAAC,QAAQ,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC;IAE5C,kBAAkB;IAClB,MAAM,IAAI,GAAG,MAAM,CAAC,WAAW,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;IAEjD,yCAAyC;IACzC,MAAM,YAAY,GAAG,MAAM,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;IAExD,sFAAsF;IACtF,MAAM,aAAa,GAAG,GAAG,IAAI,IAAI,KAAK,IAAI,GAAG,IAAI,MAAM,IAAI,YAAY,GAAG,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;IAE/F,OAAO,cAAI,CAAC,IAAI,CAAC,IAAI,EAAE,iBAAiB,EAAE,aAAa,CAAC,CAAC;AAC3D,CAAC,CAAC;AAEF,kBAAe,iBAAiB,CAAC"}
|
|
@@ -3,14 +3,14 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
|
|
6
|
+
const path_1 = __importDefault(require("path"));
|
|
7
7
|
/**
|
|
8
8
|
* Get the root path of the project
|
|
9
9
|
* @author Yuen Ler Chow
|
|
10
10
|
* @returns the root path of the project
|
|
11
11
|
*/
|
|
12
|
-
|
|
13
|
-
|
|
12
|
+
const getRootPath = () => {
|
|
13
|
+
const root = path_1.default.join(__dirname, '../../../../');
|
|
14
14
|
return root;
|
|
15
15
|
};
|
|
16
16
|
exports.default = getRootPath;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getRootPath.js","sourceRoot":"","sources":["../../../start/helpers/getRootPath.ts"],"names":[],"mappings":";;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"getRootPath.js","sourceRoot":"","sources":["../../../start/helpers/getRootPath.ts"],"names":[],"mappings":";;;;;AAAA,gDAAwB;AAExB;;;;GAIG;AACH,MAAM,WAAW,GAAG,GAAG,EAAE;IACvB,MAAM,IAAI,GAAG,cAAI,CAAC,IAAI,CAAC,SAAS,EAAE,cAAc,CAAC,CAAC;IAClD,OAAO,IAAI,CAAC;AACd,CAAC,CAAC;AAEF,kBAAe,WAAW,CAAC"}
|