@4399ywkf/core 5.0.26 → 5.0.28
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/biome.json +88 -0
- package/dist/cli/index.js +2225 -108
- package/dist/cli/index.js.map +1 -1
- package/dist/config/index.d.ts +24 -4
- package/dist/config/index.js +2124 -6
- package/dist/config/index.js.map +1 -1
- package/dist/index.d.ts +5 -487
- package/dist/index.js +4276 -3939
- package/dist/index.js.map +1 -1
- package/dist/plugin/index.d.ts +3 -3
- package/dist/rspack/index.d.ts +2 -2
- package/dist/rspack/index.js +2129 -72
- package/dist/rspack/index.js.map +1 -1
- package/dist/runtime/index.d.ts +2 -2
- package/dist/schema-CMyZyL6E.d.ts +1153 -0
- package/dist/{types-DbUq-VY8.d.ts → types-BYqzyGAY.d.ts} +1 -1
- package/package.json +5 -3
- package/dist/schema-runIYOB7.d.ts +0 -407
package/dist/index.d.ts
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { G as GeneratorContext,
|
|
2
|
-
export {
|
|
1
|
+
import { G as GeneratorContext, e as PluginHooks, Y as YwkfConfig, f as PluginConfig } from './schema-CMyZyL6E.js';
|
|
2
|
+
export { A as AnalyticsPluginOptions, h as BiomePluginOptions, j as BrowserCheckPluginOptions, k as BrowserMinVersions, y as BuildHooks, C as CodeInjection, D as DevServerConfig, E as EnvConfig, m as GarfishPluginOptions, F as GeneratedFile, J as GeneratorHooks, H as HtmlConfig, I as I18nPluginOptions, M as MicroFrontendConfig, q as MockPluginOptions, b as OutputConfig, P as PerformanceConfig, K as PluginContext, s as ReactQueryPluginOptions, R as RouterConfig, L as RouterHooks, N as RuntimeHooks, S as StyleConfig, u as TailwindPluginOptions, v as ThemePluginOptions, T as ToolsConfig, Q as YwkfPlugin, Z as ZustandPluginOptions, g as analyticsPlugin, i as biomePlugin, l as browserCheckPlugin, d as defaultConfig, a as defineConfig, n as garfishPlugin, o as getDefaultBiomeConfig, p as i18nPlugin, r as mockPlugin, t as reactQueryPlugin, w as tailwindPlugin, x as themePlugin, z as zustandPlugin } from './schema-CMyZyL6E.js';
|
|
3
3
|
import { Compiler } from '@rspack/core';
|
|
4
4
|
export { PluginManager, createPlugin, definePlugin } from './plugin/index.js';
|
|
5
5
|
export { ConventionalRouteGenerator, ConventionalRoutePlugin, ConventionalRoutePluginOptions, GeneratorOptions, RouteConfig, generateConventionalRoutes } from './router/index.js';
|
|
6
6
|
export { createBaseConfig, createDevConfig, createProdConfig, createRspackConfig } from './rspack/index.js';
|
|
7
7
|
export { AppContext, AppContextProvider, ErrorBoundary, RootProvider, bootstrap, createMicroApp, createProvider, getMicroAppPublicPath, isMicroAppEnv, unmount, useApp, useAppName, useBasename, useEnv, useIsDev } from './runtime/index.js';
|
|
8
|
-
export {
|
|
8
|
+
export { A as AntdConfig, a as AppConfig, b as AppContextValue, L as LifecycleHooks, M as MicroAppConfig, P as ProviderConfig } from './types-BYqzyGAY.js';
|
|
9
|
+
import 'react/jsx-runtime';
|
|
9
10
|
import 'react';
|
|
10
11
|
import 'react-router';
|
|
11
|
-
import 'react/jsx-runtime';
|
|
12
12
|
|
|
13
13
|
/**
|
|
14
14
|
* 执行生产构建
|
|
@@ -142,486 +142,4 @@ declare class YwkfGeneratorPlugin {
|
|
|
142
142
|
private watchConfig;
|
|
143
143
|
}
|
|
144
144
|
|
|
145
|
-
|
|
146
|
-
/** 是否启用构建分析 */
|
|
147
|
-
buildAnalysis?: boolean;
|
|
148
|
-
/** 是否输出构建时间 */
|
|
149
|
-
timing?: boolean;
|
|
150
|
-
/** 是否分析 bundle 大小 */
|
|
151
|
-
bundleSize?: boolean;
|
|
152
|
-
/** 大文件警告阈值(KB) */
|
|
153
|
-
sizeWarningThreshold?: number;
|
|
154
|
-
}
|
|
155
|
-
/**
|
|
156
|
-
* 构建分析插件
|
|
157
|
-
*
|
|
158
|
-
* @example
|
|
159
|
-
* ```ts
|
|
160
|
-
* import { analyticsPlugin } from "@4399ywkf/core/plugin";
|
|
161
|
-
*
|
|
162
|
-
* export default defineConfig({
|
|
163
|
-
* plugins: [
|
|
164
|
-
* analyticsPlugin({
|
|
165
|
-
* timing: true,
|
|
166
|
-
* bundleSize: true,
|
|
167
|
-
* sizeWarningThreshold: 500, // 500KB
|
|
168
|
-
* }),
|
|
169
|
-
* ],
|
|
170
|
-
* });
|
|
171
|
-
* ```
|
|
172
|
-
*/
|
|
173
|
-
declare const analyticsPlugin: (options?: AnalyticsPluginOptions | undefined) => YwkfPlugin;
|
|
174
|
-
|
|
175
|
-
interface BiomePluginOptions {
|
|
176
|
-
/**
|
|
177
|
-
* 是否在项目根目录生成 biome.json(仅在文件不存在时)
|
|
178
|
-
* @default true
|
|
179
|
-
*/
|
|
180
|
-
scaffold?: boolean;
|
|
181
|
-
/**
|
|
182
|
-
* biome.json 的 formatter 缩进风格
|
|
183
|
-
* @default "space"
|
|
184
|
-
*/
|
|
185
|
-
indentStyle?: "space" | "tab";
|
|
186
|
-
/**
|
|
187
|
-
* JS/TS formatter 引号风格
|
|
188
|
-
* @default "double"
|
|
189
|
-
*/
|
|
190
|
-
quoteStyle?: "double" | "single";
|
|
191
|
-
/**
|
|
192
|
-
* 箭头函数参数括号
|
|
193
|
-
* @default "always"
|
|
194
|
-
*/
|
|
195
|
-
arrowParentheses?: "always" | "asNeeded";
|
|
196
|
-
/**
|
|
197
|
-
* JS/TS 行宽
|
|
198
|
-
* @default 100
|
|
199
|
-
*/
|
|
200
|
-
lineWidth?: number;
|
|
201
|
-
/**
|
|
202
|
-
* 是否启用 organizeImports
|
|
203
|
-
* @default true
|
|
204
|
-
*/
|
|
205
|
-
organizeImports?: boolean;
|
|
206
|
-
/**
|
|
207
|
-
* 额外忽略的文件 glob
|
|
208
|
-
*/
|
|
209
|
-
ignore?: string[];
|
|
210
|
-
/**
|
|
211
|
-
* 自定义 linter 规则覆盖(浅合并到默认规则上)
|
|
212
|
-
*/
|
|
213
|
-
rules?: Record<string, Record<string, string>>;
|
|
214
|
-
}
|
|
215
|
-
/**
|
|
216
|
-
* Biome 代码规范插件
|
|
217
|
-
*
|
|
218
|
-
* 在 setup 阶段自动生成 biome.json,为项目提供统一的
|
|
219
|
-
* Lint / Format / Import Sorting 规范。
|
|
220
|
-
*
|
|
221
|
-
* 默认配置参考 modern.js 的 biome 方案,并适配 React + Ant Design 项目。
|
|
222
|
-
*
|
|
223
|
-
* @example
|
|
224
|
-
* ```ts
|
|
225
|
-
* import { defineConfig, biomePlugin } from "@4399ywkf/core";
|
|
226
|
-
*
|
|
227
|
-
* export default defineConfig({
|
|
228
|
-
* plugins: [
|
|
229
|
-
* biomePlugin(),
|
|
230
|
-
* ],
|
|
231
|
-
* });
|
|
232
|
-
* ```
|
|
233
|
-
*/
|
|
234
|
-
declare const biomePlugin: (options?: BiomePluginOptions | undefined) => YwkfPlugin;
|
|
235
|
-
/**
|
|
236
|
-
* 生成默认 biome.json 配置内容(纯数据,供 CLI 脚手架使用)
|
|
237
|
-
*/
|
|
238
|
-
declare function getDefaultBiomeConfig(): Record<string, unknown>;
|
|
239
|
-
|
|
240
|
-
interface GarfishPluginOptions {
|
|
241
|
-
/** 应用名称(微前端标识) */
|
|
242
|
-
appName?: string;
|
|
243
|
-
/** 是否作为主应用 */
|
|
244
|
-
master?: boolean;
|
|
245
|
-
/** 子应用列表(主应用模式) */
|
|
246
|
-
apps?: {
|
|
247
|
-
name: string;
|
|
248
|
-
entry: string;
|
|
249
|
-
activeRule: string;
|
|
250
|
-
basename?: string;
|
|
251
|
-
}[];
|
|
252
|
-
/** 沙箱配置 */
|
|
253
|
-
sandbox?: {
|
|
254
|
-
/** 是否开启 JS 沙箱 */
|
|
255
|
-
open?: boolean;
|
|
256
|
-
/** 是否开启快照沙箱 */
|
|
257
|
-
snapshot?: boolean;
|
|
258
|
-
/** 样式隔离 */
|
|
259
|
-
strictStyleIsolation?: boolean;
|
|
260
|
-
};
|
|
261
|
-
}
|
|
262
|
-
/**
|
|
263
|
-
* Garfish 微前端插件
|
|
264
|
-
*
|
|
265
|
-
* 通过插件方式启用微前端功能,支持子应用和主应用两种模式。
|
|
266
|
-
*
|
|
267
|
-
* @example
|
|
268
|
-
* ```ts
|
|
269
|
-
* // ywkf.config.ts - 子应用模式
|
|
270
|
-
* import { defineConfig, garfishPlugin } from "@4399ywkf/core";
|
|
271
|
-
*
|
|
272
|
-
* export default defineConfig({
|
|
273
|
-
* plugins: [
|
|
274
|
-
* garfishPlugin({
|
|
275
|
-
* appName: "sub-app",
|
|
276
|
-
* }),
|
|
277
|
-
* ],
|
|
278
|
-
* });
|
|
279
|
-
* ```
|
|
280
|
-
*
|
|
281
|
-
* @example
|
|
282
|
-
* ```ts
|
|
283
|
-
* // ywkf.config.ts - 主应用模式
|
|
284
|
-
* import { defineConfig, garfishPlugin } from "@4399ywkf/core";
|
|
285
|
-
*
|
|
286
|
-
* export default defineConfig({
|
|
287
|
-
* plugins: [
|
|
288
|
-
* garfishPlugin({
|
|
289
|
-
* master: true,
|
|
290
|
-
* apps: [
|
|
291
|
-
* { name: "sub-app", entry: "http://localhost:3001", activeRule: "/sub" },
|
|
292
|
-
* ],
|
|
293
|
-
* }),
|
|
294
|
-
* ],
|
|
295
|
-
* });
|
|
296
|
-
* ```
|
|
297
|
-
*/
|
|
298
|
-
declare const garfishPlugin: (options?: GarfishPluginOptions | undefined) => YwkfPlugin;
|
|
299
|
-
|
|
300
|
-
interface I18nPluginOptions {
|
|
301
|
-
/**
|
|
302
|
-
* 默认语言
|
|
303
|
-
* @default "zh-CN"
|
|
304
|
-
*/
|
|
305
|
-
defaultLocale?: string;
|
|
306
|
-
/**
|
|
307
|
-
* 支持的语言列表
|
|
308
|
-
* @default ["zh-CN", "en-US"]
|
|
309
|
-
*/
|
|
310
|
-
locales?: string[];
|
|
311
|
-
/**
|
|
312
|
-
* 翻译 JSON 文件目录(相对于项目根目录)
|
|
313
|
-
* 非默认语言的 JSON 翻译文件存放位置
|
|
314
|
-
* @default "locales"
|
|
315
|
-
*/
|
|
316
|
-
localesDir?: string;
|
|
317
|
-
/**
|
|
318
|
-
* 默认语言 TS 源文件目录(相对于项目根目录)
|
|
319
|
-
* 开发者在此编写 TypeScript 翻译源文件,作为 i18n 的 single source of truth
|
|
320
|
-
* @default "src/locales/default"
|
|
321
|
-
*/
|
|
322
|
-
sourceDir?: string;
|
|
323
|
-
/**
|
|
324
|
-
* 默认命名空间
|
|
325
|
-
* @default ["common"]
|
|
326
|
-
*/
|
|
327
|
-
defaultNS?: string[];
|
|
328
|
-
/**
|
|
329
|
-
* 是否自动生成初始脚手架文件
|
|
330
|
-
* @default true
|
|
331
|
-
*/
|
|
332
|
-
autoScaffold?: boolean;
|
|
333
|
-
}
|
|
334
|
-
/**
|
|
335
|
-
* 国际化插件(TS-first 工作流)
|
|
336
|
-
*
|
|
337
|
-
* 开发流程:
|
|
338
|
-
* 1. 开发者在 src/locales/default/ 中编写 TypeScript 翻译源文件(有类型推导 + IDE 补全)
|
|
339
|
-
* 2. 运行 `pnpm i18n:gen` 将 TS 源文件转换为 locales/{defaultLocale}/*.json
|
|
340
|
-
* 3. 运行 `pnpm i18n` 使用 @lobehub/i18n-cli 将默认语言 JSON 翻译为其他语言
|
|
341
|
-
* 4. 运行时:开发模式下默认语言直接 import TS,其他场景懒加载 JSON
|
|
342
|
-
*
|
|
343
|
-
* @example
|
|
344
|
-
* ```ts
|
|
345
|
-
* import { defineConfig, i18nPlugin } from "@4399ywkf/core";
|
|
346
|
-
*
|
|
347
|
-
* export default defineConfig({
|
|
348
|
-
* plugins: [
|
|
349
|
-
* i18nPlugin({
|
|
350
|
-
* defaultLocale: "zh-CN",
|
|
351
|
-
* locales: ["zh-CN", "en-US", "ja-JP"],
|
|
352
|
-
* }),
|
|
353
|
-
* ],
|
|
354
|
-
* });
|
|
355
|
-
* ```
|
|
356
|
-
*/
|
|
357
|
-
declare const i18nPlugin: (options?: I18nPluginOptions | undefined) => YwkfPlugin;
|
|
358
|
-
|
|
359
|
-
interface MockPluginOptions {
|
|
360
|
-
/** Mock 文件目录 */
|
|
361
|
-
mockDir?: string;
|
|
362
|
-
/** 是否在生产环境启用 */
|
|
363
|
-
enableInProd?: boolean;
|
|
364
|
-
/** 延迟时间(模拟网络延迟) */
|
|
365
|
-
delay?: number;
|
|
366
|
-
/** 前缀路径 */
|
|
367
|
-
prefix?: string;
|
|
368
|
-
}
|
|
369
|
-
/**
|
|
370
|
-
* Mock 数据插件
|
|
371
|
-
*
|
|
372
|
-
* @example
|
|
373
|
-
* ```ts
|
|
374
|
-
* // ywkf.config.ts
|
|
375
|
-
* import { mockPlugin } from "@4399ywkf/core/plugin";
|
|
376
|
-
*
|
|
377
|
-
* export default defineConfig({
|
|
378
|
-
* plugins: [
|
|
379
|
-
* mockPlugin({
|
|
380
|
-
* mockDir: "mock",
|
|
381
|
-
* prefix: "/api",
|
|
382
|
-
* }),
|
|
383
|
-
* ],
|
|
384
|
-
* });
|
|
385
|
-
* ```
|
|
386
|
-
*
|
|
387
|
-
* Mock 文件示例 (mock/user.ts):
|
|
388
|
-
* ```ts
|
|
389
|
-
* export default {
|
|
390
|
-
* "GET /api/users": [
|
|
391
|
-
* { id: 1, name: "张三" },
|
|
392
|
-
* ],
|
|
393
|
-
* "POST /api/users": (req, res) => {
|
|
394
|
-
* res.json({ success: true });
|
|
395
|
-
* },
|
|
396
|
-
* };
|
|
397
|
-
* ```
|
|
398
|
-
*/
|
|
399
|
-
declare const mockPlugin: (options?: MockPluginOptions | undefined) => YwkfPlugin;
|
|
400
|
-
|
|
401
|
-
interface ReactQueryPluginOptions {
|
|
402
|
-
/**
|
|
403
|
-
* 默认 staleTime(毫秒)
|
|
404
|
-
* @default 5 * 60 * 1000 (5 分钟)
|
|
405
|
-
*/
|
|
406
|
-
staleTime?: number;
|
|
407
|
-
/**
|
|
408
|
-
* 默认 gcTime(毫秒)
|
|
409
|
-
* @default 10 * 60 * 1000 (10 分钟)
|
|
410
|
-
*/
|
|
411
|
-
gcTime?: number;
|
|
412
|
-
/**
|
|
413
|
-
* 默认重试次数
|
|
414
|
-
* @default 1
|
|
415
|
-
*/
|
|
416
|
-
retry?: number | boolean;
|
|
417
|
-
/**
|
|
418
|
-
* 是否开启 React Query DevTools(仅开发模式生效)
|
|
419
|
-
* @default true
|
|
420
|
-
*/
|
|
421
|
-
devtools?: boolean;
|
|
422
|
-
/**
|
|
423
|
-
* axios baseURL
|
|
424
|
-
* @default ""
|
|
425
|
-
*/
|
|
426
|
-
baseURL?: string;
|
|
427
|
-
/**
|
|
428
|
-
* 请求超时时间(毫秒)
|
|
429
|
-
* @default 15000
|
|
430
|
-
*/
|
|
431
|
-
timeout?: number;
|
|
432
|
-
}
|
|
433
|
-
/**
|
|
434
|
-
* React Query + Axios 请求层插件
|
|
435
|
-
*
|
|
436
|
-
* - 自动注入 QueryClientProvider
|
|
437
|
-
* - 生成 .ywkf/query-client.ts(QueryClient 实例 + 默认配置)
|
|
438
|
-
* - 生成 .ywkf/request.ts(axios 封装 + 拦截器骨架)
|
|
439
|
-
* - 开发模式可选开启 React Query DevTools
|
|
440
|
-
*
|
|
441
|
-
* @example
|
|
442
|
-
* ```ts
|
|
443
|
-
* import { defineConfig, reactQueryPlugin } from "@4399ywkf/core";
|
|
444
|
-
*
|
|
445
|
-
* export default defineConfig({
|
|
446
|
-
* plugins: [
|
|
447
|
-
* reactQueryPlugin({ staleTime: 5 * 60 * 1000 }),
|
|
448
|
-
* ],
|
|
449
|
-
* });
|
|
450
|
-
* ```
|
|
451
|
-
*/
|
|
452
|
-
declare const reactQueryPlugin: (options?: ReactQueryPluginOptions | undefined) => YwkfPlugin;
|
|
453
|
-
|
|
454
|
-
interface TailwindPluginOptions {
|
|
455
|
-
/**
|
|
456
|
-
* 自定义暗色模式选择器
|
|
457
|
-
* @default '&:where([data-theme="dark"], [data-theme="dark"] *)'
|
|
458
|
-
*/
|
|
459
|
-
darkModeSelector?: string;
|
|
460
|
-
/**
|
|
461
|
-
* 是否生成 postcss.config.js(如果不存在)
|
|
462
|
-
* @default true
|
|
463
|
-
*/
|
|
464
|
-
autoConfig?: boolean;
|
|
465
|
-
/**
|
|
466
|
-
* 额外的 CSS 内容(追加到 index.css 之后)
|
|
467
|
-
*/
|
|
468
|
-
extraCSS?: string;
|
|
469
|
-
}
|
|
470
|
-
/**
|
|
471
|
-
* Tailwind CSS 插件
|
|
472
|
-
*
|
|
473
|
-
* 自动配置 Tailwind CSS:
|
|
474
|
-
* - 注入 `@import "tailwindcss"` 到 index.css
|
|
475
|
-
* - 确保 postcss.config.js 存在
|
|
476
|
-
* - 修改 Rspack 配置添加 postcss-loader
|
|
477
|
-
*
|
|
478
|
-
* @example
|
|
479
|
-
* ```ts
|
|
480
|
-
* import { defineConfig, tailwindPlugin } from "@4399ywkf/core";
|
|
481
|
-
*
|
|
482
|
-
* export default defineConfig({
|
|
483
|
-
* plugins: [
|
|
484
|
-
* tailwindPlugin(),
|
|
485
|
-
* ],
|
|
486
|
-
* });
|
|
487
|
-
* ```
|
|
488
|
-
*/
|
|
489
|
-
declare const tailwindPlugin: (options?: TailwindPluginOptions | undefined) => YwkfPlugin;
|
|
490
|
-
|
|
491
|
-
interface ThemePluginOptions {
|
|
492
|
-
/**
|
|
493
|
-
* 是否启用暗色模式切换能力
|
|
494
|
-
* @default true
|
|
495
|
-
*/
|
|
496
|
-
darkMode?: boolean;
|
|
497
|
-
/**
|
|
498
|
-
* 默认主题模式(运行时可通过 useThemeStore 动态切换)
|
|
499
|
-
* @default "light"
|
|
500
|
-
*/
|
|
501
|
-
defaultAppearance?: "light" | "dark" | "auto";
|
|
502
|
-
/**
|
|
503
|
-
* 主色调(Lobe-UI 命名预设,运行时可通过 useThemeStore 动态切换)
|
|
504
|
-
*
|
|
505
|
-
* 不设置时使用 Lobe-UI 默认 primary 色阶(黑色系),
|
|
506
|
-
* 可选值:"blue" | "cyan" | "geekblue" | "gold" | "green" | "lime"
|
|
507
|
-
* | "magenta" | "orange" | "purple" | "red" | "volcano" | "yellow"
|
|
508
|
-
*
|
|
509
|
-
* @default undefined
|
|
510
|
-
*/
|
|
511
|
-
primaryColor?: string;
|
|
512
|
-
/**
|
|
513
|
-
* 中性色(Lobe-UI 命名预设)
|
|
514
|
-
*
|
|
515
|
-
* 可选值:"mauve" | "olive" | "sage" | "sand" | "slate"
|
|
516
|
-
*
|
|
517
|
-
* @default undefined
|
|
518
|
-
*/
|
|
519
|
-
neutralColor?: string;
|
|
520
|
-
/**
|
|
521
|
-
* antd 组件前缀
|
|
522
|
-
*
|
|
523
|
-
* 支持三种配置方式(优先级从高到低):
|
|
524
|
-
* 1. 运行时环境变量 process.env.YWKF_PREFIX_CLS
|
|
525
|
-
* 2. 插件选项中直接指定
|
|
526
|
-
* 3. 默认值 "ant"
|
|
527
|
-
*
|
|
528
|
-
* @default "ant"
|
|
529
|
-
*/
|
|
530
|
-
prefixCls?: string;
|
|
531
|
-
/**
|
|
532
|
-
* 是否启用 CSS 变量
|
|
533
|
-
* @default true
|
|
534
|
-
*/
|
|
535
|
-
cssVar?: boolean;
|
|
536
|
-
/**
|
|
537
|
-
* 是否注入全局样式重置
|
|
538
|
-
* @default true
|
|
539
|
-
*/
|
|
540
|
-
globalReset?: boolean;
|
|
541
|
-
/**
|
|
542
|
-
* 是否启用外部主题注入(微前端场景)
|
|
543
|
-
*
|
|
544
|
-
* 启用后:
|
|
545
|
-
* - 应用启动时读取 window.__YWKF_THEME__ 作为初始覆盖
|
|
546
|
-
* - 监听 ywkf:theme-change 自定义事件,实现运行时主题同步
|
|
547
|
-
*
|
|
548
|
-
* @default false
|
|
549
|
-
*/
|
|
550
|
-
externalTheme?: boolean;
|
|
551
|
-
/**
|
|
552
|
-
* 将 Tooltip / Dropdown / Modal 等弹层的挂载节点限定在 ThemeWrapper 容器内
|
|
553
|
-
*
|
|
554
|
-
* 解决问题:antd 弹层默认挂载到 document.body,在以下场景会导致样式失效:
|
|
555
|
-
* - 微前端子应用使用 StyleProvider 将样式注入到子应用容器,弹层挂载 body 后脱离样式范围
|
|
556
|
-
* - CSS 变量作用域被限定在特定容器,body 上的弹层无法继承
|
|
557
|
-
*
|
|
558
|
-
* 启用后会在 ThemeWrapper 内创建一个 `data-ywkf-root` 容器作为弹层挂载点,
|
|
559
|
-
* 该容器始终是 StyleProvider 的子孙节点,样式链路不会断裂。
|
|
560
|
-
*
|
|
561
|
-
* @default true
|
|
562
|
-
*/
|
|
563
|
-
scopePopupContainer?: boolean;
|
|
564
|
-
}
|
|
565
|
-
/**
|
|
566
|
-
* 响应式主题系统插件
|
|
567
|
-
*
|
|
568
|
-
* 基于 antd-style + @4399ywkf/theme-system + Zustand 提供运行时可变的主题管理:
|
|
569
|
-
* - 使用 Lobe-UI 色彩体系(13 阶色阶 + 自定义算法)
|
|
570
|
-
* - 支持 PrimaryColors / NeutralColors 命名预设
|
|
571
|
-
* - 亮/暗色/跟随系统自动切换
|
|
572
|
-
* - 支持微前端场景主应用注入主题
|
|
573
|
-
*
|
|
574
|
-
* @example
|
|
575
|
-
* ```ts
|
|
576
|
-
* import { defineConfig, themePlugin } from "@4399ywkf/core";
|
|
577
|
-
*
|
|
578
|
-
* export default defineConfig({
|
|
579
|
-
* plugins: [
|
|
580
|
-
* themePlugin({
|
|
581
|
-
* defaultAppearance: "light",
|
|
582
|
-
* primaryColor: "geekblue",
|
|
583
|
-
* neutralColor: "slate",
|
|
584
|
-
* prefixCls: "my-app",
|
|
585
|
-
* }),
|
|
586
|
-
* ],
|
|
587
|
-
* });
|
|
588
|
-
* ```
|
|
589
|
-
*/
|
|
590
|
-
declare const themePlugin: (options?: ThemePluginOptions | undefined) => YwkfPlugin;
|
|
591
|
-
|
|
592
|
-
interface ZustandPluginOptions {
|
|
593
|
-
/**
|
|
594
|
-
* 是否自动生成 store 脚手架(仅在 store/ 目录不存在时)
|
|
595
|
-
* @default true
|
|
596
|
-
*/
|
|
597
|
-
scaffold?: boolean;
|
|
598
|
-
/**
|
|
599
|
-
* store 目录路径(相对于项目根目录)
|
|
600
|
-
* @default "store"
|
|
601
|
-
*/
|
|
602
|
-
storeDir?: string;
|
|
603
|
-
}
|
|
604
|
-
/**
|
|
605
|
-
* Zustand 状态管理插件
|
|
606
|
-
*
|
|
607
|
-
* 采用扁平域/Slice 架构:
|
|
608
|
-
* - store/{domain}/slices/ 按业务域拆分
|
|
609
|
-
* - 每个 slice 拆为 initialState.ts + actions.ts
|
|
610
|
-
* - 域级 store.ts 聚合所有 slice
|
|
611
|
-
* - 使用 StateCreator<Store, [['zustand/devtools', never]], [], Action> 标准范式
|
|
612
|
-
* - 内置 devtools + subscribeWithSelector 中间件
|
|
613
|
-
*
|
|
614
|
-
* @example
|
|
615
|
-
* ```ts
|
|
616
|
-
* import { defineConfig, zustandPlugin } from "@4399ywkf/core";
|
|
617
|
-
*
|
|
618
|
-
* export default defineConfig({
|
|
619
|
-
* plugins: [
|
|
620
|
-
* zustandPlugin(),
|
|
621
|
-
* ],
|
|
622
|
-
* });
|
|
623
|
-
* ```
|
|
624
|
-
*/
|
|
625
|
-
declare const zustandPlugin: (options?: ZustandPluginOptions | undefined) => YwkfPlugin;
|
|
626
|
-
|
|
627
|
-
export { type AnalyticsPluginOptions, type BiomePluginOptions, type GarfishPluginOptions, GeneratorContext, type I18nPluginOptions, type MockPluginOptions, PluginConfig, PluginHooks, type ReactQueryPluginOptions, type TailwindPluginOptions, type ThemePluginOptions, YwkfConfig, YwkfGenerator, YwkfGeneratorPlugin, type YwkfGeneratorPluginOptions, YwkfPlugin, type ZustandPluginOptions, analyticsPlugin, biomePlugin, build, dev, garfishPlugin, getDefaultBiomeConfig, i18nPlugin, mockPlugin, reactQueryPlugin, tailwindPlugin, themePlugin, zustandPlugin };
|
|
145
|
+
export { GeneratorContext, PluginConfig, PluginHooks, YwkfConfig, YwkfGenerator, YwkfGeneratorPlugin, type YwkfGeneratorPluginOptions, build, dev };
|