@pandacss/node 0.0.0-dev-20231023175607 → 0.0.0-dev-20231023195038

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 +117 -6
  2. package/dist/index.mjs +117 -6
  3. package/package.json +14 -13
package/dist/index.js CHANGED
@@ -787,6 +787,113 @@ var import_fs = require("fs");
787
787
  var import_fs_extra2 = require("fs-extra");
788
788
  var import_path2 = require("path");
789
789
 
790
+ // ../../node_modules/.pnpm/p-limit@4.0.0/node_modules/p-limit/index.js
791
+ init_cjs_shims();
792
+
793
+ // ../../node_modules/.pnpm/yocto-queue@1.0.0/node_modules/yocto-queue/index.js
794
+ init_cjs_shims();
795
+ var Node = class {
796
+ value;
797
+ next;
798
+ constructor(value) {
799
+ this.value = value;
800
+ }
801
+ };
802
+ var Queue = class {
803
+ #head;
804
+ #tail;
805
+ #size;
806
+ constructor() {
807
+ this.clear();
808
+ }
809
+ enqueue(value) {
810
+ const node = new Node(value);
811
+ if (this.#head) {
812
+ this.#tail.next = node;
813
+ this.#tail = node;
814
+ } else {
815
+ this.#head = node;
816
+ this.#tail = node;
817
+ }
818
+ this.#size++;
819
+ }
820
+ dequeue() {
821
+ const current = this.#head;
822
+ if (!current) {
823
+ return;
824
+ }
825
+ this.#head = this.#head.next;
826
+ this.#size--;
827
+ return current.value;
828
+ }
829
+ clear() {
830
+ this.#head = void 0;
831
+ this.#tail = void 0;
832
+ this.#size = 0;
833
+ }
834
+ get size() {
835
+ return this.#size;
836
+ }
837
+ *[Symbol.iterator]() {
838
+ let current = this.#head;
839
+ while (current) {
840
+ yield current.value;
841
+ current = current.next;
842
+ }
843
+ }
844
+ };
845
+
846
+ // ../../node_modules/.pnpm/p-limit@4.0.0/node_modules/p-limit/index.js
847
+ function pLimit(concurrency) {
848
+ if (!((Number.isInteger(concurrency) || concurrency === Number.POSITIVE_INFINITY) && concurrency > 0)) {
849
+ throw new TypeError("Expected `concurrency` to be a number from 1 and up");
850
+ }
851
+ const queue = new Queue();
852
+ let activeCount = 0;
853
+ const next = () => {
854
+ activeCount--;
855
+ if (queue.size > 0) {
856
+ queue.dequeue()();
857
+ }
858
+ };
859
+ const run = async (fn, resolve3, args) => {
860
+ activeCount++;
861
+ const result = (async () => fn(...args))();
862
+ resolve3(result);
863
+ try {
864
+ await result;
865
+ } catch {
866
+ }
867
+ next();
868
+ };
869
+ const enqueue = (fn, resolve3, args) => {
870
+ queue.enqueue(run.bind(void 0, fn, resolve3, args));
871
+ (async () => {
872
+ await Promise.resolve();
873
+ if (activeCount < concurrency && queue.size > 0) {
874
+ queue.dequeue()();
875
+ }
876
+ })();
877
+ };
878
+ const generator = (fn, ...args) => new Promise((resolve3) => {
879
+ enqueue(fn, resolve3, args);
880
+ });
881
+ Object.defineProperties(generator, {
882
+ activeCount: {
883
+ get: () => activeCount
884
+ },
885
+ pendingCount: {
886
+ get: () => queue.size
887
+ },
888
+ clearQueue: {
889
+ value: () => {
890
+ queue.clear();
891
+ }
892
+ }
893
+ });
894
+ return generator;
895
+ }
896
+
790
897
  // src/config.ts
791
898
  init_cjs_shims();
792
899
  var import_config = require("@pandacss/config");
