@pandacss/node 0.54.0 → 1.0.1
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 +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +24 -43
- package/dist/index.mjs +46 -63
- package/package.json +15 -15
package/dist/index.d.mts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as _pandacss_reporter from '@pandacss/reporter';
|
|
2
2
|
import { ReportFormat } from '@pandacss/reporter';
|
|
3
3
|
import * as _pandacss_types from '@pandacss/types';
|
|
4
|
-
import { LoadConfigResult,
|
|
4
|
+
import { LoadConfigResult, Runtime, PandaHooks, Artifact, WatchOptions, WatcherEventType, AnalysisOptions, ArtifactId, Config, CssArtifactType } from '@pandacss/types';
|
|
5
5
|
import { StyleEncoder, Stylesheet } from '@pandacss/core';
|
|
6
6
|
import { Generator } from '@pandacss/generator';
|
|
7
7
|
import * as _pandacss_parser from '@pandacss/parser';
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as _pandacss_reporter from '@pandacss/reporter';
|
|
2
2
|
import { ReportFormat } from '@pandacss/reporter';
|
|
3
3
|
import * as _pandacss_types from '@pandacss/types';
|
|
4
|
-
import { LoadConfigResult,
|
|
4
|
+
import { LoadConfigResult, Runtime, PandaHooks, Artifact, WatchOptions, WatcherEventType, AnalysisOptions, ArtifactId, Config, CssArtifactType } from '@pandacss/types';
|
|
5
5
|
import { StyleEncoder, Stylesheet } from '@pandacss/core';
|
|
6
6
|
import { Generator } from '@pandacss/generator';
|
|
7
7
|
import * as _pandacss_parser from '@pandacss/parser';
|
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.
|
|
36
|
+
// ../../node_modules/.pnpm/tsup@8.5.0_@swc+core@1.13.3_jiti@2.4.2_postcss@8.5.6_tsx@4.20.3_typescript@5.8.3_yaml@2.7.0/node_modules/tsup/assets/cjs_shims.js
|
|
37
37
|
var init_cjs_shims = __esm({
|
|
38
|
-
"../../node_modules/.pnpm/tsup@8.
|
|
38
|
+
"../../node_modules/.pnpm/tsup@8.5.0_@swc+core@1.13.3_jiti@2.4.2_postcss@8.5.6_tsx@4.20.3_typescript@5.8.3_yaml@2.7.0/node_modules/tsup/assets/cjs_shims.js"() {
|
|
39
39
|
"use strict";
|
|
40
40
|
}
|
|
41
41
|
});
|
|
@@ -352,12 +352,10 @@ var require_ansi_align = __commonJS({
|
|
|
352
352
|
init_cjs_shims();
|
|
353
353
|
var stringWidth2 = require_string_width();
|
|
354
354
|
function ansiAlign2(text, opts) {
|
|
355
|
-
if (!text)
|
|
356
|
-
return text;
|
|
355
|
+
if (!text) return text;
|
|
357
356
|
opts = opts || {};
|
|
358
357
|
const align = opts.align || "center";
|
|
359
|
-
if (align === "left")
|
|
360
|
-
return text;
|
|
358
|
+
if (align === "left") return text;
|
|
361
359
|
const split = opts.split || "\n";
|
|
362
360
|
const pad = opts.pad || " ";
|
|
363
361
|
const widthDiffFn = align !== "right" ? halfDiff : fullDiff;
|
|
@@ -401,8 +399,8 @@ var require_ansi_align = __commonJS({
|
|
|
401
399
|
});
|
|
402
400
|
|
|
403
401
|
// src/index.ts
|
|
404
|
-
var
|
|
405
|
-
__export(
|
|
402
|
+
var index_exports = {};
|
|
403
|
+
__export(index_exports, {
|
|
406
404
|
Builder: () => Builder,
|
|
407
405
|
PandaContext: () => PandaContext,
|
|
408
406
|
analyze: () => analyze,
|
|
@@ -419,7 +417,7 @@ __export(src_exports, {
|
|
|
419
417
|
setupPostcss: () => setupPostcss,
|
|
420
418
|
startProfiling: () => startProfiling
|
|
421
419
|
});
|
|
422
|
-
module.exports = __toCommonJS(
|
|
420
|
+
module.exports = __toCommonJS(index_exports);
|
|
423
421
|
init_cjs_shims();
|
|
424
422
|
|
|
425
423
|
// src/analyze.ts
|
|
@@ -451,10 +449,8 @@ function analyze(ctx, options = {}) {
|
|
|
451
449
|
};
|
|
452
450
|
}
|
|
453
451
|
function replacer(_, value) {
|
|
454
|
-
if (value instanceof Set)
|
|
455
|
-
|
|
456
|
-
if (value instanceof Map)
|
|
457
|
-
return Object.fromEntries(value);
|
|
452
|
+
if (value instanceof Set) return Array.from(value);
|
|
453
|
+
if (value instanceof Map) return Object.fromEntries(value);
|
|
458
454
|
return value;
|
|
459
455
|
}
|
|
460
456
|
|
|
@@ -607,13 +603,11 @@ function pLimit(concurrency) {
|
|
|
607
603
|
// src/codegen.ts
|
|
608
604
|
var limit = pLimit(20);
|
|
609
605
|
async function codegen(ctx, ids) {
|
|
610
|
-
if (ctx.config.clean)
|
|
611
|
-
ctx.output.empty();
|
|
606
|
+
if (ctx.config.clean) ctx.output.empty();
|
|
612
607
|
let artifacts = ctx.getArtifacts(ids);
|
|
613
608
|
if (ctx.hooks["codegen:prepare"]) {
|
|
614
609
|
const results = await ctx.hooks["codegen:prepare"]?.({ changed: ids, artifacts });
|
|
615
|
-
if (results)
|
|
616
|
-
artifacts = results;
|
|
610
|
+
if (results) artifacts = results;
|
|
617
611
|
}
|
|
618
612
|
const promises = artifacts.map((artifact) => limit(() => ctx.output.write(artifact)));
|
|
619
613
|
await Promise.allSettled(promises);
|
|
@@ -1975,8 +1969,7 @@ var DiffEngine = class {
|
|
|
1975
1969
|
*/
|
|
1976
1970
|
refresh(conf, fn) {
|
|
1977
1971
|
const affected = (0, import_config.diffConfigs)(() => conf.deserialize(), this.prevConfig);
|
|
1978
|
-
if (!affected.hasConfigChanged || !this.prevConfig)
|
|
1979
|
-
return affected;
|
|
1972
|
+
if (!affected.hasConfigChanged || !this.prevConfig) return affected;
|
|
1980
1973
|
fn?.(conf);
|
|
1981
1974
|
this.prevConfig = conf.deserialize();
|
|
1982
1975
|
return affected;
|
|
@@ -2041,8 +2034,7 @@ var nodeRuntime = {
|
|
|
2041
2034
|
return import_fs_extra.default.readFileSync(filePath, "utf8");
|
|
2042
2035
|
},
|
|
2043
2036
|
glob(opts) {
|
|
2044
|
-
if (!opts.include)
|
|
2045
|
-
return [];
|
|
2037
|
+
if (!opts.include) return [];
|
|
2046
2038
|
const ignore = opts.exclude ?? [];
|
|
2047
2039
|
if (!ignore.length) {
|
|
2048
2040
|
ignore.push("**/*.d.ts");
|
|
@@ -2113,14 +2105,12 @@ var OutputEngine = class {
|
|
|
2113
2105
|
return outPath;
|
|
2114
2106
|
};
|
|
2115
2107
|
write = (output) => {
|
|
2116
|
-
if (!output)
|
|
2117
|
-
return;
|
|
2108
|
+
if (!output) return;
|
|
2118
2109
|
const { dir = this.paths.root, files } = output;
|
|
2119
2110
|
this.fs.ensureDirSync(this.path.join(...dir));
|
|
2120
2111
|
return Promise.allSettled(
|
|
2121
2112
|
files.map(async (artifact) => {
|
|
2122
|
-
if (!artifact?.code)
|
|
2123
|
-
return;
|
|
2113
|
+
if (!artifact?.code) return;
|
|
2124
2114
|
const { file, code } = artifact;
|
|
2125
2115
|
const absPath = this.path.join(...dir, file);
|
|
2126
2116
|
import_logger3.logger.debug("write:file", dir.slice(-1).concat(file).join("/"));
|
|
@@ -2161,8 +2151,7 @@ var PandaContext = class extends import_generator2.Generator {
|
|
|
2161
2151
|
}
|
|
2162
2152
|
getExplicitDependencies = () => {
|
|
2163
2153
|
const { cwd, dependencies } = this.config;
|
|
2164
|
-
if (!dependencies)
|
|
2165
|
-
return [];
|
|
2154
|
+
if (!dependencies) return [];
|
|
2166
2155
|
return this.runtime.fs.glob({ include: dependencies, cwd });
|
|
2167
2156
|
};
|
|
2168
2157
|
initMessage = () => {
|
|
@@ -2198,8 +2187,7 @@ var PandaContext = class extends import_generator2.Generator {
|
|
|
2198
2187
|
const measure = import_logger4.logger.time.debug(`Parsed ${file}`);
|
|
2199
2188
|
const result = this.project.parseSourceFile(file, encoder);
|
|
2200
2189
|
measure();
|
|
2201
|
-
if (!result || result.isEmpty() || encoder.isEmpty())
|
|
2202
|
-
return;
|
|
2190
|
+
if (!result || result.isEmpty() || encoder.isEmpty()) return;
|
|
2203
2191
|
filesWithCss.push(file);
|
|
2204
2192
|
results.push(result);
|
|
2205
2193
|
});
|
|
@@ -2264,8 +2252,7 @@ async function loadTsConfig(conf, cwd) {
|
|
|
2264
2252
|
//@ts-ignore
|
|
2265
2253
|
resolveWithEmptyIfConfigNotFound: true
|
|
2266
2254
|
});
|
|
2267
|
-
if (!tsconfigResult)
|
|
2268
|
-
return;
|
|
2255
|
+
if (!tsconfigResult) return;
|
|
2269
2256
|
const { tsconfig, tsconfigFile } = tsconfigResult;
|
|
2270
2257
|
const { compilerOptions } = tsconfig;
|
|
2271
2258
|
const result = {
|
|
@@ -2448,8 +2435,7 @@ var Builder = class {
|
|
|
2448
2435
|
extractFile = (ctx, file) => {
|
|
2449
2436
|
const meta = this.filesMeta?.changes.get(file) ?? this.getFileMeta(file);
|
|
2450
2437
|
const hasConfigChanged = this.affecteds ? this.affecteds.hasConfigChanged : true;
|
|
2451
|
-
if (meta.isUnchanged && !hasConfigChanged)
|
|
2452
|
-
return;
|
|
2438
|
+
if (meta.isUnchanged && !hasConfigChanged) return;
|
|
2453
2439
|
const parserResult = ctx.parseFile(file);
|
|
2454
2440
|
fileModifiedMap.set(file, meta.mtime);
|
|
2455
2441
|
return parserResult;
|
|
@@ -2493,8 +2479,7 @@ var Builder = class {
|
|
|
2493
2479
|
const ctx = this.getContextOrThrow();
|
|
2494
2480
|
for (const fileOrGlob of ctx.config.include) {
|
|
2495
2481
|
const dependency = parseDependency(fileOrGlob);
|
|
2496
|
-
if (dependency)
|
|
2497
|
-
fn(dependency);
|
|
2482
|
+
if (dependency) fn(dependency);
|
|
2498
2483
|
}
|
|
2499
2484
|
for (const file of this.configDependencies) {
|
|
2500
2485
|
fn({ type: "dependency", file: (0, import_path4.normalize)((0, import_path4.resolve)(file)) });
|
|
@@ -2539,8 +2524,7 @@ var startProfiling = async (cwd, prefix, isWatching) => {
|
|
|
2539
2524
|
};
|
|
2540
2525
|
if (isWatching) {
|
|
2541
2526
|
import_node_readline.default.emitKeypressEvents(process.stdin);
|
|
2542
|
-
if (process.stdin.isTTY)
|
|
2543
|
-
process.stdin.setRawMode(true);
|
|
2527
|
+
if (process.stdin.isTTY) process.stdin.setRawMode(true);
|
|
2544
2528
|
console.log("Press 'p' to stop profiling...");
|
|
2545
2529
|
process.stdin.on("keypress", (str, key) => {
|
|
2546
2530
|
if (key.name === "p") {
|
|
@@ -2641,12 +2625,10 @@ async function debug(ctx, options) {
|
|
|
2641
2625
|
const encoder = ctx.encoder.clone();
|
|
2642
2626
|
const result = ctx.project.parseSourceFile(file, encoder);
|
|
2643
2627
|
measure();
|
|
2644
|
-
if (!result || result.isEmpty() || encoder.isEmpty())
|
|
2645
|
-
return;
|
|
2628
|
+
if (!result || result.isEmpty() || encoder.isEmpty()) return;
|
|
2646
2629
|
const styles4 = ctx.decoder.clone().collect(encoder);
|
|
2647
2630
|
const css = ctx.getParserCss(styles4);
|
|
2648
|
-
if (!css)
|
|
2649
|
-
return;
|
|
2631
|
+
if (!css) return;
|
|
2650
2632
|
if (options.dry) {
|
|
2651
2633
|
console.log({ path: file, ast: result, code: css });
|
|
2652
2634
|
return;
|
|
@@ -2738,8 +2720,7 @@ var import_look_it_up = require("look-it-up");
|
|
|
2738
2720
|
var import_outdent = __toESM(require("outdent"));
|
|
2739
2721
|
function setupGitIgnore(ctx) {
|
|
2740
2722
|
const { outdir, gitignore } = ctx.config;
|
|
2741
|
-
if (!gitignore)
|
|
2742
|
-
return;
|
|
2723
|
+
if (!gitignore) return;
|
|
2743
2724
|
const txt = import_outdent.default`
|
|
2744
2725
|
|
|
2745
2726
|
## Panda
|
package/dist/index.mjs
CHANGED
|
@@ -27,9 +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.
|
|
30
|
+
// ../../node_modules/.pnpm/tsup@8.5.0_@swc+core@1.13.3_jiti@2.4.2_postcss@8.5.6_tsx@4.20.3_typescript@5.8.3_yaml@2.7.0/node_modules/tsup/assets/esm_shims.js
|
|
31
|
+
import path from "path";
|
|
32
|
+
import { fileURLToPath } from "url";
|
|
31
33
|
var init_esm_shims = __esm({
|
|
32
|
-
"../../node_modules/.pnpm/tsup@8.
|
|
34
|
+
"../../node_modules/.pnpm/tsup@8.5.0_@swc+core@1.13.3_jiti@2.4.2_postcss@8.5.6_tsx@4.20.3_typescript@5.8.3_yaml@2.7.0/node_modules/tsup/assets/esm_shims.js"() {
|
|
33
35
|
"use strict";
|
|
34
36
|
}
|
|
35
37
|
});
|
|
@@ -346,12 +348,10 @@ var require_ansi_align = __commonJS({
|
|
|
346
348
|
init_esm_shims();
|
|
347
349
|
var stringWidth2 = require_string_width();
|
|
348
350
|
function ansiAlign2(text, opts) {
|
|
349
|
-
if (!text)
|
|
350
|
-
return text;
|
|
351
|
+
if (!text) return text;
|
|
351
352
|
opts = opts || {};
|
|
352
353
|
const align = opts.align || "center";
|
|
353
|
-
if (align === "left")
|
|
354
|
-
return text;
|
|
354
|
+
if (align === "left") return text;
|
|
355
355
|
const split = opts.split || "\n";
|
|
356
356
|
const pad = opts.pad || " ";
|
|
357
357
|
const widthDiffFn = align !== "right" ? halfDiff : fullDiff;
|
|
@@ -426,10 +426,8 @@ function analyze(ctx, options = {}) {
|
|
|
426
426
|
};
|
|
427
427
|
}
|
|
428
428
|
function replacer(_, value) {
|
|
429
|
-
if (value instanceof Set)
|
|
430
|
-
|
|
431
|
-
if (value instanceof Map)
|
|
432
|
-
return Object.fromEntries(value);
|
|
429
|
+
if (value instanceof Set) return Array.from(value);
|
|
430
|
+
if (value instanceof Map) return Object.fromEntries(value);
|
|
433
431
|
return value;
|
|
434
432
|
}
|
|
435
433
|
|
|
@@ -582,13 +580,11 @@ function pLimit(concurrency) {
|
|
|
582
580
|
// src/codegen.ts
|
|
583
581
|
var limit = pLimit(20);
|
|
584
582
|
async function codegen(ctx, ids) {
|
|
585
|
-
if (ctx.config.clean)
|
|
586
|
-
ctx.output.empty();
|
|
583
|
+
if (ctx.config.clean) ctx.output.empty();
|
|
587
584
|
let artifacts = ctx.getArtifacts(ids);
|
|
588
585
|
if (ctx.hooks["codegen:prepare"]) {
|
|
589
586
|
const results = await ctx.hooks["codegen:prepare"]?.({ changed: ids, artifacts });
|
|
590
|
-
if (results)
|
|
591
|
-
artifacts = results;
|
|
587
|
+
if (results) artifacts = results;
|
|
592
588
|
}
|
|
593
589
|
const promises = artifacts.map((artifact) => limit(() => ctx.output.write(artifact)));
|
|
594
590
|
await Promise.allSettled(promises);
|
|
@@ -617,7 +613,7 @@ init_esm_shims();
|
|
|
617
613
|
|
|
618
614
|
// ../../node_modules/.pnpm/boxen@7.1.1/node_modules/boxen/index.js
|
|
619
615
|
init_esm_shims();
|
|
620
|
-
import process3 from "
|
|
616
|
+
import process3 from "process";
|
|
621
617
|
|
|
622
618
|
// ../../node_modules/.pnpm/string-width@5.1.2/node_modules/string-width/index.js
|
|
623
619
|
init_esm_shims();
|
|
@@ -878,9 +874,9 @@ var ansi_styles_default = ansiStyles;
|
|
|
878
874
|
|
|
879
875
|
// ../../node_modules/.pnpm/chalk@5.3.0/node_modules/chalk/source/vendor/supports-color/index.js
|
|
880
876
|
init_esm_shims();
|
|
881
|
-
import process2 from "
|
|
882
|
-
import os from "
|
|
883
|
-
import tty from "
|
|
877
|
+
import process2 from "process";
|
|
878
|
+
import os from "os";
|
|
879
|
+
import tty from "tty";
|
|
884
880
|
function hasFlag(flag, argv = globalThis.Deno ? globalThis.Deno.args : process2.argv) {
|
|
885
881
|
const prefix = flag.startsWith("-") ? "" : flag.length === 1 ? "-" : "--";
|
|
886
882
|
const position = argv.indexOf(prefix + flag);
|
|
@@ -1950,8 +1946,7 @@ var DiffEngine = class {
|
|
|
1950
1946
|
*/
|
|
1951
1947
|
refresh(conf, fn) {
|
|
1952
1948
|
const affected = diffConfigs(() => conf.deserialize(), this.prevConfig);
|
|
1953
|
-
if (!affected.hasConfigChanged || !this.prevConfig)
|
|
1954
|
-
return affected;
|
|
1949
|
+
if (!affected.hasConfigChanged || !this.prevConfig) return affected;
|
|
1955
1950
|
fn?.(conf);
|
|
1956
1951
|
this.prevConfig = conf.deserialize();
|
|
1957
1952
|
return affected;
|
|
@@ -2016,8 +2011,7 @@ var nodeRuntime = {
|
|
|
2016
2011
|
return fsExtra.readFileSync(filePath, "utf8");
|
|
2017
2012
|
},
|
|
2018
2013
|
glob(opts) {
|
|
2019
|
-
if (!opts.include)
|
|
2020
|
-
return [];
|
|
2014
|
+
if (!opts.include) return [];
|
|
2021
2015
|
const ignore = opts.exclude ?? [];
|
|
2022
2016
|
if (!ignore.length) {
|
|
2023
2017
|
ignore.push("**/*.d.ts");
|
|
@@ -2029,8 +2023,8 @@ var nodeRuntime = {
|
|
|
2029
2023
|
readDirSync: fsExtra.readdirSync,
|
|
2030
2024
|
rmDirSync: fsExtra.emptyDirSync,
|
|
2031
2025
|
rmFileSync: fsExtra.removeSync,
|
|
2032
|
-
ensureDirSync(
|
|
2033
|
-
return fsExtra.ensureDirSync(
|
|
2026
|
+
ensureDirSync(path4) {
|
|
2027
|
+
return fsExtra.ensureDirSync(path4);
|
|
2034
2028
|
},
|
|
2035
2029
|
watch(options) {
|
|
2036
2030
|
const { include, exclude, cwd, poll } = options;
|
|
@@ -2041,8 +2035,8 @@ var nodeRuntime = {
|
|
|
2041
2035
|
const watcher = chokidar.watch(dirnames, {
|
|
2042
2036
|
usePolling: poll,
|
|
2043
2037
|
cwd,
|
|
2044
|
-
ignored(
|
|
2045
|
-
const relativePath = relative(workingDir,
|
|
2038
|
+
ignored(path4, stats) {
|
|
2039
|
+
const relativePath = relative(workingDir, path4);
|
|
2046
2040
|
return !!stats?.isFile() && !isValidPath(relativePath);
|
|
2047
2041
|
},
|
|
2048
2042
|
ignoreInitial: true,
|
|
@@ -2088,14 +2082,12 @@ var OutputEngine = class {
|
|
|
2088
2082
|
return outPath;
|
|
2089
2083
|
};
|
|
2090
2084
|
write = (output) => {
|
|
2091
|
-
if (!output)
|
|
2092
|
-
return;
|
|
2085
|
+
if (!output) return;
|
|
2093
2086
|
const { dir = this.paths.root, files } = output;
|
|
2094
2087
|
this.fs.ensureDirSync(this.path.join(...dir));
|
|
2095
2088
|
return Promise.allSettled(
|
|
2096
2089
|
files.map(async (artifact) => {
|
|
2097
|
-
if (!artifact?.code)
|
|
2098
|
-
return;
|
|
2090
|
+
if (!artifact?.code) return;
|
|
2099
2091
|
const { file, code } = artifact;
|
|
2100
2092
|
const absPath = this.path.join(...dir, file);
|
|
2101
2093
|
logger3.debug("write:file", dir.slice(-1).concat(file).join("/"));
|
|
@@ -2136,8 +2128,7 @@ var PandaContext = class extends Generator2 {
|
|
|
2136
2128
|
}
|
|
2137
2129
|
getExplicitDependencies = () => {
|
|
2138
2130
|
const { cwd, dependencies } = this.config;
|
|
2139
|
-
if (!dependencies)
|
|
2140
|
-
return [];
|
|
2131
|
+
if (!dependencies) return [];
|
|
2141
2132
|
return this.runtime.fs.glob({ include: dependencies, cwd });
|
|
2142
2133
|
};
|
|
2143
2134
|
initMessage = () => {
|
|
@@ -2173,8 +2164,7 @@ var PandaContext = class extends Generator2 {
|
|
|
2173
2164
|
const measure = logger4.time.debug(`Parsed ${file}`);
|
|
2174
2165
|
const result = this.project.parseSourceFile(file, encoder);
|
|
2175
2166
|
measure();
|
|
2176
|
-
if (!result || result.isEmpty() || encoder.isEmpty())
|
|
2177
|
-
return;
|
|
2167
|
+
if (!result || result.isEmpty() || encoder.isEmpty()) return;
|
|
2178
2168
|
filesWithCss.push(file);
|
|
2179
2169
|
results.push(result);
|
|
2180
2170
|
});
|
|
@@ -2239,8 +2229,7 @@ async function loadTsConfig(conf, cwd) {
|
|
|
2239
2229
|
//@ts-ignore
|
|
2240
2230
|
resolveWithEmptyIfConfigNotFound: true
|
|
2241
2231
|
});
|
|
2242
|
-
if (!tsconfigResult)
|
|
2243
|
-
return;
|
|
2232
|
+
if (!tsconfigResult) return;
|
|
2244
2233
|
const { tsconfig, tsconfigFile } = tsconfigResult;
|
|
2245
2234
|
const { compilerOptions } = tsconfig;
|
|
2246
2235
|
const result = {
|
|
@@ -2423,8 +2412,7 @@ var Builder = class {
|
|
|
2423
2412
|
extractFile = (ctx, file) => {
|
|
2424
2413
|
const meta = this.filesMeta?.changes.get(file) ?? this.getFileMeta(file);
|
|
2425
2414
|
const hasConfigChanged = this.affecteds ? this.affecteds.hasConfigChanged : true;
|
|
2426
|
-
if (meta.isUnchanged && !hasConfigChanged)
|
|
2427
|
-
return;
|
|
2415
|
+
if (meta.isUnchanged && !hasConfigChanged) return;
|
|
2428
2416
|
const parserResult = ctx.parseFile(file);
|
|
2429
2417
|
fileModifiedMap.set(file, meta.mtime);
|
|
2430
2418
|
return parserResult;
|
|
@@ -2468,8 +2456,7 @@ var Builder = class {
|
|
|
2468
2456
|
const ctx = this.getContextOrThrow();
|
|
2469
2457
|
for (const fileOrGlob of ctx.config.include) {
|
|
2470
2458
|
const dependency = parseDependency(fileOrGlob);
|
|
2471
|
-
if (dependency)
|
|
2472
|
-
fn(dependency);
|
|
2459
|
+
if (dependency) fn(dependency);
|
|
2473
2460
|
}
|
|
2474
2461
|
for (const file of this.configDependencies) {
|
|
2475
2462
|
fn({ type: "dependency", file: normalize2(resolve3(file)) });
|
|
@@ -2480,11 +2467,11 @@ var Builder = class {
|
|
|
2480
2467
|
// src/cpu-profile.ts
|
|
2481
2468
|
init_esm_shims();
|
|
2482
2469
|
import { logger as logger6 } from "@pandacss/logger";
|
|
2483
|
-
import fs from "
|
|
2484
|
-
import
|
|
2485
|
-
import readline from "
|
|
2470
|
+
import fs from "fs";
|
|
2471
|
+
import path2 from "path";
|
|
2472
|
+
import readline from "readline";
|
|
2486
2473
|
var startProfiling = async (cwd, prefix, isWatching) => {
|
|
2487
|
-
const inspector = await import("
|
|
2474
|
+
const inspector = await import("inspector").then((r) => r.default);
|
|
2488
2475
|
const session = new inspector.Session();
|
|
2489
2476
|
session.connect();
|
|
2490
2477
|
let state = "idle";
|
|
@@ -2514,8 +2501,7 @@ var startProfiling = async (cwd, prefix, isWatching) => {
|
|
|
2514
2501
|
};
|
|
2515
2502
|
if (isWatching) {
|
|
2516
2503
|
readline.emitKeypressEvents(process.stdin);
|
|
2517
|
-
if (process.stdin.isTTY)
|
|
2518
|
-
process.stdin.setRawMode(true);
|
|
2504
|
+
if (process.stdin.isTTY) process.stdin.setRawMode(true);
|
|
2519
2505
|
console.log("Press 'p' to stop profiling...");
|
|
2520
2506
|
process.stdin.on("keypress", (str, key) => {
|
|
2521
2507
|
if (key.name === "p") {
|
|
@@ -2546,7 +2532,7 @@ var startProfiling = async (cwd, prefix, isWatching) => {
|
|
|
2546
2532
|
const date = /* @__PURE__ */ new Date();
|
|
2547
2533
|
const timestamp = date.toISOString().replace(/[-:.]/g, "");
|
|
2548
2534
|
const title = `panda-${prefix}-${timestamp}`;
|
|
2549
|
-
const outfile =
|
|
2535
|
+
const outfile = path2.join(cwd, `${title}.cpuprofile`);
|
|
2550
2536
|
fs.writeFileSync(outfile, JSON.stringify(params.profile));
|
|
2551
2537
|
logger6.info("cpu-prof", outfile);
|
|
2552
2538
|
cb?.();
|
|
@@ -2599,7 +2585,7 @@ async function debug(ctx, options) {
|
|
|
2599
2585
|
const files = ctx.getFiles();
|
|
2600
2586
|
const measureTotal = logger8.time.debug(`Done parsing ${files.length} files`);
|
|
2601
2587
|
ctx.config.minify = false;
|
|
2602
|
-
const { fs: fs3, path:
|
|
2588
|
+
const { fs: fs3, path: path4 } = ctx.runtime;
|
|
2603
2589
|
const outdir = options.outdir;
|
|
2604
2590
|
if (!options.dry && outdir) {
|
|
2605
2591
|
fs3.ensureDirSync(outdir);
|
|
@@ -2616,12 +2602,10 @@ async function debug(ctx, options) {
|
|
|
2616
2602
|
const encoder = ctx.encoder.clone();
|
|
2617
2603
|
const result = ctx.project.parseSourceFile(file, encoder);
|
|
2618
2604
|
measure();
|
|
2619
|
-
if (!result || result.isEmpty() || encoder.isEmpty())
|
|
2620
|
-
return;
|
|
2605
|
+
if (!result || result.isEmpty() || encoder.isEmpty()) return;
|
|
2621
2606
|
const styles4 = ctx.decoder.clone().collect(encoder);
|
|
2622
2607
|
const css = ctx.getParserCss(styles4);
|
|
2623
|
-
if (!css)
|
|
2624
|
-
return;
|
|
2608
|
+
if (!css) return;
|
|
2625
2609
|
if (options.dry) {
|
|
2626
2610
|
console.log({ path: file, ast: result, code: css });
|
|
2627
2611
|
return;
|
|
@@ -2629,14 +2613,14 @@ async function debug(ctx, options) {
|
|
|
2629
2613
|
if (outdir) {
|
|
2630
2614
|
filesWithCss.push(file);
|
|
2631
2615
|
const parsedPath = parse(file);
|
|
2632
|
-
const relative2 =
|
|
2633
|
-
const astJsonPath = `${relative2}${
|
|
2634
|
-
const cssPath = `${relative2}${
|
|
2616
|
+
const relative2 = path4.relative(ctx.config.cwd, parsedPath.dir);
|
|
2617
|
+
const astJsonPath = `${relative2}${path4.sep}${parsedPath.name}.ast.json`.replaceAll(path4.sep, "__");
|
|
2618
|
+
const cssPath = `${relative2}${path4.sep}${parsedPath.name}.css`.replaceAll(path4.sep, "__");
|
|
2635
2619
|
logger8.info("cli", `Writing ${colors2.bold(`${outdir}/${astJsonPath}`)}`);
|
|
2636
2620
|
logger8.info("cli", `Writing ${colors2.bold(`${outdir}/${cssPath}`)}`);
|
|
2637
2621
|
return Promise.allSettled([
|
|
2638
|
-
fs3.writeFile(`${outdir}${
|
|
2639
|
-
fs3.writeFile(`${outdir}${
|
|
2622
|
+
fs3.writeFile(`${outdir}${path4.sep}${astJsonPath}`, JSON.stringify(result.toJSON(), null, 2)),
|
|
2623
|
+
fs3.writeFile(`${outdir}${path4.sep}${cssPath}`, css)
|
|
2640
2624
|
]);
|
|
2641
2625
|
}
|
|
2642
2626
|
});
|
|
@@ -2713,8 +2697,7 @@ import { lookItUpSync } from "look-it-up";
|
|
|
2713
2697
|
import outdent from "outdent";
|
|
2714
2698
|
function setupGitIgnore(ctx) {
|
|
2715
2699
|
const { outdir, gitignore } = ctx.config;
|
|
2716
|
-
if (!gitignore)
|
|
2717
|
-
return;
|
|
2700
|
+
if (!gitignore) return;
|
|
2718
2701
|
const txt = outdent`
|
|
2719
2702
|
|
|
2720
2703
|
## Panda
|
|
@@ -2734,13 +2717,13 @@ function setupGitIgnore(ctx) {
|
|
|
2734
2717
|
// src/logstream.ts
|
|
2735
2718
|
init_esm_shims();
|
|
2736
2719
|
import { logger as logger10 } from "@pandacss/logger";
|
|
2737
|
-
import fs2 from "
|
|
2738
|
-
import
|
|
2720
|
+
import fs2 from "fs";
|
|
2721
|
+
import path3 from "path";
|
|
2739
2722
|
var setLogStream = (options) => {
|
|
2740
2723
|
const { cwd = process.cwd() } = options;
|
|
2741
2724
|
let stream;
|
|
2742
2725
|
if (options.logfile) {
|
|
2743
|
-
const outPath =
|
|
2726
|
+
const outPath = path3.resolve(cwd, options.logfile);
|
|
2744
2727
|
ensure(outPath);
|
|
2745
2728
|
logger10.info("logfile", outPath);
|
|
2746
2729
|
stream = fs2.createWriteStream(outPath, { flags: "a" });
|
|
@@ -2761,7 +2744,7 @@ var setLogStream = (options) => {
|
|
|
2761
2744
|
};
|
|
2762
2745
|
};
|
|
2763
2746
|
var ensure = (outPath) => {
|
|
2764
|
-
const dirname2 =
|
|
2747
|
+
const dirname2 = path3.dirname(outPath);
|
|
2765
2748
|
fs2.mkdirSync(dirname2, { recursive: true });
|
|
2766
2749
|
return outPath;
|
|
2767
2750
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pandacss/node",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "1.0.1",
|
|
4
4
|
"description": "The core css panda library",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.mjs",
|
|
@@ -43,23 +43,23 @@
|
|
|
43
43
|
"outdent": " ^0.8.0",
|
|
44
44
|
"package-manager-detector": "0.1.0",
|
|
45
45
|
"perfect-debounce": "1.0.0",
|
|
46
|
-
"pkg-types": "
|
|
47
|
-
"picomatch": "4.0.
|
|
46
|
+
"pkg-types": "2.2.0",
|
|
47
|
+
"picomatch": "4.0.3",
|
|
48
48
|
"pluralize": "8.0.0",
|
|
49
49
|
"postcss": "8.4.49",
|
|
50
50
|
"prettier": "3.2.5",
|
|
51
|
-
"ts-morph": "
|
|
52
|
-
"ts-pattern": "5.0
|
|
53
|
-
"tsconfck": "3.
|
|
54
|
-
"@pandacss/config": "0.
|
|
55
|
-
"@pandacss/core": "0.
|
|
56
|
-
"@pandacss/generator": "0.
|
|
57
|
-
"@pandacss/reporter": "0.
|
|
58
|
-
"@pandacss/logger": "0.
|
|
59
|
-
"@pandacss/parser": "0.
|
|
60
|
-
"@pandacss/shared": "0.
|
|
61
|
-
"@pandacss/token-dictionary": "0.
|
|
62
|
-
"@pandacss/types": "0.
|
|
51
|
+
"ts-morph": "26.0.0",
|
|
52
|
+
"ts-pattern": "5.8.0",
|
|
53
|
+
"tsconfck": "3.1.6",
|
|
54
|
+
"@pandacss/config": "1.0.1",
|
|
55
|
+
"@pandacss/core": "1.0.1",
|
|
56
|
+
"@pandacss/generator": "1.0.1",
|
|
57
|
+
"@pandacss/reporter": "1.0.1",
|
|
58
|
+
"@pandacss/logger": "1.0.1",
|
|
59
|
+
"@pandacss/parser": "1.0.1",
|
|
60
|
+
"@pandacss/shared": "1.0.1",
|
|
61
|
+
"@pandacss/token-dictionary": "1.0.1",
|
|
62
|
+
"@pandacss/types": "1.0.1"
|
|
63
63
|
},
|
|
64
64
|
"devDependencies": {
|
|
65
65
|
"@types/picomatch": "3.0.2",
|