@bridge-ds/core 0.15.0 → 0.17.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.
@@ -14,6 +14,8 @@ export declare const REPO_MODEL_DEFAULTS: {
14
14
  readonly componentSpecs: "packages/react/component-specs.json";
15
15
  /** Optional token usage notes (group -> sentence), relative to tokens.root, when tokens.usage is not set. */
16
16
  readonly tokensUsage: "usage.json";
17
+ /** Most global stylesheets read (components.styles): a broad glob never turns into hundreds of reads. */
18
+ readonly maxStylesheets: 50;
17
19
  readonly repo: {
18
20
  readonly owner: "peterbono";
19
21
  readonly repo: "ai-design-system-demo";
@@ -62,6 +64,30 @@ export declare function siteRepoFromConfig(config: BridgeConfig, raw?: unknown,
62
64
  repo: string;
63
65
  defaultBranch: string;
64
66
  }): SiteRepo;
67
+ /**
68
+ * The global stylesheet globs of a config: components.styles, else every .css file under the styles/ and theme/
69
+ * folders next to the components folder (packages/react/src/styles, packages/react/src/theme here).
70
+ */
71
+ export declare function styleGlobs(config: BridgeConfig): string[];
72
+ /** The folder to list for a glob: its segments before the first wildcard ('' for the whole repository). */
73
+ export declare function globBase(glob: string): string;
74
+ /**
75
+ * The global stylesheets of a repository (styleGlobs): one listing per glob folder, files under the components folder
76
+ * left to the component scan, at most REPO_MODEL_DEFAULTS.maxStylesheets (a problem says when more match).
77
+ */
78
+ export declare function listStylesheets(source: RepoSource, config: BridgeConfig): Promise<{
79
+ globs: string[];
80
+ paths: string[];
81
+ problems: string[];
82
+ }>;
83
+ /**
84
+ * The global stylesheets of a repository with the CSS custom properties each reads: what RepoModel.styles holds.
85
+ * loadRepoModel reads them with everything else; a model computed without them (an older snapshot) can be completed
86
+ * with this alone.
87
+ */
88
+ export declare function readStylesheets(source: RepoSource, config: BridgeConfig, concurrency?: number): Promise<RepoModel['styles'] & {
89
+ problems: string[];
90
+ }>;
65
91
  /** The config the model uses when the repo has no bridge.config.json (or an invalid one): the defaults above. */
66
92
  export declare const defaultModelConfig: () => BridgeConfig;
67
93
  /** bridge.config.json text -> config, parsed once. Never throws: problems are returned and the defaults stand in. */
@@ -104,6 +130,14 @@ export interface RepoModel {
104
130
  }[];
105
131
  list: ScannedComponent[];
106
132
  } | null;
133
+ /**
134
+ * Global stylesheets of the library (components.styles): the globs read, and each matching file with the CSS custom
135
+ * properties it reads (`var(--x)`), so a token read only by base styles counts as in use.
136
+ */
137
+ styles: {
138
+ globs: string[];
139
+ vars: Record<string, string[]>;
140
+ };
107
141
  specs: {
108
142
  path: string;
109
143
  /** Parsed component-specs.json, null when missing or of another version. */
@@ -122,7 +156,7 @@ export interface RepoModelOptions {
122
156
  /**
123
157
  * Hears how far the read has gone, in real file counts: once with every phase's total before the first body is
124
158
  * read, then once per file settled. Phases run in order: tokens (token files, contrast checks, usage notes), then
125
- * components (code, styles, stories, the index and the Figma specs), then docs (each component's docs file).
159
+ * components (code, styles, stories, the index, the global stylesheets and the Figma specs), then docs (each component's docs file).
126
160
  */
127
161
  onProgress?: (progress: RepoModelProgress) => void;
128
162
  }