@pandacss/node 0.17.1 → 0.17.3
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 +17 -17
- package/dist/index.mjs +27 -36
- package/package.json +13 -13
package/dist/index.js
CHANGED
|
@@ -784,7 +784,7 @@ var import_core3 = require("@pandacss/core");
|
|
|
784
784
|
var import_error = require("@pandacss/error");
|
|
785
785
|
var import_logger5 = require("@pandacss/logger");
|
|
786
786
|
var import_fs = require("fs");
|
|
787
|
-
var import_fs_extra2 = require("fs-extra");
|
|
787
|
+
var import_fs_extra2 = __toESM(require("fs-extra"));
|
|
788
788
|
var import_path2 = require("path");
|
|
789
789
|
|
|
790
790
|
// ../../node_modules/.pnpm/p-limit@4.0.0/node_modules/p-limit/index.js
|
|
@@ -951,7 +951,7 @@ init_cjs_shims();
|
|
|
951
951
|
var import_logger2 = require("@pandacss/logger");
|
|
952
952
|
var import_chokidar = __toESM(require("chokidar"));
|
|
953
953
|
var import_fast_glob = __toESM(require("fast-glob"));
|
|
954
|
-
var import_fs_extra = require("fs-extra");
|
|
954
|
+
var import_fs_extra = __toESM(require("fs-extra"));
|
|
955
955
|
var import_pathe = require("pathe");
|
|
956
956
|
var nodeRuntime = {
|
|
957
957
|
cwd() {
|
|
@@ -972,9 +972,9 @@ var nodeRuntime = {
|
|
|
972
972
|
}
|
|
973
973
|
},
|
|
974
974
|
fs: {
|
|
975
|
-
existsSync: import_fs_extra.existsSync,
|
|
975
|
+
existsSync: import_fs_extra.default.existsSync,
|
|
976
976
|
readFileSync(filePath) {
|
|
977
|
-
return
|
|
977
|
+
return import_fs_extra.default.readFileSync(filePath, "utf8");
|
|
978
978
|
},
|
|
979
979
|
glob(opts) {
|
|
980
980
|
if (!opts.include)
|
|
@@ -985,13 +985,13 @@ var nodeRuntime = {
|
|
|
985
985
|
}
|
|
986
986
|
return import_fast_glob.default.sync(opts.include, { cwd: opts.cwd, ignore, absolute: true });
|
|
987
987
|
},
|
|
988
|
-
writeFile: import_fs_extra.writeFile,
|
|
989
|
-
writeFileSync: import_fs_extra.writeFileSync,
|
|
990
|
-
readDirSync: import_fs_extra.readdirSync,
|
|
991
|
-
rmDirSync: import_fs_extra.emptyDirSync,
|
|
992
|
-
rmFileSync: import_fs_extra.removeSync,
|
|
988
|
+
writeFile: import_fs_extra.default.writeFile,
|
|
989
|
+
writeFileSync: import_fs_extra.default.writeFileSync,
|
|
990
|
+
readDirSync: import_fs_extra.default.readdirSync,
|
|
991
|
+
rmDirSync: import_fs_extra.default.emptyDirSync,
|
|
992
|
+
rmFileSync: import_fs_extra.default.removeSync,
|
|
993
993
|
ensureDirSync(path2) {
|
|
994
|
-
return
|
|
994
|
+
return import_fs_extra.default.ensureDirSync(path2);
|
|
995
995
|
},
|
|
996
996
|
watch(options) {
|
|
997
997
|
const { include, exclude, cwd, poll } = options;
|
|
@@ -2616,17 +2616,17 @@ var Builder = class {
|
|
|
2616
2616
|
const newModified = /* @__PURE__ */ new Map();
|
|
2617
2617
|
const prevModified = configCache.get(configPath)?.depsModifiedMap;
|
|
2618
2618
|
for (const file of deps) {
|
|
2619
|
-
const stats =
|
|
2619
|
+
const stats = import_fs_extra2.default.statSync(file, { throwIfNoEntry: false });
|
|
2620
2620
|
if (!stats)
|
|
2621
2621
|
continue;
|
|
2622
2622
|
const time = stats.mtimeMs;
|
|
2623
2623
|
newModified.set(file, time);
|
|
2624
|
-
if (
|
|
2624
|
+
if (prevModified && (!prevModified.has(file) || time > prevModified.get(file))) {
|
|
2625
2625
|
modified = true;
|
|
2626
2626
|
}
|
|
2627
2627
|
}
|
|
2628
2628
|
if (!modified) {
|
|
2629
|
-
return { isModified: false, modifiedMap: prevModified };
|
|
2629
|
+
return { isModified: false, modifiedMap: prevModified || /* @__PURE__ */ new Map() };
|
|
2630
2630
|
}
|
|
2631
2631
|
for (const file of deps) {
|
|
2632
2632
|
delete require.cache[file];
|
|
@@ -2706,7 +2706,7 @@ var Builder = class {
|
|
|
2706
2706
|
return contentFilesCache.get(ctx).fileCssMap;
|
|
2707
2707
|
}
|
|
2708
2708
|
extractFile = async (ctx, file) => {
|
|
2709
|
-
const mtime = (0, import_fs.existsSync)(file) ?
|
|
2709
|
+
const mtime = (0, import_fs.existsSync)(file) ? import_fs_extra2.default.statSync(file).mtimeMs : -Infinity;
|
|
2710
2710
|
const isUnchanged = this.fileModifiedMap.has(file) && mtime === this.fileModifiedMap.get(file);
|
|
2711
2711
|
if (isUnchanged)
|
|
2712
2712
|
return;
|
|
@@ -2924,7 +2924,7 @@ function setupGitIgnore(ctx) {
|
|
|
2924
2924
|
init_cjs_shims();
|
|
2925
2925
|
var import_generator2 = require("@pandacss/generator");
|
|
2926
2926
|
var import_logger9 = require("@pandacss/logger");
|
|
2927
|
-
var import_fs_extra3 = require("fs-extra");
|
|
2927
|
+
var import_fs_extra3 = __toESM(require("fs-extra"));
|
|
2928
2928
|
var import_look_it_up3 = require("look-it-up");
|
|
2929
2929
|
var import_outdent2 = require("outdent");
|
|
2930
2930
|
var import_path3 = require("path");
|
|
@@ -2971,7 +2971,7 @@ jsxFramework: '${jsxFramework}',` : ""}
|
|
|
2971
2971
|
syntax: '${syntax}'` : ""}
|
|
2972
2972
|
})
|
|
2973
2973
|
`;
|
|
2974
|
-
await
|
|
2974
|
+
await import_fs_extra3.default.writeFile((0, import_path3.join)(cwd, file), content);
|
|
2975
2975
|
import_logger9.logger.log(import_generator2.messages.thankYou());
|
|
2976
2976
|
}
|
|
2977
2977
|
}
|
|
@@ -2984,7 +2984,7 @@ module.exports = {
|
|
|
2984
2984
|
},
|
|
2985
2985
|
}
|
|
2986
2986
|
`;
|
|
2987
|
-
await
|
|
2987
|
+
await import_fs_extra3.default.writeFile((0, import_path3.join)(cwd, "postcss.config.cjs"), content);
|
|
2988
2988
|
}
|
|
2989
2989
|
|
|
2990
2990
|
// src/ship-files.ts
|
package/dist/index.mjs
CHANGED
|
@@ -759,8 +759,8 @@ import { getConfigDependencies } from "@pandacss/config";
|
|
|
759
759
|
import { optimizeCss as optimizeCss2, mergeCss as mergeCss2 } from "@pandacss/core";
|
|
760
760
|
import { ConfigNotFoundError } from "@pandacss/error";
|
|
761
761
|
import { logger as logger5 } from "@pandacss/logger";
|
|
762
|
-
import { existsSync
|
|
763
|
-
import
|
|
762
|
+
import { existsSync } from "fs";
|
|
763
|
+
import fsExtra2 from "fs-extra";
|
|
764
764
|
import { resolve as resolve2 } from "path";
|
|
765
765
|
|
|
766
766
|
// ../../node_modules/.pnpm/p-limit@4.0.0/node_modules/p-limit/index.js
|
|
@@ -927,16 +927,7 @@ init_esm_shims();
|
|
|
927
927
|
import { logger as logger2 } from "@pandacss/logger";
|
|
928
928
|
import chokidar from "chokidar";
|
|
929
929
|
import glob from "fast-glob";
|
|
930
|
-
import
|
|
931
|
-
emptyDirSync,
|
|
932
|
-
ensureDirSync,
|
|
933
|
-
existsSync,
|
|
934
|
-
readdirSync,
|
|
935
|
-
readFileSync,
|
|
936
|
-
removeSync,
|
|
937
|
-
writeFile as writeFile2,
|
|
938
|
-
writeFileSync
|
|
939
|
-
} from "fs-extra";
|
|
930
|
+
import fsExtra from "fs-extra";
|
|
940
931
|
import { dirname, extname, isAbsolute, join, relative, sep } from "pathe";
|
|
941
932
|
var nodeRuntime = {
|
|
942
933
|
cwd() {
|
|
@@ -957,9 +948,9 @@ var nodeRuntime = {
|
|
|
957
948
|
}
|
|
958
949
|
},
|
|
959
950
|
fs: {
|
|
960
|
-
existsSync,
|
|
951
|
+
existsSync: fsExtra.existsSync,
|
|
961
952
|
readFileSync(filePath) {
|
|
962
|
-
return readFileSync(filePath, "utf8");
|
|
953
|
+
return fsExtra.readFileSync(filePath, "utf8");
|
|
963
954
|
},
|
|
964
955
|
glob(opts) {
|
|
965
956
|
if (!opts.include)
|
|
@@ -970,13 +961,13 @@ var nodeRuntime = {
|
|
|
970
961
|
}
|
|
971
962
|
return glob.sync(opts.include, { cwd: opts.cwd, ignore, absolute: true });
|
|
972
963
|
},
|
|
973
|
-
writeFile:
|
|
974
|
-
writeFileSync,
|
|
975
|
-
readDirSync: readdirSync,
|
|
976
|
-
rmDirSync: emptyDirSync,
|
|
977
|
-
rmFileSync: removeSync,
|
|
964
|
+
writeFile: fsExtra.writeFile,
|
|
965
|
+
writeFileSync: fsExtra.writeFileSync,
|
|
966
|
+
readDirSync: fsExtra.readdirSync,
|
|
967
|
+
rmDirSync: fsExtra.emptyDirSync,
|
|
968
|
+
rmFileSync: fsExtra.removeSync,
|
|
978
969
|
ensureDirSync(path2) {
|
|
979
|
-
return ensureDirSync(path2);
|
|
970
|
+
return fsExtra.ensureDirSync(path2);
|
|
980
971
|
},
|
|
981
972
|
watch(options) {
|
|
982
973
|
const { include, exclude, cwd, poll } = options;
|
|
@@ -1108,7 +1099,7 @@ init_esm_shims();
|
|
|
1108
1099
|
import { optimizeCss } from "@pandacss/core";
|
|
1109
1100
|
import { logger as logger4 } from "@pandacss/logger";
|
|
1110
1101
|
import { createParserResult } from "@pandacss/parser";
|
|
1111
|
-
import { writeFile as
|
|
1102
|
+
import { writeFile as writeFile2 } from "fs/promises";
|
|
1112
1103
|
import { Obj, pipe, tap, tryCatch } from "lil-fp";
|
|
1113
1104
|
import { match } from "ts-pattern";
|
|
1114
1105
|
|
|
@@ -2499,7 +2490,7 @@ async function bundleCss(ctx, outfile) {
|
|
|
2499
2490
|
const extracted = await writeChunks(ctx);
|
|
2500
2491
|
const files = ctx.chunks.getFiles();
|
|
2501
2492
|
const minify = ctx.config.minify;
|
|
2502
|
-
await
|
|
2493
|
+
await writeFile2(outfile, optimizeCss(ctx.getCss({ files, resolve: true }), { minify }));
|
|
2503
2494
|
return { files, msg: ctx.messages.buildComplete(extracted.length) };
|
|
2504
2495
|
}
|
|
2505
2496
|
async function bundleMinimalFilesCss(ctx, outfile) {
|
|
@@ -2519,7 +2510,7 @@ async function bundleMinimalFilesCss(ctx, outfile) {
|
|
|
2519
2510
|
if (!css)
|
|
2520
2511
|
return { files, msg: ctx.messages.buildComplete(files.length) };
|
|
2521
2512
|
const minify = ctx.config.minify;
|
|
2522
|
-
await
|
|
2513
|
+
await writeFile2(outfile, optimizeCss(css, { minify }));
|
|
2523
2514
|
return { files, msg: ctx.messages.buildComplete(files.length) };
|
|
2524
2515
|
}
|
|
2525
2516
|
async function generateCssArtifactOfType(ctx, cssType, outfile) {
|
|
@@ -2532,7 +2523,7 @@ async function generateCssArtifactOfType(ctx, cssType, outfile) {
|
|
|
2532
2523
|
if (!css)
|
|
2533
2524
|
return { msg: `No css to generate for type <${cssType}>` };
|
|
2534
2525
|
const minify = ctx.config.minify;
|
|
2535
|
-
await
|
|
2526
|
+
await writeFile2(outfile, optimizeCss(css, { minify }));
|
|
2536
2527
|
return { msg: `Successfully generated ${cssType} css artifact \u2728` };
|
|
2537
2528
|
}
|
|
2538
2529
|
|
|
@@ -2601,17 +2592,17 @@ var Builder = class {
|
|
|
2601
2592
|
const newModified = /* @__PURE__ */ new Map();
|
|
2602
2593
|
const prevModified = configCache.get(configPath)?.depsModifiedMap;
|
|
2603
2594
|
for (const file of deps) {
|
|
2604
|
-
const stats = statSync(file, { throwIfNoEntry: false });
|
|
2595
|
+
const stats = fsExtra2.statSync(file, { throwIfNoEntry: false });
|
|
2605
2596
|
if (!stats)
|
|
2606
2597
|
continue;
|
|
2607
2598
|
const time = stats.mtimeMs;
|
|
2608
2599
|
newModified.set(file, time);
|
|
2609
|
-
if (
|
|
2600
|
+
if (prevModified && (!prevModified.has(file) || time > prevModified.get(file))) {
|
|
2610
2601
|
modified = true;
|
|
2611
2602
|
}
|
|
2612
2603
|
}
|
|
2613
2604
|
if (!modified) {
|
|
2614
|
-
return { isModified: false, modifiedMap: prevModified };
|
|
2605
|
+
return { isModified: false, modifiedMap: prevModified || /* @__PURE__ */ new Map() };
|
|
2615
2606
|
}
|
|
2616
2607
|
for (const file of deps) {
|
|
2617
2608
|
delete __require.cache[file];
|
|
@@ -2691,7 +2682,7 @@ var Builder = class {
|
|
|
2691
2682
|
return contentFilesCache.get(ctx).fileCssMap;
|
|
2692
2683
|
}
|
|
2693
2684
|
extractFile = async (ctx, file) => {
|
|
2694
|
-
const mtime =
|
|
2685
|
+
const mtime = existsSync(file) ? fsExtra2.statSync(file).mtimeMs : -Infinity;
|
|
2695
2686
|
const isUnchanged = this.fileModifiedMap.has(file) && mtime === this.fileModifiedMap.get(file);
|
|
2696
2687
|
if (isUnchanged)
|
|
2697
2688
|
return;
|
|
@@ -2882,7 +2873,7 @@ async function generate(config, configPath) {
|
|
|
2882
2873
|
|
|
2883
2874
|
// src/git-ignore.ts
|
|
2884
2875
|
init_esm_shims();
|
|
2885
|
-
import { appendFileSync, readFileSync
|
|
2876
|
+
import { appendFileSync, readFileSync, writeFileSync } from "fs";
|
|
2886
2877
|
import { lookItUpSync as lookItUpSync2 } from "look-it-up";
|
|
2887
2878
|
import outdent from "outdent";
|
|
2888
2879
|
function setupGitIgnore(ctx) {
|
|
@@ -2897,9 +2888,9 @@ function setupGitIgnore(ctx) {
|
|
|
2897
2888
|
`;
|
|
2898
2889
|
const file = lookItUpSync2(".gitignore");
|
|
2899
2890
|
if (!file) {
|
|
2900
|
-
return
|
|
2891
|
+
return writeFileSync(".gitignore", txt);
|
|
2901
2892
|
}
|
|
2902
|
-
const content =
|
|
2893
|
+
const content = readFileSync(file, "utf-8");
|
|
2903
2894
|
if (!content.includes(outdir)) {
|
|
2904
2895
|
appendFileSync(file, txt);
|
|
2905
2896
|
}
|
|
@@ -2909,7 +2900,7 @@ function setupGitIgnore(ctx) {
|
|
|
2909
2900
|
init_esm_shims();
|
|
2910
2901
|
import { messages } from "@pandacss/generator";
|
|
2911
2902
|
import { logger as logger9, quote } from "@pandacss/logger";
|
|
2912
|
-
import
|
|
2903
|
+
import fsExtra3 from "fs-extra";
|
|
2913
2904
|
import { lookItUpSync as lookItUpSync3 } from "look-it-up";
|
|
2914
2905
|
import { outdent as outdent2 } from "outdent";
|
|
2915
2906
|
import { join as join2 } from "path";
|
|
@@ -2956,7 +2947,7 @@ jsxFramework: '${jsxFramework}',` : ""}
|
|
|
2956
2947
|
syntax: '${syntax}'` : ""}
|
|
2957
2948
|
})
|
|
2958
2949
|
`;
|
|
2959
|
-
await
|
|
2950
|
+
await fsExtra3.writeFile(join2(cwd, file), content);
|
|
2960
2951
|
logger9.log(messages.thankYou());
|
|
2961
2952
|
}
|
|
2962
2953
|
}
|
|
@@ -2969,14 +2960,14 @@ module.exports = {
|
|
|
2969
2960
|
},
|
|
2970
2961
|
}
|
|
2971
2962
|
`;
|
|
2972
|
-
await
|
|
2963
|
+
await fsExtra3.writeFile(join2(cwd, "postcss.config.cjs"), content);
|
|
2973
2964
|
}
|
|
2974
2965
|
|
|
2975
2966
|
// src/ship-files.ts
|
|
2976
2967
|
init_esm_shims();
|
|
2977
2968
|
import { colors as colors2, logger as logger10 } from "@pandacss/logger";
|
|
2978
2969
|
import { createParserResult as createParserResult2 } from "@pandacss/parser";
|
|
2979
|
-
import { writeFile as
|
|
2970
|
+
import { writeFile as writeFile3 } from "fs/promises";
|
|
2980
2971
|
import * as path from "path";
|
|
2981
2972
|
async function shipFiles(ctx, outfile) {
|
|
2982
2973
|
const files = ctx.getFiles();
|
|
@@ -2996,7 +2987,7 @@ async function shipFiles(ctx, outfile) {
|
|
|
2996
2987
|
const minify = ctx.config.minify;
|
|
2997
2988
|
logger10.info("cli", `Writing ${minify ? "[min] " : " "}${colors2.bold(outfile)}`);
|
|
2998
2989
|
const output = JSON.stringify(extractResult.toJSON(), null, minify ? 0 : 2);
|
|
2999
|
-
await
|
|
2990
|
+
await writeFile3(outfile, output);
|
|
3000
2991
|
logger10.info("cli", "Done!");
|
|
3001
2992
|
}
|
|
3002
2993
|
export {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pandacss/node",
|
|
3
|
-
"version": "0.17.
|
|
3
|
+
"version": "0.17.3",
|
|
4
4
|
"description": "The core css panda library",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.mjs",
|
|
@@ -46,17 +46,17 @@
|
|
|
46
46
|
"ts-morph": "19.0.0",
|
|
47
47
|
"ts-pattern": "5.0.5",
|
|
48
48
|
"tsconfck": "^2.1.2",
|
|
49
|
-
"@pandacss/
|
|
50
|
-
"@pandacss/
|
|
51
|
-
"@pandacss/
|
|
52
|
-
"@pandacss/extractor": "0.17.
|
|
53
|
-
"@pandacss/
|
|
54
|
-
"@pandacss/
|
|
55
|
-
"@pandacss/
|
|
56
|
-
"@pandacss/
|
|
57
|
-
"@pandacss/
|
|
58
|
-
"@pandacss/
|
|
59
|
-
"@pandacss/
|
|
49
|
+
"@pandacss/config": "0.17.3",
|
|
50
|
+
"@pandacss/core": "0.17.3",
|
|
51
|
+
"@pandacss/error": "0.17.3",
|
|
52
|
+
"@pandacss/extractor": "0.17.3",
|
|
53
|
+
"@pandacss/generator": "0.17.3",
|
|
54
|
+
"@pandacss/is-valid-prop": "0.17.3",
|
|
55
|
+
"@pandacss/logger": "0.17.3",
|
|
56
|
+
"@pandacss/parser": "0.17.3",
|
|
57
|
+
"@pandacss/shared": "0.17.3",
|
|
58
|
+
"@pandacss/token-dictionary": "0.17.3",
|
|
59
|
+
"@pandacss/types": "0.17.3"
|
|
60
60
|
},
|
|
61
61
|
"devDependencies": {
|
|
62
62
|
"@types/fs-extra": "11.0.3",
|
|
@@ -66,7 +66,7 @@
|
|
|
66
66
|
"@types/pluralize": "0.0.30",
|
|
67
67
|
"boxen": "^7.1.1",
|
|
68
68
|
"p-limit": "^4.0.0",
|
|
69
|
-
"@pandacss/fixture": "0.17.
|
|
69
|
+
"@pandacss/fixture": "0.17.3"
|
|
70
70
|
},
|
|
71
71
|
"scripts": {
|
|
72
72
|
"build": "tsup src/index.ts --format=cjs,esm --shims --dts",
|