dceky 1.0.5-beta.ky-declarations.10 → 1.0.5-beta.ky-declarations.12
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/postinstall/index.js +2 -6
- package/lib/postinstall/index.js.map +1 -1
- 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 +29 -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/package.json +1 -1
- package/postinstall/index.ts +2 -7
- package/preinstall/index.ts +4 -3
- package/setup/genDynamicConfigFile.ts +6 -0
- package/postinstall/helpers/exec.ts +0 -17
package/lib/postinstall/index.js
CHANGED
|
@@ -12,7 +12,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
12
12
|
var fs_1 = __importDefault(require("fs"));
|
|
13
13
|
var path_1 = __importDefault(require("path"));
|
|
14
14
|
// Import helpers
|
|
15
|
-
var exec_1 = __importDefault(require("./helpers/exec"));
|
|
16
15
|
var getRootPath_1 = __importDefault(require("./helpers/getRootPath"));
|
|
17
16
|
// Get the project directory
|
|
18
17
|
var root = (0, getRootPath_1.default)();
|
|
@@ -42,11 +41,6 @@ if (!pkgJson.scripts['ky:dev']) {
|
|
|
42
41
|
}
|
|
43
42
|
// Write back the modified package.json
|
|
44
43
|
fs_1.default.writeFileSync(path_1.default.join(root, 'package.json'), JSON.stringify(pkgJson, null, 2), 'utf8');
|
|
45
|
-
// Automatically set up
|
|
46
|
-
if (modified) {
|
|
47
|
-
console.log('\nRunning initial ky setup...');
|
|
48
|
-
(0, exec_1.default)("cd ".concat(root, " && npm run ky:setup"), true);
|
|
49
|
-
}
|
|
50
44
|
// Notify user
|
|
51
45
|
if (modified) {
|
|
52
46
|
console.log('\nAdded dceky scripts to package.json');
|
|
@@ -54,5 +48,7 @@ if (modified) {
|
|
|
54
48
|
console.log(' npm run ky:start # Start ky tests');
|
|
55
49
|
console.log(' npm run ky:setup # Setup or update ky-managed files in this project');
|
|
56
50
|
console.log(' npm run ky:dev # Start ky tests after ensuring set up');
|
|
51
|
+
console.log('');
|
|
52
|
+
console.log('We recommend running ky:setup right now');
|
|
57
53
|
}
|
|
58
54
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../postinstall/index.ts"],"names":[],"mappings":";AAAA,+BAA+B;AAC/B;;;GAGG;;;;;AAEH,cAAc;AACd,0CAAoB;AACpB,8CAAwB;AAExB,iBAAiB;AACjB,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../postinstall/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,6BAA6B;AAC7B,qEAAqE;AACrE,IAAM,OAAO,GAAG,OAAO,CAAC,cAAI,CAAC,IAAI,CAAC,IAAI,EAAE,cAAc,CAAC,CAAC,CAAC;AAEzD,8BAA8B;AAC9B,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE,CAAC;IACrB,OAAO,CAAC,OAAO,GAAG,EAAE,CAAC;AACvB,CAAC;AAED,uCAAuC;AACvC,IAAI,QAAQ,GAAG,KAAK,CAAC;AAErB,sBAAsB;AACtB,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,UAAU,CAAC,EAAE,CAAC;IACjC,OAAO,CAAC,OAAO,CAAC,UAAU,CAAC,GAAG,uCAAuC,CAAC;IACtE,QAAQ,GAAG,IAAI,CAAC;AAClB,CAAC;AAED,sBAAsB;AACtB,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,UAAU,CAAC,EAAE,CAAC;IACjC,OAAO,CAAC,OAAO,CAAC,UAAU,CAAC,GAAG,uCAAuC,CAAC;IACtE,QAAQ,GAAG,IAAI,CAAC;AAClB,CAAC;AAED,oBAAoB;AACpB,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,CAAC;IAC/B,OAAO,CAAC,OAAO,CAAC,QAAQ,CAAC,GAAG,qCAAqC,CAAC;IAClE,QAAQ,GAAG,IAAI,CAAC;AAClB,CAAC;AAED,uCAAuC;AACvC,YAAE,CAAC,aAAa,CACd,cAAI,CAAC,IAAI,CAAC,IAAI,EAAE,cAAc,CAAC,EAC/B,IAAI,CAAC,SAAS,CAAC,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC,EAChC,MAAM,CACP,CAAC;AAEF,cAAc;AACd,IAAI,QAAQ,EAAE,CAAC;IACb,OAAO,CAAC,GAAG,CAAC,uCAAuC,CAAC,CAAC;IACrD,OAAO,CAAC,GAAG,CAAC,kBAAkB,CAAC,CAAC;IAChC,OAAO,CAAC,GAAG,CAAC,uCAAuC,CAAC,CAAC;IACrD,OAAO,CAAC,GAAG,CAAC,yEAAyE,CAAC,CAAC;IACvF,OAAO,CAAC,GAAG,CAAC,6DAA6D,CAAC,CAAC;IAC3E,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IAChB,OAAO,CAAC,GAAG,CAAC,yCAAyC,CAAC,CAAC;AACzD,CAAC"}
|
|
@@ -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,29 @@
|
|
|
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 First (!)');
|
|
23
|
+
console.log('');
|
|
24
|
+
console.log('1. Run "npm i cypress --save-dev"');
|
|
25
|
+
console.log('2. Run "npx cypress open", choose E2E, configure, then close the app');
|
|
26
|
+
console.log('3. Run "npm i dceky --save-dev"');
|
|
27
|
+
process.exit(1);
|
|
28
|
+
}
|
|
29
|
+
//# 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,+BAA+B,CAAC,CAAC;IAC7C,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IAChB,OAAO,CAAC,GAAG,CAAC,mCAAmC,CAAC,CAAC;IACjD,OAAO,CAAC,GAAG,CAAC,sEAAsE,CAAC,CAAC;IACpF,OAAO,CAAC,GAAG,CAAC,iCAAiC,CAAC,CAAC;IAC/C,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/package.json
CHANGED
package/postinstall/index.ts
CHANGED
|
@@ -9,7 +9,6 @@ import fs from 'fs';
|
|
|
9
9
|
import path from 'path';
|
|
10
10
|
|
|
11
11
|
// Import helpers
|
|
12
|
-
import exec from './helpers/exec';
|
|
13
12
|
import getRootPath from './helpers/getRootPath';
|
|
14
13
|
|
|
15
14
|
// Get the project directory
|
|
@@ -52,12 +51,6 @@ fs.writeFileSync(
|
|
|
52
51
|
'utf8',
|
|
53
52
|
);
|
|
54
53
|
|
|
55
|
-
// Automatically set up
|
|
56
|
-
if (modified) {
|
|
57
|
-
console.log('\nRunning initial ky setup...');
|
|
58
|
-
exec(`cd ${root} && npm run ky:setup`, true);
|
|
59
|
-
}
|
|
60
|
-
|
|
61
54
|
// Notify user
|
|
62
55
|
if (modified) {
|
|
63
56
|
console.log('\nAdded dceky scripts to package.json');
|
|
@@ -65,4 +58,6 @@ if (modified) {
|
|
|
65
58
|
console.log(' npm run ky:start # Start ky tests');
|
|
66
59
|
console.log(' npm run ky:setup # Setup or update ky-managed files in this project');
|
|
67
60
|
console.log(' npm run ky:dev # Start ky tests after ensuring set up');
|
|
61
|
+
console.log('');
|
|
62
|
+
console.log('We recommend running ky:setup right now');
|
|
68
63
|
}
|
package/preinstall/index.ts
CHANGED
|
@@ -18,9 +18,10 @@ const root = getRootPath();
|
|
|
18
18
|
const cypressDir = path.join(root, 'cypress');
|
|
19
19
|
const cypressExists = fs.existsSync(cypressDir);
|
|
20
20
|
if (!cypressExists) {
|
|
21
|
-
console.log('Install
|
|
21
|
+
console.log('(!) Install Cypress First (!)');
|
|
22
|
+
console.log('');
|
|
22
23
|
console.log('1. Run "npm i cypress --save-dev"');
|
|
23
|
-
console.log('2. Run "npx cypress open"
|
|
24
|
-
console.log('3. Run "npm i dceky --save-dev');
|
|
24
|
+
console.log('2. Run "npx cypress open", choose E2E, configure, then close the app');
|
|
25
|
+
console.log('3. Run "npm i dceky --save-dev"');
|
|
25
26
|
process.exit(1);
|
|
26
27
|
}
|
|
@@ -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
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { execSync } from 'child_process';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Execute a command
|
|
5
|
-
* @author Gabe Abrams
|
|
6
|
-
* @param command the command to execute
|
|
7
|
-
* @param printToStdOut if true, print to standard out instead of returning
|
|
8
|
-
*/
|
|
9
|
-
const exec = (command: string, printToStdOut?: boolean): string => {
|
|
10
|
-
if (printToStdOut) {
|
|
11
|
-
execSync(command, { stdio: 'inherit' });
|
|
12
|
-
return '';
|
|
13
|
-
}
|
|
14
|
-
return execSync(command).toString();
|
|
15
|
-
};
|
|
16
|
-
|
|
17
|
-
export default exec;
|