@pandacss/node 0.7.0 → 0.8.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 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +39 -44
- package/dist/index.mjs +40 -45
- package/package.json +15 -15
package/dist/index.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { discardDuplicate } from '@pandacss/core';
|
|
2
2
|
import * as _pandacss_types from '@pandacss/types';
|
|
3
|
-
import { PandaHookable, Artifact, ConfigResultWithHooks, ParserResultType, Config } from '@pandacss/types';
|
|
3
|
+
import { PandaHookable, Artifact, ConfigResultWithHooks, Runtime as Runtime$1, ParserResultType, Config } from '@pandacss/types';
|
|
4
4
|
import { Generator } from '@pandacss/generator';
|
|
5
5
|
import { Project } from '@pandacss/parser';
|
|
6
6
|
import { Runtime } from '@pandacss/types/src/runtime';
|
|
@@ -30,7 +30,7 @@ declare const getOutputEngine: ({ paths, runtime: { path, fs }, }: Generator & {
|
|
|
30
30
|
|
|
31
31
|
declare const createContext: (conf: ConfigResultWithHooks) => PandaContext;
|
|
32
32
|
type PandaContext = Generator & {
|
|
33
|
-
runtime: Runtime;
|
|
33
|
+
runtime: Runtime$1;
|
|
34
34
|
hooks: PandaHookable;
|
|
35
35
|
project: Project;
|
|
36
36
|
getFiles: () => string[];
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { discardDuplicate } from '@pandacss/core';
|
|
2
2
|
import * as _pandacss_types from '@pandacss/types';
|
|
3
|
-
import { PandaHookable, Artifact, ConfigResultWithHooks, ParserResultType, Config } from '@pandacss/types';
|
|
3
|
+
import { PandaHookable, Artifact, ConfigResultWithHooks, Runtime as Runtime$1, ParserResultType, Config } from '@pandacss/types';
|
|
4
4
|
import { Generator } from '@pandacss/generator';
|
|
5
5
|
import { Project } from '@pandacss/parser';
|
|
6
6
|
import { Runtime } from '@pandacss/types/src/runtime';
|
|
@@ -30,7 +30,7 @@ declare const getOutputEngine: ({ paths, runtime: { path, fs }, }: Generator & {
|
|
|
30
30
|
|
|
31
31
|
declare const createContext: (conf: ConfigResultWithHooks) => PandaContext;
|
|
32
32
|
type PandaContext = Generator & {
|
|
33
|
-
runtime: Runtime;
|
|
33
|
+
runtime: Runtime$1;
|
|
34
34
|
hooks: PandaHookable;
|
|
35
35
|
project: Project;
|
|
36
36
|
getFiles: () => string[];
|
package/dist/index.js
CHANGED
|
@@ -798,7 +798,6 @@ var import_tsconfck = require("tsconfck");
|
|
|
798
798
|
init_cjs_shims();
|
|
799
799
|
var import_generator = require("@pandacss/generator");
|
|
800
800
|
var import_parser = require("@pandacss/parser");
|
|
801
|
-
var import_lil_fp = require("lil-fp");
|
|
802
801
|
|
|
803
802
|
// src/chunk-engine.ts
|
|
804
803
|
init_cjs_shims();
|
|
@@ -939,29 +938,29 @@ var getOutputEngine = ({
|
|
|
939
938
|
});
|
|
940
939
|
|
|
941
940
|
// src/create-context.ts
|
|
942
|
-
var createContext = (conf) =>
|
|
943
|
-
conf
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
})
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
941
|
+
var createContext = (conf) => {
|
|
942
|
+
const generator = (0, import_generator.createGenerator)(conf);
|
|
943
|
+
const config = conf.config;
|
|
944
|
+
const runtime = nodeRuntime;
|
|
945
|
+
config.cwd ||= runtime.cwd();
|
|
946
|
+
const { include, exclude, cwd } = config;
|
|
947
|
+
const getFiles = () => runtime.fs.glob({ include, exclude, cwd });
|
|
948
|
+
const ctx = {
|
|
949
|
+
...conf,
|
|
950
|
+
...generator,
|
|
951
|
+
runtime: nodeRuntime,
|
|
952
|
+
hooks: conf.hooks,
|
|
953
|
+
getFiles,
|
|
954
|
+
project: (0, import_parser.createProject)({
|
|
955
955
|
...conf.tsconfig,
|
|
956
956
|
getFiles,
|
|
957
|
-
readFile: fs.readFileSync,
|
|
957
|
+
readFile: runtime.fs.readFileSync,
|
|
958
958
|
hooks: conf.hooks,
|
|
959
|
-
parserOptions
|
|
960
|
-
})
|
|
961
|
-
}
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
);
|
|
959
|
+
parserOptions: { join: runtime.path.join, ...generator.parserOptions }
|
|
960
|
+
})
|
|
961
|
+
};
|
|
962
|
+
return Object.assign(ctx, { chunks: getChunkEngine(ctx), output: getOutputEngine(ctx) });
|
|
963
|
+
};
|
|
965
964
|
|
|
966
965
|
// src/config.ts
|
|
967
966
|
var configs = [".ts", ".js", ".mjs", ".cjs"];
|
|
@@ -987,6 +986,11 @@ async function loadConfigAndCreateContext(options = {}) {
|
|
|
987
986
|
if (tsconfigResult) {
|
|
988
987
|
conf.tsconfig = tsconfigResult.tsconfig;
|
|
989
988
|
conf.tsconfigFile = tsconfigResult.tsconfigFile;
|
|
989
|
+
const options2 = tsconfigResult.tsconfig?.compilerOptions;
|
|
990
|
+
if (options2?.paths) {
|
|
991
|
+
const baseUrl = options2.baseUrl;
|
|
992
|
+
conf.tsOptions = { baseUrl, pathMappings: (0, import_config.convertTsPathsToRegexes)(options2.paths, baseUrl ?? cwd) };
|
|
993
|
+
}
|
|
990
994
|
}
|
|
991
995
|
conf.config.outdir ??= "styled-system";
|
|
992
996
|
if (conf.config.hooks) {
|
|
@@ -1002,7 +1006,7 @@ async function loadConfigAndCreateContext(options = {}) {
|
|
|
1002
1006
|
// src/extract.ts
|
|
1003
1007
|
init_cjs_shims();
|
|
1004
1008
|
var import_logger3 = require("@pandacss/logger");
|
|
1005
|
-
var
|
|
1009
|
+
var import_lil_fp = require("lil-fp");
|
|
1006
1010
|
|
|
1007
1011
|
// src/cli-box.ts
|
|
1008
1012
|
init_cjs_shims();
|
|
@@ -2340,21 +2344,21 @@ function extractFile(ctx, file) {
|
|
|
2340
2344
|
runtime: { path: path2 },
|
|
2341
2345
|
config: { cwd }
|
|
2342
2346
|
} = ctx;
|
|
2343
|
-
return (0,
|
|
2347
|
+
return (0, import_lil_fp.pipe)(
|
|
2344
2348
|
{ file: path2.abs(cwd, file) },
|
|
2345
|
-
(0,
|
|
2346
|
-
|
|
2347
|
-
|
|
2349
|
+
(0, import_lil_fp.tap)(() => import_logger3.logger.debug("file:extract", file)),
|
|
2350
|
+
import_lil_fp.Obj.bind("measure", () => import_logger3.logger.time.debug(`Extracted ${file}`)),
|
|
2351
|
+
import_lil_fp.Obj.bind(
|
|
2348
2352
|
"result",
|
|
2349
|
-
(0,
|
|
2353
|
+
(0, import_lil_fp.tryCatch)(
|
|
2350
2354
|
({ file: file2 }) => ctx.project.parseSourceFile(file2),
|
|
2351
2355
|
(error) => import_logger3.logger.error("file:parse", error)
|
|
2352
2356
|
)
|
|
2353
2357
|
),
|
|
2354
|
-
|
|
2355
|
-
|
|
2356
|
-
(0,
|
|
2357
|
-
|
|
2358
|
+
import_lil_fp.Obj.bind("measureCss", () => import_logger3.logger.time.debug(`Parsed ${file}`)),
|
|
2359
|
+
import_lil_fp.Obj.bind("css", ({ result }) => result ? ctx.getParserCss(result) : void 0),
|
|
2360
|
+
(0, import_lil_fp.tap)(({ measure, measureCss }) => [measureCss(), measure()]),
|
|
2361
|
+
import_lil_fp.Obj.get("css")
|
|
2358
2362
|
);
|
|
2359
2363
|
}
|
|
2360
2364
|
function extractFiles(ctx) {
|
|
@@ -2484,18 +2488,9 @@ var Builder = class {
|
|
|
2484
2488
|
async setup(options = {}) {
|
|
2485
2489
|
import_logger4.logger.debug("builder", "\u{1F6A7} Setup");
|
|
2486
2490
|
const configPath = options.configPath ?? this.getConfigPath();
|
|
2487
|
-
|
|
2488
|
-
|
|
2489
|
-
|
|
2490
|
-
if (options2?.paths) {
|
|
2491
|
-
const baseUrl = options2.baseUrl;
|
|
2492
|
-
tsOptions = {
|
|
2493
|
-
baseUrl,
|
|
2494
|
-
pathMappings: (0, import_config2.convertTsPathsToRegexes)(options2?.paths, baseUrl ?? this.context.config.cwd)
|
|
2495
|
-
};
|
|
2496
|
-
}
|
|
2497
|
-
}
|
|
2498
|
-
const { deps: foundDeps } = (0, import_config2.getConfigDependencies)(configPath, tsOptions);
|
|
2491
|
+
const tsOptions = this.context?.tsOptions ?? { baseUrl: void 0, pathMappings: [] };
|
|
2492
|
+
const compilerOptions = this.context?.tsconfig?.compilerOptions ?? {};
|
|
2493
|
+
const { deps: foundDeps } = (0, import_config2.getConfigDependencies)(configPath, tsOptions, compilerOptions);
|
|
2499
2494
|
const cwd = this.context?.config.cwd ?? (0, import_path2.dirname)(configPath);
|
|
2500
2495
|
const configDeps = /* @__PURE__ */ new Set([...foundDeps, ...(this.context?.dependencies ?? []).map((file) => (0, import_path2.resolve)(cwd, file))]);
|
|
2501
2496
|
this.configDependencies = configDeps;
|
|
@@ -2810,7 +2805,7 @@ outExtension: '${outExtension}',` : ""}
|
|
|
2810
2805
|
outdir: "styled-system",
|
|
2811
2806
|
${jsxFramework ? `
|
|
2812
2807
|
// The JSX framework to use
|
|
2813
|
-
jsxFramework: '${jsxFramework}'
|
|
2808
|
+
jsxFramework: '${jsxFramework}',` : ""}
|
|
2814
2809
|
${syntax ? `
|
|
2815
2810
|
// The CSS Syntax to use to use
|
|
2816
2811
|
syntax: '${syntax}'` : ""}
|
package/dist/index.mjs
CHANGED
|
@@ -756,7 +756,7 @@ var writeAnalyzeJSON = (fileName, result, ctx) => {
|
|
|
756
756
|
|
|
757
757
|
// src/builder.ts
|
|
758
758
|
init_esm_shims();
|
|
759
|
-
import { getConfigDependencies
|
|
759
|
+
import { getConfigDependencies } from "@pandacss/config";
|
|
760
760
|
import { discardDuplicate, mergeCss as mergeCss2 } from "@pandacss/core";
|
|
761
761
|
import { ConfigNotFoundError } from "@pandacss/error";
|
|
762
762
|
import { logger as logger4 } from "@pandacss/logger";
|
|
@@ -766,7 +766,7 @@ import { dirname as dirname2, resolve as resolve2 } from "path";
|
|
|
766
766
|
|
|
767
767
|
// src/config.ts
|
|
768
768
|
init_esm_shims();
|
|
769
|
-
import { loadConfigFile } from "@pandacss/config";
|
|
769
|
+
import { convertTsPathsToRegexes, loadConfigFile } from "@pandacss/config";
|
|
770
770
|
import { createDebugger, createHooks } from "hookable";
|
|
771
771
|
import { lookItUpSync } from "look-it-up";
|
|
772
772
|
import { parse } from "tsconfck";
|
|
@@ -775,7 +775,6 @@ import { parse } from "tsconfck";
|
|
|
775
775
|
init_esm_shims();
|
|
776
776
|
import { createGenerator } from "@pandacss/generator";
|
|
777
777
|
import { createProject } from "@pandacss/parser";
|
|
778
|
-
import { Obj, pipe, tap } from "lil-fp";
|
|
779
778
|
|
|
780
779
|
// src/chunk-engine.ts
|
|
781
780
|
init_esm_shims();
|
|
@@ -925,29 +924,29 @@ var getOutputEngine = ({
|
|
|
925
924
|
});
|
|
926
925
|
|
|
927
926
|
// src/create-context.ts
|
|
928
|
-
var createContext = (conf) =>
|
|
929
|
-
conf
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
})
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
927
|
+
var createContext = (conf) => {
|
|
928
|
+
const generator = createGenerator(conf);
|
|
929
|
+
const config = conf.config;
|
|
930
|
+
const runtime = nodeRuntime;
|
|
931
|
+
config.cwd ||= runtime.cwd();
|
|
932
|
+
const { include, exclude, cwd } = config;
|
|
933
|
+
const getFiles = () => runtime.fs.glob({ include, exclude, cwd });
|
|
934
|
+
const ctx = {
|
|
935
|
+
...conf,
|
|
936
|
+
...generator,
|
|
937
|
+
runtime: nodeRuntime,
|
|
938
|
+
hooks: conf.hooks,
|
|
939
|
+
getFiles,
|
|
940
|
+
project: createProject({
|
|
941
941
|
...conf.tsconfig,
|
|
942
942
|
getFiles,
|
|
943
|
-
readFile: fs.readFileSync,
|
|
943
|
+
readFile: runtime.fs.readFileSync,
|
|
944
944
|
hooks: conf.hooks,
|
|
945
|
-
parserOptions
|
|
946
|
-
})
|
|
947
|
-
}
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
);
|
|
945
|
+
parserOptions: { join: runtime.path.join, ...generator.parserOptions }
|
|
946
|
+
})
|
|
947
|
+
};
|
|
948
|
+
return Object.assign(ctx, { chunks: getChunkEngine(ctx), output: getOutputEngine(ctx) });
|
|
949
|
+
};
|
|
951
950
|
|
|
952
951
|
// src/config.ts
|
|
953
952
|
var configs = [".ts", ".js", ".mjs", ".cjs"];
|
|
@@ -973,6 +972,11 @@ async function loadConfigAndCreateContext(options = {}) {
|
|
|
973
972
|
if (tsconfigResult) {
|
|
974
973
|
conf.tsconfig = tsconfigResult.tsconfig;
|
|
975
974
|
conf.tsconfigFile = tsconfigResult.tsconfigFile;
|
|
975
|
+
const options2 = tsconfigResult.tsconfig?.compilerOptions;
|
|
976
|
+
if (options2?.paths) {
|
|
977
|
+
const baseUrl = options2.baseUrl;
|
|
978
|
+
conf.tsOptions = { baseUrl, pathMappings: convertTsPathsToRegexes(options2.paths, baseUrl ?? cwd) };
|
|
979
|
+
}
|
|
976
980
|
}
|
|
977
981
|
conf.config.outdir ??= "styled-system";
|
|
978
982
|
if (conf.config.hooks) {
|
|
@@ -988,7 +992,7 @@ async function loadConfigAndCreateContext(options = {}) {
|
|
|
988
992
|
// src/extract.ts
|
|
989
993
|
init_esm_shims();
|
|
990
994
|
import { logger as logger3 } from "@pandacss/logger";
|
|
991
|
-
import { Obj
|
|
995
|
+
import { Obj, pipe, tap, tryCatch } from "lil-fp";
|
|
992
996
|
|
|
993
997
|
// src/cli-box.ts
|
|
994
998
|
init_esm_shims();
|
|
@@ -2326,21 +2330,21 @@ function extractFile(ctx, file) {
|
|
|
2326
2330
|
runtime: { path: path2 },
|
|
2327
2331
|
config: { cwd }
|
|
2328
2332
|
} = ctx;
|
|
2329
|
-
return
|
|
2333
|
+
return pipe(
|
|
2330
2334
|
{ file: path2.abs(cwd, file) },
|
|
2331
|
-
|
|
2332
|
-
|
|
2333
|
-
|
|
2335
|
+
tap(() => logger3.debug("file:extract", file)),
|
|
2336
|
+
Obj.bind("measure", () => logger3.time.debug(`Extracted ${file}`)),
|
|
2337
|
+
Obj.bind(
|
|
2334
2338
|
"result",
|
|
2335
2339
|
tryCatch(
|
|
2336
2340
|
({ file: file2 }) => ctx.project.parseSourceFile(file2),
|
|
2337
2341
|
(error) => logger3.error("file:parse", error)
|
|
2338
2342
|
)
|
|
2339
2343
|
),
|
|
2340
|
-
|
|
2341
|
-
|
|
2342
|
-
|
|
2343
|
-
|
|
2344
|
+
Obj.bind("measureCss", () => logger3.time.debug(`Parsed ${file}`)),
|
|
2345
|
+
Obj.bind("css", ({ result }) => result ? ctx.getParserCss(result) : void 0),
|
|
2346
|
+
tap(({ measure, measureCss }) => [measureCss(), measure()]),
|
|
2347
|
+
Obj.get("css")
|
|
2344
2348
|
);
|
|
2345
2349
|
}
|
|
2346
2350
|
function extractFiles(ctx) {
|
|
@@ -2470,18 +2474,9 @@ var Builder = class {
|
|
|
2470
2474
|
async setup(options = {}) {
|
|
2471
2475
|
logger4.debug("builder", "\u{1F6A7} Setup");
|
|
2472
2476
|
const configPath = options.configPath ?? this.getConfigPath();
|
|
2473
|
-
|
|
2474
|
-
|
|
2475
|
-
|
|
2476
|
-
if (options2?.paths) {
|
|
2477
|
-
const baseUrl = options2.baseUrl;
|
|
2478
|
-
tsOptions = {
|
|
2479
|
-
baseUrl,
|
|
2480
|
-
pathMappings: convertTsPathsToRegexes(options2?.paths, baseUrl ?? this.context.config.cwd)
|
|
2481
|
-
};
|
|
2482
|
-
}
|
|
2483
|
-
}
|
|
2484
|
-
const { deps: foundDeps } = getConfigDependencies(configPath, tsOptions);
|
|
2477
|
+
const tsOptions = this.context?.tsOptions ?? { baseUrl: void 0, pathMappings: [] };
|
|
2478
|
+
const compilerOptions = this.context?.tsconfig?.compilerOptions ?? {};
|
|
2479
|
+
const { deps: foundDeps } = getConfigDependencies(configPath, tsOptions, compilerOptions);
|
|
2485
2480
|
const cwd = this.context?.config.cwd ?? dirname2(configPath);
|
|
2486
2481
|
const configDeps = /* @__PURE__ */ new Set([...foundDeps, ...(this.context?.dependencies ?? []).map((file) => resolve2(cwd, file))]);
|
|
2487
2482
|
this.configDependencies = configDeps;
|
|
@@ -2796,7 +2791,7 @@ outExtension: '${outExtension}',` : ""}
|
|
|
2796
2791
|
outdir: "styled-system",
|
|
2797
2792
|
${jsxFramework ? `
|
|
2798
2793
|
// The JSX framework to use
|
|
2799
|
-
jsxFramework: '${jsxFramework}'
|
|
2794
|
+
jsxFramework: '${jsxFramework}',` : ""}
|
|
2800
2795
|
${syntax ? `
|
|
2801
2796
|
// The CSS Syntax to use to use
|
|
2802
2797
|
syntax: '${syntax}'` : ""}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pandacss/node",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.8.0",
|
|
4
4
|
"description": "The core css panda library",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.mjs",
|
|
@@ -31,20 +31,20 @@
|
|
|
31
31
|
"pluralize": "8.0.0",
|
|
32
32
|
"postcss": "8.4.25",
|
|
33
33
|
"preferred-pm": "^3.0.3",
|
|
34
|
-
"ts-morph": "
|
|
35
|
-
"ts-pattern": "5.0.
|
|
34
|
+
"ts-morph": "19.0.0",
|
|
35
|
+
"ts-pattern": "5.0.4",
|
|
36
36
|
"tsconfck": "^2.1.1",
|
|
37
|
-
"@pandacss/config": "0.
|
|
38
|
-
"@pandacss/core": "0.
|
|
39
|
-
"@pandacss/error": "0.
|
|
40
|
-
"@pandacss/extractor": "0.
|
|
41
|
-
"@pandacss/generator": "0.
|
|
42
|
-
"@pandacss/is-valid-prop": "0.
|
|
43
|
-
"@pandacss/logger": "0.
|
|
44
|
-
"@pandacss/parser": "0.
|
|
45
|
-
"@pandacss/shared": "0.
|
|
46
|
-
"@pandacss/token-dictionary": "0.
|
|
47
|
-
"@pandacss/types": "0.
|
|
37
|
+
"@pandacss/config": "0.8.0",
|
|
38
|
+
"@pandacss/core": "0.8.0",
|
|
39
|
+
"@pandacss/error": "0.8.0",
|
|
40
|
+
"@pandacss/extractor": "0.8.0",
|
|
41
|
+
"@pandacss/generator": "0.8.0",
|
|
42
|
+
"@pandacss/is-valid-prop": "0.8.0",
|
|
43
|
+
"@pandacss/logger": "0.8.0",
|
|
44
|
+
"@pandacss/parser": "0.8.0",
|
|
45
|
+
"@pandacss/shared": "0.8.0",
|
|
46
|
+
"@pandacss/token-dictionary": "0.8.0",
|
|
47
|
+
"@pandacss/types": "0.8.0"
|
|
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.
|
|
56
|
+
"@pandacss/fixture": "0.8.0"
|
|
57
57
|
},
|
|
58
58
|
"scripts": {
|
|
59
59
|
"build": "tsup src/index.ts --format=cjs,esm --shims --dts",
|