@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.
- package/lib/bun.js +3 -16
- package/lib/bun.js.map +1 -1
- package/lib/bun.mjs +3 -16
- package/lib/bun.mjs.map +1 -1
- package/lib/core/esbuild.d.cts +4 -0
- package/lib/core/esbuild.d.mts +4 -0
- package/lib/core/esbuild.d.ts +4 -0
- package/lib/core/esbuild.js +110 -0
- package/lib/core/esbuild.js.map +1 -0
- package/lib/core/esbuild.mjs +108 -0
- package/lib/core/esbuild.mjs.map +1 -0
- package/lib/core/index.js +49 -89
- package/lib/core/index.js.map +1 -1
- package/lib/core/index.mjs +50 -90
- package/lib/core/index.mjs.map +1 -1
- package/lib/core/transform.d.cts +5 -3
- package/lib/core/transform.d.mts +5 -3
- package/lib/core/transform.d.ts +5 -3
- package/lib/core/transform.js +25 -25
- package/lib/core/transform.js.map +1 -1
- package/lib/core/transform.mjs +25 -25
- package/lib/core/transform.mjs.map +1 -1
- package/lib/core/viteServe.d.cts +16 -38
- package/lib/core/viteServe.d.mts +16 -38
- package/lib/core/viteServe.d.ts +16 -38
- package/lib/core/viteServe.js +234 -98
- package/lib/core/viteServe.js.map +1 -1
- package/lib/core/viteServe.mjs +235 -98
- package/lib/core/viteServe.mjs.map +1 -1
- package/package.json +4 -3
- package/src/bun.ts +2 -17
- package/src/core/esbuild.ts +127 -0
- package/src/core/index.ts +51 -100
- package/src/core/transform.ts +30 -28
- package/src/core/viteServe.ts +275 -164
package/lib/core/transform.mjs
CHANGED
|
@@ -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
|
-
*
|
|
67
|
-
*
|
|
68
|
-
*
|
|
69
|
-
*
|
|
70
|
-
*
|
|
71
|
-
*
|
|
72
|
-
*
|
|
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
|
|
1053
|
-
*
|
|
1054
|
-
*
|
|
1055
|
-
*
|
|
1056
|
-
*
|
|
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
|
-
|
|
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
|
|
5701
|
-
*
|
|
5702
|
-
*
|
|
5703
|
-
*
|
|
5704
|
-
*
|
|
5705
|
-
*
|
|
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
|