routesync 1.0.43 → 1.0.45

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/cli.js +7 -2
  2. package/package.json +1 -1
package/dist/cli.js CHANGED
@@ -8358,9 +8358,11 @@ function ora(options) {
8358
8358
  var import_fs_extra = __toESM(require_lib());
8359
8359
  var import_child_process = require("child_process");
8360
8360
  var import_path = __toESM(require("path"));
8361
+ var import_os = __toESM(require("os"));
8361
8362
  var LaravelRouteParser = class {
8362
8363
  async parse(filePath, options = {}) {
8363
- const projectRoot = import_path.default.resolve(import_path.default.dirname(filePath), "..");
8364
+ const resolvedFile = import_path.default.resolve(process.cwd(), filePath);
8365
+ const projectRoot = import_path.default.dirname(import_path.default.dirname(resolvedFile));
8364
8366
  const extractModels = options.extractModels ? "true" : "false";
8365
8367
  const phpScript = `<?php
8366
8368
  error_reporting(0);
@@ -8583,8 +8585,11 @@ echo json_encode($result);
8583
8585
  const scriptPath = import_path.default.join(projectRoot, "routesync-extractor-temp.php");
8584
8586
  try {
8585
8587
  await import_fs_extra.default.writeFile(scriptPath, phpScript);
8586
- const stdout = (0, import_child_process.execSync)(`php routesync-extractor-temp.php 2>/dev/null`, {
8588
+ const isWindows = import_os.default.platform() === "win32";
8589
+ const phpCmd = isWindows ? `php routesync-extractor-temp.php 2>NUL` : `php routesync-extractor-temp.php 2>/dev/null`;
8590
+ const stdout = (0, import_child_process.execSync)(phpCmd, {
8587
8591
  cwd: projectRoot,
8592
+ shell: isWindows ? "cmd.exe" : "/bin/sh",
8588
8593
  encoding: "utf-8",
8589
8594
  maxBuffer: 1024 * 1024 * 10
8590
8595
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "routesync",
3
- "version": "1.0.43",
3
+ "version": "1.0.45",
4
4
  "description": "Laravel routes to typed frontend SDKs.",
5
5
  "main": "./dist/sdk.js",
6
6
  "module": "./dist/sdk.mjs",