@plasmicapp/nextjs-app-router 1.0.10 → 1.0.12

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.
@@ -460,19 +460,19 @@ var require_enoent = __commonJS({
460
460
  spawnargs: original.args
461
461
  });
462
462
  }
463
- function hookChildProcess(cp2, parsed) {
463
+ function hookChildProcess(cp, parsed) {
464
464
  if (!isWin) {
465
465
  return;
466
466
  }
467
- const originalEmit = cp2.emit;
468
- cp2.emit = function(name, arg1) {
467
+ const originalEmit = cp.emit;
468
+ cp.emit = function(name, arg1) {
469
469
  if (name === "exit") {
470
470
  const err = verifyENOENT(arg1, parsed, "spawn");
471
471
  if (err) {
472
- return originalEmit.call(cp2, "error", err);
472
+ return originalEmit.call(cp, "error", err);
473
473
  }
474
474
  }
475
- return originalEmit.apply(cp2, arguments);
475
+ return originalEmit.apply(cp, arguments);
476
476
  };
477
477
  }
478
478
  function verifyENOENT(status, parsed) {
@@ -500,23 +500,23 @@ var require_enoent = __commonJS({
500
500
  var require_cross_spawn = __commonJS({
501
501
  "../../node_modules/cross-spawn/index.js"(exports, module2) {
502
502
  "use strict";
503
- var cp2 = require("child_process");
503
+ var cp = require("child_process");
504
504
  var parse = require_parse();
505
505
  var enoent = require_enoent();
506
- function spawn(command2, args, options) {
506
+ function spawn2(command2, args, options) {
507
507
  const parsed = parse(command2, args, options);
508
- const spawned = cp2.spawn(parsed.command, parsed.args, parsed.options);
508
+ const spawned = cp.spawn(parsed.command, parsed.args, parsed.options);
509
509
  enoent.hookChildProcess(spawned, parsed);
510
510
  return spawned;
511
511
  }
512
512
  function spawnSync(command2, args, options) {
513
513
  const parsed = parse(command2, args, options);
514
- const result = cp2.spawnSync(parsed.command, parsed.args, parsed.options);
514
+ const result = cp.spawnSync(parsed.command, parsed.args, parsed.options);
515
515
  result.error = result.error || enoent.verifyENOENTSync(result.status, parsed);
516
516
  return result;
517
517
  }
518
- module2.exports = spawn;
519
- module2.exports.spawn = spawn;
518
+ module2.exports = spawn2;
519
+ module2.exports.spawn = spawn2;
520
520
  module2.exports.sync = spawnSync;
521
521
  module2.exports._parse = parse;
522
522
  module2.exports._enoent = enoent;
@@ -2201,7 +2201,7 @@ var require_ps_list2 = __commonJS({
2201
2201
  });
2202
2202
 
2203
2203
  // src/with-dev-server.mts
2204
- var import_child_process = __toESM(require("child_process"), 1);
2204
+ var import_cross_spawn = __toESM(require_cross_spawn(), 1);
2205
2205
 
2206
2206
  // ../../node_modules/fkill/index.js
2207
2207
  var import_node_process3 = __toESM(require("node:process"), 1);
@@ -7551,7 +7551,7 @@ async function startDevServer(command2, port, opts) {
7551
7551
  console.log(
7552
7552
  `Plasmic: starting prepass dev server at http://localhost:${port} via "npm run ${command2}"...`
7553
7553
  );
7554
- const devServerProcess = import_child_process.default.spawn(`npm`, ["run", command2], {
7554
+ const devServerProcess = (0, import_cross_spawn.spawn)(`npm`, ["run", command2], {
7555
7555
  env: {
7556
7556
  PLASMIC_PREPASS_SERVER: "true",
7557
7557
  ...import_process.default.env,
@@ -7599,15 +7599,13 @@ async function main() {
7599
7599
  });
7600
7600
  const killDevServer = () => {
7601
7601
  devProcess.kill("SIGKILL");
7602
- fkill(`:${port}`, { force: true }).then(() => {
7603
- import_process.default.exit(commandProcess.exitCode ?? void 0);
7604
- }).catch((err) => {
7602
+ return fkill(`:${port}`, { force: true }).catch((err) => {
7605
7603
  console.error(`Plasmic: Failed to kill dev server: ${err}`);
7606
7604
  });
7607
7605
  };
7608
7606
  const command2 = argv._.map((x) => `${x}`);
7609
7607
  console.log(`Plasmic: Running command: ${command2.join(" ")}`);
7610
- const commandProcess = import_child_process.default.spawn(command2[0], command2.slice(1), {
7608
+ const commandProcess = (0, import_cross_spawn.spawn)(command2[0], command2.slice(1), {
7611
7609
  env: {
7612
7610
  ...import_process.default.env,
7613
7611
  PLASMIC_PREPASS_HOST: `http://localhost:${port}`
@@ -7618,11 +7616,15 @@ async function main() {
7618
7616
  commandProcess.stderr?.pipe(import_process.default.stderr);
7619
7617
  commandProcess.on("error", (err) => {
7620
7618
  console.error(`Plasmic: Command error: ${err}`);
7621
- killDevServer();
7619
+ killDevServer().then(() => {
7620
+ import_process.default.exit(commandProcess.exitCode ?? void 0);
7621
+ });
7622
7622
  });
7623
7623
  commandProcess.on("exit", () => {
7624
7624
  console.log(`Plasmic: Command finished; killing prepass dev server...`);
7625
- killDevServer();
7625
+ killDevServer().then(() => {
7626
+ import_process.default.exit(void 0);
7627
+ });
7626
7628
  });
7627
7629
  }
7628
7630
  if (require.main === module) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@plasmicapp/nextjs-app-router",
3
- "version": "1.0.10",
3
+ "version": "1.0.12",
4
4
  "types": "./dist/index.d.ts",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.esm.js",
@@ -27,6 +27,7 @@
27
27
  "dependencies": {
28
28
  "@plasmicapp/prepass": "1.0.17",
29
29
  "@plasmicapp/query": "0.1.79",
30
+ "cross-spawn": "^7.0.3",
30
31
  "fkill": "^8.1.0",
31
32
  "get-port": "^7.0.0",
32
33
  "node-html-parser": "^6.1.5",
@@ -65,6 +66,7 @@
65
66
  "access": "public"
66
67
  },
67
68
  "devDependencies": {
69
+ "@types/cross-spawn": "^6.0.6",
68
70
  "@types/node": "^20.8.9",
69
71
  "@types/react": "^18.0.27",
70
72
  "@types/yargs": "^17.0.32",
@@ -72,5 +74,5 @@
72
74
  "react": "^18.2.0",
73
75
  "typescript": "^5.2.2"
74
76
  },
75
- "gitHead": "2f8ee12f8f9c75c0f0af3834b8302b0bea542cbd"
77
+ "gitHead": "9e7af0b37cc771d0189c30332d65b12cc891e48c"
76
78
  }