@animus-ui/vite-plugin 0.1.24 → 0.1.26
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/asset-copy-dirs.d.ts +10 -0
- package/dist/asset-copy-dirs.d.ts.map +1 -0
- package/dist/build-start.d.ts +2 -1
- package/dist/build-start.d.ts.map +1 -1
- package/dist/config.d.ts.map +1 -1
- package/dist/context.d.ts +136 -141
- package/dist/context.d.ts.map +1 -1
- package/dist/hmr.d.ts +8 -2
- package/dist/hmr.d.ts.map +1 -1
- package/dist/index.cjs +733 -903
- package/dist/index.d.ts +3 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/rediscovery.d.ts +11 -15
- package/dist/rediscovery.d.ts.map +1 -1
- package/dist/session-outcomes.d.ts +23 -0
- package/dist/session-outcomes.d.ts.map +1 -0
- package/dist/transform.d.ts +1 -1
- package/dist/transform.d.ts.map +1 -1
- package/dist/virtual-modules.d.ts.map +1 -1
- package/package.json +3 -3
- package/dist/reset-coalescer.d.ts +0 -21
- package/dist/reset-coalescer.d.ts.map +0 -1
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Each process's dev asset copies live in their own directory, named by its
|
|
3
|
+
* pid and start time, so a sweep can tell an abandoned directory from a
|
|
4
|
+
* live server's even when the pid has been reused.
|
|
5
|
+
*/
|
|
6
|
+
/** This process's copy directory name: `<pid>-<start ms>`. */
|
|
7
|
+
export declare function processCopyDir(): string;
|
|
8
|
+
/** Removes every other process's copy directory whose owner is not live. */
|
|
9
|
+
export declare function sweepAbandonedCopyDirs(copyRoot: string): void;
|
|
10
|
+
//# sourceMappingURL=asset-copy-dirs.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"asset-copy-dirs.d.ts","sourceRoot":"","sources":["../src/asset-copy-dirs.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAcH,8DAA8D;AAC9D,wBAAgB,cAAc,IAAI,MAAM,CAEvC;AAoDD,4EAA4E;AAC5E,wBAAgB,sBAAsB,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,CAa7D"}
|
package/dist/build-start.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import type { PluginContext } from './context';
|
|
2
|
+
import type { HostResolve } from '@animus-ui/extract/pipeline';
|
|
2
3
|
/**
|
|
3
4
|
* `resolveSpecifier` maps a specifier to an absolute id. `emitAsset` is
|
|
4
5
|
* present in build only, where `asset()` files become Rollup assets.
|
|
5
6
|
*/
|
|
6
|
-
export declare function runBuildStart(ctx: PluginContext, resolveSpecifier:
|
|
7
|
+
export declare function runBuildStart(ctx: PluginContext, resolveSpecifier: HostResolve, emitAsset?: (fileName: string, source: Uint8Array) => string): Promise<void>;
|
|
7
8
|
//# sourceMappingURL=build-start.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build-start.d.ts","sourceRoot":"","sources":["../src/build-start.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"build-start.d.ts","sourceRoot":"","sources":["../src/build-start.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAC/C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAE/D;;;GAGG;AACH,wBAAsB,aAAa,CACjC,GAAG,EAAE,aAAa,EAClB,gBAAgB,EAAE,WAAW,EAC7B,SAAS,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,UAAU,KAAK,MAAM,GAC3D,OAAO,CAAC,IAAI,CAAC,CAgJf"}
|
package/dist/config.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAC/C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,MAAM,CAAC;AAE3C,wBAAgB,mBAAmB,CACjC,GAAG,EAAE,aAAa,EAClB,MAAM,EAAE,cAAc,GACrB,IAAI,CAsEN"}
|
package/dist/context.d.ts
CHANGED
|
@@ -1,32 +1,26 @@
|
|
|
1
|
+
import { ExtractionSession } from '@animus-ui/extract/session';
|
|
1
2
|
import { HotUpdateEvents } from './hot-update-events';
|
|
2
3
|
import type { LightningTargets } from './css';
|
|
3
4
|
import type { AnimusExtractOptions } from './index';
|
|
4
|
-
import type { ExcludeMatcher, ExternalPackageOutcome,
|
|
5
|
+
import type { ExcludeMatcher, ExternalPackageOutcome, HostAssetClassification, HostExtensionPolicy, HostLoadExpander, ProjectManifest, SystemConfig } from '@animus-ui/extract/pipeline';
|
|
6
|
+
import type { SessionOutcome, WatchChanges } from '@animus-ui/extract/session';
|
|
5
7
|
import type { Logger } from 'vite';
|
|
6
|
-
/**
|
|
7
|
-
*
|
|
8
|
-
export
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
*
|
|
14
|
-
export
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
}>, rootDir: string, absPath: string): boolean;
|
|
18
|
-
/** A discovery's analysis input: its entries, and the file-cache seeding
|
|
19
|
-
* that follows their ingestion. */
|
|
20
|
-
export type DiscoveredSources = {
|
|
21
|
-
rawEntries: readonly RawSourceEntry[];
|
|
22
|
-
afterIngestion: (accepted: SourceIngestionResult) => void;
|
|
23
|
-
};
|
|
8
|
+
/** A Session outcome, and whether its publication changed the served
|
|
9
|
+
* system-props module. */
|
|
10
|
+
export interface ObservedOutcome {
|
|
11
|
+
outcome: SessionOutcome;
|
|
12
|
+
systemPropsChanged: boolean;
|
|
13
|
+
}
|
|
14
|
+
/** One environment's build, as Vite hands it to a hook: the object is its
|
|
15
|
+
* identity, the name its key. */
|
|
16
|
+
export interface BuildingEnvironment {
|
|
17
|
+
readonly name: string;
|
|
18
|
+
}
|
|
24
19
|
export declare class PluginContext {
|
|
25
20
|
readonly options: AnimusExtractOptions;
|
|
26
21
|
readonly verbose: boolean;
|
|
27
22
|
/** The higher tier: `verbose: 'trace'` or `ANIMUS_DEBUG=trace`. */
|
|
28
23
|
readonly tracing: boolean;
|
|
29
|
-
readonly staticCssJson: string | null;
|
|
30
24
|
isProd: boolean;
|
|
31
25
|
/** Serving or watching: an error-level diagnostic reports, and only a
|
|
32
26
|
* one-shot build fails on one. */
|
|
@@ -37,96 +31,136 @@ export declare class PluginContext {
|
|
|
37
31
|
rootDir: string;
|
|
38
32
|
logger: Logger | null;
|
|
39
33
|
system: SystemConfig;
|
|
40
|
-
/** Whether a system has loaded, so a failed reload has one to keep. */
|
|
41
|
-
private systemLoaded;
|
|
42
34
|
lcssTargets: LightningTargets;
|
|
43
35
|
pathAliasesJson: string | null;
|
|
44
36
|
/** Vite's export conditions, so the loader reads the files Vite serves. */
|
|
45
37
|
resolveConditions: string[];
|
|
46
|
-
/**
|
|
47
|
-
|
|
38
|
+
/** Vite's resolved extension order; the built-in policy until
|
|
39
|
+
* `configResolved`. */
|
|
40
|
+
extensionPolicy: HostExtensionPolicy;
|
|
41
|
+
/** Vite's asset classification, captured at `configResolved`. */
|
|
42
|
+
assetClassification: HostAssetClassification;
|
|
43
|
+
/** How Vite's build expands computed loads, captured at
|
|
44
|
+
* `configResolved`; none where it cannot be reproduced exactly. */
|
|
45
|
+
loadExpander: HostLoadExpander | undefined;
|
|
48
46
|
extensionsSet: ReadonlySet<string>;
|
|
47
|
+
/** Built once per buildStart, before any discovery, from the user's
|
|
48
|
+
* exclude list and the output directory. */
|
|
49
49
|
excludeMatcher: ExcludeMatcher;
|
|
50
|
+
/** Where Vite writes, every environment's output directories and files,
|
|
51
|
+
* as structural exclusions; none outside the root. Set in
|
|
52
|
+
* `configResolved`. */
|
|
53
|
+
outputExcludes: string[];
|
|
50
54
|
storedManifest: ProjectManifest | null;
|
|
51
55
|
storedManifestJson: string;
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
56
|
+
/** The analysis sheets with their asset() placeholders. They are read
|
|
57
|
+
* through `globalCss` and `resolvedComponentCss`, which substitute the
|
|
58
|
+
* current asset URLs, so an edited asset changes its URL without
|
|
59
|
+
* re-analysis. */
|
|
60
|
+
private analysisGlobalCss;
|
|
61
|
+
private analysisComponentCss;
|
|
62
|
+
get globalCss(): string;
|
|
63
|
+
set globalCss(css: string);
|
|
64
|
+
get resolvedComponentCss(): string;
|
|
65
|
+
set resolvedComponentCss(css: string);
|
|
66
|
+
private substitutedSheets;
|
|
55
67
|
layerDeclaration: string;
|
|
56
68
|
transformOutputHashes: Map<string, string>;
|
|
57
69
|
recordTransformOutput(relativePath: string, code: string): void;
|
|
58
70
|
reverseProvenance: Record<string, string[]>;
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
readonly fileCache: ReadonlyMap<string, {
|
|
64
|
-
hash: string;
|
|
65
|
-
source: string;
|
|
66
|
-
}>;
|
|
67
|
-
/** Mutation attempts against `fileCache`, for memos that must not key on
|
|
68
|
-
* `size` — a delete plus an unrelated create leaves it unchanged. */
|
|
69
|
-
fileCacheGeneration: number;
|
|
70
|
-
/** The one mutator of the raw-source cache: every add, replacement and
|
|
71
|
-
* deletion goes through here so no write escapes the counter above. */
|
|
72
|
-
mutateFileCache<T>(mutate: (cache: Map<string, {
|
|
73
|
-
hash: string;
|
|
74
|
-
source: string;
|
|
75
|
-
}>) => T): T;
|
|
76
|
-
/** Generated MDX/Svelte paths never enter `fileCache` — they live only in
|
|
77
|
-
* this corpus's published projection. */
|
|
78
|
-
readonly corpus: SourceCorpus;
|
|
79
|
-
rawExtensionFallbacks: Set<string>;
|
|
71
|
+
/** The exact source `virtual:animus/system-props` serves: the last
|
|
72
|
+
* publication's, so the served bytes and the HMR change decision cannot
|
|
73
|
+
* diverge. */
|
|
74
|
+
systemPropsModule: string;
|
|
80
75
|
/** Original path → hash of bytes whose parse aborted in a rejected attempt;
|
|
81
76
|
* non-empty while that rejection holds publication. Those bytes are served
|
|
82
77
|
* raw so the host reports its own syntax error instead of receiving the
|
|
83
78
|
* previous module from the retained engine. */
|
|
84
79
|
readonly abortedParseHashes: Map<string, string>;
|
|
85
|
-
/** A system reload is pending: the next analysis attempt loads the latest
|
|
86
|
-
* system. A parse hold keeps it pending and the published system served;
|
|
87
|
-
* new dependency watch keys stay registered meanwhile. */
|
|
88
|
-
systemReloadOwed: boolean;
|
|
89
|
-
/** The one mutator of a file's fallback state — every raw-serve exit of the
|
|
90
|
-
* transform hook reports here, except aborted bytes, which never execute.
|
|
91
|
-
* Production keeps the set empty. The
|
|
92
|
-
* barrier's one-shot withhold release must not route through here: it
|
|
93
|
-
* retires other files' records, no claim about their current serve. */
|
|
94
|
-
recordFallbackState(relativePath: string, isFallback: boolean): void;
|
|
95
80
|
readonly hotUpdateEvents: HotUpdateEvents;
|
|
96
|
-
|
|
97
|
-
|
|
81
|
+
/** Coalesces a burst of invalidations into one full reload. */
|
|
82
|
+
private readonly reloadWindow;
|
|
98
83
|
base: string;
|
|
99
84
|
assetUrlBySpecifier: Map<string, string>;
|
|
85
|
+
/** Where dev asset() copies live, immutable and content-named; null in a
|
|
86
|
+
* build, or when the dev server does not serve the directory, which
|
|
87
|
+
* serves the live files instead. Set in `configResolved`. */
|
|
88
|
+
assetCopyDir: string | null;
|
|
89
|
+
/** specifier → the source file its dev copy was made from. */
|
|
90
|
+
assetSourceBySpecifier: Map<string, string>;
|
|
91
|
+
/** source → its copies, oldest first: the current and the previous. */
|
|
92
|
+
private assetCopyHistory;
|
|
93
|
+
/** Specifiers whose copy the dev server does not serve, warned once. */
|
|
94
|
+
private unservedAssetCopies;
|
|
95
|
+
/** Whether the dev server serves `path`, by Vite's `server.fs` rule;
|
|
96
|
+
* set in `configResolved`. */
|
|
97
|
+
servesFile: (path: string) => boolean;
|
|
100
98
|
assetResolutionFailures: Set<string>;
|
|
101
99
|
assetPassComplete: boolean;
|
|
102
100
|
externalPackageDirs: string[];
|
|
103
|
-
/** Those whose package is linked rather than installed. */
|
|
104
|
-
externalLinkedDirs: string[];
|
|
105
|
-
/** Those read from their package's compiled output. */
|
|
106
|
-
externalOutputDirs: string[];
|
|
107
|
-
externalDirOwners: Record<string, string>;
|
|
108
101
|
/** specifier → whether its redirected source entry has side effects, from
|
|
109
102
|
* the owning package's `sideEffects`; absent leaves Vite's default. */
|
|
110
103
|
externalSourceSideEffects: Map<string, boolean>;
|
|
111
|
-
|
|
112
|
-
externalSourceEntries: Map<string, string>;
|
|
104
|
+
externalSourceEntries: ReadonlyMap<string, string>;
|
|
113
105
|
externalPackageOutcomes: ExternalPackageOutcome[];
|
|
114
|
-
/** The analysed kits' descriptors, from the last discovery. */
|
|
115
|
-
kitDescriptors: KitDescriptorRecord[];
|
|
116
|
-
/** Configured files buildStart or a late rediscovery could not read.
|
|
117
|
-
* Later analyses read no files themselves, so they replay these until the
|
|
118
|
-
* file is read into the cache or deleted. */
|
|
119
|
-
ingestionFailureDiagnostics: ManifestDiagnostic[];
|
|
120
106
|
devServer: any;
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
private v2Engine;
|
|
125
|
-
private v2SentSources;
|
|
126
|
-
private v2DriftWarned;
|
|
107
|
+
/** The Session's path lists already registered with Vite's watcher; the
|
|
108
|
+
* Session replaces a list when it changes. */
|
|
109
|
+
private readonly watchedPathLists;
|
|
127
110
|
/** Every native extraction call goes through this one accessor. */
|
|
128
111
|
readonly engineApi: () => any;
|
|
112
|
+
/** The native module's stateless lookups, before the root resolves: the
|
|
113
|
+
* shared factory, which registers no handle. */
|
|
114
|
+
readonly kitEngine: () => any;
|
|
115
|
+
private engineKey;
|
|
116
|
+
/** This context's build: one Vite config instance, one build. */
|
|
117
|
+
readonly build: string;
|
|
118
|
+
/** The build's Session, created once the Vite root resolves. */
|
|
119
|
+
session: ExtractionSession | null;
|
|
120
|
+
/** The outcomes each in-flight `submitChanges` collects. */
|
|
121
|
+
private readonly outcomeCollectors;
|
|
129
122
|
constructor(options: AnimusExtractOptions, engineApiOverride?: () => any);
|
|
123
|
+
/** Creates the build's Session from the resolved config: Vite's engine,
|
|
124
|
+
* logger and core options, kept in memory. */
|
|
125
|
+
createSession(): ExtractionSession;
|
|
126
|
+
/** Serves each publication as the Session makes it, so every reader in
|
|
127
|
+
* between sees one generation. */
|
|
128
|
+
private observeOutcome;
|
|
129
|
+
/** Submits a dev change set to the Session. Until a first publication
|
|
130
|
+
* there is no generation to update: the full read covers the change. */
|
|
131
|
+
submitChanges(changes: WatchChanges): Promise<ObservedOutcome[]>;
|
|
132
|
+
/** Runs one Session attempt and returns the outcomes that settle it. A
|
|
133
|
+
* hold warns and resolves with its outcome (Vite reports the syntax
|
|
134
|
+
* error itself); any other failure rejects. Either way the watcher
|
|
135
|
+
* learns the paths the attempt's system load named. */
|
|
136
|
+
runAttempt(attempt: (session: ExtractionSession) => Promise<void>): Promise<ObservedOutcome[]>;
|
|
137
|
+
/** Serves the Session's last publication: the manifest, the analysis
|
|
138
|
+
* sheets (asset placeholders kept; Vite substitutes them), the system,
|
|
139
|
+
* the package map and the external-package state. */
|
|
140
|
+
adoptPublication(session: ExtractionSession): void;
|
|
141
|
+
/** The environment a host without environments builds as. */
|
|
142
|
+
readonly singleEnvironment: BuildingEnvironment;
|
|
143
|
+
/** Each environment build that started and has not ended, by name. A
|
|
144
|
+
* custom `buildApp` builds a shared plugin's environments in parallel, so
|
|
145
|
+
* the context's build retires with the last of them, not the first. */
|
|
146
|
+
private readonly openBuilds;
|
|
147
|
+
/** Opens `environment`'s build, after any open build under its name has
|
|
148
|
+
* ended: a builder reused while an earlier build still runs, or a second
|
|
149
|
+
* environment under one name, builds after it rather than beside it.
|
|
150
|
+
* Each build then ends its own generation once, in `buildEnd`. */
|
|
151
|
+
openBuild(environment: BuildingEnvironment): Promise<void>;
|
|
152
|
+
/** Ends `environment`'s open build; whether that left none open. Vite
|
|
153
|
+
* ends each build once, in `buildEnd`, and a dev server ends only the
|
|
154
|
+
* environments that started, so only the build that opened an entry
|
|
155
|
+
* ends it. */
|
|
156
|
+
endBuild(environment: BuildingEnvironment): boolean;
|
|
157
|
+
/** Retires this context's build when Vite closes it: the Session leaves
|
|
158
|
+
* the registry (with its manifest and watch state) and the engine handle
|
|
159
|
+
* is released, injected engine or not. The next build start rejoins. */
|
|
160
|
+
close(): void;
|
|
161
|
+
/** Releases this context's engine handle: a standalone one, which no
|
|
162
|
+
* joined build retires. The next use makes a fresh one. */
|
|
163
|
+
releaseEngine(): void;
|
|
130
164
|
log(msg: string): void;
|
|
131
165
|
/** One line per item — a pruned option, a transformed file, an HMR
|
|
132
166
|
* decision — printed only at the trace tier. */
|
|
@@ -141,53 +175,19 @@ export declare class PluginContext {
|
|
|
141
175
|
/** A build-strictness check that failed: a build throws `message`, and
|
|
142
176
|
* development reports it at error level and takes the non-strict path. */
|
|
143
177
|
strictFailure(message: string, cause?: unknown): void;
|
|
144
|
-
/** Load the system into `this.system`. On failure the previous config is
|
|
145
|
-
* kept; strict mode throws instead, and strict development reports the
|
|
146
|
-
* failure once a system has loaded, since there is one to keep. */
|
|
147
|
-
loadSystem(): void;
|
|
148
|
-
/** The read failures still standing: a file stops counting once the cache
|
|
149
|
-
* holds a read of it or it is gone, as in the shared session, so it stops
|
|
150
|
-
* warning and stops holding pruning off. */
|
|
151
|
-
private unsettledIngestionFailures;
|
|
152
|
-
/** Runs project analysis and updates every manifest-derived state. Returns
|
|
153
|
-
* false when nothing published, and the caller must roll its cache back.
|
|
154
|
-
* While a source is skipped or unreadable, its renders are unseen, so
|
|
155
|
-
* nothing is pruned. */
|
|
156
|
-
runAnalysis(fileEntries: Array<{
|
|
157
|
-
path: string;
|
|
158
|
-
source: string;
|
|
159
|
-
hash?: string;
|
|
160
|
-
}>, skippedOriginals?: readonly string[]): boolean;
|
|
161
|
-
private assertRuntimeImportSuppliesTerminals;
|
|
162
|
-
/** The one ingest → quarantine → analyze → publish transaction. The corpus
|
|
163
|
-
* publishes only on success. `afterIngestion` runs after quarantine even
|
|
164
|
-
* when an aborted parse rejects the attempt; `beforeAnalysis` runs only
|
|
165
|
-
* once the attempt will analyze. A rejection names its aborted originals
|
|
166
|
-
* and holds publication: development callers keep their cache's latest
|
|
167
|
-
* sources, valid edits included, for the repair to publish together. In
|
|
168
|
-
* every strictness mode it fails a production build, which has no
|
|
169
|
-
* generation to keep, and only warns in development: the host reports the
|
|
170
|
-
* syntax error itself, and a throw would leave its client on the failed
|
|
171
|
-
* module. The publication that ends a hold invalidates the modules of
|
|
172
|
-
* every original whose admitted bytes changed meanwhile and returns them
|
|
173
|
-
* as `redeliver`, for a hot update to push to the client. An owed system
|
|
174
|
-
* reload loads the latest system for the attempt: a hold restores the
|
|
175
|
-
* published one and keeps the reload owed, any other outcome completes
|
|
176
|
-
* the reload's invalidation. */
|
|
177
|
-
analyzeIngested(options?: {
|
|
178
|
-
rawEntries?: readonly RawSourceEntry[];
|
|
179
|
-
afterIngestion?: (ingested: SourceIngestionResult) => void;
|
|
180
|
-
beforeAnalysis?: (accepted: SourceIngestionResult) => void;
|
|
181
|
-
}): Promise<{
|
|
182
|
-
ok: boolean;
|
|
183
|
-
accepted: SourceIngestionResult;
|
|
184
|
-
/** Original path → hash of the bytes whose parse aborted. */
|
|
185
|
-
abortedOriginals?: ReadonlyMap<string, string>;
|
|
186
|
-
endedHold: boolean;
|
|
187
|
-
redeliver: string[];
|
|
188
|
-
}>;
|
|
189
|
-
publishSourceIngestion(result: SourceIngestionResult): void;
|
|
190
178
|
devFsUrl(absPath: string): string;
|
|
179
|
+
/** A dev asset() URL: an immutable content-named copy of `absPath`, so an
|
|
180
|
+
* edit gets a new URL, or the live file where copies are not served. */
|
|
181
|
+
devAssetUrl(specifier: string, absPath: string): string;
|
|
182
|
+
/** Keeps each source's current copy and the one before it; an asset
|
|
183
|
+
* edit reloads the page, so an older URL is never fetched again. A copy
|
|
184
|
+
* another source still keeps is never removed. */
|
|
185
|
+
private retainAssetCopy;
|
|
186
|
+
/** Whether `absFile` is the source of a dev asset copy. */
|
|
187
|
+
isAssetSource(absFile: string): boolean;
|
|
188
|
+
/** Copies an edited asset under its new content name and redelivers the
|
|
189
|
+
* stylesheet that names it. */
|
|
190
|
+
refreshAssetCopies(absFile: string): void;
|
|
191
191
|
assetFallback(specifier: string, message: string, cause?: unknown): void;
|
|
192
192
|
/** Every asset() specifier in the sheets the plugin emits. */
|
|
193
193
|
sheetAssetSpecifiers(): string[];
|
|
@@ -196,32 +196,27 @@ export declare class PluginContext {
|
|
|
196
196
|
* `system`, however and whenever that was assigned; `system` keeps the
|
|
197
197
|
* placeholders for the next asset pass. */
|
|
198
198
|
get variableCss(): string;
|
|
199
|
-
/** Substitutes the analysis sheets in place, through the same step as the
|
|
200
|
-
* session; the theme's variable CSS is substituted on read
|
|
201
|
-
* (`variableCss`). */
|
|
202
|
-
substituteSheets(): void;
|
|
203
199
|
/** Resolves asset specifiers a system reload introduced. Node-side only —
|
|
204
200
|
* the plugin hook context is unavailable here, so results can differ. */
|
|
205
201
|
private applyAssetSubstitutions;
|
|
206
|
-
|
|
207
|
-
requestSystemReload(trigger: string): void;
|
|
208
|
-
performSystemReload(): Promise<void>;
|
|
209
|
-
private performSystemReloadExclusive;
|
|
210
|
-
private invalidateSystemReloadModules;
|
|
202
|
+
invalidateSystemReloadModules(reloadClient: boolean): void;
|
|
211
203
|
isSystemDependency(absFile: string): boolean;
|
|
212
|
-
/** Watch every loader-reported dependency path
|
|
213
|
-
*
|
|
204
|
+
/** Watch every loader-reported dependency path, the external package
|
|
205
|
+
* roots, and the paths the load found absent that no watched directory
|
|
206
|
+
* covers (creating one reloads the system). Vite hard-ignores
|
|
207
|
+
* node_modules, so dependencies installed there produce no events. A list
|
|
208
|
+
* already registered is not added again. */
|
|
214
209
|
registerSystemWatchPaths(): void;
|
|
210
|
+
/** The absent paths no watched directory reports a creation for. Vite's
|
|
211
|
+
* root watch and a package root's watch already do, and a watch on an
|
|
212
|
+
* absent file inside a watched directory stops that directory's events
|
|
213
|
+
* under inotify (chokidar's non-fsevents handler). */
|
|
214
|
+
private uncoveredMissingPaths;
|
|
215
215
|
/** Invalidate the component CSS and system-props modules, then reload. The
|
|
216
216
|
* reload alone rescues nothing: Vite keeps serving its cached transform.
|
|
217
217
|
* `devServer.moduleGraph` is the mixed back-compat graph on purpose — it
|
|
218
218
|
* reaches client and ssr at once; per-environment graphs do not. */
|
|
219
219
|
invalidateExtractedModules(): void;
|
|
220
|
-
/** An unresolvable `.includes()` specifier or a stale dist entry under an
|
|
221
|
-
* extended package warns, and fails the build under `strict` (strict
|
|
222
|
-
* development reports it). */
|
|
223
|
-
enforceIncludeResolution(): void;
|
|
224
|
-
enforceExternalTokenContracts(): void;
|
|
225
220
|
runSelfVerify(): void;
|
|
226
221
|
}
|
|
227
222
|
//# sourceMappingURL=context.d.ts.map
|
package/dist/context.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../src/context.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../src/context.ts"],"names":[],"mappings":"AAiBA,OAAO,EAKL,iBAAiB,EAGlB,MAAM,4BAA4B,CAAC;AAWpC,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAEtD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,OAAO,CAAC;AAC9C,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AACpD,OAAO,KAAK,EAEV,cAAc,EACd,sBAAsB,EACtB,uBAAuB,EACvB,mBAAmB,EACnB,gBAAgB,EAChB,eAAe,EACf,YAAY,EACb,MAAM,6BAA6B,CAAC;AACrC,OAAO,KAAK,EAEV,cAAc,EACd,YAAY,EACb,MAAM,4BAA4B,CAAC;AACpC,OAAO,KAAK,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ANGED
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
import type { PluginContext } from './context';
|
|
2
2
|
import type { DevEnvironment, EnvironmentModuleNode, HotUpdateOptions } from 'vite';
|
|
3
3
|
/** Vite dispatches this hook once per environment for one file event: the
|
|
4
|
-
*
|
|
5
|
-
|
|
4
|
+
* dispatch that claims it submits the file to the Session, and invalidation
|
|
5
|
+
* runs in each. */
|
|
6
|
+
export declare function handleHotUpdate(ctx: PluginContext, environment: DevEnvironment, { type, file, timestamp, modules, read }: HotUpdateOptions): Promise<EnvironmentModuleNode[] | void>;
|
|
7
|
+
/** Runs a pending system reload now, closing its window (the window's
|
|
8
|
+
* bypass), and settles with it. */
|
|
9
|
+
export declare function flushSystemReload(ctx: PluginContext): Promise<void>;
|
|
10
|
+
/** Drops a pending system reload: the context is closing. */
|
|
11
|
+
export declare function cancelSystemReload(ctx: PluginContext): void;
|
|
6
12
|
//# sourceMappingURL=hmr.d.ts.map
|
package/dist/hmr.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hmr.d.ts","sourceRoot":"","sources":["../src/hmr.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"hmr.d.ts","sourceRoot":"","sources":["../src/hmr.ts"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAAmB,aAAa,EAAE,MAAM,WAAW,CAAC;AAEhE,OAAO,KAAK,EACV,cAAc,EACd,qBAAqB,EACrB,gBAAgB,EACjB,MAAM,MAAM,CAAC;AAEd;;oBAEoB;AACpB,wBAAsB,eAAe,CACnC,GAAG,EAAE,aAAa,EAClB,WAAW,EAAE,cAAc,EAC3B,EAAE,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE,gBAAgB,GACzD,OAAO,CAAC,qBAAqB,EAAE,GAAG,IAAI,CAAC,CAqDzC;AAwCD;oCACoC;AACpC,wBAAsB,iBAAiB,CAAC,GAAG,EAAE,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC,CAEzE;AAED,6DAA6D;AAC7D,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,aAAa,GAAG,IAAI,CAI3D"}
|