@bamboocss/node 1.45.5 → 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,3 +1,4 @@
1
+ import { n as markStaticCompilerActive, t as isStaticCompilerActive } from "./static-compiler-C1QNL5nu.cjs";
1
2
  import { ReportFormat } from "@bamboocss/reporter";
2
3
  import { AnalysisOptions, Artifact, ArtifactId, BambooHooks, Config, CssArtifactType, LoadConfigResult, Runtime, SpecFile, WatchOptions, WatcherEventType } from "@bamboocss/types";
3
4
  import { DeadImport, StyleEncoder, Stylesheet } from "@bamboocss/core";
@@ -14,6 +15,8 @@ declare class DiffEngine {
14
15
  * Reload config from disk and refresh the context
15
16
  */
16
17
  reloadConfigAndRefreshContext(fn?: (conf: LoadConfigResult) => void): Promise<import("@bamboocss/types").DiffConfigResult>;
18
+ /** @internal Exact tsconfig files behind the currently attached resolution options. */
19
+ getResolutionConfigFiles: () => readonly string[];
17
20
  /**
18
21
  * Update the context from the refreshed config
19
22
  * then persist the changes on each affected engines
@@ -224,12 +227,61 @@ declare class Builder {
224
227
  private explicitDepsMeta;
225
228
  private affecteds;
226
229
  private configDependencies;
230
+ private pendingConfigCrawl;
231
+ /** Last complete included inventory, including members which have since been deleted. */
232
+ private sourceInventory;
233
+ /** Existing included owners selected by the last resolution-ledger invalidation pass. */
234
+ private affectedFiles;
235
+ /** Dependency-before-importer parse order for the selected owners. */
236
+ private extractionOrder;
237
+ /** Exact cross-file semantic reads retained per included extraction owner. */
238
+ private resolutionReadSets;
239
+ /** Previously semantic paths which are absent, retained only while their owner is unchanged. */
240
+ private pendingResolutionReadSets;
241
+ /** Missing local priority candidates which can redirect a current semantic resolution. */
242
+ private resolutionCandidateSets;
243
+ /** Exact resolver configuration reads retained per included semantic owner. */
244
+ private resolutionConfigurationSets;
245
+ /** Byte snapshots for resolver configuration files, independent of filesystem mtimes. */
246
+ private resolutionConfigurationBytes;
247
+ /** Previous effective tsconfig read-set, needed to classify its deletion as an option reload. */
248
+ private tsconfigResolutionFiles;
249
+ /** @internal Current and missing resolver paths which can change the stylesheet. */
250
+ getResolutionReadFiles: () => readonly string[];
251
+ /** @internal Exact local package/tsconfig files which can change semantic resolution. */
252
+ getResolutionConfigurationFiles: () => readonly string[];
253
+ private readResolutionConfiguration;
254
+ private changedResolutionConfigurations;
255
+ private snapshotResolutionConfigurations;
256
+ /**
257
+ * Remember what to crawl; do not crawl yet.
258
+ *
259
+ * The crawl walks the config's own import graph, and resolving a bare specifier there loads a
260
+ * whole TypeScript compiler. Only `registerDependency` reads the result, and only the PostCSS
261
+ * plugin calls that — the CLI and the Vite plugin (which crawls separately, when it watches)
262
+ * paid ~155ms of compiler load per build for a set neither of them ever read.
263
+ */
227
264
  setConfigDependencies(options: SetupContextOptions): void;
265
+ /** Crawl on first read, once per `setConfigDependencies`. */
266
+ private crawlConfigDependencies;
228
267
  setup: (options?: {
229
268
  configPath?: string;
230
269
  cwd?: string;
231
270
  dev?: boolean;
232
271
  }) => Promise<BambooContext | undefined>;
272
+ /** Normalize the path identity shared by the Project ledger and file-owner keys. */
273
+ private sourcePath;
274
+ /**
275
+ * Reload only changed ledger members, then select their transitive included consumers.
276
+ *
277
+ * The dependency graph is snapshotted before mutation: reloading an importer retracts its
278
+ * old forward edges, while deletion removes the target. Waiting until afterwards loses the
279
+ * very closure the rebuild needs. New targets also select every pending importer and each
280
+ * pending importer's dependent closure, because no edge to the new path existed yet.
281
+ */
282
+ private invalidateChangedSources;
283
+ /** Deterministic topological order, with current inventory order as the stable tie-break. */
284
+ private orderAffectedFiles;
233
285
  /**
234
286
  * Write the generated `styled-system`, so an integration can be a project's only codegen.
235
287
  *
@@ -305,16 +357,17 @@ declare function codegen(ctx: BambooContext, ids?: ArtifactId[]): Promise<{
305
357
  }>;
306
358
  //#endregion
307
359
  //#region src/config.d.ts
308
- /**
309
- * Load config and create context with auto-injected plugins.
310
- * Used by the CLI and PostCSS plugin.
311
- */
312
- declare function loadConfigAndCreateContext(options?: {
360
+ interface NodeConfigOptions {
313
361
  cwd?: string;
314
362
  config?: Config;
315
363
  configPath?: string;
316
364
  dev?: boolean;
317
- }): Promise<BambooContext>;
365
+ }
366
+ /**
367
+ * Load config and create context with auto-injected plugins.
368
+ * Used by the CLI and PostCSS plugin.
369
+ */
370
+ declare function loadConfigAndCreateContext(options?: NodeConfigOptions): Promise<BambooContext>;
318
371
  //#endregion
319
372
  //#region src/cpu-profile.d.ts
320
373
  declare const startProfiling: (cwd: string, prefix: string, isWatching?: boolean) => Promise<(cb?: () => void) => void>;
@@ -369,9 +422,6 @@ interface SpecOptions {
369
422
  declare function spec(ctx: BambooContext, options: SpecOptions): Promise<SpecFile[]>;
370
423
  //#endregion
371
424
  //#region src/vite-integration.d.ts
372
- /** Called by an integration that compiles source, as it is constructed. */
373
- declare const markStaticCompilerActive: () => void;
374
- declare const isStaticCompilerActive: () => boolean;
375
425
  /** The project's Vite config, if it has one. Not resolved further than existence. */
376
426
  declare const findViteConfig: (cwd: string) => string | undefined;
377
427
  /**
package/dist/index.d.mts CHANGED
@@ -1,3 +1,4 @@
1
+ import { n as markStaticCompilerActive, t as isStaticCompilerActive } from "./static-compiler-CvT9iHM_.mjs";
1
2
  import { ReportFormat } from "@bamboocss/reporter";
2
3
  import { DeadImport, StyleEncoder, Stylesheet } from "@bamboocss/core";
3
4
  import { Generator, generatePackageExports } from "@bamboocss/generator";
@@ -14,6 +15,8 @@ declare class DiffEngine {
14
15
  * Reload config from disk and refresh the context
15
16
  */
16
17
  reloadConfigAndRefreshContext(fn?: (conf: LoadConfigResult) => void): Promise<import("@bamboocss/types").DiffConfigResult>;
18
+ /** @internal Exact tsconfig files behind the currently attached resolution options. */
19
+ getResolutionConfigFiles: () => readonly string[];
17
20
  /**
18
21
  * Update the context from the refreshed config
19
22
  * then persist the changes on each affected engines
@@ -224,12 +227,61 @@ declare class Builder {
224
227
  private explicitDepsMeta;
225
228
  private affecteds;
226
229
  private configDependencies;
230
+ private pendingConfigCrawl;
231
+ /** Last complete included inventory, including members which have since been deleted. */
232
+ private sourceInventory;
233
+ /** Existing included owners selected by the last resolution-ledger invalidation pass. */
234
+ private affectedFiles;
235
+ /** Dependency-before-importer parse order for the selected owners. */
236
+ private extractionOrder;
237
+ /** Exact cross-file semantic reads retained per included extraction owner. */
238
+ private resolutionReadSets;
239
+ /** Previously semantic paths which are absent, retained only while their owner is unchanged. */
240
+ private pendingResolutionReadSets;
241
+ /** Missing local priority candidates which can redirect a current semantic resolution. */
242
+ private resolutionCandidateSets;
243
+ /** Exact resolver configuration reads retained per included semantic owner. */
244
+ private resolutionConfigurationSets;
245
+ /** Byte snapshots for resolver configuration files, independent of filesystem mtimes. */
246
+ private resolutionConfigurationBytes;
247
+ /** Previous effective tsconfig read-set, needed to classify its deletion as an option reload. */
248
+ private tsconfigResolutionFiles;
249
+ /** @internal Current and missing resolver paths which can change the stylesheet. */
250
+ getResolutionReadFiles: () => readonly string[];
251
+ /** @internal Exact local package/tsconfig files which can change semantic resolution. */
252
+ getResolutionConfigurationFiles: () => readonly string[];
253
+ private readResolutionConfiguration;
254
+ private changedResolutionConfigurations;
255
+ private snapshotResolutionConfigurations;
256
+ /**
257
+ * Remember what to crawl; do not crawl yet.
258
+ *
259
+ * The crawl walks the config's own import graph, and resolving a bare specifier there loads a
260
+ * whole TypeScript compiler. Only `registerDependency` reads the result, and only the PostCSS
261
+ * plugin calls that — the CLI and the Vite plugin (which crawls separately, when it watches)
262
+ * paid ~155ms of compiler load per build for a set neither of them ever read.
263
+ */
227
264
  setConfigDependencies(options: SetupContextOptions): void;
265
+ /** Crawl on first read, once per `setConfigDependencies`. */
266
+ private crawlConfigDependencies;
228
267
  setup: (options?: {
229
268
  configPath?: string;
230
269
  cwd?: string;
231
270
  dev?: boolean;
232
271
  }) => Promise<BambooContext | undefined>;
272
+ /** Normalize the path identity shared by the Project ledger and file-owner keys. */
273
+ private sourcePath;
274
+ /**
275
+ * Reload only changed ledger members, then select their transitive included consumers.
276
+ *
277
+ * The dependency graph is snapshotted before mutation: reloading an importer retracts its
278
+ * old forward edges, while deletion removes the target. Waiting until afterwards loses the
279
+ * very closure the rebuild needs. New targets also select every pending importer and each
280
+ * pending importer's dependent closure, because no edge to the new path existed yet.
281
+ */
282
+ private invalidateChangedSources;
283
+ /** Deterministic topological order, with current inventory order as the stable tie-break. */
284
+ private orderAffectedFiles;
233
285
  /**
234
286
  * Write the generated `styled-system`, so an integration can be a project's only codegen.
235
287
  *
@@ -305,16 +357,17 @@ declare function codegen(ctx: BambooContext, ids?: ArtifactId[]): Promise<{
305
357
  }>;
306
358
  //#endregion
307
359
  //#region src/config.d.ts
308
- /**
309
- * Load config and create context with auto-injected plugins.
310
- * Used by the CLI and PostCSS plugin.
311
- */
312
- declare function loadConfigAndCreateContext(options?: {
360
+ interface NodeConfigOptions {
313
361
  cwd?: string;
314
362
  config?: Config;
315
363
  configPath?: string;
316
364
  dev?: boolean;
317
- }): Promise<BambooContext>;
365
+ }
366
+ /**
367
+ * Load config and create context with auto-injected plugins.
368
+ * Used by the CLI and PostCSS plugin.
369
+ */
370
+ declare function loadConfigAndCreateContext(options?: NodeConfigOptions): Promise<BambooContext>;
318
371
  //#endregion
319
372
  //#region src/cpu-profile.d.ts
320
373
  declare const startProfiling: (cwd: string, prefix: string, isWatching?: boolean) => Promise<(cb?: () => void) => void>;
@@ -369,9 +422,6 @@ interface SpecOptions {
369
422
  declare function spec(ctx: BambooContext, options: SpecOptions): Promise<SpecFile[]>;
370
423
  //#endregion
371
424
  //#region src/vite-integration.d.ts
372
- /** Called by an integration that compiles source, as it is constructed. */
373
- declare const markStaticCompilerActive: () => void;
374
- declare const isStaticCompilerActive: () => boolean;
375
425
  /** The project's Vite config, if it has one. Not resolved further than existence. */
376
426
  declare const findViteConfig: (cwd: string) => string | undefined;
377
427
  /**