@formigio/fazemos-cli 0.10.5 → 0.10.6

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/dist/index.js CHANGED
@@ -7287,12 +7287,16 @@ docs
7287
7287
  handleScopedError(err);
7288
7288
  }
7289
7289
  });
7290
- // Only auto-parse when invoked as the entry point (i.e. `node dist/index.js ...`
7291
- // or `npx tsx src/index.ts ...`). When imported as a module — by tests using
7292
- // `vi.mock` to intercept `api()` and asserting on `program.parseAsync(...)`
7293
- // skip auto-parse so the test controls invocation.
7294
- const isMainModule = import.meta.url === `file://${process.argv[1]}`;
7295
- if (isMainModule)
7290
+ // Skip auto-parse only when running under Vitest (which sets process.env.VITEST).
7291
+ // Tests import `program` and drive it via `program.parseAsync(...)` after mocking
7292
+ // `./api.js`. In every other context direct invocation, npx tsx, OR the bin
7293
+ // shim that does `import('../dist/index.js')` — auto-parse must run, otherwise
7294
+ // the CLI produces no output.
7295
+ //
7296
+ // Earlier `import.meta.url === file://${process.argv[1]}` check was wrong: the
7297
+ // bin shim's argv[1] is the shim path, not the dist/index.js path, so the guard
7298
+ // returned false and silently skipped parse.
7299
+ if (!process.env.VITEST)
7296
7300
  program.parse();
7297
7301
  export { program };
7298
7302
  //# sourceMappingURL=index.js.map