@pandacss/node 0.0.0-dev-20230205182145 → 0.0.0-dev-20230206084557

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.
Files changed (4) hide show
  1. package/dist/index.d.ts +36 -339
  2. package/dist/index.js +1866 -2256
  3. package/dist/index.mjs +1873 -2236
  4. package/package.json +14 -12
package/dist/index.d.ts CHANGED
@@ -1,171 +1,38 @@
1
- import * as _pandacss_core from '@pandacss/core';
2
- import { StylesheetContext, Conditions, Utility } from '@pandacss/core';
3
1
  export { discardDuplicate } from '@pandacss/core';
4
- import * as _pandacss_types_dist_config from '@pandacss/types/dist/config';
5
- import * as _pandacss_types_dist_shared from '@pandacss/types/dist/shared';
6
- import * as _pandacss_types from '@pandacss/types';
7
- import { LoadConfigResult, RecipeConfig, PatternConfig, Config } from '@pandacss/types';
8
- import { ParserResult } from '@pandacss/parser';
9
- import * as _pandacss_shared from '@pandacss/shared';
10
- import { mapObject } from '@pandacss/shared';
11
- import * as _pandacss_token_dictionary from '@pandacss/token-dictionary';
12
- import { TokenDictionary } from '@pandacss/token-dictionary';
13
2
  import { Root, Message } from 'postcss';
3
+ import { Generator } from '@pandacss/generator';
4
+ import { Project } from '@pandacss/parser';
5
+ import { Artifact, LoadConfigResult, Config } from '@pandacss/types';
6
+ import { Runtime } from '@pandacss/types/src/runtime';
14
7
 
