@pandacss/node 0.0.0-dev-20230321103030 → 0.0.0-dev-20230323194924
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.ts +147 -4
- package/dist/index.js +550 -156
- package/dist/index.mjs +552 -160
- package/package.json +17 -14
package/dist/index.js
CHANGED
|
@@ -33,9 +33,9 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
33
33
|
));
|
|
34
34
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
35
35
|
|
|
36
|
-
// ../../node_modules/.pnpm/tsup@6.7.0_typescript@
|
|
36
|
+
// ../../node_modules/.pnpm/tsup@6.7.0_typescript@5.0.2/node_modules/tsup/assets/cjs_shims.js
|
|
37
37
|
var init_cjs_shims = __esm({
|
|
38
|
-
"../../node_modules/.pnpm/tsup@6.7.0_typescript@
|
|
38
|
+
"../../node_modules/.pnpm/tsup@6.7.0_typescript@5.0.2/node_modules/tsup/assets/cjs_shims.js"() {
|
|
39
39
|
}
|
|
40
40
|
});
|
|
41
41
|
|
|
@@ -402,6 +402,7 @@ var require_ansi_align = __commonJS({
|
|
|
402
402
|
var src_exports = {};
|
|
403
403
|
__export(src_exports, {
|
|
404
404
|
Builder: () => Builder,
|
|
405
|
+
analyzeTokens: () => analyzeTokens,
|
|
405
406
|
createContext: () => createContext,
|
|
406
407
|
discardDuplicate: () => import_core3.discardDuplicate,
|
|
407
408
|
emitAndExtract: () => emitAndExtract,
|
|
@@ -412,17 +413,388 @@ __export(src_exports, {
|
|
|
412
413
|
loadConfigAndCreateContext: () => loadConfigAndCreateContext,
|
|
413
414
|
setupConfig: () => setupConfig,
|
|
414
415
|
setupGitIgnore: () => setupGitIgnore,
|
|
415
|
-
setupPostcss: () => setupPostcss
|
|
416
|
+
setupPostcss: () => setupPostcss,
|
|
417
|
+
writeAnalyzeJSON: () => writeAnalyzeJSON
|
|
416
418
|
});
|
|
417
419
|
module.exports = __toCommonJS(src_exports);
|
|
418
420
|
init_cjs_shims();
|
|
419
421
|
var import_core3 = require("@pandacss/core");
|
|
420
422
|
|
|
423
|
+
// src/analyze-tokens.ts
|
|
424
|
+
init_cjs_shims();
|
|
425
|
+
var import_logger = require("@pandacss/logger");
|
|
426
|
+
var import_promises = require("fs/promises");
|
|
427
|
+
var import_ts_morph = require("ts-morph");
|
|
428
|
+
|
|
429
|
+
// src/classify.ts
|
|
430
|
+
init_cjs_shims();
|
|
431
|
+
var createReportMaps = () => {
|
|
432
|
+
const byInstanceOfKind = /* @__PURE__ */ new Map();
|
|
433
|
+
const byPropertyName = /* @__PURE__ */ new Map();
|
|
434
|
+
const byCategory = /* @__PURE__ */ new Map();
|
|
435
|
+
const byConditionName = /* @__PURE__ */ new Map();
|
|
436
|
+
const byShorthand = /* @__PURE__ */ new Map();
|
|
437
|
+
const byTokenName = /* @__PURE__ */ new Map();
|
|
438
|
+
const byPropertyPath = /* @__PURE__ */ new Map();
|
|
439
|
+
const fromKind = /* @__PURE__ */ new Map();
|
|
440
|
+
const byType = /* @__PURE__ */ new Map();
|
|
441
|
+
const byInstanceName = /* @__PURE__ */ new Map();
|
|
442
|
+
const colorsUsed = /* @__PURE__ */ new Map();
|
|
443
|
+
return {
|
|
444
|
+
byInstanceOfKind,
|
|
445
|
+
byPropertyName,
|
|
446
|
+
byCategory,
|
|
447
|
+
byConditionName,
|
|
448
|
+
byShorthand,
|
|
449
|
+
byTokenName,
|
|
450
|
+
byPropertyPath,
|
|
451
|
+
fromKind,
|
|
452
|
+
byType,
|
|
453
|
+
byInstanceName,
|
|
454
|
+
colorsUsed
|
|
455
|
+
};
|
|
456
|
+
};
|
|
457
|
+
var colorPropNames = /* @__PURE__ */ new Set(["background", "outline", "border"]);
|
|
458
|
+
var classifyTokens = (ctx, parserResultByFilepath) => {
|
|
459
|
+
const byId = /* @__PURE__ */ new Map();
|
|
460
|
+
const byInstanceId = /* @__PURE__ */ new Map();
|
|
461
|
+
const byFilepath = /* @__PURE__ */ new Map();
|
|
462
|
+
const byInstanceInFilepath = /* @__PURE__ */ new Map();
|
|
463
|
+
const globalMaps = createReportMaps();
|
|
464
|
+
const byFilePathMaps = /* @__PURE__ */ new Map();
|
|
465
|
+
const conditions = new Map(Object.entries(ctx.conditions.values));
|
|
466
|
+
let id = 0, instanceId = 0;
|
|
467
|
+
const isKnownUtility = (reportItem) => {
|
|
468
|
+
const { propName, type, value, from } = reportItem;
|
|
469
|
+
const utility = ctx.config.utilities?.[propName];
|
|
470
|
+
if (utility) {
|
|
471
|
+
if (!utility.shorthand) {
|
|
472
|
+
return Boolean(ctx.tokens.getByName(`${utility.values}.${value}`));
|
|
473
|
+
}
|
|
474
|
+
return Boolean(ctx.tokens.getByName(`${utility.values}.${value}`));
|
|
475
|
+
}
|
|
476
|
+
if (type === "pattern") {
|
|
477
|
+
const pattern = ctx.patterns.getConfig(from.toLowerCase());
|
|
478
|
+
const patternProp = pattern.properties[propName];
|
|
479
|
+
if (!patternProp)
|
|
480
|
+
return false;
|
|
481
|
+
if (patternProp.type === "boolean" || patternProp.type === "number") {
|
|
482
|
+
return true;
|
|
483
|
+
}
|
|
484
|
+
if (patternProp.type === "property") {
|
|
485
|
+
return Boolean(ctx.config.utilities?.[patternProp.value]);
|
|
486
|
+
}
|
|
487
|
+
if (patternProp.type === "enum") {
|
|
488
|
+
return Boolean(patternProp.value.includes(String(value)));
|
|
489
|
+
}
|
|
490
|
+
if (patternProp.type === "token") {
|
|
491
|
+
return Boolean(ctx.tokens.getByName(`${patternProp.value}.${value}`));
|
|
492
|
+
}
|
|
493
|
+
return false;
|
|
494
|
+
}
|
|
495
|
+
return false;
|
|
496
|
+
};
|
|
497
|
+
parserResultByFilepath.forEach((parserResult, filepath) => {
|
|
498
|
+
if (parserResult.isEmpty())
|
|
499
|
+
return;
|
|
500
|
+
const localMaps = createReportMaps();
|
|
501
|
+
const addTo = (map, key, value) => {
|
|
502
|
+
const set = map.get(key) ?? /* @__PURE__ */ new Set();
|
|
503
|
+
set.add(value);
|
|
504
|
+
map.set(key, set);
|
|
505
|
+
};
|
|
506
|
+
const processMap = (map, current, reportInstanceItem) => {
|
|
507
|
+
const { from, type, kind } = reportInstanceItem;
|
|
508
|
+
map.value.forEach((attrNode, attrName) => {
|
|
509
|
+
if (attrNode.isLiteral() || attrNode.isEmptyInitializer()) {
|
|
510
|
+
const value = attrNode.isLiteral() ? attrNode.value : true;
|
|
511
|
+
const reportItem = {
|
|
512
|
+
id: id++,
|
|
513
|
+
instanceId,
|
|
514
|
+
category: "unknown",
|
|
515
|
+
propName: attrName,
|
|
516
|
+
from,
|
|
517
|
+
type,
|
|
518
|
+
kind,
|
|
519
|
+
filepath,
|
|
520
|
+
path: current.concat(attrName),
|
|
521
|
+
value,
|
|
522
|
+
box: attrNode,
|
|
523
|
+
isKnown: false
|
|
524
|
+
};
|
|
525
|
+
reportInstanceItem.contains.push(reportItem.id);
|
|
526
|
+
if (conditions.has(attrName)) {
|
|
527
|
+
addTo(globalMaps.byConditionName, attrName, reportItem.id);
|
|
528
|
+
addTo(localMaps.byConditionName, attrName, reportItem.id);
|
|
529
|
+
reportItem.propName = current[0] ?? attrName;
|
|
530
|
+
reportItem.isKnown = isKnownUtility(reportItem);
|
|
531
|
+
reportItem.conditionName = attrName;
|
|
532
|
+
} else {
|
|
533
|
+
if (current.length && conditions.has(current[0])) {
|
|
534
|
+
reportItem.conditionName = current[0];
|
|
535
|
+
addTo(globalMaps.byConditionName, current[0], reportItem.id);
|
|
536
|
+
addTo(localMaps.byConditionName, current[0], reportItem.id);
|
|
537
|
+
}
|
|
538
|
+
const propName = ctx.utility.shorthands.get(attrName) ?? attrName;
|
|
539
|
+
reportItem.propName = propName;
|
|
540
|
+
const utility = ctx.config.utilities?.[propName];
|
|
541
|
+
reportItem.isKnown = isKnownUtility(reportItem);
|
|
542
|
+
const category = typeof utility?.values === "string" ? utility?.values : "unknown";
|
|
543
|
+
reportItem.category = category;
|
|
544
|
+
addTo(globalMaps.byPropertyName, propName, reportItem.id);
|
|
545
|
+
addTo(localMaps.byPropertyName, propName, reportItem.id);
|
|
546
|
+
addTo(globalMaps.byCategory, category, reportItem.id);
|
|
547
|
+
addTo(localMaps.byCategory, category, reportItem.id);
|
|
548
|
+
if (propName.toLowerCase().includes("color") || colorPropNames.has(propName)) {
|
|
549
|
+
addTo(globalMaps.colorsUsed, value, reportItem.id);
|
|
550
|
+
addTo(localMaps.colorsUsed, value, reportItem.id);
|
|
551
|
+
}
|
|
552
|
+
if (ctx.utility.shorthands.has(attrName)) {
|
|
553
|
+
addTo(globalMaps.byShorthand, attrName, reportItem.id);
|
|
554
|
+
addTo(localMaps.byShorthand, attrName, reportItem.id);
|
|
555
|
+
}
|
|
556
|
+
}
|
|
557
|
+
if (current.length) {
|
|
558
|
+
addTo(globalMaps.byPropertyPath, reportItem.path.join("."), reportItem.id);
|
|
559
|
+
addTo(localMaps.byPropertyPath, reportItem.path.join("."), reportItem.id);
|
|
560
|
+
}
|
|
561
|
+
addTo(globalMaps.byTokenName, String(value), reportItem.id);
|
|
562
|
+
addTo(localMaps.byTokenName, String(value), reportItem.id);
|
|
563
|
+
addTo(globalMaps.byType, type, reportItem.id);
|
|
564
|
+
addTo(localMaps.byType, type, reportItem.id);
|
|
565
|
+
addTo(globalMaps.byInstanceName, from, reportItem.id);
|
|
566
|
+
addTo(localMaps.byInstanceName, from, reportItem.id);
|
|
567
|
+
addTo(globalMaps.fromKind, kind, reportItem.id);
|
|
568
|
+
addTo(localMaps.fromKind, kind, reportItem.id);
|
|
569
|
+
addTo(byFilepath, filepath, reportItem.id);
|
|
570
|
+
byId.set(reportItem.id, reportItem);
|
|
571
|
+
return;
|
|
572
|
+
}
|
|
573
|
+
if (attrNode.isMap() && attrNode.value.size) {
|
|
574
|
+
return processMap(attrNode, current.concat(attrName), reportInstanceItem);
|
|
575
|
+
}
|
|
576
|
+
});
|
|
577
|
+
};
|
|
578
|
+
const processResultItem = (item, kind) => {
|
|
579
|
+
if (!item.box || item.box.isUnresolvable()) {
|
|
580
|
+
return;
|
|
581
|
+
}
|
|
582
|
+
if (!item.data) {
|
|
583
|
+
return;
|
|
584
|
+
}
|
|
585
|
+
const from = item.name;
|
|
586
|
+
const type = item.type;
|
|
587
|
+
const reportInstanceItem = {
|
|
588
|
+
instanceId: instanceId++,
|
|
589
|
+
from,
|
|
590
|
+
type,
|
|
591
|
+
kind,
|
|
592
|
+
filepath,
|
|
593
|
+
value: item.data,
|
|
594
|
+
box: item.box,
|
|
595
|
+
contains: []
|
|
596
|
+
};
|
|
597
|
+
if (item.box.isList()) {
|
|
598
|
+
addTo(byInstanceInFilepath, filepath, reportInstanceItem.instanceId);
|
|
599
|
+
return reportInstanceItem;
|
|
600
|
+
}
|
|
601
|
+
if (item.box.isMap() && item.box.value.size) {
|
|
602
|
+
addTo(byInstanceInFilepath, filepath, reportInstanceItem.instanceId);
|
|
603
|
+
processMap(item.box, [], reportInstanceItem);
|
|
604
|
+
return reportInstanceItem;
|
|
605
|
+
}
|
|
606
|
+
};
|
|
607
|
+
const processComponentResultItem = (item) => {
|
|
608
|
+
const reportInstanceItem = processResultItem(item, "component");
|
|
609
|
+
if (!reportInstanceItem)
|
|
610
|
+
return;
|
|
611
|
+
addTo(globalMaps.byInstanceOfKind, "component", reportInstanceItem.instanceId);
|
|
612
|
+
addTo(localMaps.byInstanceOfKind, "component", reportInstanceItem.instanceId);
|
|
613
|
+
byInstanceId.set(reportInstanceItem.instanceId, reportInstanceItem);
|
|
614
|
+
};
|
|
615
|
+
const processFunctionResultItem = (item) => {
|
|
616
|
+
const reportInstanceItem = processResultItem(item, "function");
|
|
617
|
+
if (!reportInstanceItem)
|
|
618
|
+
return;
|
|
619
|
+
addTo(globalMaps.byInstanceOfKind, "function", reportInstanceItem.instanceId);
|
|
620
|
+
addTo(localMaps.byInstanceOfKind, "function", reportInstanceItem.instanceId);
|
|
621
|
+
byInstanceId.set(reportInstanceItem.instanceId, reportInstanceItem);
|
|
622
|
+
};
|
|
623
|
+
parserResult.jsx.forEach(processComponentResultItem);
|
|
624
|
+
parserResult.css.forEach(processFunctionResultItem);
|
|
625
|
+
parserResult.cva.forEach(processFunctionResultItem);
|
|
626
|
+
parserResult.pattern.forEach((itemList) => {
|
|
627
|
+
itemList.forEach(processFunctionResultItem);
|
|
628
|
+
});
|
|
629
|
+
parserResult.recipe.forEach((itemList) => {
|
|
630
|
+
itemList.forEach(processFunctionResultItem);
|
|
631
|
+
});
|
|
632
|
+
byFilePathMaps.set(filepath, localMaps);
|
|
633
|
+
});
|
|
634
|
+
const pickCount = 10;
|
|
635
|
+
const filesWithMostInstance = Object.fromEntries(
|
|
636
|
+
Array.from(byInstanceInFilepath.entries()).map(([filepath, list]) => [filepath, list.size]).sort((a, b) => b[1] - a[1]).slice(0, pickCount)
|
|
637
|
+
);
|
|
638
|
+
const filesWithMostPropValueCombinations = Object.fromEntries(
|
|
639
|
+
Array.from(byFilepath.entries()).map(([token, list]) => [token, list.size]).sort((a, b) => b[1] - a[1]).slice(0, pickCount)
|
|
640
|
+
);
|
|
641
|
+
return {
|
|
642
|
+
counts: {
|
|
643
|
+
filesWithTokens: byFilepath.size,
|
|
644
|
+
propNameUsed: globalMaps.byPropertyName.size,
|
|
645
|
+
tokenUsed: globalMaps.byTokenName.size,
|
|
646
|
+
shorthandUsed: globalMaps.byShorthand.size,
|
|
647
|
+
propertyPathUsed: globalMaps.byPropertyPath.size,
|
|
648
|
+
typeUsed: globalMaps.byType.size,
|
|
649
|
+
instanceNameUsed: globalMaps.byInstanceName.size,
|
|
650
|
+
kindUsed: globalMaps.fromKind.size,
|
|
651
|
+
instanceOfKindUsed: globalMaps.byInstanceOfKind.size,
|
|
652
|
+
colorsUsed: globalMaps.colorsUsed.size
|
|
653
|
+
},
|
|
654
|
+
stats: {
|
|
655
|
+
//
|
|
656
|
+
filesWithMostInstance,
|
|
657
|
+
filesWithMostPropValueCombinations,
|
|
658
|
+
//
|
|
659
|
+
mostUseds: getXMostUseds(globalMaps, 10)
|
|
660
|
+
},
|
|
661
|
+
details: {
|
|
662
|
+
byId,
|
|
663
|
+
byInstanceId,
|
|
664
|
+
byFilepath,
|
|
665
|
+
byInstanceInFilepath,
|
|
666
|
+
globalMaps,
|
|
667
|
+
byFilePathMaps
|
|
668
|
+
}
|
|
669
|
+
};
|
|
670
|
+
};
|
|
671
|
+
var getXMostUseds = (globalMaps, pickCount) => {
|
|
672
|
+
return {
|
|
673
|
+
propNames: getMostUsedInMap(globalMaps.byPropertyName, pickCount),
|
|
674
|
+
tokens: getMostUsedInMap(globalMaps.byTokenName, pickCount),
|
|
675
|
+
shorthands: getMostUsedInMap(globalMaps.byShorthand, pickCount),
|
|
676
|
+
conditions: getMostUsedInMap(globalMaps.byConditionName, pickCount),
|
|
677
|
+
propertyPaths: getMostUsedInMap(globalMaps.byPropertyPath, pickCount),
|
|
678
|
+
categories: getMostUsedInMap(globalMaps.byCategory, pickCount),
|
|
679
|
+
types: getMostUsedInMap(globalMaps.byType, pickCount),
|
|
680
|
+
instanceNames: getMostUsedInMap(globalMaps.byInstanceName, pickCount),
|
|
681
|
+
fromKinds: getMostUsedInMap(globalMaps.fromKind, pickCount),
|
|
682
|
+
instanceOfKinds: getMostUsedInMap(globalMaps.byInstanceOfKind, pickCount),
|
|
683
|
+
colors: getMostUsedInMap(globalMaps.colorsUsed, pickCount)
|
|
684
|
+
};
|
|
685
|
+
};
|
|
686
|
+
var getMostUsedInMap = (map, pickCount) => {
|
|
687
|
+
return Array.from(map.entries()).map(([key, list]) => [key, list.size]).sort((a, b) => b[1] - a[1]).slice(0, pickCount).map(([key, count]) => ({ key, count }));
|
|
688
|
+
};
|
|
689
|
+
|
|
690
|
+
// src/get-node-range.ts
|
|
691
|
+
init_cjs_shims();
|
|
692
|
+
var getNodeRange = (node) => {
|
|
693
|
+
const src = node.getSourceFile();
|
|
694
|
+
const [startPosition, endPosition] = [node.getStart(), node.getEnd()];
|
|
695
|
+
const startInfo = src.getLineAndColumnAtPos(startPosition);
|
|
696
|
+
const endInfo = src.getLineAndColumnAtPos(endPosition);
|
|
697
|
+
return {
|
|
698
|
+
startPosition,
|
|
699
|
+
startLineNumber: startInfo.line,
|
|
700
|
+
startColumn: startInfo.column,
|
|
701
|
+
endPosition,
|
|
702
|
+
endLineNumber: endInfo.line,
|
|
703
|
+
endColumn: endInfo.column
|
|
704
|
+
};
|
|
705
|
+
};
|
|
706
|
+
|
|
707
|
+
// src/analyze-tokens.ts
|
|
708
|
+
var import_gzip_size = __toESM(require("gzip-size"));
|
|
709
|
+
var import_filesize = require("filesize");
|
|
710
|
+
function analyzeTokens(ctx, options = {
|
|
711
|
+
mode: "box-extractor"
|
|
712
|
+
}) {
|
|
713
|
+
const parserResultByFilepath = /* @__PURE__ */ new Map();
|
|
714
|
+
const extractTimeByFilepath = /* @__PURE__ */ new Map();
|
|
715
|
+
ctx.getFiles().map((file) => {
|
|
716
|
+
const start2 = performance.now();
|
|
717
|
+
const result = ctx.project.parseSourceFile(file, ctx.properties, options.mode);
|
|
718
|
+
const extractMs = performance.now() - start2;
|
|
719
|
+
extractTimeByFilepath.set(file, extractMs);
|
|
720
|
+
import_logger.logger.debug("analyze", `Extracted ${file} in ${extractMs}ms`);
|
|
721
|
+
if (result) {
|
|
722
|
+
parserResultByFilepath.set(file, result);
|
|
723
|
+
options.onResult?.(file, result);
|
|
724
|
+
}
|
|
725
|
+
return [file, result];
|
|
726
|
+
}).filter(([, result]) => result);
|
|
727
|
+
const totalMs = Array.from(extractTimeByFilepath.values()).reduce((a, b) => a + b, 0);
|
|
728
|
+
import_logger.logger.debug("analyze", `Analyzed ${ctx.getFiles().length} files in ${totalMs.toFixed(2)}ms`);
|
|
729
|
+
const minify = ctx.config.minify;
|
|
730
|
+
const files = ctx.chunks.getFiles();
|
|
731
|
+
ctx.config.minify = false;
|
|
732
|
+
const css = ctx.getCss({ files });
|
|
733
|
+
ctx.config.minify = true;
|
|
734
|
+
const minifiedCss = ctx.getCss({ files });
|
|
735
|
+
ctx.config.minify = minify;
|
|
736
|
+
const start = performance.now();
|
|
737
|
+
const analysis = classifyTokens(ctx, parserResultByFilepath);
|
|
738
|
+
const classifyMs = performance.now() - start;
|
|
739
|
+
return Object.assign(
|
|
740
|
+
{
|
|
741
|
+
duration: {
|
|
742
|
+
extractTimeByFiles: Object.fromEntries(extractTimeByFilepath.entries()),
|
|
743
|
+
extractTotal: totalMs,
|
|
744
|
+
classify: classifyMs
|
|
745
|
+
},
|
|
746
|
+
fileSizes: {
|
|
747
|
+
lineCount: css.split("\n").length,
|
|
748
|
+
// rulesCount: css.split('{').length - 1, ?
|
|
749
|
+
normal: (0, import_filesize.filesize)(Buffer.byteLength(css, "utf-8")),
|
|
750
|
+
minified: (0, import_filesize.filesize)(Buffer.byteLength(minifiedCss, "utf-8")),
|
|
751
|
+
gzip: {
|
|
752
|
+
normal: (0, import_filesize.filesize)(import_gzip_size.default.sync(css)),
|
|
753
|
+
minified: (0, import_filesize.filesize)(import_gzip_size.default.sync(minifiedCss))
|
|
754
|
+
}
|
|
755
|
+
}
|
|
756
|
+
},
|
|
757
|
+
analysis
|
|
758
|
+
);
|
|
759
|
+
}
|
|
760
|
+
var analyzeResultSerializer = (_key, value) => {
|
|
761
|
+
if (value instanceof Set) {
|
|
762
|
+
return Array.from(value);
|
|
763
|
+
}
|
|
764
|
+
if (value instanceof Map) {
|
|
765
|
+
return Object.fromEntries(value);
|
|
766
|
+
}
|
|
767
|
+
if (import_ts_morph.Node.isNode(value)) {
|
|
768
|
+
return { kind: value.getKindName(), range: getNodeRange(value) };
|
|
769
|
+
}
|
|
770
|
+
return value;
|
|
771
|
+
};
|
|
772
|
+
var writeAnalyzeJSON = (fileName, result, ctx) => {
|
|
773
|
+
result.details.byInstanceId.forEach((item) => {
|
|
774
|
+
item.box = { type: item.box.type, node: item.box.getNode(), stack: item.box.getStack() };
|
|
775
|
+
});
|
|
776
|
+
return (0, import_promises.writeFile)(
|
|
777
|
+
fileName,
|
|
778
|
+
JSON.stringify(
|
|
779
|
+
Object.assign(result, {
|
|
780
|
+
cwd: ctx.config.cwd,
|
|
781
|
+
theme: ctx.config.theme,
|
|
782
|
+
utilities: ctx.config.utilities,
|
|
783
|
+
conditions: ctx.config.conditions,
|
|
784
|
+
shorthands: ctx.utility.shorthands,
|
|
785
|
+
parserOptions: ctx.parserOptions
|
|
786
|
+
}),
|
|
787
|
+
analyzeResultSerializer,
|
|
788
|
+
2
|
|
789
|
+
)
|
|
790
|
+
);
|
|
791
|
+
};
|
|
792
|
+
|
|
421
793
|
// src/builder.ts
|
|
422
794
|
init_cjs_shims();
|
|
423
795
|
var import_core2 = require("@pandacss/core");
|
|
424
796
|
var import_error = require("@pandacss/error");
|
|
425
|
-
var
|
|
797
|
+
var import_logger4 = require("@pandacss/logger");
|
|
426
798
|
var import_shared = require("@pandacss/shared");
|
|
427
799
|
var import_fs = require("fs");
|
|
428
800
|
var import_fs_extra2 = require("fs-extra");
|
|
@@ -476,7 +848,7 @@ var getChunkEngine = ({ paths, config, runtime: { path, fs } }) => ({
|
|
|
476
848
|
|
|
477
849
|
// src/node-runtime.ts
|
|
478
850
|
init_cjs_shims();
|
|
479
|
-
var
|
|
851
|
+
var import_logger2 = require("@pandacss/logger");
|
|
480
852
|
var import_chokidar = __toESM(require("chokidar"));
|
|
481
853
|
var import_fast_glob = __toESM(require("fast-glob"));
|
|
482
854
|
var import_fs_extra = require("fs-extra");
|
|
@@ -528,7 +900,7 @@ var nodeRuntime = {
|
|
|
528
900
|
ignored: exclude,
|
|
529
901
|
awaitWriteFinish: coalesce ? { stabilityThreshold: 50, pollInterval: 10 } : false
|
|
530
902
|
});
|
|
531
|
-
|
|
903
|
+
import_logger2.logger.debug("watch:file", `watching [${include}]`);
|
|
532
904
|
process.once("SIGINT", async () => {
|
|
533
905
|
await watcher.close();
|
|
534
906
|
});
|
|
@@ -538,10 +910,10 @@ var nodeRuntime = {
|
|
|
538
910
|
};
|
|
539
911
|
process.setMaxListeners(Infinity);
|
|
540
912
|
process.on("unhandledRejection", (reason) => {
|
|
541
|
-
|
|
913
|
+
import_logger2.logger.error("unhandled-rejection", reason);
|
|
542
914
|
});
|
|
543
915
|
process.on("uncaughtException", (reason) => {
|
|
544
|
-
|
|
916
|
+
import_logger2.logger.error("uncaught-exception", reason);
|
|
545
917
|
});
|
|
546
918
|
|
|
547
919
|
// src/output-engine.ts
|
|
@@ -605,18 +977,21 @@ async function loadConfigAndCreateContext(options = {}) {
|
|
|
605
977
|
if (config) {
|
|
606
978
|
Object.assign(conf.config, config);
|
|
607
979
|
}
|
|
980
|
+
if (options.cwd) {
|
|
981
|
+
conf.config.cwd = options.cwd;
|
|
982
|
+
}
|
|
608
983
|
return createContext(conf);
|
|
609
984
|
}
|
|
610
985
|
|
|
611
986
|
// src/extract.ts
|
|
612
987
|
init_cjs_shims();
|
|
613
|
-
var
|
|
988
|
+
var import_logger3 = require("@pandacss/logger");
|
|
614
989
|
var import_lil_fp2 = require("lil-fp");
|
|
615
990
|
|
|
616
991
|
// src/cli-box.ts
|
|
617
992
|
init_cjs_shims();
|
|
618
993
|
|
|
619
|
-
// ../../node_modules/.pnpm/boxen@7.0.
|
|
994
|
+
// ../../node_modules/.pnpm/boxen@7.0.2/node_modules/boxen/index.js
|
|
620
995
|
init_cjs_shims();
|
|
621
996
|
var import_node_process2 = __toESM(require("process"), 1);
|
|
622
997
|
|
|
@@ -686,102 +1061,110 @@ function stringWidth(string, options = {}) {
|
|
|
686
1061
|
return width;
|
|
687
1062
|
}
|
|
688
1063
|
|
|
689
|
-
// ../../node_modules/.pnpm/chalk@5.0
|
|
1064
|
+
// ../../node_modules/.pnpm/chalk@5.2.0/node_modules/chalk/source/index.js
|
|
690
1065
|
init_cjs_shims();
|
|
691
1066
|
|
|
692
|
-
// ../../node_modules/.pnpm/chalk@5.0
|
|
1067
|
+
// ../../node_modules/.pnpm/chalk@5.2.0/node_modules/chalk/source/vendor/ansi-styles/index.js
|
|
693
1068
|
init_cjs_shims();
|
|
694
1069
|
var ANSI_BACKGROUND_OFFSET = 10;
|
|
695
1070
|
var wrapAnsi16 = (offset = 0) => (code) => `\x1B[${code + offset}m`;
|
|
696
1071
|
var wrapAnsi256 = (offset = 0) => (code) => `\x1B[${38 + offset};5;${code}m`;
|
|
697
1072
|
var wrapAnsi16m = (offset = 0) => (red, green, blue) => `\x1B[${38 + offset};2;${red};${green};${blue}m`;
|
|
1073
|
+
var styles = {
|
|
1074
|
+
modifier: {
|
|
1075
|
+
reset: [0, 0],
|
|
1076
|
+
// 21 isn't widely supported and 22 does the same thing
|
|
1077
|
+
bold: [1, 22],
|
|
1078
|
+
dim: [2, 22],
|
|
1079
|
+
italic: [3, 23],
|
|
1080
|
+
underline: [4, 24],
|
|
1081
|
+
overline: [53, 55],
|
|
1082
|
+
inverse: [7, 27],
|
|
1083
|
+
hidden: [8, 28],
|
|
1084
|
+
strikethrough: [9, 29]
|
|
1085
|
+
},
|
|
1086
|
+
color: {
|
|
1087
|
+
black: [30, 39],
|
|
1088
|
+
red: [31, 39],
|
|
1089
|
+
green: [32, 39],
|
|
1090
|
+
yellow: [33, 39],
|
|
1091
|
+
blue: [34, 39],
|
|
1092
|
+
magenta: [35, 39],
|
|
1093
|
+
cyan: [36, 39],
|
|
1094
|
+
white: [37, 39],
|
|
1095
|
+
// Bright color
|
|
1096
|
+
blackBright: [90, 39],
|
|
1097
|
+
gray: [90, 39],
|
|
1098
|
+
// Alias of `blackBright`
|
|
1099
|
+
grey: [90, 39],
|
|
1100
|
+
// Alias of `blackBright`
|
|
1101
|
+
redBright: [91, 39],
|
|
1102
|
+
greenBright: [92, 39],
|
|
1103
|
+
yellowBright: [93, 39],
|
|
1104
|
+
blueBright: [94, 39],
|
|
1105
|
+
magentaBright: [95, 39],
|
|
1106
|
+
cyanBright: [96, 39],
|
|
1107
|
+
whiteBright: [97, 39]
|
|
1108
|
+
},
|
|
1109
|
+
bgColor: {
|
|
1110
|
+
bgBlack: [40, 49],
|
|
1111
|
+
bgRed: [41, 49],
|
|
1112
|
+
bgGreen: [42, 49],
|
|
1113
|
+
bgYellow: [43, 49],
|
|
1114
|
+
bgBlue: [44, 49],
|
|
1115
|
+
bgMagenta: [45, 49],
|
|
1116
|
+
bgCyan: [46, 49],
|
|
1117
|
+
bgWhite: [47, 49],
|
|
1118
|
+
// Bright color
|
|
1119
|
+
bgBlackBright: [100, 49],
|
|
1120
|
+
bgGray: [100, 49],
|
|
1121
|
+
// Alias of `bgBlackBright`
|
|
1122
|
+
bgGrey: [100, 49],
|
|
1123
|
+
// Alias of `bgBlackBright`
|
|
1124
|
+
bgRedBright: [101, 49],
|
|
1125
|
+
bgGreenBright: [102, 49],
|
|
1126
|
+
bgYellowBright: [103, 49],
|
|
1127
|
+
bgBlueBright: [104, 49],
|
|
1128
|
+
bgMagentaBright: [105, 49],
|
|
1129
|
+
bgCyanBright: [106, 49],
|
|
1130
|
+
bgWhiteBright: [107, 49]
|
|
1131
|
+
}
|
|
1132
|
+
};
|
|
1133
|
+
var modifierNames = Object.keys(styles.modifier);
|
|
1134
|
+
var foregroundColorNames = Object.keys(styles.color);
|
|
1135
|
+
var backgroundColorNames = Object.keys(styles.bgColor);
|
|
1136
|
+
var colorNames = [...foregroundColorNames, ...backgroundColorNames];
|
|
698
1137
|
function assembleStyles() {
|
|
699
1138
|
const codes = /* @__PURE__ */ new Map();
|
|
700
|
-
const
|
|
701
|
-
modifier: {
|
|
702
|
-
reset: [0, 0],
|
|
703
|
-
// 21 isn't widely supported and 22 does the same thing
|
|
704
|
-
bold: [1, 22],
|
|
705
|
-
dim: [2, 22],
|
|
706
|
-
italic: [3, 23],
|
|
707
|
-
underline: [4, 24],
|
|
708
|
-
overline: [53, 55],
|
|
709
|
-
inverse: [7, 27],
|
|
710
|
-
hidden: [8, 28],
|
|
711
|
-
strikethrough: [9, 29]
|
|
712
|
-
},
|
|
713
|
-
color: {
|
|
714
|
-
black: [30, 39],
|
|
715
|
-
red: [31, 39],
|
|
716
|
-
green: [32, 39],
|
|
717
|
-
yellow: [33, 39],
|
|
718
|
-
blue: [34, 39],
|
|
719
|
-
magenta: [35, 39],
|
|
720
|
-
cyan: [36, 39],
|
|
721
|
-
white: [37, 39],
|
|
722
|
-
// Bright color
|
|
723
|
-
blackBright: [90, 39],
|
|
724
|
-
redBright: [91, 39],
|
|
725
|
-
greenBright: [92, 39],
|
|
726
|
-
yellowBright: [93, 39],
|
|
727
|
-
blueBright: [94, 39],
|
|
728
|
-
magentaBright: [95, 39],
|
|
729
|
-
cyanBright: [96, 39],
|
|
730
|
-
whiteBright: [97, 39]
|
|
731
|
-
},
|
|
732
|
-
bgColor: {
|
|
733
|
-
bgBlack: [40, 49],
|
|
734
|
-
bgRed: [41, 49],
|
|
735
|
-
bgGreen: [42, 49],
|
|
736
|
-
bgYellow: [43, 49],
|
|
737
|
-
bgBlue: [44, 49],
|
|
738
|
-
bgMagenta: [45, 49],
|
|
739
|
-
bgCyan: [46, 49],
|
|
740
|
-
bgWhite: [47, 49],
|
|
741
|
-
// Bright color
|
|
742
|
-
bgBlackBright: [100, 49],
|
|
743
|
-
bgRedBright: [101, 49],
|
|
744
|
-
bgGreenBright: [102, 49],
|
|
745
|
-
bgYellowBright: [103, 49],
|
|
746
|
-
bgBlueBright: [104, 49],
|
|
747
|
-
bgMagentaBright: [105, 49],
|
|
748
|
-
bgCyanBright: [106, 49],
|
|
749
|
-
bgWhiteBright: [107, 49]
|
|
750
|
-
}
|
|
751
|
-
};
|
|
752
|
-
styles2.color.gray = styles2.color.blackBright;
|
|
753
|
-
styles2.bgColor.bgGray = styles2.bgColor.bgBlackBright;
|
|
754
|
-
styles2.color.grey = styles2.color.blackBright;
|
|
755
|
-
styles2.bgColor.bgGrey = styles2.bgColor.bgBlackBright;
|
|
756
|
-
for (const [groupName, group] of Object.entries(styles2)) {
|
|
1139
|
+
for (const [groupName, group] of Object.entries(styles)) {
|
|
757
1140
|
for (const [styleName, style] of Object.entries(group)) {
|
|
758
|
-
|
|
1141
|
+
styles[styleName] = {
|
|
759
1142
|
open: `\x1B[${style[0]}m`,
|
|
760
1143
|
close: `\x1B[${style[1]}m`
|
|
761
1144
|
};
|
|
762
|
-
group[styleName] =
|
|
1145
|
+
group[styleName] = styles[styleName];
|
|
763
1146
|
codes.set(style[0], style[1]);
|
|
764
1147
|
}
|
|
765
|
-
Object.defineProperty(
|
|
1148
|
+
Object.defineProperty(styles, groupName, {
|
|
766
1149
|
value: group,
|
|
767
1150
|
enumerable: false
|
|
768
1151
|
});
|
|
769
1152
|
}
|
|
770
|
-
Object.defineProperty(
|
|
1153
|
+
Object.defineProperty(styles, "codes", {
|
|
771
1154
|
value: codes,
|
|
772
1155
|
enumerable: false
|
|
773
1156
|
});
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
Object.defineProperties(
|
|
1157
|
+
styles.color.close = "\x1B[39m";
|
|
1158
|
+
styles.bgColor.close = "\x1B[49m";
|
|
1159
|
+
styles.color.ansi = wrapAnsi16();
|
|
1160
|
+
styles.color.ansi256 = wrapAnsi256();
|
|
1161
|
+
styles.color.ansi16m = wrapAnsi16m();
|
|
1162
|
+
styles.bgColor.ansi = wrapAnsi16(ANSI_BACKGROUND_OFFSET);
|
|
1163
|
+
styles.bgColor.ansi256 = wrapAnsi256(ANSI_BACKGROUND_OFFSET);
|
|
1164
|
+
styles.bgColor.ansi16m = wrapAnsi16m(ANSI_BACKGROUND_OFFSET);
|
|
1165
|
+
Object.defineProperties(styles, {
|
|
783
1166
|
rgbToAnsi256: {
|
|
784
|
-
value
|
|
1167
|
+
value(red, green, blue) {
|
|
785
1168
|
if (red === green && green === blue) {
|
|
786
1169
|
if (red < 8) {
|
|
787
1170
|
return 16;
|
|
@@ -796,12 +1179,12 @@ function assembleStyles() {
|
|
|
796
1179
|
enumerable: false
|
|
797
1180
|
},
|
|
798
1181
|
hexToRgb: {
|
|
799
|
-
value
|
|
800
|
-
const matches = /
|
|
1182
|
+
value(hex) {
|
|
1183
|
+
const matches = /[a-f\d]{6}|[a-f\d]{3}/i.exec(hex.toString(16));
|
|
801
1184
|
if (!matches) {
|
|
802
1185
|
return [0, 0, 0];
|
|
803
1186
|
}
|
|
804
|
-
let
|
|
1187
|
+
let [colorString] = matches;
|
|
805
1188
|
if (colorString.length === 3) {
|
|
806
1189
|
colorString = [...colorString].map((character) => character + character).join("");
|
|
807
1190
|
}
|
|
@@ -817,11 +1200,11 @@ function assembleStyles() {
|
|
|
817
1200
|
enumerable: false
|
|
818
1201
|
},
|
|
819
1202
|
hexToAnsi256: {
|
|
820
|
-
value: (hex) =>
|
|
1203
|
+
value: (hex) => styles.rgbToAnsi256(...styles.hexToRgb(hex)),
|
|
821
1204
|
enumerable: false
|
|
822
1205
|
},
|
|
823
1206
|
ansi256ToAnsi: {
|
|
824
|
-
value
|
|
1207
|
+
value(code) {
|
|
825
1208
|
if (code < 8) {
|
|
826
1209
|
return 30 + code;
|
|
827
1210
|
}
|
|
@@ -855,25 +1238,25 @@ function assembleStyles() {
|
|
|
855
1238
|
enumerable: false
|
|
856
1239
|
},
|
|
857
1240
|
rgbToAnsi: {
|
|
858
|
-
value: (red, green, blue) =>
|
|
1241
|
+
value: (red, green, blue) => styles.ansi256ToAnsi(styles.rgbToAnsi256(red, green, blue)),
|
|
859
1242
|
enumerable: false
|
|
860
1243
|
},
|
|
861
1244
|
hexToAnsi: {
|
|
862
|
-
value: (hex) =>
|
|
1245
|
+
value: (hex) => styles.ansi256ToAnsi(styles.hexToAnsi256(hex)),
|
|
863
1246
|
enumerable: false
|
|
864
1247
|
}
|
|
865
1248
|
});
|
|
866
|
-
return
|
|
1249
|
+
return styles;
|
|
867
1250
|
}
|
|
868
1251
|
var ansiStyles = assembleStyles();
|
|
869
1252
|
var ansi_styles_default = ansiStyles;
|
|
870
1253
|
|
|
871
|
-
// ../../node_modules/.pnpm/chalk@5.0
|
|
1254
|
+
// ../../node_modules/.pnpm/chalk@5.2.0/node_modules/chalk/source/vendor/supports-color/index.js
|
|
872
1255
|
init_cjs_shims();
|
|
873
1256
|
var import_node_process = __toESM(require("process"), 1);
|
|
874
1257
|
var import_node_os = __toESM(require("os"), 1);
|
|
875
1258
|
var import_node_tty = __toESM(require("tty"), 1);
|
|
876
|
-
function hasFlag(flag, argv = import_node_process.default.argv) {
|
|
1259
|
+
function hasFlag(flag, argv = globalThis.Deno ? globalThis.Deno.args : import_node_process.default.argv) {
|
|
877
1260
|
const prefix = flag.startsWith("-") ? "" : flag.length === 1 ? "-" : "--";
|
|
878
1261
|
const position = argv.indexOf(prefix + flag);
|
|
879
1262
|
const terminatorPosition = argv.indexOf("--");
|
|
@@ -925,6 +1308,9 @@ function _supportsColor(haveStream, { streamIsTTY, sniffFlags = true } = {}) {
|
|
|
925
1308
|
return 2;
|
|
926
1309
|
}
|
|
927
1310
|
}
|
|
1311
|
+
if ("TF_BUILD" in env && "AGENT_NAME" in env) {
|
|
1312
|
+
return 1;
|
|
1313
|
+
}
|
|
928
1314
|
if (haveStream && !streamIsTTY && forceColor === void 0) {
|
|
929
1315
|
return 0;
|
|
930
1316
|
}
|
|
@@ -940,7 +1326,10 @@ function _supportsColor(haveStream, { streamIsTTY, sniffFlags = true } = {}) {
|
|
|
940
1326
|
return 1;
|
|
941
1327
|
}
|
|
942
1328
|
if ("CI" in env) {
|
|
943
|
-
if (
|
|
1329
|
+
if ("GITHUB_ACTIONS" in env) {
|
|
1330
|
+
return 3;
|
|
1331
|
+
}
|
|
1332
|
+
if (["TRAVIS", "CIRCLECI", "APPVEYOR", "GITLAB_CI", "BUILDKITE", "DRONE"].some((sign) => sign in env) || env.CI_NAME === "codeship") {
|
|
944
1333
|
return 1;
|
|
945
1334
|
}
|
|
946
1335
|
return min;
|
|
@@ -948,19 +1337,21 @@ function _supportsColor(haveStream, { streamIsTTY, sniffFlags = true } = {}) {
|
|
|
948
1337
|
if ("TEAMCITY_VERSION" in env) {
|
|
949
1338
|
return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0;
|
|
950
1339
|
}
|
|
951
|
-
if ("TF_BUILD" in env && "AGENT_NAME" in env) {
|
|
952
|
-
return 1;
|
|
953
|
-
}
|
|
954
1340
|
if (env.COLORTERM === "truecolor") {
|
|
955
1341
|
return 3;
|
|
956
1342
|
}
|
|
1343
|
+
if (env.TERM === "xterm-kitty") {
|
|
1344
|
+
return 3;
|
|
1345
|
+
}
|
|
957
1346
|
if ("TERM_PROGRAM" in env) {
|
|
958
1347
|
const version = Number.parseInt((env.TERM_PROGRAM_VERSION || "").split(".")[0], 10);
|
|
959
1348
|
switch (env.TERM_PROGRAM) {
|
|
960
|
-
case "iTerm.app":
|
|
1349
|
+
case "iTerm.app": {
|
|
961
1350
|
return version >= 3 ? 3 : 2;
|
|
962
|
-
|
|
1351
|
+
}
|
|
1352
|
+
case "Apple_Terminal": {
|
|
963
1353
|
return 2;
|
|
1354
|
+
}
|
|
964
1355
|
}
|
|
965
1356
|
}
|
|
966
1357
|
if (/-256(color)?$/i.test(env.TERM)) {
|
|
@@ -987,7 +1378,7 @@ var supportsColor = {
|
|
|
987
1378
|
};
|
|
988
1379
|
var supports_color_default = supportsColor;
|
|
989
1380
|
|
|
990
|
-
// ../../node_modules/.pnpm/chalk@5.0
|
|
1381
|
+
// ../../node_modules/.pnpm/chalk@5.2.0/node_modules/chalk/source/utilities.js
|
|
991
1382
|
init_cjs_shims();
|
|
992
1383
|
function stringReplaceAll(string, substring, replacer) {
|
|
993
1384
|
let index = string.indexOf(substring);
|
|
@@ -998,7 +1389,7 @@ function stringReplaceAll(string, substring, replacer) {
|
|
|
998
1389
|
let endIndex = 0;
|
|
999
1390
|
let returnValue = "";
|
|
1000
1391
|
do {
|
|
1001
|
-
returnValue += string.
|
|
1392
|
+
returnValue += string.slice(endIndex, index) + substring + replacer;
|
|
1002
1393
|
endIndex = index + substringLength;
|
|
1003
1394
|
index = string.indexOf(substring, endIndex);
|
|
1004
1395
|
} while (index !== -1);
|
|
@@ -1010,7 +1401,7 @@ function stringEncaseCRLFWithFirstIndex(string, prefix, postfix, index) {
|
|
|
1010
1401
|
let returnValue = "";
|
|
1011
1402
|
do {
|
|
1012
1403
|
const gotCR = string[index - 1] === "\r";
|
|
1013
|
-
returnValue += string.
|
|
1404
|
+
returnValue += string.slice(endIndex, gotCR ? index - 1 : index) + prefix + (gotCR ? "\r\n" : "\n") + postfix;
|
|
1014
1405
|
endIndex = index + 1;
|
|
1015
1406
|
index = string.indexOf("\n", endIndex);
|
|
1016
1407
|
} while (index !== -1);
|
|
@@ -1018,7 +1409,7 @@ function stringEncaseCRLFWithFirstIndex(string, prefix, postfix, index) {
|
|
|
1018
1409
|
return returnValue;
|
|
1019
1410
|
}
|
|
1020
1411
|
|
|
1021
|
-
// ../../node_modules/.pnpm/chalk@5.0
|
|
1412
|
+
// ../../node_modules/.pnpm/chalk@5.2.0/node_modules/chalk/source/index.js
|
|
1022
1413
|
var { stdout: stdoutColor, stderr: stderrColor } = supports_color_default;
|
|
1023
1414
|
var GENERATOR = Symbol("GENERATOR");
|
|
1024
1415
|
var STYLER = Symbol("STYLER");
|
|
@@ -1029,7 +1420,7 @@ var levelMapping = [
|
|
|
1029
1420
|
"ansi256",
|
|
1030
1421
|
"ansi16m"
|
|
1031
1422
|
];
|
|
1032
|
-
var
|
|
1423
|
+
var styles2 = /* @__PURE__ */ Object.create(null);
|
|
1033
1424
|
var applyOptions = (object, options = {}) => {
|
|
1034
1425
|
if (options.level && !(Number.isInteger(options.level) && options.level >= 0 && options.level <= 3)) {
|
|
1035
1426
|
throw new Error("The `level` option should be an integer from 0 to 3");
|
|
@@ -1048,7 +1439,7 @@ function createChalk(options) {
|
|
|
1048
1439
|
}
|
|
1049
1440
|
Object.setPrototypeOf(createChalk.prototype, Function.prototype);
|
|
1050
1441
|
for (const [styleName, style] of Object.entries(ansi_styles_default)) {
|
|
1051
|
-
|
|
1442
|
+
styles2[styleName] = {
|
|
1052
1443
|
get() {
|
|
1053
1444
|
const builder = createBuilder(this, createStyler(style.open, style.close, this[STYLER]), this[IS_EMPTY]);
|
|
1054
1445
|
Object.defineProperty(this, styleName, { value: builder });
|
|
@@ -1056,7 +1447,7 @@ for (const [styleName, style] of Object.entries(ansi_styles_default)) {
|
|
|
1056
1447
|
}
|
|
1057
1448
|
};
|
|
1058
1449
|
}
|
|
1059
|
-
|
|
1450
|
+
styles2.visible = {
|
|
1060
1451
|
get() {
|
|
1061
1452
|
const builder = createBuilder(this, this[STYLER], true);
|
|
1062
1453
|
Object.defineProperty(this, "visible", { value: builder });
|
|
@@ -1080,7 +1471,7 @@ var getModelAnsi = (model, level, type, ...arguments_) => {
|
|
|
1080
1471
|
};
|
|
1081
1472
|
var usedModels = ["rgb", "hex", "ansi256"];
|
|
1082
1473
|
for (const model of usedModels) {
|
|
1083
|
-
|
|
1474
|
+
styles2[model] = {
|
|
1084
1475
|
get() {
|
|
1085
1476
|
const { level } = this;
|
|
1086
1477
|
return function(...arguments_) {
|
|
@@ -1090,7 +1481,7 @@ for (const model of usedModels) {
|
|
|
1090
1481
|
}
|
|
1091
1482
|
};
|
|
1092
1483
|
const bgModel = "bg" + model[0].toUpperCase() + model.slice(1);
|
|
1093
|
-
|
|
1484
|
+
styles2[bgModel] = {
|
|
1094
1485
|
get() {
|
|
1095
1486
|
const { level } = this;
|
|
1096
1487
|
return function(...arguments_) {
|
|
@@ -1102,7 +1493,7 @@ for (const model of usedModels) {
|
|
|
1102
1493
|
}
|
|
1103
1494
|
var proto = Object.defineProperties(() => {
|
|
1104
1495
|
}, {
|
|
1105
|
-
...
|
|
1496
|
+
...styles2,
|
|
1106
1497
|
level: {
|
|
1107
1498
|
enumerable: true,
|
|
1108
1499
|
get() {
|
|
@@ -1160,7 +1551,7 @@ var applyStyle = (self, string) => {
|
|
|
1160
1551
|
}
|
|
1161
1552
|
return openAll + string + closeAll;
|
|
1162
1553
|
};
|
|
1163
|
-
Object.defineProperties(createChalk.prototype,
|
|
1554
|
+
Object.defineProperties(createChalk.prototype, styles2);
|
|
1164
1555
|
var chalk = createChalk();
|
|
1165
1556
|
var chalkStderr = createChalk({ level: stderrColor ? stderrColor.level : 0 });
|
|
1166
1557
|
var source_default = chalk;
|
|
@@ -1175,7 +1566,7 @@ function widestLine(string) {
|
|
|
1175
1566
|
return lineWidth;
|
|
1176
1567
|
}
|
|
1177
1568
|
|
|
1178
|
-
// ../../node_modules/.pnpm/boxen@7.0.
|
|
1569
|
+
// ../../node_modules/.pnpm/boxen@7.0.2/node_modules/boxen/index.js
|
|
1179
1570
|
var import_cli_boxes = __toESM(require_cli_boxes(), 1);
|
|
1180
1571
|
|
|
1181
1572
|
// ../../node_modules/.pnpm/camelcase@7.0.0/node_modules/camelcase/index.js
|
|
@@ -1259,7 +1650,7 @@ function camelCase(input, options) {
|
|
|
1259
1650
|
return postProcess(input, toUpperCase);
|
|
1260
1651
|
}
|
|
1261
1652
|
|
|
1262
|
-
// ../../node_modules/.pnpm/boxen@7.0.
|
|
1653
|
+
// ../../node_modules/.pnpm/boxen@7.0.2/node_modules/boxen/index.js
|
|
1263
1654
|
var import_ansi_align = __toESM(require_ansi_align(), 1);
|
|
1264
1655
|
|
|
1265
1656
|
// ../../node_modules/.pnpm/wrap-ansi@8.0.1/node_modules/wrap-ansi/index.js
|
|
@@ -1273,7 +1664,7 @@ var wrapAnsi2562 = (offset = 0) => (code) => `\x1B[${38 + offset};5;${code}m`;
|
|
|
1273
1664
|
var wrapAnsi16m2 = (offset = 0) => (red, green, blue) => `\x1B[${38 + offset};2;${red};${green};${blue}m`;
|
|
1274
1665
|
function assembleStyles2() {
|
|
1275
1666
|
const codes = /* @__PURE__ */ new Map();
|
|
1276
|
-
const
|
|
1667
|
+
const styles3 = {
|
|
1277
1668
|
modifier: {
|
|
1278
1669
|
reset: [0, 0],
|
|
1279
1670
|
// 21 isn't widely supported and 22 does the same thing
|
|
@@ -1325,37 +1716,37 @@ function assembleStyles2() {
|
|
|
1325
1716
|
bgWhiteBright: [107, 49]
|
|
1326
1717
|
}
|
|
1327
1718
|
};
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
for (const [groupName, group] of Object.entries(
|
|
1719
|
+
styles3.color.gray = styles3.color.blackBright;
|
|
1720
|
+
styles3.bgColor.bgGray = styles3.bgColor.bgBlackBright;
|
|
1721
|
+
styles3.color.grey = styles3.color.blackBright;
|
|
1722
|
+
styles3.bgColor.bgGrey = styles3.bgColor.bgBlackBright;
|
|
1723
|
+
for (const [groupName, group] of Object.entries(styles3)) {
|
|
1333
1724
|
for (const [styleName, style] of Object.entries(group)) {
|
|
1334
|
-
|
|
1725
|
+
styles3[styleName] = {
|
|
1335
1726
|
open: `\x1B[${style[0]}m`,
|
|
1336
1727
|
close: `\x1B[${style[1]}m`
|
|
1337
1728
|
};
|
|
1338
|
-
group[styleName] =
|
|
1729
|
+
group[styleName] = styles3[styleName];
|
|
1339
1730
|
codes.set(style[0], style[1]);
|
|
1340
1731
|
}
|
|
1341
|
-
Object.defineProperty(
|
|
1732
|
+
Object.defineProperty(styles3, groupName, {
|
|
1342
1733
|
value: group,
|
|
1343
1734
|
enumerable: false
|
|
1344
1735
|
});
|
|
1345
1736
|
}
|
|
1346
|
-
Object.defineProperty(
|
|
1737
|
+
Object.defineProperty(styles3, "codes", {
|
|
1347
1738
|
value: codes,
|
|
1348
1739
|
enumerable: false
|
|
1349
1740
|
});
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
|
|
1357
|
-
|
|
1358
|
-
Object.defineProperties(
|
|
1741
|
+
styles3.color.close = "\x1B[39m";
|
|
1742
|
+
styles3.bgColor.close = "\x1B[49m";
|
|
1743
|
+
styles3.color.ansi = wrapAnsi162();
|
|
1744
|
+
styles3.color.ansi256 = wrapAnsi2562();
|
|
1745
|
+
styles3.color.ansi16m = wrapAnsi16m2();
|
|
1746
|
+
styles3.bgColor.ansi = wrapAnsi162(ANSI_BACKGROUND_OFFSET2);
|
|
1747
|
+
styles3.bgColor.ansi256 = wrapAnsi2562(ANSI_BACKGROUND_OFFSET2);
|
|
1748
|
+
styles3.bgColor.ansi16m = wrapAnsi16m2(ANSI_BACKGROUND_OFFSET2);
|
|
1749
|
+
Object.defineProperties(styles3, {
|
|
1359
1750
|
rgbToAnsi256: {
|
|
1360
1751
|
value: (red, green, blue) => {
|
|
1361
1752
|
if (red === green && green === blue) {
|
|
@@ -1393,7 +1784,7 @@ function assembleStyles2() {
|
|
|
1393
1784
|
enumerable: false
|
|
1394
1785
|
},
|
|
1395
1786
|
hexToAnsi256: {
|
|
1396
|
-
value: (hex) =>
|
|
1787
|
+
value: (hex) => styles3.rgbToAnsi256(...styles3.hexToRgb(hex)),
|
|
1397
1788
|
enumerable: false
|
|
1398
1789
|
},
|
|
1399
1790
|
ansi256ToAnsi: {
|
|
@@ -1431,15 +1822,15 @@ function assembleStyles2() {
|
|
|
1431
1822
|
enumerable: false
|
|
1432
1823
|
},
|
|
1433
1824
|
rgbToAnsi: {
|
|
1434
|
-
value: (red, green, blue) =>
|
|
1825
|
+
value: (red, green, blue) => styles3.ansi256ToAnsi(styles3.rgbToAnsi256(red, green, blue)),
|
|
1435
1826
|
enumerable: false
|
|
1436
1827
|
},
|
|
1437
1828
|
hexToAnsi: {
|
|
1438
|
-
value: (hex) =>
|
|
1829
|
+
value: (hex) => styles3.ansi256ToAnsi(styles3.hexToAnsi256(hex)),
|
|
1439
1830
|
enumerable: false
|
|
1440
1831
|
}
|
|
1441
1832
|
});
|
|
1442
|
-
return
|
|
1833
|
+
return styles3;
|
|
1443
1834
|
}
|
|
1444
1835
|
var ansiStyles2 = assembleStyles2();
|
|
1445
1836
|
var ansi_styles_default2 = ansiStyles2;
|
|
@@ -1595,7 +1986,7 @@ function wrapAnsi(string, columns, options) {
|
|
|
1595
1986
|
return String(string).normalize().replace(/\r\n/g, "\n").split("\n").map((line) => exec(line, columns, options)).join("\n");
|
|
1596
1987
|
}
|
|
1597
1988
|
|
|
1598
|
-
// ../../node_modules/.pnpm/boxen@7.0.
|
|
1989
|
+
// ../../node_modules/.pnpm/boxen@7.0.2/node_modules/boxen/index.js
|
|
1599
1990
|
var import_cli_boxes2 = __toESM(require_cli_boxes(), 1);
|
|
1600
1991
|
var NEWLINE = "\n";
|
|
1601
1992
|
var PAD = " ";
|
|
@@ -1879,7 +2270,7 @@ async function bundleChunks(ctx) {
|
|
|
1879
2270
|
}
|
|
1880
2271
|
async function writeFileChunk(ctx, file) {
|
|
1881
2272
|
const { path } = ctx.runtime;
|
|
1882
|
-
|
|
2273
|
+
import_logger3.logger.debug("chunk:write", `File: ${path.relative(ctx.config.cwd, file)}`);
|
|
1883
2274
|
const css = extractFile(ctx, file);
|
|
1884
2275
|
if (!css)
|
|
1885
2276
|
return;
|
|
@@ -1893,17 +2284,18 @@ function extractFile(ctx, file) {
|
|
|
1893
2284
|
} = ctx;
|
|
1894
2285
|
return (0, import_lil_fp2.pipe)(
|
|
1895
2286
|
{ file: path.abs(cwd, file) },
|
|
1896
|
-
(0, import_lil_fp2.tap)(() =>
|
|
1897
|
-
import_lil_fp2.Obj.bind("measure", () =>
|
|
2287
|
+
(0, import_lil_fp2.tap)(() => import_logger3.logger.debug("file:extract", file)),
|
|
2288
|
+
import_lil_fp2.Obj.bind("measure", () => import_logger3.logger.time.debug(`Extracted ${file}`)),
|
|
1898
2289
|
import_lil_fp2.Obj.bind(
|
|
1899
2290
|
"result",
|
|
1900
2291
|
(0, import_lil_fp2.tryCatch)(
|
|
1901
|
-
({ file: file2 }) => ctx.project.parseSourceFile(file2),
|
|
1902
|
-
(error) =>
|
|
2292
|
+
({ file: file2 }) => ctx.project.parseSourceFile(file2, ctx.properties),
|
|
2293
|
+
(error) => import_logger3.logger.error("file:parse", error)
|
|
1903
2294
|
)
|
|
1904
2295
|
),
|
|
2296
|
+
import_lil_fp2.Obj.bind("measureCss", () => import_logger3.logger.time.debug(`Parsed ${file}`)),
|
|
1905
2297
|
import_lil_fp2.Obj.bind("css", ({ result }) => result ? ctx.getParserCss(result) : void 0),
|
|
1906
|
-
(0, import_lil_fp2.tap)(({ measure }) => measure()),
|
|
2298
|
+
(0, import_lil_fp2.tap)(({ measure, measureCss }) => [measureCss(), measure()]),
|
|
1907
2299
|
import_lil_fp2.Obj.get("css")
|
|
1908
2300
|
);
|
|
1909
2301
|
}
|
|
@@ -2029,7 +2421,7 @@ var Builder = class {
|
|
|
2029
2421
|
}
|
|
2030
2422
|
async extract() {
|
|
2031
2423
|
const ctx = this.ensure();
|
|
2032
|
-
const done =
|
|
2424
|
+
const done = import_logger4.logger.time.info("Extracted in");
|
|
2033
2425
|
await Promise.all(
|
|
2034
2426
|
ctx.getFiles().map(async (file) => {
|
|
2035
2427
|
const mtime = (0, import_fs.existsSync)(file) ? (0, import_fs_extra2.statSync)(file).mtimeMs : -Infinity;
|
|
@@ -2090,7 +2482,7 @@ var Builder = class {
|
|
|
2090
2482
|
|
|
2091
2483
|
// src/exec-command.ts
|
|
2092
2484
|
init_cjs_shims();
|
|
2093
|
-
var
|
|
2485
|
+
var import_logger5 = require("@pandacss/logger");
|
|
2094
2486
|
var import_child_process = require("child_process");
|
|
2095
2487
|
var import_preferred_pm = __toESM(require("preferred-pm"));
|
|
2096
2488
|
async function execCommand(cmd, cwd) {
|
|
@@ -2102,13 +2494,13 @@ async function execCommand(cmd, cwd) {
|
|
|
2102
2494
|
}
|
|
2103
2495
|
const check = (0, import_child_process.spawnSync)(pm, args, { cwd, stdio: "pipe" });
|
|
2104
2496
|
if (check.status !== 0) {
|
|
2105
|
-
|
|
2497
|
+
import_logger5.logger.error("exec", check.stderr.toString());
|
|
2106
2498
|
}
|
|
2107
2499
|
}
|
|
2108
2500
|
|
|
2109
2501
|
// src/generate.ts
|
|
2110
2502
|
init_cjs_shims();
|
|
2111
|
-
var
|
|
2503
|
+
var import_logger6 = require("@pandacss/logger");
|
|
2112
2504
|
var import_ts_pattern = require("ts-pattern");
|
|
2113
2505
|
|
|
2114
2506
|
// src/load-context.ts
|
|
@@ -2126,7 +2518,7 @@ var loadContext = async (config, configPath) => {
|
|
|
2126
2518
|
// src/generate.ts
|
|
2127
2519
|
async function build(ctx) {
|
|
2128
2520
|
const msg = await emitAndExtract(ctx);
|
|
2129
|
-
|
|
2521
|
+
import_logger6.logger.info("css:emit", msg);
|
|
2130
2522
|
}
|
|
2131
2523
|
async function generate(config, configPath) {
|
|
2132
2524
|
const [ctxRef, loadCtx] = await loadContext(config, configPath);
|
|
@@ -2140,13 +2532,13 @@ async function generate(config, configPath) {
|
|
|
2140
2532
|
if (ctx.config.watch) {
|
|
2141
2533
|
const configWatcher = fs.watch({ include: dependencies });
|
|
2142
2534
|
configWatcher.on("change", async () => {
|
|
2143
|
-
|
|
2535
|
+
import_logger6.logger.info("config:change", "Config changed, restarting...");
|
|
2144
2536
|
await loadCtx();
|
|
2145
2537
|
return build(ctxRef.current);
|
|
2146
2538
|
});
|
|
2147
2539
|
const contentWatcher = fs.watch(ctx.config);
|
|
2148
2540
|
contentWatcher.on("all", async (event, file) => {
|
|
2149
|
-
|
|
2541
|
+
import_logger6.logger.info(`file:${event}`, file);
|
|
2150
2542
|
(0, import_ts_pattern.match)(event).with("unlink", () => {
|
|
2151
2543
|
ctx.project.removeSourceFile(path.abs(cwd, file));
|
|
2152
2544
|
ctx.chunks.rm(file);
|
|
@@ -2160,7 +2552,7 @@ async function generate(config, configPath) {
|
|
|
2160
2552
|
}).otherwise(() => {
|
|
2161
2553
|
});
|
|
2162
2554
|
});
|
|
2163
|
-
|
|
2555
|
+
import_logger6.logger.info("ctx:watch", ctx.messages.watch());
|
|
2164
2556
|
}
|
|
2165
2557
|
}
|
|
2166
2558
|
|
|
@@ -2186,7 +2578,7 @@ function setupGitIgnore({ config: { outdir } }) {
|
|
|
2186
2578
|
|
|
2187
2579
|
// src/setup-config.ts
|
|
2188
2580
|
init_cjs_shims();
|
|
2189
|
-
var
|
|
2581
|
+
var import_logger7 = require("@pandacss/logger");
|
|
2190
2582
|
var import_generator2 = require("@pandacss/generator");
|
|
2191
2583
|
var import_fs_extra3 = require("fs-extra");
|
|
2192
2584
|
var import_look_it_up3 = require("look-it-up");
|
|
@@ -2200,9 +2592,9 @@ async function setupConfig(cwd, { force }) {
|
|
|
2200
2592
|
const cmd = pm === "npm" ? "npm run" : pm;
|
|
2201
2593
|
const isTs = (0, import_look_it_up3.lookItUpSync)("tsconfig.json", cwd);
|
|
2202
2594
|
const file = isTs ? "panda.config.ts" : "panda.config.mjs";
|
|
2203
|
-
|
|
2595
|
+
import_logger7.logger.info("init:config", `creating panda config file: ${(0, import_logger7.quote)(file)}`);
|
|
2204
2596
|
if (!force && configFile) {
|
|
2205
|
-
|
|
2597
|
+
import_logger7.logger.warn("init:config", import_generator2.messages.configExists(cmd));
|
|
2206
2598
|
} else {
|
|
2207
2599
|
const content = import_outdent2.outdent`
|
|
2208
2600
|
import { defineConfig } from "@pandacss/dev"
|
|
@@ -2222,11 +2614,11 @@ async function setupConfig(cwd, { force }) {
|
|
|
2222
2614
|
})
|
|
2223
2615
|
`;
|
|
2224
2616
|
await (0, import_fs_extra3.writeFile)((0, import_path4.join)(cwd, file), content);
|
|
2225
|
-
|
|
2617
|
+
import_logger7.logger.log(import_generator2.messages.thankYou());
|
|
2226
2618
|
}
|
|
2227
2619
|
}
|
|
2228
2620
|
async function setupPostcss(cwd) {
|
|
2229
|
-
|
|
2621
|
+
import_logger7.logger.info("init:postcss", `creating postcss config file: ${(0, import_logger7.quote)("postcss.config.cjs")}`);
|
|
2230
2622
|
const content = import_outdent2.outdent`
|
|
2231
2623
|
module.exports = {
|
|
2232
2624
|
plugins: {
|
|
@@ -2239,6 +2631,7 @@ async function setupPostcss(cwd) {
|
|
|
2239
2631
|
// Annotate the CommonJS export names for ESM import in node:
|
|
2240
2632
|
0 && (module.exports = {
|
|
2241
2633
|
Builder,
|
|
2634
|
+
analyzeTokens,
|
|
2242
2635
|
createContext,
|
|
2243
2636
|
discardDuplicate,
|
|
2244
2637
|
emitAndExtract,
|
|
@@ -2249,5 +2642,6 @@ async function setupPostcss(cwd) {
|
|
|
2249
2642
|
loadConfigAndCreateContext,
|
|
2250
2643
|
setupConfig,
|
|
2251
2644
|
setupGitIgnore,
|
|
2252
|
-
setupPostcss
|
|
2645
|
+
setupPostcss,
|
|
2646
|
+
writeAnalyzeJSON
|
|
2253
2647
|
});
|