cypress-validate 1.0.0

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.
@@ -0,0 +1,46 @@
1
+ 'use strict';
2
+
3
+ const path = require('path');
4
+ const fs = require('fs');
5
+
6
+ /**
7
+ * Finds the Cypress config file in the current working directory or ancestors.
8
+ * Supports: cypress.config.js, cypress.config.ts, cypress.config.mjs, cypress.config.cjs
9
+ */
10
+ function findCypressConfig(startDir = process.cwd()) {
11
+ const configNames = [
12
+ 'cypress.config.js',
13
+ 'cypress.config.ts',
14
+ 'cypress.config.mjs',
15
+ 'cypress.config.cjs',
16
+ ];
17
+
18
+ let dir = startDir;
19
+ while (true) {
20
+ for (const name of configNames) {
21
+ const full = path.join(dir, name);
22
+ if (fs.existsSync(full)) return full;
23
+ }
24
+ const parent = path.dirname(dir);
25
+ if (parent === dir) break; // reached filesystem root
26
+ dir = parent;
27
+ }
28
+ return null;
29
+ }
30
+
31
+ /**
32
+ * Returns the directory containing the Cypress config.
33
+ */
34
+ function findProjectRoot() {
35
+ const config = findCypressConfig();
36
+ return config ? path.dirname(config) : process.cwd();
37
+ }
38
+
39
+ /**
40
+ * Returns the path to the last-run results JSON (written after each run).
41
+ */
42
+ function lastRunResultsPath(projectRoot = findProjectRoot()) {
43
+ return path.join(projectRoot, '.cypress-validate', 'last-run.json');
44
+ }
45
+
46
+ module.exports = { findCypressConfig, findProjectRoot, lastRunResultsPath };
@@ -0,0 +1,31 @@
1
+ 'use strict';
2
+
3
+ const chalk = require('chalk');
4
+ const ora = require('ora');
5
+
6
+ /**
7
+ * Creates a spinner instance with consistent styling
8
+ */
9
+ function createSpinner(text) {
10
+ return ora({
11
+ text,
12
+ color: 'cyan',
13
+ spinner: 'dots',
14
+ });
15
+ }
16
+
17
+ /**
18
+ * Log helpers with consistent formatting
19
+ */
20
+ const logger = {
21
+ info: (msg) => console.log(chalk.cyan(' ℹ ') + msg),
22
+ success: (msg) => console.log(chalk.green(' ✔ ') + msg),
23
+ warn: (msg) => console.log(chalk.yellow(' ⚠ ') + msg),
24
+ error: (msg) => console.log(chalk.red(' ✖ ') + msg),
25
+ step: (msg) => console.log(chalk.blue(' → ') + msg),
26
+ title: (msg) => console.log('\n' + chalk.bold.white(' ' + msg)),
27
+ divider: () => console.log(chalk.gray(' ' + '─'.repeat(50))),
28
+ blank: () => console.log(),
29
+ };
30
+
31
+ module.exports = { createSpinner, logger };
package/package.json ADDED
@@ -0,0 +1,65 @@
1
+ {
2
+ "name": "cypress-validate",
3
+ "version": "1.0.0",
4
+ "description": "A Playwright-style CLI for Cypress — run, open, generate, screenshot, report and more via npx cypress-validate",
5
+ "main": "lib/index.js",
6
+ "bin": {
7
+ "cypress-validate": "bin/cypress-validate.js"
8
+ },
9
+ "scripts": {
10
+ "start": "node bin/cypress-validate.js",
11
+ "test": "node bin/cypress-validate.js --help"
12
+ },
13
+ "keywords": [
14
+ "cypress",
15
+ "cli",
16
+ "playwright",
17
+ "testing",
18
+ "e2e",
19
+ "automation",
20
+ "validate",
21
+ "test-runner",
22
+ "cypress-plugin"
23
+ ],
24
+ "author": "cypress-validate contributors",
25
+ "license": "MIT",
26
+ "publishConfig": {
27
+ "access": "public"
28
+ },
29
+ "engines": {
30
+ "node": ">=14.0.0"
31
+ },
32
+ "dependencies": {
33
+ "chalk": "^4.1.2",
34
+ "commander": "^11.1.0",
35
+ "enquirer": "^2.4.1",
36
+ "execa": "^5.1.1",
37
+ "fs-extra": "^11.2.0",
38
+ "open": "^8.4.2",
39
+ "ora": "^5.4.1",
40
+ "serve": "^14.2.3"
41
+ },
42
+ "peerDependencies": {
43
+ "cypress": ">=10.0.0"
44
+ },
45
+ "peerDependenciesMeta": {
46
+ "cypress": {
47
+ "optional": true
48
+ }
49
+ },
50
+ "files": [
51
+ "bin/",
52
+ "lib/",
53
+ "templates/",
54
+ "README.md",
55
+ "LICENSE"
56
+ ],
57
+ "homepage": "https://github.com/mvsaran/cypress-validate#readme",
58
+ "repository": {
59
+ "type": "git",
60
+ "url": "https://github.com/mvsaran/cypress-validate.git"
61
+ },
62
+ "bugs": {
63
+ "url": "https://github.com/mvsaran/cypress-validate/issues"
64
+ }
65
+ }