@animus-ui/extract 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/crates/extract-v2/animus-extract-v2.darwin-arm64.node +0 -0
- package/crates/extract-v2/animus-extract-v2.linux-arm64-gnu.node +0 -0
- package/crates/extract-v2/animus-extract-v2.linux-x64-gnu.node +0 -0
- package/crates/extract-v2/index.d.ts +107 -6
- package/dist/index.cjs +48 -5
- package/dist/index.mjs +2 -2
- package/dist/pipeline/alias-agreement.d.ts +107 -0
- package/dist/pipeline/alias-agreement.d.ts.map +1 -0
- package/dist/pipeline/analyze-project-args.d.ts +11 -2
- package/dist/pipeline/analyze-project-args.d.ts.map +1 -1
- package/dist/pipeline/asset-copies.d.ts +20 -0
- package/dist/pipeline/asset-copies.d.ts.map +1 -0
- package/dist/pipeline/built-in-asset-types.d.ts +9 -0
- package/dist/pipeline/built-in-asset-types.d.ts.map +1 -0
- package/dist/pipeline/core-options.d.ts +31 -7
- package/dist/pipeline/core-options.d.ts.map +1 -1
- package/dist/pipeline/discover-packages.d.ts +98 -12
- package/dist/pipeline/discover-packages.d.ts.map +1 -1
- package/dist/pipeline/engine-adapter.d.ts +41 -3
- package/dist/pipeline/engine-adapter.d.ts.map +1 -1
- package/dist/pipeline/engine-retirement.d.ts +7 -1
- package/dist/pipeline/engine-retirement.d.ts.map +1 -1
- package/dist/pipeline/extension-policy.d.ts +95 -0
- package/dist/pipeline/extension-policy.d.ts.map +1 -0
- package/dist/pipeline/host-assets.d.ts +32 -0
- package/dist/pipeline/host-assets.d.ts.map +1 -0
- package/dist/pipeline/host-expansions.d.ts +92 -0
- package/dist/pipeline/host-expansions.d.ts.map +1 -0
- package/dist/pipeline/host-extensions.d.ts +64 -0
- package/dist/pipeline/host-extensions.d.ts.map +1 -0
- package/dist/pipeline/host-package-resolver.d.ts +40 -0
- package/dist/pipeline/host-package-resolver.d.ts.map +1 -0
- package/dist/pipeline/index.d.ts +32 -8
- package/dist/pipeline/index.d.ts.map +1 -1
- package/dist/pipeline/kit-publication.d.ts.map +1 -1
- package/dist/pipeline/manifest-diagnostics.d.ts +27 -6
- package/dist/pipeline/manifest-diagnostics.d.ts.map +1 -1
- package/dist/pipeline/manifest-schema.d.ts +16 -0
- package/dist/pipeline/manifest-schema.d.ts.map +1 -1
- package/dist/pipeline/output-targets.d.ts +52 -0
- package/dist/pipeline/output-targets.d.ts.map +1 -0
- package/dist/pipeline/probe-evidence.d.ts +58 -0
- package/dist/pipeline/probe-evidence.d.ts.map +1 -0
- package/dist/pipeline/run-analysis.d.ts +26 -0
- package/dist/pipeline/run-analysis.d.ts.map +1 -1
- package/dist/pipeline/runtime-import.d.ts +10 -0
- package/dist/pipeline/runtime-import.d.ts.map +1 -0
- package/dist/pipeline/served-files.d.ts +16 -0
- package/dist/pipeline/served-files.d.ts.map +1 -0
- package/dist/pipeline/source-corpus.d.ts +4 -0
- package/dist/pipeline/source-corpus.d.ts.map +1 -1
- package/dist/pipeline/source-ingestion.d.ts +37 -5
- package/dist/pipeline/source-ingestion.d.ts.map +1 -1
- package/dist/pipeline/system-config.d.ts +18 -0
- package/dist/pipeline/system-config.d.ts.map +1 -1
- package/dist/pipeline/system-instances.d.ts +27 -0
- package/dist/pipeline/system-instances.d.ts.map +1 -0
- package/dist/pipeline/tsconfig-paths.d.ts +4 -0
- package/dist/pipeline/tsconfig-paths.d.ts.map +1 -1
- package/dist/pipeline/vite-expansions.d.ts +40 -0
- package/dist/pipeline/vite-expansions.d.ts.map +1 -0
- package/dist/pipeline/webpack-expansions.d.ts +55 -0
- package/dist/pipeline/webpack-expansions.d.ts.map +1 -0
- package/dist/pipeline/workspace-packages.d.ts +13 -0
- package/dist/pipeline/workspace-packages.d.ts.map +1 -0
- package/dist/{pipeline-Bl20tbu_.mjs → pipeline-BzMQ_Z0M.mjs} +2293 -751
- package/dist/{pipeline-CAH9mxnK.cjs → pipeline-DyUf-eKZ.cjs} +2564 -746
- package/dist/session/coalescing-window.d.ts +34 -0
- package/dist/session/coalescing-window.d.ts.map +1 -0
- package/dist/session/extraction-session.d.ts +297 -35
- package/dist/session/extraction-session.d.ts.map +1 -1
- package/dist/session/index.d.ts +7 -3
- package/dist/session/index.d.ts.map +1 -1
- package/dist/session/published-set.d.ts +6 -1
- package/dist/session/published-set.d.ts.map +1 -1
- package/dist/session/resolve-packages.d.ts +9 -5
- package/dist/session/resolve-packages.d.ts.map +1 -1
- package/dist/session/singleton.d.ts +218 -53
- package/dist/session/singleton.d.ts.map +1 -1
- package/dist/session/turbopack-orchestrator.d.ts.map +1 -1
- package/dist/session.cjs +1462 -510
- package/dist/session.mjs +1430 -489
- package/package.json +4 -4
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import type { EngineApi } from './engine-adapter';
|
|
2
|
+
import type { ExtensionOrder, ProbedFile } from './extension-policy';
|
|
2
3
|
import type { KitDescriptorRecord } from './kit-descriptor';
|
|
3
4
|
import type { ManifestDiagnostic } from './manifest-diagnostics';
|
|
4
|
-
import type { ExtractExportFact, ExtractImportFact } from './source-ingestion';
|
|
5
|
+
import type { ExtractExportFact, ExtractFactsResult, ExtractImportFact } from './source-ingestion';
|
|
5
6
|
import type { JsonValue } from './tsconfig-paths';
|
|
7
|
+
import type { WorkspacePackages } from './workspace-packages';
|
|
6
8
|
export declare function findPackageRoot(absEntryPath: string): string;
|
|
7
9
|
export declare const PACKAGE_SRC_EXCLUDES: string[];
|
|
8
10
|
export declare function isExcludedPackageRelativePath(rel: string): boolean;
|
|
@@ -11,8 +13,13 @@ export interface ExternalPackageOutcome {
|
|
|
11
13
|
specifier: string;
|
|
12
14
|
outcome: 'resolved' | 'unresolvable' | 'empty' | 'stale-dist';
|
|
13
15
|
fileCount: number;
|
|
16
|
+
/** For an unresolvable specifier, why the resolver found no file. */
|
|
17
|
+
reason?: string;
|
|
14
18
|
}
|
|
15
|
-
|
|
19
|
+
/** The file an absolute path specifier names, through the extension
|
|
20
|
+
* policy, spelled exactly below the directory it shares with `within`
|
|
21
|
+
* when given; a file differing only in case is a mismatch. */
|
|
22
|
+
export declare function probeAbsolutePathSpecifier(absSpecifier: string, extensionsSet?: ReadonlySet<string>, within?: string, policy?: ExtensionOrder): ProbedFile;
|
|
16
23
|
/** The package a bare specifier names: `@scope/name` or `name`. */
|
|
17
24
|
export declare function bareSpecifierPackageName(specifier: string): string;
|
|
18
25
|
/** Each `exports` subpath and its value; a bare target or condition object
|
|
@@ -29,15 +36,38 @@ export interface KitSourceCondition {
|
|
|
29
36
|
/** Each exact entry that declares the condition: its subpath and its
|
|
30
37
|
* absolute source file. */
|
|
31
38
|
entries: Array<[subpath: string, target: string]>;
|
|
32
|
-
/** Entries whose target is missing
|
|
33
|
-
|
|
39
|
+
/** Entries whose target is missing, differs from its file only in case,
|
|
40
|
+
* or is no package target Node accepts, and which of those. */
|
|
41
|
+
invalid: Array<[subpath: string, target: string, why: string]>;
|
|
34
42
|
/** The deepest directory holding every source entry: what discovery walks.
|
|
35
43
|
* Null when no entry is valid. */
|
|
36
44
|
root: string | null;
|
|
37
45
|
}
|
|
38
|
-
/**
|
|
39
|
-
*
|
|
40
|
-
|
|
46
|
+
/** A kit's source root as the system loader's table selects it (spec §2.2
|
|
47
|
+
* A5): the rule that chose it, each exact entry's source file, and the
|
|
48
|
+
* `animus` targets the loader does not read as source, with why. Each of
|
|
49
|
+
* those falls back to its runtime target, except a percent-escaped one,
|
|
50
|
+
* which fails the load. `unresolved` names why the specifier names no file
|
|
51
|
+
* though its package was located. */
|
|
52
|
+
export interface KitSourceSelection {
|
|
53
|
+
rule: 'animus' | 'source-exports' | 'src' | 'compiled';
|
|
54
|
+
root: string | null;
|
|
55
|
+
entries: Array<[subpath: string, file: string]>;
|
|
56
|
+
invalid: Array<[subpath: string, target: string, why: string]>;
|
|
57
|
+
unresolved: string | null;
|
|
58
|
+
}
|
|
59
|
+
/** A specifier's kit source root, given the package discovery located and
|
|
60
|
+
* the file the host resolves; null where no host imports the specifier. */
|
|
61
|
+
export type KitSourceRootResolver = (specifier: string, packageDir: string, hostEntry: string | null) => KitSourceSelection | null;
|
|
62
|
+
/** Where a package is installed: the package `name` located from
|
|
63
|
+
* `fromDir`, at its real path, or null. */
|
|
64
|
+
export type PackageLocator = (name: string, fromDir: string) => string | null;
|
|
65
|
+
/** The system loader's package locator under the session's declared
|
|
66
|
+
* `workspaces`: the first `node_modules/<name>` up the tree, then the
|
|
67
|
+
* workspace of that name. */
|
|
68
|
+
export declare function nativePackageLocator(engine: Pick<EngineApi, 'locatePackage'>, workspaces: WorkspacePackages): PackageLocator;
|
|
69
|
+
/** The native table's kit source roots under one resolution context. */
|
|
70
|
+
export declare function nativeKitSourceRoot(engine: Pick<EngineApi, 'resolveKitSourceRoot'>, fromDir: string, conditions: readonly string[], workspaces: WorkspacePackages, policyJson: string): KitSourceRootResolver;
|
|
41
71
|
/** Whether a bundler that reads the nearest `package.json`'s `sideEffects`
|
|
42
72
|
* against the file's own path keeps `absFile`; undefined without a field
|
|
43
73
|
* it reads, which keeps the bundler's side-effectful default. */
|
|
@@ -94,10 +124,22 @@ export interface CollectedExternalPackages {
|
|
|
94
124
|
diagnostics: ManifestDiagnostic[];
|
|
95
125
|
/** Each resolved package's kit descriptor, once per package root. */
|
|
96
126
|
kitDescriptors: KitDescriptorRecord[];
|
|
127
|
+
/** Package name → the real root of the instance read for it (spec §2.2
|
|
128
|
+
* A4): another instance an importer resolves is not this one. */
|
|
129
|
+
packageInstances: Record<string, string>;
|
|
97
130
|
}
|
|
98
131
|
export declare function collectExternalPackageSources(opts: {
|
|
99
132
|
specifiers: string[];
|
|
100
133
|
resolveSpecifier: (specifier: string) => string | null | Promise<string | null>;
|
|
134
|
+
/** Why `resolveSpecifier` found no file for a specifier, when it knows. */
|
|
135
|
+
unresolvedReason?: (specifier: string) => string | undefined;
|
|
136
|
+
/** Each kit's source root, as the system loader's table selects it. */
|
|
137
|
+
kitSourceRoot: KitSourceRootResolver;
|
|
138
|
+
/** Where the system loader locates each package from `rootDir`. */
|
|
139
|
+
locatePackage: PackageLocator;
|
|
140
|
+
/** The directory each specifier's package is located from: the kit's own
|
|
141
|
+
* for a package a kit's system extends; `rootDir` otherwise. */
|
|
142
|
+
locateFrom?: (specifier: string) => string;
|
|
101
143
|
rootDir: string;
|
|
102
144
|
extensionsSet: ReadonlySet<string>;
|
|
103
145
|
hasEntry: (relPath: string) => boolean;
|
|
@@ -106,6 +148,16 @@ export declare function collectExternalPackageSources(opts: {
|
|
|
106
148
|
/** Called once per specifier after its package dir is derived and BEFORE
|
|
107
149
|
* its sources are walked, so a host can watch with no blind gap. */
|
|
108
150
|
onPackageResolved?: (specifier: string, packageDir: string) => void;
|
|
151
|
+
/** Specifiers the host itself cannot resolve: each is admitted only where
|
|
152
|
+
* a source entry redirects the host's import of it, since compiled output
|
|
153
|
+
* the host never opens is nothing it bundles. */
|
|
154
|
+
requireSourceEntry?: (specifier: string) => boolean;
|
|
155
|
+
/** The host's extension order (spec §2.2 A2) for an absolute include or a
|
|
156
|
+
* source-entry guess; the built-in policy without one. */
|
|
157
|
+
extensions?: ExtensionOrder;
|
|
158
|
+
/** The host's output directories, absolute: a package inside one is
|
|
159
|
+
* output, never collected as source. */
|
|
160
|
+
hostOutputDirs?: readonly string[];
|
|
109
161
|
}): Promise<CollectedExternalPackages>;
|
|
110
162
|
export interface SourceKitDependency {
|
|
111
163
|
name: string;
|
|
@@ -118,7 +170,18 @@ export interface SourceKitDependency {
|
|
|
118
170
|
* A bundler serves an installed one as compiled code unless told
|
|
119
171
|
* otherwise: Next keeps it external on the server unless it is in
|
|
120
172
|
* `transpilePackages`, and Vite's optimizer prebundles it. */
|
|
121
|
-
export declare function sourceKitDependencies(rootDir: string): SourceKitDependency[];
|
|
173
|
+
export declare function sourceKitDependencies(rootDir: string, engine: Pick<EngineApi, 'declaresKitSource' | 'locatePackage'>): SourceKitDependency[];
|
|
174
|
+
/**
|
|
175
|
+
* The installed packages a system's membership reaches: each is a kit,
|
|
176
|
+
* whether or not it declares the source condition, and so is every kit its
|
|
177
|
+
* own system extends or includes. Read before any host resolves (a
|
|
178
|
+
* bundler's config), so the application's modules import as the system
|
|
179
|
+
* loader resolves them from the root, and a kit's from its own directory.
|
|
180
|
+
*/
|
|
181
|
+
export declare function systemKitDependencies(rootDir: string, systemPath: string, engine: Pick<EngineApi, 'systemMembership' | 'resolveSpecifier' | 'locatePackage'>): Promise<SourceKitDependency[]>;
|
|
182
|
+
/** A specifier that names a package: not relative or absolute, and no URL,
|
|
183
|
+
* scheme (`node:`, `virtual:`), subpath import or virtual id. */
|
|
184
|
+
export declare function isPackageSpecifier(specifier: string): boolean;
|
|
122
185
|
/**
|
|
123
186
|
* An error for each kit the application's own `files` import or re-export
|
|
124
187
|
* whose system the application's system does not include: a package that
|
|
@@ -132,13 +195,23 @@ export declare function sourceKitDependencies(rootDir: string): SourceKitDepende
|
|
|
132
195
|
export declare function importedKitDiagnostics(files: ReadonlyArray<{
|
|
133
196
|
path: string;
|
|
134
197
|
source: string;
|
|
135
|
-
|
|
198
|
+
hash: string;
|
|
199
|
+
}>, engine: Pick<EngineApi, 'declaresKitSource' | 'locatePackage'>, rootDir: string, systemKits: readonly string[],
|
|
200
|
+
/** The engine's facts for parser-ready files: the ingestion's cached
|
|
201
|
+
* parse, so the corpus pass that follows parses nothing again. */
|
|
202
|
+
factsOf: (files: ReadonlyArray<{
|
|
203
|
+
path: string;
|
|
204
|
+
source: string;
|
|
205
|
+
hash: string;
|
|
206
|
+
}>) => ExtractFactsResult): ManifestDiagnostic[];
|
|
136
207
|
export interface PackageDirOwners {
|
|
137
208
|
[packageDir: string]: string;
|
|
138
209
|
}
|
|
139
210
|
export declare function firstOwners(dirOwnerSets: Record<string, string[]>): PackageDirOwners;
|
|
140
211
|
export declare function excludeCollectedPackages(collected: CollectedExternalPackages, rejectedSpecifiers: ReadonlySet<string>, rootDir: string): CollectedExternalPackages;
|
|
141
|
-
|
|
212
|
+
/** Every unresolvable include, with why where the resolver said, and the
|
|
213
|
+
* system file that includes them when the caller knows it. */
|
|
214
|
+
export declare function unresolvableIncludesMessage(outcomes: ExternalPackageOutcome[], importer?: string): string | null;
|
|
142
215
|
/** A stale dist silently skews merged registry content while discovery
|
|
143
216
|
* compiles the fresh sources; null when no specifier is stale. */
|
|
144
217
|
export declare function staleDistIncludesMessage(outcomes: ExternalPackageOutcome[]): string | null;
|
|
@@ -158,10 +231,23 @@ export type ModuleParser = (source: string, path: string) => ModuleRecord | null
|
|
|
158
231
|
export declare function engineModuleParser(engine: Pick<EngineApi, 'extractFacts'>): ModuleParser | undefined;
|
|
159
232
|
/** A host's resolution of a bare specifier to its entry file: the one it
|
|
160
233
|
* resolves the packages a system extends with, under its own conditions. */
|
|
161
|
-
|
|
234
|
+
/** A package specifier's file, as the module `importer` imports it. */
|
|
235
|
+
export type PackageResolver = (specifier: string, importer: string) => string | null | Promise<string | null>;
|
|
162
236
|
/** The warning for a `createSystem` call that the parser's scopes leave
|
|
163
237
|
* unbound: no import, declaration or parameter names it. Null when there is
|
|
164
238
|
* none, or when the parser reports no scopes. */
|
|
165
239
|
export declare function unimportedCreateSystemCall(systemFilePath: string, record: ModuleRecord): ManifestDiagnostic | null;
|
|
166
|
-
|
|
240
|
+
/**
|
|
241
|
+
* The packages and local modules a system file's roots extend or include,
|
|
242
|
+
* from the engine's own read of it (spec §2.3 step 5): a bare specifier as
|
|
243
|
+
* its import spells it, a relative one resolved against the system file.
|
|
244
|
+
* The engine follows each root binding's identity through the modules this
|
|
245
|
+
* supplies on request: a relative one by the host's extension order,
|
|
246
|
+
* spelled exactly, a bare one by the host's package resolution.
|
|
247
|
+
*/
|
|
248
|
+
export declare function extractSystemFilePackages(systemFilePath: string, engine: Pick<EngineApi, 'systemMembership'>, report?: (diagnostic: ManifestDiagnostic) => void, resolvePackage?: PackageResolver, extensions?: ExtensionOrder,
|
|
249
|
+
/** Filled with each package member a kit's module spells, by the file it
|
|
250
|
+
* names from that kit: the instance that kit's system extends, which can
|
|
251
|
+
* differ from the application's own copy, or exist only under the kit. */
|
|
252
|
+
kitMembers?: Map<string, string>): Promise<string[]>;
|
|
167
253
|
//# sourceMappingURL=discover-packages.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"discover-packages.d.ts","sourceRoot":"","sources":["../../pipeline/discover-packages.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"discover-packages.d.ts","sourceRoot":"","sources":["../../pipeline/discover-packages.ts"],"names":[],"mappings":"AA2CA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,KAAK,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AACrE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAC5D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AACjE,OAAO,KAAK,EACV,iBAAiB,EACjB,kBAAkB,EAClB,iBAAiB,EAClB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAE9D,wBAAgB,eAAe,CAAC,YAAY,EAAE,MAAM,GAAG,MAAM,CAS5D;AAED,eAAO,MAAM,oBAAoB,UAKhC,CAAC;AAEF,wBAAgB,6BAA6B,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAElE;AAED,wBAAgB,kBAAkB,CAChC,UAAU,EAAE,MAAM,EAClB,aAAa,EAAE,WAAW,CAAC,MAAM,CAAC,GACjC,MAAM,EAAE,CAIV;AAUD,MAAM,WAAW,sBAAsB;IACrC,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,UAAU,GAAG,cAAc,GAAG,OAAO,GAAG,YAAY,CAAC;IAC9D,SAAS,EAAE,MAAM,CAAC;IAClB,qEAAqE;IACrE,MAAM,CAAC,EAAE,MAA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E,wBAAwB,CAAC,EAAE,aAAa,CAAC,SAAS,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;CACrE;AAED,oEAAoE;AACpE,MAAM,MAAM,YAAY,GAAG,CACzB,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,MAAM,KACT,YAAY,GAAG,IAAI,CAAC;AAEzB;;mCAEmC;AACnC,wBAAgB,kBAAkB,CAChC,MAAM,EAAE,IAAI,CAAC,SAAS,EAAE,cAAc,CAAC,GACtC,YAAY,GAAG,SAAS,CAoB1B;AAED;6EAC6E;AAC7E,uEAAuE;AACvE,MAAM,MAAM,eAAe,GAAG,CAC5B,SAAS,EAAE,MAAM,EACjB,QAAQ,EAAE,MAAM,KACb,MAAM,GAAG,IAAI,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC;AAsC5C;;kDAEkD;AAClD,wBAAgB,0BAA0B,CACxC,cAAc,EAAE,MAAM,EACtB,MAAM,EAAE,YAAY,GACnB,kBAAkB,GAAG,IAAI,CAa3B;AA8BD;;;;;;;GAOG;AACH,wBAAsB,yBAAyB,CAC7C,cAAc,EAAE,MAAM,EACtB,MAAM,EAAE,IAAI,CAAC,SAAS,EAAE,kBAAkB,CAAC,EAC3C,MAAM,CAAC,EAAE,CAAC,UAAU,EAAE,kBAAkB,KAAK,IAAI,EACjD,cAAc,CAAC,EAAE,eAAe,EAChC,UAAU,CAAC,EAAE,cAAc;AAC3B;;2EAE2E;AAC3E,UAAU,CAAC,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,GAC/B,OAAO,CAAC,MAAM,EAAE,CAAC,CAgInB"}
|
|
@@ -2,9 +2,14 @@
|
|
|
2
2
|
* One engine API for both plugins. Imports neither the native binding nor any
|
|
3
3
|
* plugin or bundler — every such dependency arrives injected.
|
|
4
4
|
*/
|
|
5
|
+
import type { ProbeEvidenceGatherer } from './probe-evidence';
|
|
6
|
+
import type { WorkspacePackages } from './workspace-packages';
|
|
5
7
|
/** The stateful engine handle produced by `new native.ExtractEngine(...)`. */
|
|
6
8
|
export interface V2ExtractEngine {
|
|
7
|
-
analyze
|
|
9
|
+
/** Parses the files for the next `analyze` of them, and names each base
|
|
10
|
+
* their specifiers probe. */
|
|
11
|
+
prepare(filesJson: string): string;
|
|
12
|
+
analyze(filesJson: string, probeEvidenceJson?: string): string;
|
|
8
13
|
transformFile(path: string): string;
|
|
9
14
|
clearCache(): void;
|
|
10
15
|
}
|
|
@@ -21,10 +26,43 @@ export interface EngineApi {
|
|
|
21
26
|
/** Parse-only native fact extraction used to prepare adapted sources. */
|
|
22
27
|
extractFacts?: (filesJson: string) => string;
|
|
23
28
|
/** Each file's run-time module specifiers, for the kit publication check. */
|
|
24
|
-
moduleSpecifiers?: (filesJson: string) => string;
|
|
29
|
+
moduleSpecifiers?: (filesJson: string, pathAliasesJson?: string) => string;
|
|
30
|
+
/** Which kits a system file's roots extend or include, from the
|
|
31
|
+
* engine's own parse; lists the modules it needs until supplied. */
|
|
32
|
+
systemMembership?: (inputsJson: string) => string;
|
|
25
33
|
/** The engine's code-to-severity table, as JSON. */
|
|
26
34
|
diagnosticCodes?: () => string;
|
|
27
|
-
|
|
35
|
+
/** A specifier resolved as the system loader resolves it, a package from
|
|
36
|
+
* `node_modules` then the declared `workspaces`, under the host's
|
|
37
|
+
* extension order (`extensionPolicyJson`): the real path of the file it
|
|
38
|
+
* names, or why it names none. */
|
|
39
|
+
resolveSpecifier?: (specifier: string, fromDir: string, conditions?: readonly string[], workspaces?: WorkspacePackages, extensionPolicyJson?: string) => {
|
|
40
|
+
path?: string | null;
|
|
41
|
+
unresolved?: string | null;
|
|
42
|
+
};
|
|
43
|
+
/** A fast fingerprint of the bytes at `path`, for telling whether a file
|
|
44
|
+
* changed between watch passes; null where it cannot be read. */
|
|
45
|
+
fingerprintFile?: (path: string) => string | null;
|
|
46
|
+
/** `fingerprintFile` of bytes already read. */
|
|
47
|
+
fingerprintBytes?: (bytes: Buffer) => string;
|
|
48
|
+
/** Whether the package at `packageDir` declares the kit source condition:
|
|
49
|
+
* an `animus` key anywhere in its `exports`, read from the manifest. */
|
|
50
|
+
declaresKitSource?: (packageDir: string) => boolean;
|
|
51
|
+
/** The package `name` as the system loader locates it from `fromDir`,
|
|
52
|
+
* the first `node_modules/<name>` up the tree, then the declared
|
|
53
|
+
* `workspaces`: its real path, or null where it locates none. */
|
|
54
|
+
locatePackage?: (name: string, fromDir: string, workspaces?: WorkspacePackages) => string | null;
|
|
55
|
+
/** A kit's source root as the system loader's table selects it (spec
|
|
56
|
+
* §2.2 A5), as JSON: the rule that chose it, its entries and invalid
|
|
57
|
+
* `animus` targets; or `{ "unresolved": why }` where no host imports the
|
|
58
|
+
* specifier. `hostEntry` is the file the host resolves; `packageDir` the
|
|
59
|
+
* package discovery located. */
|
|
60
|
+
resolveKitSourceRoot?: (specifier: string, fromDir: string, conditions?: readonly string[], workspaces?: WorkspacePackages, extensionPolicyJson?: string, hostEntry?: string, packageDir?: string) => string;
|
|
61
|
+
analyzeProject: (filesJson: string, scalesJson: string, variableMapJson: string, contextualVarsJson: string | null, propConfigJson: string, groupRegistryJson: string, packageResolutionJson: string, devMode: boolean, emitterConfigJson: string | null, selectorAliasesJson: string | null, selectorOrderJson: string | null, globalStyleBlocksJson: string | null, pathAliasesJson: string | null, keyframesJson: string | null, staticCssJson: string | null, conditionAliasesJson: string | null, externalDirsJson: string | null, transformSourcesJson: string | null, transformProvenanceJson?: string | null, declarationScalesJson?: string, analysisContextJson?: string, generatedNamesJson?: string, propertyRecordsJson?: string,
|
|
62
|
+
/** Given, the session's evidence for the bases and computed loads the
|
|
63
|
+
* engine's `prepare` names, carrying its input identity (spec §2.2
|
|
64
|
+
* A2, A8, §6.3), as JSON. */
|
|
65
|
+
probeEvidence?: ProbeEvidenceGatherer) => string;
|
|
28
66
|
transformFile: (source: string, path: string, manifest: string) => TransformFileResult;
|
|
29
67
|
clearAnalysisCache: () => void;
|
|
30
68
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"engine-adapter.d.ts","sourceRoot":"","sources":["../../pipeline/engine-adapter.ts"],"names":[],"mappings":"AAAA;;;GAGG;
|
|
1
|
+
{"version":3,"file":"engine-adapter.d.ts","sourceRoot":"","sources":["../../pipeline/engine-adapter.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAMH,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAC;AAC9D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAE9D,8EAA8E;AAC9E,MAAM,WAAW,eAAe;IAC9B;kCAC8B;IAC9B,OAAO,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAAC;IACnC,OAAO,CAAC,SAAS,EAAE,MAAM,EAAE,iBAAiB,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC/D,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAAC;IACpC,UAAU,IAAI,IAAI,CAAC;CACpB;AAED,MAAM,WAAW,mBAAmB;IAClC,IAAI,EAAE,MAAM,CAAC;IACb,aAAa,EAAE,OAAO,CAAC;CACxB;AAED;;;GAGG;AACH,MAAM,WAAW,SAAS;IAGxB,gBAAgB,EAAE,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,KAAK,GAAG,CAAC;IAC9C,yEAAyE;IACzE,YAAY,CAAC,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,MAAM,CAAC;IAC7C,6EAA6E;IAC7E,gBAAgB,CAAC,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,eAAe,CAAC,EAAE,MAAM,KAAK,MAAM,CAAC;IAC3E;yEACqE;IACrE,gBAAgB,CAAC,EAAE,CAAC,UAAU,EAAE,MAAM,KAAK,MAAM,CAAC;IAClD,oDAAoD;IACpD,eAAe,CAAC,EAAE,MAAM,MAAM,CAAC;IAC/B;;;uCAGmC;IACnC,gBAAgB,CAAC,EAAE,CACjB,SAAS,EAAE,MAAM,EACjB,OAA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AM,CAAC;IACd,yEAAyE;IACzE,IAAI,IAAI,OAAO,CAAC;IAChB,2EAA2E;IAC3E,gBAAgB,IAAI,kBAAkB,CAAC;IACvC,qEAAqE;IACrE,KAAK,EAAE,kBAAkB,CAAC;IAC1B;6EACyE;IACzE,uBAAuB,CAAC,EAAE,OAAO,CAAC;IAClC;kFAC8E;IAC9E,kBAAkB,CAAC,CAAC,YAAY,EAAE,MAAM,GAAG,MAAM,CAAC;CACnD;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,mBAAmB,GAAG,MAAM,SAAS,CAqM5E"}
|
|
@@ -1,3 +1,9 @@
|
|
|
1
1
|
export declare const RETIRED_ENGINE_MESSAGE: string;
|
|
2
|
-
|
|
2
|
+
/**
|
|
3
|
+
* v2 is the only engine (SA2): the option and `ANIMUS_ENGINE`, a startup
|
|
4
|
+
* input a worker may pass as captured, accept `v2` or nothing. Hosts call
|
|
5
|
+
* this before the native module loads, so another selection never reaches
|
|
6
|
+
* it; either fails as a configuration error naming its source.
|
|
7
|
+
*/
|
|
8
|
+
export declare function assertSupportedEngine(engineOption: string | undefined, environmentSelection?: string | undefined): void;
|
|
3
9
|
//# sourceMappingURL=engine-retirement.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"engine-retirement.d.ts","sourceRoot":"","sources":["../../pipeline/engine-retirement.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"engine-retirement.d.ts","sourceRoot":"","sources":["../../pipeline/engine-retirement.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,sBAAsB,QAGQ,CAAC;AAE5C;;;;;GAKG;AACH,wBAAgB,qBAAqB,CACnC,YAAY,EAAE,MAAM,GAAG,SAAS,EAChC,oBAAoB,GAAE,MAAM,GAAG,SAAqC,GACnE,IAAI,CAeN"}
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The one extension policy: the order in which a relative or aliased
|
|
3
|
+
* specifier's candidate files are tried. Source ingestion reads it here. The
|
|
4
|
+
* system loader and the extractor read `extension_policy.json`, which
|
|
5
|
+
* `node packages/extract/scripts/extension-policy.ts --write` generates from
|
|
6
|
+
* it, so every resolver tries the same files in the same order.
|
|
7
|
+
*
|
|
8
|
+
* The order: the base itself, the base with each appended extension, its
|
|
9
|
+
* `index` with each, then the sources an emitted NodeNext extension stands
|
|
10
|
+
* for (`./x.js` for `x.ts`), spelled exactly.
|
|
11
|
+
*/
|
|
12
|
+
export declare const EXTENSION_POLICY: {
|
|
13
|
+
/** Appended to the base, then to `{base}/index`. */
|
|
14
|
+
readonly appended: readonly ['.ts', '.tsx', '.js', '.jsx', '.mjs'];
|
|
15
|
+
/** An emitted extension, and the source extensions it names, in order. */
|
|
16
|
+
readonly nodeNext: readonly [readonly ['.js', readonly ['.ts', '.tsx', '.jsx']], readonly ['.jsx', readonly ['.tsx']], readonly ['.mjs', readonly ['.mts']], readonly ['.cjs', readonly ['.cts']]];
|
|
17
|
+
};
|
|
18
|
+
/** An extension order: what a specifier's base is tried with, in order. */
|
|
19
|
+
export interface ExtensionOrder {
|
|
20
|
+
/** Appended to the base, then to `{base}/index`. */
|
|
21
|
+
readonly appended: readonly string[];
|
|
22
|
+
/** An emitted extension, and the source extensions it names, in order,
|
|
23
|
+
* tried after the literal spelling. */
|
|
24
|
+
readonly nodeNext: ReadonlyArray<readonly [emitted: string, sources: readonly string[]]>;
|
|
25
|
+
/** A configured alias of an emitted extension: its sequence replaces the
|
|
26
|
+
* literal try, in order. */
|
|
27
|
+
readonly alias: ReadonlyArray<readonly [emitted: string, sequence: readonly string[]]>;
|
|
28
|
+
}
|
|
29
|
+
/** The files `base` can name, in policy order: itself, with each appended
|
|
30
|
+
* extension, as a directory's index with each, then the sources its
|
|
31
|
+
* emitted NodeNext extension stands for (`x.js` names `x.ts`), spelled
|
|
32
|
+
* exactly. Given `sources`, only extensions in it are tried, and under the
|
|
33
|
+
* built-in order those it lacks (`.mdx`) follow its own. A configured
|
|
34
|
+
* alias of the base's suffix replaces all of these. `index` spells a
|
|
35
|
+
* directory's index path. */
|
|
36
|
+
export declare function policyCandidates(base: string, options?: {
|
|
37
|
+
readonly sources?: ReadonlySet<string>;
|
|
38
|
+
readonly index?: (directory: string, file: string) => string;
|
|
39
|
+
/** A host's extension order (spec §2.2 A2); the built-in policy
|
|
40
|
+
* without one. */
|
|
41
|
+
readonly policy?: ExtensionOrder;
|
|
42
|
+
}): string[];
|
|
43
|
+
/** What the filesystem holds at a candidate path, spelled exactly. */
|
|
44
|
+
export type SeenFile = {
|
|
45
|
+
kind: 'file';
|
|
46
|
+
}
|
|
47
|
+
/** A file the filesystem opens under the candidate's spelling though no
|
|
48
|
+
* directory lists that spelling: its real path, as the filesystem
|
|
49
|
+
* reports it. */
|
|
50
|
+
| {
|
|
51
|
+
kind: 'case-only';
|
|
52
|
+
actual: string;
|
|
53
|
+
} | {
|
|
54
|
+
kind: 'missing';
|
|
55
|
+
};
|
|
56
|
+
/** How a probe ends. A case mismatch is the first candidate a host opens
|
|
57
|
+
* under a spelling no directory lists: a case- or normalization-insensitive
|
|
58
|
+
* host loads it and a sensitive one does not, so it is neither found nor
|
|
59
|
+
* absent. */
|
|
60
|
+
export type ProbedFile = {
|
|
61
|
+
kind: 'found';
|
|
62
|
+
path: string;
|
|
63
|
+
} | {
|
|
64
|
+
kind: 'case-mismatch';
|
|
65
|
+
candidate: string;
|
|
66
|
+
actual: string;
|
|
67
|
+
} | {
|
|
68
|
+
kind: 'absent';
|
|
69
|
+
};
|
|
70
|
+
/** The first of `candidates` that `see` finds, in order; a candidate found
|
|
71
|
+
* only under another case ends the probe as a mismatch. */
|
|
72
|
+
export declare function probeCandidates(candidates: readonly string[], see: (candidate: string) => SeenFile): ProbedFile;
|
|
73
|
+
/** What the filesystem holds at `candidate`: a file it opens under exactly
|
|
74
|
+
* that spelling, or one it opens although a directory below the one the
|
|
75
|
+
* candidate shares with `within` lists no entry spelled as the candidate
|
|
76
|
+
* spells it (a case- or normalization-insensitive filesystem opening
|
|
77
|
+
* another spelling). Nothing is folded: the filesystem decides what opens,
|
|
78
|
+
* and its listings decide the spelling, so a file a case-sensitive
|
|
79
|
+
* filesystem cannot open is simply missing. The shared directory is
|
|
80
|
+
* spelled as given, as a specifier spells only the path from its
|
|
81
|
+
* importer's directory and a manifest only the paths in its package. `..`
|
|
82
|
+
* is taken back lexically, as Node and the bundlers resolve a specifier
|
|
83
|
+
* before opening it. The system loader reads it alike. */
|
|
84
|
+
export declare function seeOnDisk(candidate: string, within?: string): SeenFile;
|
|
85
|
+
/** The first of `candidates` the filesystem holds, spelled exactly below
|
|
86
|
+
* `within` when given. */
|
|
87
|
+
export declare function probeOnDisk(candidates: readonly string[], within?: string): ProbedFile;
|
|
88
|
+
/** Why `subject` names no file: the file it would load is spelled otherwise
|
|
89
|
+
* on disk. `remedy` says what to respell. The system loader words it
|
|
90
|
+
* alike. */
|
|
91
|
+
export declare function caseMismatchReason(subject: string, mismatch: {
|
|
92
|
+
candidate: string;
|
|
93
|
+
actual: string;
|
|
94
|
+
}, remedy: string): string;
|
|
95
|
+
//# sourceMappingURL=extension-policy.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"extension-policy.d.ts","sourceRoot":"","sources":["../../pipeline/extension-policy.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;GAUG;AACH,eAAO,MAAM,gBAAgB;IAC3B,oDAAoD;aACpD,QAAQ,YAAG,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM;IAC/C,0EAA0E;aAC1E,QAAQ,sBACL,KAAK,YAAG,KAAK,EAAE,MAAM,EAAE,MAAM,cAC7B,MAAM,YAAG,MAAM,cACf,MAAM,YAAG,MAAM,cACf,MAAM,YAAG,MAAM;CAEV,CAAC;AAEX,2EAA2E;AAC3E,MAAM,WAAW,cAAc;IAC7B,oDAAoD;IACpD,QAAQ,CAAC,QAAQ,EAAE,SAAS,MAAM,EA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C,SAAS,EAAE,MAAM,KAAK,QAAQ,GACnC,UAAU,CASZ;AA6BD;;;;;;;;;;2DAU2D;AAC3D,wBAAgB,SAAS,CAAC,SAAS,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,QAAQ,CAyBtE;AAED;2BAC2B;AAC3B,wBAAgB,WAAW,CACzB,UAAU,EAAE,SAAS,MAAM,EAAE,EAC7B,MAAM,CAAC,EAAE,MAAM,GACd,UAAU,CAIZ;AAED;;aAEa;AACb,wBAAgB,kBAAkB,CAChC,OAAO,EAAE,MAAM,EACf,QAAQ,EAAE;IAAE,SAAS,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,EAC/C,MAAM,EAAE,MAAM,GACb,MAAM,CAOR"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/** Which files a host loads as opaque values (spec §2.2 A8): an asset, a
|
|
2
|
+
* stylesheet or JSON, with no code and no effects on app objects (a CSS
|
|
3
|
+
* module's class-name map, or JSON's values, are opaque data, never read
|
|
4
|
+
* statically). An opaque file the host opens is Resolved(asset). Where the
|
|
5
|
+
* host's reading is uncertain, a file is not opaque. */
|
|
6
|
+
export interface HostAssetClassification {
|
|
7
|
+
/** Whether the host loads `file`, requested with `query` (`''`, or the
|
|
8
|
+
* specifier's `?…`), as an opaque value. */
|
|
9
|
+
isAsset(file: string, query: string): boolean;
|
|
10
|
+
/** Where the classification comes from: the host's captured option, or
|
|
11
|
+
* `built-in` with the reason (`noHost`, `hostOptionUnreadable`). */
|
|
12
|
+
readonly resolverVersion: string;
|
|
13
|
+
}
|
|
14
|
+
/** The built-in classification, where no host's can be read or is not
|
|
15
|
+
* modelled (webpack's and Rspack's rules, as a conditional rule may never
|
|
16
|
+
* apply): Vite's known asset types, `svg` included, its CSS languages
|
|
17
|
+
* (`BUILT_IN_ASSET_SOURCE`) and JSON, read with Vite's queries. */
|
|
18
|
+
export declare function builtInAssetClassification(reason: 'noHost' | 'hostOptionUnreadable', detail?: string): HostAssetClassification;
|
|
19
|
+
/** Vite's own classification: `?url` and `?raw`, its known asset types and
|
|
20
|
+
* the user's `assetsInclude`, as `ResolvedConfig.assetsInclude` answers,
|
|
21
|
+
* its CSS languages (`isCSSRequest`), and its json plugin's JSON. */
|
|
22
|
+
export declare function viteAssetClassification(assetsInclude: (file: string) => boolean, version?: string): HostAssetClassification;
|
|
23
|
+
/** esbuild's classification, from its `loader` map: the loader esbuild
|
|
24
|
+
* picks for a file is the longest extension of its name the map holds,
|
|
25
|
+
* exact case. */
|
|
26
|
+
export declare function esbuildAssetClassification(loader: Readonly<Record<string, string>> | undefined): HostAssetClassification;
|
|
27
|
+
/** Turbopack's classification under Next: Next's static-image table
|
|
28
|
+
* (`nextImageLoaderRegex`), unless `images.disableStaticImages`, and its
|
|
29
|
+
* stylesheets (`regexLikeCss`), as the installed `next` declares them,
|
|
30
|
+
* and JSON. Built-in where Next cannot be read. */
|
|
31
|
+
export declare function nextImageAssetClassification(rootDir: string, disableStaticImages: boolean): HostAssetClassification;
|
|
32
|
+
//# sourceMappingURL=host-assets.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"host-assets.d.ts","sourceRoot":"","sources":["../../pipeline/host-assets.ts"],"names":[],"mappings":"AAQA;;;;yDAIyD;AACzD,MAAM,WAAW,uBAAuB;IACtC;iDAC6C;IAC7C,OAAO,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC;IAC9C;yEACqE;IACrE,QAAQ,CAAC,eAAe,EAAE,MAAM,CAAC;CAClC;AAqBD;;;oEAGoE;AACpE,wBAAgB,0BAA0B,CACxC,MAAM,EAAE,QAAQ,GAAG,sBAAsB,EACzC,MAAM,CAAC,EAAE,MAAM,GACd,uBAAuB,CASzB;AAED;;sEAEsE;AACtE,wBAAgB,uBAAuB,CACrC,aAAa,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,EACxC,OAAO,CAAC,EAAE,MAAM,GACf,uBAAuB,CASzB;AAiCD;;kBAEkB;AAClB,wBAAgB,0BAA0B,CACxC,MAAM,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,GAAG,SAAS,GACnD,uBAAuB,CAmBzB;AAED;;;oDAGoD;AACpD,wBAAgB,4BAA4B,CAC1C,OAAO,EAAE,MAAM,EACf,mBAAmB,EAAE,OAAO,GAC3B,uBAAuB,CA2BzB"}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
/** A regular expression literal as written. */
|
|
2
|
+
export interface RegexLiteral {
|
|
3
|
+
source: string;
|
|
4
|
+
flags: string;
|
|
5
|
+
}
|
|
6
|
+
/** A value written statically in an options object, as JSON. */
|
|
7
|
+
export type StaticValue = string | number | boolean | null | StaticValue[] | {
|
|
8
|
+
[key: string]: StaticValue;
|
|
9
|
+
};
|
|
10
|
+
/** A computed load's arguments as written, as the engine's `prepare` lists
|
|
11
|
+
* them: by `kind`, a specifier's static text, a context, or a glob. */
|
|
12
|
+
export type ListedArgs = {
|
|
13
|
+
/** The specifier's static text between its substitutions: one more
|
|
14
|
+
* than the substitutions. */
|
|
15
|
+
quasis: string[];
|
|
16
|
+
/** Whether the specifier is a template literal; otherwise a string
|
|
17
|
+
* concatenation. */
|
|
18
|
+
template: boolean;
|
|
19
|
+
/** `import()`'s options object as written (its attributes). */
|
|
20
|
+
options: {
|
|
21
|
+
[key: string]: StaticValue;
|
|
22
|
+
} | null;
|
|
23
|
+
/** The comments inside the call, delimiters included. */
|
|
24
|
+
comments: string[];
|
|
25
|
+
} | {
|
|
26
|
+
dir: string;
|
|
27
|
+
recursive: boolean | null;
|
|
28
|
+
regExp: RegexLiteral | null;
|
|
29
|
+
include: RegexLiteral | null;
|
|
30
|
+
exclude: RegexLiteral | null;
|
|
31
|
+
mode: string | null;
|
|
32
|
+
} | {
|
|
33
|
+
patterns: string[];
|
|
34
|
+
options: {
|
|
35
|
+
[key: string]: StaticValue;
|
|
36
|
+
} | null;
|
|
37
|
+
};
|
|
38
|
+
/** A computed load the engine's `prepare` lists (spec §6.3): a load call or
|
|
39
|
+
* `import()` that names no single specifier. */
|
|
40
|
+
export interface ListedLoad {
|
|
41
|
+
/** The importing module, rootDir-relative, as the analysis keys it. */
|
|
42
|
+
importer: string;
|
|
43
|
+
/** The call's byte offset in the importer. */
|
|
44
|
+
start: number;
|
|
45
|
+
kind: 'import' | 'require' | 'context' | 'webpackContext' | 'glob' | 'globEager';
|
|
46
|
+
/** Null where an argument is not written statically. */
|
|
47
|
+
args: ListedArgs | null;
|
|
48
|
+
}
|
|
49
|
+
/** A file a computed load expands to, rootDir-relative, with the query the
|
|
50
|
+
* host loads it with (`''`, or `?…`). */
|
|
51
|
+
export interface ExpandedPath {
|
|
52
|
+
path: string;
|
|
53
|
+
query: string;
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* How a host's bundler expands computed loads (spec §6.3).
|
|
57
|
+
*
|
|
58
|
+
* A load is named by its importer, rootDir-relative exactly as the
|
|
59
|
+
* analysis keys it, and `start`, the UTF-8 byte offset of the call in the
|
|
60
|
+
* source `prepare` read. A host that locates loads with a JavaScript
|
|
61
|
+
* parser's ranges, which count UTF-16 code units, converts them first (a
|
|
62
|
+
* BOM and `// π 😀` put a call at byte 36, UTF-16 index 31).
|
|
63
|
+
*/
|
|
64
|
+
export interface HostLoadExpander {
|
|
65
|
+
/** Every file the bundler expands `load` to, exactly as it would, each
|
|
66
|
+
* rootDir-relative exactly as the analysis keys it, with the query the
|
|
67
|
+
* host loads it with. Undefined where the host's semantics are not
|
|
68
|
+
* reproduced exactly, so the load keeps its widest reading: when in
|
|
69
|
+
* doubt, no expansion. */
|
|
70
|
+
expand(load: ListedLoad, rootDir: string): readonly ExpandedPath[] | undefined;
|
|
71
|
+
}
|
|
72
|
+
/** One load's expansion, as the engine's `HostExpansion` reads it. */
|
|
73
|
+
export interface HostExpansion {
|
|
74
|
+
importer: string;
|
|
75
|
+
start: number;
|
|
76
|
+
closed: boolean;
|
|
77
|
+
files: Array<{
|
|
78
|
+
path: string;
|
|
79
|
+
status: 'analysed' | 'opaque' | 'unanalysed';
|
|
80
|
+
}>;
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* The host's expansion of each listed load the expander reproduces, with
|
|
84
|
+
* each file read as the analysis and the host read it: a module the
|
|
85
|
+
* analysis holds, loaded as code without a query; a file the host loads as
|
|
86
|
+
* an opaque value (spec §2.2 A8); otherwise a file the analysis does not
|
|
87
|
+
* read. A query can select other code than the module (a plugin's
|
|
88
|
+
* transform), so a queried file that is not opaque is never the analysed
|
|
89
|
+
* module, and it keeps its query.
|
|
90
|
+
*/
|
|
91
|
+
export declare function hostExpansions(loads: readonly ListedLoad[], rootDir: string, analysed: ReadonlySet<string>, expander: HostLoadExpander, isAsset: ((file: string, query: string) => boolean) | undefined): HostExpansion[];
|
|
92
|
+
//# sourceMappingURL=host-expansions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"host-expansions.d.ts","sourceRoot":"","sources":["../../pipeline/host-expansions.ts"],"names":[],"mappings":"AAEA,+CAA+C;AAC/C,MAAM,WAAW,YAAY;IAC3B,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;CACf;AAED,gEAAgE;AAChE,MAAM,MAAM,WAAW,GACnB,MAAM,GACN,MAAM,GACN,OAAO,GACP,IAAI,GACJ,WAAW,EAAE,GACb;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,WAAW,CAAA;CAAE,CAAC;AAEnC;wEACwE;AACxE,MAAM,MAAM,UAAU,GAClB;IACE;kCAC8B;IAC9B,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB;yBACqB;IACrB,QAAQ,EAAE,OAAO,CAAC;IAClB,+DAA+D;IAC/D,OAAO,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,WAAW,CAAA;KAAE,GAAG,IAAI,CAAC;IAC/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AG,YAAY,CAAC;KAC9C,CAAC,CAAC;CACJ;AAED;;;;;;;;GAQG;AACH,wBAAgB,cAAc,CAC5B,KAAK,EAAE,SAAS,UAAU,EAAE,EAC5B,OAAO,EAAE,MAAM,EACf,QAAQ,EAAE,WAAW,CAAC,MAAM,CAAC,EAC7B,QAAQ,EAAE,gBAAgB,EAC1B,OAAO,EAAE,CAAC,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,KAAK,OAAO,CAAC,GAAG,SAAS,GAC9D,aAAa,EAAE,CAyBjB"}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import type { ExtensionOrder } from './extension-policy';
|
|
2
|
+
/**
|
|
3
|
+
* The extension order a host resolver uses (spec §2.2 A2): the extensions it
|
|
4
|
+
* appends to a specifier, in its order, and the source substitutions it
|
|
5
|
+
* applies to an emitted extension (`./x.js` for `x.ts`). Each adapter
|
|
6
|
+
* captures it from the host's resolved configuration, so extraction can open
|
|
7
|
+
* the file the bundler loads.
|
|
8
|
+
*/
|
|
9
|
+
export interface HostExtensionPolicy extends ExtensionOrder {
|
|
10
|
+
/** Where the order came from: `<host>[@version] captured` when read from
|
|
11
|
+
* the host's resolved configuration, `<host>[@version] default` when the
|
|
12
|
+
* host sets none and runs its documented default, or `built-in` where no
|
|
13
|
+
* host resolves (the CLI, direct engine calls) or, with the reason
|
|
14
|
+
* `hostOptionUnreadable` (spec §2.2 A2), where the host has an order the
|
|
15
|
+
* adapter cannot read (`built-in (hostOptionUnreadable:
|
|
16
|
+
* rollup-node-resolve)`). */
|
|
17
|
+
readonly resolverVersion: string;
|
|
18
|
+
}
|
|
19
|
+
/** Animus's own order, where no host resolver configuration exists. */
|
|
20
|
+
export declare const BUILT_IN_EXTENSION_POLICY: HostExtensionPolicy;
|
|
21
|
+
/** Documented defaults, for a host whose resolved order is not readable. */
|
|
22
|
+
export declare const HOST_DEFAULT_EXTENSIONS: {
|
|
23
|
+
readonly vite: readonly ['.mjs', '.js', '.mts', '.ts', '.jsx', '.tsx', '.json'];
|
|
24
|
+
readonly webpack: readonly ['.js', '.json', '.wasm'];
|
|
25
|
+
/** Rspack 1's documented default; later versions document another. */
|
|
26
|
+
readonly rspack1: readonly ['.js', '.json', '.wasm'];
|
|
27
|
+
readonly turbopack: readonly ['.tsx', '.ts', '.jsx', '.js', '.mjs', '.json'];
|
|
28
|
+
readonly esbuild: readonly ['.tsx', '.ts', '.jsx', '.js', '.css', '.json'];
|
|
29
|
+
};
|
|
30
|
+
/** Vite's `resolve.extensions`, which `configResolved` holds with its
|
|
31
|
+
* defaults applied. A TypeScript importer's `./x.js` names `x.ts` too.
|
|
32
|
+
* Only the default order is captured, as a real build resolves it. A
|
|
33
|
+
* configured list does not describe Vite's effective resolution: Vite 8's
|
|
34
|
+
* resolver falls back past it (`['.js']` still loads `./only` as
|
|
35
|
+
* `only.tsx`), so it is unreadable. */
|
|
36
|
+
export declare function viteExtensionPolicy(extensions: readonly string[], version?: string): HostExtensionPolicy;
|
|
37
|
+
/** One `resolve` block of webpack's or Rspack's configuration. */
|
|
38
|
+
interface WebpackResolveBlock {
|
|
39
|
+
readonly extensions?: readonly string[];
|
|
40
|
+
readonly extensionAlias?: Readonly<Record<string, string | string[]>>;
|
|
41
|
+
}
|
|
42
|
+
/** webpack's or Rspack's resolved order for an ESM import: the root
|
|
43
|
+
* `resolve` with `byDependency.esm` merged over it as the bundler merges
|
|
44
|
+
* it, a `...` standing for what it extends. `extensionAlias` is kept whole
|
|
45
|
+
* and in order. Where neither sets extensions, the bundler's documented
|
|
46
|
+
* default stands in; for Rspack only version 1's is known. */
|
|
47
|
+
export declare function webpackExtensionPolicy(host: string, resolve: WebpackResolveBlock & {
|
|
48
|
+
readonly byDependency?: Readonly<Record<string, WebpackResolveBlock | undefined>>;
|
|
49
|
+
}, version?: string): HostExtensionPolicy;
|
|
50
|
+
/** Turbopack's `turbopack.resolveExtensions`, or its documented default
|
|
51
|
+
* when the Next config sets none. It substitutes no source: under Next
|
|
52
|
+
* 16.3, `./x.js` beside only `x.ts` names no module. */
|
|
53
|
+
export declare function turbopackExtensionPolicy(resolveExtensions: readonly string[] | undefined, nextVersion?: string): HostExtensionPolicy;
|
|
54
|
+
/** esbuild's `resolveExtensions`, or its default when the build sets none. */
|
|
55
|
+
export declare function esbuildExtensionPolicy(resolveExtensions: readonly string[] | undefined, version?: string): HostExtensionPolicy;
|
|
56
|
+
/** Rollup leaves the extension order to its resolver plugins, which keep
|
|
57
|
+
* their options private: a TypeScript build sets `@rollup/plugin-node-resolve`'s
|
|
58
|
+
* `extensions`, which no documented default matches. The built-in policy
|
|
59
|
+
* answers, with the reason. */
|
|
60
|
+
export declare function rollupExtensionPolicy(usesNodeResolve: boolean): HostExtensionPolicy;
|
|
61
|
+
/** The policy as the system loader reads it (`ExtensionPolicy`). */
|
|
62
|
+
export declare function extensionPolicyJson(policy: HostExtensionPolicy): string;
|
|
63
|
+
export {};
|
|
64
|
+
//# sourceMappingURL=host-extensions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"host-extensions.d.ts","sourceRoot":"","sources":["../../pipeline/host-extensions.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAEzD;;;;;;GAMG;AACH,MAAM,WAAW,mBAAoB,SAAQ,cAAc;IACzD;;;;;;kCAM8B;IAC9B,QAAQ,CAAC,eAAe,EAAE,MAAM,CAAC;CAClC;AAED,uEAAuE;AACvE,eAAO,MAAM,yBAAyB,EAAE,mBAKvC,CAAC;AAqBF,4EAA4E;AAC5E,eAAO,MAAM,uBAAuB;aAClC,IAAI,YAAG,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO;aAC5D,OAAO,YAAG,KAAK,EAAE,OAAO,EAAE,OAAO;IACjC,sEAAsE;aACtE,OAAO,YAAG,KAAK,EAAE,OAAO,EAAE,OAAO;aACjC,SA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