@4399ywkf/core 5.0.17 → 5.0.19

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.
@@ -1,7 +1,7 @@
1
- import { Y as YwkfConfig } from '../schema-VPH72NAR.js';
2
- export { D as DevServerConfig, E as EnvConfig, H as HtmlConfig, M as MicroFrontendConfig, O as OutputConfig, P as PerformanceConfig, R as RouterConfig, S as StyleConfig, T as ToolsConfig, a as defaultConfig, d as defineConfig } from '../schema-VPH72NAR.js';
1
+ import { Y as YwkfConfig } from '../schema-CGQSqjRr.js';
2
+ export { D as DevServerConfig, E as EnvConfig, H as HtmlConfig, M as MicroFrontendConfig, O as OutputConfig, P as PerformanceConfig, R as RouterConfig, S as StyleConfig, T as ToolsConfig, d as defaultConfig, a as defineConfig } from '../schema-CGQSqjRr.js';
3
3
  import '@rspack/core';
4
- import '../types-BztKUufh.js';
4
+ import '../types-DbUq-VY8.js';
5
5
  import 'react';
6
6
  import 'react-router';
7
7
 
@@ -1,3 +1,9 @@
1
+ // src/config/loader.ts
2
+ import { existsSync } from "fs";
3
+ import { extname, resolve } from "path";
4
+ import { pathToFileURL } from "url";
5
+ import deepmerge from "deepmerge";
6
+
1
7
  // src/config/schema.ts
