@bamboocss/parser 1.48.5 → 1.50.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,6 @@
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, ts } from "ts-morph";
3
+ import { CompilerOptions, Project as Project$1, ProjectOptions as ProjectOptions$1, SourceFile } from "@bamboocss/ts-ast";
4
4
  import { ResolveModule } from "@bamboocss/extractor";
5
5
 
6
6
  //#region ../generator/dist/index.d.cts
@@ -538,6 +538,14 @@ declare class Project {
538
538
  /** @internal Deterministic resolver/add/read work, for regression assertions. */
539
539
  getResolutionWork: () => ResolutionWork;
540
540
  getSourceFile: (filePath: string) => SourceFile | undefined;
541
+ /**
542
+ * How many syntax errors this file's parse produced.
543
+ *
544
+ * Asked by the token accounting, which may only speak for a file whose tree it can trust: a
545
+ * construct the parser could not read leaves an ast that stops early, and every call below
546
+ * the offending line silently ceases to exist. Zero means the file parsed as written.
547
+ */
548
+ getSyntacticDiagnosticCount: (filePath: string) => number;
541
549
  /** ts-morph reports forward slashes; normalize callers' paths to match on Windows. */
542
550
  private normalizePath;
543
551
  /**
@@ -559,7 +567,7 @@ declare class Project {
559
567
  *
560
568
  * @internal
561
569
  */
562
- refreshResolutionConfiguration: (compilerOptions: ts.CompilerOptions | undefined, resolutionConfigFiles: readonly string[], replaceCompilerOptions: boolean) => void;
570
+ refreshResolutionConfiguration: (compilerOptions: CompilerOptions | undefined, resolutionConfigFiles: readonly string[], replaceCompilerOptions: boolean) => void;
563
571
  private isLocalAlias;
564
572
  private getLocalFailedLookupCandidates;
565
573
  private isUnresolvedLocalSpecifier;
@@ -630,7 +638,7 @@ declare class Project {
630
638
  * the comparison meaningful; see `digestExportValue`.
631
639
  */
632
640
  digestExportRead: (filePath: string, exportedName: string, onCrossing?: (crossedPath: string) => void) => string | undefined;
633
- reloadSourceFile: (filePath: string) => FileSystemRefreshResult | undefined;
641
+ reloadSourceFile: (filePath: string) => SourceFile | undefined;
634
642
  reloadSourceFiles: () => void;
635
643
  get readFile(): (filePath: string) => string;
636
644
  get getFiles(): () => string[];
package/dist/index.d.mts CHANGED
@@ -1,4 +1,4 @@
1
- import { FileSystemRefreshResult, Project as Project$1, ProjectOptions as ProjectOptions$1, SourceFile, ts } from "ts-morph";
1
+ import { CompilerOptions, Project as Project$1, ProjectOptions as ProjectOptions$1, SourceFile } from "@bamboocss/ts-ast";
2
2
  import { ResolveModule } from "@bamboocss/extractor";
3
3
  import { Context, DeadImport, ParserOptions, StyleDecoder, Stylesheet } from "@bamboocss/core";
4
4
  import { ArtifactId, BambooHooks, ConfigTsOptions, CssArtifactType, LoadConfigResult, ParserResultConfigureOptions, ParserResultInterface, ResultItem, Runtime, SpecFile, SpecType, SpecTypeMap } from "@bamboocss/types";
@@ -538,6 +538,14 @@ declare class Project {
538
538
  /** @internal Deterministic resolver/add/read work, for regression assertions. */
539
539
  getResolutionWork: () => ResolutionWork;
540
540
  getSourceFile: (filePath: string) => SourceFile | undefined;
541
+ /**
542
+ * How many syntax errors this file's parse produced.
543
+ *
544
+ * Asked by the token accounting, which may only speak for a file whose tree it can trust: a
545
+ * construct the parser could not read leaves an ast that stops early, and every call below
546
+ * the offending line silently ceases to exist. Zero means the file parsed as written.
547
+ */
548
+ getSyntacticDiagnosticCount: (filePath: string) => number;
541
549
  /** ts-morph reports forward slashes; normalize callers' paths to match on Windows. */
542
550
  private normalizePath;
543
551
  /**
@@ -559,7 +567,7 @@ declare class Project {
559
567
  *
560
568
  * @internal
561
569
  */
562
- refreshResolutionConfiguration: (compilerOptions: ts.CompilerOptions | undefined, resolutionConfigFiles: readonly string[], replaceCompilerOptions: boolean) => void;
570
+ refreshResolutionConfiguration: (compilerOptions: CompilerOptions | undefined, resolutionConfigFiles: readonly string[], replaceCompilerOptions: boolean) => void;
563
571
  private isLocalAlias;
564
572
  private getLocalFailedLookupCandidates;
565
573
  private isUnresolvedLocalSpecifier;
@@ -630,7 +638,7 @@ declare class Project {
630
638
  * the comparison meaningful; see `digestExportValue`.
631
639
  */
632
640
  digestExportRead: (filePath: string, exportedName: string, onCrossing?: (crossedPath: string) => void) => string | undefined;
633
- reloadSourceFile: (filePath: string) => FileSystemRefreshResult | undefined;
641
+ reloadSourceFile: (filePath: string) => SourceFile | undefined;
634
642
  reloadSourceFiles: () => void;
635
643
  get readFile(): (filePath: string) => string;
636
644
  get getFiles(): () => string[];