@pandacss/node 0.0.0-dev-20230816155120 → 0.0.0-dev-20230821094657
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 +14 -14
- package/dist/index.d.ts +14 -14
- package/dist/index.js +29 -28
- package/dist/index.mjs +29 -28
- package/package.json +13 -13
package/dist/index.d.mts
CHANGED
|
@@ -190,26 +190,26 @@ declare class Builder {
|
|
|
190
190
|
*/
|
|
191
191
|
context: PandaContext | undefined;
|
|
192
192
|
configDependencies: Set<string>;
|
|
193
|
-
writeFileCss(file: string, css: string)
|
|
194
|
-
checkConfigDeps(configPath: string, deps: Set<string>)
|
|
195
|
-
getConfigPath()
|
|
196
|
-
setup(options?: {
|
|
193
|
+
writeFileCss: (file: string, css: string) => void;
|
|
194
|
+
checkConfigDeps: (configPath: string, deps: Set<string>) => ConfigDepsResult;
|
|
195
|
+
getConfigPath: () => string;
|
|
196
|
+
setup: (options?: {
|
|
197
197
|
configPath?: string;
|
|
198
198
|
cwd?: string;
|
|
199
|
-
})
|
|
200
|
-
setupContext(options: {
|
|
199
|
+
}) => Promise<void>;
|
|
200
|
+
setupContext: (options: {
|
|
201
201
|
configPath: string;
|
|
202
202
|
depsModifiedMap: Map<string, number>;
|
|
203
|
-
})
|
|
204
|
-
getContextOrThrow()
|
|
203
|
+
}) => Promise<void>;
|
|
204
|
+
getContextOrThrow: () => PandaContext;
|
|
205
205
|
get fileModifiedMap(): Map<string, number>;
|
|
206
206
|
get fileCssMap(): Map<string, string>;
|
|
207
|
-
extractFile(ctx: PandaContext, file: string)
|
|
208
|
-
extract()
|
|
209
|
-
toString()
|
|
210
|
-
isValidRoot(root: Root)
|
|
211
|
-
write(root: Root)
|
|
212
|
-
registerDependency(fn: (dep: Message) => void)
|
|
207
|
+
extractFile: (ctx: PandaContext, file: string) => Promise<string | undefined>;
|
|
208
|
+
extract: () => Promise<void>;
|
|
209
|
+
toString: () => string;
|
|
210
|
+
isValidRoot: (root: Root) => boolean;
|
|
211
|
+
write: (root: Root) => void;
|
|
212
|
+
registerDependency: (fn: (dep: Message) => void) => void;
|
|
213
213
|
}
|
|
214
214
|
|
|
215
215
|
declare function findConfig(): string | undefined;
|
package/dist/index.d.ts
CHANGED
|
@@ -190,26 +190,26 @@ declare class Builder {
|
|
|
190
190
|
*/
|
|
191
191
|
context: PandaContext | undefined;
|
|
192
192
|
configDependencies: Set<string>;
|
|
193
|
-
writeFileCss(file: string, css: string)
|
|
194
|
-
checkConfigDeps(configPath: string, deps: Set<string>)
|
|
195
|
-
getConfigPath()
|
|
196
|
-
setup(options?: {
|
|
193
|
+
writeFileCss: (file: string, css: string) => void;
|
|
194
|
+
checkConfigDeps: (configPath: string, deps: Set<string>) => ConfigDepsResult;
|
|
195
|
+
getConfigPath: () => string;
|
|
196
|
+
setup: (options?: {
|
|
197
197
|
configPath?: string;
|
|
198
198
|
cwd?: string;
|
|
199
|
-
})
|
|
200
|
-
setupContext(options: {
|
|
199
|
+
}) => Promise<void>;
|
|
200
|
+
setupContext: (options: {
|
|
201
201
|
configPath: string;
|
|
202
202
|
depsModifiedMap: Map<string, number>;
|
|
203
|
-
})
|
|
204
|
-
getContextOrThrow()
|
|
203
|
+
}) => Promise<void>;
|
|
204
|
+
getContextOrThrow: () => PandaContext;
|
|
205
205
|
get fileModifiedMap(): Map<string, number>;
|
|
206
206
|
get fileCssMap(): Map<string, string>;
|
|
207
|
-
extractFile(ctx: PandaContext, file: string)
|
|
208
|
-
extract()
|
|
209
|
-
toString()
|
|
210
|
-
isValidRoot(root: Root)
|
|
211
|
-
write(root: Root)
|
|
212
|
-
registerDependency(fn: (dep: Message) => void)
|
|
207
|
+
extractFile: (ctx: PandaContext, file: string) => Promise<string | undefined>;
|
|
208
|
+
extract: () => Promise<void>;
|
|
209
|
+
toString: () => string;
|
|
210
|
+
isValidRoot: (root: Root) => boolean;
|
|
211
|
+
write: (root: Root) => void;
|
|
212
|
+
registerDependency: (fn: (dep: Message) => void) => void;
|
|
213
213
|
}
|
|
214
214
|
|
|
215
215
|
declare function findConfig(): string | undefined;
|
package/dist/index.js
CHANGED
|
@@ -2450,12 +2450,12 @@ var Builder = class {
|
|
|
2450
2450
|
*/
|
|
2451
2451
|
context;
|
|
2452
2452
|
configDependencies = /* @__PURE__ */ new Set();
|
|
2453
|
-
writeFileCss(file, css) {
|
|
2453
|
+
writeFileCss = (file, css) => {
|
|
2454
2454
|
const oldCss = this.fileCssMap?.get(file) ?? "";
|
|
2455
2455
|
const newCss = (0, import_core2.mergeCss)(oldCss, css);
|
|
2456
2456
|
this.fileCssMap?.set(file, newCss);
|
|
2457
|
-
}
|
|
2458
|
-
checkConfigDeps(configPath, deps) {
|
|
2457
|
+
};
|
|
2458
|
+
checkConfigDeps = (configPath, deps) => {
|
|
2459
2459
|
let modified = false;
|
|
2460
2460
|
const newModified = /* @__PURE__ */ new Map();
|
|
2461
2461
|
const prevModified = configCache.get(configPath)?.depsModifiedMap;
|
|
@@ -2479,15 +2479,15 @@ var Builder = class {
|
|
|
2479
2479
|
import_logger4.logger.debug("builder", "\u2699\uFE0F Config changed, reloading");
|
|
2480
2480
|
}
|
|
2481
2481
|
return { isModified: true, modifiedMap: newModified };
|
|
2482
|
-
}
|
|
2483
|
-
getConfigPath() {
|
|
2482
|
+
};
|
|
2483
|
+
getConfigPath = () => {
|
|
2484
2484
|
const configPath = findConfig();
|
|
2485
2485
|
if (!configPath) {
|
|
2486
2486
|
throw new import_error.ConfigNotFoundError();
|
|
2487
2487
|
}
|
|
2488
2488
|
return configPath;
|
|
2489
|
-
}
|
|
2490
|
-
async
|
|
2489
|
+
};
|
|
2490
|
+
setup = async (options = {}) => {
|
|
2491
2491
|
import_logger4.logger.debug("builder", "\u{1F6A7} Setup");
|
|
2492
2492
|
const configPath = options.configPath ?? this.getConfigPath();
|
|
2493
2493
|
const tsOptions = this.context?.tsOptions ?? { baseUrl: void 0, pathMappings: [] };
|
|
@@ -2516,8 +2516,8 @@ var Builder = class {
|
|
|
2516
2516
|
});
|
|
2517
2517
|
}
|
|
2518
2518
|
setupCount++;
|
|
2519
|
-
}
|
|
2520
|
-
async
|
|
2519
|
+
};
|
|
2520
|
+
setupContext = async (options) => {
|
|
2521
2521
|
const { configPath, depsModifiedMap } = options;
|
|
2522
2522
|
this.context = await loadConfigAndCreateContext({ configPath });
|
|
2523
2523
|
if (setupCount > 0) {
|
|
@@ -2532,13 +2532,13 @@ var Builder = class {
|
|
|
2532
2532
|
fileCssMap: /* @__PURE__ */ new Map(),
|
|
2533
2533
|
fileModifiedMap: /* @__PURE__ */ new Map()
|
|
2534
2534
|
});
|
|
2535
|
-
}
|
|
2536
|
-
getContextOrThrow() {
|
|
2535
|
+
};
|
|
2536
|
+
getContextOrThrow = () => {
|
|
2537
2537
|
if (!this.context) {
|
|
2538
2538
|
throw new Error("context not loaded");
|
|
2539
2539
|
}
|
|
2540
2540
|
return this.context;
|
|
2541
|
-
}
|
|
2541
|
+
};
|
|
2542
2542
|
get fileModifiedMap() {
|
|
2543
2543
|
const ctx = this.getContextOrThrow();
|
|
2544
2544
|
return contentFilesCache.get(ctx).fileModifiedMap;
|
|
@@ -2547,7 +2547,7 @@ var Builder = class {
|
|
|
2547
2547
|
const ctx = this.getContextOrThrow();
|
|
2548
2548
|
return contentFilesCache.get(ctx).fileCssMap;
|
|
2549
2549
|
}
|
|
2550
|
-
async
|
|
2550
|
+
extractFile = async (ctx, file) => {
|
|
2551
2551
|
const mtime = (0, import_fs.existsSync)(file) ? (0, import_fs_extra2.statSync)(file).mtimeMs : -Infinity;
|
|
2552
2552
|
const isUnchanged = this.fileModifiedMap.has(file) && mtime === this.fileModifiedMap.get(file);
|
|
2553
2553
|
if (isUnchanged)
|
|
@@ -2558,30 +2558,31 @@ var Builder = class {
|
|
|
2558
2558
|
this.fileModifiedMap.set(file, mtime);
|
|
2559
2559
|
this.writeFileCss(file, css);
|
|
2560
2560
|
return css;
|
|
2561
|
-
}
|
|
2562
|
-
async
|
|
2561
|
+
};
|
|
2562
|
+
extract = async () => {
|
|
2563
2563
|
const ctx = this.getContextOrThrow();
|
|
2564
2564
|
const done = import_logger4.logger.time.info("Extracted in");
|
|
2565
2565
|
await Promise.all(ctx.getFiles().map((file) => this.extractFile(ctx, file)));
|
|
2566
2566
|
done();
|
|
2567
|
-
}
|
|
2568
|
-
toString() {
|
|
2567
|
+
};
|
|
2568
|
+
toString = () => {
|
|
2569
2569
|
const ctx = this.getContextOrThrow();
|
|
2570
2570
|
return ctx.getCss({
|
|
2571
2571
|
files: Array.from(this.fileCssMap.values()),
|
|
2572
2572
|
resolve: true
|
|
2573
2573
|
});
|
|
2574
|
-
}
|
|
2575
|
-
isValidRoot(root) {
|
|
2576
|
-
|
|
2574
|
+
};
|
|
2575
|
+
isValidRoot = (root) => {
|
|
2576
|
+
const ctx = this.getContextOrThrow();
|
|
2577
|
+
let valid = false;
|
|
2577
2578
|
root.walkAtRules("layer", (rule) => {
|
|
2578
|
-
if (
|
|
2579
|
-
|
|
2579
|
+
if (ctx.isValidLayerRule(rule.params)) {
|
|
2580
|
+
valid = true;
|
|
2580
2581
|
}
|
|
2581
2582
|
});
|
|
2582
|
-
return
|
|
2583
|
-
}
|
|
2584
|
-
write(root) {
|
|
2583
|
+
return valid;
|
|
2584
|
+
};
|
|
2585
|
+
write = (root) => {
|
|
2585
2586
|
const rootCssContent = root.toString();
|
|
2586
2587
|
root.removeAll();
|
|
2587
2588
|
root.append(
|
|
@@ -2590,8 +2591,8 @@ var Builder = class {
|
|
|
2590
2591
|
${this.toString()}
|
|
2591
2592
|
`)
|
|
2592
2593
|
);
|
|
2593
|
-
}
|
|
2594
|
-
registerDependency(fn) {
|
|
2594
|
+
};
|
|
2595
|
+
registerDependency = (fn) => {
|
|
2595
2596
|
const ctx = this.getContextOrThrow();
|
|
2596
2597
|
for (const fileOrGlob of ctx.config.include) {
|
|
2597
2598
|
const dependency = parseDependency(fileOrGlob);
|
|
@@ -2605,7 +2606,7 @@ var Builder = class {
|
|
|
2605
2606
|
for (const file of this.configDependencies) {
|
|
2606
2607
|
fn({ type: "dependency", file: (0, import_path2.resolve)(file) });
|
|
2607
2608
|
}
|
|
2608
|
-
}
|
|
2609
|
+
};
|
|
2609
2610
|
};
|
|
2610
2611
|
|
|
2611
2612
|
// src/debug-files.ts
|
package/dist/index.mjs
CHANGED
|
@@ -2436,12 +2436,12 @@ var Builder = class {
|
|
|
2436
2436
|
*/
|
|
2437
2437
|
context;
|
|
2438
2438
|
configDependencies = /* @__PURE__ */ new Set();
|
|
2439
|
-
writeFileCss(file, css) {
|
|
2439
|
+
writeFileCss = (file, css) => {
|
|
2440
2440
|
const oldCss = this.fileCssMap?.get(file) ?? "";
|
|
2441
2441
|
const newCss = mergeCss2(oldCss, css);
|
|
2442
2442
|
this.fileCssMap?.set(file, newCss);
|
|
2443
|
-
}
|
|
2444
|
-
checkConfigDeps(configPath, deps) {
|
|
2443
|
+
};
|
|
2444
|
+
checkConfigDeps = (configPath, deps) => {
|
|
2445
2445
|
let modified = false;
|
|
2446
2446
|
const newModified = /* @__PURE__ */ new Map();
|
|
2447
2447
|
const prevModified = configCache.get(configPath)?.depsModifiedMap;
|
|
@@ -2465,15 +2465,15 @@ var Builder = class {
|
|
|
2465
2465
|
logger4.debug("builder", "\u2699\uFE0F Config changed, reloading");
|
|
2466
2466
|
}
|
|
2467
2467
|
return { isModified: true, modifiedMap: newModified };
|
|
2468
|
-
}
|
|
2469
|
-
getConfigPath() {
|
|
2468
|
+
};
|
|
2469
|
+
getConfigPath = () => {
|
|
2470
2470
|
const configPath = findConfig();
|
|
2471
2471
|
if (!configPath) {
|
|
2472
2472
|
throw new ConfigNotFoundError();
|
|
2473
2473
|
}
|
|
2474
2474
|
return configPath;
|
|
2475
|
-
}
|
|
2476
|
-
async
|
|
2475
|
+
};
|
|
2476
|
+
setup = async (options = {}) => {
|
|
2477
2477
|
logger4.debug("builder", "\u{1F6A7} Setup");
|
|
2478
2478
|
const configPath = options.configPath ?? this.getConfigPath();
|
|
2479
2479
|
const tsOptions = this.context?.tsOptions ?? { baseUrl: void 0, pathMappings: [] };
|
|
@@ -2502,8 +2502,8 @@ var Builder = class {
|
|
|
2502
2502
|
});
|
|
2503
2503
|
}
|
|
2504
2504
|
setupCount++;
|
|
2505
|
-
}
|
|
2506
|
-
async
|
|
2505
|
+
};
|
|
2506
|
+
setupContext = async (options) => {
|
|
2507
2507
|
const { configPath, depsModifiedMap } = options;
|
|
2508
2508
|
this.context = await loadConfigAndCreateContext({ configPath });
|
|
2509
2509
|
if (setupCount > 0) {
|
|
@@ -2518,13 +2518,13 @@ var Builder = class {
|
|
|
2518
2518
|
fileCssMap: /* @__PURE__ */ new Map(),
|
|
2519
2519
|
fileModifiedMap: /* @__PURE__ */ new Map()
|
|
2520
2520
|
});
|
|
2521
|
-
}
|
|
2522
|
-
getContextOrThrow() {
|
|
2521
|
+
};
|
|
2522
|
+
getContextOrThrow = () => {
|
|
2523
2523
|
if (!this.context) {
|
|
2524
2524
|
throw new Error("context not loaded");
|
|
2525
2525
|
}
|
|
2526
2526
|
return this.context;
|
|
2527
|
-
}
|
|
2527
|
+
};
|
|
2528
2528
|
get fileModifiedMap() {
|
|
2529
2529
|
const ctx = this.getContextOrThrow();
|
|
2530
2530
|
return contentFilesCache.get(ctx).fileModifiedMap;
|
|
@@ -2533,7 +2533,7 @@ var Builder = class {
|
|
|
2533
2533
|
const ctx = this.getContextOrThrow();
|
|
2534
2534
|
return contentFilesCache.get(ctx).fileCssMap;
|
|
2535
2535
|
}
|
|
2536
|
-
async
|
|
2536
|
+
extractFile = async (ctx, file) => {
|
|
2537
2537
|
const mtime = existsSync2(file) ? statSync(file).mtimeMs : -Infinity;
|
|
2538
2538
|
const isUnchanged = this.fileModifiedMap.has(file) && mtime === this.fileModifiedMap.get(file);
|
|
2539
2539
|
if (isUnchanged)
|
|
@@ -2544,30 +2544,31 @@ var Builder = class {
|
|
|
2544
2544
|
this.fileModifiedMap.set(file, mtime);
|
|
2545
2545
|
this.writeFileCss(file, css);
|
|
2546
2546
|
return css;
|
|
2547
|
-
}
|
|
2548
|
-
async
|
|
2547
|
+
};
|
|
2548
|
+
extract = async () => {
|
|
2549
2549
|
const ctx = this.getContextOrThrow();
|
|
2550
2550
|
const done = logger4.time.info("Extracted in");
|
|
2551
2551
|
await Promise.all(ctx.getFiles().map((file) => this.extractFile(ctx, file)));
|
|
2552
2552
|
done();
|
|
2553
|
-
}
|
|
2554
|
-
toString() {
|
|
2553
|
+
};
|
|
2554
|
+
toString = () => {
|
|
2555
2555
|
const ctx = this.getContextOrThrow();
|
|
2556
2556
|
return ctx.getCss({
|
|
2557
2557
|
files: Array.from(this.fileCssMap.values()),
|
|
2558
2558
|
resolve: true
|
|
2559
2559
|
});
|
|
2560
|
-
}
|
|
2561
|
-
isValidRoot(root) {
|
|
2562
|
-
|
|
2560
|
+
};
|
|
2561
|
+
isValidRoot = (root) => {
|
|
2562
|
+
const ctx = this.getContextOrThrow();
|
|
2563
|
+
let valid = false;
|
|
2563
2564
|
root.walkAtRules("layer", (rule) => {
|
|
2564
|
-
if (
|
|
2565
|
-
|
|
2565
|
+
if (ctx.isValidLayerRule(rule.params)) {
|
|
2566
|
+
valid = true;
|
|
2566
2567
|
}
|
|
2567
2568
|
});
|
|
2568
|
-
return
|
|
2569
|
-
}
|
|
2570
|
-
write(root) {
|
|
2569
|
+
return valid;
|
|
2570
|
+
};
|
|
2571
|
+
write = (root) => {
|
|
2571
2572
|
const rootCssContent = root.toString();
|
|
2572
2573
|
root.removeAll();
|
|
2573
2574
|
root.append(
|
|
@@ -2576,8 +2577,8 @@ var Builder = class {
|
|
|
2576
2577
|
${this.toString()}
|
|
2577
2578
|
`)
|
|
2578
2579
|
);
|
|
2579
|
-
}
|
|
2580
|
-
registerDependency(fn) {
|
|
2580
|
+
};
|
|
2581
|
+
registerDependency = (fn) => {
|
|
2581
2582
|
const ctx = this.getContextOrThrow();
|
|
2582
2583
|
for (const fileOrGlob of ctx.config.include) {
|
|
2583
2584
|
const dependency = parseDependency(fileOrGlob);
|
|
@@ -2591,7 +2592,7 @@ var Builder = class {
|
|
|
2591
2592
|
for (const file of this.configDependencies) {
|
|
2592
2593
|
fn({ type: "dependency", file: resolve2(file) });
|
|
2593
2594
|
}
|
|
2594
|
-
}
|
|
2595
|
+
};
|
|
2595
2596
|
};
|
|
2596
2597
|
|
|
2597
2598
|
// src/debug-files.ts
|
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-20230821094657",
|
|
4
4
|
"description": "The core css panda library",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.mjs",
|
|
@@ -34,17 +34,17 @@
|
|
|
34
34
|
"ts-morph": "19.0.0",
|
|
35
35
|
"ts-pattern": "5.0.4",
|
|
36
36
|
"tsconfck": "^2.1.2",
|
|
37
|
-
"@pandacss/config": "0.0.0-dev-
|
|
38
|
-
"@pandacss/core": "0.0.0-dev-
|
|
39
|
-
"@pandacss/error": "0.0.0-dev-
|
|
40
|
-
"@pandacss/extractor": "0.0.0-dev-
|
|
41
|
-
"@pandacss/generator": "0.0.0-dev-
|
|
42
|
-
"@pandacss/is-valid-prop": "0.0.0-dev-
|
|
43
|
-
"@pandacss/logger": "0.0.0-dev-
|
|
44
|
-
"@pandacss/parser": "0.0.0-dev-
|
|
45
|
-
"@pandacss/shared": "0.0.0-dev-
|
|
46
|
-
"@pandacss/token-dictionary": "0.0.0-dev-
|
|
47
|
-
"@pandacss/types": "0.0.0-dev-
|
|
37
|
+
"@pandacss/config": "0.0.0-dev-20230821094657",
|
|
38
|
+
"@pandacss/core": "0.0.0-dev-20230821094657",
|
|
39
|
+
"@pandacss/error": "0.0.0-dev-20230821094657",
|
|
40
|
+
"@pandacss/extractor": "0.0.0-dev-20230821094657",
|
|
41
|
+
"@pandacss/generator": "0.0.0-dev-20230821094657",
|
|
42
|
+
"@pandacss/is-valid-prop": "0.0.0-dev-20230821094657",
|
|
43
|
+
"@pandacss/logger": "0.0.0-dev-20230821094657",
|
|
44
|
+
"@pandacss/parser": "0.0.0-dev-20230821094657",
|
|
45
|
+
"@pandacss/shared": "0.0.0-dev-20230821094657",
|
|
46
|
+
"@pandacss/token-dictionary": "0.0.0-dev-20230821094657",
|
|
47
|
+
"@pandacss/types": "0.0.0-dev-20230821094657"
|
|
48
48
|
},
|
|
49
49
|
"devDependencies": {
|
|
50
50
|
"@types/fs-extra": "11.0.1",
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
"@types/lodash.merge": "4.6.7",
|
|
54
54
|
"@types/pluralize": "0.0.30",
|
|
55
55
|
"boxen": "^7.1.1",
|
|
56
|
-
"@pandacss/fixture": "0.0.0-dev-
|
|
56
|
+
"@pandacss/fixture": "0.0.0-dev-20230821094657"
|
|
57
57
|
},
|
|
58
58
|
"scripts": {
|
|
59
59
|
"build": "tsup src/index.ts --format=cjs,esm --shims --dts",
|