laxy-verify 1.1.30 → 1.1.31

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/dist/detect.js +18 -0
  2. package/package.json +1 -1
package/dist/detect.js CHANGED
@@ -42,6 +42,21 @@ const FRAMEWORK_DEFAULT_PORTS = {
42
42
  cra: 3000,
43
43
  sveltekit: 5173,
44
44
  };
45
+ function isLaxyVerifyPackage(pkg) {
46
+ if (pkg.name === "laxy-verify")
47
+ return true;
48
+ const bin = pkg.bin;
49
+ if (typeof bin === "object" && bin !== null) {
50
+ for (const value of Object.values(bin)) {
51
+ if (typeof value === "string" && value.includes("dist/cli.js")) {
52
+ return true;
53
+ }
54
+ }
55
+ }
56
+ const scripts = pkg.scripts ?? {};
57
+ return Object.values(scripts).some((script) => typeof script === "string" &&
58
+ (script.includes("node dist/cli.js") || script.includes("laxy-verify")));
59
+ }
45
60
  function detectPackageManager(dir) {
46
61
  if (fs.existsSync(path.join(dir, "pnpm-lock.yaml")))
47
62
  return "pnpm";
@@ -114,6 +129,9 @@ function detect(dir) {
114
129
  throw new Error(`Not a Node.js project: no package.json found at ${pkgPath}`);
115
130
  }
116
131
  const pkg = JSON.parse(fs.readFileSync(pkgPath, "utf-8"));
132
+ if (isLaxyVerifyPackage(pkg)) {
133
+ throw new Error("Cannot run laxy-verify against the laxy-verify package itself. Run it from the frontend app you actually want to verify.");
134
+ }
117
135
  if (!pkg.scripts || !pkg.scripts.build) {
118
136
  throw new Error("No 'build' script found in package.json");
119
137
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "laxy-verify",
3
- "version": "1.1.30",
3
+ "version": "1.1.31",
4
4
  "description": "Frontend verification CLI for build checks, Lighthouse, E2E, and release readiness",
5
5
  "license": "MIT",
6
6
  "type": "commonjs",