@pandacss/node 0.0.0-dev-20230201155624 → 0.0.0-dev-20230203163304
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 +22 -25
- package/dist/index.mjs +22 -25
- package/package.json +11 -11
package/dist/index.js
CHANGED
|
@@ -55,15 +55,15 @@ var import_logger2 = require("@pandacss/logger");
|
|
|
55
55
|
// src/extract.ts
|
|
56
56
|
var import_logger = require("@pandacss/logger");
|
|
57
57
|
function extractFile(ctx, file) {
|
|
58
|
-
import_logger.logger.debug(
|
|
58
|
+
import_logger.logger.debug("file:extract", file);
|
|
59
59
|
let data;
|
|
60
60
|
let result;
|
|
61
|
-
const done = import_logger.logger.time.debug(
|
|
61
|
+
const done = import_logger.logger.time.debug(`Extracted ${(0, import_logger.quote)(file)}`);
|
|
62
62
|
try {
|
|
63
63
|
const source = ctx.getSourceFile(file);
|
|
64
64
|
data = ctx.parseSourceFile(source);
|
|
65
65
|
} catch (error) {
|
|
66
|
-
import_logger.logger.error(
|
|
66
|
+
import_logger.logger.error("file:parse", error);
|
|
67
67
|
}
|
|
68
68
|
if (data) {
|
|
69
69
|
result = ctx.getCss(data, file);
|
|
@@ -119,7 +119,7 @@ async function bundleChunks(ctx) {
|
|
|
119
119
|
await ctx.write(ctx.paths.root, [{ file: "styles.css", code: css2 }]);
|
|
120
120
|
}
|
|
121
121
|
async function writeFileChunk(ctx, file) {
|
|
122
|
-
import_logger2.logger.info(`File changed: ${file}`);
|
|
122
|
+
import_logger2.logger.info("chunk:change", `File changed: ${file}`);
|
|
123
123
|
const result = extractFile(ctx, file);
|
|
124
124
|
if (result) {
|
|
125
125
|
await ctx.chunks.write(result.file, result.css);
|
|
@@ -1855,7 +1855,7 @@ function createContext(conf, io = fileSystem) {
|
|
|
1855
1855
|
prefix
|
|
1856
1856
|
});
|
|
1857
1857
|
const hasTokens = !tokens.isEmpty;
|
|
1858
|
-
import_logger4.logger.debug(
|
|
1858
|
+
import_logger4.logger.debug("ctx:token", tokens.allNames);
|
|
1859
1859
|
const utility = new import_core3.Utility({
|
|
1860
1860
|
prefix,
|
|
1861
1861
|
tokens,
|
|
@@ -1866,7 +1866,7 @@ function createContext(conf, io = fileSystem) {
|
|
|
1866
1866
|
conditions: conditionsProp,
|
|
1867
1867
|
breakpoints
|
|
1868
1868
|
});
|
|
1869
|
-
import_logger4.logger.debug(
|
|
1869
|
+
import_logger4.logger.debug("ctx:conditions", conditions);
|
|
1870
1870
|
(0, import_core3.assignCompositions)(
|
|
1871
1871
|
{ conditions, utility },
|
|
1872
1872
|
(0, import_shared4.compact)({
|
|
@@ -2013,7 +2013,7 @@ function createContext(conf, io = fileSystem) {
|
|
|
2013
2013
|
const fileName = chunks.format(file);
|
|
2014
2014
|
const oldCss = await chunks.readFile(file);
|
|
2015
2015
|
const newCss = (0, import_core3.mergeCss)(oldCss, css2);
|
|
2016
|
-
import_logger4.logger.debug(
|
|
2016
|
+
import_logger4.logger.debug("chunk:write", { file, path: fileName });
|
|
2017
2017
|
return write(paths.chunk, [{ file: fileName, code: newCss }]);
|
|
2018
2018
|
},
|
|
2019
2019
|
rm(file) {
|
|
@@ -2031,7 +2031,7 @@ function createContext(conf, io = fileSystem) {
|
|
|
2031
2031
|
return import_fast_glob.default.sync(config.include, { cwd, ignore: config.exclude, absolute: true });
|
|
2032
2032
|
}
|
|
2033
2033
|
const files = getFiles();
|
|
2034
|
-
import_logger4.logger.debug(
|
|
2034
|
+
import_logger4.logger.debug("ctx:files", files);
|
|
2035
2035
|
const tsProject = (0, import_parser.createProject)();
|
|
2036
2036
|
function addSourceFile(file) {
|
|
2037
2037
|
tsProject.createSourceFile(file, (0, import_fs3.readFileSync)(file, "utf8"), {
|
|
@@ -2173,7 +2173,7 @@ function createContext(conf, io = fileSystem) {
|
|
|
2173
2173
|
sheet.processRecipe(recipe, item.data);
|
|
2174
2174
|
}
|
|
2175
2175
|
} catch (error) {
|
|
2176
|
-
import_logger4.logger.error(
|
|
2176
|
+
import_logger4.logger.error("recipe", error);
|
|
2177
2177
|
}
|
|
2178
2178
|
});
|
|
2179
2179
|
collector.pattern.forEach((result, name) => {
|
|
@@ -2183,7 +2183,7 @@ function createContext(conf, io = fileSystem) {
|
|
|
2183
2183
|
sheet.processAtomic(styles);
|
|
2184
2184
|
}
|
|
2185
2185
|
} catch (error) {
|
|
2186
|
-
import_logger4.logger.error(
|
|
2186
|
+
import_logger4.logger.error("pattern", error);
|
|
2187
2187
|
}
|
|
2188
2188
|
});
|
|
2189
2189
|
if (collector.isEmpty) {
|
|
@@ -2424,7 +2424,7 @@ async function execCommand(cmd, cwd) {
|
|
|
2424
2424
|
}
|
|
2425
2425
|
const check = (0, import_child_process.spawnSync)(pm, args, { cwd, stdio: "pipe" });
|
|
2426
2426
|
if (check.status !== 0) {
|
|
2427
|
-
import_logger6.logger.error(check.stderr.toString());
|
|
2427
|
+
import_logger6.logger.error("exec", check.stderr.toString());
|
|
2428
2428
|
}
|
|
2429
2429
|
}
|
|
2430
2430
|
|
|
@@ -2446,10 +2446,7 @@ function createWatcher(files, options = {}) {
|
|
|
2446
2446
|
ignored: ignore,
|
|
2447
2447
|
awaitWriteFinish: coalesce ? { stabilityThreshold: 50, pollInterval: 10 } : false
|
|
2448
2448
|
});
|
|
2449
|
-
import_logger7.logger.debug({
|
|
2450
|
-
type: "file:watcher",
|
|
2451
|
-
msg: `watching [${files}]`
|
|
2452
|
-
});
|
|
2449
|
+
import_logger7.logger.debug("watch:file", `watching [${files}]`);
|
|
2453
2450
|
process.once("SIGINT", async () => {
|
|
2454
2451
|
await watcher.close();
|
|
2455
2452
|
});
|
|
@@ -2465,7 +2462,7 @@ async function createContentWatcher(ctx, callback) {
|
|
|
2465
2462
|
ignore: exclude
|
|
2466
2463
|
});
|
|
2467
2464
|
watcher.on("all", async (event, file) => {
|
|
2468
|
-
import_logger7.logger.debug(
|
|
2465
|
+
import_logger7.logger.debug(`file:${event}`, file);
|
|
2469
2466
|
(0, import_ts_pattern6.match)(event).with("unlink", () => {
|
|
2470
2467
|
ctx.removeSourceFile(file);
|
|
2471
2468
|
ctx.chunks.rm(file);
|
|
@@ -2485,21 +2482,21 @@ async function watch(ctx, options) {
|
|
|
2485
2482
|
await createContentWatcher(ctx, options.onContentChange);
|
|
2486
2483
|
const configWatcher = await createConfigWatcher(ctx.conf);
|
|
2487
2484
|
configWatcher.on("change", async () => {
|
|
2488
|
-
import_logger7.logger.info("Config changed, restarting...");
|
|
2485
|
+
import_logger7.logger.info("watch:config", "Config changed, restarting...");
|
|
2489
2486
|
await options.onConfigChange();
|
|
2490
2487
|
});
|
|
2491
2488
|
}
|
|
2492
2489
|
process.on("unhandledRejection", (reason) => {
|
|
2493
|
-
import_logger7.logger.error(
|
|
2490
|
+
import_logger7.logger.error("watch:unhandledRejection", reason);
|
|
2494
2491
|
});
|
|
2495
|
-
process.on("uncaughtException", (
|
|
2496
|
-
import_logger7.logger.error(
|
|
2492
|
+
process.on("uncaughtException", (reason) => {
|
|
2493
|
+
import_logger7.logger.error("watch:uncaughtException", reason);
|
|
2497
2494
|
});
|
|
2498
2495
|
|
|
2499
2496
|
// src/generate.ts
|
|
2500
2497
|
async function build(ctx) {
|
|
2501
2498
|
const msg = await emitAndExtract(ctx);
|
|
2502
|
-
import_logger8.logger.info(msg);
|
|
2499
|
+
import_logger8.logger.info("css:emit", msg);
|
|
2503
2500
|
}
|
|
2504
2501
|
var loadContext = async (config, configPath) => {
|
|
2505
2502
|
const ctxRef = { current: void 0 };
|
|
@@ -2525,7 +2522,7 @@ async function generate5(config, configPath) {
|
|
|
2525
2522
|
return bundleChunks(ctxRef.current);
|
|
2526
2523
|
}
|
|
2527
2524
|
});
|
|
2528
|
-
import_logger8.logger.info(watchMessage());
|
|
2525
|
+
import_logger8.logger.info("ctx:watch", watchMessage());
|
|
2529
2526
|
}
|
|
2530
2527
|
}
|
|
2531
2528
|
|
|
@@ -2562,9 +2559,9 @@ async function setupConfig(cwd, { force }) {
|
|
|
2562
2559
|
const cmd = pm === "npm" ? "npm run" : pm;
|
|
2563
2560
|
const isTs = (0, import_look_it_up3.lookItUpSync)("tsconfig.json", cwd);
|
|
2564
2561
|
const file = isTs ? "panda.config.ts" : "panda.config.mjs";
|
|
2565
|
-
import_logger9.logger.info(
|
|
2562
|
+
import_logger9.logger.info("init:config", `creating panda config file: ${(0, import_logger9.quote)(file)}`);
|
|
2566
2563
|
if (!force && configFile) {
|
|
2567
|
-
import_logger9.logger.warn("config
|
|
2564
|
+
import_logger9.logger.warn("init:config", configExistsMessage(cmd));
|
|
2568
2565
|
} else {
|
|
2569
2566
|
const content = import_outdent26.outdent`
|
|
2570
2567
|
import { defineConfig } from "css-panda"
|
|
@@ -2591,7 +2588,7 @@ async function setupConfig(cwd, { force }) {
|
|
|
2591
2588
|
}
|
|
2592
2589
|
}
|
|
2593
2590
|
async function setupPostcss(cwd) {
|
|
2594
|
-
import_logger9.logger.info(
|
|
2591
|
+
import_logger9.logger.info("init:postcss", `creating postcss config file: ${(0, import_logger9.quote)("postcss.config.cjs")}`);
|
|
2595
2592
|
const content = import_outdent26.outdent`
|
|
2596
2593
|
module.exports = {
|
|
2597
2594
|
plugins: {
|
package/dist/index.mjs
CHANGED
|
@@ -8,15 +8,15 @@ import { logger as logger2 } from "@pandacss/logger";
|
|
|
8
8
|
// src/extract.ts
|
|
9
9
|
import { logger, quote } from "@pandacss/logger";
|
|
10
10
|
function extractFile(ctx, file) {
|
|
11
|
-
logger.debug(
|
|
11
|
+
logger.debug("file:extract", file);
|
|
12
12
|
let data;
|
|
13
13
|
let result;
|
|
14
|
-
const done = logger.time.debug(
|
|
14
|
+
const done = logger.time.debug(`Extracted ${quote(file)}`);
|
|
15
15
|
try {
|
|
16
16
|
const source = ctx.getSourceFile(file);
|
|
17
17
|
data = ctx.parseSourceFile(source);
|
|
18
18
|
} catch (error) {
|
|
19
|
-
logger.error(
|
|
19
|
+
logger.error("file:parse", error);
|
|
20
20
|
}
|
|
21
21
|
if (data) {
|
|
22
22
|
result = ctx.getCss(data, file);
|
|
@@ -72,7 +72,7 @@ async function bundleChunks(ctx) {
|
|
|
72
72
|
await ctx.write(ctx.paths.root, [{ file: "styles.css", code: css2 }]);
|
|
73
73
|
}
|
|
74
74
|
async function writeFileChunk(ctx, file) {
|
|
75
|
-
logger2.info(`File changed: ${file}`);
|
|
75
|
+
logger2.info("chunk:change", `File changed: ${file}`);
|
|
76
76
|
const result = extractFile(ctx, file);
|
|
77
77
|
if (result) {
|
|
78
78
|
await ctx.chunks.write(result.file, result.css);
|
|
@@ -1815,7 +1815,7 @@ function createContext(conf, io = fileSystem) {
|
|
|
1815
1815
|
prefix
|
|
1816
1816
|
});
|
|
1817
1817
|
const hasTokens = !tokens.isEmpty;
|
|
1818
|
-
logger4.debug(
|
|
1818
|
+
logger4.debug("ctx:token", tokens.allNames);
|
|
1819
1819
|
const utility = new Utility({
|
|
1820
1820
|
prefix,
|
|
1821
1821
|
tokens,
|
|
@@ -1826,7 +1826,7 @@ function createContext(conf, io = fileSystem) {
|
|
|
1826
1826
|
conditions: conditionsProp,
|
|
1827
1827
|
breakpoints
|
|
1828
1828
|
});
|
|
1829
|
-
logger4.debug(
|
|
1829
|
+
logger4.debug("ctx:conditions", conditions);
|
|
1830
1830
|
assignCompositions(
|
|
1831
1831
|
{ conditions, utility },
|
|
1832
1832
|
compact({
|
|
@@ -1973,7 +1973,7 @@ function createContext(conf, io = fileSystem) {
|
|
|
1973
1973
|
const fileName = chunks.format(file);
|
|
1974
1974
|
const oldCss = await chunks.readFile(file);
|
|
1975
1975
|
const newCss = mergeCss(oldCss, css2);
|
|
1976
|
-
logger4.debug(
|
|
1976
|
+
logger4.debug("chunk:write", { file, path: fileName });
|
|
1977
1977
|
return write(paths.chunk, [{ file: fileName, code: newCss }]);
|
|
1978
1978
|
},
|
|
1979
1979
|
rm(file) {
|
|
@@ -1991,7 +1991,7 @@ function createContext(conf, io = fileSystem) {
|
|
|
1991
1991
|
return glob.sync(config.include, { cwd, ignore: config.exclude, absolute: true });
|
|
1992
1992
|
}
|
|
1993
1993
|
const files = getFiles();
|
|
1994
|
-
logger4.debug(
|
|
1994
|
+
logger4.debug("ctx:files", files);
|
|
1995
1995
|
const tsProject = createProject();
|
|
1996
1996
|
function addSourceFile(file) {
|
|
1997
1997
|
tsProject.createSourceFile(file, readFileSync4(file, "utf8"), {
|
|
@@ -2133,7 +2133,7 @@ function createContext(conf, io = fileSystem) {
|
|
|
2133
2133
|
sheet.processRecipe(recipe, item.data);
|
|
2134
2134
|
}
|
|
2135
2135
|
} catch (error) {
|
|
2136
|
-
logger4.error(
|
|
2136
|
+
logger4.error("recipe", error);
|
|
2137
2137
|
}
|
|
2138
2138
|
});
|
|
2139
2139
|
collector.pattern.forEach((result, name) => {
|
|
@@ -2143,7 +2143,7 @@ function createContext(conf, io = fileSystem) {
|
|
|
2143
2143
|
sheet.processAtomic(styles);
|
|
2144
2144
|
}
|
|
2145
2145
|
} catch (error) {
|
|
2146
|
-
logger4.error(
|
|
2146
|
+
logger4.error("pattern", error);
|
|
2147
2147
|
}
|
|
2148
2148
|
});
|
|
2149
2149
|
if (collector.isEmpty) {
|
|
@@ -2384,7 +2384,7 @@ async function execCommand(cmd, cwd) {
|
|
|
2384
2384
|
}
|
|
2385
2385
|
const check = spawnSync(pm, args, { cwd, stdio: "pipe" });
|
|
2386
2386
|
if (check.status !== 0) {
|
|
2387
|
-
logger6.error(check.stderr.toString());
|
|
2387
|
+
logger6.error("exec", check.stderr.toString());
|
|
2388
2388
|
}
|
|
2389
2389
|
}
|
|
2390
2390
|
|
|
@@ -2406,10 +2406,7 @@ function createWatcher(files, options = {}) {
|
|
|
2406
2406
|
ignored: ignore,
|
|
2407
2407
|
awaitWriteFinish: coalesce ? { stabilityThreshold: 50, pollInterval: 10 } : false
|
|
2408
2408
|
});
|
|
2409
|
-
logger7.debug({
|
|
2410
|
-
type: "file:watcher",
|
|
2411
|
-
msg: `watching [${files}]`
|
|
2412
|
-
});
|
|
2409
|
+
logger7.debug("watch:file", `watching [${files}]`);
|
|
2413
2410
|
process.once("SIGINT", async () => {
|
|
2414
2411
|
await watcher.close();
|
|
2415
2412
|
});
|
|
@@ -2425,7 +2422,7 @@ async function createContentWatcher(ctx, callback) {
|
|
|
2425
2422
|
ignore: exclude
|
|
2426
2423
|
});
|
|
2427
2424
|
watcher.on("all", async (event, file) => {
|
|
2428
|
-
logger7.debug(
|
|
2425
|
+
logger7.debug(`file:${event}`, file);
|
|
2429
2426
|
match6(event).with("unlink", () => {
|
|
2430
2427
|
ctx.removeSourceFile(file);
|
|
2431
2428
|
ctx.chunks.rm(file);
|
|
@@ -2445,21 +2442,21 @@ async function watch(ctx, options) {
|
|
|
2445
2442
|
await createContentWatcher(ctx, options.onContentChange);
|
|
2446
2443
|
const configWatcher = await createConfigWatcher(ctx.conf);
|
|
2447
2444
|
configWatcher.on("change", async () => {
|
|
2448
|
-
logger7.info("Config changed, restarting...");
|
|
2445
|
+
logger7.info("watch:config", "Config changed, restarting...");
|
|
2449
2446
|
await options.onConfigChange();
|
|
2450
2447
|
});
|
|
2451
2448
|
}
|
|
2452
2449
|
process.on("unhandledRejection", (reason) => {
|
|
2453
|
-
logger7.error(
|
|
2450
|
+
logger7.error("watch:unhandledRejection", reason);
|
|
2454
2451
|
});
|
|
2455
|
-
process.on("uncaughtException", (
|
|
2456
|
-
logger7.error(
|
|
2452
|
+
process.on("uncaughtException", (reason) => {
|
|
2453
|
+
logger7.error("watch:uncaughtException", reason);
|
|
2457
2454
|
});
|
|
2458
2455
|
|
|
2459
2456
|
// src/generate.ts
|
|
2460
2457
|
async function build(ctx) {
|
|
2461
2458
|
const msg = await emitAndExtract(ctx);
|
|
2462
|
-
logger8.info(msg);
|
|
2459
|
+
logger8.info("css:emit", msg);
|
|
2463
2460
|
}
|
|
2464
2461
|
var loadContext = async (config, configPath) => {
|
|
2465
2462
|
const ctxRef = { current: void 0 };
|
|
@@ -2485,7 +2482,7 @@ async function generate5(config, configPath) {
|
|
|
2485
2482
|
return bundleChunks(ctxRef.current);
|
|
2486
2483
|
}
|
|
2487
2484
|
});
|
|
2488
|
-
logger8.info(watchMessage());
|
|
2485
|
+
logger8.info("ctx:watch", watchMessage());
|
|
2489
2486
|
}
|
|
2490
2487
|
}
|
|
2491
2488
|
|
|
@@ -2522,9 +2519,9 @@ async function setupConfig(cwd, { force }) {
|
|
|
2522
2519
|
const cmd = pm === "npm" ? "npm run" : pm;
|
|
2523
2520
|
const isTs = lookItUpSync3("tsconfig.json", cwd);
|
|
2524
2521
|
const file = isTs ? "panda.config.ts" : "panda.config.mjs";
|
|
2525
|
-
logger9.info(
|
|
2522
|
+
logger9.info("init:config", `creating panda config file: ${quote3(file)}`);
|
|
2526
2523
|
if (!force && configFile) {
|
|
2527
|
-
logger9.warn("config
|
|
2524
|
+
logger9.warn("init:config", configExistsMessage(cmd));
|
|
2528
2525
|
} else {
|
|
2529
2526
|
const content = outdent26`
|
|
2530
2527
|
import { defineConfig } from "css-panda"
|
|
@@ -2551,7 +2548,7 @@ async function setupConfig(cwd, { force }) {
|
|
|
2551
2548
|
}
|
|
2552
2549
|
}
|
|
2553
2550
|
async function setupPostcss(cwd) {
|
|
2554
|
-
logger9.info(
|
|
2551
|
+
logger9.info("init:postcss", `creating postcss config file: ${quote3("postcss.config.cjs")}`);
|
|
2555
2552
|
const content = outdent26`
|
|
2556
2553
|
module.exports = {
|
|
2557
2554
|
plugins: {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pandacss/node",
|
|
3
|
-
"version": "0.0.0-dev-
|
|
3
|
+
"version": "0.0.0-dev-20230203163304",
|
|
4
4
|
"description": "The core css panda library",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.mjs",
|
|
@@ -30,15 +30,15 @@
|
|
|
30
30
|
"javascript-stringify": "2.1.0",
|
|
31
31
|
"ts-pattern": "4.1.3",
|
|
32
32
|
"ts-morph": "17.0.1",
|
|
33
|
-
"@pandacss/types": "0.0.0-dev-
|
|
34
|
-
"@pandacss/is-valid-prop": "0.0.0-dev-
|
|
35
|
-
"@pandacss/error": "0.0.0-dev-
|
|
36
|
-
"@pandacss/parser": "0.0.0-dev-
|
|
37
|
-
"@pandacss/shared": "0.0.0-dev-
|
|
38
|
-
"@pandacss/token-dictionary": "0.0.0-dev-
|
|
39
|
-
"@pandacss/logger": "0.0.0-dev-
|
|
40
|
-
"@pandacss/core": "0.0.0-dev-
|
|
41
|
-
"@pandacss/config": "0.0.0-dev-
|
|
33
|
+
"@pandacss/types": "0.0.0-dev-20230203163304",
|
|
34
|
+
"@pandacss/is-valid-prop": "0.0.0-dev-20230203163304",
|
|
35
|
+
"@pandacss/error": "0.0.0-dev-20230203163304",
|
|
36
|
+
"@pandacss/parser": "0.0.0-dev-20230203163304",
|
|
37
|
+
"@pandacss/shared": "0.0.0-dev-20230203163304",
|
|
38
|
+
"@pandacss/token-dictionary": "0.0.0-dev-20230203163304",
|
|
39
|
+
"@pandacss/logger": "0.0.0-dev-20230203163304",
|
|
40
|
+
"@pandacss/core": "0.0.0-dev-20230203163304",
|
|
41
|
+
"@pandacss/config": "0.0.0-dev-20230203163304"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
44
44
|
"@types/fs-extra": "11.0.1",
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
"@types/glob-parent": "^5.1.1",
|
|
47
47
|
"@types/pluralize": "0.0.29",
|
|
48
48
|
"@types/lodash.merge": "4.6.7",
|
|
49
|
-
"@pandacss/fixture": "0.0.0-dev-
|
|
49
|
+
"@pandacss/fixture": "0.0.0-dev-20230203163304"
|
|
50
50
|
},
|
|
51
51
|
"scripts": {
|
|
52
52
|
"build": "tsup src/index.ts --format=cjs,esm --shims --dts",
|