kryptheon 0.1.36 → 0.1.37
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/bin/kryptheon.js +60 -1
- package/package.json +2 -2
package/bin/kryptheon.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
1
|
+
#!/usr/bin/env node
|
|
2
2
|
// The kryptheon CLI. A thin wrapper so nobody has to remember Playwright's
|
|
3
3
|
// command line or edit a config file. Everything here shells out to the
|
|
4
4
|
// Playwright binary that ships with this package.
|
|
@@ -2563,9 +2563,68 @@ function dashboardAlreadyRunning(port) {
|
|
|
2563
2563
|
});
|
|
2564
2564
|
}
|
|
2565
2565
|
|
|
2566
|
+
/**
|
|
2567
|
+
* The dashboard, started from the home folder: kept in a kryptheon-tests
|
|
2568
|
+
* folder there, the one record already uses - set up the first time, asked
|
|
2569
|
+
* once, and simply opened every time after.
|
|
2570
|
+
*
|
|
2571
|
+
* Found when the first person paid: the site's Kryptheon.cmd download was
|
|
2572
|
+
* flagged as dangerous by the browser and by Windows, and would not open
|
|
2573
|
+
* once saved. Its replacement is Win+R and one pasted line - and Win+R starts
|
|
2574
|
+
* in the home folder, where dashboard used to refuse to run at all.
|
|
2575
|
+
*/
|
|
2576
|
+
async function dashboardFromHome(plan) {
|
|
2577
|
+
const ready = project.hasPackageJson(plan.into) && project.kryptheonInstalledIn(plan.into);
|
|
2578
|
+
if (!ready) {
|
|
2579
|
+
console.log('');
|
|
2580
|
+
console.log(' Kryptheon keeps your recordings and results in a folder of their own:');
|
|
2581
|
+
console.log('');
|
|
2582
|
+
console.log(' ' + plan.into);
|
|
2583
|
+
console.log('');
|
|
2584
|
+
console.log(' The first time, I make it and install kryptheon in it (about 20MB).');
|
|
2585
|
+
console.log(' Nothing else on this computer is touched.');
|
|
2586
|
+
console.log('');
|
|
2587
|
+
const question = project.setupQuestion(plan);
|
|
2588
|
+
const yes = process.stdin.isTTY
|
|
2589
|
+
? project.answeredYes(await askLine(question.text), question.yesByDefault)
|
|
2590
|
+
: question.yesByDefault;
|
|
2591
|
+
if (!yes) {
|
|
2592
|
+
console.log('');
|
|
2593
|
+
console.log(' Nothing was changed. To keep them beside your app instead, open a');
|
|
2594
|
+
console.log(' terminal in its folder and run: npx kryptheon@latest dashboard');
|
|
2595
|
+
console.log('');
|
|
2596
|
+
return 1;
|
|
2597
|
+
}
|
|
2598
|
+
try {
|
|
2599
|
+
fs.mkdirSync(plan.into, { recursive: true });
|
|
2600
|
+
} catch (err) {
|
|
2601
|
+
console.error('');
|
|
2602
|
+
console.error(' Could not make the folder: ' + plan.into);
|
|
2603
|
+
console.error('');
|
|
2604
|
+
return 1;
|
|
2605
|
+
}
|
|
2606
|
+
if (!makeReady(plan.into)) return 1;
|
|
2607
|
+
}
|
|
2608
|
+
// Run again from inside that folder, as record does: every path in this
|
|
2609
|
+
// file is worked out once, from the folder the command started in.
|
|
2610
|
+
const child = spawn(process.execPath, [__filename, 'dashboard'], { cwd: plan.into, stdio: 'inherit' });
|
|
2611
|
+
const wait = () => {};
|
|
2612
|
+
process.on('SIGINT', wait);
|
|
2613
|
+
process.on('SIGTERM', wait);
|
|
2614
|
+
const code = await new Promise((resolve) => {
|
|
2615
|
+
child.on('error', () => resolve(1));
|
|
2616
|
+
child.on('close', (status) => resolve(status === null ? 1 : status));
|
|
2617
|
+
});
|
|
2618
|
+
process.removeListener('SIGINT', wait);
|
|
2619
|
+
process.removeListener('SIGTERM', wait);
|
|
2620
|
+
return code;
|
|
2621
|
+
}
|
|
2622
|
+
|
|
2566
2623
|
async function dashboardCommand() {
|
|
2567
2624
|
const here = project.inspectProject(USER_DIR);
|
|
2568
2625
|
if (!here.ok) {
|
|
2626
|
+
const plan = project.setupPlan(USER_DIR);
|
|
2627
|
+
if (plan.action === 'home') return await dashboardFromHome(plan);
|
|
2569
2628
|
for (const line of project.noProjectLines(here)) console.error(line);
|
|
2570
2629
|
return 1;
|
|
2571
2630
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "kryptheon",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.37",
|
|
4
4
|
"description": "Record what you do in your app and get plain-language reports when it breaks.",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE",
|
|
6
6
|
"type": "commonjs",
|
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
"@playwright/test": "^1.62.1"
|
|
53
53
|
},
|
|
54
54
|
"scripts": {
|
|
55
|
-
"check": "node kryptheon-store.check.js && node kryptheon-code.check.js && node kryptheon-constdata.check.js && node kryptheon-accept.check.js && node kryptheon-keys.check.js && node kryptheon-dashboard.check.js && node kryptheon-autostart.check.js && node kryptheon-changes.check.js && node kryptheon-look.check.js && node kryptheon-verify.check.js && node kryptheon-recheck.check.js && node kryptheon-reporter.check.js && node kryptheon-signature.check.js && node kryptheon-signature.stream.check.js && node kryptheon-signature.baseline.check.js && node kryptheon-signature.settle.check.js && node kryptheon-signature.number.check.js && node kryptheon-env.check.js && node kryptheon-watchdog.check.js && node kryptheon-phone.check.js && node kryptheon-record.check.js && node kryptheon-selectors.check.js && node kryptheon-recordings.check.js && node kryptheon-cleanup.check.js && node kryptheon-orphan.check.js && node kryptheon-project.check.js && node kryptheon-setup.check.js && node kryptheon-browser.check.js && node kryptheon-heal.check.js && node kryptheon-load.check.js && node kryptheon-package.check.js",
|
|
55
|
+
"check": "node kryptheon-store.check.js && node kryptheon-code.check.js && node kryptheon-constdata.check.js && node kryptheon-accept.check.js && node kryptheon-keys.check.js && node kryptheon-dashboard.check.js && node kryptheon-autostart.check.js && node kryptheon-changes.check.js && node kryptheon-look.check.js && node kryptheon-verify.check.js && node kryptheon-recheck.check.js && node kryptheon-reporter.check.js && node kryptheon-signature.check.js && node kryptheon-signature.stream.check.js && node kryptheon-signature.baseline.check.js && node kryptheon-signature.settle.check.js && node kryptheon-signature.number.check.js && node kryptheon-env.check.js && node kryptheon-watchdog.check.js && node kryptheon-phone.check.js && node kryptheon-homedash.check.js && node kryptheon-record.check.js && node kryptheon-selectors.check.js && node kryptheon-recordings.check.js && node kryptheon-cleanup.check.js && node kryptheon-orphan.check.js && node kryptheon-project.check.js && node kryptheon-setup.check.js && node kryptheon-browser.check.js && node kryptheon-heal.check.js && node kryptheon-load.check.js && node kryptheon-package.check.js",
|
|
56
56
|
"check:store": "node kryptheon-store.check.js",
|
|
57
57
|
"check:code": "node kryptheon-code.check.js",
|
|
58
58
|
"check:constdata": "node kryptheon-constdata.check.js",
|