@ubean/build 0.7.11 → 0.7.13
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.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { _ as defineVirtualModule, a as ssrSingletonProdOptimizeExclude, b as useVirtualRegistry, c as getComponentResolvers, d as registerComponentResolver, f as registerCssImport, g as createVirtualRegistry, h as VirtualModuleRegistry, i as ssrSingletonDevPolicy, l as getCssImports, m as resetModuleRegistry, n as SSR_SINGLETON_OPTIMIZE_EXCLUDE, o as ssrSingletonProdSsr, p as registerHeadScript, r as SSR_SINGLETON_PACKAGES, t as SSR_SINGLETON_DEDUPE, u as getHeadScripts, v as defineVirtualModulePrefix, y as resetVirtualRegistry } from "./ssr-singleton-CD6tSMIE.js";
|
|
2
|
-
import { a as createRoutingVirtualModule, i as createPagesVirtualModule, n as createLocalesVirtualModule, o as stripMacros, r as createMetaVirtualModule, s as transformMacros, t as createAppVirtualModule } from "./virtual-modules-
|
|
2
|
+
import { a as createRoutingVirtualModule, i as createPagesVirtualModule, n as createLocalesVirtualModule, o as stripMacros, r as createMetaVirtualModule, s as transformMacros, t as createAppVirtualModule } from "./virtual-modules-B3EarSb_.js";
|
|
3
3
|
export { SSR_SINGLETON_DEDUPE, SSR_SINGLETON_OPTIMIZE_EXCLUDE, SSR_SINGLETON_PACKAGES, VirtualModuleRegistry, createAppVirtualModule, createLocalesVirtualModule, createMetaVirtualModule, createPagesVirtualModule, createRoutingVirtualModule, createVirtualRegistry, defineVirtualModule, defineVirtualModulePrefix, getComponentResolvers, getCssImports, getHeadScripts, registerComponentResolver, registerCssImport, registerHeadScript, resetModuleRegistry, resetVirtualRegistry, ssrSingletonDevPolicy, ssrSingletonProdOptimizeExclude, ssrSingletonProdSsr, stripMacros, transformMacros, useVirtualRegistry };
|
package/dist/production.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { T as buildWithEnvironments, v as createIslandsSsrStubPlugin, y as generateCloudflareWorkerEntry, b as generateNodeServerEntry, x as generateStandardHandlerEntry, S as generateVirtualModulesToDisk, C as getPresetBuildConfig, w as serializePagesForEntry } from "./vite-
|
|
1
|
+
export { T as buildWithEnvironments, v as createIslandsSsrStubPlugin, y as generateCloudflareWorkerEntry, b as generateNodeServerEntry, x as generateStandardHandlerEntry, S as generateVirtualModulesToDisk, C as getPresetBuildConfig, w as serializePagesForEntry } from "./vite-B8-eK3SO.js";
|
|
@@ -278,6 +278,21 @@ function codesFromConfig() {
|
|
|
278
278
|
return i18nConfig.locales.map(l => typeof l === 'string' ? l : l.code);
|
|
279
279
|
}
|
|
280
280
|
|
|
281
|
+
/** 一条 locale 配置(字符串或对象)→ \`setLocaleMeta()\` 的元信息。 */
|
|
282
|
+
function configLocaleMeta(loc) {
|
|
283
|
+
const cfg = typeof loc === 'string' ? { code: loc } : loc;
|
|
284
|
+
// 默认语言以 \`i18n.defaultLocale\` 为准;\`defaultCode\` 是扫描结果里的
|
|
285
|
+
// “第一个 locale 文件”,仅当配置缺省时才用它(两者并不总是同一个)。
|
|
286
|
+
const defaultLocaleCode = (i18nConfig && i18nConfig.defaultLocale) || defaultCode;
|
|
287
|
+
return {
|
|
288
|
+
name: cfg.name,
|
|
289
|
+
path: cfg.path,
|
|
290
|
+
dir: cfg.dir || 'ltr',
|
|
291
|
+
language: cfg.language,
|
|
292
|
+
isDefault: cfg.code === defaultLocaleCode
|
|
293
|
+
};
|
|
294
|
+
}
|
|
295
|
+
|
|
281
296
|
export const localeCodes = codesFromConfig();
|
|
282
297
|
const defaultCode = ${defaultCode};
|
|
283
298
|
|
|
@@ -289,6 +304,12 @@ if (import.meta.env.SSR) {
|
|
|
289
304
|
} else if (defaultCode) {
|
|
290
305
|
i18nRuntime.setFallbackLocale(defaultCode);
|
|
291
306
|
}
|
|
307
|
+
// 所有配置里的 locale 在模块求值时一次性登记元信息,**不能**等文案被加载才登记:
|
|
308
|
+
// 中间件每请求只加载 \`locale + fallback\`,否则 SSR 首屏的 \`availableLocales\` 只有
|
|
309
|
+
// 一个(语言切换器只剩一项)。\`loadLocale()\` 之后的重复登记是幂等的。
|
|
310
|
+
for (const loc of (i18nConfig && i18nConfig.locales) || []) {
|
|
311
|
+
i18nRuntime.setLocaleMeta(typeof loc === 'string' ? loc : loc.code, configLocaleMeta(loc));
|
|
312
|
+
}
|
|
292
313
|
}
|
|
293
314
|
|
|
294
315
|
async function collectMessages(code) {
|
|
@@ -299,13 +320,7 @@ async function collectMessages(code) {
|
|
|
299
320
|
const configLoc = i18nConfig && i18nConfig.locales
|
|
300
321
|
? i18nConfig.locales.find(l => (typeof l === 'string' ? l : l.code) === code)
|
|
301
322
|
: undefined;
|
|
302
|
-
if (configLoc
|
|
303
|
-
localeData.options.name = configLoc.name;
|
|
304
|
-
localeData.options.path = configLoc.path;
|
|
305
|
-
localeData.options.dir = configLoc.dir || 'ltr';
|
|
306
|
-
localeData.options.language = configLoc.language;
|
|
307
|
-
localeData.options.isDefault = configLoc.code === (i18nConfig && i18nConfig.defaultLocale);
|
|
308
|
-
}
|
|
323
|
+
if (configLoc) Object.assign(localeData.options, configLocaleMeta(configLoc));
|
|
309
324
|
|
|
310
325
|
for (const [path, loader] of Object.entries(localeModules)) {
|
|
311
326
|
const parsed = parseLocalePath(path);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { a as ssrSingletonProdOptimizeExclude, g as createVirtualRegistry, o as ssrSingletonProdSsr, x as __exportAll } from "./ssr-singleton-CD6tSMIE.js";
|
|
2
|
-
import { a as createRoutingVirtualModule, i as createPagesVirtualModule, n as createLocalesVirtualModule, r as createMetaVirtualModule, s as transformMacros, t as createAppVirtualModule } from "./virtual-modules-
|
|
2
|
+
import { a as createRoutingVirtualModule, i as createPagesVirtualModule, n as createLocalesVirtualModule, r as createMetaVirtualModule, s as transformMacros, t as createAppVirtualModule } from "./virtual-modules-B3EarSb_.js";
|
|
3
3
|
import { a as generateOpenApiTypes, i as generateTypes } from "./codegen-DXr2Iq8g.js";
|
|
4
4
|
import { _ as sendWebResponse, a as createServerEntryVirtualModule, d as ensureDevApp, i as createClientEntryVirtualModule, n as ubeanVite, o as createVueAppEntryVirtualModule, r as composeHeadScripts, s as createVuePagesVirtualModule, v as toWebRequest, x as getDevScanCoordinator } from "./vue-MPB6L-fL.js";
|
|
5
5
|
import { createStaticSsgRenderer } from "./static-render.js";
|
package/dist/vite.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { g as createVirtualRegistry } from "./ssr-singleton-CD6tSMIE.js";
|
|
2
2
|
import { A as buildDevSsrRoutes, C as peekDevScanCoordinator, D as resolveDevSecurityHeaders, E as createDevAppReady, O as resolveLocaleVueParam, S as onDevScan, T as createDevApp, _ as sendWebResponse, b as createDevScanCoordinator, c as DEVTOOLS_PASS_THROUGH_PREFIXES, d as ensureDevApp, f as getDevApp, g as ubeanDevRequestPlugin, h as isViteResourceRequest, j as toVueRouterPagePath, k as enhanceDevApp, l as collectDevCssLinks, m as isFrameworkHtmlPage, p as injectStylesheetLinks, u as createUbeanRequestHandlers, v as toWebRequest, w as bootstrapDevApp, x as getDevScanCoordinator, y as DEV_SCAN_DIRS } from "./vue-MPB6L-fL.js";
|
|
3
|
-
import { D as createCloudflarePreviewRunner, E as MINIFLARE_INSTALL_HINT, O as defaultLoadMiniflare, _ as ubeanPreviewPlugin, a as createEnvRunnerTransport, c as getDevWorkerEntrySource, d as attachPreviewMiddleware, f as createPreviewMiddleware, g as sendPreviewStatus, h as sendPreviewFile, i as bridgeEnvRunnerInvokes, k as readCompatibilityDate, l as invalidateDevWorkerModules, m as resolvePreviewFile, n as UBEAN_DEV_ENV_NAME, o as createUbeanDevEnvironmentFactory, p as previewMimeType, r as UbeanDevEnvironment, s as DEV_WORKER_FILE, t as ubeanPlugin, u as writeDevWorkerEntry } from "./vite-
|
|
3
|
+
import { D as createCloudflarePreviewRunner, E as MINIFLARE_INSTALL_HINT, O as defaultLoadMiniflare, _ as ubeanPreviewPlugin, a as createEnvRunnerTransport, c as getDevWorkerEntrySource, d as attachPreviewMiddleware, f as createPreviewMiddleware, g as sendPreviewStatus, h as sendPreviewFile, i as bridgeEnvRunnerInvokes, k as readCompatibilityDate, l as invalidateDevWorkerModules, m as resolvePreviewFile, n as UBEAN_DEV_ENV_NAME, o as createUbeanDevEnvironmentFactory, p as previewMimeType, r as UbeanDevEnvironment, s as DEV_WORKER_FILE, t as ubeanPlugin, u as writeDevWorkerEntry } from "./vite-B8-eK3SO.js";
|
|
4
4
|
export { DEVTOOLS_PASS_THROUGH_PREFIXES, DEV_SCAN_DIRS, DEV_WORKER_FILE, MINIFLARE_INSTALL_HINT, UBEAN_DEV_ENV_NAME, UbeanDevEnvironment, attachPreviewMiddleware, bootstrapDevApp, bridgeEnvRunnerInvokes, buildDevSsrRoutes, collectDevCssLinks, createCloudflarePreviewRunner, createDevApp, createDevAppReady, createDevScanCoordinator, createEnvRunnerTransport, createPreviewMiddleware, createUbeanDevEnvironmentFactory, createUbeanRequestHandlers, createVirtualRegistry, defaultLoadMiniflare, enhanceDevApp, ensureDevApp, getDevApp, getDevScanCoordinator, getDevWorkerEntrySource, injectStylesheetLinks, invalidateDevWorkerModules, isFrameworkHtmlPage, isViteResourceRequest, onDevScan, peekDevScanCoordinator, previewMimeType, readCompatibilityDate, resolveDevSecurityHeaders, resolveLocaleVueParam, resolvePreviewFile, sendPreviewFile, sendPreviewStatus, sendWebResponse, toVueRouterPagePath, toWebRequest, ubeanDevRequestPlugin, ubeanPlugin, ubeanPreviewPlugin, writeDevWorkerEntry };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ubean/build",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.13",
|
|
4
4
|
"description": "Vite plugins, production build, SSG prerender, type codegen, and Server Actions plugin for ubean",
|
|
5
5
|
"files": [
|
|
6
6
|
"dist"
|
|
@@ -49,19 +49,19 @@
|
|
|
49
49
|
},
|
|
50
50
|
"dependencies": {
|
|
51
51
|
"@intlify/unplugin-vue-i18n": "11.2.8",
|
|
52
|
-
"@ubean/app": "0.7.
|
|
53
|
-
"@ubean/client": "0.7.
|
|
54
|
-
"@ubean/config": "0.7.
|
|
55
|
-
"@ubean/i18n": "0.7.
|
|
56
|
-
"@ubean/islands": "0.7.
|
|
57
|
-
"@ubean/markdown": "0.7.
|
|
58
|
-
"@ubean/pages": "0.7.
|
|
59
|
-
"@ubean/preset": "0.7.
|
|
60
|
-
"@ubean/routes": "0.7.
|
|
61
|
-
"@ubean/scan": "0.7.
|
|
62
|
-
"@ubean/server": "0.7.
|
|
63
|
-
"@ubean/shared": "0.7.
|
|
64
|
-
"@ubean/vue": "0.7.
|
|
52
|
+
"@ubean/app": "0.7.13",
|
|
53
|
+
"@ubean/client": "0.7.13",
|
|
54
|
+
"@ubean/config": "0.7.13",
|
|
55
|
+
"@ubean/i18n": "0.7.13",
|
|
56
|
+
"@ubean/islands": "0.7.13",
|
|
57
|
+
"@ubean/markdown": "0.7.13",
|
|
58
|
+
"@ubean/pages": "0.7.13",
|
|
59
|
+
"@ubean/preset": "0.7.13",
|
|
60
|
+
"@ubean/routes": "0.7.13",
|
|
61
|
+
"@ubean/scan": "0.7.13",
|
|
62
|
+
"@ubean/server": "0.7.13",
|
|
63
|
+
"@ubean/shared": "0.7.13",
|
|
64
|
+
"@ubean/vue": "0.7.13",
|
|
65
65
|
"@vitejs/plugin-vue": "^6.0.10",
|
|
66
66
|
"@vitejs/plugin-vue-jsx": "^5.1.6",
|
|
67
67
|
"openapi-typescript": "^7.13.0",
|