@@ -1012,8 +1119,12 @@ async function loadConfigAndCreateContext(options = {}) {
1012
1119
 
1013
1120
  // src/extract.ts
1014
1121
  init_cjs_shims();
1122
+ var import_core2 = require("@pandacss/core");
1015
1123
  var import_logger4 = require("@pandacss/logger");
1124
+ var import_parser2 = require("@pandacss/parser");
1125
+ var import_promises2 = require("fs/promises");
1016
1126
  var import_lil_fp = require("lil-fp");
1127
+ var import_ts_pattern = require("ts-pattern");
1017
1128
 
1018
1129
  // src/cli-box.ts
1019
1130
  init_cjs_shims();
@@ -2328,10 +2439,6 @@ var createBox = (options) => boxen(options.content, {
2328
2439
  });
2329
2440
 
2330
2441
  // src/extract.ts
2331
- var import_promises2 = require("fs/promises");
2332
- var import_parser2 = require("@pandacss/parser");
2333
- var import_ts_pattern = require("ts-pattern");
2334
- var import_core2 = require("@pandacss/core");
2335
2442
  async function bundleStyleChunksWithImports(ctx) {
2336
2443
  const files = ctx.chunks.getFiles();
2337
2444
  await ctx.output.write({
@@ -2376,10 +2483,12 @@ function writeChunks(ctx) {
2376
2483
  }
2377
2484
  var randomWords = ["Sweet", "Divine", "Pandalicious", "Super"];
2378
2485
  var pickRandom = (arr) => arr[Math.floor(Math.random() * arr.length)];
2486
+ var limit = pLimit(20);
2379
2487
  async function emitArtifacts(ctx) {
2380
2488
  if (ctx.config.clean)
2381
2489
  ctx.output.empty();
2382
- await Promise.allSettled(ctx.getArtifacts().map(ctx.output.write));
2490
+ const promises = ctx.getArtifacts().map((artifact) => limit(() => ctx.output.write(artifact)));
2491
+ await Promise.allSettled(promises);
2383
2492
  void ctx.hooks.callHook("generator:done");
2384
2493
  return {
2385
2494
  box: createBox({
@@ -2488,6 +2597,7 @@ function parseDependency(fileOrGlob) {
2488
2597
  // src/builder.ts
2489
2598
  var configCache = /* @__PURE__ */ new Map();
2490
2599
  var contentFilesCache = /* @__PURE__ */ new WeakMap();
2600
+ var limit2 = pLimit(20);
2491
2601
  var setupCount = 0;
2492
2602
  var Builder = class {
2493
2603
  /**
@@ -2607,7 +2717,8 @@ var Builder = class {
2607
2717
  extract = async () => {
2608
2718
  const ctx = this.getContextOrThrow();
2609
2719
  const done = import_logger5.logger.time.info("Extracted in");
2610
- await Promise.allSettled(ctx.getFiles().map((file) => this.extractFile(ctx, file)));
2720
+ const promises = ctx.getFiles().map((file) => limit2(() => this.extractFile(ctx, file)));
2721
+ await Promise.allSettled(promises);
2611
2722
  done();
2612
2723
  };
2613
2724
  toString = () => {
package/dist/index.mjs CHANGED
@@ -763,6 +763,113 @@ import { existsSync as existsSync2 } from "fs";
763
763
  import { statSync } from "fs-extra";
764
764
  import { resolve as resolve2 } from "path";
765
765
 
766
+ // ../../node_modules/.pnpm/p-limit@4.0.0/node_modules/p-limit/index.js
767
+ init_esm_shims();
768
+
769
+ // ../../node_modules/.pnpm/yocto-queue@1.0.0/node_modules/yocto-queue/index.js
770
+ init_esm_shims();
771
+ var Node = class {
772
+ value;
773
+ next;
774
+ constructor(value) {
775
+ this.value = value;
776
+ }
777
+ };
778
+ var Queue = class {
779
+ #head;
780
+ #tail;
781
+ #size;
782
+ constructor() {
783
+ this.clear();
784
+ }
785
+ enqueue(value) {
786
+ const node = new Node(value);
787
+ if (this.#head) {
788
+ this.#tail.next = node;
789
+ this.#tail = node;
790
+ } else {
791
+ this.#head = node;
792
+ this.#tail = node;
793
+ }
794
+ this.#size++;
795
+ }
796
+ dequeue() {
797
+ const current = this.#head;
798
+ if (!current) {
799
+ return;
800
+ }
801
+ this.#head = this.#head.next;
802
+ this.#size--;
803
+ return current.value;
804
+ }
805
+ clear() {
806
+ this.#head = void 0;
807
+ this.#tail = void 0;
808
+ this.#size = 0;
809
+ }
810
+ get size() {
811
+ return this.#size;
812
+ }
813
+ *[Symbol.iterator]() {
814
+ let current = this.#head;
815
+ while (current) {
816
+ yield current.value;
817
+ current = current.next;
818
+ }
819
+ }
820
+ };
821
+
822
+ // ../../node_modules/.pnpm/p-limit@4.0.0/node_modules/p-limit/index.js
823
+ function pLimit(concurrency) {
824
+ if (!((Number.isInteger(concurrency) || concurrency === Number.POSITIVE_INFINITY) && concurrency > 0)) {
825
+ throw new TypeError("Expected `concurrency` to be a number from 1 and up");
826
+ }
827
+ const queue = new Queue();
828
+ let activeCount = 0;
829
+ const next = () => {
830
+ activeCount--;
831
+ if (queue.size > 0) {
832
+ queue.dequeue()();
833
+ }
834
+ };
835
+ const run = async (fn, resolve3, args) => {
836
+ activeCount++;
837
+ const result = (async () => fn(...args))();
838
+ resolve3(result);
839
+ try {
840
+ await result;
841
+ } catch {
842
+ }
843
+ next();
844
+ };
845
+ const enqueue = (fn, resolve3, args) => {
846
+ queue.enqueue(run.bind(void 0, fn, resolve3, args));
847
+ (async () => {
848
+ await Promise.resolve();
849
+ if (activeCount < concurrency && queue.size > 0) {
850
+ queue.dequeue()();
851
+ }
852
+ })();
853
+ };
854
+ const generator = (fn, ...args) => new Promise((resolve3) => {
855
+ enqueue(fn, resolve3, args);
856
+ });
857
+ Object.defineProperties(generator, {
858
+ activeCount: {
859
+ get: () => activeCount
860
+ },
861
+ pendingCount: {
862
+ get: () => queue.size
863
+ },
864
+ clearQueue: {
865
+ value: () => {
866
+ queue.clear();
867
+ }
868
+ }
869
+ });
870
+ return generator;
871
+ }
872
+
766
873
  // src/config.ts
767
874
  init_esm_shims();
768
875
  import { convertTsPathsToRegexes, loadConfigFile } from "@pandacss/config";
@@ -997,8 +1104,12 @@ async function loadConfigAndCreateContext(options = {}) {
997
1104
 
998
1105
  // src/extract.ts
999
1106
  init_esm_shims();
1107
+ import { optimizeCss } from "@pandacss/core";
1000
1108
  import { logger as logger4 } from "@pandacss/logger";
1109
+ import { createParserResult } from "@pandacss/parser";
1110
+ import { writeFile as writeFile3 } from "fs/promises";
1001
1111
  import { Obj, pipe, tap, tryCatch } from "lil-fp";
1112
+ import { match } from "ts-pattern";
1002
1113
 
1003
1114
  // src/cli-box.ts
1004
1115
  init_esm_shims();
@@ -2313,10 +2424,6 @@ var createBox = (options) => boxen(options.content, {
2313
2424
  });
2314
2425
 
2315
2426
  // src/extract.ts
2316
- import { writeFile as writeFile3 } from "fs/promises";
2317
- import { createParserResult } from "@pandacss/parser";
2318
- import { match } from "ts-pattern";
2319
- import { optimizeCss } from "@pandacss/core";
2320
2427
  async function bundleStyleChunksWithImports(ctx) {
2321
2428
  const files = ctx.chunks.getFiles();
2322
2429
  await ctx.output.write({
@@ -2361,10 +2468,12 @@ function writeChunks(ctx) {
2361
2468
  }
2362
2469
  var randomWords = ["Sweet", "Divine", "Pandalicious", "Super"];
2363
2470
  var pickRandom = (arr) => arr[Math.floor(Math.random() * arr.length)];
2471
+ var limit = pLimit(20);
2364
2472
  async function emitArtifacts(ctx) {
2365
2473
  if (ctx.config.clean)
2366
2474
  ctx.output.empty();
2367
- await Promise.allSettled(ctx.getArtifacts().map(ctx.output.write));
2475
+ const promises = ctx.getArtifacts().map((artifact) => limit(() => ctx.output.write(artifact)));
2476
+ await Promise.allSettled(promises);
2368
2477
  void ctx.hooks.callHook("generator:done");
2369
2478
  return {
2370
2479
  box: createBox({
@@ -2473,6 +2582,7 @@ function parseDependency(fileOrGlob) {
2473
2582
  // src/builder.ts
2474
2583
  var configCache = /* @__PURE__ */ new Map();
2475
2584
  var contentFilesCache = /* @__PURE__ */ new WeakMap();
2585
+ var limit2 = pLimit(20);
2476
2586
  var setupCount = 0;
2477
2587
  var Builder = class {
2478
2588
  /**
@@ -2592,7 +2702,8 @@ var Builder = class {
2592
2702
  extract = async () => {
2593
2703
  const ctx = this.getContextOrThrow();
2594
2704
  const done = logger5.time.info("Extracted in");
2595
- await Promise.allSettled(ctx.getFiles().map((file) => this.extractFile(ctx, file)));
2705
+ const promises = ctx.getFiles().map((file) => limit2(() => this.extractFile(ctx, file)));
2706
+ await Promise.allSettled(promises);
2596
2707
  done();
2597
2708
  };
2598
2709
  toString = () => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pandacss/node",
3
- "version": "0.0.0-dev-20231023175607",
3
+ "version": "0.0.0-dev-20231023195038",
4
4
  "description": "The core css panda library",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
@@ -34,17 +34,17 @@
34
34
  "ts-morph": "19.0.0",
35
35
  "ts-pattern": "5.0.5",
36
36
  "tsconfck": "^2.1.2",
37
- "@pandacss/config": "0.0.0-dev-20231023175607",
38
- "@pandacss/core": "0.0.0-dev-20231023175607",
39
- "@pandacss/error": "0.0.0-dev-20231023175607",
40
- "@pandacss/extractor": "0.0.0-dev-20231023175607",
41
- "@pandacss/generator": "0.0.0-dev-20231023175607",
42
- "@pandacss/is-valid-prop": "0.0.0-dev-20231023175607",
43
- "@pandacss/logger": "0.0.0-dev-20231023175607",
44
- "@pandacss/parser": "0.0.0-dev-20231023175607",
45
- "@pandacss/shared": "0.0.0-dev-20231023175607",
46
- "@pandacss/token-dictionary": "0.0.0-dev-20231023175607",
47
- "@pandacss/types": "0.0.0-dev-20231023175607"
37
+ "@pandacss/config": "0.0.0-dev-20231023195038",
38
+ "@pandacss/core": "0.0.0-dev-20231023195038",
39
+ "@pandacss/error": "0.0.0-dev-20231023195038",
40
+ "@pandacss/extractor": "0.0.0-dev-20231023195038",
41
+ "@pandacss/generator": "0.0.0-dev-20231023195038",
42
+ "@pandacss/is-valid-prop": "0.0.0-dev-20231023195038",
43
+ "@pandacss/logger": "0.0.0-dev-20231023195038",
44
+ "@pandacss/parser": "0.0.0-dev-20231023195038",
45
+ "@pandacss/shared": "0.0.0-dev-20231023195038",
46
+ "@pandacss/token-dictionary": "0.0.0-dev-20231023195038",
47
+ "@pandacss/types": "0.0.0-dev-20231023195038"
48
48
  },
49
49
  "devDependencies": {
50
50
  "@types/fs-extra": "11.0.3",
@@ -53,7 +53,8 @@
53
53
  "@types/lodash.merge": "4.6.8",
54
54
  "@types/pluralize": "0.0.30",
55
55
  "boxen": "^7.1.1",
56
- "@pandacss/fixture": "0.0.0-dev-20231023175607"
56
+ "p-limit": "^4.0.0",
57
+ "@pandacss/fixture": "0.0.0-dev-20231023195038"
57
58
  },
58
59
  "scripts": {
59
60
  "build": "tsup src/index.ts --format=cjs,esm --shims --dts",