@pandacss/node 0.0.2 → 0.3.0

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,13 +1,14 @@
1
1
  export { discardDuplicate } from '@pandacss/core';
2
2
  import * as _pandacss_types from '@pandacss/types';
3
- import { Artifact, LoadConfigResult, ParserResult, Config } from '@pandacss/types';
3
+ import { PandaHookable, Artifact, ConfigResultWithHooks, ParserResultType, Config } from '@pandacss/types';
4
4
  import { Generator } from '@pandacss/generator';
5
5
  import { Project } from '@pandacss/parser';
6
6
  import { Runtime } from '@pandacss/types/src/runtime';
7
7
  import { Root, Message } from 'postcss';
8
8
 
9
- declare const getChunkEngine: ({ paths, config, runtime: { path, fs } }: Generator & {
9
+ declare const getChunkEngine: ({ paths, config, runtime: { path, fs }, }: Generator & {
10
10
  runtime: Runtime;
11
+ hooks: PandaHookable;
11
12
  }) => {
12
13
  dir: string;
13
14
  readFile(file: string): string;
@@ -19,25 +20,28 @@ declare const getChunkEngine: ({ paths, config, runtime: { path, fs } }: Generat
19
20
  readonly glob: string[];
20
21
  };
21
22
 
22
- declare const getOutputEngine: ({ paths, runtime: { path, fs } }: Generator & {
23
+ declare const getOutputEngine: ({ paths, runtime: { path, fs }, }: Generator & {
23
24
  runtime: Runtime;
25
+ hooks: PandaHookable;
24
26
  }) => {
25
27
  empty(): void;
26
28
  write(output: Artifact | undefined): Promise<void[] | undefined>;
27
29
  };
28
30
 
29
- declare const createContext: (conf: LoadConfigResult) => PandaContext;
31
+ declare const createContext: (conf: ConfigResultWithHooks) => PandaContext;
30
32
  type PandaContext = Generator & {
31
33
  runtime: Runtime;
34
+ hooks: PandaHookable;
32
35
  project: Project;
33
36
  getFiles: () => string[];
34
37
  chunks: ReturnType<typeof getChunkEngine>;
35
38
  output: ReturnType<typeof getOutputEngine>;
36
39
  };
37
40
 
38
- declare function analyzeTokens(ctx: PandaContext, options?: {
39
- onResult?: (file: string, result: ParserResult) => void;
40
- }): {
41
+ type Options = {
42
+ onResult?: (file: string, result: ParserResultType) => void;
43
+ };
44
+ declare function analyzeTokens(ctx: PandaContext, options?: Options): {
41
45
  duration: {
42
46
  extractTimeByFiles: {
43
47
  [k: string]: number;
@@ -188,7 +192,9 @@ declare class Builder {
188
192
  writeFileCss(file: string, css: string): void;
189
193
  checkConfigDeps(configPath: string, deps: Set<string>): ConfigDepsResult;
190
194
  getConfigPath(): string;
191
- setup(): Promise<void>;
195
+ setup(options?: {
196
+ configPath?: string;
197
+ }): Promise<void>;
192
198
  setupContext(options: {
193
199
  configPath: string;
194
200
  depsModifiedMap: Map<string, number>;
@@ -204,6 +210,7 @@ declare class Builder {
204
210
  registerDependency(fn: (dep: Message) => void): void;
205
211
  }
206
212
 
213
+ declare function findConfig(): string | undefined;
207
214
  declare function loadConfigAndCreateContext(options?: {
208
215
  cwd?: string;
209
216
  config?: Config;
@@ -217,17 +224,25 @@ declare function debugFiles(ctx: PandaContext, options: {
217
224
 
218
225
  declare function execCommand(cmd: string, cwd: string): Promise<void>;
219
226
 
227
+ declare function extractFile(ctx: PandaContext, file: string): string | undefined;
220
228
  declare function emitArtifacts(ctx: PandaContext): Promise<string>;
221
229
  declare function emitAndExtract(ctx: PandaContext): Promise<string>;
222
230
  declare function extractCss(ctx: PandaContext): Promise<string>;
223
231
 
224
232
  declare function generate(config: Config, configPath?: string): Promise<void>;
225
233
 
226
- declare function setupGitIgnore({ config: { outdir, gitignore } }: PandaContext): void;
234
+ declare function parseDependency(fileOrGlob: string): Message | null;
235
+
236
+ declare function setupGitIgnore(ctx: PandaContext): void;
227
237
 
228
- declare function setupConfig(cwd: string, { force }: {
238
+ type SetupOptions = {
239
+ outExtension?: string;
240
+ jsxFramework?: string;
229
241
  force?: boolean;
230
- }): Promise<void>;
242
+ };
243
+ declare function setupConfig(cwd: string, opts?: SetupOptions): Promise<void>;
231
244
  declare function setupPostcss(cwd: string): Promise<void>;
232
245
 
233
- export { Builder, analyzeTokens, createContext, debugFiles, emitAndExtract, emitArtifacts, execCommand, extractCss, generate, loadConfigAndCreateContext, setupConfig, setupGitIgnore, setupPostcss, writeAnalyzeJSON };
246
+ declare function shipFiles(ctx: PandaContext, outfile: string): Promise<void>;
247
+
248
+ export { Builder, PandaContext, analyzeTokens, createContext, debugFiles, emitAndExtract, emitArtifacts, execCommand, extractCss, extractFile, findConfig, generate, loadConfigAndCreateContext, parseDependency, setupConfig, setupGitIgnore, setupPostcss, shipFiles, writeAnalyzeJSON };