@bamboocss/parser 1.45.4 → 1.46.0

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/index.d.cts CHANGED
@@ -1,6 +1,7 @@
1
1
  import { Context, DeadImport, ParserOptions, StyleDecoder, Stylesheet } from "@bamboocss/core";
2
2
  import { ArtifactId, BambooHooks, ConfigTsOptions, CssArtifactType, LoadConfigResult, ParserResultConfigureOptions, ParserResultInterface, ResultItem, Runtime, SpecFile, SpecType, SpecTypeMap } from "@bamboocss/types";
3
- import { FileSystemRefreshResult, Project as Project$1, ProjectOptions as ProjectOptions$1, SourceFile } from "ts-morph";
3
+ import { FileSystemRefreshResult, Project as Project$1, ProjectOptions as ProjectOptions$1, SourceFile, ts } from "ts-morph";
4
+ import { ResolveModule } from "@bamboocss/extractor";
4
5
 
5
6
  //#region ../generator/dist/index.d.cts
6
7
  //#region src/generator.d.ts
@@ -219,9 +220,6 @@ declare class Generator extends Context {
219
220
  * Get CSS for a specific theme
220
221
  */
221
222
  //#endregion
222
- //#region src/imported-recipes.d.ts
223
- type ResolveModule = (specifier: string, from: SourceFile) => SourceFile | undefined;
224
- //#endregion
225
223
  //#region src/unresolved-styles.d.ts
226
224
  interface UnresolvedStyle {
227
225
  /**
@@ -277,6 +275,8 @@ declare class ParserResult implements ParserResultInterface {
277
275
  pattern: Map<string, Set<ResultItem>>;
278
276
  filePath: string | undefined;
279
277
  encoder: ParserOptions['encoder'];
278
+ /** Resolver targets crossed while extracting values which contributed CSS. */
279
+ private dependencies;
280
280
  /**
281
281
  * `css()` calls whose styles the build could not fully see.
282
282
  *
@@ -355,6 +355,17 @@ declare class ParserResult implements ParserResultInterface {
355
355
  setRecipe(recipeName: string, result: ResultItem): void;
356
356
  isEmpty(): boolean;
357
357
  setFilePath(filePath: string): this;
358
+ /** @internal Called only by the extractor-facing resolver, not by import classification. */
359
+ addDependency(filePath: string): void;
360
+ /**
361
+ * Local source paths crossed while resolving values this extraction actually encoded.
362
+ *
363
+ * The Project ledger deliberately records every local import, including ordinary runtime
364
+ * bindings. Box nodes retain the declaration node followed while resolving a style value,
365
+ * so this is the narrow semantic target set consumers can feed back to that ledger to recover
366
+ * re-export/barrel paths without watching unrelated imports.
367
+ */
368
+ getDependencies(): string[];
358
369
  merge(result: ParserResult): this;
359
370
  toArray(): ResultItem[];
360
371
  toJSON(): {
@@ -387,31 +398,73 @@ resolveModule?: ResolveModule) => ParserResult | undefined;
387
398
  //#endregion
388
399
  //#region src/project.d.ts
389
400
  interface ProjectOptions extends ProjectOptions$1 {
401
+ /**
402
+ * Snapshot `getFiles()` now, but defer reading and parsing that inventory until a source
403
+ * graph operation. `BambooContext` opts into this; standalone Projects remain eager.
404
+ *
405
+ * @internal
406
+ */
407
+ deferInitialSourceFiles?: boolean;
390
408
  readFile: Runtime['fs']['readFileSync'];
391
409
  getFiles(): string[];
392
410
  hooks: Partial<BambooHooks>;
393
411
  parserOptions: ParserOptions;
412
+ /** @internal Exact tsconfig files which produced the current compiler resolution options. */
413
+ resolutionConfigFiles?: readonly string[];
394
414
  tsOptions?: ConfigTsOptions;
395
415
  }
416
+ /** @internal One stable local module-resolution observation from a source AST. */
417
+ interface ResolutionFact {
418
+ readonly importer: string;
419
+ readonly target: string | null;
420
+ readonly specifier: string;
421
+ readonly kind: 'import' | 'export';
422
+ readonly ordinal: number;
423
+ }
424
+ /** @internal Exact semantic closure plus missing local paths which can redirect it. */
425
+ interface ResolutionReadSet {
426
+ readonly dependencies: readonly string[];
427
+ readonly pendingCandidates: readonly string[];
428
+ }
429
+ /** @internal Deterministic filesystem work performed by the Project-owned resolver. */
430
+ interface ResolutionWork {
431
+ readonly moduleResolutionsAttempted: number;
432
+ readonly sourceFilesAdded: number;
433
+ readonly sourceFilesRead: number;
434
+ }
396
435
  declare class Project {
397
- private options;
398
- project: Project$1;
436
+ #private;
437
+ /**
438
+ * Source-loading contract for the opt-in deferred mode:
439
+ *
440
+ * - materializing: `project`, `getSourceFile`, `getDependents`, every create/add/remove/reload
441
+ * API, and non-JSON `parseSourceFile`;
442
+ * - graph-independent: `files`, `parser`, `parserOptions`, `readFile`, `getFiles`, the
443
+ * resolution-ledger/work getters, `getUnresolvedImporters`, `parseJson`/JSON
444
+ * `parseSourceFile`, `transformFile`, `classify`.
445
+ *
446
+ * Graph-independent means outside the atomic preload. While it is `loading`, every public
447
+ * wrapper entry rejects reentrancy before returning live state or invoking a callback.
448
+ *
449
+ * Private resolution and dependency helpers are reachable only after a materializing parse.
450
+ */
399
451
  parser: ReturnType<typeof createParser>;
452
+ project: Project$1;
453
+ private options;
400
454
  get parserOptions(): ParserOptions;
401
455
  constructor(options: ProjectOptions);
402
456
  get files(): string[];
403
- /**
404
- * Reverse dependency graph: imported file -> files importing it, both keyed on
405
- * the source file's own normalized path so lookups match regardless of whether
406
- * the caller passed a relative, aliased or platform-specific path.
407
- *
408
- * Populated while parsing. Cross-file extraction folds imported values into the
409
- * importer's output, so editing a shared style file has to re-parse everyone who
410
- * imports it — re-parsing only the changed file leaves consumers stale.
411
- */
457
+ /** Reverse dependency graph: resolved target -> importers. */
412
458
  private dependents;
413
459
  /** Forward edges, so a re-parse can retract exactly the previous ones. */
414
460
  private dependencies;
461
+ /**
462
+ * Deleted targets retain their last importers until those importers are reparsed.
463
+ *
464
+ * A watcher commonly removes first and asks second. The ledger itself must say the target
465
+ * is now unresolved, while this one-turn tombstone keeps that unlink query answerable.
466
+ */
467
+ private removedDependents;
415
468
  /**
416
469
  * Path as a caller spells it -> the source file's own path.
417
470
  *
@@ -423,30 +476,33 @@ declare class Project {
423
476
  */
424
477
  private canonicalPaths;
425
478
  /**
426
- * Files holding at least one import whose specifier resolved to nothing.
479
+ * Files holding at least one import whose local resolution is not final.
427
480
  *
428
- * A broken or not-yet-created import produces no edge, so when the file it wants
429
- * finally appears there is nothing in the graph connecting them. These importers
430
- * are the only candidates for that, and the set is normally empty.
481
+ * A broken or not-yet-created import produces no edge. A successful fallback edge
482
+ * likewise cannot point at the missing higher-priority candidate that may replace it.
483
+ * These importers are the only candidates for either add-event transition, and the
484
+ * set is normally empty.
431
485
  */
432
486
  private unresolvedImporters;
433
- /** Files whose imports did not all resolve when they were last parsed. */
487
+ /** Exact post-transform resolution facts, one immutable list per importer. */
488
+ private resolutionsByImporter;
489
+ /** One hook/transform transaction for each source revision Bamboo can semantically read. */
490
+ private sourcePreparations;
491
+ /** Paths explicitly removed through this wrapper, until an add/create observes them again. */
492
+ private removedSourcePaths;
493
+ private resolutionWork;
494
+ private resetResolutionState;
495
+ /** Files whose imports may resolve differently after a local file appears. */
434
496
  getUnresolvedImporters: () => string[];
497
+ /** @internal Immutable resolution facts in importer/AST order. */
498
+ getResolutionLedger: () => readonly ResolutionFact[];
499
+ /** @internal Every distinct local target represented by the current ledger. */
500
+ getResolvedSourceFiles: () => readonly string[];
501
+ /** @internal Deterministic resolver/add/read work, for regression assertions. */
502
+ getResolutionWork: () => ResolutionWork;
435
503
  getSourceFile: (filePath: string) => SourceFile | undefined;
436
504
  /** ts-morph reports forward slashes; normalize callers' paths to match on Windows. */
437
505
  private normalizePath;
438
- /**
439
- * Resolves a module specifier to a file already in the project.
440
- *
441
- * Deliberately not `decl.getModuleSpecifierSourceFile()`: that goes through the
442
- * symbol table, which forces `initializeTypeChecker` on first use and costs
443
- * hundreds of ms on a cold build. `ts.resolveModuleName` is purely a filesystem
444
- * lookup, and a shared cache keeps repeat specifiers off the disk.
445
- *
446
- * Looks the result up rather than adding it, so resolving `react` cannot pull a
447
- * `.d.ts` into the project. The graph only tracks files bamboo already scans.
448
- */
449
- private moduleResolutionCache;
450
506
  /**
451
507
  * Everything memoized against the shape of the file tree, including the negative half.
452
508
  *
@@ -456,20 +512,74 @@ declare class Project {
456
512
  * importing it, since resolution is what finds one.
457
513
  */
458
514
  private invalidate;
459
- private resolveImport;
460
515
  /**
461
- * `resolveImport` in the shape a caller can use, for a specifier read off any declaration.
516
+ * Invalidate module/evaluator state after a resolver configuration byte changes.
517
+ *
518
+ * Unlike `resetResolutionState`, this keeps the published dependency graph long enough for
519
+ * an incremental consumer to take its old dependent closure. Each reparsed importer replaces
520
+ * its own facts under the bumped revision; unrelated graph entries remain available until
521
+ * they are next queried instead of forcing a whole-project rebuild.
462
522
  *
463
- * Shares the module resolution cache above, so a barrel resolved while tracking
464
- * dependencies is not resolved again while looking for recipes.
523
+ * @internal
465
524
  */
525
+ refreshResolutionConfiguration: (compilerOptions: ts.CompilerOptions | undefined, resolutionConfigFiles: readonly string[], replaceCompilerOptions: boolean) => void;
526
+ private isLocalAlias;
527
+ private getLocalFailedLookupCandidates;
528
+ private isUnresolvedLocalSpecifier;
529
+ private isInCheckout;
530
+ private resolveSpecifier;
531
+ private retractImporter;
532
+ private publishResolutionFacts;
533
+ private ensureResolutionFacts;
534
+ /** The sole cross-file source resolver supplied to parser and extractor. */
466
535
  private resolveModule;
467
536
  private trackDependencies;
537
+ private invalidateSourcePreparation;
538
+ /**
539
+ * Apply the parser hook and built-in transform once to one source revision.
540
+ *
541
+ * Resolver traversal is a semantic read just as surely as an explicit parse: returning a
542
+ * raw dependency here would let parse order decide both the value extraction sees and the
543
+ * downstream edges the ledger records. The transaction is published only after the AST and
544
+ * its facts agree. A failed or re-entered attempt restores the input AST and can be retried.
545
+ */
546
+ private prepareEffectiveSource;
547
+ private markTargetRemoved;
468
548
  /**
469
549
  * Every file that transitively imports `filePath`, so a watcher can re-parse the
470
550
  * consumers of an edited file. Excludes `filePath` itself.
471
551
  */
472
552
  getDependents: (filePath: string) => string[];
553
+ /**
554
+ * Every local source transitively read by `filePath`, excluding the file itself. When
555
+ * `targets` are supplied, retain only paths leading to one of those semantic reads.
556
+ *
557
+ * This is the forward half of `getDependents`, exposed for bundler consumers which must
558
+ * register the complete semantic read-set as watch files. Walking the indexed ledger closure
559
+ * avoids rescanning every resolution fact once per transformed module.
560
+ */
561
+ getDependencies: (filePath: string, targets?: Iterable<string>) => string[];
562
+ /**
563
+ * Exact semantic dependencies plus missing local resolver candidates which can supersede
564
+ * one of those dependencies.
565
+ *
566
+ * Candidate provenance stays attached to its import/export fact. Filtering those facts
567
+ * through the selected dependency closure keeps an unrelated runtime import—even a local
568
+ * alias with its own fallback—out of the watch set without asking consumers to reinterpret
569
+ * specifiers or scan the checkout.
570
+ */
571
+ getResolutionReadSet: (filePath: string, targets?: Iterable<string>, previous?: ResolutionReadSet) => ResolutionReadSet;
572
+ /**
573
+ * Exact resolution configuration files read by the semantic closure selected by `targets`.
574
+ *
575
+ * Package manifests stay attached to their import/export ordinal, so a runtime-only branch
576
+ * cannot turn an arbitrary package.json into a Builder dependency. Tsconfig files are global
577
+ * inputs to those same selected facts and are added only when the owner has a semantic
578
+ * cross-file read.
579
+ *
580
+ * @internal
581
+ */
582
+ getResolutionConfigurationFiles: (filePath: string, targets?: Iterable<string>, previous?: Iterable<string>) => readonly string[];
473
583
  createSourceFile: (filePath: string) => SourceFile;
474
584
  createSourceFiles: () => void;
475
585
  addSourceFile: (filePath: string, content: string) => SourceFile;
@@ -484,4 +594,4 @@ declare class Project {
484
594
  classify: (fileMap: Map<string, ParserResultInterface>) => import("@bamboocss/types").ClassifyReport;
485
595
  }
486
596
  //#endregion
487
- export { ParserResult, Project, ProjectOptions, type UnresolvedStyle, findUnresolvedStyles };
597
+ export { ParserResult, Project, ProjectOptions, ResolutionFact, ResolutionReadSet, ResolutionWork, type UnresolvedStyle, findUnresolvedStyles };
package/dist/index.d.mts CHANGED
@@ -1,4 +1,5 @@
1
- import { FileSystemRefreshResult, Project as Project$1, ProjectOptions as ProjectOptions$1, SourceFile } from "ts-morph";
1
+ import { FileSystemRefreshResult, Project as Project$1, ProjectOptions as ProjectOptions$1, SourceFile, ts } from "ts-morph";
2
+ import { ResolveModule } from "@bamboocss/extractor";
2
3
  import { Context, DeadImport, ParserOptions, StyleDecoder, Stylesheet } from "@bamboocss/core";
3
4
  import { ArtifactId, BambooHooks, ConfigTsOptions, CssArtifactType, LoadConfigResult, ParserResultConfigureOptions, ParserResultInterface, ResultItem, Runtime, SpecFile, SpecType, SpecTypeMap } from "@bamboocss/types";
4
5
 
@@ -219,9 +220,6 @@ declare class Generator extends Context {
219
220
  * Get CSS for a specific theme
220
221
  */
221
222
  //#endregion
222
- //#region src/imported-recipes.d.ts
223
- type ResolveModule = (specifier: string, from: SourceFile) => SourceFile | undefined;
224
- //#endregion
225
223
  //#region src/unresolved-styles.d.ts
226
224
  interface UnresolvedStyle {
227
225
  /**
@@ -277,6 +275,8 @@ declare class ParserResult implements ParserResultInterface {
277
275
  pattern: Map<string, Set<ResultItem>>;
278
276
  filePath: string | undefined;
279
277
  encoder: ParserOptions['encoder'];
278
+ /** Resolver targets crossed while extracting values which contributed CSS. */
279
+ private dependencies;
280
280
  /**
281
281
  * `css()` calls whose styles the build could not fully see.
282
282
  *
@@ -355,6 +355,17 @@ declare class ParserResult implements ParserResultInterface {
355
355
  setRecipe(recipeName: string, result: ResultItem): void;
356
356
  isEmpty(): boolean;
357
357
  setFilePath(filePath: string): this;
358
+ /** @internal Called only by the extractor-facing resolver, not by import classification. */
359
+ addDependency(filePath: string): void;
360
+ /**
361
+ * Local source paths crossed while resolving values this extraction actually encoded.
362
+ *
363
+ * The Project ledger deliberately records every local import, including ordinary runtime
364
+ * bindings. Box nodes retain the declaration node followed while resolving a style value,
365
+ * so this is the narrow semantic target set consumers can feed back to that ledger to recover
366
+ * re-export/barrel paths without watching unrelated imports.
367
+ */
368
+ getDependencies(): string[];
358
369
  merge(result: ParserResult): this;
359
370
  toArray(): ResultItem[];
360
371
  toJSON(): {
@@ -387,31 +398,73 @@ resolveModule?: ResolveModule) => ParserResult | undefined;
387
398
  //#endregion
388
399
  //#region src/project.d.ts
389
400
  interface ProjectOptions extends ProjectOptions$1 {
401
+ /**
402
+ * Snapshot `getFiles()` now, but defer reading and parsing that inventory until a source
403
+ * graph operation. `BambooContext` opts into this; standalone Projects remain eager.
404
+ *
405
+ * @internal
406
+ */
407
+ deferInitialSourceFiles?: boolean;
390
408
  readFile: Runtime['fs']['readFileSync'];
391
409
  getFiles(): string[];
392
410
  hooks: Partial<BambooHooks>;
393
411
  parserOptions: ParserOptions;
412
+ /** @internal Exact tsconfig files which produced the current compiler resolution options. */
413
+ resolutionConfigFiles?: readonly string[];
394
414
  tsOptions?: ConfigTsOptions;
395
415
  }
416
+ /** @internal One stable local module-resolution observation from a source AST. */
417
+ interface ResolutionFact {
418
+ readonly importer: string;
419
+ readonly target: string | null;
420
+ readonly specifier: string;
421
+ readonly kind: 'import' | 'export';
422
+ readonly ordinal: number;
423
+ }
424
+ /** @internal Exact semantic closure plus missing local paths which can redirect it. */
425
+ interface ResolutionReadSet {
426
+ readonly dependencies: readonly string[];
427
+ readonly pendingCandidates: readonly string[];
428
+ }
429
+ /** @internal Deterministic filesystem work performed by the Project-owned resolver. */
430
+ interface ResolutionWork {
431
+ readonly moduleResolutionsAttempted: number;
432
+ readonly sourceFilesAdded: number;
433
+ readonly sourceFilesRead: number;
434
+ }
396
435
  declare class Project {
397
- private options;
398
- project: Project$1;
436
+ #private;
437
+ /**
438
+ * Source-loading contract for the opt-in deferred mode:
439
+ *
440
+ * - materializing: `project`, `getSourceFile`, `getDependents`, every create/add/remove/reload
441
+ * API, and non-JSON `parseSourceFile`;
442
+ * - graph-independent: `files`, `parser`, `parserOptions`, `readFile`, `getFiles`, the
443
+ * resolution-ledger/work getters, `getUnresolvedImporters`, `parseJson`/JSON
444
+ * `parseSourceFile`, `transformFile`, `classify`.
445
+ *
446
+ * Graph-independent means outside the atomic preload. While it is `loading`, every public
447
+ * wrapper entry rejects reentrancy before returning live state or invoking a callback.
448
+ *
449
+ * Private resolution and dependency helpers are reachable only after a materializing parse.
450
+ */
399
451
  parser: ReturnType<typeof createParser>;
452
+ project: Project$1;
453
+ private options;
400
454
  get parserOptions(): ParserOptions;
401
455
  constructor(options: ProjectOptions);
402
456
  get files(): string[];
403
- /**
404
- * Reverse dependency graph: imported file -> files importing it, both keyed on
405
- * the source file's own normalized path so lookups match regardless of whether
406
- * the caller passed a relative, aliased or platform-specific path.
407
- *
408
- * Populated while parsing. Cross-file extraction folds imported values into the
409
- * importer's output, so editing a shared style file has to re-parse everyone who
410
- * imports it — re-parsing only the changed file leaves consumers stale.
411
- */
457
+ /** Reverse dependency graph: resolved target -> importers. */
412
458
  private dependents;
413
459
  /** Forward edges, so a re-parse can retract exactly the previous ones. */
414
460
  private dependencies;
461
+ /**
462
+ * Deleted targets retain their last importers until those importers are reparsed.
463
+ *
464
+ * A watcher commonly removes first and asks second. The ledger itself must say the target
465
+ * is now unresolved, while this one-turn tombstone keeps that unlink query answerable.
466
+ */
467
+ private removedDependents;
415
468
  /**
416
469
  * Path as a caller spells it -> the source file's own path.
417
470
  *
@@ -423,30 +476,33 @@ declare class Project {
423
476
  */
424
477
  private canonicalPaths;
425
478
  /**
426
- * Files holding at least one import whose specifier resolved to nothing.
479
+ * Files holding at least one import whose local resolution is not final.
427
480
  *
428
- * A broken or not-yet-created import produces no edge, so when the file it wants
429
- * finally appears there is nothing in the graph connecting them. These importers
430
- * are the only candidates for that, and the set is normally empty.
481
+ * A broken or not-yet-created import produces no edge. A successful fallback edge
482
+ * likewise cannot point at the missing higher-priority candidate that may replace it.
483
+ * These importers are the only candidates for either add-event transition, and the
484
+ * set is normally empty.
431
485
  */
432
486
  private unresolvedImporters;
433
- /** Files whose imports did not all resolve when they were last parsed. */
487
+ /** Exact post-transform resolution facts, one immutable list per importer. */
488
+ private resolutionsByImporter;
489
+ /** One hook/transform transaction for each source revision Bamboo can semantically read. */
490
+ private sourcePreparations;
491
+ /** Paths explicitly removed through this wrapper, until an add/create observes them again. */
492
+ private removedSourcePaths;
493
+ private resolutionWork;
494
+ private resetResolutionState;
495
+ /** Files whose imports may resolve differently after a local file appears. */
434
496
  getUnresolvedImporters: () => string[];
497
+ /** @internal Immutable resolution facts in importer/AST order. */
498
+ getResolutionLedger: () => readonly ResolutionFact[];
499
+ /** @internal Every distinct local target represented by the current ledger. */
500
+ getResolvedSourceFiles: () => readonly string[];
501
+ /** @internal Deterministic resolver/add/read work, for regression assertions. */
502
+ getResolutionWork: () => ResolutionWork;
435
503
  getSourceFile: (filePath: string) => SourceFile | undefined;
436
504
  /** ts-morph reports forward slashes; normalize callers' paths to match on Windows. */
437
505
  private normalizePath;
438
- /**
439
- * Resolves a module specifier to a file already in the project.
440
- *
441
- * Deliberately not `decl.getModuleSpecifierSourceFile()`: that goes through the
442
- * symbol table, which forces `initializeTypeChecker` on first use and costs
443
- * hundreds of ms on a cold build. `ts.resolveModuleName` is purely a filesystem
444
- * lookup, and a shared cache keeps repeat specifiers off the disk.
445
- *
446
- * Looks the result up rather than adding it, so resolving `react` cannot pull a
447
- * `.d.ts` into the project. The graph only tracks files bamboo already scans.
448
- */
449
- private moduleResolutionCache;
450
506
  /**
451
507
  * Everything memoized against the shape of the file tree, including the negative half.
452
508
  *
@@ -456,20 +512,74 @@ declare class Project {
456
512
  * importing it, since resolution is what finds one.
457
513
  */
458
514
  private invalidate;
459
- private resolveImport;
460
515
  /**
461
- * `resolveImport` in the shape a caller can use, for a specifier read off any declaration.
516
+ * Invalidate module/evaluator state after a resolver configuration byte changes.
517
+ *
518
+ * Unlike `resetResolutionState`, this keeps the published dependency graph long enough for
519
+ * an incremental consumer to take its old dependent closure. Each reparsed importer replaces
520
+ * its own facts under the bumped revision; unrelated graph entries remain available until
521
+ * they are next queried instead of forcing a whole-project rebuild.
462
522
  *
463
- * Shares the module resolution cache above, so a barrel resolved while tracking
464
- * dependencies is not resolved again while looking for recipes.
523
+ * @internal
465
524
  */
525
+ refreshResolutionConfiguration: (compilerOptions: ts.CompilerOptions | undefined, resolutionConfigFiles: readonly string[], replaceCompilerOptions: boolean) => void;
526
+ private isLocalAlias;
527
+ private getLocalFailedLookupCandidates;
528
+ private isUnresolvedLocalSpecifier;
529
+ private isInCheckout;
530
+ private resolveSpecifier;
531
+ private retractImporter;
532
+ private publishResolutionFacts;
533
+ private ensureResolutionFacts;
534
+ /** The sole cross-file source resolver supplied to parser and extractor. */
466
535
  private resolveModule;
467
536
  private trackDependencies;
537
+ private invalidateSourcePreparation;
538
+ /**
539
+ * Apply the parser hook and built-in transform once to one source revision.
540
+ *
541
+ * Resolver traversal is a semantic read just as surely as an explicit parse: returning a
542
+ * raw dependency here would let parse order decide both the value extraction sees and the
543
+ * downstream edges the ledger records. The transaction is published only after the AST and
544
+ * its facts agree. A failed or re-entered attempt restores the input AST and can be retried.
545
+ */
546
+ private prepareEffectiveSource;
547
+ private markTargetRemoved;
468
548
  /**
469
549
  * Every file that transitively imports `filePath`, so a watcher can re-parse the
470
550
  * consumers of an edited file. Excludes `filePath` itself.
471
551
  */
472
552
  getDependents: (filePath: string) => string[];
553
+ /**
554
+ * Every local source transitively read by `filePath`, excluding the file itself. When
555
+ * `targets` are supplied, retain only paths leading to one of those semantic reads.
556
+ *
557
+ * This is the forward half of `getDependents`, exposed for bundler consumers which must
558
+ * register the complete semantic read-set as watch files. Walking the indexed ledger closure
559
+ * avoids rescanning every resolution fact once per transformed module.
560
+ */
561
+ getDependencies: (filePath: string, targets?: Iterable<string>) => string[];
562
+ /**
563
+ * Exact semantic dependencies plus missing local resolver candidates which can supersede
564
+ * one of those dependencies.
565
+ *
566
+ * Candidate provenance stays attached to its import/export fact. Filtering those facts
567
+ * through the selected dependency closure keeps an unrelated runtime import—even a local
568
+ * alias with its own fallback—out of the watch set without asking consumers to reinterpret
569
+ * specifiers or scan the checkout.
570
+ */
571
+ getResolutionReadSet: (filePath: string, targets?: Iterable<string>, previous?: ResolutionReadSet) => ResolutionReadSet;
572
+ /**
573
+ * Exact resolution configuration files read by the semantic closure selected by `targets`.
574
+ *
575
+ * Package manifests stay attached to their import/export ordinal, so a runtime-only branch
576
+ * cannot turn an arbitrary package.json into a Builder dependency. Tsconfig files are global
577
+ * inputs to those same selected facts and are added only when the owner has a semantic
578
+ * cross-file read.
579
+ *
580
+ * @internal
581
+ */
582
+ getResolutionConfigurationFiles: (filePath: string, targets?: Iterable<string>, previous?: Iterable<string>) => readonly string[];
473
583
  createSourceFile: (filePath: string) => SourceFile;
474
584
  createSourceFiles: () => void;
475
585
  addSourceFile: (filePath: string, content: string) => SourceFile;
@@ -484,4 +594,4 @@ declare class Project {
484
594
  classify: (fileMap: Map<string, ParserResultInterface>) => import("@bamboocss/types").ClassifyReport;
485
595
  }
486
596
  //#endregion
487
- export { ParserResult, Project, ProjectOptions, type UnresolvedStyle, findUnresolvedStyles };
597
+ export { ParserResult, Project, ProjectOptions, ResolutionFact, ResolutionReadSet, ResolutionWork, type UnresolvedStyle, findUnresolvedStyles };