@pandacss/node 1.5.1 → 1.6.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.d.mts +2 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +43 -4
- package/dist/index.mjs +43 -4
- package/package.json +12 -12
package/dist/index.d.mts
CHANGED
|
@@ -55,6 +55,7 @@ declare class PandaContext extends Generator {
|
|
|
55
55
|
results: ParserResult[];
|
|
56
56
|
};
|
|
57
57
|
writeCss: (sheet?: Stylesheet) => Promise<PromiseSettledResult<void>[]> | undefined;
|
|
58
|
+
writeSplitCss: (sheet: Stylesheet) => Promise<void>;
|
|
58
59
|
watchConfig: (cb: (file: string) => void | Promise<void>, opts?: Omit<WatchOptions, "include">) => void;
|
|
59
60
|
watchFiles: (cb: (event: WatcherEventType, file: string) => void | Promise<void>, opts?: Omit<WatchOptions, "include" | "exclude" | "poll" | "cwd" | "logger">) => void;
|
|
60
61
|
}
|
|
@@ -132,6 +133,7 @@ interface CssGenOptions {
|
|
|
132
133
|
outfile?: string;
|
|
133
134
|
type?: CssArtifactType;
|
|
134
135
|
minimal?: boolean;
|
|
136
|
+
splitting?: boolean;
|
|
135
137
|
}
|
|
136
138
|
declare const cssgen: (ctx: PandaContext, options: CssGenOptions) => Promise<void>;
|
|
137
139
|
|
package/dist/index.d.ts
CHANGED
|
@@ -55,6 +55,7 @@ declare class PandaContext extends Generator {
|
|
|
55
55
|
results: ParserResult[];
|
|
56
56
|
};
|
|
57
57
|
writeCss: (sheet?: Stylesheet) => Promise<PromiseSettledResult<void>[]> | undefined;
|
|
58
|
+
writeSplitCss: (sheet: Stylesheet) => Promise<void>;
|
|
58
59
|
watchConfig: (cb: (file: string) => void | Promise<void>, opts?: Omit<WatchOptions, "include">) => void;
|
|
59
60
|
watchFiles: (cb: (event: WatcherEventType, file: string) => void | Promise<void>, opts?: Omit<WatchOptions, "include" | "exclude" | "poll" | "cwd" | "logger">) => void;
|
|
60
61
|
}
|
|
@@ -132,6 +133,7 @@ interface CssGenOptions {
|
|
|
132
133
|
outfile?: string;
|
|
133
134
|
type?: CssArtifactType;
|
|
134
135
|
minimal?: boolean;
|
|
136
|
+
splitting?: boolean;
|
|
135
137
|
}
|
|
136
138
|
declare const cssgen: (ctx: PandaContext, options: CssGenOptions) => Promise<void>;
|
|
137
139
|
|
package/dist/index.js
CHANGED
|
@@ -33,9 +33,9 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
33
33
|
));
|
|
34
34
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
35
35
|
|
|
36
|
-
// ../../node_modules/.pnpm/tsup@8.5.1_@swc+core@1.15.
|
|
36
|
+
// ../../node_modules/.pnpm/tsup@8.5.1_@swc+core@1.15.2_@swc+helpers@0.5.17__jiti@2.6.1_postcss@8.5.6_tsx@4.20.6_typescript@5.9.3_yaml@2.8.1/node_modules/tsup/assets/cjs_shims.js
|
|
37
37
|
var init_cjs_shims = __esm({
|
|
38
|
-
"../../node_modules/.pnpm/tsup@8.5.1_@swc+core@1.15.
|
|
38
|
+
"../../node_modules/.pnpm/tsup@8.5.1_@swc+core@1.15.2_@swc+helpers@0.5.17__jiti@2.6.1_postcss@8.5.6_tsx@4.20.6_typescript@5.9.3_yaml@2.8.1/node_modules/tsup/assets/cjs_shims.js"() {
|
|
39
39
|
"use strict";
|
|
40
40
|
}
|
|
41
41
|
});
|
|
@@ -2140,6 +2140,43 @@ var PandaContext = class extends import_generator2.Generator {
|
|
|
2140
2140
|
files: [{ file: "styles.css", code: this.getCss(sheet) }]
|
|
2141
2141
|
});
|
|
2142
2142
|
};
|
|
2143
|
+
writeSplitCss = async (sheet) => {
|
|
2144
|
+
const { path: pathUtil, fs: fs3 } = this.runtime;
|
|
2145
|
+
const rootDir = this.paths.root;
|
|
2146
|
+
const stylesDir = [...rootDir, "styles"];
|
|
2147
|
+
const artifacts = this.getSplitCssArtifacts(sheet);
|
|
2148
|
+
const subDirs = new Set([...artifacts.recipes, ...artifacts.themes].map((a) => a.dir).filter(Boolean));
|
|
2149
|
+
fs3.ensureDirSync(pathUtil.join(...stylesDir));
|
|
2150
|
+
subDirs.forEach((dir) => fs3.ensureDirSync(pathUtil.join(...stylesDir, dir)));
|
|
2151
|
+
const styleFiles = [];
|
|
2152
|
+
for (const layer of artifacts.layers) {
|
|
2153
|
+
styleFiles.push({ file: layer.file, code: layer.code });
|
|
2154
|
+
import_logger4.logger.info("css", pathUtil.join(...stylesDir, layer.file));
|
|
2155
|
+
}
|
|
2156
|
+
for (const recipe of artifacts.recipes) {
|
|
2157
|
+
styleFiles.push({ file: `${recipe.dir}/${recipe.file}`, code: recipe.code });
|
|
2158
|
+
import_logger4.logger.info("css", pathUtil.join(...stylesDir, recipe.dir, recipe.file));
|
|
2159
|
+
}
|
|
2160
|
+
if (artifacts.recipes.length) {
|
|
2161
|
+
styleFiles.push({ file: "recipes.css", code: artifacts.recipesIndex });
|
|
2162
|
+
import_logger4.logger.info("css", pathUtil.join(...stylesDir, "recipes.css"));
|
|
2163
|
+
}
|
|
2164
|
+
for (const theme of artifacts.themes) {
|
|
2165
|
+
styleFiles.push({ file: `${theme.dir}/${theme.file}`, code: theme.code });
|
|
2166
|
+
import_logger4.logger.info("css", pathUtil.join(...stylesDir, theme.dir, theme.file));
|
|
2167
|
+
}
|
|
2168
|
+
await this.output.write({
|
|
2169
|
+
id: "styles",
|
|
2170
|
+
dir: stylesDir,
|
|
2171
|
+
files: styleFiles
|
|
2172
|
+
});
|
|
2173
|
+
import_logger4.logger.info("css", pathUtil.join(...rootDir, "styles.css"));
|
|
2174
|
+
await this.output.write({
|
|
2175
|
+
id: "styles.css",
|
|
2176
|
+
dir: rootDir,
|
|
2177
|
+
files: [{ file: "styles.css", code: artifacts.index }]
|
|
2178
|
+
});
|
|
2179
|
+
};
|
|
2143
2180
|
watchConfig = (cb, opts) => {
|
|
2144
2181
|
const { cwd, poll, exclude } = opts ?? {};
|
|
2145
2182
|
import_logger4.logger.info("ctx:watch", this.messages.configWatch());
|
|
@@ -2503,7 +2540,7 @@ var startProfiling = async (cwd, prefix, isWatching) => {
|
|
|
2503
2540
|
init_cjs_shims();
|
|
2504
2541
|
var import_logger7 = require("@pandacss/logger");
|
|
2505
2542
|
var cssgen = async (ctx, options) => {
|
|
2506
|
-
const { outfile, type, minimal } = options;
|
|
2543
|
+
const { outfile, type, minimal, splitting } = options;
|
|
2507
2544
|
const sheet = ctx.createSheet();
|
|
2508
2545
|
if (type) {
|
|
2509
2546
|
const done = import_logger7.logger.time.info(ctx.messages.cssArtifactComplete(type));
|
|
@@ -2524,7 +2561,9 @@ var cssgen = async (ctx, options) => {
|
|
|
2524
2561
|
ctx.appendBaselineCss(sheet);
|
|
2525
2562
|
}
|
|
2526
2563
|
ctx.appendParserCss(sheet);
|
|
2527
|
-
if (
|
|
2564
|
+
if (splitting) {
|
|
2565
|
+
await ctx.writeSplitCss(sheet);
|
|
2566
|
+
} else if (outfile) {
|
|
2528
2567
|
const css = ctx.getCss(sheet);
|
|
2529
2568
|
import_logger7.logger.info("css", ctx.runtime.path.resolve(outfile));
|
|
2530
2569
|
await ctx.runtime.fs.writeFile(outfile, css);
|
package/dist/index.mjs
CHANGED
|
@@ -27,11 +27,11 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
27
27
|
mod
|
|
28
28
|
));
|
|
29
29
|
|
|
30
|
-
// ../../node_modules/.pnpm/tsup@8.5.1_@swc+core@1.15.
|
|
30
|
+
// ../../node_modules/.pnpm/tsup@8.5.1_@swc+core@1.15.2_@swc+helpers@0.5.17__jiti@2.6.1_postcss@8.5.6_tsx@4.20.6_typescript@5.9.3_yaml@2.8.1/node_modules/tsup/assets/esm_shims.js
|
|
31
31
|
import path from "path";
|
|
32
32
|
import { fileURLToPath } from "url";
|
|
33
33
|
var init_esm_shims = __esm({
|
|
34
|
-
"../../node_modules/.pnpm/tsup@8.5.1_@swc+core@1.15.
|
|
34
|
+
"../../node_modules/.pnpm/tsup@8.5.1_@swc+core@1.15.2_@swc+helpers@0.5.17__jiti@2.6.1_postcss@8.5.6_tsx@4.20.6_typescript@5.9.3_yaml@2.8.1/node_modules/tsup/assets/esm_shims.js"() {
|
|
35
35
|
"use strict";
|
|
36
36
|
}
|
|
37
37
|
});
|
|
@@ -2117,6 +2117,43 @@ var PandaContext = class extends Generator2 {
|
|
|
2117
2117
|
files: [{ file: "styles.css", code: this.getCss(sheet) }]
|
|
2118
2118
|
});
|
|
2119
2119
|
};
|
|
2120
|
+
writeSplitCss = async (sheet) => {
|
|
2121
|
+
const { path: pathUtil, fs: fs3 } = this.runtime;
|
|
2122
|
+
const rootDir = this.paths.root;
|
|
2123
|
+
const stylesDir = [...rootDir, "styles"];
|
|
2124
|
+
const artifacts = this.getSplitCssArtifacts(sheet);
|
|
2125
|
+
const subDirs = new Set([...artifacts.recipes, ...artifacts.themes].map((a) => a.dir).filter(Boolean));
|
|
2126
|
+
fs3.ensureDirSync(pathUtil.join(...stylesDir));
|
|
2127
|
+
subDirs.forEach((dir) => fs3.ensureDirSync(pathUtil.join(...stylesDir, dir)));
|
|
2128
|
+
const styleFiles = [];
|
|
2129
|
+
for (const layer of artifacts.layers) {
|
|
2130
|
+
styleFiles.push({ file: layer.file, code: layer.code });
|
|
2131
|
+
logger4.info("css", pathUtil.join(...stylesDir, layer.file));
|
|
2132
|
+
}
|
|
2133
|
+
for (const recipe of artifacts.recipes) {
|
|
2134
|
+
styleFiles.push({ file: `${recipe.dir}/${recipe.file}`, code: recipe.code });
|
|
2135
|
+
logger4.info("css", pathUtil.join(...stylesDir, recipe.dir, recipe.file));
|
|
2136
|
+
}
|
|
2137
|
+
if (artifacts.recipes.length) {
|
|
2138
|
+
styleFiles.push({ file: "recipes.css", code: artifacts.recipesIndex });
|
|
2139
|
+
logger4.info("css", pathUtil.join(...stylesDir, "recipes.css"));
|
|
2140
|
+
}
|
|
2141
|
+
for (const theme of artifacts.themes) {
|
|
2142
|
+
styleFiles.push({ file: `${theme.dir}/${theme.file}`, code: theme.code });
|
|
2143
|
+
logger4.info("css", pathUtil.join(...stylesDir, theme.dir, theme.file));
|
|
2144
|
+
}
|
|
2145
|
+
await this.output.write({
|
|
2146
|
+
id: "styles",
|
|
2147
|
+
dir: stylesDir,
|
|
2148
|
+
files: styleFiles
|
|
2149
|
+
});
|
|
2150
|
+
logger4.info("css", pathUtil.join(...rootDir, "styles.css"));
|
|
2151
|
+
await this.output.write({
|
|
2152
|
+
id: "styles.css",
|
|
2153
|
+
dir: rootDir,
|
|
2154
|
+
files: [{ file: "styles.css", code: artifacts.index }]
|
|
2155
|
+
});
|
|
2156
|
+
};
|
|
2120
2157
|
watchConfig = (cb, opts) => {
|
|
2121
2158
|
const { cwd, poll, exclude } = opts ?? {};
|
|
2122
2159
|
logger4.info("ctx:watch", this.messages.configWatch());
|
|
@@ -2480,7 +2517,7 @@ var startProfiling = async (cwd, prefix, isWatching) => {
|
|
|
2480
2517
|
init_esm_shims();
|
|
2481
2518
|
import { logger as logger7 } from "@pandacss/logger";
|
|
2482
2519
|
var cssgen = async (ctx, options) => {
|
|
2483
|
-
const { outfile, type, minimal } = options;
|
|
2520
|
+
const { outfile, type, minimal, splitting } = options;
|
|
2484
2521
|
const sheet = ctx.createSheet();
|
|
2485
2522
|
if (type) {
|
|
2486
2523
|
const done = logger7.time.info(ctx.messages.cssArtifactComplete(type));
|
|
@@ -2501,7 +2538,9 @@ var cssgen = async (ctx, options) => {
|
|
|
2501
2538
|
ctx.appendBaselineCss(sheet);
|
|
2502
2539
|
}
|
|
2503
2540
|
ctx.appendParserCss(sheet);
|
|
2504
|
-
if (
|
|
2541
|
+
if (splitting) {
|
|
2542
|
+
await ctx.writeSplitCss(sheet);
|
|
2543
|
+
} else if (outfile) {
|
|
2505
2544
|
const css = ctx.getCss(sheet);
|
|
2506
2545
|
logger7.info("css", ctx.runtime.path.resolve(outfile));
|
|
2507
2546
|
await ctx.runtime.fs.writeFile(outfile, css);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pandacss/node",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.6.0",
|
|
4
4
|
"description": "The core css panda library",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.mjs",
|
|
@@ -33,10 +33,10 @@
|
|
|
33
33
|
"access": "public"
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"browserslist": "4.
|
|
36
|
+
"browserslist": "4.28.0",
|
|
37
37
|
"chokidar": "4.0.3",
|
|
38
38
|
"fast-glob": "3.3.3",
|
|
39
|
-
"fs-extra": "11.2
|
|
39
|
+
"fs-extra": "11.3.2",
|
|
40
40
|
"glob-parent": "6.0.2",
|
|
41
41
|
"is-glob": "4.0.3",
|
|
42
42
|
"lodash.merge": "4.6.2",
|
|
@@ -52,15 +52,15 @@
|
|
|
52
52
|
"ts-morph": "27.0.2",
|
|
53
53
|
"ts-pattern": "5.9.0",
|
|
54
54
|
"tsconfck": "3.1.6",
|
|
55
|
-
"@pandacss/config": "1.
|
|
56
|
-
"@pandacss/core": "1.
|
|
57
|
-
"@pandacss/generator": "1.
|
|
58
|
-
"@pandacss/reporter": "1.
|
|
59
|
-
"@pandacss/
|
|
60
|
-
"@pandacss/
|
|
61
|
-
"@pandacss/shared": "1.
|
|
62
|
-
"@pandacss/token-dictionary": "1.
|
|
63
|
-
"@pandacss/types": "1.
|
|
55
|
+
"@pandacss/config": "1.6.0",
|
|
56
|
+
"@pandacss/core": "1.6.0",
|
|
57
|
+
"@pandacss/generator": "1.6.0",
|
|
58
|
+
"@pandacss/reporter": "1.6.0",
|
|
59
|
+
"@pandacss/logger": "1.6.0",
|
|
60
|
+
"@pandacss/parser": "1.6.0",
|
|
61
|
+
"@pandacss/shared": "1.6.0",
|
|
62
|
+
"@pandacss/token-dictionary": "1.6.0",
|
|
63
|
+
"@pandacss/types": "1.6.0"
|
|
64
64
|
},
|
|
65
65
|
"devDependencies": {
|
|
66
66
|
"@types/picomatch": "4.0.2",
|