15
- type IO = {
16
- read(id: string): Promise<string>;
17
- write(id: string, content: string): Promise<void>;
18
- rm(id: string): Promise<void>;
8
+ declare const getChunkEngine: ({ paths, config, runtime: { path, fs } }: Generator & {
9
+ runtime: Runtime;
10
+ }) => {
11
+ dir: string;
12
+ readFile(file: string): string;
13
+ getFiles(): string[];
14
+ format(file: string): string;
15
+ getArtifact(file: string, css: string): Artifact;
16
+ rm(file: string): void;
17
+ empty(): void;
18
+ readonly glob: string[];
19
19
  };
20
- type Nullable<T> = T | null | undefined;
21
- type Output = Nullable<{
22
- dir?: string;
23
- files: Array<{
24
- file: string;
25
- code: string | undefined;
26
- }>;
27
- }>;
28
- declare function createContext(conf: LoadConfigResult, io?: IO): {
29
- theme: {
30
- breakpoints?: Record<string, string> | undefined;
31
- keyframes?: _pandacss_types.CssKeyframes | undefined;
32
- tokens?: _pandacss_types.Tokens | undefined;
33
- semanticTokens?: _pandacss_types.SemanticTokens<string> | undefined;
34
- textStyles?: _pandacss_types.TextStyles | undefined;
35
- layerStyles?: _pandacss_types.LayerStyles | undefined;
36
- recipes?: Record<string, RecipeConfig<_pandacss_types.RecipeVariantRecord>> | undefined;
37
- };
38
- config: _pandacss_types_dist_shared.UnwrapExtend<_pandacss_types.RequiredBy<_pandacss_types.Config, "include" | "outdir" | "cwd">>;
39
- configPath: string;
40
- cwd: string;
41
- conf: LoadConfigResult;
42
- chunks: {
43
- dir: string;
44
- readFile(file: string): Promise<string>;
45
- getFiles(): string[];
46
- format(file: string): string;
47
- write(file: string, css: string): Promise<void[]>;
48
- rm(file: string): Promise<void>;
49
- empty(): Promise<void>;
50
- glob: string[];
51
- };
52
- files: string[];
53
- helpers: {
54
- map: typeof mapObject;
55
- };
56
- context: () => StylesheetContext;
57
- exclude: string[];
58
- conditions: Conditions;
59
- importMap: {
60
- css: string;
61
- recipe: string;
62
- pattern: string;
63
- jsx: string;
64
- };
65
- absPath: (str: string) => string;
66
- project: any;
67
- getPath: (pathLike?: string) => string;
68
- paths: {
69
- root: string;
70
- css: string;
71
- token: string;
72
- types: string;
73
- recipe: string;
74
- pattern: string;
75
- chunk: string;
76
- outCss: string;
77
- jsx: string;
78
- };
79
- write: (dir: string, options: Array<{
80
- file: string;
81
- code: string | undefined;
82
- }>) => Promise<void[]>;
83
- writeOutput: (output: Output) => Promise<void[]> | undefined;
84
- cleanOutdir: () => Promise<void>;
85
- getExt: (file: string) => string;
86
- getImport: (items: string, mod: string) => string;
87
- getExport: (mod: string) => string;
88
- cssVarRoot: string;
89
- tokens: TokenDictionary;
90
- hasTokens: boolean;
91
- utility: Utility;
92
- getCss: (collector: ParserResult, file: string) => {
93
- css: string;
94
- file: string;
95
- } | undefined;
96
- getGlobalCss: () => string;
97
- getStaticCss: () => string | undefined;
98
- patterns: Record<string, PatternConfig>;
99
- hasPatterns: boolean;
100
- getPattern: (name: string) => PatternConfig | undefined;
101
- execPattern: (name: string, data: Record<string, any>) => _pandacss_types.SystemStyleObject;
102
- patternNodes: {
103
- type: "pattern";
104
- name: string;
105
- props: string[];
106
- baseName: string;
107
- }[];
108
- getPatternFnName: (jsx: string) => string;
109
- getPatternDetails: (name: string, pattern: PatternConfig | undefined) => {
110
- name: string;
111
- props: string[];
112
- dashName: string;
113
- upperName: string;
114
- styleFn: string;
115
- jsxName: string;
116
- blocklistType: string;
117
- };
118
- recipes: Record<string, RecipeConfig<_pandacss_types.RecipeVariantRecord>>;
119
- getRecipe: (name: string) => RecipeConfig | undefined;
120
- hasRecipes: boolean;
121
- getRecipeDetails: () => {
122
- [x: string]: {
123
- [x: string]: string[];
124
- }[];
125
- }[];
126
- jsxFactory: string;
127
- jsxFactoryDetails: {
128
- name: string;
129
- upperName: string;
130
- typeName: string;
131
- componentName: string;
132
- framework: "solid" | "react" | "preact" | undefined;
133
- };
134
- properties: string[];
135
- extract: (fn: (file: string) => Promise<{
136
- css: string;
137
- file: string;
138
- } | undefined>) => Promise<({
139
- css: string;
140
- file: string;
141
- } | undefined)[]>;
142
- hash?: boolean | undefined;
143
- prefix?: string | undefined;
144
- separator?: "-" | "_" | "=" | undefined;
145
- static?: _pandacss_types.StaticCssOptions | undefined;
146
- minify?: boolean | undefined;
147
- utilities?: _pandacss_types.UtilityConfig | undefined;
148
- emitPackage?: boolean | undefined;
149
- gitignore?: boolean | undefined;
150
- studio?: Partial<_pandacss_types_dist_config.Studio> | undefined;
151
- logLevel?: "debug" | "info" | "warn" | "error" | "silent" | undefined;
152
- presets?: (string | _pandacss_types.Preset)[] | undefined;
153
- preflight?: boolean | undefined;
154
- clean?: boolean | undefined;
155
- watch?: boolean | undefined;
156
- poll?: boolean | undefined;
157
- globalCss?: _pandacss_types.GlobalStyleObject | undefined;
158
- jsxFramework?: "solid" | "react" | "preact" | undefined;
159
- strictTokens?: boolean | undefined;
160
- outExtension?: "mjs" | "js" | undefined;
161
- include: string[];
162
- outdir: string;
20
+
21
+ declare const getOutputEngine: ({ paths, runtime: { path, fs } }: Generator & {
22
+ runtime: Runtime;
23
+ }) => {
24
+ empty(): void;
25
+ write(output: Artifact | undefined): Promise<void[] | undefined>;
163
26
  };
164
- type PandaContext = ReturnType<typeof createContext>;
165
27
 
166
- declare function emitArtifacts(ctx: PandaContext): Promise<string>;
167
- declare function emitAndExtract(ctx: PandaContext): Promise<string>;
168
- declare function extractCss(ctx: PandaContext): Promise<string>;
28
+ declare const createContext: (conf: LoadConfigResult) => PandaContext;
29
+ type PandaContext = Generator & {
30
+ runtime: Runtime;
31
+ project: Project;
32
+ getFiles: () => string[];
33
+ chunks: ReturnType<typeof getChunkEngine>;
34
+ output: ReturnType<typeof getOutputEngine>;
35
+ };
169
36
 
170
37
  declare class Builder {
171
38
  /**
@@ -178,7 +45,7 @@ declare class Builder {
178
45
  fileCssMap: Map<string, string>;
179
46
  context: PandaContext | undefined;
180
47
  configChanged: boolean;
181
- updateFile(file: string, css: string): void;
48
+ writeFile(file: string, css: string): void;
182
49
  setup(): Promise<void>;
183
50
  ensure(): PandaContext;
184
51
  extract(): Promise<void>;
@@ -192,187 +59,17 @@ declare function loadConfigAndCreateContext(options?: {
192
59
  cwd?: string;
193
60
  config?: Config;
194
61
  configPath?: string;
195
- }): Promise<{
196
- theme: {
197
- breakpoints?: Record<string, string> | undefined;
198
- keyframes?: _pandacss_types.CssKeyframes | undefined;
199
- tokens?: _pandacss_types.Tokens | undefined;
200
- semanticTokens?: _pandacss_types.SemanticTokens<string> | undefined;
201
- textStyles?: _pandacss_types.TextStyles | undefined;
202
- layerStyles?: _pandacss_types.LayerStyles | undefined;
203
- recipes?: Record<string, _pandacss_types.RecipeConfig<_pandacss_types.RecipeVariantRecord>> | undefined;
204
- };
205
- config: _pandacss_types_dist_shared.UnwrapExtend<_pandacss_types.RequiredBy<Config, "include" | "outdir" | "cwd">>;
206
- configPath: string;
207
- cwd: string;
208
- conf: _pandacss_types.LoadConfigResult;
209
- chunks: {
210
- dir: string;
211
- readFile(file: string): Promise<string>;
212
- getFiles(): string[];
213
- format(file: string): string;
214
- write(file: string, css: string): Promise<void[]>;
215
- rm(file: string): Promise<void>;
216
- empty(): Promise<void>;
217
- glob: string[];
218
- };
219
- files: string[];
220
- helpers: {
221
- map: typeof _pandacss_shared.mapObject;
222
- };
223
- context: () => _pandacss_core.StylesheetContext;
224
- exclude: string[];
225
- conditions: _pandacss_core.Conditions;
226
- importMap: {
227
- css: string;
228
- recipe: string;
229
- pattern: string;
230
- jsx: string;
231
- };
232
- absPath: (str: string) => string;
233
- project: any;
234
- getPath: (pathLike?: string | undefined) => string;
235
- paths: {
236
- root: string;
237
- css: string;
238
- token: string;
239
- types: string;
240
- recipe: string;
241
- pattern: string;
242
- chunk: string;
243
- outCss: string;
244
- jsx: string;
245
- };
246
- write: (dir: string, options: {
247
- file: string;
248
- code: string | undefined;
249
- }[]) => Promise<void[]>;
250
- writeOutput: (output: Output) => Promise<void[]> | undefined;
251
- cleanOutdir: () => Promise<void>;
252
- getExt: (file: string) => string;
253
- getImport: (items: string, mod: string) => string;
254
- getExport: (mod: string) => string;
255
- cssVarRoot: string;
256
- tokens: _pandacss_token_dictionary.TokenDictionary;
257
- hasTokens: boolean;
258
- utility: _pandacss_core.Utility;
259
- getCss: (collector: {
260
- jsx: Set<{
261
- name?: string | undefined;
262
- data: Record<string, any>;
263
- type?: string | undefined;
264
- }>;
265
- css: Set<{
266
- name?: string | undefined;
267
- data: Record<string, any>;
268
- type?: string | undefined;
269
- }>;
270
- cva: Set<{
271
- name?: string | undefined;
272
- data: Record<string, any>;
273
- type?: string | undefined;
274
- }>;
275
- recipe: Map<string, Set<{
276
- name?: string | undefined;
277
- data: Record<string, any>;
278
- type?: string | undefined;
279
- }>>;
280
- pattern: Map<string, Set<{
281
- name?: string | undefined;
282
- data: Record<string, any>;
283
- type?: string | undefined;
284
- }>>;
285
- set(name: "css" | "cva", result: {
286
- data: Record<string, any>;
287
- }): void;
288
- setCva(result: {
289
- data: Record<string, any>;
290
- }): void;
291
- setPattern(name: string, result: {
292
- data: Record<string, any>;
293
- }): void;
294
- setRecipe(name: string, result: {
295
- data: Record<string, any>;
296
- }): void;
297
- isEmpty(): boolean;
298
- }, file: string) => {
299
- css: string;
300
- file: string;
301
- } | undefined;
302
- getGlobalCss: () => string;
303
- getStaticCss: () => string | undefined;
304
- patterns: Record<string, _pandacss_types.PatternConfig>;
305
- hasPatterns: boolean;
306
- getPattern: (name: string) => _pandacss_types.PatternConfig | undefined;
307
- execPattern: (name: string, data: Record<string, any>) => _pandacss_types.SystemStyleObject;
308
- patternNodes: {
309
- type: "pattern";
310
- name: string;
311
- props: string[];
312
- baseName: string;
313
- }[];
314
- getPatternFnName: (jsx: string) => string;
315
- getPatternDetails: (name: string, pattern: _pandacss_types.PatternConfig | undefined) => {
316
- name: string;
317
- props: string[];
318
- dashName: string;
319
- upperName: string;
320
- styleFn: string;
321
- jsxName: string;
322
- blocklistType: string;
323
- };
324
- recipes: Record<string, _pandacss_types.RecipeConfig<_pandacss_types.RecipeVariantRecord>>;
325
- getRecipe: (name: string) => _pandacss_types.RecipeConfig<_pandacss_types.RecipeVariantRecord> | undefined;
326
- hasRecipes: boolean;
327
- getRecipeDetails: () => {
328
- [x: string]: {
329
- [x: string]: string[];
330
- }[];
331
- }[];
332
- jsxFactory: string;
333
- jsxFactoryDetails: {
334
- name: string;
335
- upperName: string;
336
- typeName: string;
337
- componentName: string;
338
- framework: "solid" | "react" | "preact" | undefined;
339
- };
340
- properties: string[];
341
- extract: (fn: (file: string) => Promise<{
342
- css: string;
343
- file: string;
344
- } | undefined>) => Promise<({
345
- css: string;
346
- file: string;
347
- } | undefined)[]>;
348
- hash?: boolean | undefined;
349
- prefix?: string | undefined;
350
- separator?: "-" | "_" | "=" | undefined;
351
- static?: _pandacss_types.StaticCssOptions | undefined;
352
- minify?: boolean | undefined;
353
- utilities?: _pandacss_types.UtilityConfig | undefined;
354
- emitPackage?: boolean | undefined;
355
- gitignore?: boolean | undefined;
356
- studio?: Partial<_pandacss_types_dist_config.Studio> | undefined;
357
- logLevel?: "debug" | "info" | "warn" | "error" | "silent" | undefined;
358
- presets?: (string | _pandacss_types.Preset)[] | undefined;
359
- preflight?: boolean | undefined;
360
- clean?: boolean | undefined;
361
- watch?: boolean | undefined;
362
- poll?: boolean | undefined;
363
- globalCss?: _pandacss_types.GlobalStyleObject | undefined;
364
- jsxFramework?: "solid" | "react" | "preact" | undefined;
365
- strictTokens?: boolean | undefined;
366
- outExtension?: "mjs" | "js" | undefined;
367
- include: string[];
368
- outdir: string;
369
- }>;
62
+ }): Promise<PandaContext>;
370
63
 
371
64
  declare function execCommand(cmd: string, cwd: string): Promise<void>;
372
65
 
66
+ declare function emitArtifacts(ctx: PandaContext): Promise<string>;
67
+ declare function emitAndExtract(ctx: PandaContext): Promise<string>;
68
+ declare function extractCss(ctx: PandaContext): Promise<string>;
69
+
373
70
  declare function generate(config: Config, configPath?: string): Promise<void>;
374
71
 
375
- declare function setupGitIgnore(ctx: PandaContext): void;
72
+ declare function setupGitIgnore({ config: { outdir } }: PandaContext): void;
376
73
 
377
74
  declare function setupConfig(cwd: string, { force }: {
378
75
  force?: boolean;