@pandacss/node 0.0.0-dev-20230420174953 → 0.0.0-dev-20230421141155

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 (3) hide show
  1. package/dist/index.js +15 -11
  2. package/dist/index.mjs +15 -11
  3. package/package.json +13 -13
package/dist/index.js CHANGED
@@ -800,7 +800,8 @@ function gzipSizeSync(input, options) {
800
800
  function analyzeTokens(ctx, options = {}) {
801
801
  const parserResultByFilepath = /* @__PURE__ */ new Map();
802
802
  const extractTimeByFilepath = /* @__PURE__ */ new Map();
803
- ctx.getFiles().map((file) => {
803
+ const includedFiles = ctx.getFiles();
804
+ includedFiles.map((file) => {
804
805
  const start2 = performance.now();
805
806
  const result = ctx.project.parseSourceFile(file);
806
807
  const extractMs = performance.now() - start2;
@@ -813,13 +814,13 @@ function analyzeTokens(ctx, options = {}) {
813
814
  return [file, result];
814
815
  });
815
816
  const totalMs = Array.from(extractTimeByFilepath.values()).reduce((a, b) => a + b, 0);
816
- import_logger.logger.debug("analyze", `Analyzed ${ctx.getFiles().length} files in ${totalMs.toFixed(2)}ms`);
817
+ import_logger.logger.debug("analyze", `Analyzed ${includedFiles.length} files in ${totalMs.toFixed(2)}ms`);
817
818
  const minify = ctx.config.minify;
818
- const files = ctx.chunks.getFiles();
819
+ const chunkFiles = ctx.chunks.getFiles();
819
820
  ctx.config.minify = false;
820
- const css = ctx.getCss({ files });
821
+ const css = ctx.getCss({ files: chunkFiles });
821
822
  ctx.config.minify = true;
822
- const minifiedCss = ctx.getCss({ files });
823
+ const minifiedCss = ctx.getCss({ files: chunkFiles });
823
824
  ctx.config.minify = minify;
824
825
  const start = performance.now();
825
826
  const analysis = classifyTokens(ctx, parserResultByFilepath);
@@ -2574,16 +2575,17 @@ var import_logger5 = require("@pandacss/logger");
2574
2575
  var import_promises2 = require("fs/promises");
2575
2576
  var path = __toESM(require("path"));
2576
2577
  async function debugFiles(ctx, options) {
2577
- const parserResultByFilepath = /* @__PURE__ */ new Map();
2578
- const measureTotal = import_logger5.logger.time.debug(`Analyzed ${ctx.getFiles().length} files`);
2578
+ const files = ctx.getFiles();
2579
+ const measureTotal = import_logger5.logger.time.debug(`Done parsing ${files.length} files`);
2579
2580
  ctx.config.minify = false;
2580
- await ctx.getFiles().map(async (file) => {
2581
+ await (0, import_promises2.mkdir)(options.outdir, { recursive: true });
2582
+ const filesWithCss = [];
2583
+ await files.map(async (file) => {
2581
2584
  const measure = import_logger5.logger.time.debug(`Parsed ${file}`);
2582
2585
  const result = ctx.project.parseSourceFile(file);
2583
2586
  measure();
2584
2587
  if (!result)
2585
2588
  return;
2586
- parserResultByFilepath.set(file, result);
2587
2589
  const list = result.getAll().map((result2) => {
2588
2590
  const node = result2.box.getNode();
2589
2591
  const range = getNodeRange(node);
@@ -2602,19 +2604,21 @@ async function debugFiles(ctx, options) {
2602
2604
  if (options.dry) {
2603
2605
  console.log({ path: file, ast: list, code: css });
2604
2606
  return Promise.resolve();
2605
- } else if (options.outdir) {
2607
+ }
2608
+ if (options.outdir) {
2609
+ filesWithCss.push(file);
2606
2610
  const parsedPath = path.parse(file);
2607
2611
  const relative3 = path.relative(ctx.config.cwd, parsedPath.dir);
2608
2612
  const astJsonPath = `${relative3}/${parsedPath.name}.ast.json`.replaceAll(path.sep, "__");
2609
2613
  const cssPath = `${relative3}/${parsedPath.name}.css`.replaceAll(path.sep, "__");
2610
2614
  import_logger5.logger.info("cli", `Writing ${import_logger5.colors.bold(`${options.outdir}/${astJsonPath}`)}`);
2611
- await (0, import_promises2.mkdir)(options.outdir, { recursive: true });
2612
2615
  return Promise.all([
2613
2616
  (0, import_promises2.writeFile)(`${options.outdir}/${astJsonPath}`, JSON.stringify(list, debugResultSerializer, 2)),
2614
2617
  (0, import_promises2.writeFile)(`${options.outdir}/${cssPath}`, css)
2615
2618
  ]);
2616
2619
  }
2617
2620
  });
2621
+ import_logger5.logger.info("cli", `Found ${import_logger5.colors.bold(`${filesWithCss.length}/${files.length}`)} files using Panda`);
2618
2622
  measureTotal();
2619
2623
  }
2620
2624
  var debugResultSerializer = (_key, value) => {
package/dist/index.mjs CHANGED
@@ -780,7 +780,8 @@ function gzipSizeSync(input, options) {
780
780
  function analyzeTokens(ctx, options = {}) {
781
781
  const parserResultByFilepath = /* @__PURE__ */ new Map();
782
782
  const extractTimeByFilepath = /* @__PURE__ */ new Map();
783
- ctx.getFiles().map((file) => {
783
+ const includedFiles = ctx.getFiles();
784
+ includedFiles.map((file) => {
784
785
  const start2 = performance.now();
785
786
  const result = ctx.project.parseSourceFile(file);
786
787
  const extractMs = performance.now() - start2;
@@ -793,13 +794,13 @@ function analyzeTokens(ctx, options = {}) {
793
794
  return [file, result];
794
795
  });
795
796
  const totalMs = Array.from(extractTimeByFilepath.values()).reduce((a, b) => a + b, 0);
796
- logger.debug("analyze", `Analyzed ${ctx.getFiles().length} files in ${totalMs.toFixed(2)}ms`);
797
+ logger.debug("analyze", `Analyzed ${includedFiles.length} files in ${totalMs.toFixed(2)}ms`);
797
798
  const minify = ctx.config.minify;
798
- const files = ctx.chunks.getFiles();
799
+ const chunkFiles = ctx.chunks.getFiles();
799
800
  ctx.config.minify = false;
800
- const css = ctx.getCss({ files });
801
+ const css = ctx.getCss({ files: chunkFiles });
801
802
  ctx.config.minify = true;
802
- const minifiedCss = ctx.getCss({ files });
803
+ const minifiedCss = ctx.getCss({ files: chunkFiles });
803
804
  ctx.config.minify = minify;
804
805
  const start = performance.now();
805
806
  const analysis = classifyTokens(ctx, parserResultByFilepath);
@@ -2563,16 +2564,17 @@ import { colors, logger as logger5 } from "@pandacss/logger";
2563
2564
  import { mkdir, writeFile as writeFile3 } from "fs/promises";
2564
2565
  import * as path from "path";
2565
2566
  async function debugFiles(ctx, options) {
2566
- const parserResultByFilepath = /* @__PURE__ */ new Map();
2567
- const measureTotal = logger5.time.debug(`Analyzed ${ctx.getFiles().length} files`);
2567
+ const files = ctx.getFiles();
2568
+ const measureTotal = logger5.time.debug(`Done parsing ${files.length} files`);
2568
2569
  ctx.config.minify = false;
2569
- await ctx.getFiles().map(async (file) => {
2570
+ await mkdir(options.outdir, { recursive: true });
2571
+ const filesWithCss = [];
2572
+ await files.map(async (file) => {
2570
2573
  const measure = logger5.time.debug(`Parsed ${file}`);
2571
2574
  const result = ctx.project.parseSourceFile(file);
2572
2575
  measure();
2573
2576
  if (!result)
2574
2577
  return;
2575
- parserResultByFilepath.set(file, result);
2576
2578
  const list = result.getAll().map((result2) => {
2577
2579
  const node = result2.box.getNode();
2578
2580
  const range = getNodeRange(node);
@@ -2591,19 +2593,21 @@ async function debugFiles(ctx, options) {
2591
2593
  if (options.dry) {
2592
2594
  console.log({ path: file, ast: list, code: css });
2593
2595
  return Promise.resolve();
2594
- } else if (options.outdir) {
2596
+ }
2597
+ if (options.outdir) {
2598
+ filesWithCss.push(file);
2595
2599
  const parsedPath = path.parse(file);
2596
2600
  const relative3 = path.relative(ctx.config.cwd, parsedPath.dir);
2597
2601
  const astJsonPath = `${relative3}/${parsedPath.name}.ast.json`.replaceAll(path.sep, "__");
2598
2602
  const cssPath = `${relative3}/${parsedPath.name}.css`.replaceAll(path.sep, "__");
2599
2603
  logger5.info("cli", `Writing ${colors.bold(`${options.outdir}/${astJsonPath}`)}`);
2600
- await mkdir(options.outdir, { recursive: true });
2601
2604
  return Promise.all([
2602
2605
  writeFile3(`${options.outdir}/${astJsonPath}`, JSON.stringify(list, debugResultSerializer, 2)),
2603
2606
  writeFile3(`${options.outdir}/${cssPath}`, css)
2604
2607
  ]);
2605
2608
  }
2606
2609
  });
2610
+ logger5.info("cli", `Found ${colors.bold(`${filesWithCss.length}/${files.length}`)} files using Panda`);
2607
2611
  measureTotal();
2608
2612
  }
2609
2613
  var debugResultSerializer = (_key, value) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pandacss/node",
3
- "version": "0.0.0-dev-20230420174953",
3
+ "version": "0.0.0-dev-20230421141155",
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.2.2",
36
- "@pandacss/config": "0.0.0-dev-20230420174953",
37
- "@pandacss/core": "0.0.0-dev-20230420174953",
38
- "@pandacss/error": "0.0.0-dev-20230420174953",
39
- "@pandacss/generator": "0.0.0-dev-20230420174953",
40
- "@pandacss/is-valid-prop": "0.0.0-dev-20230420174953",
41
- "@pandacss/logger": "0.0.0-dev-20230420174953",
42
- "@pandacss/parser": "0.0.0-dev-20230420174953",
43
- "@pandacss/extractor": "0.0.0-dev-20230420174953",
44
- "@pandacss/shared": "0.0.0-dev-20230420174953",
45
- "@pandacss/token-dictionary": "0.0.0-dev-20230420174953",
46
- "@pandacss/types": "0.0.0-dev-20230420174953"
36
+ "@pandacss/config": "0.0.0-dev-20230421141155",
37
+ "@pandacss/core": "0.0.0-dev-20230421141155",
38
+ "@pandacss/error": "0.0.0-dev-20230421141155",
39
+ "@pandacss/generator": "0.0.0-dev-20230421141155",
40
+ "@pandacss/is-valid-prop": "0.0.0-dev-20230421141155",
41
+ "@pandacss/logger": "0.0.0-dev-20230421141155",
42
+ "@pandacss/parser": "0.0.0-dev-20230421141155",
43
+ "@pandacss/extractor": "0.0.0-dev-20230421141155",
44
+ "@pandacss/shared": "0.0.0-dev-20230421141155",
45
+ "@pandacss/token-dictionary": "0.0.0-dev-20230421141155",
46
+ "@pandacss/types": "0.0.0-dev-20230421141155"
47
47
  },
48
48
  "devDependencies": {
49
49
  "@types/fs-extra": "11.0.1",
@@ -53,7 +53,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-20230420174953"
56
+ "@pandacss/fixture": "0.0.0-dev-20230421141155"
57
57
  },
58
58
  "scripts": {
59
59
  "build": "tsup src/index.ts --format=cjs,esm --shims --dts",