@bamboocss/node 1.45.5 → 1.46.1
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.cjs +671 -296
- package/dist/index.d.cts +67 -9
- package/dist/index.d.mts +67 -9
- package/dist/index.mjs +667 -292
- package/dist/static-compiler-C1QNL5nu.d.cts +6 -0
- package/dist/static-compiler-CvT9iHM_.d.mts +6 -0
- package/dist/static-compiler.cjs +22 -0
- package/dist/static-compiler.d.cts +2 -0
- package/dist/static-compiler.d.mts +2 -0
- package/dist/static-compiler.mjs +20 -0
- package/package.json +29 -16
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,69 @@ 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
|
+
/** Config-graph mtimes as of the last completed setup, consulted by the dev fast path. */
|
|
250
|
+
private configGraphMtimes;
|
|
251
|
+
/** @internal Current and missing resolver paths which can change the stylesheet. */
|
|
252
|
+
getResolutionReadFiles: () => readonly string[];
|
|
253
|
+
/** @internal Exact local package/tsconfig files which can change semantic resolution. */
|
|
254
|
+
getResolutionConfigurationFiles: () => readonly string[];
|
|
255
|
+
private readResolutionConfiguration;
|
|
256
|
+
private changedResolutionConfigurations;
|
|
257
|
+
private snapshotResolutionConfigurations;
|
|
258
|
+
/**
|
|
259
|
+
* Remember what to crawl; do not crawl yet.
|
|
260
|
+
*
|
|
261
|
+
* The crawl walks the config's own import graph, and resolving a bare specifier there loads a
|
|
262
|
+
* whole TypeScript compiler. Only `registerDependency` reads the result, and only the PostCSS
|
|
263
|
+
* plugin calls that — the CLI and the Vite plugin (which crawls separately, when it watches)
|
|
264
|
+
* paid ~155ms of compiler load per build for a set neither of them ever read.
|
|
265
|
+
*/
|
|
227
266
|
setConfigDependencies(options: SetupContextOptions): void;
|
|
267
|
+
/** Crawl on first read, once per `setConfigDependencies`. */
|
|
268
|
+
private crawlConfigDependencies;
|
|
228
269
|
setup: (options?: {
|
|
229
270
|
configPath?: string;
|
|
230
271
|
cwd?: string;
|
|
231
272
|
dev?: boolean;
|
|
232
273
|
}) => Promise<BambooContext | undefined>;
|
|
274
|
+
/** Every file whose content participates in the resolved config, for the dev fast path. */
|
|
275
|
+
private configGraphFiles;
|
|
276
|
+
private configGraphUnchanged;
|
|
277
|
+
private snapshotConfigGraphMtimes;
|
|
278
|
+
/** The per-pass source bookkeeping every setup ends with, config reload or not. */
|
|
279
|
+
private refreshSourceState;
|
|
280
|
+
/** Normalize the path identity shared by the Project ledger and file-owner keys. */
|
|
281
|
+
private sourcePath;
|
|
282
|
+
/**
|
|
283
|
+
* Reload only changed ledger members, then select their transitive included consumers.
|
|
284
|
+
*
|
|
285
|
+
* The dependency graph is snapshotted before mutation: reloading an importer retracts its
|
|
286
|
+
* old forward edges, while deletion removes the target. Waiting until afterwards loses the
|
|
287
|
+
* very closure the rebuild needs. New targets also select every pending importer and each
|
|
288
|
+
* pending importer's dependent closure, because no edge to the new path existed yet.
|
|
289
|
+
*/
|
|
290
|
+
private invalidateChangedSources;
|
|
291
|
+
/** Deterministic topological order, with current inventory order as the stable tie-break. */
|
|
292
|
+
private orderAffectedFiles;
|
|
233
293
|
/**
|
|
234
294
|
* Write the generated `styled-system`, so an integration can be a project's only codegen.
|
|
235
295
|
*
|
|
@@ -305,16 +365,17 @@ declare function codegen(ctx: BambooContext, ids?: ArtifactId[]): Promise<{
|
|
|
305
365
|
}>;
|
|
306
366
|
//#endregion
|
|
307
367
|
//#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?: {
|
|
368
|
+
interface NodeConfigOptions {
|
|
313
369
|
cwd?: string;
|
|
314
370
|
config?: Config;
|
|
315
371
|
configPath?: string;
|
|
316
372
|
dev?: boolean;
|
|
317
|
-
}
|
|
373
|
+
}
|
|
374
|
+
/**
|
|
375
|
+
* Load config and create context with auto-injected plugins.
|
|
376
|
+
* Used by the CLI and PostCSS plugin.
|
|
377
|
+
*/
|
|
378
|
+
declare function loadConfigAndCreateContext(options?: NodeConfigOptions): Promise<BambooContext>;
|
|
318
379
|
//#endregion
|
|
319
380
|
//#region src/cpu-profile.d.ts
|
|
320
381
|
declare const startProfiling: (cwd: string, prefix: string, isWatching?: boolean) => Promise<(cb?: () => void) => void>;
|
|
@@ -369,9 +430,6 @@ interface SpecOptions {
|
|
|
369
430
|
declare function spec(ctx: BambooContext, options: SpecOptions): Promise<SpecFile[]>;
|
|
370
431
|
//#endregion
|
|
371
432
|
//#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
433
|
/** The project's Vite config, if it has one. Not resolved further than existence. */
|
|
376
434
|
declare const findViteConfig: (cwd: string) => string | undefined;
|
|
377
435
|
/**
|
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,69 @@ 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
|
+
/** Config-graph mtimes as of the last completed setup, consulted by the dev fast path. */
|
|
250
|
+
private configGraphMtimes;
|
|
251
|
+
/** @internal Current and missing resolver paths which can change the stylesheet. */
|
|
252
|
+
getResolutionReadFiles: () => readonly string[];
|
|
253
|
+
/** @internal Exact local package/tsconfig files which can change semantic resolution. */
|
|
254
|
+
getResolutionConfigurationFiles: () => readonly string[];
|
|
255
|
+
private readResolutionConfiguration;
|
|
256
|
+
private changedResolutionConfigurations;
|
|
257
|
+
private snapshotResolutionConfigurations;
|
|
258
|
+
/**
|
|
259
|
+
* Remember what to crawl; do not crawl yet.
|
|
260
|
+
*
|
|
261
|
+
* The crawl walks the config's own import graph, and resolving a bare specifier there loads a
|
|
262
|
+
* whole TypeScript compiler. Only `registerDependency` reads the result, and only the PostCSS
|
|
263
|
+
* plugin calls that — the CLI and the Vite plugin (which crawls separately, when it watches)
|
|
264
|
+
* paid ~155ms of compiler load per build for a set neither of them ever read.
|
|
265
|
+
*/
|
|
227
266
|
setConfigDependencies(options: SetupContextOptions): void;
|
|
267
|
+
/** Crawl on first read, once per `setConfigDependencies`. */
|
|
268
|
+
private crawlConfigDependencies;
|
|
228
269
|
setup: (options?: {
|
|
229
270
|
configPath?: string;
|
|
230
271
|
cwd?: string;
|
|
231
272
|
dev?: boolean;
|
|
232
273
|
}) => Promise<BambooContext | undefined>;
|
|
274
|
+
/** Every file whose content participates in the resolved config, for the dev fast path. */
|
|
275
|
+
private configGraphFiles;
|
|
276
|
+
private configGraphUnchanged;
|
|
277
|
+
private snapshotConfigGraphMtimes;
|
|
278
|
+
/** The per-pass source bookkeeping every setup ends with, config reload or not. */
|
|
279
|
+
private refreshSourceState;
|
|
280
|
+
/** Normalize the path identity shared by the Project ledger and file-owner keys. */
|
|
281
|
+
private sourcePath;
|
|
282
|
+
/**
|
|
283
|
+
* Reload only changed ledger members, then select their transitive included consumers.
|
|
284
|
+
*
|
|
285
|
+
* The dependency graph is snapshotted before mutation: reloading an importer retracts its
|
|
286
|
+
* old forward edges, while deletion removes the target. Waiting until afterwards loses the
|
|
287
|
+
* very closure the rebuild needs. New targets also select every pending importer and each
|
|
288
|
+
* pending importer's dependent closure, because no edge to the new path existed yet.
|
|
289
|
+
*/
|
|
290
|
+
private invalidateChangedSources;
|
|
291
|
+
/** Deterministic topological order, with current inventory order as the stable tie-break. */
|
|
292
|
+
private orderAffectedFiles;
|
|
233
293
|
/**
|
|
234
294
|
* Write the generated `styled-system`, so an integration can be a project's only codegen.
|
|
235
295
|
*
|
|
@@ -305,16 +365,17 @@ declare function codegen(ctx: BambooContext, ids?: ArtifactId[]): Promise<{
|
|
|
305
365
|
}>;
|
|
306
366
|
//#endregion
|
|
307
367
|
//#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?: {
|
|
368
|
+
interface NodeConfigOptions {
|
|
313
369
|
cwd?: string;
|
|
314
370
|
config?: Config;
|
|
315
371
|
configPath?: string;
|
|
316
372
|
dev?: boolean;
|
|
317
|
-
}
|
|
373
|
+
}
|
|
374
|
+
/**
|
|
375
|
+
* Load config and create context with auto-injected plugins.
|
|
376
|
+
* Used by the CLI and PostCSS plugin.
|
|
377
|
+
*/
|
|
378
|
+
declare function loadConfigAndCreateContext(options?: NodeConfigOptions): Promise<BambooContext>;
|
|
318
379
|
//#endregion
|
|
319
380
|
//#region src/cpu-profile.d.ts
|
|
320
381
|
declare const startProfiling: (cwd: string, prefix: string, isWatching?: boolean) => Promise<(cb?: () => void) => void>;
|
|
@@ -369,9 +430,6 @@ interface SpecOptions {
|
|
|
369
430
|
declare function spec(ctx: BambooContext, options: SpecOptions): Promise<SpecFile[]>;
|
|
370
431
|
//#endregion
|
|
371
432
|
//#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
433
|
/** The project's Vite config, if it has one. Not resolved further than existence. */
|
|
376
434
|
declare const findViteConfig: (cwd: string) => string | undefined;
|
|
377
435
|
/**
|