@pandacss/node 0.0.0-dev-20230411123239 → 0.0.0-dev-20230411200729
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.js +118 -29
- package/dist/index.mjs +104 -10
- package/package.json +16 -15
package/dist/index.js
CHANGED
|
@@ -39,6 +39,80 @@ var init_cjs_shims = __esm({
|
|
|
39
39
|
}
|
|
40
40
|
});
|
|
41
41
|
|
|
42
|
+
// ../../node_modules/.pnpm/duplexer@0.1.2/node_modules/duplexer/index.js
|
|
43
|
+
var require_duplexer = __commonJS({
|
|
44
|
+
"../../node_modules/.pnpm/duplexer@0.1.2/node_modules/duplexer/index.js"(exports, module2) {
|
|
45
|
+
init_cjs_shims();
|
|
46
|
+
var Stream = require("stream");
|
|
47
|
+
var writeMethods = ["write", "end", "destroy"];
|
|
48
|
+
var readMethods = ["resume", "pause"];
|
|
49
|
+
var readEvents = ["data", "close"];
|
|
50
|
+
var slice = Array.prototype.slice;
|
|
51
|
+
module2.exports = duplex;
|
|
52
|
+
function forEach(arr, fn) {
|
|
53
|
+
if (arr.forEach) {
|
|
54
|
+
return arr.forEach(fn);
|
|
55
|
+
}
|
|
56
|
+
for (var i = 0; i < arr.length; i++) {
|
|
57
|
+
fn(arr[i], i);
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
function duplex(writer, reader) {
|
|
61
|
+
var stream2 = new Stream();
|
|
62
|
+
var ended = false;
|
|
63
|
+
forEach(writeMethods, proxyWriter);
|
|
64
|
+
forEach(readMethods, proxyReader);
|
|
65
|
+
forEach(readEvents, proxyStream);
|
|
66
|
+
reader.on("end", handleEnd);
|
|
67
|
+
writer.on("drain", function() {
|
|
68
|
+
stream2.emit("drain");
|
|
69
|
+
});
|
|
70
|
+
writer.on("error", reemit);
|
|
71
|
+
reader.on("error", reemit);
|
|
72
|
+
stream2.writable = writer.writable;
|
|
73
|
+
stream2.readable = reader.readable;
|
|
74
|
+
return stream2;
|
|
75
|
+
function proxyWriter(methodName) {
|
|
76
|
+
stream2[methodName] = method;
|
|
77
|
+
function method() {
|
|
78
|
+
return writer[methodName].apply(writer, arguments);
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
function proxyReader(methodName) {
|
|
82
|
+
stream2[methodName] = method;
|
|
83
|
+
function method() {
|
|
84
|
+
stream2.emit(methodName);
|
|
85
|
+
var func = reader[methodName];
|
|
86
|
+
if (func) {
|
|
87
|
+
return func.apply(reader, arguments);
|
|
88
|
+
}
|
|
89
|
+
reader.emit(methodName);
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
function proxyStream(methodName) {
|
|
93
|
+
reader.on(methodName, reemit2);
|
|
94
|
+
function reemit2() {
|
|
95
|
+
var args = slice.call(arguments);
|
|
96
|
+
args.unshift(methodName);
|
|
97
|
+
stream2.emit.apply(stream2, args);
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
function handleEnd() {
|
|
101
|
+
if (ended) {
|
|
102
|
+
return;
|
|
103
|
+
}
|
|
104
|
+
ended = true;
|
|
105
|
+
var args = slice.call(arguments);
|
|
106
|
+
args.unshift("end");
|
|
107
|
+
stream2.emit.apply(stream2, args);
|
|
108
|
+
}
|
|
109
|
+
function reemit(err) {
|
|
110
|
+
stream2.emit("error", err);
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
});
|
|
115
|
+
|
|
42
116
|
// ../../node_modules/.pnpm/eastasianwidth@0.2.0/node_modules/eastasianwidth/eastasianwidth.js
|
|
43
117
|
var require_eastasianwidth = __commonJS({
|
|
44
118
|
"../../node_modules/.pnpm/eastasianwidth@0.2.0/node_modules/eastasianwidth/eastasianwidth.js"(exports, module2) {
|
|
@@ -428,6 +502,7 @@ var import_ts_morph = require("ts-morph");
|
|
|
428
502
|
|
|
429
503
|
// src/classify.ts
|
|
430
504
|
init_cjs_shims();
|
|
505
|
+
var import_extractor = require("@pandacss/extractor");
|
|
431
506
|
var createReportMaps = () => {
|
|
432
507
|
const byInstanceOfKind = /* @__PURE__ */ new Map();
|
|
433
508
|
const byPropertyName = /* @__PURE__ */ new Map();
|
|
@@ -506,8 +581,8 @@ var classifyTokens = (ctx, parserResultByFilepath) => {
|
|
|
506
581
|
const processMap = (map, current, reportInstanceItem) => {
|
|
507
582
|
const { from, type, kind } = reportInstanceItem;
|
|
508
583
|
map.value.forEach((attrNode, attrName) => {
|
|
509
|
-
if (
|
|
510
|
-
const value =
|
|
584
|
+
if (import_extractor.box.isLiteral(attrNode) || import_extractor.box.isEmptyInitializer(attrNode)) {
|
|
585
|
+
const value = import_extractor.box.isLiteral(attrNode) ? attrNode.value : true;
|
|
511
586
|
const reportItem = {
|
|
512
587
|
id: id++,
|
|
513
588
|
instanceId,
|
|
@@ -570,13 +645,13 @@ var classifyTokens = (ctx, parserResultByFilepath) => {
|
|
|
570
645
|
byId.set(reportItem.id, reportItem);
|
|
571
646
|
return;
|
|
572
647
|
}
|
|
573
|
-
if (
|
|
648
|
+
if (import_extractor.box.isMap(attrNode) && attrNode.value.size) {
|
|
574
649
|
return processMap(attrNode, current.concat(attrName), reportInstanceItem);
|
|
575
650
|
}
|
|
576
651
|
});
|
|
577
652
|
};
|
|
578
653
|
const processResultItem = (item, kind) => {
|
|
579
|
-
if (!item.box ||
|
|
654
|
+
if (!item.box || import_extractor.box.isUnresolvable(item.box)) {
|
|
580
655
|
return;
|
|
581
656
|
}
|
|
582
657
|
if (!item.data) {
|
|
@@ -594,11 +669,11 @@ var classifyTokens = (ctx, parserResultByFilepath) => {
|
|
|
594
669
|
box: item.box,
|
|
595
670
|
contains: []
|
|
596
671
|
};
|
|
597
|
-
if (
|
|
672
|
+
if (import_extractor.box.isArray(item.box)) {
|
|
598
673
|
addTo(byInstanceInFilepath, filepath, reportInstanceItem.instanceId);
|
|
599
674
|
return reportInstanceItem;
|
|
600
675
|
}
|
|
601
|
-
if (
|
|
676
|
+
if (import_extractor.box.isMap(item.box) && item.box.value.size) {
|
|
602
677
|
addTo(byInstanceInFilepath, filepath, reportInstanceItem.instanceId);
|
|
603
678
|
processMap(item.box, [], reportInstanceItem);
|
|
604
679
|
return reportInstanceItem;
|
|
@@ -705,8 +780,22 @@ var getNodeRange = (node) => {
|
|
|
705
780
|
};
|
|
706
781
|
|
|
707
782
|
// src/analyze-tokens.ts
|
|
708
|
-
var import_gzip_size = __toESM(require("gzip-size"));
|
|
709
783
|
var import_filesize = require("filesize");
|
|
784
|
+
|
|
785
|
+
// ../../node_modules/.pnpm/gzip-size@7.0.0/node_modules/gzip-size/index.js
|
|
786
|
+
init_cjs_shims();
|
|
787
|
+
var import_node_fs = __toESM(require("fs"), 1);
|
|
788
|
+
var import_node_stream = __toESM(require("stream"), 1);
|
|
789
|
+
var import_node_zlib = __toESM(require("zlib"), 1);
|
|
790
|
+
var import_node_util = require("util");
|
|
791
|
+
var import_duplexer = __toESM(require_duplexer(), 1);
|
|
792
|
+
var getOptions = (options) => ({ level: 9, ...options });
|
|
793
|
+
var gzip = (0, import_node_util.promisify)(import_node_zlib.default.gzip);
|
|
794
|
+
function gzipSizeSync(input, options) {
|
|
795
|
+
return import_node_zlib.default.gzipSync(input, getOptions(options)).length;
|
|
796
|
+
}
|
|
797
|
+
|
|
798
|
+
// src/analyze-tokens.ts
|
|
710
799
|
function analyzeTokens(ctx, options = {
|
|
711
800
|
mode: "box-extractor"
|
|
712
801
|
}) {
|
|
@@ -749,8 +838,8 @@ function analyzeTokens(ctx, options = {
|
|
|
749
838
|
normal: (0, import_filesize.filesize)(Buffer.byteLength(css, "utf-8")),
|
|
750
839
|
minified: (0, import_filesize.filesize)(Buffer.byteLength(minifiedCss, "utf-8")),
|
|
751
840
|
gzip: {
|
|
752
|
-
normal: (0, import_filesize.filesize)(
|
|
753
|
-
minified: (0, import_filesize.filesize)(
|
|
841
|
+
normal: (0, import_filesize.filesize)(gzipSizeSync(css)),
|
|
842
|
+
minified: (0, import_filesize.filesize)(gzipSizeSync(minifiedCss))
|
|
754
843
|
}
|
|
755
844
|
}
|
|
756
845
|
},
|
|
@@ -814,15 +903,15 @@ var import_lil_fp = require("lil-fp");
|
|
|
814
903
|
// src/chunk-engine.ts
|
|
815
904
|
init_cjs_shims();
|
|
816
905
|
var import_core = require("@pandacss/core");
|
|
817
|
-
var getChunkEngine = ({ paths, config, runtime: { path, fs } }) => ({
|
|
906
|
+
var getChunkEngine = ({ paths, config, runtime: { path, fs: fs2 } }) => ({
|
|
818
907
|
dir: path.join(...paths.chunk),
|
|
819
908
|
readFile(file) {
|
|
820
909
|
const fileName = path.join(...paths.chunk, this.format(file));
|
|
821
|
-
return
|
|
910
|
+
return fs2.existsSync(fileName) ? fs2.readFileSync(fileName) : "";
|
|
822
911
|
},
|
|
823
912
|
getFiles() {
|
|
824
|
-
const files =
|
|
825
|
-
return files.map((file) =>
|
|
913
|
+
const files = fs2.existsSync(this.dir) ? fs2.readDirSync(this.dir) : [];
|
|
914
|
+
return files.map((file) => fs2.readFileSync(path.join(this.dir, file)));
|
|
826
915
|
},
|
|
827
916
|
format(file) {
|
|
828
917
|
return path.relative(config.cwd, file).replaceAll(path.sep, "__").replace(path.extname(file), ".css");
|
|
@@ -836,10 +925,10 @@ var getChunkEngine = ({ paths, config, runtime: { path, fs } }) => ({
|
|
|
836
925
|
};
|
|
837
926
|
},
|
|
838
927
|
rm(file) {
|
|
839
|
-
return
|
|
928
|
+
return fs2.rmFileSync(path.join(...paths.chunk, this.format(file)));
|
|
840
929
|
},
|
|
841
930
|
empty() {
|
|
842
|
-
return
|
|
931
|
+
return fs2.rmDirSync(this.dir);
|
|
843
932
|
},
|
|
844
933
|
get glob() {
|
|
845
934
|
return [`${this.dir}/**/*.css`];
|
|
@@ -918,20 +1007,20 @@ process.on("uncaughtException", (reason) => {
|
|
|
918
1007
|
|
|
919
1008
|
// src/output-engine.ts
|
|
920
1009
|
init_cjs_shims();
|
|
921
|
-
var getOutputEngine = ({ paths, runtime: { path, fs } }) => ({
|
|
1010
|
+
var getOutputEngine = ({ paths, runtime: { path, fs: fs2 } }) => ({
|
|
922
1011
|
empty() {
|
|
923
|
-
|
|
1012
|
+
fs2.rmDirSync(path.join(...paths.root));
|
|
924
1013
|
},
|
|
925
1014
|
async write(output) {
|
|
926
1015
|
if (!output)
|
|
927
1016
|
return;
|
|
928
1017
|
const { dir = paths.root, files } = output;
|
|
929
|
-
|
|
1018
|
+
fs2.ensureDirSync(path.join(...dir));
|
|
930
1019
|
return Promise.all(
|
|
931
1020
|
files.map(async ({ file, code }) => {
|
|
932
1021
|
const absPath = path.join(...dir, file);
|
|
933
1022
|
if (code) {
|
|
934
|
-
return
|
|
1023
|
+
return fs2.writeFile(absPath, code);
|
|
935
1024
|
}
|
|
936
1025
|
})
|
|
937
1026
|
);
|
|
@@ -946,14 +1035,14 @@ var createContext = (conf) => (0, import_lil_fp.pipe)(
|
|
|
946
1035
|
(0, import_lil_fp.tap)(({ config, runtime }) => {
|
|
947
1036
|
config.cwd ||= runtime.cwd();
|
|
948
1037
|
}),
|
|
949
|
-
import_lil_fp.Obj.bind("getFiles", ({ config, runtime: { fs } }) => () => {
|
|
1038
|
+
import_lil_fp.Obj.bind("getFiles", ({ config, runtime: { fs: fs2 } }) => () => {
|
|
950
1039
|
const { include, exclude, cwd } = config;
|
|
951
|
-
return
|
|
1040
|
+
return fs2.glob({ include, exclude, cwd });
|
|
952
1041
|
}),
|
|
953
|
-
import_lil_fp.Obj.bind("project", ({ getFiles, runtime: { fs }, parserOptions }) => {
|
|
1042
|
+
import_lil_fp.Obj.bind("project", ({ getFiles, runtime: { fs: fs2 }, parserOptions }) => {
|
|
954
1043
|
return (0, import_parser.createProject)({
|
|
955
1044
|
getFiles,
|
|
956
|
-
readFile:
|
|
1045
|
+
readFile: fs2.readFileSync,
|
|
957
1046
|
parserOptions
|
|
958
1047
|
});
|
|
959
1048
|
}),
|
|
@@ -1365,9 +1454,9 @@ function _supportsColor(haveStream, { streamIsTTY, sniffFlags = true } = {}) {
|
|
|
1365
1454
|
}
|
|
1366
1455
|
return min;
|
|
1367
1456
|
}
|
|
1368
|
-
function createSupportsColor(
|
|
1369
|
-
const level = _supportsColor(
|
|
1370
|
-
streamIsTTY:
|
|
1457
|
+
function createSupportsColor(stream2, options = {}) {
|
|
1458
|
+
const level = _supportsColor(stream2, {
|
|
1459
|
+
streamIsTTY: stream2 && stream2.isTTY,
|
|
1371
1460
|
...options
|
|
1372
1461
|
});
|
|
1373
1462
|
return translateLevel(level);
|
|
@@ -2525,18 +2614,18 @@ async function generate(config, configPath) {
|
|
|
2525
2614
|
const ctx = ctxRef.current;
|
|
2526
2615
|
await build(ctx);
|
|
2527
2616
|
const {
|
|
2528
|
-
runtime: { fs, path },
|
|
2617
|
+
runtime: { fs: fs2, path },
|
|
2529
2618
|
dependencies,
|
|
2530
2619
|
config: { cwd }
|
|
2531
2620
|
} = ctx;
|
|
2532
2621
|
if (ctx.config.watch) {
|
|
2533
|
-
const configWatcher =
|
|
2622
|
+
const configWatcher = fs2.watch({ include: dependencies });
|
|
2534
2623
|
configWatcher.on("change", async () => {
|
|
2535
2624
|
import_logger6.logger.info("config:change", "Config changed, restarting...");
|
|
2536
2625
|
await loadCtx();
|
|
2537
2626
|
return build(ctxRef.current);
|
|
2538
2627
|
});
|
|
2539
|
-
const contentWatcher =
|
|
2628
|
+
const contentWatcher = fs2.watch(ctx.config);
|
|
2540
2629
|
contentWatcher.on("all", async (event, file) => {
|
|
2541
2630
|
import_logger6.logger.info(`file:${event}`, file);
|
|
2542
2631
|
(0, import_ts_pattern.match)(event).with("unlink", () => {
|
package/dist/index.mjs
CHANGED
|
@@ -4,10 +4,17 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
|
4
4
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
5
|
var __getProtoOf = Object.getPrototypeOf;
|
|
6
6
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
|
|
8
|
+
get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
|
|
9
|
+
}) : x)(function(x) {
|
|
10
|
+
if (typeof require !== "undefined")
|
|
11
|
+
return require.apply(this, arguments);
|
|
12
|
+
throw new Error('Dynamic require of "' + x + '" is not supported');
|
|
13
|
+
});
|
|
7
14
|
var __esm = (fn, res) => function __init() {
|
|
8
15
|
return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
|
|
9
16
|
};
|
|
10
|
-
var __commonJS = (cb, mod) => function
|
|
17
|
+
var __commonJS = (cb, mod) => function __require2() {
|
|
11
18
|
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
12
19
|
};
|
|
13
20
|
var __copyProps = (to, from, except, desc) => {
|
|
@@ -33,6 +40,80 @@ var init_esm_shims = __esm({
|
|
|
33
40
|
}
|
|
34
41
|
});
|
|
35
42
|
|
|
43
|
+
// ../../node_modules/.pnpm/duplexer@0.1.2/node_modules/duplexer/index.js
|
|
44
|
+
var require_duplexer = __commonJS({
|
|
45
|
+
"../../node_modules/.pnpm/duplexer@0.1.2/node_modules/duplexer/index.js"(exports, module) {
|
|
46
|
+
init_esm_shims();
|
|
47
|
+
var Stream = __require("stream");
|
|
48
|
+
var writeMethods = ["write", "end", "destroy"];
|
|
49
|
+
var readMethods = ["resume", "pause"];
|
|
50
|
+
var readEvents = ["data", "close"];
|
|
51
|
+
var slice = Array.prototype.slice;
|
|
52
|
+
module.exports = duplex;
|
|
53
|
+
function forEach(arr, fn) {
|
|
54
|
+
if (arr.forEach) {
|
|
55
|
+
return arr.forEach(fn);
|
|
56
|
+
}
|
|
57
|
+
for (var i = 0; i < arr.length; i++) {
|
|
58
|
+
fn(arr[i], i);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
function duplex(writer, reader) {
|
|
62
|
+
var stream = new Stream();
|
|
63
|
+
var ended = false;
|
|
64
|
+
forEach(writeMethods, proxyWriter);
|
|
65
|
+
forEach(readMethods, proxyReader);
|
|
66
|
+
forEach(readEvents, proxyStream);
|
|
67
|
+
reader.on("end", handleEnd);
|
|
68
|
+
writer.on("drain", function() {
|
|
69
|
+
stream.emit("drain");
|
|
70
|
+
});
|
|
71
|
+
writer.on("error", reemit);
|
|
72
|
+
reader.on("error", reemit);
|
|
73
|
+
stream.writable = writer.writable;
|
|
74
|
+
stream.readable = reader.readable;
|
|
75
|
+
return stream;
|
|
76
|
+
function proxyWriter(methodName) {
|
|
77
|
+
stream[methodName] = method;
|
|
78
|
+
function method() {
|
|
79
|
+
return writer[methodName].apply(writer, arguments);
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
function proxyReader(methodName) {
|
|
83
|
+
stream[methodName] = method;
|
|
84
|
+
function method() {
|
|
85
|
+
stream.emit(methodName);
|
|
86
|
+
var func = reader[methodName];
|
|
87
|
+
if (func) {
|
|
88
|
+
return func.apply(reader, arguments);
|
|
89
|
+
}
|
|
90
|
+
reader.emit(methodName);
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
function proxyStream(methodName) {
|
|
94
|
+
reader.on(methodName, reemit2);
|
|
95
|
+
function reemit2() {
|
|
96
|
+
var args = slice.call(arguments);
|
|
97
|
+
args.unshift(methodName);
|
|
98
|
+
stream.emit.apply(stream, args);
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
function handleEnd() {
|
|
102
|
+
if (ended) {
|
|
103
|
+
return;
|
|
104
|
+
}
|
|
105
|
+
ended = true;
|
|
106
|
+
var args = slice.call(arguments);
|
|
107
|
+
args.unshift("end");
|
|
108
|
+
stream.emit.apply(stream, args);
|
|
109
|
+
}
|
|
110
|
+
function reemit(err) {
|
|
111
|
+
stream.emit("error", err);
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
});
|
|
116
|
+
|
|
36
117
|
// ../../node_modules/.pnpm/eastasianwidth@0.2.0/node_modules/eastasianwidth/eastasianwidth.js
|
|
37
118
|
var require_eastasianwidth = __commonJS({
|
|
38
119
|
"../../node_modules/.pnpm/eastasianwidth@0.2.0/node_modules/eastasianwidth/eastasianwidth.js"(exports, module) {
|
|
@@ -404,6 +485,7 @@ import { Node } from "ts-morph";
|
|
|
404
485
|
|
|
405
486
|
// src/classify.ts
|
|
406
487
|
init_esm_shims();
|
|
488
|
+
import { box } from "@pandacss/extractor";
|
|
407
489
|
var createReportMaps = () => {
|
|
408
490
|
const byInstanceOfKind = /* @__PURE__ */ new Map();
|
|
409
491
|
const byPropertyName = /* @__PURE__ */ new Map();
|
|
@@ -482,8 +564,8 @@ var classifyTokens = (ctx, parserResultByFilepath) => {
|
|
|
482
564
|
const processMap = (map, current, reportInstanceItem) => {
|
|
483
565
|
const { from, type, kind } = reportInstanceItem;
|
|
484
566
|
map.value.forEach((attrNode, attrName) => {
|
|
485
|
-
if (
|
|
486
|
-
const value =
|
|
567
|
+
if (box.isLiteral(attrNode) || box.isEmptyInitializer(attrNode)) {
|
|
568
|
+
const value = box.isLiteral(attrNode) ? attrNode.value : true;
|
|
487
569
|
const reportItem = {
|
|
488
570
|
id: id++,
|
|
489
571
|
instanceId,
|
|
@@ -546,13 +628,13 @@ var classifyTokens = (ctx, parserResultByFilepath) => {
|
|
|
546
628
|
byId.set(reportItem.id, reportItem);
|
|
547
629
|
return;
|
|
548
630
|
}
|
|
549
|
-
if (
|
|
631
|
+
if (box.isMap(attrNode) && attrNode.value.size) {
|
|
550
632
|
return processMap(attrNode, current.concat(attrName), reportInstanceItem);
|
|
551
633
|
}
|
|
552
634
|
});
|
|
553
635
|
};
|
|
554
636
|
const processResultItem = (item, kind) => {
|
|
555
|
-
if (!item.box ||
|
|
637
|
+
if (!item.box || box.isUnresolvable(item.box)) {
|
|
556
638
|
return;
|
|
557
639
|
}
|
|
558
640
|
if (!item.data) {
|
|
@@ -570,11 +652,11 @@ var classifyTokens = (ctx, parserResultByFilepath) => {
|
|
|
570
652
|
box: item.box,
|
|
571
653
|
contains: []
|
|
572
654
|
};
|
|
573
|
-
if (item.box
|
|
655
|
+
if (box.isArray(item.box)) {
|
|
574
656
|
addTo(byInstanceInFilepath, filepath, reportInstanceItem.instanceId);
|
|
575
657
|
return reportInstanceItem;
|
|
576
658
|
}
|
|
577
|
-
if (
|
|
659
|
+
if (box.isMap(item.box) && item.box.value.size) {
|
|
578
660
|
addTo(byInstanceInFilepath, filepath, reportInstanceItem.instanceId);
|
|
579
661
|
processMap(item.box, [], reportInstanceItem);
|
|
580
662
|
return reportInstanceItem;
|
|
@@ -681,8 +763,20 @@ var getNodeRange = (node) => {
|
|
|
681
763
|
};
|
|
682
764
|
|
|
683
765
|
// src/analyze-tokens.ts
|
|
684
|
-
import gzipSize from "gzip-size";
|
|
685
766
|
import { filesize } from "filesize";
|
|
767
|
+
|
|
768
|
+
// ../../node_modules/.pnpm/gzip-size@7.0.0/node_modules/gzip-size/index.js
|
|
769
|
+
init_esm_shims();
|
|
770
|
+
var import_duplexer = __toESM(require_duplexer(), 1);
|
|
771
|
+
import zlib from "node:zlib";
|
|
772
|
+
import { promisify } from "node:util";
|
|
773
|
+
var getOptions = (options) => ({ level: 9, ...options });
|
|
774
|
+
var gzip = promisify(zlib.gzip);
|
|
775
|
+
function gzipSizeSync(input, options) {
|
|
776
|
+
return zlib.gzipSync(input, getOptions(options)).length;
|
|
777
|
+
}
|
|
778
|
+
|
|
779
|
+
// src/analyze-tokens.ts
|
|
686
780
|
function analyzeTokens(ctx, options = {
|
|
687
781
|
mode: "box-extractor"
|
|
688
782
|
}) {
|
|
@@ -725,8 +819,8 @@ function analyzeTokens(ctx, options = {
|
|
|
725
819
|
normal: filesize(Buffer.byteLength(css, "utf-8")),
|
|
726
820
|
minified: filesize(Buffer.byteLength(minifiedCss, "utf-8")),
|
|
727
821
|
gzip: {
|
|
728
|
-
normal: filesize(
|
|
729
|
-
minified: filesize(
|
|
822
|
+
normal: filesize(gzipSizeSync(css)),
|
|
823
|
+
minified: filesize(gzipSizeSync(minifiedCss))
|
|
730
824
|
}
|
|
731
825
|
}
|
|
732
826
|
},
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pandacss/node",
|
|
3
|
-
"version": "0.0.0-dev-
|
|
3
|
+
"version": "0.0.0-dev-20230411200729",
|
|
4
4
|
"description": "The core css panda library",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.mjs",
|
|
@@ -17,10 +17,9 @@
|
|
|
17
17
|
"chokidar": "^3.5.3",
|
|
18
18
|
"fast-glob": "^3.2.12",
|
|
19
19
|
"file-size": "^1.0.0",
|
|
20
|
-
"filesize": "^10.0.
|
|
20
|
+
"filesize": "^10.0.7",
|
|
21
21
|
"fs-extra": "11.1.1",
|
|
22
22
|
"glob-parent": "^6.0.2",
|
|
23
|
-
"gzip-size": "^6.0.0",
|
|
24
23
|
"hookable": "5.5.3",
|
|
25
24
|
"is-glob": "^4.0.3",
|
|
26
25
|
"javascript-stringify": "2.1.0",
|
|
@@ -32,18 +31,19 @@
|
|
|
32
31
|
"pluralize": "8.0.0",
|
|
33
32
|
"postcss": "8.4.21",
|
|
34
33
|
"preferred-pm": "^3.0.3",
|
|
35
|
-
"ts-morph": "
|
|
34
|
+
"ts-morph": "18.0.0",
|
|
36
35
|
"ts-pattern": "4.2.2",
|
|
37
|
-
"@pandacss/config": "0.0.0-dev-
|
|
38
|
-
"@pandacss/core": "0.0.0-dev-
|
|
39
|
-
"@pandacss/error": "0.0.0-dev-
|
|
40
|
-
"@pandacss/generator": "0.0.0-dev-
|
|
41
|
-
"@pandacss/is-valid-prop": "0.0.0-dev-
|
|
42
|
-
"@pandacss/logger": "0.0.0-dev-
|
|
43
|
-
"@pandacss/parser": "0.0.0-dev-
|
|
44
|
-
"@pandacss/
|
|
45
|
-
"@pandacss/
|
|
46
|
-
"@pandacss/
|
|
36
|
+
"@pandacss/config": "0.0.0-dev-20230411200729",
|
|
37
|
+
"@pandacss/core": "0.0.0-dev-20230411200729",
|
|
38
|
+
"@pandacss/error": "0.0.0-dev-20230411200729",
|
|
39
|
+
"@pandacss/generator": "0.0.0-dev-20230411200729",
|
|
40
|
+
"@pandacss/is-valid-prop": "0.0.0-dev-20230411200729",
|
|
41
|
+
"@pandacss/logger": "0.0.0-dev-20230411200729",
|
|
42
|
+
"@pandacss/parser": "0.0.0-dev-20230411200729",
|
|
43
|
+
"@pandacss/extractor": "0.0.0-dev-20230411200729",
|
|
44
|
+
"@pandacss/shared": "0.0.0-dev-20230411200729",
|
|
45
|
+
"@pandacss/token-dictionary": "0.0.0-dev-20230411200729",
|
|
46
|
+
"@pandacss/types": "0.0.0-dev-20230411200729"
|
|
47
47
|
},
|
|
48
48
|
"devDependencies": {
|
|
49
49
|
"@types/fs-extra": "11.0.1",
|
|
@@ -52,7 +52,8 @@
|
|
|
52
52
|
"@types/lodash.merge": "4.6.7",
|
|
53
53
|
"@types/pluralize": "0.0.29",
|
|
54
54
|
"boxen": "^7.0.2",
|
|
55
|
-
"
|
|
55
|
+
"gzip-size": "^7.0.0",
|
|
56
|
+
"@pandacss/fixture": "0.0.0-dev-20230411200729"
|
|
56
57
|
},
|
|
57
58
|
"scripts": {
|
|
58
59
|
"build": "tsup src/index.ts --format=cjs,esm --shims --dts",
|