@ttsc/unplugin 0.30.3 → 0.30.4

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.
@@ -30,27 +30,46 @@ interface ViteEnvironmentLike {
30
30
  * carries.
31
31
  */
32
32
  export interface ViteDevServerLike {
33
+ config?: {
34
+ root?: string;
35
+ };
33
36
  environments?: Record<string, ViteEnvironmentLike>;
34
37
  hot?: ViteHotChannelLike;
35
38
  moduleGraph?: ViteModuleGraphLike;
36
39
  ws?: ViteHotChannelLike;
37
40
  }
41
+ export interface ViteServeWatchOperations {
42
+ /** Override case-policy discovery for a simulated host filesystem. */
43
+ caseSensitive?(directory: string): boolean;
44
+ /** Override path semantics when testing a non-host platform. */
45
+ platform?: NodeJS.Platform;
46
+ poll(listener: () => void): {
47
+ close(): void;
48
+ };
49
+ watch(root: string, listener: (eventType: string, file: string | null) => void, onError: () => void): {
50
+ close(): void;
51
+ };
52
+ }
38
53
  /** Serve-time compiler dependencies never enter Vite's runtime import graph. */
39
54
  export interface ViteServeInputWatch {
40
55
  attach(server: ViteDevServerLike): void;
56
+ begin(): number;
41
57
  dispose(): Promise<void>;
42
- replace(importer: string, inputs: readonly TtscWatchInput[], failed?: boolean): void;
58
+ /** Release every compiler input owned by one removed source module. */
59
+ forget(importer: string): void;
60
+ replace(importer: string, inputs: readonly TtscWatchInput[], failed?: boolean, startedAt?: number): void;
43
61
  }
44
62
  /**
45
- * One filesystem subscription per unique input, shared by all served modules.
63
+ * A bounded recursive filesystem observer shared by all served modules.
46
64
  *
47
65
  * Vite resolves transform-context addWatchFile as a runtime import, including
48
66
  * type-only .server files and non-module plugin assets. Use a separate watcher
49
67
  * for compiler inputs, including node_modules, which Vite's watcher ignores.
50
68
  * 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.
69
+ * Missing spellings and directory predicates use the recursive observer for
70
+ * their nearest available scope. Inputs a native scope cannot safely cover
71
+ * share one bounded fallback poll; linked files also share topology checks
72
+ * because retargeting a junction need not emit events on its old descendants.
54
73
  */
55
- export declare function createViteServeInputWatch(): ViteServeInputWatch;
74
+ export declare function createViteServeInputWatch(operations?: Partial<ViteServeWatchOperations>): ViteServeInputWatch;
56
75
  export {};
@@ -30,27 +30,46 @@ interface ViteEnvironmentLike {
30
30
  * carries.
31
31
  */
32
32
  export interface ViteDevServerLike {
33
+ config?: {
34
+ root?: string;
35
+ };
33
36
  environments?: Record<string, ViteEnvironmentLike>;
34
37
  hot?: ViteHotChannelLike;
35
38
  moduleGraph?: ViteModuleGraphLike;
36
39
  ws?: ViteHotChannelLike;
37
40
  }
41
+ export interface ViteServeWatchOperations {
42
+ /** Override case-policy discovery for a simulated host filesystem. */
43
+ caseSensitive?(directory: string): boolean;
44
+ /** Override path semantics when testing a non-host platform. */
45
+ platform?: NodeJS.Platform;
46
+ poll(listener: () => void): {
47
+ close(): void;
48
+ };
49
+ watch(root: string, listener: (eventType: string, file: string | null) => void, onError: () => void): {
50
+ close(): void;
51
+ };
52
+ }
38
53
  /** Serve-time compiler dependencies never enter Vite's runtime import graph. */
39
54
  export interface ViteServeInputWatch {
40
55
  attach(server: ViteDevServerLike): void;
56
+ begin(): number;
41
57
  dispose(): Promise<void>;
42
- replace(importer: string, inputs: readonly TtscWatchInput[], failed?: boolean): void;
58
+ /** Release every compiler input owned by one removed source module. */
59
+ forget(importer: string): void;
60
+ replace(importer: string, inputs: readonly TtscWatchInput[], failed?: boolean, startedAt?: number): void;
43
61
  }
44
62
  /**
45
- * One filesystem subscription per unique input, shared by all served modules.
63
+ * A bounded recursive filesystem observer shared by all served modules.
46
64
  *
47
65
  * Vite resolves transform-context addWatchFile as a runtime import, including
48
66
  * type-only .server files and non-module plugin assets. Use a separate watcher
49
67
  * for compiler inputs, including node_modules, which Vite's watcher ignores.
50
68
  * 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.
69
+ * Missing spellings and directory predicates use the recursive observer for
70
+ * their nearest available scope. Inputs a native scope cannot safely cover
71
+ * share one bounded fallback poll; linked files also share topology checks
72
+ * because retargeting a junction need not emit events on its old descendants.
54
73
  */
55
- export declare function createViteServeInputWatch(): ViteServeInputWatch;
74
+ export declare function createViteServeInputWatch(operations?: Partial<ViteServeWatchOperations>): ViteServeInputWatch;
56
75
  export {};
@@ -30,27 +30,46 @@ interface ViteEnvironmentLike {
30
30
  * carries.
31
31
  */
32
32
  export interface ViteDevServerLike {
33
+ config?: {
34
+ root?: string;
35
+ };
33
36
  environments?: Record<string, ViteEnvironmentLike>;
34
37
  hot?: ViteHotChannelLike;
35
38
  moduleGraph?: ViteModuleGraphLike;
36
39
  ws?: ViteHotChannelLike;
37
40
  }
41
+ export interface ViteServeWatchOperations {
42
+ /** Override case-policy discovery for a simulated host filesystem. */
43
+ caseSensitive?(directory: string): boolean;
44
+ /** Override path semantics when testing a non-host platform. */
45
+ platform?: NodeJS.Platform;
46
+ poll(listener: () => void): {
47
+ close(): void;
48
+ };
49
+ watch(root: string, listener: (eventType: string, file: string | null) => void, onError: () => void): {
50
+ close(): void;
51
+ };
52
+ }
38
53
  /** Serve-time compiler dependencies never enter Vite's runtime import graph. */
39
54
  export interface ViteServeInputWatch {
40
55
  attach(server: ViteDevServerLike): void;
56
+ begin(): number;
41
57
  dispose(): Promise<void>;
42
- replace(importer: string, inputs: readonly TtscWatchInput[], failed?: boolean): void;
58
+ /** Release every compiler input owned by one removed source module. */
59
+ forget(importer: string): void;
60
+ replace(importer: string, inputs: readonly TtscWatchInput[], failed?: boolean, startedAt?: number): void;
43
61
  }
44
62
  /**
45
- * One filesystem subscription per unique input, shared by all served modules.
63
+ * A bounded recursive filesystem observer shared by all served modules.
46
64
  *
47
65
  * Vite resolves transform-context addWatchFile as a runtime import, including
48
66
  * type-only .server files and non-module plugin assets. Use a separate watcher
49
67
  * for compiler inputs, including node_modules, which Vite's watcher ignores.
50
68
  * 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.
69
+ * Missing spellings and directory predicates use the recursive observer for
70
+ * their nearest available scope. Inputs a native scope cannot safely cover
71
+ * share one bounded fallback poll; linked files also share topology checks
72
+ * because retargeting a junction need not emit events on its old descendants.
54
73
  */
55
- export declare function createViteServeInputWatch(): ViteServeInputWatch;
74
+ export declare function createViteServeInputWatch(operations?: Partial<ViteServeWatchOperations>): ViteServeInputWatch;
56
75
  export {};