2
8
  function defineConfig(config) {
3
9
  return config;
@@ -61,16 +67,7 @@ var defaultConfig = {
61
67
  };
62
68
 
63
69
  // src/config/loader.ts
64
- import { existsSync } from "fs";
65
- import { resolve, extname } from "path";
66
- import { pathToFileURL } from "url";
67
- import deepmerge from "deepmerge";
68
- var CONFIG_FILES = [
69
- "ywkf.config.ts",
70
- "ywkf.config.mts",
71
- "ywkf.config.js",
72
- "ywkf.config.mjs"
73
- ];
70
+ var CONFIG_FILES = ["ywkf.config.ts", "ywkf.config.mts", "ywkf.config.js", "ywkf.config.mjs"];
74
71
  function findConfigFile(cwd) {
75
72
  for (const file of CONFIG_FILES) {
76
73
  const configPath = resolve(cwd, file);
@@ -108,9 +105,7 @@ function mergeConfig(userConfig, baseConfig = defaultConfig) {
108
105
  async function resolveConfig(cwd) {
109
106
  const configPath = findConfigFile(cwd);
110
107
  if (!configPath) {
111
- console.warn(
112
- "\u26A0\uFE0F \u672A\u627E\u5230\u914D\u7F6E\u6587\u4EF6 (ywkf.config.ts)\uFF0C\u4F7F\u7528\u9ED8\u8BA4\u914D\u7F6E"
113
- );
108
+ console.warn("\u26A0\uFE0F \u672A\u627E\u5230\u914D\u7F6E\u6587\u4EF6 (ywkf.config.ts)\uFF0C\u4F7F\u7528\u9ED8\u8BA4\u914D\u7F6E");
114
109
  return {
115
110
  config: defaultConfig,
116
111
  configPath: null
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/config/schema.ts","../../src/config/loader.ts"],"sourcesContent":["import type { Configuration as RspackConfig } from \"@rspack/core\";\nimport type { PluginConfig } from \"../plugin/types.js\";\n\n/**\n * 开发服务器配置\n */\nexport interface DevServerConfig {\n /** 开发服务器端口 */\n port?: number;\n /** 开发服务器主机 */\n host?: string;\n /** 代理配置 */\n proxy?: Record<string, string | object>;\n /** 是否开启 HTTPS */\n https?: boolean;\n}\n\n/**\n * 输出配置\n */\nexport interface OutputConfig {\n /** 输出目录 */\n path?: string;\n /** 公共路径 */\n publicPath?: string;\n /** 是否清理输出目录 */\n clean?: boolean;\n}\n\n/**\n * HTML 配置\n */\nexport interface HtmlConfig {\n /** 页面标题 */\n title?: string;\n /** HTML 模板路径 */\n template?: string;\n /** favicon 路径 */\n favicon?: string;\n /** 挂载根元素 ID */\n mountRoot?: string;\n}\n\n/**\n * 样式配置\n */\nexport interface StyleConfig {\n /** 是否启用 CSS Modules */\n cssModules?: boolean;\n /** Less 配置 */\n less?: {\n /** 是否启用 */\n enabled?: boolean;\n /** Less 选项 */\n lessOptions?: Record<string, unknown>;\n };\n /** Sass 配置 */\n sass?: {\n /** 是否启用 */\n enabled?: boolean;\n /** Sass 选项 */\n sassOptions?: Record<string, unknown>;\n };\n /** 是否启用 TailwindCSS */\n tailwindcss?: boolean;\n}\n\n/**\n * 路由配置\n */\nexport interface RouterConfig {\n /** 路由基础路径 */\n basename?: string;\n /** 是否启用约定式路由 */\n conventional?: boolean;\n /** 约定式路由扫描目录 */\n pagesDir?: string;\n /** 排除的文件/目录模式 */\n exclude?: (string | RegExp)[];\n}\n\n/**\n * 微前端配置\n */\nexport interface MicroFrontendConfig {\n /** 是否启用微前端模式 */\n enabled?: boolean;\n /** 应用名称(用于 UMD 导出) */\n name?: string;\n /** 微前端框架类型 */\n framework?: \"qiankun\" | \"garfish\";\n}\n\n/**\n * 性能配置\n */\nexport interface PerformanceConfig {\n /** 是否启用 Rsdoctor 分析 */\n rsdoctor?: boolean;\n /** 是否开启代码分割 */\n splitChunks?: boolean;\n /** 是否移除 console */\n dropConsole?: boolean;\n}\n\n/**\n * 工具链配置\n */\nexport interface ToolsConfig {\n /**\n * 自定义 Rspack 配置\n * @param config 当前配置\n * @param context 上下文信息\n * @returns 修改后的配置\n */\n rspack?: (\n config: RspackConfig,\n context: { isDev: boolean; isProd: boolean }\n ) => RspackConfig | void;\n}\n\n/**\n * 环境变量配置\n */\nexport interface EnvConfig {\n /** 公共环境变量文件路径 */\n publicEnvFile?: string;\n /** 环境特定的变量文件目录 */\n envDir?: string;\n}\n\n/**\n * 框架完整配置\n */\nexport interface YwkfConfig {\n /** 应用名称 */\n appName?: string;\n /** 应用中文名 */\n appCName?: string;\n /** 开发服务器配置 */\n dev?: DevServerConfig;\n /** 输出配置 */\n output?: OutputConfig;\n /** HTML 配置 */\n html?: HtmlConfig;\n /** 样式配置 */\n style?: StyleConfig;\n /** 路由配置 */\n router?: RouterConfig;\n /** 微前端配置 */\n microFrontend?: MicroFrontendConfig;\n /** 性能配置 */\n performance?: PerformanceConfig;\n /** 工具链配置 */\n tools?: ToolsConfig;\n /** 环境变量配置 */\n env?: EnvConfig;\n /** 路径别名 */\n alias?: Record<string, string>;\n /** 插件列表 */\n plugins?: PluginConfig[];\n}\n\n/**\n * 定义配置的辅助函数(提供类型提示)\n */\nexport function defineConfig(config: YwkfConfig): YwkfConfig {\n return config;\n}\n\n/**\n * 默认配置\n */\nexport const defaultConfig: Required<YwkfConfig> = {\n appName: \"app\",\n appCName: \"应用\",\n dev: {\n port: 3000,\n host: \"localhost\",\n proxy: {},\n https: false,\n },\n output: {\n path: \"dist\",\n publicPath: \"/\",\n clean: true,\n },\n html: {\n title: \"应用\",\n template: \"public/index.html\",\n favicon: \"public/favicon.ico\",\n mountRoot: \"root\",\n },\n style: {\n cssModules: true,\n less: { enabled: true, lessOptions: { javascriptEnabled: true } },\n sass: { enabled: true, sassOptions: {} },\n tailwindcss: true,\n },\n router: {\n basename: \"/\",\n conventional: false,\n pagesDir: \"src/pages\",\n exclude: [\n /\\/components?\\//,\n /\\/models\\//,\n /\\/utils?\\//,\n /^_/,\n /\\.d\\.ts$/,\n /\\.(test|spec|e2e)\\.(ts|tsx|js|jsx)$/,\n ],\n },\n microFrontend: {\n enabled: false,\n name: \"app\",\n framework: \"qiankun\",\n },\n performance: {\n rsdoctor: false,\n splitChunks: true,\n dropConsole: false,\n },\n tools: {},\n env: {\n publicEnvFile: \"config/env/.env.public\",\n envDir: \"config/env\",\n },\n alias: {},\n plugins: [],\n};\n","import { existsSync } from \"node:fs\";\nimport { resolve, extname } from \"node:path\";\nimport { pathToFileURL } from \"node:url\";\nimport deepmerge from \"deepmerge\";\nimport { defaultConfig, type YwkfConfig } from \"./schema.js\";\n\n/** 支持的配置文件名 */\nconst CONFIG_FILES = [\n \"ywkf.config.ts\",\n \"ywkf.config.mts\",\n \"ywkf.config.js\",\n \"ywkf.config.mjs\",\n];\n\n/**\n * 查找配置文件\n */\nexport function findConfigFile(cwd: string): string | null {\n for (const file of CONFIG_FILES) {\n const configPath = resolve(cwd, file);\n if (existsSync(configPath)) {\n return configPath;\n }\n }\n return null;\n}\n\n/**\n * 加载 TypeScript 配置文件\n */\nasync function loadTsConfig(configPath: string): Promise<YwkfConfig> {\n const jiti = (await import(\"jiti\")).default;\n const loader = jiti(configPath, {\n interopDefault: true,\n });\n\n const config = loader(configPath);\n return config.default || config;\n}\n\n/**\n * 加载 JavaScript 配置文件\n */\nasync function loadJsConfig(configPath: string): Promise<YwkfConfig> {\n const fileUrl = pathToFileURL(configPath).href;\n const module = await import(fileUrl);\n return module.default || module;\n}\n\n/**\n * 加载配置文件\n */\nexport async function loadConfigFile(configPath: string): Promise<YwkfConfig> {\n const ext = extname(configPath);\n\n if (ext === \".ts\" || ext === \".mts\") {\n return loadTsConfig(configPath);\n }\n\n return loadJsConfig(configPath);\n}\n\n/**\n * 合并配置\n */\nexport function mergeConfig(\n userConfig: YwkfConfig,\n baseConfig: YwkfConfig = defaultConfig\n): Required<YwkfConfig> {\n return deepmerge(baseConfig, userConfig, {\n arrayMerge: (_, sourceArray) => sourceArray,\n }) as Required<YwkfConfig>;\n}\n\n/**\n * 解析并加载完整配置\n * @param cwd 工作目录\n * @returns 合并后的完整配置\n */\nexport async function resolveConfig(cwd: string): Promise<{\n config: Required<YwkfConfig>;\n configPath: string | null;\n}> {\n const configPath = findConfigFile(cwd);\n\n if (!configPath) {\n console.warn(\n \"⚠️ 未找到配置文件 (ywkf.config.ts),使用默认配置\"\n );\n return {\n config: defaultConfig as Required<YwkfConfig>,\n configPath: null,\n };\n }\n\n try {\n const userConfig = await loadConfigFile(configPath);\n const config = mergeConfig(userConfig);\n\n return { config, configPath };\n } catch (error) {\n console.error(\"❌ 配置文件加载失败:\", error);\n throw error;\n }\n}\n\n/**\n * 获取应用路径解析器\n */\nexport function createPathResolver(cwd: string) {\n return {\n resolveApp: (relativePath: string) => resolve(cwd, relativePath),\n cwd,\n };\n}\n"],"mappings":"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","names":[]}
1
+ {"version":3,"sources":["../../src/config/loader.ts","../../src/config/schema.ts"],"sourcesContent":["import { existsSync } from \"node:fs\";\nimport { extname, resolve } from \"node:path\";\nimport { pathToFileURL } from \"node:url\";\nimport deepmerge from \"deepmerge\";\nimport { defaultConfig, type YwkfConfig } from \"./schema.js\";\n\n/** 支持的配置文件名 */\nconst CONFIG_FILES = [\"ywkf.config.ts\", \"ywkf.config.mts\", \"ywkf.config.js\", \"ywkf.config.mjs\"];\n\n/**\n * 查找配置文件\n */\nexport function findConfigFile(cwd: string): string | null {\n for (const file of CONFIG_FILES) {\n const configPath = resolve(cwd, file);\n if (existsSync(configPath)) {\n return configPath;\n }\n }\n return null;\n}\n\n/**\n * 加载 TypeScript 配置文件\n */\nasync function loadTsConfig(configPath: string): Promise<YwkfConfig> {\n const jiti = (await import(\"jiti\")).default;\n const loader = jiti(configPath, {\n interopDefault: true,\n });\n\n const config = loader(configPath);\n return config.default || config;\n}\n\n/**\n * 加载 JavaScript 配置文件\n */\nasync function loadJsConfig(configPath: string): Promise<YwkfConfig> {\n const fileUrl = pathToFileURL(configPath).href;\n const module = await import(fileUrl);\n return module.default || module;\n}\n\n/**\n * 加载配置文件\n */\nexport async function loadConfigFile(configPath: string): Promise<YwkfConfig> {\n const ext = extname(configPath);\n\n if (ext === \".ts\" || ext === \".mts\") {\n return loadTsConfig(configPath);\n }\n\n return loadJsConfig(configPath);\n}\n\n/**\n * 合并配置\n */\nexport function mergeConfig(\n userConfig: YwkfConfig,\n baseConfig: YwkfConfig = defaultConfig,\n): Required<YwkfConfig> {\n return deepmerge(baseConfig, userConfig, {\n arrayMerge: (_, sourceArray) => sourceArray,\n }) as Required<YwkfConfig>;\n}\n\n/**\n * 解析并加载完整配置\n * @param cwd 工作目录\n * @returns 合并后的完整配置\n */\nexport async function resolveConfig(cwd: string): Promise<{\n config: Required<YwkfConfig>;\n configPath: string | null;\n}> {\n const configPath = findConfigFile(cwd);\n\n if (!configPath) {\n console.warn(\"⚠️ 未找到配置文件 (ywkf.config.ts),使用默认配置\");\n return {\n config: defaultConfig as Required<YwkfConfig>,\n configPath: null,\n };\n }\n\n try {\n const userConfig = await loadConfigFile(configPath);\n const config = mergeConfig(userConfig);\n\n return { config, configPath };\n } catch (error) {\n console.error(\"❌ 配置文件加载失败:\", error);\n throw error;\n }\n}\n\n/**\n * 获取应用路径解析器\n */\nexport function createPathResolver(cwd: string) {\n return {\n resolveApp: (relativePath: string) => resolve(cwd, relativePath),\n cwd,\n };\n}\n","import type { Configuration as RspackConfig } from \"@rspack/core\";\nimport type { PluginConfig } from \"../plugin/types.js\";\n\n/**\n * 开发服务器配置\n */\nexport interface DevServerConfig {\n /** 开发服务器端口 */\n port?: number;\n /** 开发服务器主机 */\n host?: string;\n /** 代理配置 */\n proxy?: Record<string, string | object>;\n /** 是否开启 HTTPS */\n https?: boolean;\n}\n\n/**\n * 输出配置\n */\nexport interface OutputConfig {\n /** 输出目录 */\n path?: string;\n /** 公共路径 */\n publicPath?: string;\n /** 是否清理输出目录 */\n clean?: boolean;\n}\n\n/**\n * HTML 配置\n */\nexport interface HtmlConfig {\n /** 页面标题 */\n title?: string;\n /** HTML 模板路径 */\n template?: string;\n /** favicon 路径 */\n favicon?: string;\n /** 挂载根元素 ID */\n mountRoot?: string;\n}\n\n/**\n * 样式配置\n */\nexport interface StyleConfig {\n /** 是否启用 CSS Modules */\n cssModules?: boolean;\n /** Less 配置 */\n less?: {\n /** 是否启用 */\n enabled?: boolean;\n /** Less 选项 */\n lessOptions?: Record<string, unknown>;\n };\n /** Sass 配置 */\n sass?: {\n /** 是否启用 */\n enabled?: boolean;\n /** Sass 选项 */\n sassOptions?: Record<string, unknown>;\n };\n /** 是否启用 TailwindCSS */\n tailwindcss?: boolean;\n}\n\n/**\n * 路由配置\n */\nexport interface RouterConfig {\n /** 路由基础路径 */\n basename?: string;\n /** 是否启用约定式路由 */\n conventional?: boolean;\n /** 约定式路由扫描目录 */\n pagesDir?: string;\n /** 排除的文件/目录模式 */\n exclude?: (string | RegExp)[];\n}\n\n/**\n * 微前端配置\n */\nexport interface MicroFrontendConfig {\n /** 是否启用微前端模式 */\n enabled?: boolean;\n /** 应用名称(用于 UMD 导出) */\n name?: string;\n /** 微前端框架类型 */\n framework?: \"qiankun\" | \"garfish\";\n}\n\n/**\n * 性能配置\n */\nexport interface PerformanceConfig {\n /** 是否启用 Rsdoctor 分析 */\n rsdoctor?: boolean;\n /** 是否开启代码分割 */\n splitChunks?: boolean;\n /** 是否移除 console */\n dropConsole?: boolean;\n}\n\n/**\n * 工具链配置\n */\nexport interface ToolsConfig {\n /**\n * 自定义 Rspack 配置\n * @param config 当前配置\n * @param context 上下文信息\n * @returns 修改后的配置\n */\n rspack?: (\n config: RspackConfig,\n context: { isDev: boolean; isProd: boolean },\n ) => RspackConfig | undefined;\n}\n\n/**\n * 环境变量配置\n */\nexport interface EnvConfig {\n /** 公共环境变量文件路径 */\n publicEnvFile?: string;\n /** 环境特定的变量文件目录 */\n envDir?: string;\n}\n\n/**\n * 框架完整配置\n */\nexport interface YwkfConfig {\n /** 应用名称 */\n appName?: string;\n /** 应用中文名 */\n appCName?: string;\n /** 开发服务器配置 */\n dev?: DevServerConfig;\n /** 输出配置 */\n output?: OutputConfig;\n /** HTML 配置 */\n html?: HtmlConfig;\n /** 样式配置 */\n style?: StyleConfig;\n /** 路由配置 */\n router?: RouterConfig;\n /** 微前端配置 */\n microFrontend?: MicroFrontendConfig;\n /** 性能配置 */\n performance?: PerformanceConfig;\n /** 工具链配置 */\n tools?: ToolsConfig;\n /** 环境变量配置 */\n env?: EnvConfig;\n /** 路径别名 */\n alias?: Record<string, string>;\n /** 插件列表 */\n plugins?: PluginConfig[];\n}\n\n/**\n * 定义配置的辅助函数(提供类型提示)\n */\nexport function defineConfig(config: YwkfConfig): YwkfConfig {\n return config;\n}\n\n/**\n * 默认配置\n */\nexport const defaultConfig: Required<YwkfConfig> = {\n appName: \"app\",\n appCName: \"应用\",\n dev: {\n port: 3000,\n host: \"localhost\",\n proxy: {},\n https: false,\n },\n output: {\n path: \"dist\",\n publicPath: \"/\",\n clean: true,\n },\n html: {\n title: \"应用\",\n template: \"public/index.html\",\n favicon: \"public/favicon.ico\",\n mountRoot: \"root\",\n },\n style: {\n cssModules: true,\n less: { enabled: true, lessOptions: { javascriptEnabled: true } },\n sass: { enabled: true, sassOptions: {} },\n tailwindcss: true,\n },\n router: {\n basename: \"/\",\n conventional: false,\n pagesDir: \"src/pages\",\n exclude: [\n /\\/components?\\//,\n /\\/models\\//,\n /\\/utils?\\//,\n /^_/,\n /\\.d\\.ts$/,\n /\\.(test|spec|e2e)\\.(ts|tsx|js|jsx)$/,\n ],\n },\n microFrontend: {\n enabled: false,\n name: \"app\",\n framework: \"qiankun\",\n },\n performance: {\n rsdoctor: false,\n splitChunks: true,\n dropConsole: false,\n },\n tools: {},\n env: {\n publicEnvFile: \"config/env/.env.public\",\n envDir: \"config/env\",\n },\n alias: {},\n plugins: [],\n};\n"],"mappings":"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","names":[]}
package/dist/index.d.ts CHANGED
@@ -1,15 +1,37 @@
1
- import { G as GeneratorContext, b as PluginHooks, Y as YwkfConfig, c as PluginConfig, e as YwkfPlugin } from './schema-VPH72NAR.js';
2
- export { B as BuildHooks, C as CodeInjection, D as DevServerConfig, E as EnvConfig, j as GeneratedFile, i as GeneratorHooks, H as HtmlConfig, M as MicroFrontendConfig, O as OutputConfig, P as PerformanceConfig, f as PluginContext, R as RouterConfig, g as RouterHooks, h as RuntimeHooks, S as StyleConfig, T as ToolsConfig, a as defaultConfig, d as defineConfig } from './schema-VPH72NAR.js';
3
- export { createBaseConfig, createDevConfig, createProdConfig, createRspackConfig } from './rspack/index.js';
4
- export { ConventionalRouteGenerator, ConventionalRoutePlugin, ConventionalRoutePluginOptions, GeneratorOptions, RouteConfig, generateConventionalRoutes } from './router/index.js';
1
+ import { G as GeneratorContext, b as PluginHooks, Y as YwkfConfig, c as PluginConfig, e as YwkfPlugin } from './schema-CGQSqjRr.js';
2
+ export { B as BuildHooks, C as CodeInjection, D as DevServerConfig, E as EnvConfig, f as GeneratedFile, g as GeneratorHooks, H as HtmlConfig, M as MicroFrontendConfig, O as OutputConfig, P as PerformanceConfig, h as PluginContext, R as RouterConfig, i as RouterHooks, j as RuntimeHooks, S as StyleConfig, T as ToolsConfig, d as defaultConfig, a as defineConfig } from './schema-CGQSqjRr.js';
5
3
  import { Compiler } from '@rspack/core';
6
- export { a as AntdConfig, A as AppConfig, b as AppContextValue, L as LifecycleHooks, M as MicroAppConfig, P as ProviderConfig } from './types-BztKUufh.js';
7
- export { AppContext, AppContextProvider, ErrorBoundary, RootProvider, bootstrap, createMicroApp, createProvider, getMicroAppPublicPath, isMicroAppEnv, unmount, useApp, useAppName, useBasename, useEnv, useIsDev } from './runtime/index.js';
8
4
  export { PluginManager, createPlugin, definePlugin } from './plugin/index.js';
5
+ export { ConventionalRouteGenerator, ConventionalRoutePlugin, ConventionalRoutePluginOptions, GeneratorOptions, RouteConfig, generateConventionalRoutes } from './router/index.js';
6
+ export { createBaseConfig, createDevConfig, createProdConfig, createRspackConfig } from './rspack/index.js';
7
+ export { AppContext, AppContextProvider, ErrorBoundary, RootProvider, bootstrap, createMicroApp, createProvider, getMicroAppPublicPath, isMicroAppEnv, unmount, useApp, useAppName, useBasename, useEnv, useIsDev } from './runtime/index.js';
8
+ export { a as AntdConfig, A as AppConfig, b as AppContextValue, L as LifecycleHooks, M as MicroAppConfig, P as ProviderConfig } from './types-DbUq-VY8.js';
9
9
  import 'react';
10
10
  import 'react-router';
11
11
  import 'react/jsx-runtime';
12
12
 
13
+ /**
14
+ * 执行生产构建
15
+ *
16
+ * @param options.mode - env 文件模式,决定加载 .env.{mode},默认 "production"
17
+ * 例如 --mode staging 会加载 .env.staging,但 NODE_ENV 仍为 "production"
18
+ */
19
+ declare function build(options?: {
20
+ cwd?: string;
21
+ mode?: string;
22
+ }): Promise<void>;
23
+
24
+ /**
25
+ * 启动开发服务器
26
+ *
27
+ * @param options.mode - env 文件模式,决定加载 .env.{mode},默认 "development"
28
+ * 例如 --mode staging 会加载 .env.staging,但 NODE_ENV 仍为 "development"
29
+ */
30
+ declare function dev(options?: {
31
+ cwd?: string;
32
+ mode?: string;
33
+ }): Promise<void>;
34
+
13
35
  /**
14
36
  * .ywkf 目录代码生成器
15
37
  *
@@ -120,6 +142,101 @@ declare class YwkfGeneratorPlugin {
120
142
  private watchConfig;
121
143
  }
122
144
 
145
+ interface AnalyticsPluginOptions {
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
+
123
240
  interface GarfishPluginOptions {
124
241
  /** 应用名称(微前端标识) */
125
242
  appName?: string;
@@ -180,43 +297,6 @@ interface GarfishPluginOptions {
180
297
  */
181
298
  declare const garfishPlugin: (options?: GarfishPluginOptions | undefined) => YwkfPlugin;
182
299
 
183
- interface TailwindPluginOptions {
184
- /**
185
- * 自定义暗色模式选择器
186
- * @default '&:where([data-theme="dark"], [data-theme="dark"] *)'
187
- */
188
- darkModeSelector?: string;
189
- /**
190
- * 是否生成 postcss.config.js(如果不存在)
191
- * @default true
192
- */
193
- autoConfig?: boolean;
194
- /**
195
- * 额外的 CSS 内容(追加到 index.css 之后)
196
- */
197
- extraCSS?: string;
198
- }
199
- /**
200
- * Tailwind CSS 插件
201
- *
202
- * 自动配置 Tailwind CSS:
203
- * - 注入 `@import "tailwindcss"` 到 index.css
204
- * - 确保 postcss.config.js 存在
205
- * - 修改 Rspack 配置添加 postcss-loader
206
- *
207
- * @example
208
- * ```ts
209
- * import { defineConfig, tailwindPlugin } from "@4399ywkf/core";
210
- *
211
- * export default defineConfig({
212
- * plugins: [
213
- * tailwindPlugin(),
214
- * ],
215
- * });
216
- * ```
217
- */
218
- declare const tailwindPlugin: (options?: TailwindPluginOptions | undefined) => YwkfPlugin;
219
-
220
300
  interface I18nPluginOptions {
221
301
  /**
222
302
  * 默认语言
@@ -276,94 +356,6 @@ interface I18nPluginOptions {
276
356
  */
277
357
  declare const i18nPlugin: (options?: I18nPluginOptions | undefined) => YwkfPlugin;
278
358
 
279
- interface ThemePluginOptions {
280
- /**
281
- * 是否启用暗色模式切换能力
282
- * @default true
283
- */
284
- darkMode?: boolean;
285
- /**
286
- * 默认主题模式(运行时可通过 useThemeStore 动态切换)
287
- * @default "light"
288
- */
289
- defaultAppearance?: "light" | "dark" | "auto";
290
- /**
291
- * 主色调(Lobe-UI 命名预设,运行时可通过 useThemeStore 动态切换)
292
- *
293
- * 不设置时使用 Lobe-UI 默认 primary 色阶(黑色系),
294
- * 可选值:"blue" | "cyan" | "geekblue" | "gold" | "green" | "lime"
295
- * | "magenta" | "orange" | "purple" | "red" | "volcano" | "yellow"
296
- *
297
- * @default undefined
298
- */
299
- primaryColor?: string;
300
- /**
301
- * 中性色(Lobe-UI 命名预设)
302
- *
303
- * 可选值:"mauve" | "olive" | "sage" | "sand" | "slate"
304
- *
305
- * @default undefined
306
- */
307
- neutralColor?: string;
308
- /**
309
- * antd 组件前缀
310
- *
311
- * 支持三种配置方式(优先级从高到低):
312
- * 1. 运行时环境变量 process.env.YWKF_PREFIX_CLS
313
- * 2. 插件选项中直接指定
314
- * 3. 默认值 "ant"
315
- *
316
- * @default "ant"
317
- */
318
- prefixCls?: string;
319
- /**
320
- * 是否启用 CSS 变量
321
- * @default true
322
- */
323
- cssVar?: boolean;
324
- /**
325
- * 是否注入全局样式重置
326
- * @default true
327
- */
328
- globalReset?: boolean;
329
- /**
330
- * 是否启用外部主题注入(微前端场景)
331
- *
332
- * 启用后:
333
- * - 应用启动时读取 window.__YWKF_THEME__ 作为初始覆盖
334
- * - 监听 ywkf:theme-change 自定义事件,实现运行时主题同步
335
- *
336
- * @default false
337
- */
338
- externalTheme?: boolean;
339
- }
340
- /**
341
- * 响应式主题系统插件
342
- *
343
- * 基于 antd-style + @4399ywkf/theme-system + Zustand 提供运行时可变的主题管理:
344
- * - 使用 Lobe-UI 色彩体系(13 阶色阶 + 自定义算法)
345
- * - 支持 PrimaryColors / NeutralColors 命名预设
346
- * - 亮/暗色/跟随系统自动切换
347
- * - 支持微前端场景主应用注入主题
348
- *
349
- * @example
350
- * ```ts
351
- * import { defineConfig, themePlugin } from "@4399ywkf/core";
352
- *
353
- * export default defineConfig({
354
- * plugins: [
355
- * themePlugin({
356
- * defaultAppearance: "light",
357
- * primaryColor: "geekblue",
358
- * neutralColor: "slate",
359
- * prefixCls: "my-app",
360
- * }),
361
- * ],
362
- * });
363
- * ```
364
- */
365
- declare const themePlugin: (options?: ThemePluginOptions | undefined) => YwkfPlugin;
366
-
367
359
  interface MockPluginOptions {
368
360
  /** Mock 文件目录 */
369
361
  mockDir?: string;
@@ -406,36 +398,6 @@ interface MockPluginOptions {
406
398
  */
407
399
  declare const mockPlugin: (options?: MockPluginOptions | undefined) => YwkfPlugin;
408
400
 
409
- interface AnalyticsPluginOptions {
410
- /** 是否启用构建分析 */
411
- buildAnalysis?: boolean;
412
- /** 是否输出构建时间 */
413
- timing?: boolean;
414
- /** 是否分析 bundle 大小 */
415
- bundleSize?: boolean;
416
- /** 大文件警告阈值(KB) */
417
- sizeWarningThreshold?: number;
418
- }
419
- /**
420
- * 构建分析插件
421
- *
422
- * @example
423
- * ```ts
424
- * import { analyticsPlugin } from "@4399ywkf/core/plugin";
425
- *
426
- * export default defineConfig({
427
- * plugins: [
428
- * analyticsPlugin({
429
- * timing: true,
430
- * bundleSize: true,
431
- * sizeWarningThreshold: 500, // 500KB
432
- * }),
433
- * ],
434
- * });
435
- * ```
436
- */
437
- declare const analyticsPlugin: (options?: AnalyticsPluginOptions | undefined) => YwkfPlugin;
438
-
439
401
  interface ReactQueryPluginOptions {
440
402
  /**
441
403
  * 默认 staleTime(毫秒)
@@ -489,6 +451,131 @@ interface ReactQueryPluginOptions {
489
451
  */
490
452
  declare const reactQueryPlugin: (options?: ReactQueryPluginOptions | undefined) => YwkfPlugin;
491
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
+ /**
553
+ * 响应式主题系统插件
554
+ *
555
+ * 基于 antd-style + @4399ywkf/theme-system + Zustand 提供运行时可变的主题管理:
556
+ * - 使用 Lobe-UI 色彩体系(13 阶色阶 + 自定义算法)
557
+ * - 支持 PrimaryColors / NeutralColors 命名预设
558
+ * - 亮/暗色/跟随系统自动切换
559
+ * - 支持微前端场景主应用注入主题
560
+ *
561
+ * @example
562
+ * ```ts
563
+ * import { defineConfig, themePlugin } from "@4399ywkf/core";
564
+ *
565
+ * export default defineConfig({
566
+ * plugins: [
567
+ * themePlugin({
568
+ * defaultAppearance: "light",
569
+ * primaryColor: "geekblue",
570
+ * neutralColor: "slate",
571
+ * prefixCls: "my-app",
572
+ * }),
573
+ * ],
574
+ * });
575
+ * ```
576
+ */
577
+ declare const themePlugin: (options?: ThemePluginOptions | undefined) => YwkfPlugin;
578
+
492
579
  interface ZustandPluginOptions {
493
580
  /**
494
581
  * 是否自动生成 store 脚手架(仅在 store/ 目录不存在时)
@@ -524,26 +611,4 @@ interface ZustandPluginOptions {
524
611
  */
525
612
  declare const zustandPlugin: (options?: ZustandPluginOptions | undefined) => YwkfPlugin;
526
613
 
527
- /**
528
- * 启动开发服务器
529
- *
530
- * @param options.mode - env 文件模式,决定加载 .env.{mode},默认 "development"
531
- * 例如 --mode staging 会加载 .env.staging,但 NODE_ENV 仍为 "development"
532
- */
533
- declare function dev(options?: {
534
- cwd?: string;
535
- mode?: string;
536
- }): Promise<void>;
537
-
538
- /**
539
- * 执行生产构建
540
- *
541
- * @param options.mode - env 文件模式,决定加载 .env.{mode},默认 "production"
542
- * 例如 --mode staging 会加载 .env.staging,但 NODE_ENV 仍为 "production"
543
- */
544
- declare function build(options?: {
545
- cwd?: string;
546
- mode?: string;
547
- }): Promise<void>;
548
-
549
- export { type AnalyticsPluginOptions, type GarfishPluginOptions, GeneratorContext, type I18nPluginOptions, type MockPluginOptions, PluginConfig, PluginHooks, type ReactQueryPluginOptions, type TailwindPluginOptions, type ThemePluginOptions, YwkfConfig, YwkfGenerator, YwkfGeneratorPlugin, type YwkfGeneratorPluginOptions, YwkfPlugin, type ZustandPluginOptions, analyticsPlugin, build, dev, garfishPlugin, i18nPlugin, mockPlugin, reactQueryPlugin, tailwindPlugin, themePlugin, zustandPlugin };
614
+ 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 };