@pandacss/node 0.26.1 → 0.27.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.js +23 -16
- package/dist/index.mjs +23 -16
- package/package.json +12 -11
package/dist/index.js
CHANGED
|
@@ -791,6 +791,7 @@ var import_core = require("@pandacss/core");
|
|
|
791
791
|
var import_error = require("@pandacss/error");
|
|
792
792
|
var import_logger6 = require("@pandacss/logger");
|
|
793
793
|
var import_fs = require("fs");
|
|
794
|
+
var import_pathe3 = require("pathe");
|
|
794
795
|
|
|
795
796
|
// src/codegen.ts
|
|
796
797
|
init_cjs_shims();
|
|
@@ -2238,6 +2239,7 @@ init_cjs_shims();
|
|
|
2238
2239
|
var import_config2 = require("@pandacss/config");
|
|
2239
2240
|
var import_hookable = require("hookable");
|
|
2240
2241
|
var import_tsconfck = require("tsconfck");
|
|
2242
|
+
var import_browserslist = __toESM(require("browserslist"));
|
|
2241
2243
|
|
|
2242
2244
|
// src/create-context.ts
|
|
2243
2245
|
init_cjs_shims();
|
|
@@ -2459,6 +2461,7 @@ var PandaContext = class extends import_generator2.Generator {
|
|
|
2459
2461
|
};
|
|
2460
2462
|
};
|
|
2461
2463
|
writeCss = (sheet) => {
|
|
2464
|
+
import_logger5.logger.info("css", this.runtime.path.join(...this.paths.root, "styles.css"));
|
|
2462
2465
|
return this.output.write({
|
|
2463
2466
|
id: "styles.css",
|
|
2464
2467
|
dir: this.paths.root,
|
|
@@ -2512,6 +2515,9 @@ async function loadConfigAndCreateContext(options = {}) {
|
|
|
2512
2515
|
if (options.cwd) {
|
|
2513
2516
|
conf.config.cwd = options.cwd;
|
|
2514
2517
|
}
|
|
2518
|
+
if (conf.config.lightningcss && !conf.config.browserslist) {
|
|
2519
|
+
conf.config.browserslist ||= import_browserslist.default.findConfig(cwd)?.defaults;
|
|
2520
|
+
}
|
|
2515
2521
|
const tsconfigResult = await (0, import_tsconfck.parse)(conf.path, {
|
|
2516
2522
|
root: cwd,
|
|
2517
2523
|
// @ts-ignore
|
|
@@ -2585,7 +2591,6 @@ function parseDependency(fileOrGlob) {
|
|
|
2585
2591
|
}
|
|
2586
2592
|
|
|
2587
2593
|
// src/builder.ts
|
|
2588
|
-
var import_pathe3 = require("pathe");
|
|
2589
2594
|
var fileModifiedMap = /* @__PURE__ */ new Map();
|
|
2590
2595
|
var Builder = class {
|
|
2591
2596
|
/**
|
|
@@ -2709,10 +2714,16 @@ var Builder = class {
|
|
|
2709
2714
|
write = (root) => {
|
|
2710
2715
|
const ctx = this.getContextOrThrow();
|
|
2711
2716
|
const sheet = ctx.createSheet();
|
|
2717
|
+
ctx.appendLayerParams(sheet);
|
|
2712
2718
|
ctx.appendBaselineCss(sheet);
|
|
2713
|
-
ctx.appendParserCss(sheet);
|
|
2714
2719
|
const css = ctx.getCss(sheet);
|
|
2715
|
-
root.append(
|
|
2720
|
+
root.append(
|
|
2721
|
+
(0, import_core.optimizeCss)(css, {
|
|
2722
|
+
browserslist: ctx.config.browserslist,
|
|
2723
|
+
minify: ctx.config.minify,
|
|
2724
|
+
lightningcss: ctx.config.lightningcss
|
|
2725
|
+
})
|
|
2726
|
+
);
|
|
2716
2727
|
};
|
|
2717
2728
|
registerDependency = (fn) => {
|
|
2718
2729
|
const ctx = this.getContextOrThrow();
|
|
@@ -2732,38 +2743,33 @@ var Builder = class {
|
|
|
2732
2743
|
init_cjs_shims();
|
|
2733
2744
|
var import_logger7 = require("@pandacss/logger");
|
|
2734
2745
|
var cssgen = async (ctx, options) => {
|
|
2735
|
-
const {
|
|
2736
|
-
let outPath = ctx.runtime.path.join(...ctx.paths.getFilePath("styles.css"));
|
|
2746
|
+
const { outfile, type, minimal } = options;
|
|
2737
2747
|
const sheet = ctx.createSheet();
|
|
2738
2748
|
if (type) {
|
|
2749
|
+
const done = import_logger7.logger.time.info(ctx.messages.cssArtifactComplete(type));
|
|
2739
2750
|
ctx.appendCssOfType(type, sheet);
|
|
2740
2751
|
if (outfile) {
|
|
2741
|
-
outPath = ctx.output.ensure(outfile, cwd);
|
|
2742
2752
|
const css = ctx.getCss(sheet);
|
|
2743
2753
|
ctx.runtime.fs.writeFileSync(outfile, css);
|
|
2744
2754
|
} else {
|
|
2745
2755
|
await ctx.writeCss(sheet);
|
|
2746
2756
|
}
|
|
2747
|
-
|
|
2748
|
-
import_logger7.logger.info("css:emit:path", outPath);
|
|
2749
|
-
import_logger7.logger.info("css:emit:artifact", msg);
|
|
2757
|
+
done();
|
|
2750
2758
|
} else {
|
|
2759
|
+
const { files } = ctx.parseFiles();
|
|
2760
|
+
const done = import_logger7.logger.time.info(ctx.messages.buildComplete(files.length));
|
|
2751
2761
|
if (!minimal) {
|
|
2752
2762
|
ctx.appendLayerParams(sheet);
|
|
2753
2763
|
ctx.appendBaselineCss(sheet);
|
|
2754
2764
|
}
|
|
2755
|
-
const { files } = ctx.parseFiles();
|
|
2756
2765
|
ctx.appendParserCss(sheet);
|
|
2757
2766
|
if (outfile) {
|
|
2758
|
-
outPath = ctx.output.ensure(outfile, cwd);
|
|
2759
2767
|
const css = ctx.getCss(sheet);
|
|
2760
2768
|
ctx.runtime.fs.writeFileSync(outfile, css);
|
|
2761
2769
|
} else {
|
|
2762
2770
|
await ctx.writeCss(sheet);
|
|
2763
2771
|
}
|
|
2764
|
-
|
|
2765
|
-
import_logger7.logger.info("css:emit:path", outPath);
|
|
2766
|
-
import_logger7.logger.info("css:emit:out", msg);
|
|
2772
|
+
done();
|
|
2767
2773
|
}
|
|
2768
2774
|
};
|
|
2769
2775
|
|
|
@@ -2830,13 +2836,14 @@ async function build(ctx, artifactIds) {
|
|
|
2830
2836
|
if (ctx.config.emitTokensOnly) {
|
|
2831
2837
|
return import_logger9.logger.info("css:emit", "Successfully rebuilt the css variables and js function to query your tokens \u2728");
|
|
2832
2838
|
}
|
|
2839
|
+
const done = import_logger9.logger.time.info("");
|
|
2833
2840
|
const sheet = ctx.createSheet();
|
|
2834
2841
|
ctx.appendLayerParams(sheet);
|
|
2835
2842
|
ctx.appendBaselineCss(sheet);
|
|
2836
|
-
ctx.parseFiles();
|
|
2843
|
+
const parsed = ctx.parseFiles();
|
|
2837
2844
|
ctx.appendParserCss(sheet);
|
|
2838
2845
|
await ctx.writeCss(sheet);
|
|
2839
|
-
|
|
2846
|
+
done(ctx.messages.buildComplete(parsed.files.length));
|
|
2840
2847
|
}
|
|
2841
2848
|
async function generate(config, configPath) {
|
|
2842
2849
|
let ctx = await loadConfigAndCreateContext({ config, configPath });
|
package/dist/index.mjs
CHANGED
|
@@ -767,6 +767,7 @@ import { optimizeCss } from "@pandacss/core";
|
|
|
767
767
|
import { ConfigNotFoundError } from "@pandacss/error";
|
|
768
768
|
import { logger as logger6 } from "@pandacss/logger";
|
|
769
769
|
import { existsSync, statSync } from "fs";
|
|
770
|
+
import { resolve as resolve3 } from "pathe";
|
|
770
771
|
|
|
771
772
|
// src/codegen.ts
|
|
772
773
|
init_esm_shims();
|
|
@@ -2214,6 +2215,7 @@ init_esm_shims();
|
|
|
2214
2215
|
import { convertTsPathsToRegexes, loadConfig as loadConfig2 } from "@pandacss/config";
|
|
2215
2216
|
import { createDebugger, createHooks } from "hookable";
|
|
2216
2217
|
import { parse } from "tsconfck";
|
|
2218
|
+
import browserslist from "browserslist";
|
|
2217
2219
|
|
|
2218
2220
|
// src/create-context.ts
|
|
2219
2221
|
init_esm_shims();
|
|
@@ -2435,6 +2437,7 @@ var PandaContext = class extends Generator2 {
|
|
|
2435
2437
|
};
|
|
2436
2438
|
};
|
|
2437
2439
|
writeCss = (sheet) => {
|
|
2440
|
+
logger5.info("css", this.runtime.path.join(...this.paths.root, "styles.css"));
|
|
2438
2441
|
return this.output.write({
|
|
2439
2442
|
id: "styles.css",
|
|
2440
2443
|
dir: this.paths.root,
|
|
@@ -2488,6 +2491,9 @@ async function loadConfigAndCreateContext(options = {}) {
|
|
|
2488
2491
|
if (options.cwd) {
|
|
2489
2492
|
conf.config.cwd = options.cwd;
|
|
2490
2493
|
}
|
|
2494
|
+
if (conf.config.lightningcss && !conf.config.browserslist) {
|
|
2495
|
+
conf.config.browserslist ||= browserslist.findConfig(cwd)?.defaults;
|
|
2496
|
+
}
|
|
2491
2497
|
const tsconfigResult = await parse(conf.path, {
|
|
2492
2498
|
root: cwd,
|
|
2493
2499
|
// @ts-ignore
|
|
@@ -2561,7 +2567,6 @@ function parseDependency(fileOrGlob) {
|
|
|
2561
2567
|
}
|
|
2562
2568
|
|
|
2563
2569
|
// src/builder.ts
|
|
2564
|
-
import { resolve as resolve3 } from "pathe";
|
|
2565
2570
|
var fileModifiedMap = /* @__PURE__ */ new Map();
|
|
2566
2571
|
var Builder = class {
|
|
2567
2572
|
/**
|
|
@@ -2685,10 +2690,16 @@ var Builder = class {
|
|
|
2685
2690
|
write = (root) => {
|
|
2686
2691
|
const ctx = this.getContextOrThrow();
|
|
2687
2692
|
const sheet = ctx.createSheet();
|
|
2693
|
+
ctx.appendLayerParams(sheet);
|
|
2688
2694
|
ctx.appendBaselineCss(sheet);
|
|
2689
|
-
ctx.appendParserCss(sheet);
|
|
2690
2695
|
const css = ctx.getCss(sheet);
|
|
2691
|
-
root.append(
|
|
2696
|
+
root.append(
|
|
2697
|
+
optimizeCss(css, {
|
|
2698
|
+
browserslist: ctx.config.browserslist,
|
|
2699
|
+
minify: ctx.config.minify,
|
|
2700
|
+
lightningcss: ctx.config.lightningcss
|
|
2701
|
+
})
|
|
2702
|
+
);
|
|
2692
2703
|
};
|
|
2693
2704
|
registerDependency = (fn) => {
|
|
2694
2705
|
const ctx = this.getContextOrThrow();
|
|
@@ -2708,38 +2719,33 @@ var Builder = class {
|
|
|
2708
2719
|
init_esm_shims();
|
|
2709
2720
|
import { logger as logger7 } from "@pandacss/logger";
|
|
2710
2721
|
var cssgen = async (ctx, options) => {
|
|
2711
|
-
const {
|
|
2712
|
-
let outPath = ctx.runtime.path.join(...ctx.paths.getFilePath("styles.css"));
|
|
2722
|
+
const { outfile, type, minimal } = options;
|
|
2713
2723
|
const sheet = ctx.createSheet();
|
|
2714
2724
|
if (type) {
|
|
2725
|
+
const done = logger7.time.info(ctx.messages.cssArtifactComplete(type));
|
|
2715
2726
|
ctx.appendCssOfType(type, sheet);
|
|
2716
2727
|
if (outfile) {
|
|
2717
|
-
outPath = ctx.output.ensure(outfile, cwd);
|
|
2718
2728
|
const css = ctx.getCss(sheet);
|
|
2719
2729
|
ctx.runtime.fs.writeFileSync(outfile, css);
|
|
2720
2730
|
} else {
|
|
2721
2731
|
await ctx.writeCss(sheet);
|
|
2722
2732
|
}
|
|
2723
|
-
|
|
2724
|
-
logger7.info("css:emit:path", outPath);
|
|
2725
|
-
logger7.info("css:emit:artifact", msg);
|
|
2733
|
+
done();
|
|
2726
2734
|
} else {
|
|
2735
|
+
const { files } = ctx.parseFiles();
|
|
2736
|
+
const done = logger7.time.info(ctx.messages.buildComplete(files.length));
|
|
2727
2737
|
if (!minimal) {
|
|
2728
2738
|
ctx.appendLayerParams(sheet);
|
|
2729
2739
|
ctx.appendBaselineCss(sheet);
|
|
2730
2740
|
}
|
|
2731
|
-
const { files } = ctx.parseFiles();
|
|
2732
2741
|
ctx.appendParserCss(sheet);
|
|
2733
2742
|
if (outfile) {
|
|
2734
|
-
outPath = ctx.output.ensure(outfile, cwd);
|
|
2735
2743
|
const css = ctx.getCss(sheet);
|
|
2736
2744
|
ctx.runtime.fs.writeFileSync(outfile, css);
|
|
2737
2745
|
} else {
|
|
2738
2746
|
await ctx.writeCss(sheet);
|
|
2739
2747
|
}
|
|
2740
|
-
|
|
2741
|
-
logger7.info("css:emit:path", outPath);
|
|
2742
|
-
logger7.info("css:emit:out", msg);
|
|
2748
|
+
done();
|
|
2743
2749
|
}
|
|
2744
2750
|
};
|
|
2745
2751
|
|
|
@@ -2806,13 +2812,14 @@ async function build(ctx, artifactIds) {
|
|
|
2806
2812
|
if (ctx.config.emitTokensOnly) {
|
|
2807
2813
|
return logger9.info("css:emit", "Successfully rebuilt the css variables and js function to query your tokens \u2728");
|
|
2808
2814
|
}
|
|
2815
|
+
const done = logger9.time.info("");
|
|
2809
2816
|
const sheet = ctx.createSheet();
|
|
2810
2817
|
ctx.appendLayerParams(sheet);
|
|
2811
2818
|
ctx.appendBaselineCss(sheet);
|
|
2812
|
-
ctx.parseFiles();
|
|
2819
|
+
const parsed = ctx.parseFiles();
|
|
2813
2820
|
ctx.appendParserCss(sheet);
|
|
2814
2821
|
await ctx.writeCss(sheet);
|
|
2815
|
-
|
|
2822
|
+
done(ctx.messages.buildComplete(parsed.files.length));
|
|
2816
2823
|
}
|
|
2817
2824
|
async function generate(config, configPath) {
|
|
2818
2825
|
let ctx = await loadConfigAndCreateContext({ config, configPath });
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pandacss/node",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.27.0",
|
|
4
4
|
"description": "The core css panda library",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.mjs",
|
|
@@ -32,6 +32,7 @@
|
|
|
32
32
|
"access": "public"
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
|
+
"browserslist": "^4.22.2",
|
|
35
36
|
"chokidar": "^3.5.3",
|
|
36
37
|
"fast-glob": "^3.3.1",
|
|
37
38
|
"file-size": "^1.0.0",
|
|
@@ -53,16 +54,16 @@
|
|
|
53
54
|
"ts-morph": "19.0.0",
|
|
54
55
|
"ts-pattern": "5.0.5",
|
|
55
56
|
"tsconfck": "^2.1.2",
|
|
56
|
-
"@pandacss/config": "0.
|
|
57
|
-
"@pandacss/core": "0.
|
|
58
|
-
"@pandacss/error": "0.
|
|
59
|
-
"@pandacss/extractor": "0.
|
|
60
|
-
"@pandacss/generator": "0.
|
|
61
|
-
"@pandacss/logger": "0.
|
|
62
|
-
"@pandacss/parser": "0.
|
|
63
|
-
"@pandacss/shared": "0.
|
|
64
|
-
"@pandacss/token-dictionary": "0.
|
|
65
|
-
"@pandacss/types": "0.
|
|
57
|
+
"@pandacss/config": "0.27.0",
|
|
58
|
+
"@pandacss/core": "0.27.0",
|
|
59
|
+
"@pandacss/error": "0.27.0",
|
|
60
|
+
"@pandacss/extractor": "0.27.0",
|
|
61
|
+
"@pandacss/generator": "0.27.0",
|
|
62
|
+
"@pandacss/logger": "0.27.0",
|
|
63
|
+
"@pandacss/parser": "0.27.0",
|
|
64
|
+
"@pandacss/shared": "0.27.0",
|
|
65
|
+
"@pandacss/token-dictionary": "0.27.0",
|
|
66
|
+
"@pandacss/types": "0.27.0"
|
|
66
67
|
},
|
|
67
68
|
"devDependencies": {
|
|
68
69
|
"@types/fs-extra": "11.0.4",
|