@pandacss/node 0.0.0-dev-20230203182017 → 0.0.0-dev-20230204123646
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.ts +47 -157
- package/dist/index.js +20 -54
- package/dist/index.mjs +21 -55
- package/package.json +18 -17
package/dist/index.d.ts
CHANGED
|
@@ -2,12 +2,10 @@ import * as _pandacss_core from '@pandacss/core';
|
|
|
2
2
|
import { StylesheetContext, Conditions, Utility } from '@pandacss/core';
|
|
3
3
|
export { discardDuplicate } from '@pandacss/core';
|
|
4
4
|
import * as _pandacss_types_dist_config from '@pandacss/types/dist/config';
|
|
5
|
-
import * as ts_morph from 'ts-morph';
|
|
6
5
|
import * as _pandacss_types_dist_shared from '@pandacss/types/dist/shared';
|
|
7
6
|
import * as _pandacss_types from '@pandacss/types';
|
|
8
7
|
import { LoadConfigResult, RecipeConfig, PatternConfig, Config } from '@pandacss/types';
|
|
9
|
-
import
|
|
10
|
-
import { Collector } from '@pandacss/parser';
|
|
8
|
+
import { ParserResult } from '@pandacss/parser';
|
|
11
9
|
import * as _pandacss_shared from '@pandacss/shared';
|
|
12
10
|
import { mapObject } from '@pandacss/shared';
|
|
13
11
|
import * as _pandacss_token_dictionary from '@pandacss/token-dictionary';
|
|
@@ -64,12 +62,8 @@ declare function createContext(conf: LoadConfigResult, io?: IO): {
|
|
|
64
62
|
pattern: string;
|
|
65
63
|
jsx: string;
|
|
66
64
|
};
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
addSourceFile: (file: string) => void;
|
|
70
|
-
reloadSourceFile: (file: string) => void;
|
|
71
|
-
removeSourceFile: (file: string) => boolean | undefined;
|
|
72
|
-
parseSourceFile: (sourceFile: ts_morph.SourceFile | undefined) => Collector | undefined;
|
|
65
|
+
absPath: (str: string) => string;
|
|
66
|
+
project: any;
|
|
73
67
|
getPath: (pathLike?: string) => string;
|
|
74
68
|
paths: {
|
|
75
69
|
root: string;
|
|
@@ -95,7 +89,7 @@ declare function createContext(conf: LoadConfigResult, io?: IO): {
|
|
|
95
89
|
tokens: TokenDictionary;
|
|
96
90
|
hasTokens: boolean;
|
|
97
91
|
utility: Utility;
|
|
98
|
-
getCss: (collector:
|
|
92
|
+
getCss: (collector: ParserResult, file: string) => {
|
|
99
93
|
css: string;
|
|
100
94
|
file: string;
|
|
101
95
|
} | undefined;
|
|
@@ -186,146 +180,7 @@ declare class Builder {
|
|
|
186
180
|
configChanged: boolean;
|
|
187
181
|
updateFile(file: string, css: string): void;
|
|
188
182
|
setup(): Promise<void>;
|
|
189
|
-
ensure():
|
|
190
|
-
theme: {
|
|
191
|
-
breakpoints?: Record<string, string> | undefined;
|
|
192
|
-
keyframes?: _pandacss_types.CssKeyframes | undefined;
|
|
193
|
-
tokens?: _pandacss_types.Tokens | undefined;
|
|
194
|
-
semanticTokens?: _pandacss_types.SemanticTokens<string> | undefined;
|
|
195
|
-
textStyles?: _pandacss_types.TextStyles | undefined;
|
|
196
|
-
layerStyles?: _pandacss_types.LayerStyles | undefined;
|
|
197
|
-
recipes?: Record<string, _pandacss_types.RecipeConfig<_pandacss_types.RecipeVariantRecord>> | undefined;
|
|
198
|
-
};
|
|
199
|
-
config: _pandacss_types_dist_shared.UnwrapExtend<_pandacss_types.RequiredBy<_pandacss_types.Config, "include" | "outdir" | "cwd">>;
|
|
200
|
-
configPath: string;
|
|
201
|
-
cwd: string;
|
|
202
|
-
conf: _pandacss_types.LoadConfigResult;
|
|
203
|
-
chunks: {
|
|
204
|
-
dir: string;
|
|
205
|
-
readFile(file: string): Promise<string>;
|
|
206
|
-
getFiles(): string[];
|
|
207
|
-
format(file: string): string;
|
|
208
|
-
write(file: string, css: string): Promise<void[]>;
|
|
209
|
-
rm(file: string): Promise<void>;
|
|
210
|
-
empty(): Promise<void>;
|
|
211
|
-
glob: string[];
|
|
212
|
-
};
|
|
213
|
-
files: string[];
|
|
214
|
-
helpers: {
|
|
215
|
-
map: typeof _pandacss_shared.mapObject;
|
|
216
|
-
};
|
|
217
|
-
context: () => _pandacss_core.StylesheetContext;
|
|
218
|
-
exclude: string[];
|
|
219
|
-
conditions: _pandacss_core.Conditions;
|
|
220
|
-
importMap: {
|
|
221
|
-
css: string;
|
|
222
|
-
recipe: string;
|
|
223
|
-
pattern: string;
|
|
224
|
-
jsx: string;
|
|
225
|
-
};
|
|
226
|
-
reloadSourceFiles: () => void;
|
|
227
|
-
getSourceFile: (file: string) => ts_morph.SourceFile | undefined;
|
|
228
|
-
addSourceFile: (file: string) => void;
|
|
229
|
-
reloadSourceFile: (file: string) => void;
|
|
230
|
-
removeSourceFile: (file: string) => boolean | undefined;
|
|
231
|
-
parseSourceFile: (sourceFile: ts_morph.SourceFile | undefined) => _pandacss_parser.Collector | undefined;
|
|
232
|
-
getPath: (pathLike?: string | undefined) => string;
|
|
233
|
-
paths: {
|
|
234
|
-
root: string;
|
|
235
|
-
css: string;
|
|
236
|
-
token: string;
|
|
237
|
-
types: string;
|
|
238
|
-
recipe: string;
|
|
239
|
-
pattern: string;
|
|
240
|
-
chunk: string;
|
|
241
|
-
outCss: string;
|
|
242
|
-
jsx: string;
|
|
243
|
-
};
|
|
244
|
-
write: (dir: string, options: {
|
|
245
|
-
file: string;
|
|
246
|
-
code: string | undefined;
|
|
247
|
-
}[]) => Promise<void[]>;
|
|
248
|
-
writeOutput: (output: Output) => Promise<void[]> | undefined;
|
|
249
|
-
cleanOutdir: () => Promise<void>;
|
|
250
|
-
getExt: (file: string) => string;
|
|
251
|
-
getImport: (items: string, mod: string) => string;
|
|
252
|
-
getExport: (mod: string) => string;
|
|
253
|
-
cssVarRoot: string;
|
|
254
|
-
tokens: _pandacss_token_dictionary.TokenDictionary;
|
|
255
|
-
hasTokens: boolean;
|
|
256
|
-
utility: _pandacss_core.Utility;
|
|
257
|
-
getCss: (collector: _pandacss_parser.Collector, file: string) => {
|
|
258
|
-
css: string;
|
|
259
|
-
file: string;
|
|
260
|
-
} | undefined;
|
|
261
|
-
getGlobalCss: () => string;
|
|
262
|
-
getStaticCss: () => string | undefined;
|
|
263
|
-
patterns: Record<string, _pandacss_types.PatternConfig>;
|
|
264
|
-
hasPatterns: boolean;
|
|
265
|
-
getPattern: (name: string) => _pandacss_types.PatternConfig | undefined;
|
|
266
|
-
execPattern: (name: string, data: Record<string, any>) => _pandacss_types.SystemStyleObject;
|
|
267
|
-
patternNodes: {
|
|
268
|
-
type: "pattern";
|
|
269
|
-
name: string;
|
|
270
|
-
props: string[];
|
|
271
|
-
baseName: string;
|
|
272
|
-
}[];
|
|
273
|
-
getPatternFnName: (jsx: string) => string;
|
|
274
|
-
getPatternDetails: (name: string, pattern: _pandacss_types.PatternConfig | undefined) => {
|
|
275
|
-
name: string;
|
|
276
|
-
props: string[];
|
|
277
|
-
dashName: string;
|
|
278
|
-
upperName: string;
|
|
279
|
-
styleFn: string;
|
|
280
|
-
jsxName: string;
|
|
281
|
-
blocklistType: string;
|
|
282
|
-
};
|
|
283
|
-
recipes: Record<string, _pandacss_types.RecipeConfig<_pandacss_types.RecipeVariantRecord>>;
|
|
284
|
-
getRecipe: (name: string) => _pandacss_types.RecipeConfig<_pandacss_types.RecipeVariantRecord> | undefined;
|
|
285
|
-
hasRecipes: boolean;
|
|
286
|
-
getRecipeDetails: () => {
|
|
287
|
-
[x: string]: {
|
|
288
|
-
[x: string]: string[];
|
|
289
|
-
}[];
|
|
290
|
-
}[];
|
|
291
|
-
jsxFactory: string;
|
|
292
|
-
jsxFactoryDetails: {
|
|
293
|
-
name: string;
|
|
294
|
-
upperName: string;
|
|
295
|
-
typeName: string;
|
|
296
|
-
componentName: string;
|
|
297
|
-
framework: "solid" | "react" | "preact" | undefined;
|
|
298
|
-
};
|
|
299
|
-
properties: string[];
|
|
300
|
-
extract: (fn: (file: string) => Promise<{
|
|
301
|
-
css: string;
|
|
302
|
-
file: string;
|
|
303
|
-
} | undefined>) => Promise<({
|
|
304
|
-
css: string;
|
|
305
|
-
file: string;
|
|
306
|
-
} | undefined)[]>;
|
|
307
|
-
hash?: boolean | undefined;
|
|
308
|
-
prefix?: string | undefined;
|
|
309
|
-
separator?: "-" | "_" | "=" | undefined;
|
|
310
|
-
static?: _pandacss_types.StaticCssOptions | undefined;
|
|
311
|
-
minify?: boolean | undefined;
|
|
312
|
-
utilities?: _pandacss_types.UtilityConfig | undefined;
|
|
313
|
-
emitPackage?: boolean | undefined;
|
|
314
|
-
gitignore?: boolean | undefined;
|
|
315
|
-
studio?: Partial<_pandacss_types_dist_config.Studio> | undefined;
|
|
316
|
-
logLevel?: "debug" | "info" | "warn" | "error" | "silent" | undefined;
|
|
317
|
-
presets?: (string | _pandacss_types.Preset)[] | undefined;
|
|
318
|
-
preflight?: boolean | undefined;
|
|
319
|
-
clean?: boolean | undefined;
|
|
320
|
-
watch?: boolean | undefined;
|
|
321
|
-
poll?: boolean | undefined;
|
|
322
|
-
globalCss?: _pandacss_types.GlobalStyleObject | undefined;
|
|
323
|
-
jsxFramework?: "solid" | "react" | "preact" | undefined;
|
|
324
|
-
strictTokens?: boolean | undefined;
|
|
325
|
-
outExtension?: "mjs" | "js" | undefined;
|
|
326
|
-
include: string[];
|
|
327
|
-
outdir: string;
|
|
328
|
-
};
|
|
183
|
+
ensure(): PandaContext;
|
|
329
184
|
extract(): Promise<void>;
|
|
330
185
|
toString(): string;
|
|
331
186
|
isValidRoot(root: Root): boolean;
|
|
@@ -374,12 +229,8 @@ declare function loadConfigAndCreateContext(options?: {
|
|
|
374
229
|
pattern: string;
|
|
375
230
|
jsx: string;
|
|
376
231
|
};
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
addSourceFile: (file: string) => void;
|
|
380
|
-
reloadSourceFile: (file: string) => void;
|
|
381
|
-
removeSourceFile: (file: string) => boolean | undefined;
|
|
382
|
-
parseSourceFile: (sourceFile: ts_morph.SourceFile | undefined) => _pandacss_parser.Collector | undefined;
|
|
232
|
+
absPath: (str: string) => string;
|
|
233
|
+
project: any;
|
|
383
234
|
getPath: (pathLike?: string | undefined) => string;
|
|
384
235
|
paths: {
|
|
385
236
|
root: string;
|
|
@@ -405,7 +256,46 @@ declare function loadConfigAndCreateContext(options?: {
|
|
|
405
256
|
tokens: _pandacss_token_dictionary.TokenDictionary;
|
|
406
257
|
hasTokens: boolean;
|
|
407
258
|
utility: _pandacss_core.Utility;
|
|
408
|
-
getCss: (collector:
|
|
259
|
+
getCss: (collector: {
|
|
260
|
+
jsx: Set<{
|
|
261
|
+
name?: string | undefined;
|
|
262
|
+
data: Record<string, any>;
|
|
263
|
+
type?: string | undefined;
|
|
264
|
+
}>;
|
|
265
|
+
css: Set<{
|
|
266
|
+
name?: string | undefined;
|
|
267
|
+
data: Record<string, any>;
|
|
268
|
+
type?: string | undefined;
|
|
269
|
+
}>;
|
|
270
|
+
cva: Set<{
|
|
271
|
+
name?: string | undefined;
|
|
272
|
+
data: Record<string, any>;
|
|
273
|
+
type?: string | undefined;
|
|
274
|
+
}>;
|
|
275
|
+
recipe: Map<string, Set<{
|
|
276
|
+
name?: string | undefined;
|
|
277
|
+
data: Record<string, any>;
|
|
278
|
+
type?: string | undefined;
|
|
279
|
+
}>>;
|
|
280
|
+
pattern: Map<string, Set<{
|
|
281
|
+
name?: string | undefined;
|
|
282
|
+
data: Record<string, any>;
|
|
283
|
+
type?: string | undefined;
|
|
284
|
+
}>>;
|
|
285
|
+
set(name: "css" | "cva", result: {
|
|
286
|
+
data: Record<string, any>;
|
|
287
|
+
}): void;
|
|
288
|
+
setCva(result: {
|
|
289
|
+
data: Record<string, any>;
|
|
290
|
+
}): void;
|
|
291
|
+
setPattern(name: string, result: {
|
|
292
|
+
data: Record<string, any>;
|
|
293
|
+
}): void;
|
|
294
|
+
setRecipe(name: string, result: {
|
|
295
|
+
data: Record<string, any>;
|
|
296
|
+
}): void;
|
|
297
|
+
isEmpty(): boolean;
|
|
298
|
+
}, file: string) => {
|
|
409
299
|
css: string;
|
|
410
300
|
file: string;
|
|
411
301
|
} | undefined;
|
package/dist/index.js
CHANGED
|
@@ -60,8 +60,7 @@ function extractFile(ctx, file) {
|
|
|
60
60
|
let result;
|
|
61
61
|
const done = import_logger.logger.time.debug(`Extracted ${(0, import_logger.quote)(file)}`);
|
|
62
62
|
try {
|
|
63
|
-
|
|
64
|
-
data = ctx.parseSourceFile(source);
|
|
63
|
+
data = ctx.project.parseSourceFile(ctx.absPath(file));
|
|
65
64
|
} catch (error) {
|
|
66
65
|
import_logger.logger.error("file:parse", error);
|
|
67
66
|
}
|
|
@@ -1794,7 +1793,6 @@ var import_fs_extra2 = require("fs-extra");
|
|
|
1794
1793
|
var import_promises = require("fs/promises");
|
|
1795
1794
|
var import_path2 = require("path");
|
|
1796
1795
|
var import_postcss2 = __toESM(require("postcss"));
|
|
1797
|
-
var import_ts_morph = require("ts-morph");
|
|
1798
1796
|
var import_ts_pattern5 = require("ts-pattern");
|
|
1799
1797
|
var helpers = {
|
|
1800
1798
|
map: import_shared4.mapObject
|
|
@@ -2032,52 +2030,24 @@ function createContext(conf, io = fileSystem) {
|
|
|
2032
2030
|
}
|
|
2033
2031
|
const files = getFiles();
|
|
2034
2032
|
import_logger4.logger.debug("ctx:files", files);
|
|
2035
|
-
const tsProject = (0, import_parser.createProject)();
|
|
2036
|
-
function addSourceFile(file) {
|
|
2037
|
-
tsProject.createSourceFile(file, (0, import_fs3.readFileSync)(file, "utf8"), {
|
|
2038
|
-
overwrite: true,
|
|
2039
|
-
scriptKind: import_ts_morph.ScriptKind.TSX
|
|
2040
|
-
});
|
|
2041
|
-
}
|
|
2042
|
-
function reloadSourceFile(file) {
|
|
2043
|
-
const sourceFile = tsProject.getSourceFile(file);
|
|
2044
|
-
sourceFile?.refreshFromFileSystemSync();
|
|
2045
|
-
}
|
|
2046
|
-
function reloadSourceFiles() {
|
|
2047
|
-
const files2 = getFiles();
|
|
2048
|
-
for (const file of files2) {
|
|
2049
|
-
const source = tsProject.getSourceFile(file);
|
|
2050
|
-
if (source) {
|
|
2051
|
-
source.refreshFromFileSystemSync();
|
|
2052
|
-
} else {
|
|
2053
|
-
tsProject.addSourceFileAtPath(file);
|
|
2054
|
-
}
|
|
2055
|
-
}
|
|
2056
|
-
}
|
|
2057
|
-
function getSourceFile(file) {
|
|
2058
|
-
return tsProject.getSourceFile(absPath(file));
|
|
2059
|
-
}
|
|
2060
|
-
function removeSourceFile(file) {
|
|
2061
|
-
const sourceFile = tsProject.getSourceFile(absPath(file));
|
|
2062
|
-
if (sourceFile) {
|
|
2063
|
-
return tsProject.removeSourceFile(sourceFile);
|
|
2064
|
-
}
|
|
2065
|
-
}
|
|
2066
|
-
files.forEach((file) => {
|
|
2067
|
-
addSourceFile(file);
|
|
2068
|
-
});
|
|
2069
2033
|
const importMap = {
|
|
2070
2034
|
css: `${outdir}/css`,
|
|
2071
2035
|
recipe: `${outdir}/recipes`,
|
|
2072
2036
|
pattern: `${outdir}/patterns`,
|
|
2073
2037
|
jsx: `${outdir}/jsx`
|
|
2074
2038
|
};
|
|
2075
|
-
const
|
|
2076
|
-
|
|
2077
|
-
|
|
2078
|
-
|
|
2079
|
-
|
|
2080
|
-
|
|
2039
|
+
const project = (0, import_parser.createProject)({
|
|
2040
|
+
getFiles,
|
|
2041
|
+
readFile(filePath) {
|
|
2042
|
+
return (0, import_fs3.readFileSync)(filePath, "utf8");
|
|
2043
|
+
},
|
|
2044
|
+
parserOptions: {
|
|
2045
|
+
importMap,
|
|
2046
|
+
jsx: {
|
|
2047
|
+
factory: jsxFactory,
|
|
2048
|
+
isStyleProp,
|
|
2049
|
+
nodes: [...patternNodes, ...recipeNodes]
|
|
2050
|
+
}
|
|
2081
2051
|
}
|
|
2082
2052
|
});
|
|
2083
2053
|
function getGlobalCss() {
|
|
@@ -2186,7 +2156,7 @@ function createContext(conf, io = fileSystem) {
|
|
|
2186
2156
|
import_logger4.logger.error("pattern", error);
|
|
2187
2157
|
}
|
|
2188
2158
|
});
|
|
2189
|
-
if (collector.isEmpty) {
|
|
2159
|
+
if (collector.isEmpty()) {
|
|
2190
2160
|
return;
|
|
2191
2161
|
}
|
|
2192
2162
|
return {
|
|
@@ -2211,12 +2181,8 @@ function createContext(conf, io = fileSystem) {
|
|
|
2211
2181
|
exclude,
|
|
2212
2182
|
conditions,
|
|
2213
2183
|
importMap,
|
|
2214
|
-
|
|
2215
|
-
|
|
2216
|
-
addSourceFile,
|
|
2217
|
-
reloadSourceFile,
|
|
2218
|
-
removeSourceFile,
|
|
2219
|
-
parseSourceFile,
|
|
2184
|
+
absPath,
|
|
2185
|
+
project,
|
|
2220
2186
|
getPath,
|
|
2221
2187
|
paths,
|
|
2222
2188
|
write,
|
|
@@ -2332,7 +2298,7 @@ var Builder = class {
|
|
|
2332
2298
|
const configHash = getConfigHash();
|
|
2333
2299
|
const cachedContext = contextCache.get(configHash);
|
|
2334
2300
|
if (cachedContext) {
|
|
2335
|
-
cachedContext.reloadSourceFiles();
|
|
2301
|
+
cachedContext.project.reloadSourceFiles();
|
|
2336
2302
|
this.context = cachedContext;
|
|
2337
2303
|
this.fileCssMap = builderCache.get(cachedContext).fileCssMap;
|
|
2338
2304
|
this.fileModifiedMap = builderCache.get(cachedContext).fileModifiedMap;
|
|
@@ -2464,13 +2430,13 @@ async function createContentWatcher(ctx, callback) {
|
|
|
2464
2430
|
watcher.on("all", async (event, file) => {
|
|
2465
2431
|
import_logger7.logger.debug(`file:${event}`, file);
|
|
2466
2432
|
(0, import_ts_pattern6.match)(event).with("unlink", () => {
|
|
2467
|
-
ctx.removeSourceFile(file);
|
|
2433
|
+
ctx.project.removeSourceFile(ctx.absPath(file));
|
|
2468
2434
|
ctx.chunks.rm(file);
|
|
2469
2435
|
}).with("change", async () => {
|
|
2470
|
-
ctx.reloadSourceFile(file);
|
|
2436
|
+
ctx.project.reloadSourceFile(file);
|
|
2471
2437
|
await callback(file);
|
|
2472
2438
|
}).with("add", async () => {
|
|
2473
|
-
ctx.
|
|
2439
|
+
ctx.project.createSourceFile(file);
|
|
2474
2440
|
await callback(file);
|
|
2475
2441
|
}).otherwise(() => {
|
|
2476
2442
|
});
|
package/dist/index.mjs
CHANGED
|
@@ -13,8 +13,7 @@ function extractFile(ctx, file) {
|
|
|
13
13
|
let result;
|
|
14
14
|
const done = logger.time.debug(`Extracted ${quote(file)}`);
|
|
15
15
|
try {
|
|
16
|
-
|
|
17
|
-
data = ctx.parseSourceFile(source);
|
|
16
|
+
data = ctx.project.parseSourceFile(ctx.absPath(file));
|
|
18
17
|
} catch (error) {
|
|
19
18
|
logger.error("file:parse", error);
|
|
20
19
|
}
|
|
@@ -1745,7 +1744,7 @@ import {
|
|
|
1745
1744
|
} from "@pandacss/core";
|
|
1746
1745
|
import { isCssProperty } from "@pandacss/is-valid-prop";
|
|
1747
1746
|
import { logger as logger4 } from "@pandacss/logger";
|
|
1748
|
-
import {
|
|
1747
|
+
import { createProject } from "@pandacss/parser";
|
|
1749
1748
|
import { capitalize as capitalize4, compact, dashCase as dashCase2, mapObject, splitProps, uncapitalize } from "@pandacss/shared";
|
|
1750
1749
|
import { TokenDictionary } from "@pandacss/token-dictionary";
|
|
1751
1750
|
import glob from "fast-glob";
|
|
@@ -1754,7 +1753,6 @@ import { emptyDir, ensureDir, existsSync } from "fs-extra";
|
|
|
1754
1753
|
import { readFile, unlink, writeFile } from "fs/promises";
|
|
1755
1754
|
import { extname, isAbsolute, join as join2, relative, resolve, sep } from "path";
|
|
1756
1755
|
import postcss2 from "postcss";
|
|
1757
|
-
import { ScriptKind } from "ts-morph";
|
|
1758
1756
|
import { match as match5, P } from "ts-pattern";
|
|
1759
1757
|
var helpers = {
|
|
1760
1758
|
map: mapObject
|
|
@@ -1992,52 +1990,24 @@ function createContext(conf, io = fileSystem) {
|
|
|
1992
1990
|
}
|
|
1993
1991
|
const files = getFiles();
|
|
1994
1992
|
logger4.debug("ctx:files", files);
|
|
1995
|
-
const tsProject = createProject();
|
|
1996
|
-
function addSourceFile(file) {
|
|
1997
|
-
tsProject.createSourceFile(file, readFileSync4(file, "utf8"), {
|
|
1998
|
-
overwrite: true,
|
|
1999
|
-
scriptKind: ScriptKind.TSX
|
|
2000
|
-
});
|
|
2001
|
-
}
|
|
2002
|
-
function reloadSourceFile(file) {
|
|
2003
|
-
const sourceFile = tsProject.getSourceFile(file);
|
|
2004
|
-
sourceFile?.refreshFromFileSystemSync();
|
|
2005
|
-
}
|
|
2006
|
-
function reloadSourceFiles() {
|
|
2007
|
-
const files2 = getFiles();
|
|
2008
|
-
for (const file of files2) {
|
|
2009
|
-
const source = tsProject.getSourceFile(file);
|
|
2010
|
-
if (source) {
|
|
2011
|
-
source.refreshFromFileSystemSync();
|
|
2012
|
-
} else {
|
|
2013
|
-
tsProject.addSourceFileAtPath(file);
|
|
2014
|
-
}
|
|
2015
|
-
}
|
|
2016
|
-
}
|
|
2017
|
-
function getSourceFile(file) {
|
|
2018
|
-
return tsProject.getSourceFile(absPath(file));
|
|
2019
|
-
}
|
|
2020
|
-
function removeSourceFile(file) {
|
|
2021
|
-
const sourceFile = tsProject.getSourceFile(absPath(file));
|
|
2022
|
-
if (sourceFile) {
|
|
2023
|
-
return tsProject.removeSourceFile(sourceFile);
|
|
2024
|
-
}
|
|
2025
|
-
}
|
|
2026
|
-
files.forEach((file) => {
|
|
2027
|
-
addSourceFile(file);
|
|
2028
|
-
});
|
|
2029
1993
|
const importMap = {
|
|
2030
1994
|
css: `${outdir}/css`,
|
|
2031
1995
|
recipe: `${outdir}/recipes`,
|
|
2032
1996
|
pattern: `${outdir}/patterns`,
|
|
2033
1997
|
jsx: `${outdir}/jsx`
|
|
2034
1998
|
};
|
|
2035
|
-
const
|
|
2036
|
-
|
|
2037
|
-
|
|
2038
|
-
|
|
2039
|
-
|
|
2040
|
-
|
|
1999
|
+
const project = createProject({
|
|
2000
|
+
getFiles,
|
|
2001
|
+
readFile(filePath) {
|
|
2002
|
+
return readFileSync4(filePath, "utf8");
|
|
2003
|
+
},
|
|
2004
|
+
parserOptions: {
|
|
2005
|
+
importMap,
|
|
2006
|
+
jsx: {
|
|
2007
|
+
factory: jsxFactory,
|
|
2008
|
+
isStyleProp,
|
|
2009
|
+
nodes: [...patternNodes, ...recipeNodes]
|
|
2010
|
+
}
|
|
2041
2011
|
}
|
|
2042
2012
|
});
|
|
2043
2013
|
function getGlobalCss() {
|
|
@@ -2146,7 +2116,7 @@ function createContext(conf, io = fileSystem) {
|
|
|
2146
2116
|
logger4.error("pattern", error);
|
|
2147
2117
|
}
|
|
2148
2118
|
});
|
|
2149
|
-
if (collector.isEmpty) {
|
|
2119
|
+
if (collector.isEmpty()) {
|
|
2150
2120
|
return;
|
|
2151
2121
|
}
|
|
2152
2122
|
return {
|
|
@@ -2171,12 +2141,8 @@ function createContext(conf, io = fileSystem) {
|
|
|
2171
2141
|
exclude,
|
|
2172
2142
|
conditions,
|
|
2173
2143
|
importMap,
|
|
2174
|
-
|
|
2175
|
-
|
|
2176
|
-
addSourceFile,
|
|
2177
|
-
reloadSourceFile,
|
|
2178
|
-
removeSourceFile,
|
|
2179
|
-
parseSourceFile,
|
|
2144
|
+
absPath,
|
|
2145
|
+
project,
|
|
2180
2146
|
getPath,
|
|
2181
2147
|
paths,
|
|
2182
2148
|
write,
|
|
@@ -2292,7 +2258,7 @@ var Builder = class {
|
|
|
2292
2258
|
const configHash = getConfigHash();
|
|
2293
2259
|
const cachedContext = contextCache.get(configHash);
|
|
2294
2260
|
if (cachedContext) {
|
|
2295
|
-
cachedContext.reloadSourceFiles();
|
|
2261
|
+
cachedContext.project.reloadSourceFiles();
|
|
2296
2262
|
this.context = cachedContext;
|
|
2297
2263
|
this.fileCssMap = builderCache.get(cachedContext).fileCssMap;
|
|
2298
2264
|
this.fileModifiedMap = builderCache.get(cachedContext).fileModifiedMap;
|
|
@@ -2424,13 +2390,13 @@ async function createContentWatcher(ctx, callback) {
|
|
|
2424
2390
|
watcher.on("all", async (event, file) => {
|
|
2425
2391
|
logger7.debug(`file:${event}`, file);
|
|
2426
2392
|
match6(event).with("unlink", () => {
|
|
2427
|
-
ctx.removeSourceFile(file);
|
|
2393
|
+
ctx.project.removeSourceFile(ctx.absPath(file));
|
|
2428
2394
|
ctx.chunks.rm(file);
|
|
2429
2395
|
}).with("change", async () => {
|
|
2430
|
-
ctx.reloadSourceFile(file);
|
|
2396
|
+
ctx.project.reloadSourceFile(file);
|
|
2431
2397
|
await callback(file);
|
|
2432
2398
|
}).with("add", async () => {
|
|
2433
|
-
ctx.
|
|
2399
|
+
ctx.project.createSourceFile(file);
|
|
2434
2400
|
await callback(file);
|
|
2435
2401
|
}).otherwise(() => {
|
|
2436
2402
|
});
|
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-20230204123646",
|
|
4
4
|
"description": "The core css panda library",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.mjs",
|
|
@@ -17,36 +17,37 @@
|
|
|
17
17
|
"chokidar": "^3.5.3",
|
|
18
18
|
"fast-glob": "^3.2.12",
|
|
19
19
|
"fs-extra": "11.1.0",
|
|
20
|
-
"is-glob": "^4.0.3",
|
|
21
20
|
"glob-parent": "^6.0.2",
|
|
22
21
|
"hookable": "5.4.2",
|
|
22
|
+
"is-glob": "^4.0.3",
|
|
23
|
+
"javascript-stringify": "2.1.0",
|
|
24
|
+
"lil-fp": "1.1.8",
|
|
23
25
|
"lodash.merge": "4.6.2",
|
|
24
26
|
"look-it-up": "2.1.0",
|
|
25
27
|
"outdent": " ^0.8.0",
|
|
26
|
-
"preferred-pm": "^3.0.3",
|
|
27
|
-
"postcss": "8.4.21",
|
|
28
28
|
"pkg-types": "1.0.1",
|
|
29
29
|
"pluralize": "8.0.0",
|
|
30
|
-
"
|
|
30
|
+
"postcss": "8.4.21",
|
|
31
|
+
"preferred-pm": "^3.0.3",
|
|
31
32
|
"ts-pattern": "4.1.3",
|
|
32
33
|
"ts-morph": "17.0.1",
|
|
33
|
-
"@pandacss/
|
|
34
|
-
"@pandacss/
|
|
35
|
-
"@pandacss/error": "0.0.0-dev-
|
|
36
|
-
"@pandacss/
|
|
37
|
-
"@pandacss/
|
|
38
|
-
"@pandacss/
|
|
39
|
-
"@pandacss/
|
|
40
|
-
"@pandacss/
|
|
41
|
-
"@pandacss/
|
|
34
|
+
"@pandacss/config": "0.0.0-dev-20230204123646",
|
|
35
|
+
"@pandacss/core": "0.0.0-dev-20230204123646",
|
|
36
|
+
"@pandacss/error": "0.0.0-dev-20230204123646",
|
|
37
|
+
"@pandacss/is-valid-prop": "0.0.0-dev-20230204123646",
|
|
38
|
+
"@pandacss/logger": "0.0.0-dev-20230204123646",
|
|
39
|
+
"@pandacss/parser": "0.0.0-dev-20230204123646",
|
|
40
|
+
"@pandacss/shared": "0.0.0-dev-20230204123646",
|
|
41
|
+
"@pandacss/token-dictionary": "0.0.0-dev-20230204123646",
|
|
42
|
+
"@pandacss/types": "0.0.0-dev-20230204123646"
|
|
42
43
|
},
|
|
43
44
|
"devDependencies": {
|
|
44
45
|
"@types/fs-extra": "11.0.1",
|
|
45
|
-
"@types/is-glob": "^4.0.2",
|
|
46
46
|
"@types/glob-parent": "^5.1.1",
|
|
47
|
-
"@types/
|
|
47
|
+
"@types/is-glob": "^4.0.2",
|
|
48
48
|
"@types/lodash.merge": "4.6.7",
|
|
49
|
-
"@
|
|
49
|
+
"@types/pluralize": "0.0.29",
|
|
50
|
+
"@pandacss/fixture": "0.0.0-dev-20230204123646"
|
|
50
51
|
},
|
|
51
52
|
"scripts": {
|
|
52
53
|
"build": "tsup src/index.ts --format=cjs,esm --shims --dts",
|