@pandacss/node 0.0.0-dev-20230626124525 → 0.0.0-dev-20230626180512

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.mts CHANGED
@@ -225,16 +225,29 @@ declare function debugFiles(ctx: PandaContext, options: {
225
225
  declare function execCommand(cmd: string, cwd: string): Promise<void>;
226
226
 
227
227
  declare function extractFile(ctx: PandaContext, file: string): string | undefined;
228
- declare function emitArtifacts(ctx: PandaContext): Promise<string>;
229
- declare function emitAndExtract(ctx: PandaContext): Promise<string>;
230
- declare function extractCss(ctx: PandaContext): Promise<string>;
228
+ declare function emitArtifacts(ctx: PandaContext): Promise<{
229
+ box: string;
230
+ msg: string;
231
+ }>;
232
+ declare function emitAndExtract(ctx: PandaContext): Promise<{
233
+ files: string[];
234
+ msg: string;
235
+ }>;
236
+ declare function extractCss(ctx: PandaContext): Promise<{
237
+ files: string[];
238
+ msg: string;
239
+ }>;
240
+ declare function bundleCss(ctx: PandaContext, outfile: string): Promise<{
241
+ files: string[];
242
+ msg: string;
243
+ }>;
231
244
 
232
245
  declare function generate(config: Config, configPath?: string): Promise<void>;
233
246
 
234
- declare function parseDependency(fileOrGlob: string): Message | null;
235
-
236
247
  declare function setupGitIgnore(ctx: PandaContext): void;
237
248
 
249
+ declare function parseDependency(fileOrGlob: string): Message | null;
250
+
238
251
  type SetupOptions = Partial<Config> & {
239
252
  force?: boolean;
240
253
  };
@@ -243,4 +256,4 @@ declare function setupPostcss(cwd: string): Promise<void>;
243
256
 
244
257
  declare function shipFiles(ctx: PandaContext, outfile: string): Promise<void>;
245
258
 
246
- export { Builder, PandaContext, analyzeTokens, createContext, debugFiles, emitAndExtract, emitArtifacts, execCommand, extractCss, extractFile, findConfig, generate, loadConfigAndCreateContext, parseDependency, setupConfig, setupGitIgnore, setupPostcss, shipFiles, writeAnalyzeJSON };
259
+ export { Builder, PandaContext, analyzeTokens, bundleCss, createContext, debugFiles, emitAndExtract, emitArtifacts, execCommand, extractCss, extractFile, findConfig, generate, loadConfigAndCreateContext, parseDependency, setupConfig, setupGitIgnore, setupPostcss, shipFiles, writeAnalyzeJSON };
package/dist/index.d.ts CHANGED
@@ -225,16 +225,29 @@ declare function debugFiles(ctx: PandaContext, options: {
225
225
  declare function execCommand(cmd: string, cwd: string): Promise<void>;
226
226
 
227
227
  declare function extractFile(ctx: PandaContext, file: string): string | undefined;
228
- declare function emitArtifacts(ctx: PandaContext): Promise<string>;
229
- declare function emitAndExtract(ctx: PandaContext): Promise<string>;
230
- declare function extractCss(ctx: PandaContext): Promise<string>;
228
+ declare function emitArtifacts(ctx: PandaContext): Promise<{
229
+ box: string;
230
+ msg: string;
231
+ }>;
232
+ declare function emitAndExtract(ctx: PandaContext): Promise<{
233
+ files: string[];
234
+ msg: string;
235
+ }>;
236
+ declare function extractCss(ctx: PandaContext): Promise<{
237
+ files: string[];
238
+ msg: string;
239
+ }>;
240
+ declare function bundleCss(ctx: PandaContext, outfile: string): Promise<{
241
+ files: string[];
242
+ msg: string;
243
+ }>;
231
244
 
232
245
  declare function generate(config: Config, configPath?: string): Promise<void>;
233
246
 
234
- declare function parseDependency(fileOrGlob: string): Message | null;
235
-
236
247
  declare function setupGitIgnore(ctx: PandaContext): void;
237
248
 
249
+ declare function parseDependency(fileOrGlob: string): Message | null;
250
+
238
251
  type SetupOptions = Partial<Config> & {
239
252
  force?: boolean;
240
253
  };
@@ -243,4 +256,4 @@ declare function setupPostcss(cwd: string): Promise<void>;
243
256
 
244
257
  declare function shipFiles(ctx: PandaContext, outfile: string): Promise<void>;
245
258
 
246
- export { Builder, PandaContext, analyzeTokens, createContext, debugFiles, emitAndExtract, emitArtifacts, execCommand, extractCss, extractFile, findConfig, generate, loadConfigAndCreateContext, parseDependency, setupConfig, setupGitIgnore, setupPostcss, shipFiles, writeAnalyzeJSON };
259
+ export { Builder, PandaContext, analyzeTokens, bundleCss, createContext, debugFiles, emitAndExtract, emitArtifacts, execCommand, extractCss, extractFile, findConfig, generate, loadConfigAndCreateContext, parseDependency, setupConfig, setupGitIgnore, setupPostcss, shipFiles, writeAnalyzeJSON };
package/dist/index.js CHANGED
@@ -405,6 +405,7 @@ var src_exports = {};
405
405
  __export(src_exports, {
406
406
  Builder: () => Builder,
407
407
  analyzeTokens: () => analyzeTokens,
408
+ bundleCss: () => bundleCss,
408
409
  createContext: () => createContext,
409
410
  debugFiles: () => debugFiles,
410
411
  discardDuplicate: () => import_core3.discardDuplicate,
@@ -2295,12 +2296,14 @@ var createBox = (options) => boxen(options.content, {
2295
2296
  });
2296
2297
 
2297
2298
  // src/extract.ts
2299
+ var import_promises2 = require("fs/promises");
2298
2300
  async function bundleChunks(ctx) {
2299
2301
  const files = ctx.chunks.getFiles();
2300
- return ctx.output.write({
2302
+ await ctx.output.write({
2301
2303
  dir: ctx.paths.root,
2302
2304
  files: [{ file: "styles.css", code: ctx.getCss({ files }) }]
2303
2305
  });
2306
+ return { files, msg: ctx.messages.buildComplete(files.length) };
2304
2307
  }
2305
2308
  async function writeFileChunk(ctx, file) {
2306
2309
  const { path: path2 } = ctx.runtime;
@@ -2342,21 +2345,29 @@ async function emitArtifacts(ctx) {
2342
2345
  if (ctx.config.clean)
2343
2346
  ctx.output.empty();
2344
2347
  await Promise.all(ctx.getArtifacts().map(ctx.output.write));
2345
- return ctx.messages.artifactsGenerated() + createBox({
2346
- content: ctx.messages.codegenComplete(),
2347
- title: `\u{1F43C} ${pickRandom(randomWords)}! \u2728`
2348
- });
2348
+ return {
2349
+ box: createBox({
2350
+ content: ctx.messages.codegenComplete(),
2351
+ title: `\u{1F43C} ${pickRandom(randomWords)}! \u2728`
2352
+ }),
2353
+ msg: ctx.messages.artifactsGenerated()
2354
+ };
2349
2355
  }
2350
2356
  async function emitAndExtract(ctx) {
2351
2357
  await emitArtifacts(ctx);
2352
- if (ctx.config.emitTokensOnly)
2353
- return "Successfully rebuilt the css variables and js function to query your tokens \u2728";
2358
+ if (ctx.config.emitTokensOnly) {
2359
+ return { files: [], msg: "Successfully rebuilt the css variables and js function to query your tokens \u2728" };
2360
+ }
2354
2361
  return extractCss(ctx);
2355
2362
  }
2356
2363
  async function extractCss(ctx) {
2357
2364
  await extractFiles(ctx);
2358
- await bundleChunks(ctx);
2359
- return ctx.messages.buildComplete(ctx.getFiles().length);
2365
+ return bundleChunks(ctx);
2366
+ }
2367
+ async function bundleCss(ctx, outfile) {
2368
+ const files = ctx.chunks.getFiles();
2369
+ await (0, import_promises2.writeFile)(outfile, ctx.getCss({ files, resolve: true }));
2370
+ return { files, msg: ctx.messages.buildComplete(files.length) };
2360
2371
  }
2361
2372
 
2362
2373
  // src/parse-dependency.ts
@@ -2658,7 +2669,7 @@ var loadContext = async (config, configPath) => {
2658
2669
 
2659
2670
  // src/generate.ts
2660
2671
  async function build(ctx) {
2661
- const msg = await emitAndExtract(ctx);
2672
+ const { msg } = await emitAndExtract(ctx);
2662
2673
  import_logger7.logger.info("css:emit", msg);
2663
2674
  }
2664
2675
  async function generate(config, configPath) {
@@ -2794,7 +2805,7 @@ module.exports = {
2794
2805
  init_cjs_shims();
2795
2806
  var import_logger9 = require("@pandacss/logger");
2796
2807
  var import_parser2 = require("@pandacss/parser");
2797
- var import_promises2 = require("fs/promises");
2808
+ var import_promises3 = require("fs/promises");
2798
2809
  var path = __toESM(require("path"));
2799
2810
  async function shipFiles(ctx, outfile) {
2800
2811
  const files = ctx.getFiles();
@@ -2814,13 +2825,14 @@ async function shipFiles(ctx, outfile) {
2814
2825
  const minify = ctx.config.minify;
2815
2826
  import_logger9.logger.info("cli", `Writing ${minify ? "[min] " : " "}${import_logger9.colors.bold(outfile)}`);
2816
2827
  const output = JSON.stringify(extractResult.toJSON(), null, minify ? 0 : 2);
2817
- await (0, import_promises2.writeFile)(outfile, output);
2828
+ await (0, import_promises3.writeFile)(outfile, output);
2818
2829
  import_logger9.logger.info("cli", "Done!");
2819
2830
  }
2820
2831
  // Annotate the CommonJS export names for ESM import in node:
2821
2832
  0 && (module.exports = {
2822
2833
  Builder,
2823
2834
  analyzeTokens,
2835
+ bundleCss,
2824
2836
  createContext,
2825
2837
  debugFiles,
2826
2838
  discardDuplicate,
package/dist/index.mjs CHANGED
@@ -2282,12 +2282,14 @@ var createBox = (options) => boxen(options.content, {
2282
2282
  });
2283
2283
 
2284
2284
  // src/extract.ts
2285
+ import { writeFile as writeFile3 } from "fs/promises";
2285
2286
  async function bundleChunks(ctx) {
2286
2287
  const files = ctx.chunks.getFiles();
2287
- return ctx.output.write({
2288
+ await ctx.output.write({
2288
2289
  dir: ctx.paths.root,
2289
2290
  files: [{ file: "styles.css", code: ctx.getCss({ files }) }]
2290
2291
  });
2292
+ return { files, msg: ctx.messages.buildComplete(files.length) };
2291
2293
  }
2292
2294
  async function writeFileChunk(ctx, file) {
2293
2295
  const { path: path2 } = ctx.runtime;
@@ -2329,21 +2331,29 @@ async function emitArtifacts(ctx) {
2329
2331
  if (ctx.config.clean)
2330
2332
  ctx.output.empty();
2331
2333
  await Promise.all(ctx.getArtifacts().map(ctx.output.write));
2332
- return ctx.messages.artifactsGenerated() + createBox({
2333
- content: ctx.messages.codegenComplete(),
2334
- title: `\u{1F43C} ${pickRandom(randomWords)}! \u2728`
2335
- });
2334
+ return {
2335
+ box: createBox({
2336
+ content: ctx.messages.codegenComplete(),
2337
+ title: `\u{1F43C} ${pickRandom(randomWords)}! \u2728`
2338
+ }),
2339
+ msg: ctx.messages.artifactsGenerated()
2340
+ };
2336
2341
  }
2337
2342
  async function emitAndExtract(ctx) {
2338
2343
  await emitArtifacts(ctx);
2339
- if (ctx.config.emitTokensOnly)
2340
- return "Successfully rebuilt the css variables and js function to query your tokens \u2728";
2344
+ if (ctx.config.emitTokensOnly) {
2345
+ return { files: [], msg: "Successfully rebuilt the css variables and js function to query your tokens \u2728" };
2346
+ }
2341
2347
  return extractCss(ctx);
2342
2348
  }
2343
2349
  async function extractCss(ctx) {
2344
2350
  await extractFiles(ctx);
2345
- await bundleChunks(ctx);
2346
- return ctx.messages.buildComplete(ctx.getFiles().length);
2351
+ return bundleChunks(ctx);
2352
+ }
2353
+ async function bundleCss(ctx, outfile) {
2354
+ const files = ctx.chunks.getFiles();
2355
+ await writeFile3(outfile, ctx.getCss({ files, resolve: true }));
2356
+ return { files, msg: ctx.messages.buildComplete(files.length) };
2347
2357
  }
2348
2358
 
2349
2359
  // src/parse-dependency.ts
@@ -2645,7 +2655,7 @@ var loadContext = async (config, configPath) => {
2645
2655
 
2646
2656
  // src/generate.ts
2647
2657
  async function build(ctx) {
2648
- const msg = await emitAndExtract(ctx);
2658
+ const { msg } = await emitAndExtract(ctx);
2649
2659
  logger7.info("css:emit", msg);
2650
2660
  }
2651
2661
  async function generate(config, configPath) {
@@ -2714,7 +2724,7 @@ function setupGitIgnore(ctx) {
2714
2724
  init_esm_shims();
2715
2725
  import { messages } from "@pandacss/generator";
2716
2726
  import { logger as logger8, quote } from "@pandacss/logger";
2717
- import { writeFile as writeFile3 } from "fs-extra";
2727
+ import { writeFile as writeFile4 } from "fs-extra";
2718
2728
  import { lookItUpSync as lookItUpSync3 } from "look-it-up";
2719
2729
  import { outdent as outdent2 } from "outdent";
2720
2730
  import { join as join2 } from "path";
@@ -2761,7 +2771,7 @@ jsxFramework: '${jsxFramework}'` : ""}
2761
2771
  syntax: '${syntax}'` : ""}
2762
2772
  })
2763
2773
  `;
2764
- await writeFile3(join2(cwd, file), content);
2774
+ await writeFile4(join2(cwd, file), content);
2765
2775
  logger8.log(messages.thankYou());
2766
2776
  }
2767
2777
  }
@@ -2774,14 +2784,14 @@ module.exports = {
2774
2784
  },
2775
2785
  }
2776
2786
  `;
2777
- await writeFile3(join2(cwd, "postcss.config.cjs"), content);
2787
+ await writeFile4(join2(cwd, "postcss.config.cjs"), content);
2778
2788
  }
2779
2789
 
2780
2790
  // src/ship-files.ts
2781
2791
  init_esm_shims();
2782
2792
  import { colors as colors2, logger as logger9 } from "@pandacss/logger";
2783
2793
  import { createParserResult } from "@pandacss/parser";
2784
- import { writeFile as writeFile4 } from "fs/promises";
2794
+ import { writeFile as writeFile5 } from "fs/promises";
2785
2795
  import * as path from "path";
2786
2796
  async function shipFiles(ctx, outfile) {
2787
2797
  const files = ctx.getFiles();
@@ -2801,12 +2811,13 @@ async function shipFiles(ctx, outfile) {
2801
2811
  const minify = ctx.config.minify;
2802
2812
  logger9.info("cli", `Writing ${minify ? "[min] " : " "}${colors2.bold(outfile)}`);
2803
2813
  const output = JSON.stringify(extractResult.toJSON(), null, minify ? 0 : 2);
2804
- await writeFile4(outfile, output);
2814
+ await writeFile5(outfile, output);
2805
2815
  logger9.info("cli", "Done!");
2806
2816
  }
2807
2817
  export {
2808
2818
  Builder,
2809
2819
  analyzeTokens,
2820
+ bundleCss,
2810
2821
  createContext,
2811
2822
  debugFiles,
2812
2823
  discardDuplicate2 as discardDuplicate,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pandacss/node",
3
- "version": "0.0.0-dev-20230626124525",
3
+ "version": "0.0.0-dev-20230626180512",
4
4
  "description": "The core css panda library",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
@@ -33,17 +33,17 @@
33
33
  "preferred-pm": "^3.0.3",
34
34
  "ts-morph": "18.0.0",
35
35
  "ts-pattern": "4.3.0",
36
- "@pandacss/config": "0.0.0-dev-20230626124525",
37
- "@pandacss/core": "0.0.0-dev-20230626124525",
38
- "@pandacss/error": "0.0.0-dev-20230626124525",
39
- "@pandacss/extractor": "0.0.0-dev-20230626124525",
40
- "@pandacss/generator": "0.0.0-dev-20230626124525",
41
- "@pandacss/is-valid-prop": "0.0.0-dev-20230626124525",
42
- "@pandacss/logger": "0.0.0-dev-20230626124525",
43
- "@pandacss/parser": "0.0.0-dev-20230626124525",
44
- "@pandacss/shared": "0.0.0-dev-20230626124525",
45
- "@pandacss/token-dictionary": "0.0.0-dev-20230626124525",
46
- "@pandacss/types": "0.0.0-dev-20230626124525"
36
+ "@pandacss/config": "0.0.0-dev-20230626180512",
37
+ "@pandacss/core": "0.0.0-dev-20230626180512",
38
+ "@pandacss/error": "0.0.0-dev-20230626180512",
39
+ "@pandacss/extractor": "0.0.0-dev-20230626180512",
40
+ "@pandacss/generator": "0.0.0-dev-20230626180512",
41
+ "@pandacss/is-valid-prop": "0.0.0-dev-20230626180512",
42
+ "@pandacss/logger": "0.0.0-dev-20230626180512",
43
+ "@pandacss/parser": "0.0.0-dev-20230626180512",
44
+ "@pandacss/shared": "0.0.0-dev-20230626180512",
45
+ "@pandacss/token-dictionary": "0.0.0-dev-20230626180512",
46
+ "@pandacss/types": "0.0.0-dev-20230626180512"
47
47
  },
48
48
  "devDependencies": {
49
49
  "@types/fs-extra": "11.0.1",
@@ -52,7 +52,7 @@
52
52
  "@types/lodash.merge": "4.6.7",
53
53
  "@types/pluralize": "0.0.29",
54
54
  "boxen": "^7.1.0",
55
- "@pandacss/fixture": "0.0.0-dev-20230626124525"
55
+ "@pandacss/fixture": "0.0.0-dev-20230626180512"
56
56
  },
57
57
  "scripts": {
58
58
  "build": "tsup src/index.ts --format=cjs,esm --shims --dts",