chaincss 2.1.15 → 2.1.17
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/plugins/vite.js +23 -0
- package/package.json +1 -1
- package/src/plugins/vite.ts +28 -0
package/dist/plugins/vite.js
CHANGED
|
@@ -3370,6 +3370,11 @@ const setManifest = (manifest) => {
|
|
|
3370
3370
|
}
|
|
3371
3371
|
`;
|
|
3372
3372
|
}
|
|
3373
|
+
let chainCount = 0;
|
|
3374
|
+
let staticCount = 0;
|
|
3375
|
+
let dynamicCount = 0;
|
|
3376
|
+
let hybridCount = 0;
|
|
3377
|
+
let totalCSSBytes = 0;
|
|
3373
3378
|
return {
|
|
3374
3379
|
name: "chaincss",
|
|
3375
3380
|
enforce: "pre",
|
|
@@ -3417,6 +3422,19 @@ const setManifest = (manifest) => {
|
|
|
3417
3422
|
}
|
|
3418
3423
|
log(`Processing: ${fileName}`);
|
|
3419
3424
|
processedFiles.add(id);
|
|
3425
|
+
const chainMatches = source.match(/chain\(/g);
|
|
3426
|
+
const smartMatches = source.match(/smartChain\(/g);
|
|
3427
|
+
const total = (chainMatches?.length || 0) + (smartMatches?.length || 0);
|
|
3428
|
+
if (total > 0) {
|
|
3429
|
+
chainCount += total;
|
|
3430
|
+
if (smartMatches) {
|
|
3431
|
+
hybridCount += smartMatches.length;
|
|
3432
|
+
staticCount += chainMatches?.length || 0;
|
|
3433
|
+
} else {
|
|
3434
|
+
staticCount += total;
|
|
3435
|
+
}
|
|
3436
|
+
console.log(` \u2514\u2500 Found ${total} chain calls (${chainMatches?.length || 0} static, ${smartMatches?.length || 0} hybrid)`);
|
|
3437
|
+
}
|
|
3420
3438
|
await compiler.compileSource(source, id);
|
|
3421
3439
|
const css = compiler.getCombinedCSS();
|
|
3422
3440
|
if (css && css.trim()) {
|
|
@@ -3475,6 +3493,11 @@ ${source}`,
|
|
|
3475
3493
|
generatedCSS = "";
|
|
3476
3494
|
generatedManifest = {};
|
|
3477
3495
|
compiler.clearCSS();
|
|
3496
|
+
chainCount = 0;
|
|
3497
|
+
staticCount = 0;
|
|
3498
|
+
dynamicCount = 0;
|
|
3499
|
+
hybridCount = 0;
|
|
3500
|
+
totalCSSBytes = 0;
|
|
3478
3501
|
},
|
|
3479
3502
|
buildEnd() {
|
|
3480
3503
|
const finalCSS = updateCSS();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "chaincss",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.17",
|
|
4
4
|
"description": "ChainCSS v3.0 - The first CSS-in-JS library with true auto-detection mixed mode. Zero runtime by default, dynamic when you need it.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
package/src/plugins/vite.ts
CHANGED
|
@@ -232,6 +232,12 @@ const setManifest = (manifest) => {
|
|
|
232
232
|
`;
|
|
233
233
|
}
|
|
234
234
|
|
|
235
|
+
let chainCount = 0;
|
|
236
|
+
let staticCount = 0;
|
|
237
|
+
let dynamicCount = 0;
|
|
238
|
+
let hybridCount = 0;
|
|
239
|
+
let totalCSSBytes = 0;
|
|
240
|
+
|
|
235
241
|
return {
|
|
236
242
|
name: 'chaincss',
|
|
237
243
|
enforce: 'pre' as const,
|
|
@@ -292,6 +298,23 @@ const setManifest = (manifest) => {
|
|
|
292
298
|
log(`Processing: ${fileName}`);
|
|
293
299
|
processedFiles.add(id);
|
|
294
300
|
|
|
301
|
+
// Count chain() and smartChain() calls
|
|
302
|
+
const chainMatches = source.match(/chain\(/g);
|
|
303
|
+
const smartMatches = source.match(/smartChain\(/g);
|
|
304
|
+
const total = (chainMatches?.length || 0) + (smartMatches?.length || 0);
|
|
305
|
+
|
|
306
|
+
if (total > 0) {
|
|
307
|
+
chainCount += total;
|
|
308
|
+
// Estimate static vs dynamic (smartChain is hybrid, chain is static)
|
|
309
|
+
if (smartMatches) {
|
|
310
|
+
hybridCount += smartMatches.length;
|
|
311
|
+
staticCount += (chainMatches?.length || 0);
|
|
312
|
+
} else {
|
|
313
|
+
staticCount += total;
|
|
314
|
+
}
|
|
315
|
+
console.log(` └─ Found ${total} chain calls (${chainMatches?.length || 0} static, ${smartMatches?.length || 0} hybrid)`);
|
|
316
|
+
}
|
|
317
|
+
|
|
295
318
|
// Compile the source
|
|
296
319
|
await compiler.compileSource(source, id);
|
|
297
320
|
|
|
@@ -375,6 +398,11 @@ const setManifest = (manifest) => {
|
|
|
375
398
|
generatedCSS = '';
|
|
376
399
|
generatedManifest = {};
|
|
377
400
|
compiler.clearCSS();
|
|
401
|
+
chainCount = 0;
|
|
402
|
+
staticCount = 0;
|
|
403
|
+
dynamicCount = 0;
|
|
404
|
+
hybridCount = 0;
|
|
405
|
+
totalCSSBytes = 0;
|
|
378
406
|
},
|
|
379
407
|
|
|
380
408
|
buildEnd() {
|