@korajs/cli 0.1.2 → 0.1.4

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/bin.cjs CHANGED
@@ -147,13 +147,16 @@ async function findSchemaFile(projectRoot) {
147
147
  return null;
148
148
  }
149
149
  async function resolveProjectBinary(projectRoot, binaryName) {
150
- const binaryPath = (0, import_node_path.join)(projectRoot, "node_modules", ".bin", binaryName);
151
- try {
152
- await (0, import_promises.access)(binaryPath);
153
- return binaryPath;
154
- } catch {
155
- return null;
150
+ const binDir = (0, import_node_path.join)(projectRoot, "node_modules", ".bin");
151
+ const candidates = process.platform === "win32" ? [(0, import_node_path.join)(binDir, `${binaryName}.cmd`), (0, import_node_path.join)(binDir, binaryName)] : [(0, import_node_path.join)(binDir, binaryName)];
152
+ for (const candidate of candidates) {
153
+ try {
154
+ await (0, import_promises.access)(candidate);
155
+ return candidate;
156
+ } catch {
157
+ }
156
158
  }
159
+ return null;
157
160
  }
158
161
  function isKoraProject(pkg) {
159
162
  if (typeof pkg !== "object" || pkg === null) return false;
@@ -574,7 +577,9 @@ var ProcessManager = class {
574
577
  const options = {
575
578
  cwd: config.cwd,
576
579
  env: { ...process.env, ...config.env },
577
- stdio: ["ignore", "pipe", "pipe"]
580
+ stdio: ["ignore", "pipe", "pipe"],
581
+ // On Windows, .cmd shims require shell to execute
582
+ shell: process.platform === "win32"
578
583
  };
579
584
  const child = (0, import_node_child_process4.spawn)(config.command, config.args, options);
580
585
  let resolveExit;
@@ -804,7 +809,7 @@ var devCommand = (0, import_citty2.defineCommand)({
804
809
  }
805
810
  if (shouldStartSync && syncServerFile === null && managedSyncStore) {
806
811
  const hasServerPackage = await fileExists(
807
- (0, import_node_path5.join)(projectRoot, "node_modules", "@kora", "server", "package.json")
812
+ (0, import_node_path5.join)(projectRoot, "node_modules", "@korajs", "server", "package.json")
808
813
  );
809
814
  if (!hasServerPackage) {
810
815
  logger.warn(