@pandacss/node 0.0.0-dev-20240130133424 → 0.0.0-dev-20240201185610
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 +13 -4
- package/dist/index.d.ts +13 -4
- package/dist/index.js +57 -17
- package/dist/index.mjs +56 -17
- package/package.json +10 -10
package/dist/index.d.mts
CHANGED
|
@@ -53,7 +53,7 @@ declare class PandaContext extends Generator {
|
|
|
53
53
|
};
|
|
54
54
|
writeCss: (sheet?: Stylesheet) => Promise<PromiseSettledResult<void>[]> | undefined;
|
|
55
55
|
watchConfig: (cb: (file: string) => void | Promise<void>, opts?: Omit<WatchOptions, 'include'>) => void;
|
|
56
|
-
watchFiles: (cb: (event: WatcherEventType, file: string) => void | Promise<void>) => void;
|
|
56
|
+
watchFiles: (cb: (event: WatcherEventType, file: string) => void | Promise<void>, opts?: Omit<WatchOptions, 'include' | 'exclude' | 'poll' | 'cwd' | 'logger'>) => void;
|
|
57
57
|
}
|
|
58
58
|
|
|
59
59
|
interface Options {
|
|
@@ -246,14 +246,14 @@ declare function codegen(ctx: PandaContext, ids?: ArtifactId[]): Promise<{
|
|
|
246
246
|
msg: string;
|
|
247
247
|
}>;
|
|
248
248
|
|
|
249
|
-
declare const startProfiling: (cwd: string, prefix: string) => Promise<() => void>;
|
|
250
|
-
|
|
251
249
|
declare function loadConfigAndCreateContext(options?: {
|
|
252
250
|
cwd?: string;
|
|
253
251
|
config?: Config;
|
|
254
252
|
configPath?: string;
|
|
255
253
|
}): Promise<PandaContext>;
|
|
256
254
|
|
|
255
|
+
declare const startProfiling: (cwd: string, prefix: string) => Promise<() => void>;
|
|
256
|
+
|
|
257
257
|
interface CssGenOptions {
|
|
258
258
|
cwd: string;
|
|
259
259
|
outfile?: string;
|
|
@@ -273,6 +273,15 @@ declare function generate(config: Config, configPath?: string): Promise<void>;
|
|
|
273
273
|
|
|
274
274
|
declare function setupGitIgnore(ctx: PandaContext): void;
|
|
275
275
|
|
|
276
|
+
interface LogstreamOptions {
|
|
277
|
+
cwd?: string;
|
|
278
|
+
logfile?: string;
|
|
279
|
+
}
|
|
280
|
+
declare const setLogStream: (options: LogstreamOptions) => {
|
|
281
|
+
end(): void;
|
|
282
|
+
[Symbol.dispose]: () => void;
|
|
283
|
+
};
|
|
284
|
+
|
|
276
285
|
declare function parseDependency(fileOrGlob: string): Message | null;
|
|
277
286
|
|
|
278
287
|
type SetupOptions = Partial<Config> & {
|
|
@@ -281,4 +290,4 @@ type SetupOptions = Partial<Config> & {
|
|
|
281
290
|
declare function setupConfig(cwd: string, opts?: SetupOptions): Promise<void>;
|
|
282
291
|
declare function setupPostcss(cwd: string): Promise<void>;
|
|
283
292
|
|
|
284
|
-
export { Builder, type CssGenOptions, PandaContext, analyzeTokens, buildInfo, codegen, cssgen, debug, generate, loadConfigAndCreateContext, parseDependency, setupConfig, setupGitIgnore, setupPostcss, startProfiling, writeAnalyzeJSON };
|
|
293
|
+
export { Builder, type CssGenOptions, PandaContext, analyzeTokens, buildInfo, codegen, cssgen, debug, generate, loadConfigAndCreateContext, parseDependency, setLogStream, setupConfig, setupGitIgnore, setupPostcss, startProfiling, writeAnalyzeJSON };
|
package/dist/index.d.ts
CHANGED
|
@@ -53,7 +53,7 @@ declare class PandaContext extends Generator {
|
|
|
53
53
|
};
|
|
54
54
|
writeCss: (sheet?: Stylesheet) => Promise<PromiseSettledResult<void>[]> | undefined;
|
|
55
55
|
watchConfig: (cb: (file: string) => void | Promise<void>, opts?: Omit<WatchOptions, 'include'>) => void;
|
|
56
|
-
watchFiles: (cb: (event: WatcherEventType, file: string) => void | Promise<void>) => void;
|
|
56
|
+
watchFiles: (cb: (event: WatcherEventType, file: string) => void | Promise<void>, opts?: Omit<WatchOptions, 'include' | 'exclude' | 'poll' | 'cwd' | 'logger'>) => void;
|
|
57
57
|
}
|
|
58
58
|
|
|
59
59
|
interface Options {
|
|
@@ -246,14 +246,14 @@ declare function codegen(ctx: PandaContext, ids?: ArtifactId[]): Promise<{
|
|
|
246
246
|
msg: string;
|
|
247
247
|
}>;
|
|
248
248
|
|
|
249
|
-
declare const startProfiling: (cwd: string, prefix: string) => Promise<() => void>;
|
|
250
|
-
|
|
251
249
|
declare function loadConfigAndCreateContext(options?: {
|
|
252
250
|
cwd?: string;
|
|
253
251
|
config?: Config;
|
|
254
252
|
configPath?: string;
|
|
255
253
|
}): Promise<PandaContext>;
|
|
256
254
|
|
|
255
|
+
declare const startProfiling: (cwd: string, prefix: string) => Promise<() => void>;
|
|
256
|
+
|
|
257
257
|
interface CssGenOptions {
|
|
258
258
|
cwd: string;
|
|
259
259
|
outfile?: string;
|
|
@@ -273,6 +273,15 @@ declare function generate(config: Config, configPath?: string): Promise<void>;
|
|
|
273
273
|
|
|
274
274
|
declare function setupGitIgnore(ctx: PandaContext): void;
|
|
275
275
|
|
|
276
|
+
interface LogstreamOptions {
|
|
277
|
+
cwd?: string;
|
|
278
|
+
logfile?: string;
|
|
279
|
+
}
|
|
280
|
+
declare const setLogStream: (options: LogstreamOptions) => {
|
|
281
|
+
end(): void;
|
|
282
|
+
[Symbol.dispose]: () => void;
|
|
283
|
+
};
|
|
284
|
+
|
|
276
285
|
declare function parseDependency(fileOrGlob: string): Message | null;
|
|
277
286
|
|
|
278
287
|
type SetupOptions = Partial<Config> & {
|
|
@@ -281,4 +290,4 @@ type SetupOptions = Partial<Config> & {
|
|
|
281
290
|
declare function setupConfig(cwd: string, opts?: SetupOptions): Promise<void>;
|
|
282
291
|
declare function setupPostcss(cwd: string): Promise<void>;
|
|
283
292
|
|
|
284
|
-
export { Builder, type CssGenOptions, PandaContext, analyzeTokens, buildInfo, codegen, cssgen, debug, generate, loadConfigAndCreateContext, parseDependency, setupConfig, setupGitIgnore, setupPostcss, startProfiling, writeAnalyzeJSON };
|
|
293
|
+
export { Builder, type CssGenOptions, PandaContext, analyzeTokens, buildInfo, codegen, cssgen, debug, generate, loadConfigAndCreateContext, parseDependency, setLogStream, setupConfig, setupGitIgnore, setupPostcss, startProfiling, writeAnalyzeJSON };
|
package/dist/index.js
CHANGED
|
@@ -413,6 +413,7 @@ __export(src_exports, {
|
|
|
413
413
|
generate: () => generate,
|
|
414
414
|
loadConfigAndCreateContext: () => loadConfigAndCreateContext,
|
|
415
415
|
parseDependency: () => parseDependency,
|
|
416
|
+
setLogStream: () => setLogStream,
|
|
416
417
|
setupConfig: () => setupConfig,
|
|
417
418
|
setupGitIgnore: () => setupGitIgnore,
|
|
418
419
|
setupPostcss: () => setupPostcss,
|
|
@@ -2223,7 +2224,9 @@ var limit = pLimit(20);
|
|
|
2223
2224
|
async function codegen(ctx, ids) {
|
|
2224
2225
|
if (ctx.config.clean)
|
|
2225
2226
|
ctx.output.empty();
|
|
2226
|
-
const
|
|
2227
|
+
const artifacts = ctx.getArtifacts(ids);
|
|
2228
|
+
await ctx.hooks["codegen:prepare"]?.({ changed: ids, artifacts });
|
|
2229
|
+
const promises = artifacts.map((artifact) => limit(() => ctx.output.write(artifact)));
|
|
2227
2230
|
await Promise.allSettled(promises);
|
|
2228
2231
|
await ctx.hooks["codegen:done"]?.({ changed: ids });
|
|
2229
2232
|
return {
|
|
@@ -2327,8 +2330,8 @@ var nodeRuntime = {
|
|
|
2327
2330
|
readDirSync: import_fs_extra.default.readdirSync,
|
|
2328
2331
|
rmDirSync: import_fs_extra.default.emptyDirSync,
|
|
2329
2332
|
rmFileSync: import_fs_extra.default.removeSync,
|
|
2330
|
-
ensureDirSync(
|
|
2331
|
-
return import_fs_extra.default.ensureDirSync(
|
|
2333
|
+
ensureDirSync(path3) {
|
|
2334
|
+
return import_fs_extra.default.ensureDirSync(path3);
|
|
2332
2335
|
},
|
|
2333
2336
|
watch(options) {
|
|
2334
2337
|
const { include, exclude, cwd, poll } = options;
|
|
@@ -2495,10 +2498,11 @@ var PandaContext = class extends import_generator2.Generator {
|
|
|
2495
2498
|
})
|
|
2496
2499
|
);
|
|
2497
2500
|
};
|
|
2498
|
-
watchFiles = (cb) => {
|
|
2501
|
+
watchFiles = (cb, opts) => {
|
|
2499
2502
|
const { include, exclude, poll, cwd } = this.config;
|
|
2500
2503
|
import_logger5.logger.info("ctx:watch", this.messages.watch());
|
|
2501
2504
|
const watcher = this.runtime.fs.watch({
|
|
2505
|
+
...opts,
|
|
2502
2506
|
include,
|
|
2503
2507
|
exclude,
|
|
2504
2508
|
poll,
|
|
@@ -2837,12 +2841,12 @@ async function debug(ctx, options) {
|
|
|
2837
2841
|
const measureTotal = import_logger9.logger.time.debug(`Done parsing ${files.length} files`);
|
|
2838
2842
|
ctx.config.minify = false;
|
|
2839
2843
|
ctx.config.optimize = true;
|
|
2840
|
-
const { fs:
|
|
2844
|
+
const { fs: fs3, path: path3 } = ctx.runtime;
|
|
2841
2845
|
const outdir = options.outdir;
|
|
2842
2846
|
if (!options.dry && outdir) {
|
|
2843
|
-
|
|
2847
|
+
fs3.ensureDirSync(outdir);
|
|
2844
2848
|
import_logger9.logger.info("cli", `Writing ${import_logger9.colors.bold(`${outdir}/config.json`)}`);
|
|
2845
|
-
await
|
|
2849
|
+
await fs3.writeFile(`${outdir}/config.json`, JSON.stringify(ctx.config, null, 2));
|
|
2846
2850
|
}
|
|
2847
2851
|
if (options.onlyConfig) {
|
|
2848
2852
|
measureTotal();
|
|
@@ -2867,14 +2871,14 @@ async function debug(ctx, options) {
|
|
|
2867
2871
|
if (outdir) {
|
|
2868
2872
|
filesWithCss.push(file);
|
|
2869
2873
|
const parsedPath = (0, import_path5.parse)(file);
|
|
2870
|
-
const relative2 =
|
|
2871
|
-
const astJsonPath = `${relative2}/${parsedPath.name}.ast.json`.replaceAll(
|
|
2872
|
-
const cssPath = `${relative2}/${parsedPath.name}.css`.replaceAll(
|
|
2874
|
+
const relative2 = path3.relative(ctx.config.cwd, parsedPath.dir);
|
|
2875
|
+
const astJsonPath = `${relative2}/${parsedPath.name}.ast.json`.replaceAll(path3.sep, "__");
|
|
2876
|
+
const cssPath = `${relative2}/${parsedPath.name}.css`.replaceAll(path3.sep, "__");
|
|
2873
2877
|
import_logger9.logger.info("cli", `Writing ${import_logger9.colors.bold(`${outdir}/${astJsonPath}`)}`);
|
|
2874
2878
|
import_logger9.logger.info("cli", `Writing ${import_logger9.colors.bold(`${outdir}/${cssPath}`)}`);
|
|
2875
2879
|
return Promise.allSettled([
|
|
2876
|
-
|
|
2877
|
-
|
|
2880
|
+
fs3.writeFile(`${outdir}/${astJsonPath}`, JSON.stringify(result.toJSON(), null, 2)),
|
|
2881
|
+
fs3.writeFile(`${outdir}/${cssPath}`, css)
|
|
2878
2882
|
]);
|
|
2879
2883
|
}
|
|
2880
2884
|
});
|
|
@@ -2968,11 +2972,46 @@ function setupGitIgnore(ctx) {
|
|
|
2968
2972
|
}
|
|
2969
2973
|
}
|
|
2970
2974
|
|
|
2975
|
+
// src/logstream.ts
|
|
2976
|
+
init_cjs_shims();
|
|
2977
|
+
var import_logger11 = require("@pandacss/logger");
|
|
2978
|
+
var import_node_fs = __toESM(require("fs"));
|
|
2979
|
+
var import_node_path = __toESM(require("path"));
|
|
2980
|
+
var setLogStream = (options) => {
|
|
2981
|
+
const { cwd = process.cwd() } = options;
|
|
2982
|
+
let stream;
|
|
2983
|
+
if (options.logfile) {
|
|
2984
|
+
const outPath = import_node_path.default.resolve(cwd, options.logfile);
|
|
2985
|
+
ensure(outPath);
|
|
2986
|
+
import_logger11.logger.info("logfile", outPath);
|
|
2987
|
+
stream = import_node_fs.default.createWriteStream(outPath, { flags: "a" });
|
|
2988
|
+
import_logger11.logger.onLog = (entry) => {
|
|
2989
|
+
stream?.write(JSON.stringify(entry) + "\n");
|
|
2990
|
+
};
|
|
2991
|
+
}
|
|
2992
|
+
process.once("SIGINT", () => {
|
|
2993
|
+
stream?.end();
|
|
2994
|
+
});
|
|
2995
|
+
return {
|
|
2996
|
+
end() {
|
|
2997
|
+
stream?.end();
|
|
2998
|
+
},
|
|
2999
|
+
[Symbol.dispose]: () => {
|
|
3000
|
+
stream?.end();
|
|
3001
|
+
}
|
|
3002
|
+
};
|
|
3003
|
+
};
|
|
3004
|
+
var ensure = (outPath) => {
|
|
3005
|
+
const dirname2 = import_node_path.default.dirname(outPath);
|
|
3006
|
+
import_node_fs.default.mkdirSync(dirname2, { recursive: true });
|
|
3007
|
+
return outPath;
|
|
3008
|
+
};
|
|
3009
|
+
|
|
2971
3010
|
// src/setup-config.ts
|
|
2972
3011
|
init_cjs_shims();
|
|
2973
3012
|
var import_config7 = require("@pandacss/config");
|
|
2974
3013
|
var import_core2 = require("@pandacss/core");
|
|
2975
|
-
var
|
|
3014
|
+
var import_logger12 = require("@pandacss/logger");
|
|
2976
3015
|
var import_shared3 = require("@pandacss/shared");
|
|
2977
3016
|
var import_fs_extra2 = __toESM(require("fs-extra"));
|
|
2978
3017
|
var import_look_it_up2 = require("look-it-up");
|
|
@@ -2995,9 +3034,9 @@ async function setupConfig(cwd, opts = {}) {
|
|
|
2995
3034
|
const cmd = pm === "npm" ? "npm run" : pm;
|
|
2996
3035
|
const isTs = (0, import_look_it_up2.lookItUpSync)("tsconfig.json", cwd);
|
|
2997
3036
|
const file = isTs ? "panda.config.ts" : "panda.config.mjs";
|
|
2998
|
-
|
|
3037
|
+
import_logger12.logger.info("init:config", `creating panda config file: ${(0, import_logger12.quote)(file)}`);
|
|
2999
3038
|
if (!force && configFile) {
|
|
3000
|
-
|
|
3039
|
+
import_logger12.logger.warn("init:config", import_core2.messages.configExists(cmd));
|
|
3001
3040
|
} else {
|
|
3002
3041
|
const content = import_outdent2.outdent`
|
|
3003
3042
|
import { defineConfig } from "@pandacss/dev"
|
|
@@ -3030,11 +3069,11 @@ syntax: '${syntax}'` : ""}
|
|
|
3030
3069
|
})
|
|
3031
3070
|
`;
|
|
3032
3071
|
await import_fs_extra2.default.writeFile((0, import_path6.join)(cwd, file), import_prettier.default.format(content, { parser: "babel" }));
|
|
3033
|
-
|
|
3072
|
+
import_logger12.logger.log(import_core2.messages.thankYou());
|
|
3034
3073
|
}
|
|
3035
3074
|
}
|
|
3036
3075
|
async function setupPostcss(cwd) {
|
|
3037
|
-
|
|
3076
|
+
import_logger12.logger.info("init:postcss", `creating postcss config file: ${(0, import_logger12.quote)("postcss.config.cjs")}`);
|
|
3038
3077
|
const content = import_outdent2.outdent`
|
|
3039
3078
|
module.exports = {
|
|
3040
3079
|
plugins: {
|
|
@@ -3056,6 +3095,7 @@ module.exports = {
|
|
|
3056
3095
|
generate,
|
|
3057
3096
|
loadConfigAndCreateContext,
|
|
3058
3097
|
parseDependency,
|
|
3098
|
+
setLogStream,
|
|
3059
3099
|
setupConfig,
|
|
3060
3100
|
setupGitIgnore,
|
|
3061
3101
|
setupPostcss,
|
package/dist/index.mjs
CHANGED
|
@@ -2198,7 +2198,9 @@ var limit = pLimit(20);
|
|
|
2198
2198
|
async function codegen(ctx, ids) {
|
|
2199
2199
|
if (ctx.config.clean)
|
|
2200
2200
|
ctx.output.empty();
|
|
2201
|
-
const
|
|
2201
|
+
const artifacts = ctx.getArtifacts(ids);
|
|
2202
|
+
await ctx.hooks["codegen:prepare"]?.({ changed: ids, artifacts });
|
|
2203
|
+
const promises = artifacts.map((artifact) => limit(() => ctx.output.write(artifact)));
|
|
2202
2204
|
await Promise.allSettled(promises);
|
|
2203
2205
|
await ctx.hooks["codegen:done"]?.({ changed: ids });
|
|
2204
2206
|
return {
|
|
@@ -2302,8 +2304,8 @@ var nodeRuntime = {
|
|
|
2302
2304
|
readDirSync: fsExtra.readdirSync,
|
|
2303
2305
|
rmDirSync: fsExtra.emptyDirSync,
|
|
2304
2306
|
rmFileSync: fsExtra.removeSync,
|
|
2305
|
-
ensureDirSync(
|
|
2306
|
-
return fsExtra.ensureDirSync(
|
|
2307
|
+
ensureDirSync(path3) {
|
|
2308
|
+
return fsExtra.ensureDirSync(path3);
|
|
2307
2309
|
},
|
|
2308
2310
|
watch(options) {
|
|
2309
2311
|
const { include, exclude, cwd, poll } = options;
|
|
@@ -2470,10 +2472,11 @@ var PandaContext = class extends Generator2 {
|
|
|
2470
2472
|
})
|
|
2471
2473
|
);
|
|
2472
2474
|
};
|
|
2473
|
-
watchFiles = (cb) => {
|
|
2475
|
+
watchFiles = (cb, opts) => {
|
|
2474
2476
|
const { include, exclude, poll, cwd } = this.config;
|
|
2475
2477
|
logger5.info("ctx:watch", this.messages.watch());
|
|
2476
2478
|
const watcher = this.runtime.fs.watch({
|
|
2479
|
+
...opts,
|
|
2477
2480
|
include,
|
|
2478
2481
|
exclude,
|
|
2479
2482
|
poll,
|
|
@@ -2812,12 +2815,12 @@ async function debug(ctx, options) {
|
|
|
2812
2815
|
const measureTotal = logger9.time.debug(`Done parsing ${files.length} files`);
|
|
2813
2816
|
ctx.config.minify = false;
|
|
2814
2817
|
ctx.config.optimize = true;
|
|
2815
|
-
const { fs:
|
|
2818
|
+
const { fs: fs3, path: path3 } = ctx.runtime;
|
|
2816
2819
|
const outdir = options.outdir;
|
|
2817
2820
|
if (!options.dry && outdir) {
|
|
2818
|
-
|
|
2821
|
+
fs3.ensureDirSync(outdir);
|
|
2819
2822
|
logger9.info("cli", `Writing ${colors2.bold(`${outdir}/config.json`)}`);
|
|
2820
|
-
await
|
|
2823
|
+
await fs3.writeFile(`${outdir}/config.json`, JSON.stringify(ctx.config, null, 2));
|
|
2821
2824
|
}
|
|
2822
2825
|
if (options.onlyConfig) {
|
|
2823
2826
|
measureTotal();
|
|
@@ -2842,14 +2845,14 @@ async function debug(ctx, options) {
|
|
|
2842
2845
|
if (outdir) {
|
|
2843
2846
|
filesWithCss.push(file);
|
|
2844
2847
|
const parsedPath = parse2(file);
|
|
2845
|
-
const relative2 =
|
|
2846
|
-
const astJsonPath = `${relative2}/${parsedPath.name}.ast.json`.replaceAll(
|
|
2847
|
-
const cssPath = `${relative2}/${parsedPath.name}.css`.replaceAll(
|
|
2848
|
+
const relative2 = path3.relative(ctx.config.cwd, parsedPath.dir);
|
|
2849
|
+
const astJsonPath = `${relative2}/${parsedPath.name}.ast.json`.replaceAll(path3.sep, "__");
|
|
2850
|
+
const cssPath = `${relative2}/${parsedPath.name}.css`.replaceAll(path3.sep, "__");
|
|
2848
2851
|
logger9.info("cli", `Writing ${colors2.bold(`${outdir}/${astJsonPath}`)}`);
|
|
2849
2852
|
logger9.info("cli", `Writing ${colors2.bold(`${outdir}/${cssPath}`)}`);
|
|
2850
2853
|
return Promise.allSettled([
|
|
2851
|
-
|
|
2852
|
-
|
|
2854
|
+
fs3.writeFile(`${outdir}/${astJsonPath}`, JSON.stringify(result.toJSON(), null, 2)),
|
|
2855
|
+
fs3.writeFile(`${outdir}/${cssPath}`, css)
|
|
2853
2856
|
]);
|
|
2854
2857
|
}
|
|
2855
2858
|
});
|
|
@@ -2943,11 +2946,46 @@ function setupGitIgnore(ctx) {
|
|
|
2943
2946
|
}
|
|
2944
2947
|
}
|
|
2945
2948
|
|
|
2949
|
+
// src/logstream.ts
|
|
2950
|
+
init_esm_shims();
|
|
2951
|
+
import { logger as logger11 } from "@pandacss/logger";
|
|
2952
|
+
import fs2 from "node:fs";
|
|
2953
|
+
import path2 from "node:path";
|
|
2954
|
+
var setLogStream = (options) => {
|
|
2955
|
+
const { cwd = process.cwd() } = options;
|
|
2956
|
+
let stream;
|
|
2957
|
+
if (options.logfile) {
|
|
2958
|
+
const outPath = path2.resolve(cwd, options.logfile);
|
|
2959
|
+
ensure(outPath);
|
|
2960
|
+
logger11.info("logfile", outPath);
|
|
2961
|
+
stream = fs2.createWriteStream(outPath, { flags: "a" });
|
|
2962
|
+
logger11.onLog = (entry) => {
|
|
2963
|
+
stream?.write(JSON.stringify(entry) + "\n");
|
|
2964
|
+
};
|
|
2965
|
+
}
|
|
2966
|
+
process.once("SIGINT", () => {
|
|
2967
|
+
stream?.end();
|
|
2968
|
+
});
|
|
2969
|
+
return {
|
|
2970
|
+
end() {
|
|
2971
|
+
stream?.end();
|
|
2972
|
+
},
|
|
2973
|
+
[Symbol.dispose]: () => {
|
|
2974
|
+
stream?.end();
|
|
2975
|
+
}
|
|
2976
|
+
};
|
|
2977
|
+
};
|
|
2978
|
+
var ensure = (outPath) => {
|
|
2979
|
+
const dirname2 = path2.dirname(outPath);
|
|
2980
|
+
fs2.mkdirSync(dirname2, { recursive: true });
|
|
2981
|
+
return outPath;
|
|
2982
|
+
};
|
|
2983
|
+
|
|
2946
2984
|
// src/setup-config.ts
|
|
2947
2985
|
init_esm_shims();
|
|
2948
2986
|
import { findConfig as findConfig2 } from "@pandacss/config";
|
|
2949
2987
|
import { messages } from "@pandacss/core";
|
|
2950
|
-
import { logger as
|
|
2988
|
+
import { logger as logger12, quote } from "@pandacss/logger";
|
|
2951
2989
|
import { PandaError as PandaError2 } from "@pandacss/shared";
|
|
2952
2990
|
import fsExtra2 from "fs-extra";
|
|
2953
2991
|
import { lookItUpSync as lookItUpSync2 } from "look-it-up";
|
|
@@ -2970,9 +3008,9 @@ async function setupConfig(cwd, opts = {}) {
|
|
|
2970
3008
|
const cmd = pm === "npm" ? "npm run" : pm;
|
|
2971
3009
|
const isTs = lookItUpSync2("tsconfig.json", cwd);
|
|
2972
3010
|
const file = isTs ? "panda.config.ts" : "panda.config.mjs";
|
|
2973
|
-
|
|
3011
|
+
logger12.info("init:config", `creating panda config file: ${quote(file)}`);
|
|
2974
3012
|
if (!force && configFile) {
|
|
2975
|
-
|
|
3013
|
+
logger12.warn("init:config", messages.configExists(cmd));
|
|
2976
3014
|
} else {
|
|
2977
3015
|
const content = outdent2`
|
|
2978
3016
|
import { defineConfig } from "@pandacss/dev"
|
|
@@ -3005,11 +3043,11 @@ syntax: '${syntax}'` : ""}
|
|
|
3005
3043
|
})
|
|
3006
3044
|
`;
|
|
3007
3045
|
await fsExtra2.writeFile(join2(cwd, file), prettier.format(content, { parser: "babel" }));
|
|
3008
|
-
|
|
3046
|
+
logger12.log(messages.thankYou());
|
|
3009
3047
|
}
|
|
3010
3048
|
}
|
|
3011
3049
|
async function setupPostcss(cwd) {
|
|
3012
|
-
|
|
3050
|
+
logger12.info("init:postcss", `creating postcss config file: ${quote("postcss.config.cjs")}`);
|
|
3013
3051
|
const content = outdent2`
|
|
3014
3052
|
module.exports = {
|
|
3015
3053
|
plugins: {
|
|
@@ -3030,6 +3068,7 @@ export {
|
|
|
3030
3068
|
generate,
|
|
3031
3069
|
loadConfigAndCreateContext,
|
|
3032
3070
|
parseDependency,
|
|
3071
|
+
setLogStream,
|
|
3033
3072
|
setupConfig,
|
|
3034
3073
|
setupGitIgnore,
|
|
3035
3074
|
setupPostcss,
|
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-20240201185610",
|
|
4
4
|
"description": "The core css panda library",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.mjs",
|
|
@@ -53,15 +53,15 @@
|
|
|
53
53
|
"ts-pattern": "5.0.5",
|
|
54
54
|
"tsconfck": "^2.1.2",
|
|
55
55
|
"v8-profiler-next": "^1.10.0",
|
|
56
|
-
"@pandacss/config": "0.0.0-dev-
|
|
57
|
-
"@pandacss/core": "0.0.0-dev-
|
|
58
|
-
"@pandacss/extractor": "0.0.0-dev-
|
|
59
|
-
"@pandacss/generator": "0.0.0-dev-
|
|
60
|
-
"@pandacss/logger": "0.0.0-dev-
|
|
61
|
-
"@pandacss/parser": "0.0.0-dev-
|
|
62
|
-
"@pandacss/shared": "0.0.0-dev-
|
|
63
|
-
"@pandacss/token-dictionary": "0.0.0-dev-
|
|
64
|
-
"@pandacss/types": "0.0.0-dev-
|
|
56
|
+
"@pandacss/config": "0.0.0-dev-20240201185610",
|
|
57
|
+
"@pandacss/core": "0.0.0-dev-20240201185610",
|
|
58
|
+
"@pandacss/extractor": "0.0.0-dev-20240201185610",
|
|
59
|
+
"@pandacss/generator": "0.0.0-dev-20240201185610",
|
|
60
|
+
"@pandacss/logger": "0.0.0-dev-20240201185610",
|
|
61
|
+
"@pandacss/parser": "0.0.0-dev-20240201185610",
|
|
62
|
+
"@pandacss/shared": "0.0.0-dev-20240201185610",
|
|
63
|
+
"@pandacss/token-dictionary": "0.0.0-dev-20240201185610",
|
|
64
|
+
"@pandacss/types": "0.0.0-dev-20240201185610"
|
|
65
65
|
},
|
|
66
66
|
"devDependencies": {
|
|
67
67
|
"@types/fs-extra": "11.0.4",
|