create-vidra-app 0.2.1 → 0.2.2

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/cli.js CHANGED
@@ -400,6 +400,7 @@ var newestNet10Sdk = (listSdksOutput) => splitLines(listSdksOutput).map((line) =
400
400
  var outputMentionsMaui = (workloadListOutput) => MAUI_WORKLOAD.test(workloadListOutput);
401
401
  var workloadSetVersion = (workloadListOutput) => workloadListOutput.match(WORKLOAD_SET_VERSION_LINE)?.[1];
402
402
  var MIN_MACCATALYST_WATCH_WORKLOAD_SET = [10, 0, 203];
403
+ var MIN_MACCATALYST_WATCH_SDK = [10, 0, 300];
403
404
  var meetsMinimumVersion = (version, minimum) => {
404
405
  const segments = version.split(".").map((s) => Number.parseInt(s, 10));
405
406
  if (segments.slice(0, minimum.length).some(Number.isNaN)) return false;
@@ -410,12 +411,25 @@ var meetsMinimumVersion = (version, minimum) => {
410
411
  return true;
411
412
  };
412
413
  var workloadSetSupportsCSharpHotReload = (version) => meetsMinimumVersion(version, MIN_MACCATALYST_WATCH_WORKLOAD_SET);
414
+ var sdkSupportsCSharpHotReload = (version) => meetsMinimumVersion(version, MIN_MACCATALYST_WATCH_SDK);
413
415
  var macCatalystHotReloadBlocker = () => {
416
+ const sdkRes = run(DOTNET, ["--version"]);
417
+ if (!sdkRes.found) return null;
418
+ const sdkVersion = sdkRes.stdout.trim();
419
+ if (sdkVersion && !sdkSupportsCSharpHotReload(sdkVersion)) {
420
+ return {
421
+ reason: `C# hot reload needs the .NET SDK 10.0.300+ \u2014 found ${sdkVersion}`,
422
+ fix: INSTALL_NET_10_FIX
423
+ };
424
+ }
414
425
  const res = run(DOTNET, ["workload", "list"]);
415
426
  if (!res.found) return null;
416
427
  const version = workloadSetVersion(res.stdout);
417
- if (!version) return null;
418
- return workloadSetSupportsCSharpHotReload(version) ? null : version;
428
+ if (!version || workloadSetSupportsCSharpHotReload(version)) return null;
429
+ return {
430
+ reason: `C# hot reload needs workload set 10.0.203+ \u2014 found ${version}`,
431
+ fix: "dotnet workload update"
432
+ };
419
433
  };
420
434
  var MISSING_WORKLOAD_SIGNATURES = [
421
435
  /NETSDK1147/i,
@@ -487,6 +501,15 @@ var checkCSharpHotReload = (workloadList) => {
487
501
  if (process.platform !== "darwin") {
488
502
  return { name, status: "ok", detail: "dotnet watch supported" };
489
503
  }
504
+ const sdkVersion = run(DOTNET, ["--version"]).stdout.trim();
505
+ if (sdkVersion && !sdkSupportsCSharpHotReload(sdkVersion)) {
506
+ return {
507
+ name,
508
+ status: "unknown",
509
+ detail: `SDK ${sdkVersion} \u2014 its dotnet-watch crashes Mac Catalyst apps on launch (needs 10.0.300+) \u2014 vidra dev falls back to a classic launch`,
510
+ fix: INSTALL_NET_10_FIX
511
+ };
512
+ }
490
513
  const version = workloadSetVersion(workloadList.stdout);
491
514
  if (!version) {
492
515
  return {
@@ -1058,10 +1081,10 @@ var startSession = async (argv, opts) => {
1058
1081
  console.log(
1059
1082
  row({
1060
1083
  glyph: "manual",
1061
- detail: `${dim("C# hot reload needs workload set 10.0.203+ \u2014 found")} ${value(blocker)}${dim("; using a classic launch")}`
1084
+ detail: `${dim(blocker.reason + "; using a classic launch")}`
1062
1085
  })
1063
1086
  );
1064
- console.log(fixLine("dotnet workload update"));
1087
+ console.log(fixLine(blocker.fix));
1065
1088
  }
1066
1089
  }
1067
1090
  const session = new DevSession(project, target, viteUrl, verbose, {
@@ -1293,7 +1316,12 @@ var DevSession = class {
1293
1316
  `${dim("launched")} ${value(this.project.projectName)} ${dim("\u2014 C# hot reload active")}`
1294
1317
  )
1295
1318
  );
1296
- } else if (event === "appWaiting" && !this.shuttingDown) {
1319
+ return;
1320
+ }
1321
+ if (event !== "appWaiting" && event !== "buildBlocked" || this.shuttingDown) {
1322
+ return;
1323
+ }
1324
+ if (this.watchReady) {
1297
1325
  console.log(
1298
1326
  taggedRow(
1299
1327
  "manual",
@@ -1301,20 +1329,30 @@ var DevSession = class {
1301
1329
  dim("app not running \u2014 save a C# file to relaunch, or ctrl-c to stop")
1302
1330
  )
1303
1331
  );
1304
- } else if (event === "buildBlocked" && !this.shuttingDown) {
1305
- if (!this.watchReady) {
1306
- if (looksLikeMissingWorkload(this.watchOutputTail)) printWorkloadHint();
1307
- else if (looksLikeXcodeTooOld(this.watchOutputTail)) printXcodeTooOldHint();
1308
- else if (looksLikeMissingXcode(this.watchOutputTail)) printXcodeHint();
1309
- }
1332
+ return;
1333
+ }
1334
+ if (!/Build FAILED/i.test(this.watchOutputTail)) {
1310
1335
  console.log(
1311
1336
  taggedRow(
1312
1337
  "manual",
1313
1338
  "host",
1314
- dim("build failed \u2014 fix the error and save to retry, or ctrl-c to stop")
1339
+ dim(
1340
+ "app exited before it was ready \u2014 save a C# file to relaunch, or ctrl-c to stop"
1341
+ )
1315
1342
  )
1316
1343
  );
1344
+ return;
1317
1345
  }
1346
+ if (looksLikeMissingWorkload(this.watchOutputTail)) printWorkloadHint();
1347
+ else if (looksLikeXcodeTooOld(this.watchOutputTail)) printXcodeTooOldHint();
1348
+ else if (looksLikeMissingXcode(this.watchOutputTail)) printXcodeHint();
1349
+ console.log(
1350
+ taggedRow(
1351
+ "manual",
1352
+ "host",
1353
+ dim("build failed \u2014 fix the error and save to retry, or ctrl-c to stop")
1354
+ )
1355
+ );
1318
1356
  }
1319
1357
  /**
1320
1358
  * `dotnet watch` exited before the app ever started — typically an SDK or
package/dist/index.js CHANGED
@@ -329,7 +329,7 @@ var VIDRA_REPO_ROOT = path2.resolve(CLI_ROOT, "..", "..", "..");
329
329
  var LOCAL_FEED_DIR = path2.join(VIDRA_REPO_ROOT, "dist", "packages");
330
330
  var LOCAL_CLI_DIR = CLI_ROOT;
331
331
  var LOCAL_SDK_DIR = path2.join(VIDRA_REPO_ROOT, "src", "sdk", "vidra-js");
332
- var VIDRA_VERSION = "0.2.1";
332
+ var VIDRA_VERSION = "0.2.2";
333
333
  var SDK_VERSION = "0.1.0";
334
334
  var main = async () => {
335
335
  console.log();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-vidra-app",
3
- "version": "0.2.1",
3
+ "version": "0.2.2",
4
4
  "description": "Scaffold a new Vidra application (React + .NET MAUI)",
5
5
  "type": "module",
6
6
  "bin": {