@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/viteServe.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type TtscWatchInput } from "./transform.cjs";
|
|
2
2
|
/** One module node inside a Vite module graph; opaque to this module. */
|
|
3
3
|
type ViteModuleNodeLike = object;
|
|
4
4
|
/**
|
|
@@ -35,44 +35,22 @@ export interface ViteDevServerLike {
|
|
|
35
35
|
moduleGraph?: ViteModuleGraphLike;
|
|
36
36
|
ws?: ViteHotChannelLike;
|
|
37
37
|
}
|
|
38
|
+
/** Serve-time compiler dependencies never enter Vite's runtime import graph. */
|
|
39
|
+
export interface ViteServeInputWatch {
|
|
40
|
+
attach(server: ViteDevServerLike): void;
|
|
41
|
+
dispose(): Promise<void>;
|
|
42
|
+
replace(importer: string, inputs: readonly TtscWatchInput[], failed?: boolean): void;
|
|
43
|
+
}
|
|
38
44
|
/**
|
|
39
|
-
*
|
|
40
|
-
* added imports while a development server is running.
|
|
41
|
-
*
|
|
42
|
-
* Vite serve treats every transform-context `addWatchFile()` registration as an
|
|
43
|
-
* added import: `TransformPluginContext.addWatchFile` stores the path in
|
|
44
|
-
* `_addedImports`, and `vite:import-analysis` resolves each entry like a real
|
|
45
|
-
* import of the transformed module. A missing path or an existing directory
|
|
46
|
-
* that failed a compiler file predicate then fails that resolve and turns the
|
|
47
|
-
* importer's first request into a 500, even though the transform succeeded.
|
|
45
|
+
* One filesystem subscription per unique input, shared by all served modules.
|
|
48
46
|
*
|
|
49
|
-
*
|
|
50
|
-
*
|
|
51
|
-
*
|
|
52
|
-
*
|
|
53
|
-
*
|
|
54
|
-
*
|
|
55
|
-
*
|
|
47
|
+
* Vite resolves transform-context addWatchFile as a runtime import, including
|
|
48
|
+
* type-only .server files and non-module plugin assets. Use a separate watcher
|
|
49
|
+
* for compiler inputs, including node_modules, which Vite's watcher ignores.
|
|
50
|
+
* Ordinary files use events after their initial subscription is observed.
|
|
51
|
+
* Missing spellings and directory predicates keep a shared predicate poll.
|
|
52
|
+
* Linked files also share topology checks by directory because retargeting a
|
|
53
|
+
* junction need not emit events on its previously watched descendants.
|
|
56
54
|
*/
|
|
57
|
-
export
|
|
58
|
-
/** Adopt the dev server whose module graphs creation events invalidate. */
|
|
59
|
-
attach(server: ViteDevServerLike): void;
|
|
60
|
-
/** Stop every poll; safe to call repeatedly. */
|
|
61
|
-
dispose(): void;
|
|
62
|
-
/**
|
|
63
|
-
* Report whether a dev server has ever been attached. This is not a liveness
|
|
64
|
-
* predicate — the reference intentionally survives the server's close (see
|
|
65
|
-
* {@link dispose}) — so route decisions must also gate on the resolved
|
|
66
|
-
* config's `command`, as the adapter does.
|
|
67
|
-
*/
|
|
68
|
-
serving(): boolean;
|
|
69
|
-
/** Register one unsafe watch input and its exact recorded condition. */
|
|
70
|
-
watch(input: string, importer: string, condition: ViteServeInputWatchCondition): void;
|
|
71
|
-
}
|
|
72
|
-
/** A legacy availability condition or an exact compiler predicate proof. */
|
|
73
|
-
export type ViteServeInputWatchCondition = "exists" | "file" | ITtscCompilerTransformation.IInputObservation;
|
|
74
|
-
/** Create an empty missing-input watch for one plugin instance. */
|
|
75
|
-
export declare function createViteServeMissingInputWatch(): ViteServeMissingInputWatch;
|
|
76
|
-
/** Key a private poll by predicate and exact lexical spelling. */
|
|
77
|
-
export declare function viteServeMissingInputWatchKey(input: string, condition: ViteServeInputWatchCondition): string;
|
|
55
|
+
export declare function createViteServeInputWatch(): ViteServeInputWatch;
|
|
78
56
|
export {};
|
package/lib/core/viteServe.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type TtscWatchInput } from "./transform.mjs";
|
|
2
2
|
/** One module node inside a Vite module graph; opaque to this module. */
|
|
3
3
|
type ViteModuleNodeLike = object;
|
|
4
4
|
/**
|
|
@@ -35,44 +35,22 @@ export interface ViteDevServerLike {
|
|
|
35
35
|
moduleGraph?: ViteModuleGraphLike;
|
|
36
36
|
ws?: ViteHotChannelLike;
|
|
37
37
|
}
|
|
38
|
+
/** Serve-time compiler dependencies never enter Vite's runtime import graph. */
|
|
39
|
+
export interface ViteServeInputWatch {
|
|
40
|
+
attach(server: ViteDevServerLike): void;
|
|
41
|
+
dispose(): Promise<void>;
|
|
42
|
+
replace(importer: string, inputs: readonly TtscWatchInput[], failed?: boolean): void;
|
|
43
|
+
}
|
|
38
44
|
/**
|
|
39
|
-
*
|
|
40
|
-
* added imports while a development server is running.
|
|
41
|
-
*
|
|
42
|
-
* Vite serve treats every transform-context `addWatchFile()` registration as an
|
|
43
|
-
* added import: `TransformPluginContext.addWatchFile` stores the path in
|
|
44
|
-
* `_addedImports`, and `vite:import-analysis` resolves each entry like a real
|
|
45
|
-
* import of the transformed module. A missing path or an existing directory
|
|
46
|
-
* that failed a compiler file predicate then fails that resolve and turns the
|
|
47
|
-
* importer's first request into a 500, even though the transform succeeded.
|
|
45
|
+
* One filesystem subscription per unique input, shared by all served modules.
|
|
48
46
|
*
|
|
49
|
-
*
|
|
50
|
-
*
|
|
51
|
-
*
|
|
52
|
-
*
|
|
53
|
-
*
|
|
54
|
-
*
|
|
55
|
-
*
|
|
47
|
+
* Vite resolves transform-context addWatchFile as a runtime import, including
|
|
48
|
+
* type-only .server files and non-module plugin assets. Use a separate watcher
|
|
49
|
+
* for compiler inputs, including node_modules, which Vite's watcher ignores.
|
|
50
|
+
* Ordinary files use events after their initial subscription is observed.
|
|
51
|
+
* Missing spellings and directory predicates keep a shared predicate poll.
|
|
52
|
+
* Linked files also share topology checks by directory because retargeting a
|
|
53
|
+
* junction need not emit events on its previously watched descendants.
|
|
56
54
|
*/
|
|
57
|
-
export
|
|
58
|
-
/** Adopt the dev server whose module graphs creation events invalidate. */
|
|
59
|
-
attach(server: ViteDevServerLike): void;
|
|
60
|
-
/** Stop every poll; safe to call repeatedly. */
|
|
61
|
-
dispose(): void;
|
|
62
|
-
/**
|
|
63
|
-
* Report whether a dev server has ever been attached. This is not a liveness
|
|
64
|
-
* predicate — the reference intentionally survives the server's close (see
|
|
65
|
-
* {@link dispose}) — so route decisions must also gate on the resolved
|
|
66
|
-
* config's `command`, as the adapter does.
|
|
67
|
-
*/
|
|
68
|
-
serving(): boolean;
|
|
69
|
-
/** Register one unsafe watch input and its exact recorded condition. */
|
|
70
|
-
watch(input: string, importer: string, condition: ViteServeInputWatchCondition): void;
|
|
71
|
-
}
|
|
72
|
-
/** A legacy availability condition or an exact compiler predicate proof. */
|
|
73
|
-
export type ViteServeInputWatchCondition = "exists" | "file" | ITtscCompilerTransformation.IInputObservation;
|
|
74
|
-
/** Create an empty missing-input watch for one plugin instance. */
|
|
75
|
-
export declare function createViteServeMissingInputWatch(): ViteServeMissingInputWatch;
|
|
76
|
-
/** Key a private poll by predicate and exact lexical spelling. */
|
|
77
|
-
export declare function viteServeMissingInputWatchKey(input: string, condition: ViteServeInputWatchCondition): string;
|
|
55
|
+
export declare function createViteServeInputWatch(): ViteServeInputWatch;
|
|
78
56
|
export {};
|
package/lib/core/viteServe.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type TtscWatchInput } from "./transform";
|
|
2
2
|
/** One module node inside a Vite module graph; opaque to this module. */
|
|
3
3
|
type ViteModuleNodeLike = object;
|
|
4
4
|
/**
|
|
@@ -35,44 +35,22 @@ export interface ViteDevServerLike {
|
|
|
35
35
|
moduleGraph?: ViteModuleGraphLike;
|
|
36
36
|
ws?: ViteHotChannelLike;
|
|
37
37
|
}
|
|
38
|
+
/** Serve-time compiler dependencies never enter Vite's runtime import graph. */
|
|
39
|
+
export interface ViteServeInputWatch {
|
|
40
|
+
attach(server: ViteDevServerLike): void;
|
|
41
|
+
dispose(): Promise<void>;
|
|
42
|
+
replace(importer: string, inputs: readonly TtscWatchInput[], failed?: boolean): void;
|
|
43
|
+
}
|
|
38
44
|
/**
|
|
39
|
-
*
|
|
40
|
-
* added imports while a development server is running.
|
|
41
|
-
*
|
|
42
|
-
* Vite serve treats every transform-context `addWatchFile()` registration as an
|
|
43
|
-
* added import: `TransformPluginContext.addWatchFile` stores the path in
|
|
44
|
-
* `_addedImports`, and `vite:import-analysis` resolves each entry like a real
|
|
45
|
-
* import of the transformed module. A missing path or an existing directory
|
|
46
|
-
* that failed a compiler file predicate then fails that resolve and turns the
|
|
47
|
-
* importer's first request into a 500, even though the transform succeeded.
|
|
45
|
+
* One filesystem subscription per unique input, shared by all served modules.
|
|
48
46
|
*
|
|
49
|
-
*
|
|
50
|
-
*
|
|
51
|
-
*
|
|
52
|
-
*
|
|
53
|
-
*
|
|
54
|
-
*
|
|
55
|
-
*
|
|
47
|
+
* Vite resolves transform-context addWatchFile as a runtime import, including
|
|
48
|
+
* type-only .server files and non-module plugin assets. Use a separate watcher
|
|
49
|
+
* for compiler inputs, including node_modules, which Vite's watcher ignores.
|
|
50
|
+
* Ordinary files use events after their initial subscription is observed.
|
|
51
|
+
* Missing spellings and directory predicates keep a shared predicate poll.
|
|
52
|
+
* Linked files also share topology checks by directory because retargeting a
|
|
53
|
+
* junction need not emit events on its previously watched descendants.
|
|
56
54
|
*/
|
|
57
|
-
export
|
|
58
|
-
/** Adopt the dev server whose module graphs creation events invalidate. */
|
|
59
|
-
attach(server: ViteDevServerLike): void;
|
|
60
|
-
/** Stop every poll; safe to call repeatedly. */
|
|
61
|
-
dispose(): void;
|
|
62
|
-
/**
|
|
63
|
-
* Report whether a dev server has ever been attached. This is not a liveness
|
|
64
|
-
* predicate — the reference intentionally survives the server's close (see
|
|
65
|
-
* {@link dispose}) — so route decisions must also gate on the resolved
|
|
66
|
-
* config's `command`, as the adapter does.
|
|
67
|
-
*/
|
|
68
|
-
serving(): boolean;
|
|
69
|
-
/** Register one unsafe watch input and its exact recorded condition. */
|
|
70
|
-
watch(input: string, importer: string, condition: ViteServeInputWatchCondition): void;
|
|
71
|
-
}
|
|
72
|
-
/** A legacy availability condition or an exact compiler predicate proof. */
|
|
73
|
-
export type ViteServeInputWatchCondition = "exists" | "file" | ITtscCompilerTransformation.IInputObservation;
|
|
74
|
-
/** Create an empty missing-input watch for one plugin instance. */
|
|
75
|
-
export declare function createViteServeMissingInputWatch(): ViteServeMissingInputWatch;
|
|
76
|
-
/** Key a private poll by predicate and exact lexical spelling. */
|
|
77
|
-
export declare function viteServeMissingInputWatchKey(input: string, condition: ViteServeInputWatchCondition): string;
|
|
55
|
+
export declare function createViteServeInputWatch(): ViteServeInputWatch;
|
|
78
56
|
export {};
|
package/lib/core/viteServe.js
CHANGED
|
@@ -1,137 +1,274 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
+
var chokidar = require('chokidar');
|
|
3
4
|
var fs = require('node:fs');
|
|
4
5
|
var path = require('node:path');
|
|
5
6
|
var transform = require('./transform.js');
|
|
6
7
|
|
|
7
8
|
/**
|
|
8
|
-
*
|
|
9
|
-
* milliseconds.
|
|
9
|
+
* One filesystem subscription per unique input, shared by all served modules.
|
|
10
10
|
*
|
|
11
|
-
*
|
|
12
|
-
* server
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
11
|
+
* Vite resolves transform-context addWatchFile as a runtime import, including
|
|
12
|
+
* type-only .server files and non-module plugin assets. Use a separate watcher
|
|
13
|
+
* for compiler inputs, including node_modules, which Vite's watcher ignores.
|
|
14
|
+
* Ordinary files use events after their initial subscription is observed.
|
|
15
|
+
* Missing spellings and directory predicates keep a shared predicate poll.
|
|
16
|
+
* Linked files also share topology checks by directory because retargeting a
|
|
17
|
+
* junction need not emit events on its previously watched descendants.
|
|
17
18
|
*/
|
|
18
|
-
|
|
19
|
-
/** Create an empty missing-input watch for one plugin instance. */
|
|
20
|
-
function createViteServeMissingInputWatch() {
|
|
19
|
+
function createViteServeInputWatch() {
|
|
21
20
|
const entries = new Map();
|
|
22
|
-
|
|
21
|
+
const importerInputs = new Map();
|
|
22
|
+
const pending = new Set();
|
|
23
|
+
const links = new Map();
|
|
23
24
|
let server;
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
25
|
+
let watcher;
|
|
26
|
+
let poller;
|
|
27
|
+
let flushTimer;
|
|
28
|
+
let failed = false;
|
|
29
|
+
const remove = (entry) => {
|
|
30
|
+
entries.delete(entry.file);
|
|
31
|
+
watcher?.unwatch(entry.file);
|
|
32
|
+
for (const file of entry.links) {
|
|
33
|
+
const link = links.get(file);
|
|
34
|
+
link?.inputs.delete(entry);
|
|
35
|
+
if (link?.inputs.size === 0)
|
|
36
|
+
links.delete(file);
|
|
27
37
|
}
|
|
28
|
-
clearInterval(poller);
|
|
29
|
-
poller = undefined;
|
|
30
38
|
};
|
|
31
|
-
const
|
|
39
|
+
const check = (selected) => {
|
|
32
40
|
const importers = new Set();
|
|
33
|
-
for (const
|
|
34
|
-
if (
|
|
41
|
+
for (const entry of selected) {
|
|
42
|
+
if (entries.get(entry.file) !== entry)
|
|
35
43
|
continue;
|
|
44
|
+
let baseline;
|
|
45
|
+
for (const [key, condition] of entry.conditions) {
|
|
46
|
+
const state = condition.evidence?.state;
|
|
47
|
+
let changed;
|
|
48
|
+
if (state?.codec === "predicates") {
|
|
49
|
+
changed =
|
|
50
|
+
transform.validateGraphInputObservation(entry.file, state.observation)
|
|
51
|
+
.length !== 0;
|
|
52
|
+
}
|
|
53
|
+
else {
|
|
54
|
+
baseline ??= transform.captureWatchInputBaseline(entry.file);
|
|
55
|
+
changed =
|
|
56
|
+
baseline === undefined ||
|
|
57
|
+
(condition.evidence?.state !== undefined
|
|
58
|
+
? !transform.watchInputEvidenceMatchesBaseline(condition.evidence, baseline)
|
|
59
|
+
: JSON.stringify(condition.baseline) !==
|
|
60
|
+
JSON.stringify(baseline));
|
|
61
|
+
}
|
|
62
|
+
if (!changed)
|
|
63
|
+
continue;
|
|
64
|
+
for (const importer of condition.importers)
|
|
65
|
+
importers.add(importer);
|
|
66
|
+
entry.conditions.delete(key);
|
|
36
67
|
}
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
importers.add(importer);
|
|
68
|
+
if (entry.conditions.size === 0) {
|
|
69
|
+
remove(entry);
|
|
40
70
|
}
|
|
41
71
|
}
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
72
|
+
if (server !== undefined && importers.size !== 0) {
|
|
73
|
+
invalidateImporters(server, importers);
|
|
74
|
+
sendFullReload(server);
|
|
45
75
|
}
|
|
46
|
-
|
|
47
|
-
|
|
76
|
+
};
|
|
77
|
+
const enqueue = (file, observed) => {
|
|
78
|
+
const absolute = path.resolve(file);
|
|
79
|
+
const direct = entries.get(absolute);
|
|
80
|
+
if (direct !== undefined && observed)
|
|
81
|
+
direct.observed = true;
|
|
82
|
+
for (const candidate of [absolute, path.dirname(absolute)]) {
|
|
83
|
+
const entry = entries.get(candidate);
|
|
84
|
+
if (entry !== undefined)
|
|
85
|
+
pending.add(entry);
|
|
86
|
+
}
|
|
87
|
+
if (pending.size === 0 || flushTimer !== undefined)
|
|
88
|
+
return;
|
|
89
|
+
flushTimer = setTimeout(() => {
|
|
90
|
+
flushTimer = undefined;
|
|
91
|
+
const selected = [...pending];
|
|
92
|
+
pending.clear();
|
|
93
|
+
check(selected);
|
|
94
|
+
}, 0);
|
|
95
|
+
flushTimer.unref();
|
|
96
|
+
};
|
|
97
|
+
const ensureWatcher = () => {
|
|
98
|
+
if (watcher !== undefined)
|
|
99
|
+
return watcher;
|
|
100
|
+
// Chokidar's persistent:false backend omits its native error listener on
|
|
101
|
+
// Windows. Keep the owned subscription alive until dispose() closes it.
|
|
102
|
+
const active = chokidar.watch([], { depth: 0, ignoreInitial: false });
|
|
103
|
+
watcher = active;
|
|
104
|
+
// Initial add events compare compiler-time evidence too: an edit between
|
|
105
|
+
// compilation and asynchronous watcher setup must not be missed.
|
|
106
|
+
active.on("all", (event, file) => {
|
|
107
|
+
if (watcher === active)
|
|
108
|
+
enqueue(file, event === "add" || event === "addDir");
|
|
109
|
+
});
|
|
110
|
+
active.on("error", () => {
|
|
111
|
+
if (watcher === active)
|
|
112
|
+
failed = true;
|
|
113
|
+
});
|
|
114
|
+
poller = setInterval(() => {
|
|
115
|
+
const selected = new Set([...entries.values()].filter((entry) => failed || entry.poll || !entry.observed));
|
|
116
|
+
// Files reached through one linked directory share one topology check.
|
|
117
|
+
// Content edits remain event-driven; retargeting a junction does not
|
|
118
|
+
// reliably emit an event on its previously watched descendants.
|
|
119
|
+
for (const [file, link] of links) {
|
|
120
|
+
const target = realpath(file);
|
|
121
|
+
if (target !== link.target) {
|
|
122
|
+
link.target = target;
|
|
123
|
+
for (const entry of link.inputs) {
|
|
124
|
+
selected.add(entry);
|
|
125
|
+
entry.observed = false;
|
|
126
|
+
active.unwatch(entry.file);
|
|
127
|
+
active.add(entry.file);
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
check(selected);
|
|
132
|
+
}, 500);
|
|
133
|
+
poller.unref();
|
|
134
|
+
return watcher;
|
|
48
135
|
};
|
|
49
136
|
return {
|
|
50
137
|
attach(next) {
|
|
51
138
|
server = next;
|
|
52
139
|
},
|
|
53
|
-
dispose() {
|
|
140
|
+
async dispose() {
|
|
54
141
|
entries.clear();
|
|
55
|
-
|
|
142
|
+
importerInputs.clear();
|
|
143
|
+
pending.clear();
|
|
144
|
+
links.clear();
|
|
145
|
+
if (poller !== undefined)
|
|
56
146
|
clearInterval(poller);
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
serving() {
|
|
67
|
-
return server !== undefined;
|
|
147
|
+
if (flushTimer !== undefined)
|
|
148
|
+
clearTimeout(flushTimer);
|
|
149
|
+
poller = undefined;
|
|
150
|
+
flushTimer = undefined;
|
|
151
|
+
const closing = watcher;
|
|
152
|
+
watcher = undefined;
|
|
153
|
+
failed = false;
|
|
154
|
+
await closing?.close();
|
|
155
|
+
// Retain the attached server across overlapping Vite restart containers.
|
|
68
156
|
},
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
const identity = viteServeMissingInputWatchKey(spelling, condition);
|
|
72
|
-
const existing = entries.get(identity);
|
|
73
|
-
if (existing !== undefined) {
|
|
74
|
-
existing.importers.add(path.resolve(importer));
|
|
157
|
+
replace(importer, inputs, failed = false) {
|
|
158
|
+
if (server === undefined)
|
|
75
159
|
return;
|
|
160
|
+
importer = path.resolve(importer);
|
|
161
|
+
const previous = importerInputs.get(importer) ?? new Map();
|
|
162
|
+
if (failed) {
|
|
163
|
+
// An exception can omit the dependency whose deletion caused it.
|
|
164
|
+
// Keep the last successful spellings until a successful delivery can
|
|
165
|
+
// replace them, observing their current failed state for recovery.
|
|
166
|
+
const reported = new Set(inputs.map((input) => path.resolve(input.file)));
|
|
167
|
+
inputs = [
|
|
168
|
+
...inputs,
|
|
169
|
+
...[...previous.keys()]
|
|
170
|
+
.filter((file) => !reported.has(file))
|
|
171
|
+
.map((file) => ({ file })),
|
|
172
|
+
];
|
|
76
173
|
}
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
174
|
+
const current = new Map();
|
|
175
|
+
const added = [];
|
|
176
|
+
for (const input of inputs) {
|
|
177
|
+
const file = path.resolve(input.file);
|
|
178
|
+
const evidence = input.evidence;
|
|
179
|
+
const key = JSON.stringify(evidence ?? null);
|
|
180
|
+
current.set(file, key);
|
|
181
|
+
let entry = entries.get(file);
|
|
182
|
+
if (entry === undefined) {
|
|
183
|
+
entry = {
|
|
184
|
+
file,
|
|
185
|
+
conditions: new Map(),
|
|
186
|
+
poll: false,
|
|
187
|
+
observed: false,
|
|
188
|
+
links: new Set(),
|
|
189
|
+
};
|
|
190
|
+
entries.set(file, entry);
|
|
191
|
+
added.push(file);
|
|
192
|
+
const directory = path.dirname(file);
|
|
193
|
+
const directoryTarget = realpath(directory);
|
|
194
|
+
const fileTarget = realpath(file);
|
|
195
|
+
const linked = [
|
|
196
|
+
...(directoryTarget !== undefined &&
|
|
197
|
+
!sameSpelling(directory, directoryTarget)
|
|
198
|
+
? [directory]
|
|
199
|
+
: []),
|
|
200
|
+
...(fileTarget !== undefined &&
|
|
201
|
+
directoryTarget !== undefined &&
|
|
202
|
+
!sameSpelling(fileTarget, path.join(directoryTarget, path.basename(file)))
|
|
203
|
+
? [file]
|
|
204
|
+
: []),
|
|
205
|
+
];
|
|
206
|
+
for (const linkedFile of linked) {
|
|
207
|
+
let link = links.get(linkedFile);
|
|
208
|
+
if (link === undefined) {
|
|
209
|
+
link = { target: realpath(linkedFile), inputs: new Set() };
|
|
210
|
+
links.set(linkedFile, link);
|
|
211
|
+
}
|
|
212
|
+
link.inputs.add(entry);
|
|
213
|
+
entry.links.add(linkedFile);
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
let condition = entry.conditions.get(key);
|
|
217
|
+
if (condition === undefined) {
|
|
218
|
+
condition = {
|
|
219
|
+
evidence,
|
|
220
|
+
baseline: evidence?.state === undefined
|
|
221
|
+
? transform.captureWatchInputBaseline(file)
|
|
222
|
+
: undefined,
|
|
223
|
+
importers: new Set(),
|
|
224
|
+
};
|
|
225
|
+
entry.conditions.set(key, condition);
|
|
226
|
+
}
|
|
227
|
+
condition.importers.add(importer);
|
|
228
|
+
const observation = evidence?.state?.codec === "predicates"
|
|
229
|
+
? evidence.state.observation
|
|
230
|
+
: undefined;
|
|
231
|
+
entry.poll ||=
|
|
232
|
+
evidence?.missing === true ||
|
|
233
|
+
evidence?.unavailable !== undefined ||
|
|
234
|
+
(observation !== undefined &&
|
|
235
|
+
observation.fileExists !== true &&
|
|
236
|
+
observation.stat !== "file" &&
|
|
237
|
+
observation.readFile?.ok !== true) ||
|
|
238
|
+
(evidence?.state === undefined &&
|
|
239
|
+
condition.baseline?.fileExists !== true);
|
|
86
240
|
}
|
|
241
|
+
for (const [file, key] of previous) {
|
|
242
|
+
if (current.get(file) === key)
|
|
243
|
+
continue;
|
|
244
|
+
const entry = entries.get(file);
|
|
245
|
+
const condition = entry?.conditions.get(key);
|
|
246
|
+
condition?.importers.delete(importer);
|
|
247
|
+
if (condition?.importers.size === 0)
|
|
248
|
+
entry?.conditions.delete(key);
|
|
249
|
+
if (entry?.conditions.size === 0 && !current.has(file)) {
|
|
250
|
+
remove(entry);
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
importerInputs.set(importer, current);
|
|
254
|
+
if (added.length !== 0)
|
|
255
|
+
ensureWatcher().add(added);
|
|
87
256
|
},
|
|
88
257
|
};
|
|
89
258
|
}
|
|
90
|
-
|
|
91
|
-
function viteServeMissingInputWatchKey(input, condition) {
|
|
92
|
-
// Missing aliases can share a physical parent now and later retarget or
|
|
93
|
-
// diverge. Neither predicate may let one lexical spelling answer for another.
|
|
94
|
-
const predicate = typeof condition === "string"
|
|
95
|
-
? condition
|
|
96
|
-
: `predicates:${JSON.stringify([
|
|
97
|
-
condition.accessibleEntries === undefined
|
|
98
|
-
? null
|
|
99
|
-
: [
|
|
100
|
-
condition.accessibleEntries.directories,
|
|
101
|
-
condition.accessibleEntries.files,
|
|
102
|
-
],
|
|
103
|
-
condition.directoryExists ?? null,
|
|
104
|
-
condition.fileExists ?? null,
|
|
105
|
-
condition.readFile === undefined
|
|
106
|
-
? null
|
|
107
|
-
: condition.readFile.ok
|
|
108
|
-
? [true, condition.readFile.hash]
|
|
109
|
-
: [false],
|
|
110
|
-
condition.realpath === undefined
|
|
111
|
-
? null
|
|
112
|
-
: condition.realpath.ok
|
|
113
|
-
? [true, condition.realpath.path]
|
|
114
|
-
: [false],
|
|
115
|
-
condition.stat ?? null,
|
|
116
|
-
])}`;
|
|
117
|
-
return `${predicate}:${path.resolve(input)}`;
|
|
118
|
-
}
|
|
119
|
-
/** Whether one registered condition no longer describes its lexical path. */
|
|
120
|
-
function viteServeInputWatchConditionChanged(entry) {
|
|
121
|
-
if (typeof entry.condition !== "string") {
|
|
122
|
-
return (transform.validateGraphInputObservation(entry.spelling, entry.condition).length !==
|
|
123
|
-
0);
|
|
124
|
-
}
|
|
259
|
+
function realpath(file) {
|
|
125
260
|
try {
|
|
126
|
-
|
|
127
|
-
return false;
|
|
128
|
-
}
|
|
129
|
-
return (entry.condition === "exists" || !fs.statSync(entry.spelling).isDirectory());
|
|
261
|
+
return fs.realpathSync.native(file);
|
|
130
262
|
}
|
|
131
263
|
catch {
|
|
132
|
-
return
|
|
264
|
+
return undefined;
|
|
133
265
|
}
|
|
134
266
|
}
|
|
267
|
+
function sameSpelling(left, right) {
|
|
268
|
+
return process.platform === "win32"
|
|
269
|
+
? left.toLowerCase() === right.toLowerCase()
|
|
270
|
+
: left === right;
|
|
271
|
+
}
|
|
135
272
|
/**
|
|
136
273
|
* Invalidate every module-graph node of the registered importers so the next
|
|
137
274
|
* request retransforms them. Importers keep their original absolute spelling so
|
|
@@ -216,6 +353,5 @@ function sendFullReload(server) {
|
|
|
216
353
|
}
|
|
217
354
|
}
|
|
218
355
|
|
|
219
|
-
exports.
|
|
220
|
-
exports.viteServeMissingInputWatchKey = viteServeMissingInputWatchKey;
|
|
356
|
+
exports.createViteServeInputWatch = createViteServeInputWatch;
|
|
221
357
|
//# sourceMappingURL=viteServe.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"viteServe.js","sources":["../../src/core/viteServe.ts"],"sourcesContent":[null],"names":["validateGraphInputObservation","pathIdentityKey"],"mappings":";;;;;;AAMA;;;;;;;;;;AAUG;AACH,MAAM,2BAA2B,GAAG,GAAG;AA4FvC;SACgB,gCAAgC,GAAA;AAC9C,IAAA,MAAM,OAAO,GAAG,IAAI,GAAG,EAA8B;AACrD,IAAA,IAAI,MAAkC;AACtC,IAAA,IAAI,MAAqC;IAEzC,MAAM,kBAAkB,GAAG,MAAW;QACpC,IAAI,OAAO,CAAC,IAAI,KAAK,CAAC,IAAI,MAAM,KAAK,SAAS,EAAE;YAC9C;QACF;QACA,aAAa,CAAC,MAAM,CAAC;QACrB,MAAM,GAAG,SAAS;AACpB,IAAA,CAAC;IACD,MAAM,IAAI,GAAG,MAAW;AACtB,QAAA,MAAM,SAAS,GAAG,IAAI,GAAG,EAAU;QACnC,KAAK,MAAM,CAAC,QAAQ,EAAE,KAAK,CAAC,IAAI,OAAO,EAAE;AACvC,YAAA,IAAI,CAAC,mCAAmC,CAAC,KAAK,CAAC,EAAE;gBAC/C;YACF;AACA,YAAA,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC;AACxB,YAAA,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;AACH,SAAS,mBAAmB,CAC1B,KAA0B,EAC1B,QAAgB,EAAA;AAEhB,IAAA,MAAM,MAAM,GAAG,KAAK,CAAC,gBAAgB,GAAG,QAAQ,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;IACrE,IAAI,MAAM,KAAK,SAAS,IAAI,MAAM,CAAC,IAAI,KAAK,CAAC,EAAE;AAC7C,QAAA,OAAO,CAAC,GAAG,MAAM,CAAC;IACpB;AACA,IAAA,MAAM,QAAQ,GAAGC,yBAAe,CAAC,QAAQ,CAAC;IAC1C,MAAM,MAAM,GAAyB,EAAE;AACvC,IAAA,KAAK,MAAM,CAAC,IAAI,EAAE,KAAK,CAAC,IAAI,KAAK,CAAC,gBAAgB,IAAI,EAAE,EAAE;AACxD,QAAA,IAAI,OAAO,IAAI,KAAK,QAAQ,IAAIA,yBAAe,CAAC,IAAI,CAAC,KAAK,QAAQ,EAAE;AAClE,YAAA,MAAM,CAAC,IAAI,CAAC,GAAG,KAAK,CAAC;QACvB;IACF;AACA,IAAA,OAAO,MAAM;AACf;AAEA;;;;AAIG;AACH,SAAS,cAAc,CAAC,MAAyB,EAAA;IAC/C,KAAK,MAAM,OAAO,IAAI;AACpB,QAAA,MAAM,CAAC,EAAE;AACT,QAAA,MAAM,CAAC,GAAG;AACV,QAAA,MAAM,CAAC,YAAY,EAAE,MAAM,EAAE,GAAG;AACjC,KAAA,EAAE;AACD,QAAA,IAAI,OAAO,EAAE,IAAI,KAAK,SAAS,EAAE;YAC/B;QACF;AACA,QAAA,IAAI;AACF,YAAA,OAAO,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,GAAG,EAAE,IAAI,EAAE,aAAa,EAAE,CAAC;YAChD;QACF;AAAE,QAAA,MAAM;;;QAGR;IACF;AACF;;;;;"}
|
|
1
|
+
{"version":3,"file":"viteServe.js","sources":["../../src/core/viteServe.ts"],"sourcesContent":[null],"names":["validateGraphInputObservation","captureWatchInputBaseline","watchInputEvidenceMatchesBase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