@ttsc/unplugin 0.30.2 → 0.30.3

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.
@@ -63,14 +63,13 @@ class TtscUnstableGenerationError extends TtscTerminalGenerationError {
63
63
  /**
64
64
  * A compile this pass already attempted, whose envelope failed outright.
65
65
  *
66
- * The envelope cannot say whether the host reported diagnostics about the
67
- * project or failed to run at all: an ordinary type error arrives as an
68
- * `"exception"` carrying the compiler's own diagnostic text, exactly as a
69
- * crashed host would. Sniffing that message to tell the two apart would be a
70
- * guess, so the adapter uses the one boundary it genuinely owns. Inside a pass
71
- * the answer is already settled, so every later module replays it instead of
72
- * repeating a whole-project transform to reach the same verdict, which is what
73
- * made a single broken save cost one compile per delivered module
66
+ * Native project diagnostics carry a structured failure envelope; setup and
67
+ * host failures can still arrive as opaque exceptions. Both settle the current
68
+ * attempt, so the adapter uses the delivery boundary it owns rather than
69
+ * guessing retryability from a diagnostic message. Inside a pass the answer is
70
+ * already settled, so every later module replays it instead of repeating a
71
+ * whole-project transform to reach the same verdict, which is what made a
72
+ * single broken save cost one compile per delivered module
74
73
  * (samchon/ttsc#1303).
75
74
  *
76
75
  * The scope is exactly the pass. A host whose `buildStart` repeats drops the
@@ -1049,11 +1048,11 @@ function collectDeclaredIdentities(state, projectRoot, listed) {
1049
1048
  * invalidated, and the error stays on screen (samchon/ttsc#1312).
1050
1049
  *
1051
1050
  * A failure envelope can retain exact external input spellings from its graph
1052
- * and host metadata. A pre-transform typecheck failure may have no graph yet;
1053
- * its structured diagnostics, or the host's standard diagnostic lines when it
1054
- * could return only an exception, still name the external files that need a
1055
- * repair. The cost is paid only on a failure, and only until the next compile
1056
- * succeeds and narrows the set back to the derived inputs.
1051
+ * and host metadata, including missing resolution candidates on native
1052
+ * typecheck failures. For hosts that return no graph, structured diagnostics or
1053
+ * standard diagnostic lines provide only the paths they actually name. The cost
1054
+ * is paid only on a failure, and only until the next compile succeeds and
1055
+ * narrows the set back to the derived inputs.
1057
1056
  */
1058
1057
  function notifyFailedGenerationInputs(hooks, cached) {
1059
1058
  const addWatchFile = hooks?.addWatchFile;
@@ -1098,7 +1097,7 @@ function notifyFailedGenerationInputs(hooks, cached) {
1098
1097
  }
1099
1098
  }
1100
1099
  if (addWatchFiles !== undefined) {
1101
- addWatchFiles(inputs);
1100
+ addWatchFiles(inputs, true);
1102
1101
  return;
1103
1102
  }
1104
1103
  for (const input of inputs) {
@@ -3406,7 +3405,9 @@ membership) {
3406
3405
  });
3407
3406
  broker.pendingRegistrations += 1;
3408
3407
  broker.child.ref();
3409
- broker.child.channel?.ref();
3408
+ // Bun's IPC channel omits Node's Control.ref/unref methods. The child itself
3409
+ // still owns the outstanding acknowledgement on that runtime.
3410
+ broker.child.channel?.ref?.();
3410
3411
  const id = broker.nextId++;
3411
3412
  let resolveReady;
3412
3413
  const ready = new Promise((resolve) => {
@@ -3477,7 +3478,7 @@ membership) {
3477
3478
  // exit mid-build.
3478
3479
  if (broker.pendingRegistrations === 0 && broker.pendingDrains === 0) {
3479
3480
  broker.child.unref();
3480
- broker.child.channel?.unref();
3481
+ broker.child.channel?.unref?.();
3481
3482
  }
3482
3483
  }
3483
3484
  }
@@ -3593,7 +3594,7 @@ function startWindowsProjectMutationDrain(broker) {
3593
3594
  broker.pendingDrains -= 1;
3594
3595
  if (broker.pendingDrains === 0 && broker.pendingRegistrations === 0) {
3595
3596
  broker.child.unref();
3596
- broker.child.channel?.unref();
3597
+ broker.child.channel?.unref?.();
3597
3598
  }
3598
3599
  resolve();
3599
3600
  };
@@ -3604,7 +3605,7 @@ function startWindowsProjectMutationDrain(broker) {
3604
3605
  // process exits mid-build with nothing to report.
3605
3606
  broker.pendingDrains += 1;
3606
3607
  broker.child.ref();
3607
- broker.child.channel?.ref();
3608
+ broker.child.channel?.ref?.();
3608
3609
  const timer = setTimeout(release, WINDOWS_MUTATION_DRAIN_FALLBACK_MS);
3609
3610
  broker.drains.set(id, release);
3610
3611
  if (broker.child.send?.({ id, op: "drain" }) !== true) {
@@ -5697,13 +5698,12 @@ function formatUnknownError(error) {
5697
5698
  /**
5698
5699
  * Remove terminal colour and cursor sequences from text the adapter surfaces.
5699
5700
  *
5700
- * An ordinary type error reaches the adapter as an `"exception"` envelope whose
5701
- * `error` is the host's own rendered output, colour and all, and the envelope
5702
- * carries no structured diagnostics to format instead. What the adapter hands
5703
- * back is not going to a terminal: it becomes the `Error` a bundler reports, so
5704
- * it lands in a Vite overlay, a webpack error report or a CI annotation, where
5705
- * the escapes render as literal noise around the file and line the reader needs
5706
- * (samchon/ttsc#1312).
5701
+ * An opaque host exception can contain the host's own rendered output, colour
5702
+ * and all, with no structured diagnostics to format instead. What the adapter
5703
+ * hands back is not going to a terminal: it becomes the `Error` a bundler
5704
+ * reports, so it lands in a Vite overlay, a webpack error report or a CI
5705
+ * annotation, where the escapes render as literal noise around the file and
5706
+ * line the reader needs (samchon/ttsc#1312).
5707
5707
  *
5708
5708
  * The colour originates in the host's rendering rather than in anything this
5709
5709
  * adapter configures, so this is the adapter-side repair, applied to every