regressify 1.0.14 → 1.0.16

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.
Files changed (2) hide show
  1. package/cli.js +2 -26
  2. package/package.json +2 -1
package/cli.js CHANGED
@@ -4,35 +4,11 @@ import path, { dirname } from 'path';
4
4
  import { exec } from 'child_process';
5
5
  import { fileURLToPath, pathToFileURL } from 'url';
6
6
  import chalk from 'chalk';
7
+ import slash from 'slash';
7
8
 
8
9
  function getLibraryPath() {
9
10
  const fileName = fileURLToPath(import.meta.url);
10
- let currentDir = dirname(fileName);
11
-
12
- while (true) {
13
- const packageJsonPath = path.join(currentDir, 'package.json');
14
- if (fs.existsSync(packageJsonPath)) {
15
- // We have found the package.json file
16
- const packageJson = JSON.parse(fs.readFileSync(packageJsonPath, 'utf8'));
17
- if (
18
- (packageJson.dependencies && packageJson.dependencies['regressify']) ||
19
- (packageJson.devDependencies && packageJson.devDependencies['regressify'])
20
- ) {
21
- return `node_modules/${packageJson.name}`;
22
- }
23
- }
24
-
25
- const parentDir = path.dirname(currentDir);
26
- if (parentDir === currentDir) {
27
- // We have reached the root directory
28
- console.log(chalk.red('Could not find package.json file in the current directory or any of its parents. Current directory:'), import.meta.url);
29
- console.log(chalk.red('___filename:'), __filename);
30
- console.log(chalk.red('__dirname:'), __dirname);
31
- return null;
32
- }
33
-
34
- currentDir = parentDir;
35
- }
11
+ return slash(dirname(fileName));
36
12
  }
37
13
 
38
14
  function runCommand(command) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "regressify",
3
- "version": "1.0.14",
3
+ "version": "1.0.16",
4
4
  "description": "Visual regression tests support",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -30,6 +30,7 @@
30
30
  "inquirer": "^12.2.0",
31
31
  "js-yaml": "^4.1.0",
32
32
  "ncp": "^2.0.0",
33
+ "slash": "^5.1.0",
33
34
  "tsx": "^4.19.2"
34
35
  },
35
36
  "devDependencies": {