dceky 1.0.5-beta.ky-declarations.9 → 1.0.5-beta.ky-declarations.11
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/preinstall/helpers/getRootPath.d.ts +7 -0
- package/lib/preinstall/helpers/getRootPath.js +17 -0
- package/lib/preinstall/helpers/getRootPath.js.map +1 -0
- package/lib/preinstall/index.d.ts +5 -0
- package/lib/preinstall/index.js +28 -0
- package/lib/preinstall/index.js.map +1 -0
- package/lib/setup/genDynamicConfigFile.js +5 -0
- package/lib/setup/genDynamicConfigFile.js.map +1 -1
- package/lib/setup/index.js +1 -1
- package/lib/setup/index.js.map +1 -1
- package/package.json +2 -1
- package/preinstall/helpers/getRootPath.ts +13 -0
- package/preinstall/index.ts +26 -0
- package/setup/genDynamicConfigFile.ts +6 -0
- package/setup/index.ts +1 -1
- package/tsconfig.json +7 -1
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
var path_1 = __importDefault(require("path"));
|
|
7
|
+
/**
|
|
8
|
+
* Get the root path of the project
|
|
9
|
+
* @author Yuen Ler Chow
|
|
10
|
+
* @returns the root path of the project
|
|
11
|
+
*/
|
|
12
|
+
var getRootPath = function () {
|
|
13
|
+
var root = path_1.default.join(__dirname, '../../../../');
|
|
14
|
+
return root;
|
|
15
|
+
};
|
|
16
|
+
exports.default = getRootPath;
|
|
17
|
+
//# sourceMappingURL=getRootPath.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getRootPath.js","sourceRoot":"","sources":["../../../preinstall/helpers/getRootPath.ts"],"names":[],"mappings":";;;;;AAAA,8CAAwB;AAExB;;;;GAIG;AACH,IAAM,WAAW,GAAG;IAClB,IAAM,IAAI,GAAG,cAAI,CAAC,IAAI,CAAC,SAAS,EAAE,cAAc,CAAC,CAAC;IAClD,OAAO,IAAI,CAAC;AACd,CAAC,CAAC;AAEF,kBAAe,WAAW,CAAC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/* eslint-disable no-console */
|
|
3
|
+
/**
|
|
4
|
+
* Make sure cypress folder is created
|
|
5
|
+
* @author Gabe Abrams
|
|
6
|
+
*/
|
|
7
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
8
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
9
|
+
};
|
|
10
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
11
|
+
// Import libs
|
|
12
|
+
var fs_1 = __importDefault(require("fs"));
|
|
13
|
+
var path_1 = __importDefault(require("path"));
|
|
14
|
+
// Import helpers
|
|
15
|
+
var getRootPath_1 = __importDefault(require("./helpers/getRootPath"));
|
|
16
|
+
// Get the project directory
|
|
17
|
+
var root = (0, getRootPath_1.default)();
|
|
18
|
+
// Check for cypress folder
|
|
19
|
+
var cypressDir = path_1.default.join(root, 'cypress');
|
|
20
|
+
var cypressExists = fs_1.default.existsSync(cypressDir);
|
|
21
|
+
if (!cypressExists) {
|
|
22
|
+
console.log('Install cypress before installing dceky:');
|
|
23
|
+
console.log('1. Run "npm i cypress --save-dev"');
|
|
24
|
+
console.log('2. Run "npx cypress open" and follow configuration instructions');
|
|
25
|
+
console.log('3. Run "npm i dceky --save-dev');
|
|
26
|
+
process.exit(1);
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../preinstall/index.ts"],"names":[],"mappings":";AAAA,+BAA+B;AAC/B;;;GAGG;;;;;AAEH,cAAc;AACd,0CAAoB;AACpB,8CAAwB;AAExB,iBAAiB;AACjB,sEAAgD;AAEhD,4BAA4B;AAC5B,IAAM,IAAI,GAAG,IAAA,qBAAW,GAAE,CAAC;AAE3B,2BAA2B;AAC3B,IAAM,UAAU,GAAG,cAAI,CAAC,IAAI,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC;AAC9C,IAAM,aAAa,GAAG,YAAE,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC;AAChD,IAAI,CAAC,aAAa,EAAE,CAAC;IACnB,OAAO,CAAC,GAAG,CAAC,0CAA0C,CAAC,CAAC;IACxD,OAAO,CAAC,GAAG,CAAC,mCAAmC,CAAC,CAAC;IACjD,OAAO,CAAC,GAAG,CAAC,iEAAiE,CAAC,CAAC;IAC/E,OAAO,CAAC,GAAG,CAAC,gCAAgC,CAAC,CAAC;IAC9C,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC"}
|
|
@@ -11,6 +11,11 @@ var getRootPath_1 = __importDefault(require("./helpers/getRootPath"));
|
|
|
11
11
|
*/
|
|
12
12
|
var genDynamicConfigFile = function () {
|
|
13
13
|
var root = (0, getRootPath_1.default)();
|
|
14
|
+
// Delete .js version of the config file if it exists
|
|
15
|
+
var jsConfigPath = path_1.default.join(root, 'cypress.config.js');
|
|
16
|
+
if (fs_1.default.existsSync(jsConfigPath)) {
|
|
17
|
+
fs_1.default.unlinkSync(jsConfigPath);
|
|
18
|
+
}
|
|
14
19
|
var outputFile = path_1.default.join(root, 'cypress.config.ts');
|
|
15
20
|
// Create the dynamic configuration file
|
|
16
21
|
var dynamicConfigFile = [
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"genDynamicConfigFile.js","sourceRoot":"","sources":["../../setup/genDynamicConfigFile.ts"],"names":[],"mappings":";;;;;AAAA,0CAAoB;AACpB,8CAAwB;AACxB,sEAAgD;AAEhD;;GAEG;AACH,IAAM,oBAAoB,GAAG;IAC3B,IAAM,IAAI,GAAG,IAAA,qBAAW,GAAE,CAAC;IAE3B,IAAM,UAAU,GAAG,cAAI,CAAC,IAAI,CAAC,IAAI,EAAE,mBAAmB,CAAC,CAAC;IAExD,wCAAwC;IACxC,IAAM,iBAAiB,GAAG;QACxB,mDAAmD;QACnD,EAAE;QACF,kEAAkE;QAClE,EAAE;QACF,oCAAoC;QACpC,EAAE;KACH,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAEb,wCAAwC;IACxC,YAAE,CAAC,aAAa,CAAC,UAAU,EAAE,iBAAiB,EAAE,MAAM,CAAC,CAAC;IAExD,OAAO,UAAU,CAAC;AACpB,CAAC,CAAC;AAEF,kBAAe,oBAAoB,CAAC"}
|
|
1
|
+
{"version":3,"file":"genDynamicConfigFile.js","sourceRoot":"","sources":["../../setup/genDynamicConfigFile.ts"],"names":[],"mappings":";;;;;AAAA,0CAAoB;AACpB,8CAAwB;AACxB,sEAAgD;AAEhD;;GAEG;AACH,IAAM,oBAAoB,GAAG;IAC3B,IAAM,IAAI,GAAG,IAAA,qBAAW,GAAE,CAAC;IAE3B,qDAAqD;IACrD,IAAM,YAAY,GAAG,cAAI,CAAC,IAAI,CAAC,IAAI,EAAE,mBAAmB,CAAC,CAAC;IAC1D,IAAI,YAAE,CAAC,UAAU,CAAC,YAAY,CAAC,EAAE,CAAC;QAChC,YAAE,CAAC,UAAU,CAAC,YAAY,CAAC,CAAC;IAC9B,CAAC;IAED,IAAM,UAAU,GAAG,cAAI,CAAC,IAAI,CAAC,IAAI,EAAE,mBAAmB,CAAC,CAAC;IAExD,wCAAwC;IACxC,IAAM,iBAAiB,GAAG;QACxB,mDAAmD;QACnD,EAAE;QACF,kEAAkE;QAClE,EAAE;QACF,oCAAoC;QACpC,EAAE;KACH,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAEb,wCAAwC;IACxC,YAAE,CAAC,aAAa,CAAC,UAAU,EAAE,iBAAiB,EAAE,MAAM,CAAC,CAAC;IAExD,OAAO,UAAU,CAAC;AACpB,CAAC,CAAC;AAEF,kBAAe,oBAAoB,CAAC"}
|
package/lib/setup/index.js
CHANGED
|
@@ -10,11 +10,11 @@ var setupCypressDependencies_1 = __importDefault(require("./setupCypressDependen
|
|
|
10
10
|
var checkRequiredFiles_1 = __importDefault(require("./checkRequiredFiles"));
|
|
11
11
|
var genE2ELaunchFile_1 = __importDefault(require("./genE2ELaunchFile"));
|
|
12
12
|
var genKyCommandDeclarations_1 = __importDefault(require("./genKyCommandDeclarations"));
|
|
13
|
+
(0, setupCypressDependencies_1.default)();
|
|
13
14
|
(0, checkRequiredFiles_1.default)();
|
|
14
15
|
(0, genCommandImportFile_1.default)();
|
|
15
16
|
(0, genDynamicConfigFile_1.default)();
|
|
16
17
|
(0, addToGitIgnore_1.default)();
|
|
17
|
-
(0, setupCypressDependencies_1.default)();
|
|
18
18
|
(0, genE2ELaunchFile_1.default)();
|
|
19
19
|
(0, genKyCommandDeclarations_1.default)();
|
|
20
20
|
//# sourceMappingURL=index.js.map
|
package/lib/setup/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../setup/index.ts"],"names":[],"mappings":";;;;;AAAA,gFAA0D;AAC1D,gFAA0D;AAC1D,oEAA8C;AAC9C,wFAAkE;AAClE,4EAAsD;AACtD,wEAAkD;AAClD,wFAAkE;AAElE,IAAA,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../setup/index.ts"],"names":[],"mappings":";;;;;AAAA,gFAA0D;AAC1D,gFAA0D;AAC1D,oEAA8C;AAC9C,wFAAkE;AAClE,4EAAsD;AACtD,wEAAkD;AAClD,wFAAkE;AAElE,IAAA,kCAAwB,GAAE,CAAC;AAC3B,IAAA,4BAAkB,GAAE,CAAC;AACrB,IAAA,8BAAoB,GAAE,CAAC;AACvB,IAAA,8BAAoB,GAAE,CAAC;AACvB,IAAA,wBAAc,GAAE,CAAC;AACjB,IAAA,0BAAgB,GAAE,CAAC;AACnB,IAAA,kCAAwB,GAAE,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dceky",
|
|
3
|
-
"version": "1.0.5-beta.ky-declarations.
|
|
3
|
+
"version": "1.0.5-beta.ky-declarations.11",
|
|
4
4
|
"description": "Cypress toolkit for Harvard DCE",
|
|
5
5
|
"main": "./lib/src/index.js",
|
|
6
6
|
"types": "./lib/src/index.d.ts",
|
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
"ky:start": "npx tsx ./start/index.ts",
|
|
10
10
|
"ky:setup": "npx tsx ./setup/index.ts",
|
|
11
11
|
"ky:dev": "npm run ky:setup && npm run ky:start",
|
|
12
|
+
"preinstall": "npx tsx ./preinstall/index.ts",
|
|
12
13
|
"postinstall": "npx tsx ./postinstall/index.ts"
|
|
13
14
|
},
|
|
14
15
|
"repository": {
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import path from 'path';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Get the root path of the project
|
|
5
|
+
* @author Yuen Ler Chow
|
|
6
|
+
* @returns the root path of the project
|
|
7
|
+
*/
|
|
8
|
+
const getRootPath = () => {
|
|
9
|
+
const root = path.join(__dirname, '../../../../');
|
|
10
|
+
return root;
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export default getRootPath;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/* eslint-disable no-console */
|
|
2
|
+
/**
|
|
3
|
+
* Make sure cypress folder is created
|
|
4
|
+
* @author Gabe Abrams
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
// Import libs
|
|
8
|
+
import fs from 'fs';
|
|
9
|
+
import path from 'path';
|
|
10
|
+
|
|
11
|
+
// Import helpers
|
|
12
|
+
import getRootPath from './helpers/getRootPath';
|
|
13
|
+
|
|
14
|
+
// Get the project directory
|
|
15
|
+
const root = getRootPath();
|
|
16
|
+
|
|
17
|
+
// Check for cypress folder
|
|
18
|
+
const cypressDir = path.join(root, 'cypress');
|
|
19
|
+
const cypressExists = fs.existsSync(cypressDir);
|
|
20
|
+
if (!cypressExists) {
|
|
21
|
+
console.log('Install cypress before installing dceky:');
|
|
22
|
+
console.log('1. Run "npm i cypress --save-dev"');
|
|
23
|
+
console.log('2. Run "npx cypress open" and follow configuration instructions');
|
|
24
|
+
console.log('3. Run "npm i dceky --save-dev');
|
|
25
|
+
process.exit(1);
|
|
26
|
+
}
|
|
@@ -8,6 +8,12 @@ import getRootPath from './helpers/getRootPath';
|
|
|
8
8
|
const genDynamicConfigFile = (): string => {
|
|
9
9
|
const root = getRootPath();
|
|
10
10
|
|
|
11
|
+
// Delete .js version of the config file if it exists
|
|
12
|
+
const jsConfigPath = path.join(root, 'cypress.config.js');
|
|
13
|
+
if (fs.existsSync(jsConfigPath)) {
|
|
14
|
+
fs.unlinkSync(jsConfigPath);
|
|
15
|
+
}
|
|
16
|
+
|
|
11
17
|
const outputFile = path.join(root, 'cypress.config.ts');
|
|
12
18
|
|
|
13
19
|
// Create the dynamic configuration file
|
package/setup/index.ts
CHANGED
|
@@ -6,10 +6,10 @@ import checkRequiredFiles from './checkRequiredFiles';
|
|
|
6
6
|
import genE2ELaunchFile from './genE2ELaunchFile';
|
|
7
7
|
import genKyCommandDeclarations from './genKyCommandDeclarations';
|
|
8
8
|
|
|
9
|
+
setupCypressDependencies();
|
|
9
10
|
checkRequiredFiles();
|
|
10
11
|
genCommandImportFile();
|
|
11
12
|
genDynamicConfigFile();
|
|
12
13
|
addToGitIgnore();
|
|
13
|
-
setupCypressDependencies();
|
|
14
14
|
genE2ELaunchFile();
|
|
15
15
|
genKyCommandDeclarations();
|
package/tsconfig.json
CHANGED
|
@@ -11,7 +11,13 @@
|
|
|
11
11
|
"lib": ["es5", "es2015.promise", "es2017.object", "dom"],
|
|
12
12
|
"outDir": "./lib"
|
|
13
13
|
},
|
|
14
|
-
"include": [
|
|
14
|
+
"include": [
|
|
15
|
+
"./src",
|
|
16
|
+
"setup",
|
|
17
|
+
"start",
|
|
18
|
+
"preinstall",
|
|
19
|
+
"postinstall"
|
|
20
|
+
],
|
|
15
21
|
"ts-node": {
|
|
16
22
|
"files": true
|
|
17
23
|
}
|