@4399ywkf/core 5.3.1 → 5.4.1
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 +34 -30
- package/dist/cli/index.js +152 -101
- package/dist/cli/index.js.map +1 -1
- package/dist/config/index.d.ts +3 -3
- package/dist/config/index.js +120 -75
- package/dist/config/index.js.map +1 -1
- package/dist/index.d.ts +8 -8
- package/dist/index.js +163 -116
- package/dist/index.js.map +1 -1
- package/dist/plugin/index.d.ts +3 -6
- package/dist/plugin/index.js.map +1 -1
- package/dist/router/index.d.ts +20 -20
- package/dist/router/index.js +8 -10
- package/dist/router/index.js.map +1 -1
- package/dist/rspack/index.d.ts +2 -2
- package/dist/rspack/index.js +133 -86
- package/dist/rspack/index.js.map +1 -1
- package/dist/runtime/index.d.ts +17 -17
- package/dist/runtime/index.js +11 -15
- package/dist/runtime/index.js.map +1 -1
- package/dist/{schema-Ade9gA3U.d.ts → schema-BblOKuYl.d.ts} +223 -223
- package/dist/{types-ZJhd87ue.d.ts → types-DZ7Nz9bQ.d.ts} +54 -54
- package/package.json +7 -6
package/dist/config/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { Y as YwkfConfig } from '../schema-
|
|
2
|
-
export { B as BuiltinPluginConfig, D as DevServerConfig, E as EnvConfig, H as HtmlConfig, M as MicroFrontendConfig, O as OptionalPluginConfig, b as OutputConfig, P as PerformanceConfig, R as RouterConfig, S as StyleConfig, T as ToolsConfig, c as YwkfUserConfig, d as defaultConfig, a as defineConfig } from '../schema-
|
|
1
|
+
import { Y as YwkfConfig } from '../schema-BblOKuYl.js';
|
|
2
|
+
export { B as BuiltinPluginConfig, D as DevServerConfig, E as EnvConfig, H as HtmlConfig, M as MicroFrontendConfig, O as OptionalPluginConfig, b as OutputConfig, P as PerformanceConfig, R as RouterConfig, S as StyleConfig, T as ToolsConfig, c as YwkfUserConfig, d as defaultConfig, a as defineConfig } from '../schema-BblOKuYl.js';
|
|
3
3
|
import '@rspack/core';
|
|
4
|
-
import '../types-
|
|
4
|
+
import '../types-DZ7Nz9bQ.js';
|
|
5
5
|
import 'react';
|
|
6
6
|
import 'react-router';
|
|
7
7
|
|
package/dist/config/index.js
CHANGED
|
@@ -142,9 +142,7 @@ var browserCheckPlugin = createPlugin((options = {}) => ({
|
|
|
142
142
|
}
|
|
143
143
|
}
|
|
144
144
|
const minVersions = explicitVersions ? { ...baseVersions, ...explicitVersions } : baseVersions;
|
|
145
|
-
logger.info(
|
|
146
|
-
`\u6D4F\u89C8\u5668\u517C\u5BB9\u6027\u68C0\u67E5\u5DF2\u542F\u7528 (\u7279\u6027\u68C0\u6D4B: ${features.join(", ")})`
|
|
147
|
-
);
|
|
145
|
+
logger.info(`\u6D4F\u89C8\u5668\u517C\u5BB9\u6027\u68C0\u67E5\u5DF2\u542F\u7528 (\u7279\u6027\u68C0\u6D4B: ${features.join(", ")})`);
|
|
148
146
|
logger.info(
|
|
149
147
|
`\u6700\u4F4E\u7248\u672C\u8981\u6C42: Chrome ${minVersions.chrome ?? "\u2014"}, Edge ${minVersions.edge ?? "\u2014"}, Firefox ${minVersions.firefox ?? "\u2014"}, Safari ${minVersions.safari ?? "\u2014"}${fromBrowserslist !== false ? " (\u4ECE browserslist \u8BFB\u53D6)" : ""}`
|
|
150
148
|
);
|
|
@@ -184,7 +182,7 @@ var browserCheckPlugin = createPlugin((options = {}) => ({
|
|
|
184
182
|
const insertIndex = lastImportIndex >= 0 ? lastImportIndex + 1 : 0;
|
|
185
183
|
lines.splice(insertIndex, 0, checkBlock);
|
|
186
184
|
let result = lines.join("\n");
|
|
187
|
-
result = result.
|
|
185
|
+
result = result.replaceAll(
|
|
188
186
|
/(\s*)(await\s+)?runApp\(\);?/g,
|
|
189
187
|
(_, indent, awaitKw) => `${indent}if (__ywkfBrowserOk) { ${awaitKw || ""}runApp(); }`
|
|
190
188
|
);
|
|
@@ -208,37 +206,39 @@ function buildFeatureChecks(features) {
|
|
|
208
206
|
return lines;
|
|
209
207
|
}
|
|
210
208
|
function buildVersionChecks(minVersions) {
|
|
211
|
-
const entries = Object.entries(minVersions).filter(
|
|
212
|
-
([, v]) => v != null
|
|
213
|
-
);
|
|
209
|
+
const entries = Object.entries(minVersions).filter(([, v]) => v != null);
|
|
214
210
|
if (entries.length === 0) return [];
|
|
215
211
|
const lines = ["// UA \u7248\u672C\u68C0\u6D4B", "const ua = navigator.userAgent;"];
|
|
216
212
|
for (const [browser, minVer] of entries) {
|
|
217
213
|
switch (browser) {
|
|
218
|
-
case "chrome":
|
|
214
|
+
case "chrome": {
|
|
219
215
|
lines.push(
|
|
220
216
|
`const chromeMatch = /Chrome\\/(\\d+)/.exec(ua);`,
|
|
221
217
|
`if (chromeMatch && !/Edg\\//.test(ua) && Number(chromeMatch[1]) < ${minVer}) return false;`
|
|
222
218
|
);
|
|
223
219
|
break;
|
|
224
|
-
|
|
220
|
+
}
|
|
221
|
+
case "edge": {
|
|
225
222
|
lines.push(
|
|
226
223
|
`const edgeMatch = /Edg\\/(\\d+)/.exec(ua);`,
|
|
227
224
|
`if (edgeMatch && Number(edgeMatch[1]) < ${minVer}) return false;`
|
|
228
225
|
);
|
|
229
226
|
break;
|
|
230
|
-
|
|
227
|
+
}
|
|
228
|
+
case "firefox": {
|
|
231
229
|
lines.push(
|
|
232
230
|
`const firefoxMatch = /Firefox\\/(\\d+)/.exec(ua);`,
|
|
233
231
|
`if (firefoxMatch && Number(firefoxMatch[1]) < ${minVer}) return false;`
|
|
234
232
|
);
|
|
235
233
|
break;
|
|
236
|
-
|
|
234
|
+
}
|
|
235
|
+
case "safari": {
|
|
237
236
|
lines.push(
|
|
238
237
|
`const safariMatch = /Version\\/(\\d+\\.?\\d*)/.exec(ua);`,
|
|
239
238
|
`if (safariMatch && /Safari/.test(ua) && !/Chrome/.test(ua) && Number(safariMatch[1]) < ${minVer}) return false;`
|
|
240
239
|
);
|
|
241
240
|
break;
|
|
241
|
+
}
|
|
242
242
|
}
|
|
243
243
|
}
|
|
244
244
|
return lines;
|
|
@@ -331,9 +331,9 @@ function readBrowserslistFile(filePath) {
|
|
|
331
331
|
function extractMinVersions(queries) {
|
|
332
332
|
const result = {};
|
|
333
333
|
const expanded = queries.flatMap((q) => q.split(",").map((s) => s.trim()));
|
|
334
|
-
const versionPattern = /^(
|
|
334
|
+
const versionPattern = /^([a-z_]+)\s*(?:(>=?)\s*)?(\d+(?:\.\d+)?)\s*$/i;
|
|
335
335
|
for (const query of expanded) {
|
|
336
|
-
if (/^(not|dead|last|defaults|>?\s*\d+%|unreleased|current)/i.test(query)) {
|
|
336
|
+
if (/^(?:not|dead|last|defaults|>?\s*\d+%|unreleased|current)/i.test(query)) {
|
|
337
337
|
continue;
|
|
338
338
|
}
|
|
339
339
|
const match = versionPattern.exec(query);
|
|
@@ -374,7 +374,7 @@ var garfishPlugin = createPlugin((options = {}) => ({
|
|
|
374
374
|
rspackConfig.devServer = {
|
|
375
375
|
...rspackConfig.devServer,
|
|
376
376
|
headers: {
|
|
377
|
-
...rspackConfig.devServer?.headers
|
|
377
|
+
...rspackConfig.devServer?.headers,
|
|
378
378
|
"Access-Control-Allow-Origin": "*",
|
|
379
379
|
"Access-Control-Allow-Methods": "GET, POST, PUT, DELETE, OPTIONS",
|
|
380
380
|
"Access-Control-Allow-Headers": "*"
|
|
@@ -618,7 +618,7 @@ function scaffoldSourceFiles(cwd, sourceDir, namespaces, logger) {
|
|
|
618
618
|
}
|
|
619
619
|
const indexPath = join3(dir, "index.ts");
|
|
620
620
|
if (!existsSync3(indexPath)) {
|
|
621
|
-
const imports = namespaces.map((ns) => `import ${ns} from
|
|
621
|
+
const imports = namespaces.map((ns) => `import ${ns} from './${ns}';`).join("\n");
|
|
622
622
|
const entries = namespaces.join(",\n ");
|
|
623
623
|
const content = `${imports}
|
|
624
624
|
|
|
@@ -635,19 +635,19 @@ export default resources;
|
|
|
635
635
|
function buildDefaultNsFile(ns) {
|
|
636
636
|
if (ns === "common") {
|
|
637
637
|
return `export default {
|
|
638
|
-
welcome:
|
|
639
|
-
loading:
|
|
640
|
-
confirm:
|
|
641
|
-
cancel:
|
|
642
|
-
save:
|
|
643
|
-
delete:
|
|
644
|
-
edit:
|
|
645
|
-
back:
|
|
638
|
+
welcome: '\u6B22\u8FCE\u4F7F\u7528',
|
|
639
|
+
loading: '\u52A0\u8F7D\u4E2D...',
|
|
640
|
+
confirm: '\u786E\u5B9A',
|
|
641
|
+
cancel: '\u53D6\u6D88',
|
|
642
|
+
save: '\u4FDD\u5B58',
|
|
643
|
+
delete: '\u5220\u9664',
|
|
644
|
+
edit: '\u7F16\u8F91',
|
|
645
|
+
back: '\u8FD4\u56DE',
|
|
646
646
|
} as const;
|
|
647
647
|
`;
|
|
648
648
|
}
|
|
649
649
|
return `export default {
|
|
650
|
-
title:
|
|
650
|
+
title: '${ns}',
|
|
651
651
|
} as const;
|
|
652
652
|
`;
|
|
653
653
|
}
|
|
@@ -655,11 +655,11 @@ function scaffoldResourcesFile(cwd, sourceDir, _namespaces, locales, defaultLoca
|
|
|
655
655
|
const parentDir = join3(cwd, sourceDir, "..");
|
|
656
656
|
const filePath = join3(parentDir, "resources.ts");
|
|
657
657
|
if (existsSync3(filePath)) return;
|
|
658
|
-
const content = `import resources from
|
|
658
|
+
const content = `import type resources from './default';
|
|
659
659
|
|
|
660
|
-
export const DEFAULT_LOCALE =
|
|
660
|
+
export const DEFAULT_LOCALE = '${defaultLocale}';
|
|
661
661
|
|
|
662
|
-
export const SUPPORTED_LOCALES = ${
|
|
662
|
+
export const SUPPORTED_LOCALES = [${locales.map((l) => `'${l}'`).join(", ")}] as const;
|
|
663
663
|
|
|
664
664
|
export type SupportedLocale = (typeof SUPPORTED_LOCALES)[number];
|
|
665
665
|
|
|
@@ -671,7 +671,7 @@ export const normalizeLocale = (locale?: string): SupportedLocale => {
|
|
|
671
671
|
if (!locale) return DEFAULT_LOCALE as SupportedLocale;
|
|
672
672
|
|
|
673
673
|
for (const l of SUPPORTED_LOCALES) {
|
|
674
|
-
if (l.startsWith(locale) || locale.startsWith(l.split(
|
|
674
|
+
if (l.startsWith(locale) || locale.startsWith(l.split('-')[0])) {
|
|
675
675
|
return l;
|
|
676
676
|
}
|
|
677
677
|
}
|
|
@@ -679,11 +679,9 @@ export const normalizeLocale = (locale?: string): SupportedLocale => {
|
|
|
679
679
|
return DEFAULT_LOCALE as SupportedLocale;
|
|
680
680
|
};
|
|
681
681
|
|
|
682
|
-
export const localeOptions =
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
2
|
|
686
|
-
)} as const;
|
|
682
|
+
export const localeOptions = [
|
|
683
|
+
${locales.map((l) => ` { value: '${l}', label: '${getLocaleLabel(l)}' },`).join("\n")}
|
|
684
|
+
] as const;
|
|
687
685
|
`;
|
|
688
686
|
writeFileSync2(filePath, content, "utf-8");
|
|
689
687
|
logger.info(`\u5DF2\u751F\u6210\u7C7B\u578B\u6587\u4EF6: ${sourceDir}/../resources.ts`);
|
|
@@ -702,35 +700,35 @@ function getLocaleLabel(locale) {
|
|
|
702
700
|
"ru-RU": "\u0420\u0443\u0441\u0441\u043A\u0438\u0439",
|
|
703
701
|
"it-IT": "Italiano",
|
|
704
702
|
"vi-VN": "Ti\u1EBFng Vi\u1EC7t",
|
|
705
|
-
ar: "\u0627\u0644\u0639\u0631\u0628\u064A\u0629"
|
|
703
|
+
"ar": "\u0627\u0644\u0639\u0631\u0628\u064A\u0629"
|
|
706
704
|
};
|
|
707
705
|
return map[locale] || locale;
|
|
708
706
|
}
|
|
709
707
|
function scaffoldConvertScript(cwd, sourceDir, localesDir, defaultLocale, logger) {
|
|
710
708
|
const scriptsDir = join3(cwd, "scripts");
|
|
711
|
-
const scriptPath = join3(scriptsDir, "i18n-gen.
|
|
712
|
-
if (existsSync3(scriptPath)) return;
|
|
709
|
+
const scriptPath = join3(scriptsDir, "i18n-gen.cjs");
|
|
710
|
+
if (existsSync3(scriptPath) || existsSync3(join3(scriptsDir, "i18n-gen.js"))) return;
|
|
713
711
|
if (!existsSync3(scriptsDir)) {
|
|
714
712
|
mkdirSync(scriptsDir, { recursive: true });
|
|
715
713
|
}
|
|
716
|
-
const content = `const fs = require(
|
|
717
|
-
const path = require(
|
|
714
|
+
const content = `const fs = require('node:fs');
|
|
715
|
+
const path = require('node:path');
|
|
718
716
|
|
|
719
|
-
const sourceDir = path.join(__dirname,
|
|
720
|
-
const targetDir = path.join(__dirname,
|
|
717
|
+
const sourceDir = path.join(__dirname, '../${sourceDir}');
|
|
718
|
+
const targetDir = path.join(__dirname, '../${localesDir}/${defaultLocale}');
|
|
721
719
|
|
|
722
720
|
const files = fs
|
|
723
721
|
.readdirSync(sourceDir)
|
|
724
|
-
.filter((file) => file.endsWith(
|
|
725
|
-
.map((file) => path.basename(file,
|
|
722
|
+
.filter((file) => file.endsWith('.ts') && file !== 'index.ts')
|
|
723
|
+
.map((file) => path.basename(file, '.ts'));
|
|
726
724
|
|
|
727
|
-
require(
|
|
725
|
+
require('ts-node/register');
|
|
728
726
|
|
|
729
727
|
if (!fs.existsSync(targetDir)) {
|
|
730
728
|
fs.mkdirSync(targetDir, { recursive: true });
|
|
731
729
|
}
|
|
732
730
|
|
|
733
|
-
console.log(
|
|
731
|
+
console.log('\u5F00\u59CB\u8F6C\u6362 TypeScript \u6587\u4EF6\u5230 JSON...\\n');
|
|
734
732
|
|
|
735
733
|
files.forEach((fileName) => {
|
|
736
734
|
try {
|
|
@@ -739,28 +737,28 @@ files.forEach((fileName) => {
|
|
|
739
737
|
const moduleContent = require(modulePath).default;
|
|
740
738
|
const jsonContent = JSON.stringify(moduleContent, null, 2);
|
|
741
739
|
const targetPath = path.join(targetDir, \`\${fileName}.json\`);
|
|
742
|
-
fs.writeFileSync(targetPath, jsonContent,
|
|
740
|
+
fs.writeFileSync(targetPath, jsonContent, 'utf8');
|
|
743
741
|
console.log(\` \${fileName}.ts \u2192 \${fileName}.json\`);
|
|
744
742
|
} catch (error) {
|
|
745
743
|
console.error(\` \u8F6C\u6362 \${fileName}.ts \u5931\u8D25:\`, error.message);
|
|
746
744
|
}
|
|
747
745
|
});
|
|
748
746
|
|
|
749
|
-
console.log(
|
|
747
|
+
console.log('\\n\u8F6C\u6362\u5B8C\u6210\uFF01');
|
|
750
748
|
`;
|
|
751
749
|
writeFileSync2(scriptPath, content, "utf-8");
|
|
752
|
-
logger.info("\u5DF2\u751F\u6210\u8F6C\u6362\u811A\u672C: scripts/i18n-gen.
|
|
750
|
+
logger.info("\u5DF2\u751F\u6210\u8F6C\u6362\u811A\u672C: scripts/i18n-gen.cjs");
|
|
753
751
|
}
|
|
754
752
|
function scaffoldI18nRc(cwd, localesDir, defaultLocale, locales, logger) {
|
|
755
753
|
const filePath = join3(cwd, ".i18nrc.js");
|
|
756
754
|
if (existsSync3(filePath)) return;
|
|
757
|
-
const outputLocales = locales.filter((l) => l !== defaultLocale).map((l) => `
|
|
758
|
-
const content = `const { defineConfig } = require(
|
|
755
|
+
const outputLocales = locales.filter((l) => l !== defaultLocale).map((l) => `'${l}'`).join(", ");
|
|
756
|
+
const content = `const { defineConfig } = require('@4399ywkf/i18n');
|
|
759
757
|
|
|
760
758
|
module.exports = defineConfig({
|
|
761
|
-
entry:
|
|
762
|
-
entryLocale:
|
|
763
|
-
output:
|
|
759
|
+
entry: '${localesDir}/${defaultLocale}',
|
|
760
|
+
entryLocale: '${defaultLocale}',
|
|
761
|
+
output: '${localesDir}',
|
|
764
762
|
outputLocales: [${outputLocales}],
|
|
765
763
|
});
|
|
766
764
|
`;
|
|
@@ -779,15 +777,16 @@ function scaffoldLocaleJsonDirs(cwd, localesDir, locales, defaultLocale, namespa
|
|
|
779
777
|
const filePath = join3(localeDir, `${ns}.json`);
|
|
780
778
|
if (!existsSync3(filePath)) {
|
|
781
779
|
const placeholder = ns === "common" ? JSON.stringify(
|
|
780
|
+
// 键按字母序排列,与 @4399ywkf/lint 的 Prettier(prettier-plugin-sort-json)一致
|
|
782
781
|
{
|
|
783
|
-
|
|
784
|
-
loading: "Loading...",
|
|
785
|
-
confirm: "OK",
|
|
782
|
+
back: "Back",
|
|
786
783
|
cancel: "Cancel",
|
|
787
|
-
|
|
784
|
+
confirm: "OK",
|
|
788
785
|
delete: "Delete",
|
|
789
786
|
edit: "Edit",
|
|
790
|
-
|
|
787
|
+
loading: "Loading...",
|
|
788
|
+
save: "Save",
|
|
789
|
+
welcome: "Welcome"
|
|
791
790
|
},
|
|
792
791
|
null,
|
|
793
792
|
2
|
|
@@ -853,7 +852,7 @@ function scanMockFiles(dir) {
|
|
|
853
852
|
for (const entry of entries) {
|
|
854
853
|
const fullPath = join4(dir, entry);
|
|
855
854
|
const stat = statSync(fullPath);
|
|
856
|
-
if (stat.isFile() && /\.(ts|js|mjs)$/.test(entry)) {
|
|
855
|
+
if (stat.isFile() && /\.(?:ts|js|mjs)$/.test(entry)) {
|
|
857
856
|
files.push(fullPath);
|
|
858
857
|
} else if (stat.isDirectory()) {
|
|
859
858
|
files.push(...scanMockFiles(fullPath));
|
|
@@ -1330,12 +1329,13 @@ function generateThemeProvider(opts) {
|
|
|
1330
1329
|
scopePopupContainer
|
|
1331
1330
|
} = opts;
|
|
1332
1331
|
const isAutoLocale = locale === "auto";
|
|
1333
|
-
const sections = [
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
|
|
1332
|
+
const sections = [
|
|
1333
|
+
`// \u6B64\u6587\u4EF6\u7531 @4399ywkf/plugin-theme v3 \u81EA\u52A8\u751F\u6210\uFF0C\u8BF7\u52FF\u624B\u52A8\u4FEE\u6539`,
|
|
1334
|
+
buildImports({ globalReset, cssVar, scopePopupContainer, locale }),
|
|
1335
|
+
TYPES_CODE,
|
|
1336
|
+
buildStoreCode({ defaultAppearance, primaryColor, neutralColor, locale }),
|
|
1337
|
+
HOOKS_CODE
|
|
1338
|
+
];
|
|
1339
1339
|
if (globalReset) sections.push(GLOBAL_RESET_CODE);
|
|
1340
1340
|
if (cssVar) sections.push(buildCssVarSyncCode());
|
|
1341
1341
|
if (darkMode) sections.push(APPEARANCE_SYNC_CODE);
|
|
@@ -2030,18 +2030,58 @@ export type { StateCreator, StoreApi } from "zustand";
|
|
|
2030
2030
|
|
|
2031
2031
|
// src/config/normalize.ts
|
|
2032
2032
|
var BUILTIN_PLUGINS = [
|
|
2033
|
-
{
|
|
2034
|
-
|
|
2035
|
-
|
|
2033
|
+
{
|
|
2034
|
+
key: "reactQuery",
|
|
2035
|
+
factory: reactQueryPlugin,
|
|
2036
|
+
pluginName: "@4399ywkf/plugin-react-query"
|
|
2037
|
+
},
|
|
2038
|
+
{
|
|
2039
|
+
key: "zustand",
|
|
2040
|
+
factory: zustandPlugin,
|
|
2041
|
+
pluginName: "@4399ywkf/plugin-zustand"
|
|
2042
|
+
},
|
|
2043
|
+
{
|
|
2044
|
+
key: "tailwind",
|
|
2045
|
+
factory: tailwindPlugin,
|
|
2046
|
+
pluginName: "@4399ywkf/plugin-tailwind"
|
|
2047
|
+
}
|
|
2036
2048
|
];
|
|
2037
2049
|
var OPTIONAL_PLUGINS = [
|
|
2038
|
-
{
|
|
2039
|
-
|
|
2040
|
-
|
|
2041
|
-
|
|
2042
|
-
|
|
2043
|
-
{
|
|
2044
|
-
|
|
2050
|
+
{
|
|
2051
|
+
key: "biome",
|
|
2052
|
+
factory: biomePlugin,
|
|
2053
|
+
pluginName: "@4399ywkf/plugin-biome"
|
|
2054
|
+
},
|
|
2055
|
+
{
|
|
2056
|
+
key: "analytics",
|
|
2057
|
+
factory: analyticsPlugin,
|
|
2058
|
+
pluginName: "@4399ywkf/plugin-analytics"
|
|
2059
|
+
},
|
|
2060
|
+
{
|
|
2061
|
+
key: "mock",
|
|
2062
|
+
factory: mockPlugin,
|
|
2063
|
+
pluginName: "@4399ywkf/plugin-mock"
|
|
2064
|
+
},
|
|
2065
|
+
{
|
|
2066
|
+
key: "theme",
|
|
2067
|
+
factory: themePlugin,
|
|
2068
|
+
pluginName: "@4399ywkf/plugin-theme"
|
|
2069
|
+
},
|
|
2070
|
+
{
|
|
2071
|
+
key: "i18n",
|
|
2072
|
+
factory: i18nPlugin,
|
|
2073
|
+
pluginName: "@4399ywkf/plugin-i18n"
|
|
2074
|
+
},
|
|
2075
|
+
{
|
|
2076
|
+
key: "garfish",
|
|
2077
|
+
factory: garfishPlugin,
|
|
2078
|
+
pluginName: "@4399ywkf/plugin-garfish"
|
|
2079
|
+
},
|
|
2080
|
+
{
|
|
2081
|
+
key: "browserCheck",
|
|
2082
|
+
factory: browserCheckPlugin,
|
|
2083
|
+
pluginName: "@4399ywkf/plugin-browser-check"
|
|
2084
|
+
}
|
|
2045
2085
|
];
|
|
2046
2086
|
var ALL_SHORTHAND_KEYS = /* @__PURE__ */ new Set([
|
|
2047
2087
|
...BUILTIN_PLUGINS.map((p) => p.key),
|
|
@@ -2174,7 +2214,12 @@ var defaultConfig = {
|
|
|
2174
2214
|
};
|
|
2175
2215
|
|
|
2176
2216
|
// src/config/loader.ts
|
|
2177
|
-
var CONFIG_FILES = [
|
|
2217
|
+
var CONFIG_FILES = [
|
|
2218
|
+
"ywkf.config.ts",
|
|
2219
|
+
"ywkf.config.mts",
|
|
2220
|
+
"ywkf.config.js",
|
|
2221
|
+
"ywkf.config.mjs"
|
|
2222
|
+
];
|
|
2178
2223
|
function findConfigFile(cwd) {
|
|
2179
2224
|
for (const file of CONFIG_FILES) {
|
|
2180
2225
|
const configPath = resolve2(cwd, file);
|