@pandacss/node 0.0.0-dev-20230321125457 → 0.0.0-dev-20230323235514

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 CHANGED
@@ -1,9 +1,10 @@
1
1
  export { discardDuplicate } from '@pandacss/core';
2
- import { Root, Message } from 'postcss';
2
+ import * as _pandacss_types from '@pandacss/types';
3
+ import { Artifact, LoadConfigResult, ParserResult, Config } from '@pandacss/types';
4
+ import { Project, ParserMode } from '@pandacss/parser';
3
5
  import { Generator } from '@pandacss/generator';
4
- import { Project } from '@pandacss/parser';
5
- import { Artifact, LoadConfigResult, Config } from '@pandacss/types';
6
6
  import { Runtime } from '@pandacss/types/src/runtime';
7
+ import { Root, Message } from 'postcss';
7
8
 
8
9
  declare const getChunkEngine: ({ paths, config, runtime: { path, fs } }: Generator & {
9
10
  runtime: Runtime;
@@ -34,6 +35,148 @@ type PandaContext = Generator & {
34
35
  output: ReturnType<typeof getOutputEngine>;
35
36
  };
36
37
 
38
+ declare function analyzeTokens(ctx: PandaContext, options?: {
39
+ onResult?: (file: string, result: ParserResult) => void;
40
+ mode?: ParserMode;
41
+ }): {
42
+ duration: {
43
+ extractTimeByFiles: {
44
+ [k: string]: number;
45
+ };
46
+ extractTotal: number;
47
+ classify: number;
48
+ };
49
+ fileSizes: {
50
+ lineCount: number;
51
+ normal: string | number | any[] | {
52
+ value: any;
53
+ symbol: any;
54
+ exponent: number;
55
+ unit: string;
56
+ };
57
+ minified: string | number | any[] | {
58
+ value: any;
59
+ symbol: any;
60
+ exponent: number;
61
+ unit: string;
62
+ };
63
+ gzip: {
64
+ normal: string | number | any[] | {
65
+ value: any;
66
+ symbol: any;
67
+ exponent: number;
68
+ unit: string;
69
+ };
70
+ minified: string | number | any[] | {
71
+ value: any;
72
+ symbol: any;
73
+ exponent: number;
74
+ unit: string;
75
+ };
76
+ };
77
+ };
78
+ } & {
79
+ counts: {
80
+ filesWithTokens: number;
81
+ propNameUsed: number;
82
+ tokenUsed: number;
83
+ shorthandUsed: number;
84
+ propertyPathUsed: number;
85
+ typeUsed: number;
86
+ instanceNameUsed: number;
87
+ kindUsed: number;
88
+ instanceOfKindUsed: number;
89
+ colorsUsed: number;
90
+ };
91
+ stats: {
92
+ filesWithMostInstance: {
93
+ [k: string]: number;
94
+ };
95
+ filesWithMostPropValueCombinations: {
96
+ [k: string]: number;
97
+ };
98
+ mostUseds: {
99
+ propNames: {
100
+ key: string;
101
+ count: number;
102
+ }[];
103
+ tokens: {
104
+ key: string;
105
+ count: number;
106
+ }[];
107
+ shorthands: {
108
+ key: string;
109
+ count: number;
110
+ }[];
111
+ conditions: {
112
+ key: string;
113
+ count: number;
114
+ }[];
115
+ propertyPaths: {
116
+ key: string;
117
+ count: number;
118
+ }[];
119
+ categories: {
120
+ key: string;
121
+ count: number;
122
+ }[];
123
+ types: {
124
+ key: string;
125
+ count: number;
126
+ }[];
127
+ instanceNames: {
128
+ key: string;
129
+ count: number;
130
+ }[];
131
+ fromKinds: {
132
+ key: string;
133
+ count: number;
134
+ }[];
135
+ instanceOfKinds: {
136
+ key: string;
137
+ count: number;
138
+ }[];
139
+ colors: {
140
+ key: string;
141
+ count: number;
142
+ }[];
143
+ };
144
+ };
145
+ details: {
146
+ byId: Map<number, _pandacss_types.ReportItem>;
147
+ byInstanceId: Map<number, _pandacss_types.ReportInstanceItem>;
148
+ byFilepath: Map<string, Set<number>>;
149
+ byInstanceInFilepath: Map<string, Set<number>>;
150
+ globalMaps: {
151
+ byInstanceOfKind: Map<"function" | "component", Set<number>>;
152
+ byPropertyName: Map<string, Set<number>>;
153
+ byCategory: Map<string, Set<number>>;
154
+ byConditionName: Map<string, Set<number>>;
155
+ byShorthand: Map<string, Set<number>>;
156
+ byTokenName: Map<string, Set<number>>;
157
+ byPropertyPath: Map<string, Set<number>>;
158
+ fromKind: Map<"function" | "component", Set<number>>;
159
+ byType: Map<string, Set<number>>;
160
+ byInstanceName: Map<string, Set<number>>;
161
+ colorsUsed: Map<string, Set<number>>;
162
+ };
163
+ byFilePathMaps: Map<string, {
164
+ byInstanceOfKind: Map<"function" | "component", Set<number>>;
165
+ byPropertyName: Map<string, Set<number>>;
166
+ byCategory: Map<string, Set<number>>;
167
+ byConditionName: Map<string, Set<number>>;
168
+ byShorthand: Map<string, Set<number>>;
169
+ byTokenName: Map<string, Set<number>>;
170
+ byPropertyPath: Map<string, Set<number>>;
171
+ fromKind: Map<"function" | "component", Set<number>>;
172
+ byType: Map<string, Set<number>>;
173
+ byInstanceName: Map<string, Set<number>>;
174
+ colorsUsed: Map<string, Set<number>>;
175
+ }>;
176
+ };
177
+ };
178
+ declare const writeAnalyzeJSON: (fileName: string, result: ReturnType<typeof analyzeTokens>, ctx: PandaContext) => Promise<void>;
179
+
37
180
  declare class Builder {
38
181
  /**
39
182
  * Map of file path to modified time
@@ -76,4 +219,4 @@ declare function setupConfig(cwd: string, { force }: {
76
219
  }): Promise<void>;
77
220
  declare function setupPostcss(cwd: string): Promise<void>;
78
221
 
79
- export { Builder, createContext, emitAndExtract, emitArtifacts, execCommand, extractCss, generate, loadConfigAndCreateContext, setupConfig, setupGitIgnore, setupPostcss };
222
+ export { Builder, analyzeTokens, createContext, emitAndExtract, emitArtifacts, execCommand, extractCss, generate, loadConfigAndCreateContext, setupConfig, setupGitIgnore, setupPostcss, writeAnalyzeJSON };